2014-02-06 17:48:02 +01:00
|
|
|
/* Timer for information page */
|
|
|
|
|
2015-12-23 09:26:52 +01:00
|
|
|
var i = 30;
|
2014-02-06 17:48:02 +01:00
|
|
|
var _go = 1;
|
|
|
|
|
|
|
|
function stop() {
|
2015-12-23 09:26:52 +01:00
|
|
|
_go = 0;
|
|
|
|
$('#timer').html("...");
|
2014-02-06 17:48:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function go() {
|
2015-12-23 09:26:52 +01:00
|
|
|
if (_go) {
|
|
|
|
$("#form").submit();
|
|
|
|
}
|
2014-02-06 17:48:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function timer() {
|
2015-12-23 09:26:52 +01:00
|
|
|
var h = $('#timer').html();
|
|
|
|
if (i > 0) {
|
|
|
|
i--;
|
|
|
|
}
|
|
|
|
h = h.replace(/\d+/, i);
|
|
|
|
$('#timer').html(h);
|
|
|
|
window.setTimeout('timer()', 1000);
|
2014-02-06 17:48:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2015-12-23 09:26:52 +01:00
|
|
|
if (activeTimer) {
|
|
|
|
window.setTimeout('go()', 10000);
|
|
|
|
window.setTimeout('timer()', 1000);
|
|
|
|
} else {
|
|
|
|
stop();
|
|
|
|
}
|
|
|
|
});
|