// $Id$
// Copyright (C) 2004 OKAMURA Yuji, All right reserved.

function WriteInetTime2Elmt(elmtID) {
	if (!document.getElementById) {
		return false;
	}

	var elmt = document.getElementById(elmtID);
	var	now = new Date();
	var	swt = new Date();
	var	inet;
	var	html = '@';

	swt.setTime(now.getTime() + (now.getTimezoneOffset() + 60 ) * 60 * 1000);
	inet = Math.floor((swt.getHours() * 60 * 60 + swt.getMinutes() * 60 + swt.getSeconds()) * 10 / 864);

	if (inet < 100 ) {
		html += '0';
	}
	if (inet < 10 ) {
		html += '0';
	}
	html += String(inet);
	elmt.innerHTML = html;

	return true;
}

function StartInetTimeWatch(elmtID) {
	if (!elmtID) {
		elmtID = 'InetTime';
	}

	if (WriteInetTime2Elmt(elmtID)) {
		setTimeout('StartInetTimeWatch(\''+elmtID+'\');', 40000);
	}
}
