// Copyright (c) Katsushi Okada 2007.
function mitimecalc() {
var now = new Date();
var est = new Date(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate(),now.getUTCHours(),now.getUTCMinutes());
var dstbegin = new Date(now.getFullYear(),2,1,2), dstend = new Date(now.getFullYear(),10,1,2);
if (dstbegin.getDay())
dstbegin.setDate(15-dstbegin.getDay());
dstend.setDate(8-dstend.getDay());
if (est >= dstbegin && est <= dstend) 
est.setHours(now.getUTCHours()-4);
else
est.setHours(now.getUTCHours()-5);
var zyoubi = new Array("日","月","火","水","木","金","土");
var theYY = est.getFullYear(), theMM = est.getMonth()+1, theDD = est.getDate(), theHH = est.getHours();
var ampm = "午前";
if (theHH >= 12) {
   theHH = theHH - 12;
   ampm = "午後";
}
var theMN = est.getMinutes();
if (theMN < 10)
   theMN = "0" + theMN;
var zYB = zyoubi[est.getDay()];
var estmsg = "現在のミシガンの日付と時刻：　" + theYY + "年" + theMM + "月" + theDD + "日（" + zYB + "）" + ampm + theHH + "時" + theMN + "分";
document.getElementById("michigantime").innerHTML = estmsg;
}
function mitime(kankaku) {
   mitimecalc();
   setInterval("mitimecalc()",kankaku);
}