var seconds=; function display() { if (seconds <= 0) { document.getElementById('tk').innerHTML = "Startseite bereit"; } else { std = seconds/3600; if (std < 10) { stdaus = "0"+Math.floor(std); } else { stdaus = Math.floor(std); } minneu = (seconds-(Math.floor(std)*3600))/60; if (minneu < 10) { minaus = "0"+Math.floor(minneu); } else { minaus = Math.floor(minneu); } sekneu = (seconds-(Math.floor(std)*3600)-(Math.floor(minneu)*60)); if (sekneu < 10) { sekaus = "0"+Math.floor(sekneu); } else { sekaus = Math.floor(sekneu); } seconds = seconds-1; document.getElementById('tk').innerHTML = "Startseite in " + stdaus+":"+minaus+":"+sekaus; setTimeout("display()",1000); } } var running = false var endTime = null var timerID = null var totalMinutes = 30; function startTimer() { running = true now = new Date() now = now.getTime() endTime = now + (1000 * totalMinutes); showCountDown() } function showCountDown() { var now = new Date() now = now.getTime() if (endTime - now <= 0) { clearTimeout(timerID) running = false document.getElementById('SessionTimeCount').innerHTML = "Bitte bestätigen Sie die AGB." } else { var delta = new Date(endTime - now) var theMin = delta.getMinutes() var theSec = delta.getSeconds() var theTime = theMin theTime += ((theSec < 10) ? ":0" : ":") + theSec document.getElementById('SessionTimeCount').innerHTML = "Bitte warten Sie noch " + theTime + " Sekunden bis zur Bestätigung." if (running) { timerID = setTimeout("showCountDown()",900) } } }