timeID = 10; // 割り込みタイマ用

function formClock()
{
	w = new Array("日","月","火","水","木","金","土");
	c = new Date();

	Y = c.getFullYear();
	M = c.getMonth() + 1;
	D = c.getDate();
	h = c.getHours();
	m = c.getMinutes();
	s = c.getSeconds();

	if(M < 10) M = "0" + M;
	if(D < 10) D = "0" + D;
	if(h < 10) h = "0" + h;
	if(m < 10) m = "0" + m;
	if(s < 10) s = "0" + s;

	document.getElementsByTagName("INPUT").namedItem("myClock").value = Y + "/" + M + "/" + D + " (" + w[c.getDay()] + ") " + h + ":" + m + ":" + s;
	clearTimeout(timeID);
	timeID = setTimeout('formClock()',1000);
}
