// Setup link to USCCB Lectionary text for 
// the upcoming Sunday's readings

function make_sunday_link()
{
	sunday = new Date						// get current date

	// if day of week is not Sunday set time to next Sunday
	Wday = sunday.getDay()					// get day of the week
	if (Wday !=0) {							// if not already Sunday
		now = sunday.getTime()				// get current time
		msperday  = 1000 * 60 * 60 * 24		
		sunday.setTime (now + (7 - Wday) * msperday)	// set to Sunday
	}

	// break the date into its components
	Mon = sunday.getMonth() + 1
	Day = sunday.getDate()
	Yr  = sunday.getFullYear() - 2000
	// pad with leading zeros if necessary
	if (Mon <= 9) Mon = "0" + Mon
	if (Day <= 9) Day = "0" + Day
	if (Yr <= 9)  Yr  = "0" + Yr
	// show link to Sunday's readings
	document.write ("<div style=\"text-align: center; font-family: lucida handwriting; font-weight: bold;\">")
	document.write ("<a href=\"http://www.usccb.org/bible/readings/" + Mon + Day + Yr + ".cfm\">Sunday's Readings</a><br>")
//	document.write ("Next Week's Theme: Just testing<br>")
	document.write ("</div>")
}

