var asc_tadv = new Object();

asc_tadv[901] = { above: [ "John 12:1-10", "Proverbs 24:1-22" ], below: [ "James 3:1-12", "Ezra 4-5" ] };
asc_tadv[902] = { above: [ "John 12:11-19", "Proverbs 24:23-34" ], below: [ "James 3:13-18", "Ezra 6" ] };
asc_tadv[903] = { above: [ "John 12:20-36", "Proverbs 25:1-14" ], below: [ "James 4:1-10", "Ezra 7" ] };
asc_tadv[904] = { above: [ "John 12:37-50", "Proverbs 25:15-28" ], below: [ "James 4:11-17", "Ezra 8" ] };

asc_tadv[906] = { above: [ "John 6:22-59", "Proverbs 26:1-16" ], below: [ "James 5:1-6", "Ezra 9" ] };
asc_tadv[907] = { above: [ "John 6:22-59", "Proverbs 26:17-28" ], below: [ "James 5:7-12", "Ezra 10" ] };
asc_tadv[908] = { above: [ "Exodus 16", "Proverbs 27:1-14" ], below: [ "James 5:13-20", "Esther 1" ] };
asc_tadv[909] = { above: [ "1 Kings 17:7-16", "Proverbs 27:15-27" ], below: [ "1 Peter 1:1-9", "Esther 2" ] };
asc_tadv[910] = { above: [ "Matthew 6:5-15", "Proverbs 28:1-14" ], below: [ "1 Peter 1:10-16", "Esther 3-4" ] };
asc_tadv[911] = { above: [ "1 Corinthians 11:23-26", "Revelation 2:17", "Proverbs 28:15-28" ], below: [ "1 Peter 1:17-25", "Esther 5-6" ] };

function asc_todays_readings(today)
{
	var daykey;
	var above;
	var below;
	var readingNum;
	var ref;
	var anytoday = false;
	
	document.write("<div style='padding-top:5px;'><strong>T.R.U.T.H. Adventure</strong></div>");
	
	daykey = (today.getMonth() + 1) * 100 + today.getDate();
	
	if (asc_tadv[daykey])
	{
		if (asc_tadv[daykey].above) anytoday = true;
		if (asc_tadv[daykey].below) anytoday = true;
		
		if (anytoday)
		{
			document.write("Readings for: " + asc_month(today) + "&nbsp;" + asc_day(today));
			document.write("<table width='100%' cellpadding='4'>");
		}
		
		if (asc_tadv[daykey].above)
		{
			document.write("<tr><td style='line-height:150%;'>");
			above = asc_tadv[daykey].above;
			for (readingNum = 0; readingNum < above.length; readingNum++)
			{
				if (readingNum) document.write("<br>");
				ref = above[readingNum];
				document.write("<a target='_blank' href='http://www.biblegateway.com/passage/?search=" + escape(ref)
					+ "&version=31;'>" + ref + "</a>");
			}
			document.write("</td></tr>");
		}
		if (asc_tadv[daykey].below)
		{
			document.write("<tr><td style='border-top:1px dashed gray; line-height:150%;'>");
			below = asc_tadv[daykey].below;
			for (readingNum = 0; readingNum < below.length; readingNum++)
			{
				if (readingNum) document.write("<br>");
				ref = below[readingNum];
				document.write("<a target='_blank' href='http://www.biblegateway.com/passage/?search=" + escape(ref)
					+ "&version=31;'>" + ref + "</a>");
			}
			document.write("</td></tr>");
		}
	}
	
	if (anytoday) document.write("</table>")
	
	document.write("<div style='padding:2px; background-color:#f3dca3;'>&gt;&gt; ");
	document.write("<a href='/pages/page.asp?page_id=91318'>View/Print Monthly Readings</a></div>");
}

function asc_month(today)
{
	var months = ["January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December"];
	return months[today.getMonth()];
}

function asc_day(today)
{
	return today.getDate();
}
