/*	displayDate.js
 * This is a generic date display script modified from last-mod.js, lmdate.js
 * This renders date variables declared within page header.
 * It first checks if a date varible exist on the document:
 *     lmdate = last modified date
 *     crdate = created date
 * If it does, it prints that. If it doesn't, it will try to retrieve
 * the file date on the server.
 */


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;



function checkDate(dateVar) {
	
	if (dateVar) { 
		noDate = 0;		// Date exists
	} else 
	if (!dateVar) { 
		noDate = 1 ;	// Date does not exist
	}
	
}


function displayDate(datevar) {
   
   checkDate(datevar);

   if (noDate==1) {
		document.write("");
		return;
	}

   var mod1 = new Date(Date.parse(datevar));
	
	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

   document.write(mod2);

}


