//called usually from local index->search.cfm->search.cfc (homedisplay) var warnedalready=false; function changepartywarning(warningtext){ if(!warnedalready){ warnedalready=true; alert(warningtext); } } function switchcsform() { //alert("hello"); //if(year == 2009) {switchheader(1, 'on2009');sho('searchform');hide('searchform2008');} //else {switchform('searchform2008');switchheader(0, 'on2008');loadregions('searchform2008');sho('searchform2008');hide('searchform');} } function setRegionName() { document.searchform2008.regionName.value = document.searchform2008.region.options[document.searchform2008.region.selectedIndex].text; } function loadregions(type) { while (document.searchform2008.region.firstChild) { document.searchform2008.region.removeChild(document.searchform2008.region.firstChild); } var arrRegions = new Array(); if(type == "searchform2008") { arrRegions = arrRegion; document.searchform2008.holidayType.value = 'camp'; } else if (type == "searchformApartments") { arrRegions = arrApts; document.searchform2008.holidayType.value = 'ap'; } else { arrRegions = ""; return; } arlen = arrRegions.length; //clear it first var thisgroup = ""; var lastgroup = ""; for(var i=0; i= 0) { alert("I har s\xf8gt efter et ferieophold med ankomstdato inden for de n\xe6ste 3 dage. Kontakt venligst vores rejsekonsulenter p\xe5 7028 7100 eller info@eurocamp.dk, som kan hj\xe6lpe jer med jeres sidste-\xf8jebliks-bestilling."); error = true; //tealeafajax("session.labels.errors.daysbeforetravel.xmltext"); } //party members less than 8 if(numparty > 8) { alert ("Det er maksimalt muligt at booke 8 personer ind pr. enhed gennem hjemmesiden. Kontakt venligst vores rejsekonsulenter p\xe5 7028 7200, som vil hj\xe6lpe jer med at arrangere jeres ferie."); error = true; //tealeafajax("session.labels.errors.maxpartysize.xmltext"); } //past date if(arrivaldateobj < todaysdateobj) { alert ("Den valgte dato er ugyldig, ret venligst datoen I har s\xf8gt p\xe5."); error = true; //tealeafajax("session.labels.errors.pastdate.xmltext"); } if((document[form].regioncode.selectedIndex !== undefined && document[form].regioncode.options[document[form].regioncode.selectedIndex].value == "0") || (document[form].regioncode.value !== undefined && document[form].regioncode.value == "0")) { alert ("I har ikke valgt en region"); error = true; //tealeafajax("session.labels.errors.noregion.xmltext"); } */ if(!error) { document[form].submit(); } else { hidepleasewait(); } } function tealeafajax(tlmsglbl){ var xurl="http://2009.keycamp.dk/ajax/tealeaf.cfm?nosession=true&tlmsglbl=" + tlmsglbl; //alert(xurl); var xmlhttp = getxmlhttp(); //http://crs-neo/redlabel/kcuk xmlhttp.open("GET", xurl,true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { rtxt=xmlhttp.responseText; } //end ready state }//end function xmlhttp.send(null); } function switchsearchformCSAP(year,layer,caller) { if(layer == "") { //user has called the year box from the 08 or 09 forms, so set the layer if(document.getElementById('searchformblock').className == "searchform2008" || document.getElementById('searchformblock').className == "searchform") { layer = "cs"; } else { layer = "ap"; } } if(year == "") { year = document.searchform.year.value; } //alert(year + " - " + layer); var pagetabs = document.getElementById('tabs'); if(layer == "cs") { switchform('searchform2008'); if(pagetabs !== null) { switchheaderecuk(0, 'on2008'); } sho('searchform'); hide('searchform2008'); if(document.getElementById("ap_regioncode" ) != null && document.getElementById("cs_regioncode") != null) { sho('cs_regioncode'); hide('ap_regioncode'); sethiddenfields('searchform',document.searchform.cs_regioncode.options[document.searchform.cs_regioncode.options.selectedIndex].value,'cs'); } } else if (layer == "ap") { switchform('searchformApartments'); if(pagetabs !== null) { switchheaderecuk(1, 'onAPTS'); } if(year == 2008) { loadregions('searchformApartments'); sho('searchform2008'); hide('searchform'); } else if (year >= 2009) {//pct 16 dec 09 : apartments not showing correct regions sho('searchform'); hide('searchform2008'); if(document.getElementById("ap_regioncode") != null && document.getElementById("cs_regioncode") != null) { sho('ap_regioncode'); hide('cs_regioncode'); sethiddenfields('searchform',document.searchform.ap_regioncode.options[document.searchform.ap_regioncode.options.selectedIndex].value,'ap'); } } } copyform(year,layer,caller); if(typeof dow == "function"){ dow(); } } function sethiddenfields(form,regioncode,serviceprovider) { document[form].regioncode.value = regioncode; document[form].serviceprovider.value = serviceprovider; } function copyform(year,layer,caller) { if(year == 2008 && layer == "ap") { document.searchform2008.arrivalDate.selectedIndex = document.searchform.day.selectedIndex; document.searchform2008.arrivalMonth.selectedIndex = document.searchform.month.selectedIndex; document.searchform2008.arrivalYear.selectedIndex = 0; if(document.searchform.selyear && layer == "ap"){document.searchform.selyear.selectedIndex = 1;} if(document.searchform.regioncode.selectedIndex !== undefined) { document.searchform2008.region.selectedIndex = document.searchform.regioncode.selectedIndex; } else { if(layer == "ap") { document.searchform2008.region.selectedIndex = document.searchform.ap_regioncode.selectedIndex; } else { document.searchform2008.region.selectedIndex = document.searchform.cs_regioncode.selectedIndex; } } document.searchform2008.nights.selectedIndex = document.searchform.nights.selectedIndex; document.searchform2008.adults.selectedIndex = document.searchform.adults.selectedIndex; document.searchform2008.children.selectedIndex = document.searchform.children.selectedIndex; document.searchform2008.infants.selectedIndex = document.searchform.infants.selectedIndex; if(document.searchform2008.pets.selectedIndex !== undefined) { document.searchform2008.pets.selectedIndex = document.searchform.pets.selectedIndex; } } else { /* PCT 17 DEC 09: find the correct year as 2010 wasn't showing */ document.searchform2008.arrivalYear.selectedIndex = 0; selyrlen = document.searchform2008.arrivalYear.length; selyr=0; for(var i=0; i" + document.searchform['day'+i].options[document.searchform['day'+i].selectedIndex].value + "/" + document.searchform['month'+i].options[document.searchform['month'+i].selectedIndex].value + "/" + document.searchform['year'+i].options[document.searchform['year'+i].selectedIndex].value + "

"; } } function validatebirthdate(from) { iserror = false; var arrivaldateobj = new Date(); aday = document.searchform.day.options[document.searchform.day.selectedIndex].value; amonth = document.searchform.month.options[document.searchform.month.selectedIndex].value; if(typeof(document.searchform.selyear) != 'undefined') { ayear = document.searchform.selyear.options[document.searchform.selyear.selectedIndex].value; } else { ayear = document.searchform.year.options[document.searchform.year.selectedIndex].value; } arrivaldateobj.setFullYear(ayear,amonth-1,aday); for(var i=1;i<=document.searchform.children.options[document.searchform.children.selectedIndex].value;i++) { if(document.searchform['year'+i].options[document.searchform['year'+i].selectedIndex].value && document.searchform['month'+i].options[document.searchform['month'+i].selectedIndex].value && document.searchform['day'+i].options[document.searchform['day'+i].selectedIndex].value) { childdob = new Date(); childdob.setFullYear(document.searchform['year'+i].options[document.searchform['year'+i].selectedIndex].value,document.searchform['month'+i].options[document.searchform['month'+i].selectedIndex].value-1,document.searchform['day'+i].options[document.searchform['day'+i].selectedIndex].value); yrsold = (arrivaldateobj - childdob)/60/60/24/1000/365; if(yrsold < 1) {yrsold = 1;} document.searchform['childage'+i].value = Math.floor(yrsold); } else { if(from == "validation") { alert(""); iserror = true; showdob(document.searchform.children.options[document.searchform.children.selectedIndex].value); hidepleasewait(); break; } } } if(from !== "searchform" || from !== "advsearchform") { return iserror; } } function validatesearchEZ(form) { //calculate the child ages at time of holiday iserror = validatebirthdate('validation'); selnights = document[form].nights.options[document[form].nights.selectedIndex].value; if(selnights == 3 || selnights == 4) { // select nearest Monday or Friday for midweek breaks selectnearestday(); } if(!iserror) { region = document[form].regioncode.options[document[form].regioncode.selectedIndex].value.split(','); if(typeof(document.searchform.selyear) != 'undefined') { document.searchform.year.value = document.searchform.selyear.options[document.searchform.selyear.selectedIndex].value; arrivalyear = document.searchform.selyear.options[document.searchform.selyear.selectedIndex].value; } else { arrivalyear = document[form].year.options[document[form].year.selectedIndex].value; } if(arrivalyear == 2009) { //then add arrivaldate,arrivalmonth,arrivalyear and get the resolution regioncode document[form].arrivalDate.value = aday; document[form].arrivalMonth.value = amonth; document[form].arrivalYear.value = ayear; document[form].region.value = region[1]; document[form].action = document[form].post09.value; document[form].infants.value = document[form].children.value; document[form].children.value = 0; //change the action of the form to blacklabel //submitFormByName('searchform'); document.searchform.submit(); }else { //document.searchform.submit(); document[form].infants.value = 0; document[form].regioncode.options[document[form].regioncode.selectedIndex].value = region[0]; validatesearch(form); } } }