mailer project continued:
[mailer.git] / templates / de / html / js / js_surfbar_member_book.tpl
1 /**
2  * JavaScript for ext-surfbar - member booking script
3  * --------------------------------------------------------------------
4  * $Revision::                                                        $
5  * $Date::                                                            $
6  * $Tag:: 0.2.1-FINAL                                                 $
7  * $Author::                                                          $
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
12  *
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.
17  *
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.
22  *
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,
26  * MA  02110-1301  USA
27  */
28
29 var limit       = document.getElementById('limit');
30 var span        = document.getElementById('span_limit');
31 var limited_no  = document.getElementById('limited_no');
32 var limited_yes = document.getElementById('limited_yes');
33
34 var old_limit   = 0;
35
36 function focusLimitedNo () {
37         if ((limit.value > 0) && (limit.value != '-')) {
38                 old_limit = limit.value;
39         }
40         limited_no.focus();
41         limited_yes.blur();
42         limit.disabled = true;
43         limit.setAttribute('class', 'disabled');
44         limit.value = '-';
45         return true;
46 }
47
48 function focusLimitedYes () {
49         limit.disabled = false;
50         limit.setAttribute('class', 'form_field');
51         limit.style.textAlign = 'left';
52         if (old_limit > 0) {
53                 limit.value = old_limit;
54         } else {
55                 limit.value = '';
56         }
57         limit.focus();
58         return true;
59 }
60
61 function changeLimited () {
62         if ((limit.value == '') || (limit.value == 0)) {
63                 focusLimitedNo();
64         }
65         return true;
66 }
67
68 function focusLimit () {
69         limited_yes.focus();
70         limited_no.blur();
71         limit.focus();
72         if (limit.value == '-') {
73                 limit.value = '';
74         }
75         return true;
76 }
77
78 function blurLimit () {
79         if ((limit.value == '') || (limit.value == 0)) {
80                 limit.value = '-';
81         }
82         return true;
83 }
84
85 function submitForm () {
86         if (limit.value == '-') {
87                 limit.value = 0;
88         }
89         return true;
90 }
91
92 function resetForm () {
93         old_limit = 0;
94         focusLimitedNo();
95         return true;
96 }
97
98 focusLimitedNo();