// realtime watch

function ShowTime() {
       Dt = new Date() ;
       DW = new Array('日', '月', '火', '水', '木', '金', '土') ;
       now = Dt.getFullYear()+'年'+(Dt.getMonth()+1)+'月'+Dt.getDate()+'日（'+
             DW[Dt.getDay()]+'） '+Dt.getHours()+' 時'+Dt.getMinutes()+' 分';
       var tm = document.getElementById('time');
       if(tm) {
           tm.innerHTML = now ;
       }
}
time = setInterval('ShowTime()', 1000);

function ShowTime02() {
       Dt = new Date() ;
       DW = new Array('日', '月', '火', '水', '木', '金', '土') ;
       now = (Dt.getMonth()+1)+'月'+Dt.getDate()+'日（'+
             DW[Dt.getDay()]+'）'+Dt.getHours()+' 時'+Dt.getMinutes()+' 分'+Dt.getSeconds();
       t02 = document.getElementById('time02');
       if(t02) {
           t02.innerHTML = now ;
       }
}
time02 = setInterval('ShowTime02()', 1000);


function changeBG(colorNum){
	document.getElementsByTagName("body")[0].className = colorNum;
	document.getElementById("header").className = colorNum+'header';
	document.getElementById("headerBelt").className = colorNum+'headerbelt';
	document.getElementById("footerBelt").className = colorNum+'footer';
setCookie('usrColor',colorNum,10);
}


function setCookie(_name,_value,_expires,_domain,_path,_secure){
	var date=new Date();
	date.setTime(date.getTime()+(_expires*24*60*60*1000));
	var _str=_name+'='+_value;
	_str+=';expires:'+date.toGMTString();
	if(_domain) str+=';domain='+_domain;
	if(_path) str+=';path='+_path;
	if(_secure) str+=';secure';
	document.cookie=_str;
}


function defChangeBG(){
	var allColorArray = new Array("pink","green","orange","purple","yellow","blue");
	for(i=0;i<allColorArray.length;i++){
		var allCookie = document.cookie;
		var myColor = allColorArray[i];
		if(allCookie.indexOf(myColor) !== -1){
			document.getElementsByTagName("body")[0].className = myColor;
			document.getElementById("header").className = myColor+'header';
			document.getElementById("headerBelt").className = myColor+'headerbelt';
			document.getElementById("footerBelt").className = myColor+'footer';
		}
	}
}

function popup(url, wname, w, h) {
	var w = window;
	if(w == null) {
		w = 10;
	}
	if(h == null) {
		h = 10;
	}
	w = open(url,wname,"location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,toolbar=no,left=0,top=0,width=" + w + ",height=" + h);
	w.focus();
}
