First batch of removal of the headers needed for revision-functions.php
[mailer.git] / templates / de / html / js / js_surfbar_member_book.tpl
1 /**
2  * JavaScript for ext-surfbar - member booking script
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 limit       = document.getElementById('limit');
25 var span        = document.getElementById('span_limit');
26 var limited_no  = document.getElementById('limited_no');
27 var limited_yes = document.getElementById('limited_yes');
28
29 var old_limit   = 0;
30
31 function focusLimitedNo () {
32         if ((limit.value > 0) && (limit.value != '-')) {
33                 old_limit = limit.value;
34         }
35         limited_no.focus();
36         limited_yes.blur();
37         limit.disabled = true;
38         limit.setAttribute('class', 'disabled');
39         limit.value = '-';
40         return true;
41 }
42
43 function focusLimitedYes () {
44         limit.disabled = false;
45         limit.setAttribute('class', 'form_field');
46         limit.style.textAlign = 'left';
47         if (old_limit > 0) {
48                 limit.value = old_limit;
49         } else {
50                 limit.value = '';
51         }
52         limit.focus();
53         return true;
54 }
55
56 function changeLimited () {
57         if ((limit.value == '') || (limit.value == 0)) {
58                 focusLimitedNo();
59         }
60         return true;
61 }
62
63 function focusLimit () {
64         limited_yes.focus();
65         limited_no.blur();
66         limit.focus();
67         if (limit.value == '-') {
68                 limit.value = '';
69         }
70         return true;
71 }
72
73 function blurLimit () {
74         if ((limit.value == '') || (limit.value == 0)) {
75                 limit.value = '-';
76         }
77         return true;
78 }
79
80 function submitForm () {
81         if (limit.value == '-') {
82                 limit.value = 0;
83         }
84         return true;
85 }
86
87 function resetForm () {
88         old_limit = 0;
89         focusLimitedNo();
90         return true;
91 }
92
93 focusLimitedNo();
94 document.getElementById('url').focus();
95
96 // Register all event listeners
97 $('#book').submit(function() {
98         return submitForm();
99 });
100
101 $('#reset').click(function() {
102         return resetForm();
103 });
104
105 $('#limit').click(function() {
106         return focusLimit();
107 });
108
109 $('#limit').blur(function() {
110         return blurLimit();
111 });
112
113 $('#limit').change(function() {
114         return changeLimited();
115 });
116
117 $('#limited_no').click(function() {
118         return focusLimitedNo();
119 });
120
121 $('#limited_yes').click(function() {
122         return focusLimitedYes();
123 });