



function longMonthArray() {
	this[0] = "January";	this[1] = "February";	this[2] = "March";
	this[3] = "April";	this[4] = "May";	this[5] = "June";
	this[6] = "July";	this[7] = "August";	this[8] = "September";
	this[9] = "October";	this[10] = "November";	this[11] = "December";
        return (this);
}

function shortMonthArray() {
	this[0] = "Jan";	this[1] = "Feb";	this[2] = "Mar";
	this[3] = "Apr";	this[4] = "May";	this[5] = "Jun";
	this[6] = "Jul";	this[7] = "Aug";	this[8] = "Sep";
	this[9] = "Oct";	this[10] = "Nov";	this[11] = "Dec";
        return (this);
}

function longDayArray() {
	this[0] = "Sunday";	this[1] = "Monday";	this[2] = "Tuesday";
	this[3] = "Wednesday";	this[4] = "Thursday";	this[5] = "Friday";
	this[6] = "Saturday";
        return (this);
}

function shortDayArray() {
	this[0] = "Sun"; this[1] = "Mon"; this[2] = "Tue"; this[3] = "Wed";
	this[4] = "Thu"; this[5] = "Fri"; this[6] = "Sat";
        return (this);
}

function getShortYear(year)
{
shortyear =  year%100;
     if (shortyear < 10) shortyear = "0"+shortyear;
	return shortyear
}

function getLongYear(year)
{
  if (year > 1900) return year
  return year+1900;
}

function writeDateLong(format)
{
   shortDays = new shortDayArray();
   longDays = new longDayArray();
   shortMonths = new shortMonthArray();
   longMonths = new longMonthArray();
   d = new Date();
   day = d.getDate();
   month = d.getMonth();
	year = d.getYear();
   if (format == 0)
     str = longMonths[month];
  
  else if (format == 2)
     str = longDays[d.getDay()] + " " + longMonths[month] + " " + day + ", "+getLongYear(year);
  
  document.writeln(str);
}

function writeDate()
{
   writeDateLong(2);
}

function writemonth()
{
   writeDateLong(0);
}



