First batch of removal of the headers needed for revision-functions.php
[mailer.git] / templates / de / html / js / js_surfbar_stopped.tpl
1 /**
2  * JavaScript for ext-surfbar - Stopped
3  * --------------------------------------------------------------------
4  * Copyright (c) 2003 - 2009 by Roland Haeder
5  * Copyright (c) 2009 - 2013 by Mailer Developer Team
6  * For more information visit: http://mxchange.org
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21  * MA  02110-1301  USA
22  */
23
24 var interval  = null;
25 var countDown = '{?surfbar_restart_time?}';
26 var timer     = document.getElementById('surfbar_counter');
27 var buttonDiv = document.getElementById('surfbar_button');
28
29 function restart () {
30         this.location.reload();
31 }
32
33 function showButton () {
34         buttonDiv.innerHTML = '{%form,formTarget_blank,formMethodGet=surfbar.php%}<input type=\'hidden\' name=\'frame\' value=\'top\' /><input type=\'submit\' id=\'form_submit\' value=\'Surfbar erneut starten\' />{%form_close%}';
35 }
36
37 function counter () {
38         if (countDown == 0) {
39                 if ({%get=autostart%} === true) {
40                         restart();
41                 } else {
42                         showButton();
43                 }
44                 window.clearInterval(interval);
45         } else {
46                 countDown--;
47                 timer.innerHTML = countDown;
48         }
49 }
50
51 function init () {
52         interval = window.setInterval('counter()', 1000);
53         timer.innerHTML = '{?surfbar_restart_time?}';
54 }
55
56 window.setTimeout('init()', 500);