

function tick()
{

	// create a new Date Object
	var now = new Date();

	// extract the current hours, minutes and seconds
	var hh = now.getHours();
	var mn = now.getMinutes();
	var ss = now.getSeconds();

	// ensure each components has two digits
	if( hh <= 9 ) hh = "0" + hh;
	if( mn <= 9 ) mn = "0" + mn;
	if( ss <= 9 ) ss = "0" + ss;

	// assign the current time string to the form field
	document.forms.f.clock.value = hh+ ": " +mn+ ": " +ss;

	// set the interval to one second
	window.setTimeout( "tick()", 1000 );
}




