2 * JavaScript for ext-surfbar - top frame
3 * --------------------------------------------------------------------
4 * Copyright (c) 2003 - 2009 by Roland Haeder
5 * Copyright (c) 2009 - 2016 by Mailer Developer Team
6 * For more information visit: http://mxchange.org
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.
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.
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,
24 var currCounter = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
25 var maxCounter = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
26 var counter = document.getElementById('surfbar_counter');
27 var points = document.getElementById('surfbar_points');
28 var reload = document.getElementById('surfbar_reload');
29 var max = document.getElementById('surfbar_max');
32 function startStopCounter () {
33 if (countDown === null) {
35 document.getElementById('start').innerHTML = '{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}';
36 countDown = window.setInterval('startCounter()', 1000);
38 document.getElementById('start').innerHTML = '{--MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT--}';
39 window.clearInterval(countDown);
46 countDown = window.setInterval('startCounter()', 1000);
47 window.setTimeout('initCounter()', 500);
51 if (parent.surfbar_url !== null) {
52 // Is in right frameset
53 parent.surfbar_url.location.href = '{%url=surfbar.php?id=$content[url_id]&check=$content[check]&salt=$content[salt]%}';
55 // Called frame=top directly
56 window.location.href = '{%url=surfbar.php%}';
60 function reloadSurfbar () {
61 if (parent.surfbar_stats !== null) {
62 // Is in right frameset
63 parent.surfbar_stats.location.reload();
65 // Called frame=top directly
66 window.location.href = '{%url=surfbar.php%}';
68 this.location.reload();
71 function initCounter () {
72 if (parent.surfbar_url !== null) {
73 // Is in right frameset
74 parent.surfbar_url.location.href = '{%pipe,getSurfbarUrl=$content[url_id]%}';
76 // Called frame=top directly
77 window.location.href = '{%url=surfbar.php%}';
80 counter.innerHTML = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
81 points.innerHTML = '{%pipe,getSurfbarReward,translateComma=$content[url_id]%}';
82 reload.innerHTML = '{%pipe,getSurfbarUserLocks%}';
83 max.innerHTML = '{%pipe,getSurfbarTotalUrls%}';
86 function startCounter () {
87 if (currCounter < 1) {
92 counter.innerHTML = currCounter;
94 if (currCounter == 0) {
95 clearInterval(countDown);
97 window.setTimeout('reloadSurfbar()', 500);