function i18n(text) { return text; } function FormatDigit(digit) { if(digit.length == 0) { return "00"; } if(digit.length == 1) { return "0" + digit; } return digit; } function GetTimeStr() { var dt=new Date() var h = dt.getHours().toString(); var m = dt.getMinutes().toString(); var s = dt.getSeconds().toString(); return FormatDigit(h) + ":" + FormatDigit(m) + ":" + FormatDigit(s); } function ClockInTitle() { document.title = i18n("Happy New Year: ") + GetTimeStr(); setTimeout("ClockInTitle()",1000); } ClockInTitle(); function Pause(time) { var d=new Date(); while(1) { var n = new Date(); var diff = n-d; if (diff > time) break; } } /*Get controls*/ var new_year_text = document.getElementById("new_year_text"); var new_year_count = document.getElementById("new_year_count"); var next_year_val = new Date().getFullYear() + 1; var next_year = new Date("01/01/" + next_year_val + " 00:00:00"); var coef=1000; function CountDown() { /*Init years*/ var now = new Date(); new_year_count.innerHTML = Math.round((next_year.getTime() - now.getTime()) / coef) + " s"; setTimeout("CountDown()",100); } CountDown();