document.write('
'); var Countdown = { servertime: 1283523044, toDate: 1276264800*1000, element: document.getElementById('passion-wm-countdown'), offset: 0, tick: function() { var now = +new Date() - Countdown.offset; var remaining = Math.round((Countdown.toDate - now)/1000); if (remaining < 0) { Countdown.element.innerHTML = 'Gestartet'; return; } var d = Math.floor(remaining / 86400); var h = Math.floor(remaining % 86400 / 3600); var m = Math.floor(remaining % 3600 / 60); var s = remaining % 60; d = d<10 ? '0'+d : d; h = h<10 ? '0'+h : h; m = m<10 ? '0'+m : m; s = s<10 ? '0'+s : s; Countdown.element.innerHTML = 'Noch '+d+' Tage '+h+' Std. '+m+' Min. '+s+' Sek. bis zur WM 2010'; }, start: function() { if (!Countdown.element) { //alert('No countdown element found'); return; } Countdown.offset = +new Date() - Countdown.servertime*1000; Countdown.tick(); window.setInterval(Countdown.tick, 500); } }; Countdown.start();