var mysteries= [
	["Joyful Mysteries",
	"The Annunciation",
	"The Visitation",
	"The Birth of Our Lord",
	"The Presentation in the Temple",
	"The Finding of Jesus in the Temple"],
	["Sorrowful Mysteries",
	"The agony in the garden",
	"The scourging at the pillar",
	"The crowning with thorns",
	"The carrying of the cross",
	"The crucifixion"],
	["Glorious Mysteries",
	"The Resurrection",
	"The Ascension",
	"The descent of the Holy Spirit",
	"The Assumption",
	"The crowning of Our Lady Queen of Heaven"],
	["Luminous Mysteries",
	"The Baptism in the Jordan",
	"The wedding feast of Cana",
	"The proclamation of the kingdom of God",
	"The Transfiguration",
	"The institution of the Eucharist"]
	];

var seasons= [
	["20031225","20040111","Christmas","0"],
	["20040112","20040224","Ordinary Time",0],
	["20040225","20040407","Lent",1],
	["20040408","20040530","Easter",2],
	["20040531","20041127","Ordinary Time",2],
	["20041128","20041224","Advent",0],
	["20041225","20050106","Christmas",0]
	];

function showMysteries() {
	var CurDate=new Date();
	var day = CurDate.getDate();
	  if (day < 10)
	  {
	  day = "0" + day;
	  }
	var month = CurDate.getMonth();
	month = month + 1;
	  if (month < 10)
	  {
	  month = "0" + month;
	  }
	var year = CurDate.getYear();
	if (year > 99 && year < 2000) { year = year + 1900; }
	var curDT = "" + year + month + day;
	var CurDay = CurDate.getDay();
	var Mystery;
	var MDay;
	if (CurDay == 0) {
		for (var i=0; i<seasons.length; i++) {
			if (seasons[i][0] <= curDT && curDT <= seasons[i][1])
				{Mystery = seasons[i][3]; MDay = "Sunday - "+ seasons[i][2]}
		}
	}
	else if (CurDay == 1) {Mystery = 0; MDay = "Monday"}
	else if (CurDay == 2) {Mystery = 1; MDay = "Tuesday"}
	else if (CurDay == 3) {Mystery = 2; MDay = "Wednesday"}
	else if (CurDay == 4) {Mystery = 3; MDay = "Thursday"}
	else if (CurDay == 5) {Mystery = 1; MDay = "Friday"}
	else if (CurDay == 6) {Mystery = 0; MDay = "Saturday"}
	document.writeln('<br><b>' +MDay + ' - ' + mysteries[Mystery][0] + '</b><ol>');
	document.writeln('<li>' + mysteries[Mystery][1]);
	document.writeln('<li>' + mysteries[Mystery][2]);
	document.writeln('<li>' + mysteries[Mystery][3]);
	document.writeln('<li>' + mysteries[Mystery][4]);
	document.writeln('<li>' + mysteries[Mystery][5]);
	document.writeln('</ol>');
}
