document.write('
cc
'); var cil = 1388530801; var hlaska = "Čas už uplynul"; function prvek(jmeno) { var obj=0; // getElementByID - ne-IE prohlizece a nove verze IE if(document.getElementById){ obj = document.getElementById(jmeno); } // document.all - stare verze IE else if (document.all){ obj = document.all[jmeno]; } return obj; } var el = prvek("odpocet"); function odpocet(){ var dt = new Date(); var ted = dt.getTime() / 1000; var diff = cil - ted; if(diff <= 0){ el.innerHTML = hlaska; return(0); } var tmp = diff; var d = Math.floor(tmp / 86400); tmp = tmp % 86400; var h = Math.floor(tmp / 3600); tmp = tmp % 3600; var m = Math.floor(tmp / 60); tmp = tmp % 60; var s = Math.floor(tmp); casStr = ""; if(d > 4) casStr = casStr + d + " dní, "; else if(d > 1) casStr = casStr + d + " dny, "; else if(d > 0) casStr = casStr + d + " den, "; if(h < 10) casStr += "0"; casStr = casStr + h + ":"; if(m < 10) casStr += "0"; casStr = casStr + m + ":"; if(s < 10) casStr += "0"; casStr = casStr + "" + s; el.innerHTML = casStr; setTimeout("odpocet()",995); } if(el){ setTimeout("odpocet()",1000); }