
var dateObj;
var systemClock;
var currentTime;

function setDate(serverTime, clockLabel)
{
	// the server string is passed in in the fallowing format "MMMM dd, yyyy hh:mm:ss tt"
	dateObj = new Date(serverTime);
	// set the system clock label gets grabbed here
	systemClock = document.getElementById(clockLabel);
	currentTime = document.getElementById("lblCurrentTime");
}
function runClock()
{
	// figure out the time since conception (aka time elapsed since 1/1/1970 GMT) and add a second 
	// (1 second = 1000 miliseconds)
	var miliSecondsSinceConception = dateObj.getTime() + 1000;
	dateObj.setTime(miliSecondsSinceConception);
	
	//display the time
	systemClock.innerHTML = dateObj.toLocaleString();

	if(currentTime)
		currentTime.innerHTML = dateObj.toLocaleString();
		
	setTimeout("runClock()", 1000);
}
