var year=2010;
var month=3;
var day=19;
var i=0;

theDay=new Date(year,month-1,day);
var timeCountId;

function secCountDown(){
if(i<=500){
i++;
now= new Date();
today = now.getTime();
timeToGo = theDay.getTime() - today;
dayToGo =((timeToGo>=0)? Math.ceil(timeToGo/86400000):"");
document.getElementById("countdown").innerHTML="<FONT style='font-size : 16px; color : #ff0000'>あと"+dayToGo+"日！</FONT>";
timeCountId = setTimeout("secCountDown()",1000);
}else{
 clearTimeout(timeCountId);
 document.getElementById("countdown").innerHTML="";
}

}
