<!--
/********************************************************
 * SCRIPT NAME:  datetime.js				*
 * PURPOSE:      JAVASCRIPT FUNCTIONS FOR DISPLAYING	*
 *               DATES AND TIME				*
 * AUTHOR:       ANTHONY SURALTA			*
 * CREATED:      APRIL 6, 2000				*
 ********************************************************/

// DECLARE VARIABLES
now = new Date;
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();


// DISPLAY THE HOUR
function showTheHours(theHour) {
	if (theHour > 0 && theHour < 13) {
		if (theHour == "0") theHour = 12;
			return (theHour);
		}
		if (theHour == 0) {
			return (12);
		}
	return (theHour-12);
}


// IF INTEGER IS LESS THAN ZERO
// PAD WITH 0 IN FRONT OF THE
// INTEGER
function showZeroFilled(inValue) {
	if (inValue > 9) {
		return "" + inValue;
	}
	return "0" + inValue;
}


// SHOWS AM/PM TIME
function showAmPm() {
	if (now.getHours() < 12) {
		return (" am");
	}
	return (" pm");
}


// DISPLAY DATE AND TIME
if (year < 2000)
	year = year + 1900; // http://onyx.idbsu.edu/~ipowell
	document.write(lmonth + " ");
	document.write(date + ", " + year + " ");
	document.write(showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + showAmPm());

//-->