//var timerID = null;
//var timerRunning = false;

/*function stopclock()
{
	if(timerRunning)
		clearTimeout(timerID);
	timerRunning = false;
}

function startclock()
{
	stopclock();
	showtime();
}
*/
function showtime()
{
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();

	currentTimeZoneOffsetInHours = now.getTimezoneOffset()/60;

	var timeValue = ((hours < 10) ? "0" : "") + hours;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;

	if ((hours+currentTimeZoneOffsetInHours) >= 24) hours=hours-24;
		var utValue = (((hours+currentTimeZoneOffsetInHours) < 10) ? "0" : "") + (hours+currentTimeZoneOffsetInHours);
	utValue += ((minutes < 10) ? ":0" : ":") + minutes;
	utValue += ((seconds < 10) ? ":0" : ":") + seconds;
	
	taylorValue = retire( now );

	document.getElementById("face").innerHTML = timeValue;
	document.getElementById("ut").innerHTML = utValue;
	document.getElementById("taylor").innerHTML = taylorValue;
	timerID = setTimeout("showtime()",500);
	//timerRunning = true;
}

function retire( now )
{
	var taylorevent = new Date("July 01 2008 11:59:59");
        var taylorseconds =(taylorevent - now) / 1000;
        var taylordays = Math.floor(taylorseconds / 86400);
        var taylorhours = Math.floor((taylorseconds / 3600 - 24*taylordays));
        var taylorminutes = Math.floor(taylorseconds / 60 -  24*60*taylordays - 60*taylorhours);
        var taylorseconds = Math.floor(taylorseconds - 86400*taylordays - 3600*taylorhours - 60*taylorminutes);
        var taylorValue = taylordays + " Days ";
        taylorValue += ((taylorhours < 10) ? "0" : "") + taylorhours + " Hours ";
        taylorValue += ((taylorminutes < 10) ? "0" : "") + taylorminutes + " Minutes ";
        taylorValue += ((taylorseconds < 10) ? "0" : "") + taylorseconds + " Seconds";

	return taylorValue;
}

