var hotel_id = 453810;function SetTemplate (IdBlock, lRoomType, lPersonsInRoom, target_book, count_room, hotelCat){ var hotelCat_arr = hotelCat.split("_"); varSelectCat = ""; for (var i=0; i < hotelCat_arr.length; i++) { varSelectCat += ""; } var oParent; oParent = document.getElementById("HS_AddRoom_Box_"+target_book); if (!oParent) return; if (!lRoomType) lRoomType = 1; if (!lPersonsInRoom) lPersonsInRoom = 2; //check default strTplAddRoom = "
"; strTplAddRoom += ""; strTplAddRoom += count_room+ ". "; strTplAddRoom += " Erwachsene"; strTplAddRoom += "
Alter der Kinder:
"; strTplAddRoom += ""; strTplAddRoom += ""; strTplAddRoom += ""; strTplAddRoom += "
"; oParent.innerHTML += strTplAddRoom; } function Simulateclick(unitNumber, target_book, hotelCat) { var oParent, lIndex; oParent = document.getElementById("HS_AddRoom_Box_"+target_book); if (!oParent) return; if (!unitNumber) unitNumber = 1; if (!aRoomConfig) aRoomConfig =[]; //clear oParent.innerHTML = ""; count_room = 1; for (lIndex=1; lIndex < unitNumber; lIndex++) { count_room++; //add block if (lIndex < aRoomConfig.length) SetTemplate(lIndex, aRoomConfig[lIndex][1], aRoomConfig[lIndex][2], target_book, count_room, hotelCat); else SetTemplate(lIndex, 1, 2, target_book, count_room, hotelCat); } // document.getElementById("OldUnitNumber").value = OldUnitNumber; } function aRoomConfig() { aRoomConfig = [[1, 1, 1]]; } function date_now() { var check_in = new Date(), inDays = +7 inDate = new Date(check_in.getTime() + inDays * 864E5); Tag_in = inDate.getDate(); Monat_in = inDate.getMonth()+1; Jahr_in = inDate.getFullYear(); if(Tag_in < 10) Tag_in = "0" + Tag_in; if(Monat_in < 10) Monat_in= "0" + Monat_in; if(Jahr_in < 1000) Jahr_in+=1900; document.req_check.check_in.value = Tag_in + "." + Monat_in + "." + Jahr_in; } function date_check_out() { var check_out = new Date(), outDays = +14 outDate = new Date(check_out.getTime() + outDays * 864E5); Tag_out = outDate.getDate(); Monat_out = outDate.getMonth()+1; Jahr_out = outDate.getFullYear(); if(Tag_out < 10) Tag_out = "0" + Tag_out; if(Monat_out < 10) Monat_out= "0" + Monat_out; if(Jahr_out < 1000) Jahr_out+=1900; document.req_check.check_out.value = Tag_out + "." + Monat_out + "." + Jahr_out; } function date_check_cange(check_in) { var check_in = document.req_check.check_in.value; outDays = 7 var outDate = new Date(check_in.split('.')[2], check_in.split('.')[1] - 1, check_in.split('.')[0]); outDate.setDate(outDate.getDate() + outDays); Tag_out = outDate.getDate(); Monat_out = outDate.getMonth() +1; Jahr_out = outDate.getFullYear(); if(Tag_out < 10) Tag_out = "0" + Tag_out; if(Monat_out < 10) Monat_out= "0" + Monat_out; if(Jahr_out < 1000) Jahr_out+=1900; document.req_check.check_out.value = Tag_out + "." + Monat_out + "." + Jahr_out; } function setRequest(form, option, target, url) { /* Bild laden */ var load_img = "
"; var post_str = ""; // Request erzeugen if (window.XDomainRequest) { request = new XDomainRequest(); } else if (window.XMLHttpRequest) { request = new XMLHttpRequest(); } else { request = new ActiveXObject("Microsoft.XMLHTTP"); } /* request zu url */ if (!isNaN(url)) {var url = encodeURI(document.getElementById(form).action);} //alert(url); /* id aus formular lesen */ if ((option == "get_str") && (checkForm(form) == false)){ alert(unescape("Bitte f%FCllen Sie alle Felder die mit %22 * %22 gekennzeichnet sind aus%21")); exit(); } if (option == "get_str") {post_str = get_str(form) + "option="+ option}; if (option == "edit") {post_str = get_str(form) + "option="+ option}; if (!isNaN(option)) {post_str = "&option="+ option}; //alert(post_str); var url = url + "?" + post_str; //alert(url); // überprüfen, ob Request erzeugt wurde if (!request) { alert("Kann keine XMLHTTP-Instanz erzeugen"); return false; } else { document.getElementById(target).innerHTML = load_img; // Request öffnen request.open('get', url, true); // Requestheader senden //alert(request.contentType); request.send(post_str); // Request auswerten request.onload = function() { document.getElementById(target).innerHTML = request.responseText; } } } // Request auswerten function interpretRequest(target) { switch (request.readyState) { // wenn der readyState 4 und der request.status 200 ist, dann ist alles korrekt gelaufen case 4: if (request.status != 200) { alert("Der Request wurde abgeschlossen, ist aber nicht OK\nFehler:"+request.status); } else { var content = request.responseText; //alert(content); // den Inhalt des Requests in das
schreiben document.getElementById(target).innerHTML = content; } break; default: break; } } function checkForm(form) { var sendForm = true; var sErrorStyle = "1px solid #ff0000"; var sNoErrorStyle = "1px solid #000000"; var obj = document.forms[form]; for (i=0; i < obj.length; i++) { var sel = obj.elements[i]; if ((sel.alt == "check") && (sel.value == "")) { sendForm = false; sel.style.border = sErrorStyle; } if ((sel.alt == "check") && (sel.value != "")) { sendForm = true; sel.style.border = sNoErrorStyle; } } return(sendForm); } function get_str(form) { var poststr = ""; var obj = document.forms[form]; for (i=0;i