﻿// JScript File

function showTime()
{
	if(timerTime)
	{
		clearTimeout(timerTime);
		timerTime = null;
	}
	
	nowMillis += 1000;
	now.setTime(nowMillis);
	
	var h = now.getHours();
	var m = now.getMinutes();
	var s = now.getSeconds();
	
	var sh = h < 10 ? "0" + h : h;
	var sm = m < 10 ? "0" + m : m;
	var ss = s < 10 ? "0" + s : s;
	
	clock.value = sh + ":" + sm + ":" + ss;	
	timerTime = setTimeout("showTime()", 1000);
}
function sync()
{
	nowMillis = now.getTime();
	showTime();
}
var timerTime = null;
var nowMillis = 0;