// JavaScript Document
function makeArray(n) {
	this.length = n;
	return this
}

function dateString(twoDate) {
	var theMonth = monthNames[twoDate.getMonth() + 1];
	var theYear = twoDate.getFullYear();
	if (theMonth == 0) 
		hrs=12;
	if (theMonth<=9) 
		theMonth="0"+theMonth;
	return twoDate.getDate();
}
	
function upclock() {
	var dte = new Date();
	var hrs = dte.getHours() + dte.getTimezoneOffset()/60 + 7;
	var min = dte.getMinutes();
	var sec = dte.getSeconds();
	var col = ":";
	var spc = " ";
	var com = ",";
	var apm;
	if (12 < hrs) {
		apm="pm";
		hrs-=12;
		}else {
		apm="am";
	}
	if (hrs == 0)
		hrs=12;
	if (hrs<=9)
		hrs="0"+hrs;
	if (min<=9) 
		min="0"+min;
	if (sec<=9) 
		sec="0"+sec;
	document.getElementById("clock").innerHTML = hrs+col+min+col+sec+spc+apm;
}
monthNames = new makeArray(12);
monthNames[1] = "Jan";
monthNames[2] = "Feb";
monthNames[3] = "Mar";
monthNames[4] = "Apr";
monthNames[5] = "May";
monthNames[6] = "Jun";
monthNames[7] = "Jul";
monthNames[8] = "Aug";
monthNames[9] = "Sep";
monthNames[10] = "Oct";
monthNames[11] = "Nov";
monthNames[12] = "Dec";
document.write('<span id="clock"></span>');
setInterval("upclock()",1000);