function doonload() { setInterval("countunixtimestamp('"+1283942700+"')", 1000); } function countunixtimestamp(timestamp) { if(typeof(unixtimestamp) == 'undefined') { unixtimestamp = timestamp; } else { unixtimestamp++; } } function howlong(id, endtimestamp) { dohowlong('"+id+"', "+endtimestamp+"); setInterval("dohowlong('"+id+"', "+endtimestamp+")", 1000); } function dohowlong(id, endtimestamp) { if(typeof(unixtimestamp) != 'undefined') { var long = parseInt(endtimestamp-unixtimestamp); if(long > 0) { var days = parseInt(long/60/60/24); var hours = parseInt((long/60/60)%24); if(hours < 10) {hours = "0"+hours;} var minutes = parseInt((long/60)%60); if(minutes < 10) {minutes = "0"+minutes;} var seconds = parseInt((long)%60); if(seconds < 10) {seconds = "0"+seconds;} } else { var days = "0"; var hours = "00"; var minutes = "00"; var seconds = "00"; location.reload(); } if(parseInt(days) == 1) { document.getElementById(id).innerHTML = days+" Tag "+hours+":"+minutes+":"+seconds; } else { document.getElementById(id).innerHTML = days+" Tage "+hours+":"+minutes+":"+seconds; } } }