Fixes and further rewrites to make use of EL
[mailer.git] / templates / de / html / js / js_surfbar_stopped.tpl
1 var interval  = null;
2 var countDown = "{%pipe,getRequestParameter,bigintval=restart%}";
3 var timer     = document.getElementById("surfbar_counter");
4 var buttonDiv = document.getElementById("surfbar_button");
5
6 function restart () {
7         this.location.reload();
8 }
9
10 function showButton () {
11         buttonDiv.innerHTML = "<form accept-charset='utf-8' action='{?URL?}/surfbar.php' target='_self' method='GET'><input type='hidden' name='frame' value='top' /><input type='submit' id='member_submit' value='Surfbar erneut starten' /></form>";
12 }
13
14 function counter () {
15         if (countDown == 0) {
16                 if ({%pipe,getRequestParameter=autostart%} == true) {
17                         restart();
18                 } else {
19                         showButton();
20                 }
21                 window.clearInterval(interval);
22         } else {
23                 countDown--;
24                 timer.innerHTML = countDown;
25         }
26 }
27
28 function init () {
29         interval = window.setInterval("counter()", 1000);
30         timer.innerHTML = "$content[restart]";
31 }
32
33 window.setTimeout("init()", 500);