	// Client-side reading of computer's clock and setting of greeting
	// Bob Delaney, MPP -- www.bobdelaney.com
	// As of February 1, 2012
	
	var todayObj = new Date();		// Define a Date() object
	var todayTime = "Good ";						// Good morning | afternoon | evening
	var todayDate;						// The spelled-out version of the date
	var todayGreet = null;			// Specific holiday greeting
   var theDay = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
   	"Thursday", "Friday", "Saturday");
	var theMonth = new Array("January", "February", "March", "April", 
		"May", "June", "July", "August", "September", "October", 
		"November", "December");

	// The months go from 0 = Jan to 11 = Dec.
	// Array structure is: [year, month, date, message string]
	// As of January 28, 2012
	var theEvent = new Array (
		[2012,0,1, "Happy New Year"],
		[2012,0,7, "Merry Christmas to our Coptic friends"],
		[2012,0,8, "The Christian Feast Day of the Epiphany"],
		[2012,0,29, "Alzheimer's Walk at Sheridan Mall on Sunday."],
		[2012,0,13, "Lohri diyan vadhaiyan to Sikh friends"],
		[2012,0,23, "Happy Chinese New Year"],
		[2012,0,25, "It is Robert Burns Day"],
		[2012,0,28, "Chinese community Dragon Ball tonight"],
		[2012,0,29, "Alzheimer's Walk at Sheridan Mall on Sunday"],
		[2012,1,1, "Black History Month &amp; International Change-Your-Password Day"],
		[2012,1,2,"It is Groundhog Day today"],
		[2012,1,14,"Happy Valentine's Day &amp; Happy Birthday, Hazel"],
		[2012,1,20,"Family Day in Ontario"],
		[2012,1,21,"Ontario Legislature resumes sitting today"],
		[2012,2,7,"Celebrate the vibrant colours of Holi"],
		[2012,2,10,"Set your clocks back tonight"],
		[2012,2,11,"Daylight Savings Time begins today"],
		[2012,2,15,"Beware the &quot;Ides of March&quot;"],
		[2012,2,17,"Happy St. Patrick's Day"],
		[2012,2,20,"Spring starts today"],
		[2012,3,1,"It's April Fool's Day"],
		[2012,3,6,"It is Good Friday"],
		[2012,3,7,"Passover begins"],
		[2012,3,8,"Happy Easter"],
		[2012,3,9,"Vimy Ridge 94th anniversary"],
		[2012,3,13,"The Sikh culture celebrates Vaiskhi today"],
		[2012,3,14,"Passover ends"],
		[2012,4,13,"It's Mother's Day"],
		[2012,4,21,"Enjoy Victoria Day"],
		[2012,5,2,"It's Bread and Honey weekend"],
		[2012,5,3,"It's Bread and Honey weekend"],
		[2012,5,17,"It's Father's Day"],
		[2012,5,20,"First day of summer"],
		[2012,6,1,"Happy Canada Day"],
		[2012,6,2,"Public holiday for Canada Day"],
		[2012,6,19,"Holy month of Ramadan begins"],
		[2012,7,6,"Simcoe Day Holiday"],
		[2012,7,9,"Janamashtami: birthday of the Hindu Lord Krishna"],
		[2012,7,19,"Eid ul-Fitr Mubarak"],
		[2012,7,22,"Your MPP's birthday"],
		[2012,8,3,"It's Labour Day"],
		[2012,8,17,"It's Rosh Hashanah"],
		[2012,8,22,"Summer has gone for another year"],
		[2012,8,26,"Yom Kippur today"],
		[2012,9,8,"Happy Thankgiving"],
		[2012,9,23,"Celebrating Dussehra with Hindu friends"],
		[2012,9,24,"Eid Ul Adha Mubarak"],
		[2012,9,31,"Happy Halloween"],
		[2012,10,3,"Set the clocks back tonight"],
		[2012,10,11,"It's Remembrance Day"],
		[2012,10,13,"Happy Diwali to Hindus and Sikhs"],
		[2012,10,28,"Birthday celebration of Guru Nanak Dev Sahib-ji"],
		[2012,11,9,"First day of Chanukah"],
		[2012,11,24,"It's Christmas Eve"],
		[2012,11,25,"Merry Christmas"],
		[2012,11,26,"Happy Boxing Day"],
		[2012,11,31,"It's New Year's Eve"]
		)

	// 1. Assemble the Date String
	// a. Calculate the day of the week - Sun =0; Sat =7
	todayDate = theDay[todayObj.getDay()] + " ";

	// b. Calculate month for display - Jan = 0; Dec = 11
	todayDate += theMonth[todayObj.getMonth()] + " ";

	// c. Use getDate() for date and getFullYear() for the year
	// d. Assemble the string: month + " " + date + ", " + year 		
	todayDate += (todayObj.getDate() + ", " + todayObj.getFullYear());

	// 2. Assemble the Good morning | afternoon | evening greeting
	if (todayObj.getHours() < 4) {
		todayTime += "heavens, you're up late";}		// Before 4:00 a.m.
	else if (todayObj.getHours() >= 4 && todayObj.getHours() < 7) {
		todayTime += "morning! You're up early"; }	// 4:00 to 6:59 a.m.
	else if (todayObj.getHours() >= 7 && todayObj.getHours() < 12) {
		todayTime += "morning"; }	// Before noon
	else if (todayObj.getHours() >= 12 && todayObj.getHours() < 18) {
		todayTime += "afternoon"; }	// Between 12 noon and 6:00 p.m.
	else {
		todayTime += "evening"; }	// Between 7:00 p.m. and Midnight

	// 3. Assemble the date-specific message, called todayGreet
	// theEvent elements: [0] = year; [1] = month; [2] = date; [3] = message
	for (var i = 0; i < theEvent.length; i ++) {
		if (todayObj.getFullYear() === theEvent[i][0] &&
			 todayObj.getMonth() === theEvent[i][1] &&
			 todayObj.getDate() === theEvent[i][2])
		{
			todayGreet = theEvent[i][3];
			break;		// Exit Loop
		}	//End If
		else {
			todayGreet = null;
		}
	}	//End For

