function longMonthArray() {
	this[0] = "01";	this[1] = "02";	this[2] = "03";
	this[3] = "04";	this[4] = "05";	this[5] = "06";
	this[6] = "07";	this[7] = "08";	this[8] = "09";
	this[9] = "10";	this[10] = "11";	this[11] = "12";
        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 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)
{
   shortMonths = new shortMonthArray();
   longMonths = new longMonthArray();
   d = new Date();
   day = d.getDate();
   month = d.getMonth();
	year = d.getYear();
   if (format == 0)
     str = shortMonths[month] +". " + day + ", "+getLongYear(year);
  else if (format == 1)
     str = day + "." + longMonths[month] + "."+getLongYear(year);

  document.writeln(str);
}

function writeDate()
{
   writeDateLong(0);
}

