/*
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 preloadImages( ) {
	var d=document;
	
	if( d.images ) {
		if( !d.MM_p )
			d.MM_p=new Array( );
		var i,j=d.MM_p.length,a=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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}



function swapImage( pID, pImage ) {
	if( pID.id==null )
		document.getElementById(pID).src = pImage;
	else
		pID.src = pImage;
}



function goBack( ) {
	history.go(-1)
}



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;
}

