2 * HotelGate Order helper.
3 * Copyright (C) 2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // Double-run protection due to the My::Web "text/javascript" compatibility hack.
21 if (!window.var_product_hotelgate_Order_done) {
22 var var_product_hotelgate_Order_done=1;
24 function Order_validate(form)
26 var e_types_array=form.elements["type"];
28 for (var typei=0;typei<e_types_array.length;typei++)
29 if (e_types_array[typei].checked)
32 // FIXME: Unify with: $product::hotelgate::Order::error{"type_missing"}
33 alert("Please fill in the {Device casing type} field!");
39 function Order_error_check()
42 if (document.getElementById)
43 e_error=document.getElementById("error");
44 if (e_error && e_error.textContent)
45 alert(e_error.textContent);
48 function Order_error_check_delayed()
50 // HACK: 0ms - wait for 'css_inherit.js' finalization.
51 setTimeout('Order_error_check();',0);
54 /* Origin: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
55 function addLoadEvent(func)
57 var onload_orig=window.onload;
58 if (typeof(onload_orig)!='function')
61 window.onload = function()
68 addLoadEvent(Order_error_check_delayed);