window.onload=showday;
year=2010; //年
mon=4; //月
day=1; //日
time=0; //時
xday = new Date(year,mon-1,day,time,00,00);//基準になる年月日
function showday() {
nowday = new Date();
passtime= xday.getTime()-nowday.getTime();　//今から基準になる日までの経過時間　1/1000秒単位

cnt_day = Math.floor(passtime/(1000*60*60*24));// カウントダウン表示 (日にち) の取得
passtime = passtime -(cnt_day*(1000*60*60*24)); // 経過秒から(日にち)を引く

cnt_hour = Math.floor(passtime/(1000*60*60));// カウントダウン表示 (時) の取得
passtime = passtime -(cnt_hour*(1000*60*60)); // 経過秒から(時)を引く

cnt_min = Math.floor(passtime/(1000*60)); // カウントダウン表示 (分) 取得
passtime = passtime -(cnt_min*(1000*60));// 経過秒から(分)を引く

cnt_sec = Math.floor(passtime/1000);// カウントダウン表示 (秒) 取得
passtime = passtime -(cnt_sec*(1000)); // 経過秒から(秒)を引く


// 分、秒、ミリ秒を２桁で表示する。
if(cnt_min<10){cnt_min = '0' + cnt_min;}
if(cnt_sec<10){cnt_sec = '0' + cnt_sec;}

if((xday - nowday) > 0){
document.tbox.dspday.value = ""+cnt_day+"days "+cnt_hour+":"+cnt_min+":"+cnt_sec+""
}
else {
document.tbox.dspday.value = "公募の受付は終了いたしました"
}
timerID = setTimeout('showday()', 10);
}