
// Arrays holding the references to the days and months.
// You are free to change these into another format or language.

var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var suffix = new Array("th", "st", "nd", "rd");

function addSuffix(str){
str = str.toString().replace(/^[23]?(\d)$/, "$1");
 if(suffix[str]){
  return suffix[str];
 }
   else {
          return suffix[0];
           }
    }

function showDate(){
	var now = new Date(); // Retrieve date
	var tmp = "<span class=\"date\">"; // Start formatting container
	tmp += days[now.getDay()] + ", ";; // Retrieve the day
	tmp += months[now.getMonth()] + " "; // Retrieve the month
	tmp += now.getDate(); // Retrieve the day of the month
	tmp += addSuffix(now.getDate()) + ", "; // Retrieve the suffix
	tmp += now.getFullYear(); // Retrieve the year
	tmp += "</span>"; // End formatting containter
	return tmp;
	}


