// define functions in head. This will allow them to be
// parsed before event handlers are invoked

// Month names ----------------------------------------

function makearray(n) {
	this.length = n
	return this
}
monthname = new makearray(12)
monthname[1] = "January"
monthname[2] = "February"
monthname[3] = "March"
monthname[4] = "April"
monthname[5] = "May"
monthname[6] = "June"
monthname[7] = "July"
monthname[8] = "August"
monthname[9] = "September"
monthname[10] = "October"
monthname[11] = "November"
monthname[12] = "December"

// Day names ------------------------------------------

dayname = new makearray(7)
dayname[1] = "Sunday"
dayname[2] = "Monday"
dayname[3] = "Tuesday"
dayname[4] = "Wednesday"
dayname[5] = "Thursday"
dayname[6] = "Friday"
dayname[7] = "Saturday"

// Returns date string (see format below) -------------

function customdatestring(oneDate) {
var theday = dayname[oneDate.getDay() + 1]
var themonth = monthname[oneDate.getMonth() + 1]
var theyear = oneDate.getYear() + 1900
var thehour = oneDate.getHours();
var themin =  oneDate.getMinutes();
return thehour + ":" + themin + " hours on " +
	   theday + ", " + themonth + " " + oneDate.getDate() + ", " + theyear
//     Thursday   ,_
//                     October_
//                                      22,_
//                                                                 1998
// note that this is structured in the U.S. format & 
// may not be appropriate for the rest of the world.
}

function customUTCdatestring(oneDate) {
var theday = dayname[oneDate.getDay() + 1]
var themonth = monthname[oneDate.getMonth() + 1]
var theyear = oneDate.getYear() + 1900

return theday + ", " + themonth + " " + oneDate.getDate() + ", " + theyear
//     Thursday   ,_
//                     October_
//                                      22,_
//                                                                 1998
// note that this is structured in the U.S. format & 
// may not be appropriate for the rest of the world.
}