// JavaScript Document

function jsdate()
{	
	today=new Date(); // Initialize Date in raw form
	date=today.getDate(); // Get the numerical date
	year=today.getYear(); // Get the year
	day = today.getDay(); // Get the day in number form (0,1,2,3,etc.)
	month=today.getMonth()+1; // Get the month
	
	// Make day number value correspond to actual day name
	var dayName=new Array(7)
	dayName[0]="SUNDAY";
	dayName[1]="MONDAY";
	dayName[2]="TUESDAY";
	dayName[3]="WEDNESDAY";
	dayName[4]="THURSDAY";
	dayName[5]="FRIDAY";
	dayName[6]="SATURDAY";
	
	// Add suffix to date (1st, 2nd, 4th, etc.)
	/*if (date==1) suffix=("st");
	else if (date==2) suffix=("nd");
	else if (date==3) suffix=("rd");
	else if (date==21) suffix=("st");
	else if (date==22) suffix=("nd");
	else if (date==23) suffix=("rd");
	else if (date==31) suffix=("st");
	else suffix=("th");*/
	suffix = ("");
	
	// Make month number correspond to month name
	if (month==1) monthName=("JANUARY");
	else if (month==2) monthName=("FEBRUARY");
	else if (month==3) monthName=("MARCH");
	else if (month==4) monthName=("APRIL");
	else if (month==5) monthName=("MAY");
	else if (month==6) monthName=("JUNE");
	else if (month==7) monthName=("JULY");
	else if (month==8) monthName=("AUGUST");
	else if (month==9) monthName=("SEPTEMBER");
	else if (month==10) monthName=("OCTOBER");
	else if (month==11) monthName=("NOVEMBER");
	else monthName=("DECEMBER");
	
	
	if (year < 1900) 
	{
		year += 1900;
	}
	
	// Write date
	document.write(dayName[day] + ", " + monthName + " " + date + suffix + ", " + year);
	
}
