// 
function showsub(name){
	eval("document.all."+name+".style.visibility='visible'");
}
function hidesub(name){
	eval("document.all."+name+".style.visibility='hidden'");
}


/* Live Date Script- ｩ Dynamic Drive (www.dynamicdrive.com)　For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,　visit http://www.dynamicdrive.com */

/*
var dayarray=new Array("日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日")
var montharray=new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月")
*/
var dayarray=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12")

/*
Calendar cal=Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("GMT"));   # これを除くとLocal timeでもってくる。
int yr=cal.get(Calendar.YEAR);
int mo=cal.get(Calendar.MONTH)+1;        # よくある話で0から11だよ
int dy=cal.get(Calendar.DAY_OF_MONTH);
int hr=cal.get(Calendar.HOUR_OF_DAY);
int mn=cal.get(Calendar.MINUTE);
int se=cal.get(Calendar.SECOND);



*/


function getthedate(){
	var mydate=new Date()
	var year=mydate.getYear()
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()
	var AprFst=0
	var LdnStd=0
	var LdnEnd=0
	var NykStd=0
	var NykEnd=0
	var Adjust=0
    var AprFst=0
    var Lhours=0
    var Nhours=0
    var daytms="#FF0033"
    var evntms="#FF9966"
    var ngttms="#000000"
    var mrntms="#0066FF"
    var tcolor
    var lcolor
    var ncolor

	if (year < 1000) year+=1900

    // April 1st
    AprFst= ((year + year/4 - year/100 + year/400 + (13*4 +8)/5 + 1) % 7)

    // London Sammer Time Start Last Sunday of Mar.
    if (AprFst == 0) LdnStd=25
    else             LdnStd=32-AprFst
    // London Sammer Time End Last Sunday of Oct.
    if (AprFst <= 3) LdnEnd=28-AprFst
    else             LdnEnd=35-AprFst

    // NewYork ST Start First Sun of Apr.
    if (AprFst == 0) NykStd=1
    else             NykStd=8-AprFst
    // NewYork ST End Last Sat of Oct.
    if (AprFst <= 2) NykEnd=27-AprFst
    else             NykEnd=34-AprFst


    // London
    Adjust=-9
    if ((month >3 ) && (month< 10))    Adjust=-8
    if ((month==3 ) && (daym> LdnStd)) Adjust=-8
    if ((month==3 ) && (daym==LdnStd) && (hours>10)) Adjust=-8
    if ((month==10) && (daym< LdnEnd)) Adjust=-8
    if ((month==10) && (daym==LdnEnd) && (hours>10)) Adjust=-8
    Lhours = hours+Adjust
    if (Lhours < 0) Lhours=24+Lhours

    // NewYork
    Adjust=-14
    if ((month >4 ) && (month< 10))    Adjust=-13
    if ((month==4 ) && (daym> NykStd)) Adjust=-13
    if ((month==4 ) && (daym==NykStd) && (hours>15)) Adjust=-13
    if ((month==10) && (daym< NykEnd)) Adjust=-13
    if ((month==10) && (daym==NykEnd) && (hours>15)) Adjust=-13
    Nhours = hours+Adjust
    if (Nhours < 0) Nhours=24+Nhours

    if (hours>=0  && hours<7 ) tcolor=ngttms
    if (hours>=7  && hours<9 ) tcolor=mrntms
    if (hours>=9  && hours<16) tcolor=daytms
    if (hours>=16 && hours<19) tcolor=evntms
    if (hours>=19 && hours<24) tcolor=ngttms

    if (Lhours>=0  && Lhours<7 ) lcolor=ngttms
    if (Lhours>=7  && Lhours<9 ) lcolor=mrntms
    if (Lhours>=9  && Lhours<16) lcolor=daytms
    if (Lhours>=16 && Lhours<19) lcolor=evntms
    if (Lhours>=19 && Lhours<24) lcolor=ngttms

    if (Nhours>=0  && Nhours<7 ) ncolor=ngttms
    if (Nhours>=7  && Nhours<9 ) ncolor=mrntms
    if (Nhours>=9  && Nhours<16) ncolor=daytms
    if (Nhours>=16 && Nhours<19) ncolor=evntms
    if (Nhours>=19 && Nhours<24) ncolor=ngttms

	if (daym<10) daym="0"+daym
	if (minutes<=9) minutes="0"+minutes
	if (seconds<=9) seconds="0"+seconds
	if (hours<=9) hours="0"+hours
	if (Lhours<=9) Lhours="0"+Lhours
	if (Nhours<=9) Nhours="0"+Nhours

	// change font size here
	/*
	var cdate="<small><font color='220047' face='MSP Gothic'><b> "+year+" 年 "+montharray[month]+" "+daym+" 日 "+dayarray[day]+" "+hours+":"+minutes+":"+seconds+" "+dn+"</b></font></small>"
	var cdate="<small><font color='220047' face='MSP Gothic'><b> "+year+"/"+montharray[month]+"/"+daym+" "+dayarray[day]+" "+hours+":"+minutes+":"+seconds+" "+dn+"</b></font></small>"
	*/

	var cdate="<small><font color='FFFFFF' face='MSP Gothic'><b> "+year+"/"+montharray[month]+"/"+daym+" "+dayarray[day]+"</b></font></small>"
	if (document.all)
    	document.all.tkydate.innerHTML=cdate
	else if (document.getElementById)
    	document.getElementById("tkydate").innerHTML=cdate
	else
	    document.write(cdate)

	var tdate="<small><font color="+tcolor+" face='MSP Gothic'><b> "+hours+":"+minutes+":"+seconds+"</b></font></small>"
	if (document.all)
    	document.all.tclock.innerHTML=tdate
	else if (document.getElementById)
    	document.getElementById("tclock").innerHTML=tdate
	else
	    document.write(tdate)

	var ldate="<small><font color="+lcolor+" face='MSP Gothic'><b> "+Lhours+":"+minutes+":"+seconds+"</b></font></small>"
	if (document.all)
    	document.all.lclock.innerHTML=ldate
	else if (document.getElementById)
    	document.getElementById("lclock").innerHTML=ldate
	else
	    document.write(ldate)

	var ndate="<small><font color="+ncolor+" face='MSP Gothic'><b> "+Nhours+":"+minutes+":"+seconds+"</b></font></small>"
	if (document.all)
    	document.all.nclock.innerHTML=ndate
	else if (document.getElementById)
    	document.getElementById("nclock").innerHTML=ndate
	else
	    document.write(ndate)

}

if (!document.all&&!document.getElementById)
getthedate()

function goforit(){
	if (document.all||document.getElementById)
	setInterval("getthedate()",1000)
}
