First batch of removal of the headers needed for revision-functions.php
[mailer.git] / templates / de / html / js / js_order_send.tpl
1 /**
2  * JavaScript for ext-order
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 counter = document.getElementById('counter');
25 var form    = document.getElementById('form');
26 var ok      = document.getElementById('ok');
27
28 function submitForm() {
29         if (counter.innerHTML > 0) {
30                 alert('{--MEMBER_ORDER_PLEASE_WAIT_TESTER--}');
31                 return false;
32         } else {
33                 form.submit();
34         }
35 }
36
37 function Counter() {
38         if (counter.innerHTML == 1) {
39                 ok.value='{--MEMBER_DO_ORDER--}';
40                 window.clearInterval(interval);
41         }
42
43         counter.innerHTML--;
44 }
45
46 ok.value='{--MEMBER_ORDER_TEST_STARTED--}';
47 var interval = window.setInterval("Counter()", 1000);
48
49 // Register event listener
50 $('#form').submit(function() {
51         return submitForm();
52 });