var elapsed_sec = 0; var elapsed_min = 0; var elapsed_hour = 0; function Countdown() { var time = new Date(); var remain = (occasion - today - elapsed_sec * 1000 - elapsed_min * 60000 - elapsed_hour * 3600000); remain_days = Math.floor(remain / 86400000); remain_hours = Math.floor((remain % 86400000) / 3600000); remain_minutes = Math.floor(((remain % 86400000) % 3600000) / 60000); remain_seconds = Math.floor((((remain % 86400000) % 3600000) % 60000) / 1000); if (remain <= 0) { if (document.getElementById("countdown_text").firstChild.nodeValue) { document.getElementById("countdown_text").firstChild.nodeValue = "Heute " + occasion_text + "!";} else {countdown_obj = document.all.countdown_text.innerHTML = "Heute " + occasion_text + "!";} } else { if (document.getElementById("countdown_text").firstChild.nodeValue) { document.getElementById("countdown_text").firstChild.nodeValue = "Noch " + remain_days + " Tag" + ((remain_days == 1) ? "" : "e") + ", " + remain_hours + " Stunde" + ((remain_hours == 1) ? "" : "n") + ", " + remain_minutes + " Minute" + ((remain_minutes == 1) ? "" : "n") + " und " + remain_seconds + " Sekunde" + ((remain_seconds == 1) ? "" : "n") + ", dann " + occasion_text + "!";} else {countdown_obj = document.all.countdown_text.innerHTML = "Noch " + remain_days + " Tag" + ((remain_days == 1) ? "" : "e") + ", " + remain_hours + " Stunde" + ((remain_hours == 1) ? "" : "n") + ", " + remain_minutes + " Minute" + ((remain_minutes == 1) ? "" : "n") + " und " + remain_seconds + " Sekunde" + ((remain_seconds == 1) ? "" : "n") + ", dann " + occasion_text + "!";} setTimeout("Countdown()", 1000); } elapsed_sec = elapsed_sec + 1; if (elapsed_sec == 60) {elapsed_sec = 0; elapsed_min = elapsed_min + 1;} if (elapsed_min == 60) {elapsed_min = 0; elapsed_hour = elapsed_hour + 1;} } Countdown();