/*	lmdate.js
 * Modified version of last-mod.js
 * to account for the server not returning file information.
 * It first checks if a last-modified date (lmdate) exist on the document.
 * If it does, it prints that. If it doesn't, it will try to retrieve
 * the file date on the server.
 *	This version generates the month and only the 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 nodate = 0;

if (lmdate) { 
	var mod1 = new Date(Date.parse(lmdate));		// Check if document has specified modified date
} else if (!lmdate){
	nodate = 1 ;										// No document date available
}

/*
if (lmdate) { 
	var mod1 = new Date(Date.parse(lmdate));		// Check if document has specified modified date
} else {
	var mod1 = new Date(document.lastModified);	// If not, retreive file date from server.
}
*/

var modCheck = Date.parse(mod1);					//  convert modified string to date

var month = months[mod1.getMonth() +1];			//  get Month
var day	= mod1.getDate();							//  get Day
var year = mod1.getYear();							//  get Year

if (year < 2000)										//  fix for 0000 year
	year += 1900;

var mod2 = month + " " + day + ", " + year;		// Format date display

if (nodate == 1) {									// Temporarily disable date display
} else if (month==null) {							// Fix for Apple Safari beta browser - display date string
	document.write(lmdate);
} else {
	document.write(mod2);							// If all is well, display formatted Date object
}
