var firstCall = 1;

function setDT() {

	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");

	var now = new Date();
	var year = now.getYear();
	var month = now.getMonth();
	var day = now.getDay();
	var date = now.getDate()
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	if (year < 1000){year += 1900};
		var dn = "AM";
	if (hours >= 12) {
		dn = "PM";
		hours = hours - 12;
	}
	if (hours == 0) {hours = 12}
	if (minutes <= 9) {minutes = "0" + minutes}
	if (seconds <= 9) {seconds = "0" + seconds}
	var thistime = dayarray[day];
	thistime += ", " + montharray[month];
	thistime += " " + date;
	thistime += " " + year;
	thistime += ", " + hours;
	thistime += ":" + minutes;
	thistime += ":" + seconds;
	thistime += " " + dn;

	if (firstCall) {
		if (document.getElementById) {
  			clockNode = document.getElementById('clock');
		}
  		else if (document.all) {
			clockNode = document.all['clock'];
		}
		firstCall = 0;
	}
	clockNode.innerHTML = thistime;

	setTimeout("setDT()", 1000)

	}

	window.onload = setDT;
