/*
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
*/

function swapImage( pID, pImage ) {
	if( pID.id==null )
		document.getElementById(pID).src = pImage;
	else
		pID.src = pImage;
}



function goBack( ) {
	history.go(-1)
}



function displayCurrentDate( ) {
	var arrMonthNames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
	var currentDate = new Date( );
	
	var currentDay = currentDate.getDate( );
	var currentMonth = currentDate.getMonth( );
	var currentYear = currentDate.getFullYear( );
	
	// Compose the string for display
	document.getElementById("today").firstChild.nodeValue = arrMonthNames[currentMonth] + " " + currentDay + ", " + currentYear;
}



function updateClock ( ){
  var currentTime = new Date( );

  var currentHours = currentTime.getHours( );
  var currentMinutes = currentTime.getMinutes( );
  var currentSeconds = currentTime.getSeconds( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes<10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds<10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours<12 ) ? "AM" : "PM";
  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours>12 ) ? currentHours - 12 : currentHours;
  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
	document.getElementById("clock").firstChild.nodeValue = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
}

