//// JavaScript Code To Mark When A HTML-Document Was Last Updated ////
/////////////  Copyright 1999-2000 Robert Vigliano  ///////////////////
//===================================================================//
///// Instructions: Download this file (lastUpdated.js) and ///////////
///// put it in your web-site's root-directory, then add the //////////
///// following code to your HTML-page where you want to mark /////////
///// when your page was last updated:
/////
///// <SCRIPT SRC="lastUpdated.js">
///// </SCRIPT>
/////
///// (The above assumes the HTML-page is in the same directory as this
///// js-file).  The result will show the date and time (Greenwich Mean
///// Time-Zone, AM/PM format) your document was last updated, such as:
///// 
///// "Last Updated on June 13, 1999 - 8:35 PM GMT"
/////
///// Look at the comments below on how to convert to your time-zone.
//===================================================================//
var modDate = new Date(document.lastModified);
function getCalendarMonth(dateVar) {
	var dateMo = dateVar.getMonth()
	var aryMonth = new Array(11)
	aryMonth[0] = "January"
	aryMonth[1] = "February"
	aryMonth[2] = "March"
	aryMonth[3] = "April"
	aryMonth[4] = "May"
	aryMonth[5] = "June"
	aryMonth[6] = "July"
	aryMonth[7] = "August"
	aryMonth[8] = "September"
	aryMonth[9] = "October"
	aryMonth[10] = "November"
	aryMonth[11] = "December"
	return aryMonth[dateMo]
}
var modMonth = getCalendarMonth(modDate);
var modDay = modDate.getDate();
var modYear = modDate.getYear();

//-- Internet Explorer only displays 2-digit years from JavaScript
//-- for 20th-century dates, i.e. "99" for 1999 (21st century dates are 4-digit)
//-- if current browser is IE, and year is 1999 or less, then make 4-digit
var browser = navigator.appName;
if (browser = "Microsoft Internet Explorer") {
	if (modYear < 2000) {
		modYear = modYear += 1900
	}
}

function getShortTime(dateVar) {
	var tHour = dateVar.getHours()
	var tMin = dateVar.getMinutes()
	if (tMin <= 9) {
		//single-digit minute - add leading zero
		tMin = "0" + tMin
	}
	var tSuffix = "AM"
	if (tHour >= 12) {
		// change from AM to PM
		tSuffix = "PM"
	}
	if (tHour == 0) {
		// 12 midnight
		tHour = 12
	}
	else {
		// convert hour to PM-format
		if (tHour >= 13) {
			tHour = tHour -= 12
		}
		else {
			tHour = tHour
		}
	}
	return tHour + ":" + tMin + " " + tSuffix + " EST"
}
var modTime = getShortTime(modDate);
function dateLastUpdated() {
	var dateUpdate = modMonth + " " + modDay + ", " + modYear + " - " + modTime
	return "Last Updated on " + dateUpdate
}
document.write(dateLastUpdated())
