var tags_before_clock = "<P><font face='geneva, arial, helvetica, sans-seif' size='1' color='#000000'>"
var tags_middle_clock = "<br>"
var tags_after_clock  = "</font></P>"


DaysofWeek = new Array()
  DaysofWeek[0]="Sun"
  DaysofWeek[1]="Mon"
  DaysofWeek[2]="Tue"
  DaysofWeek[3]="Wed"
  DaysofWeek[4]="Thur"
  DaysofWeek[5]="Fri"
  DaysofWeek[6]="Sat"

Months = new Array()
  Months[0]="Jan"
  Months[1]="Feb"
  Months[2]="Mar"
  Months[3]="Apr"
  Months[4]="May"
  Months[5]="Jun"
  Months[6]="Jul"
  Months[7]="Aug"
  Months[8]="Sept"
  Months[9]="Oct"
  Months[10]="Nov"
  Months[11]="Dec"

function upclock(){
	var dte = new Date();
	var hrs = dte.getHours();
	var min = dte.getMinutes();
	var sec = dte.getSeconds();
	var day = DaysofWeek[dte.getDay()]
	var date = dte.getDate()
	var month = Months[dte.getMonth()]
	var year = dte.getFullYear()

	var col = ":";
	var spc = "&nbsp;";
	var com = ",";
	var apm;


	if (12 < hrs) {
		apm="<font size='-1'>pm</font>";
		hrs-=12;
	} else {
		apm="<font size='-1'>am</font>";
	}

	if (hrs == 0) hrs=12;
	if (hrs<=9) hrs="0"+hrs;
	if (min<=9) min="0"+min;
	if (sec<=9) sec="0"+sec;

	clock.innerHTML = tags_before_clock+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+com+spc+date+spc+month+com+spc+year+tags_after_clock;
}

setInterval("upclock()",1000);
