	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
	function init ()
	{
	  timeDisplay = document.createTextNode ( "" );
	  document.getElementById("clock").appendChild ( timeDisplay );
	}
	function updateClock ()
	{
		var currentTime = new Date ( );
		var year=currentTime.getYear()
		if (year < 1000)
		year+=1900
		var day=currentTime.getDay()
		var month=currentTime.getMonth()
		var daym=currentTime.getDate()
		if (daym<10)
		daym="0"+daym
		var currentHours = currentTime.getHours ( );
		var currentMinutes = currentTime.getMinutes ( );
		var currentSeconds = currentTime.getSeconds ( );
		// Pad the minutes and seconds with leading zeros, if required
		currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
		currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
		// Choose either "AM" or "PM" as appropriate
		var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
		// Convert the hours component to 12-hour format if needed
		currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
		// Convert an hours component of "0" to "12"
		currentHours = ( currentHours == 0 ) ? 12 : currentHours;
		// Compose the string for display
		var currentTimeString = dayarray[day]+", "+montharray[month]+" "+daym+" "+year+" | "+currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
		// Update the time display
		document.getElementById("clock").firstChild.nodeValue = currentTimeString;
	}
