var now = new Date();
var timerID = null;
var timerRunning = false;

function stopclock ()
{
	if(timerRunning)clearTimeout(timerID);
	timerRunning = false;
}

function startclock (lng)
{
	now = new Date(lng);
	stopclock();
	showtime();
}

function showtime ()
{
	var year = now.getYear();
	var month = now.getMonth()+1;
	var day = now.getDate();
	var hour24 = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	var dateValue = year + ((month < 10) ? ".0" : ".") + month + ((day < 10) ? ".0" : ".") + day + " ";
	var timeValue = dateValue + hour24 ;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
	document.bsteelForm.timer.value = timeValue;
	timerID = setTimeout("changetime()",1000);
	timerRunning = true;
}

function changetime()
{
	now.setMilliseconds(now.getMilliseconds()+1000);
	showtime();
}