]> git.mxchange.org Git - mailer.git/blob - templates/de/html/js/js_surfbar_frame_top.tpl
b5cabc45641f3846fee4974ed1dedb822d546445
[mailer.git] / templates / de / html / js / js_surfbar_frame_top.tpl
1 var currCounter = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
2 var maxCounter  = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
3 var counter     = document.getElementById("surfbar_counter");
4 var points      = document.getElementById("surfbar_points");
5 var reload      = document.getElementById("surfbar_reload");
6 var max         = document.getElementById("surfbar_max");
7 var countDown   = null;
8
9 function startStopCounter () {
10         if (countDown == null) {
11                 // Start counter
12                 document.getElementById("start").innerHTML = "{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}";
13                 countDown = window.setInterval("startCounter()", 1000);
14         } else {
15                 document.getElementById("start").innerHTML = "{--MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT--}";
16                 window.clearInterval(countDown);
17                 countDown = null;
18         }
19         return false;
20 }
21
22 function init () {
23         countDown = window.setInterval("startCounter()", 1000);
24         window.setTimeout("initCounter()", 500);
25 }
26
27 function confirm () {
28         if (parent.surfbar_url != null) {
29                 // Is in right frameset
30                 parent.surfbar_url.location.href = "{%url=surfbar.php?id=$content[url_id]&check={%pipe,SURFBAR_GENERATE_VALIDATION_CODE=$content[url_id]%}&salt={%pipe,SURFBAR_GET_SALT%}%}";
31         } else {
32                 // Called frame=top directly
33                 window.location.href = "{%url=surfbar.php%}";
34         }
35 }
36
37 function reloadSurfbar () {
38         if (parent.surfbar_stats != null) {
39                 // Is in right frameset
40                 parent.surfbar_stats.location.reload();
41         } else {
42                 // Called frame=top directly
43                 window.location.href = "{%url=surfbar.php%}";
44         }
45         this.location.reload();
46 }
47
48 function initCounter () {
49         if (parent.surfbar_url != null) {
50                 // Is in right frameset
51                 parent.surfbar_url.location.href = '{%pipe,SURFBAR_GET_URL=$content[url_id]%}';
52         } else {
53                 // Called frame=top directly
54                 window.location.href = "{%url=surfbar.php%}";
55         }
56
57         counter.innerHTML = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
58         points.innerHTML  = "{%pipe,SURFBAR_GET_REWARD,translateComma=$content[url_id]%}";
59         reload.innerHTML  = "{%pipe,SURFBAR_GET_USER_LOCKS%}";
60         max.innerHTML     = "{%pipe,SURFBAR_GET_TOTAL_URLS%}";
61 }
62
63 function startCounter () {
64         if (currCounter < 1) {
65                 return false;
66         }
67
68         currCounter--;
69         counter.innerHTML = currCounter;
70
71         if (currCounter == 0) {
72                 clearInterval(countDown);
73                 confirm();
74                 window.setTimeout("reloadSurfbar()", 500);
75         }
76 }
77
78 init();