// Display the current non-GMT-based date
//
// Assumes the following date formats...
//
// Netscape: Wed, 30 Apr 2003 15:35:13 GMT 
// Netscape: Thu, 01 May 2003 15:38:08 GMT
// Explorer: Wed, 30 Apr 2003 15:36:10 UTC 
// Explorer: Thu, 1 May 2003 15:37:32 UTC 

function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"

dayNames = new MakeArray(7)
dayNames[1] = "Sunday"
dayNames[2] = "Monday"
dayNames[3] = "Tuesday"
dayNames[4] = "Wednesday"
dayNames[5] = "Thursday"
dayNames[6] = "Friday"
dayNames[7] = "Saturday"

function customDateString(oneDate) {
	var theDay = dayNames[oneDate.getDay() + 1]
	var theMonth = monthNames[oneDate.getMonth() + 1]

// this method didn't work with Netscape 7.0
//	var theYear = oneDate.getYear()
//	theYear += (theYear < 100) ? 1900 : 0

// ...but this one did...

//	theDate = new Date();
//	var yearLocation=12;
//	if ((theDate.getDate() < 10) & (navigator.appName == "Microsoft Internet Explorer")) {
//		yearLocation=yearLocation-1
//	}
//	var theGMTYear = theDate.toGMTString();
//	var theYear = theGMTYear.substring(yearLocation,yearLocation+5);

// but IE had trouble in the last few hours before the end 
// of the month due to GMT issues (my mistake)

// so I decided to sniff the browser and let the dice roll

if (navigator.appName == "Microsoft Internet Explorer") {
	var theYear = oneDate.getYear()
	} else {
	var theYear = oneDate.getYear() + 1900
	}

	return theDay + ", " + theMonth + " " + oneDate.getDate() + ", " + theYear
}

document.write(customDateString(new Date()));

// EOF
