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
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.
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.
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,
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');
31 function focusLimitedNo () {
32 if ((limit.value > 0) && (limit.value != '-')) {
33 old_limit = limit.value;
37 limit.disabled = true;
38 limit.setAttribute('class', 'disabled');
43 function focusLimitedYes () {
44 limit.disabled = false;
45 limit.setAttribute('class', 'form_field');
46 limit.style.textAlign = 'left';
48 limit.value = old_limit;
56 function changeLimited () {
57 if ((limit.value == '') || (limit.value == 0)) {
63 function focusLimit () {
67 if (limit.value == '-') {
73 function blurLimit () {
74 if ((limit.value == '') || (limit.value == 0)) {
80 function submitForm () {
81 if (limit.value == '-') {
87 function resetForm () {
94 document.getElementById('url').focus();
96 // Register all event listeners
97 $('#book').submit(function() {
101 $('#reset').click(function() {
105 $('#limit').click(function() {
109 $('#limit').blur(function() {
113 $('#limit').change(function() {
114 return changeLimited();
117 $('#limited_no').click(function() {
118 return focusLimitedNo();
121 $('#limited_yes').click(function() {
122 return focusLimitedYes();