//This function prints date and time on page.
function printDateAndTime() {
	// Get today's current date.
	var now = new Date();

	// Array list of days.
	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

	// Array list of months.
	var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

	// Calculate the number of the current day in the week.
	var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

	// Join it all together
	today =  days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " +  (fourdigits(now.getYear())) ;

	// Print out the data.

	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	var ampm = "AM"

	if (hours>12) {
		hours=hours-12;
		ampm ="PM"
	}

	if (minutes<10) {
		document.write(" " +today+ "  " + hours + ":0" + minutes + " " +ampm);
	} else {
		document.write("" +today+ "  " + hours + ":" + minutes + " " +ampm);
	}

}

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
}


