function local_date() {
 date = new Date();

   var day_number = date.getDay();
   var todays_date = date.getDate();
   var month_number = date.getMonth();
   var year = date.getYear();
   var lyear = '';	
   var day_name = '';
   var month_name = ''

   if (year >= 2000){var lyear = year;}
   if (year < 2000){var lyear = 1900 + year;}

   if(day_number == 0){day_name = 'Sunday';}
   if(day_number == 1){day_name = 'Monday';}
   if(day_number == 2){day_name = 'Tuesday';}
   if(day_number == 3){day_name = 'Wednesday';}
   if(day_number == 4){day_name = 'Thursday';}
   if(day_number == 5){day_name = 'Friday';}
   if(day_number == 6){day_name = 'Saturday';}

if(month_number == 0){month_name = 'January';}
   if(month_number == 1){month_name = 'February';}
   if(month_number == 2){month_name = 'March';}
   if(month_number == 3){month_name = 'April';}
   if(month_number == 4){month_name = 'May';} 
   if(month_number == 5){month_name = 'June';}
   if(month_number == 6){month_name = 'July';}
   if(month_number == 7){month_name = 'August';}
   if(month_number == 8){month_name = 'September';}
   if(month_number == 9){month_name = 'October';}
   if(month_number == 10){month_name = 'November';}
   if(month_number == 11){month_name ='December';}

if(todays_date == 1){dtype = "st";}
if(todays_date == 2){dtype = "nd";}
if(todays_date == 3){dtype = "rd";}
if(todays_date == 4){dtype = "th";}
if(todays_date == 5){dtype = "th";}
if(todays_date == 6){dtype = "th";}
if(todays_date == 7){dtype = "th";}
if(todays_date == 8){dtype = "th";}
if(todays_date == 9){dtype = "th";}
if(todays_date == 10){dtype = "th";}
if(todays_date == 11){dtype = "th";}
if(todays_date == 12){dtype = "th";}
if(todays_date == 13){dtype = "th";}
if(todays_date == 14){dtype = "th";}
if(todays_date == 15){dtype = "th";}
if(todays_date == 16){dtype = "th";}
if(todays_date == 17){dtype = "th";}
if(todays_date == 18){dtype = "th";}
if(todays_date == 19){dtype = "th";}
if(todays_date == 20){dtype = "th";}
if(todays_date == 21){dtype = "st";}
if(todays_date == 22){dtype = "nd";}
if(todays_date == 23){dtype = "rd";}
if(todays_date == 24){dtype = "th";}
if(todays_date == 25){dtype = "th";}
if(todays_date == 26){dtype = "th";}
if(todays_date == 27){dtype = "th";}
if(todays_date == 28){dtype = "th";}
if(todays_date == 29){dtype = "th";}
if(todays_date == 30){dtype = "th";}
if(todays_date == 31){dtype = "st";}

var dateline = day_name + ' ' + todays_date + dtype + ' ' + month_name;	
document.write(dateline);
}
