//カウントダウンプログラム

target = "2011年";//何をカウントダウンするのか

//カウントダウンの対象日を設定する
var y=2011;//年
var m=1;//月
var d=1;//日

function countdown(){

	var nowtime = new Date();
	var theday = new Date(y,m-1,d);
	miritime = theday.getTime() - nowtime.getTime() ;

	date = Math.floor(miritime/(1000*60*60*24));//残り日数
	miritime -= date*(1000*60*60*24);
	hour = Math.floor(miritime/(1000*60*60));//残り時間
	miritime -= hour*(1000*60*60);
	minute = Math.floor(miritime/(1000*60));//残り分
	miritime -= minute*(1000*60);
	second = Math.floor(miritime/1000);//残り秒

	if(hour<10){hour="0"+hour;}
	if(minute<10){minute="0"+minute;}
	if(second<10){second="0"+second;}

	strings = target + "まであと<SPAN style='color:red;font-size:30px'> " + date + " </SPAN>日と<SPAN style='color:red;font-size:30px'> " + hour + " </SPAN>時間<SPAN style='color:red;font-size:30px'> " + minute + " </SPAN>分<SPAN style='color:red;font-size:30px'> " + second + " </SPAN>秒！";
	document.getElementById("CountDownArea").innerHTML = strings;
}

function countdowning(){
	setInterval("countdown()",1000);
}
