function countdown(title,Intime){ var online= new Date(Intime); var now = new Date(); var leave = online.getTime() - now.getTime(); var day = Math.floor(leave / (1000 * 60 * 60 * 24)); if (day > 0){ if(document.all){ tools.innerHTML="今天离"+ title+"还有"+day +"天!"; } }else{ if (day == 0) { if(document.all){ tools.innerHTML="明天就是"+title+"啦!"; } }else{ if (day == -1) {tools.innerHTML="今天就是"+title+"呀!"; }else{ if(document.all){ tools.innerHTML="唉呀!"+title+"已经过了!"; } } } } }