var ids = ""; var booking_id = "558"; var area = ""; var no_country = 0; function check_booking() { if (document.getElementById("creditcard").style.visibility == "visible") { var error = checkCreditCard(document.form_submit.cardnumber.value,document.form_submit.cardtype.value); if (error == false) { alert("Kreditkort oplysningerne er ikke korrekte"); return false; } } var terms = document.form_submit.accept_terms; if (terms.checked) { return true; } else { alert(" Du skal acceptere lejebetingelserne, før ordren kan gennemføres "); return false; } } var bookingPopupDiplayed; function validateBooking() { bookingPopupDiplayed = 0; validateInputField("booking_firstName"); validateInputField("booking_lastName"); validateInputField("booking_street"); validateInputField("booking_streetNo"); validateInputField("booking_zipcode"); validateInputField("booking_city"); validateInputField("booking_telephone"); validateInputField("booking_mobile"); validateInputEmail("booking_email"); if (document.getElementById('acceptTerms').checked == false) { document.getElementById('acceptTerms').style.backgroundColor="yellow"; markBookingField(); } if (bookingPopupDiplayed == 1) { return false; } return true; } function validateInputEmail(checkfield) { document.getElementById(checkfield).style.backgroundColor=""; var email = document.getElementById(checkfield); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email.value)) { document.getElementById(checkfield).style.backgroundColor="yellow"; markBookingField(); } } function validateInputField(checkfield){ if (document.getElementById(''+checkfield).value == "") { document.getElementById(checkfield).style.backgroundColor="yellow"; markBookingField(); return false; } document.getElementById(checkfield).style.backgroundColor=""; } function markBookingField() { if (bookingPopupDiplayed == 0) { alert("Udfyld felterne markeret med gult samt accept af lejebetingelserne"); bookingPopupDiplayed = 1; } } function check_terms() { var terms = document.form_submit.accept_terms; if (terms.checked) { return true; } else { alert(" Du skal acceptere lejebetingelserne, før ordren kan gennemføres "); return false; } } function j_debug(t) { } function load_invoice() { document.getElementById("creditcard").style.visibility = "hidden"; } function load_creditcard() { document.getElementById("creditcard").style.visibility = "visible"; var body = document.getElementsByTagName('head').item(0); script = document.createElement('script'); script.src = "/fileadmin/creditcard.js"; script.type = 'text/javascript'; script.id = 'loadScript'; body.appendChild(script) } function update_calendar_start() { var from = document.getElementById("from"); from.innerHTML = document.form_calendar.s_start_date.value for (i=document.form_calendar.s_end_date.length; i>=0; i--) { document.form_calendar.s_end_date.options[i] = null; } document.form_calendar.s_end_date.options[0] = new Option("Vent", "Vent"); document.form_calendar.s_end_date.disabled = true; //update_end_day(); document.form_calendar.s_end_date.selectedIndex = 0; update_calendar_end(); } function customer_country() { var c_c = document.form_submit.country.value; if (c_c == "nl" || c_c == "be" || c_c == "de") { document.getElementById("show_creditcard").style.visibility = "hidden"; } else { document.getElementById("show_creditcard").style.visibility = "visible"; } } function toggle_calendar(reload) { var hid = document.getElementById("houseid"); var calendar_visible = document.getElementById("calendar_visible"); var show_calendar = document.getElementById("show_calendar"); var show_description = document.getElementById("show_description"); var toggle_description = document.getElementById("toggle_description"); document.form_calendar.s_start_date.disabled = true document.form_calendar.s_end_date.disabled = true if (reload == 1) { for (i=document.form_calendar.s_start_date.length; i>=0; i--) { document.form_calendar.s_start_date.options[i] = null; } for (i=document.form_calendar.s_end_date.length; i>=0; i--) { document.form_calendar.s_end_date.options[i] = null; } calendar_visible.innerHTML = 0; } if (calendar_visible.innerHTML == "1") { show_calendar.style.visibility = "hidden"; show_description.style.visibility = "visible"; calendar_visible.innerHTML = 0; toggle_description.innerHTML = "Vælg anden periode."; } else { // var s; // s = document.form_calendar.s_start_date.selectedIndex; // document.form_calendar.s_start_date.options[s] = new Option("vent", "vent"); // s = document.form_calendar.s_end_date.selectedIndex; // document.form_calendar.s_end_date.options[s] = new Option("vent", "vent"); show_calendar.style.visibility = "visible"; show_description.style.visibility = "hidden"; calendar_visible.innerHTML = 1; toggle_description.innerHTML = "Vis husets beskrivelse"; var body = document.getElementsByTagName('head').item(0); script = document.createElement('script'); script.src = "http://www.holidayhome4you.dk/get_vacancy.php?lang=dk&house_id="+hid.innerHTML+"&startdate="+document.form_calendar.s_month.value+"&arrival=1"; script.type = 'text/javascript'; script.id = 'loadScript'; body.appendChild(script) } } function hide_ids() { var hide_sub = ids.split(","); var len = hide_sub.length - 1; for (i=0; itoday) { is_first_saturday_selected = i; } } else { is_first_saturday_selected = i; } } var week = "Uge" var week_no = getWeek(date.getYear(), date.getMonth(), date.getDate()); week_no += 1; weekNote = "(" + week + " " + week_no + ")"; } document.selector.day.options[i] = new Option(date.getDate() + " - " + get_day(date.getDay()) + " " + weekNote, date.getDate()); } } var jtnm = document.getElementById("jump_to_next_month"); if (jump_month_ahead > 1 || is_first_saturday_selected == 0 && jtnm.innerHTML == 1) { jump_month_ahead--; var selectedIndex = document.selector.month.selectedIndex; selectedIndex++; document.selector.month.selectedIndex = selectedIndex; load_days(); } else { document.selector.day.selectedIndex = is_first_saturday_selected; load_interval(); } if (document.selector.day.selectedIndex > document.selector.day.length ) { document.selector.day.selectedIndex = 3; } disable_pre(); if (document.selector.day.value == "") { document.selector.day.selectedIndex = 1; } } function disable_pre() { var date = new Date(); var today = date.getDate(); var thisMonth = date.getMonth(); thisMonth++; var month = ""; month = document.selector.month.value var arr = month.split("-"); if (arr[1] == thisMonth) { for (i=today+3; i>0; i--) { document.selector.day.options[i] = null; } } } var state = ""; function showhide(layer_ref) { if (state == 'block') { state = 'none'; } else { state = 'block'; } if (document.all) { //IS IE 4 or 5 (or 6 beta) eval( "document.all." + layer_ref + ".style.display = state"); } if (document.layers) { //IS NETSCAPE 4 or below document.layers[layer_ref].display = state; } if (document.getElementById &&!document.all) { hza = document.getElementById(layer_ref); hza.style.display = state; } } function clear_subarea() { try { for (i=document.form_area.s_subarea.length; i>=0; i--) { document.form_area.s_subarea.options[i] = null; } } catch (e) { } } function subarea(area) { clear_subarea(); } function update_calendar_end() { var to = document.getElementById("to"); var price = document.getElementById("price"); to.innerHTML = document.form_calendar.s_end_date.value.split(",")[0]; var selected_price = document.form_calendar.s_end_date.value.split(",")[1]; price.innerHTML = selected_price; var bookingprice = document.getElementById("booking_price"); if (selected_price >= 0 ) { bookingprice.innerHTML = selected_price + ",00"; } var book_house = document.getElementById("book_house_link"); var start_value = document.form_calendar.s_start_date.value; var end_value = document.form_calendar.s_end_date.value.split(",")[0]; document.form_calendar.s_end_date.disabled = false; var hid = document.getElementById("houseid"); var body = document.getElementsByTagName('head').item(0); script = document.createElement('script'); script.src = "http://www.holidayhome4you.dk/get_vacancy.php?lang=dk&house_id="+hid.innerHTML+"&startdate="+document.form_calendar.s_start_date.value+"&departure=1"; script.type = 'text/javascript'; script.id = 'loadScript'; body.appendChild(script) } function update_calendar_finish11() { var to = document.getElementById("to"); var price = document.getElementById("price"); to.innerHTML = document.form_calendar.s_end_date.value.split(",")[0]; var selected_price = document.form_calendar.s_end_date.value.split(",")[1]; price.innerHTML = selected_price; var bookingprice = document.getElementById("booking_price"); if (selected_price >= 0 ) { bookingprice.innerHTML = selected_price + ",00"; } var book_house = document.getElementById("book_house_link"); var start_value = document.form_calendar.s_start_date.value; var end_value = document.form_calendar.s_end_date.value.split(",")[0]; var hid = document.getElementById("houseid"); } function calculate_persons(max) { var num_adults = document.form_submit.adults.value; var num_children = document.form_submit.children.value; var total = (num_adults*1) + (num_children*1); if (total > max) { document.getElementById("too_many_persons").innerHTML = "Max " + max + " personer! "; document.form_submit.submit.disabled = true; } else { document.form_submit.submit.disabled = false; document.getElementById("too_many_persons").innerHTML = ""; } } function toggle_terms() { if (document.getElementById('terms').style.visibility == "visible") { document.getElementById('terms').style.visibility = "hidden"; } else { document.getElementById('terms').style.visibility = "visible"; } } function getHTTPObject() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object