function swapImage( pID, pImage ) {
	if( pID.id==null ) {
		document.getElementById(pID).src = pImage;
	} else {
		pID.src = pImage;
	}
}



function goBack( steps ) {
	history.go(steps);
}



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;
}



function nz ( element, nzBG, defaultBG ) {
	if( element.value=='' )
		element.style.backgroundImage='url(images/'+nzBG+'.gif)';
	else
		element.style.backgroundImage='url(images/'+defaultBG+'.gif)';
}