// DATE CALIBRATION
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 today = new Date();
var Year = takeYear(today);
var MonthName = Months[today.getMonth()];  // displays month name
var Month = leadingZero(today.getMonth()+1);  // displays month numerically
var DayName = Days[today.getDay()];  // displays day name
var Day = leadingZero(today.getDate());  // displays date numerically
var Hours = today.getHours();
var ampm = "am";
if (Hours == 0) Hours = 12; // condition to determine if AM or PM
if (Hours > 11)
	ampm = "pm";
if (Hours > 12)
	Hours -= 12;
Hours = leadingZero(Hours);
var Minutes = leadingZero(today.getMinutes());
var Seconds = leadingZero(today.getSeconds());
var inputDate = today.getDate();

function takeYear(theDate)
{
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}

function leadingZero(nr)  // adds a leading zero if number is < 10
{
	if (nr < 10) nr = "0" + nr;
	return nr;
}

function DDtoDay(inputDate)  // adds suffix to date number
{
  var dateString = new Array('','st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st');
  returnDate = '';
  tempDate = parseInt(inputDate);
  if (tempDate >= 1 && tempDate <= 31)
  {
	  returnDate = inputDate + dateString[tempDate];
	}
	return returnDate;
}
// END DATE CALIBRATION

// DOCUMENT URL CALL
var myMsg = 'This page has been printed from: ';
var myPage = document.location;
// END DOCUMENT URL CALL

document.write ("This page was printed " + Month + '/' + Day + '/' + Year + " at " + Hours + ':' + Minutes + ampm + ' from ' + myPage);  // edit string to change display message