2 * JavaScript for ext-surfbar - top frame
3 * --------------------------------------------------------------------
8 * --------------------------------------------------------------------
9 * Copyright (c) 2003 - 2009 by Roland Haeder
10 * Copyright (c) 2009 - 2012 by Mailer Developer Team
11 * For more information visit: http://mxchange.org
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
29 var currCounter = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
30 var maxCounter = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
31 var counter = document.getElementById('surfbar_counter');
32 var points = document.getElementById('surfbar_points');
33 var reload = document.getElementById('surfbar_reload');
34 var max = document.getElementById('surfbar_max');
37 function startStopCounter () {
38 if (countDown == null) {
40 document.getElementById('start').innerHTML = '{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}';
41 countDown = window.setInterval('startCounter()', 1000);
43 document.getElementById('start').innerHTML = '{--MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT--}';
44 window.clearInterval(countDown);
51 countDown = window.setInterval('startCounter()', 1000);
52 window.setTimeout('initCounter()', 500);
56 if (parent.surfbar_url != null) {
57 // Is in right frameset
58 parent.surfbar_url.location.href = '{%url=surfbar.php?id=$content[url_id]&check=$content[check]&salt=$content[salt]%}';
60 // Called frame=top directly
61 window.location.href = '{%url=surfbar.php%}';
65 function reloadSurfbar () {
66 if (parent.surfbar_stats != null) {
67 // Is in right frameset
68 parent.surfbar_stats.location.reload();
70 // Called frame=top directly
71 window.location.href = '{%url=surfbar.php%}';
73 this.location.reload();
76 function initCounter () {
77 if (parent.surfbar_url != null) {
78 // Is in right frameset
79 parent.surfbar_url.location.href = '{%pipe,getSurfbarUrl=$content[url_id]%}';
81 // Called frame=top directly
82 window.location.href = '{%url=surfbar.php%}';
85 counter.innerHTML = '{%pipe,getSurfbarWaitingTime=$content[url_id]%}';
86 points.innerHTML = '{%pipe,getSurfbarReward,translateComma=$content[url_id]%}';
87 reload.innerHTML = '{%pipe,getSurfbarUserLocks%}';
88 max.innerHTML = '{%pipe,getSurfbarTotalUrls%}';
91 function startCounter () {
92 if (currCounter < 1) {
97 counter.innerHTML = currCounter;
99 if (currCounter == 0) {
100 clearInterval(countDown);
102 window.setTimeout('reloadSurfbar()', 500);