var flagCaptcha = false; var flagFields = true; var message = 'Please fill in all mandatory fields ! \n'; var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no) var bustcacheparameter=""; function createRequestObject(){ try { xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert('Sorry, but your browser doesn\'t support XMLHttpRequest.'); }; return xmlhttp; }; function ajaxpage(url, containerid, requesttype){ var page_request = createRequestObject(); if (requesttype=='get'){ if (bustcachevar) bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() page_request.open('GET', url+bustcacheparameter, true) page_request.send(null) } else if (requesttype=='post') { page_request.open('POST', url, true); page_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); page_request.setRequestHeader("Content-length", poststr.length); page_request.setRequestHeader("Connection", "close"); page_request.send(poststr); }; page_request.onreadystatechange=function(){ loadpage(page_request, containerid) } } function RedirectToPage(){ window.location.href = 'http://www.villasfor2.com/thank-you.shtml'; } function ajaxpageSubmit(url, containerid, requesttype){ var page_request = createRequestObject(); if (bustcachevar) bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() page_request.open('GET', url+bustcacheparameter, true) page_request.send(null); setTimeout ( "RedirectToPage()", 1000 ); } function loadpage(page_request, containerid){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) { document.getElementById(containerid).innerHTML=page_request.responseText; }; } function ShowToolTip(object) { document.getElementById(object).style.visibility = 'visible'; } function HideToolTip(object) { document.getElementById(object).style.visibility = 'hidden'; } function pause(millis){ var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis) } function submitBooking4(from, to, sMonth, sYear) { if(document.frm4.terms.checked == true){ var poststr = "ac=book&startDate="+from+"&endDate="+to + "&customerName=" + encodeURIComponent( document.frm4.customerName.value ) + "&email=" + encodeURIComponent( document.frm4.email.value ) + "&mobilePhone=" + encodeURIComponent( document.frm4.mobilePhone.value ) + "&phone=" + encodeURIComponent( document.frm4.phone.value ) + "&gender=" + encodeURIComponent( document.frm4.gender.value ) + "&nationality=" + encodeURIComponent( document.frm4.nationality.value ) + "&address=" + encodeURIComponent( document.frm4.address.value ) + "&town=" + encodeURIComponent( document.frm4.town.value ) + "&state=" + encodeURIComponent( document.frm4.state.value ) + "&zip=" + encodeURIComponent( document.frm4.zip.value ) + "&country=" + encodeURIComponent( document.frm4.country.value ) + "&customerName2=" + encodeURIComponent( document.frm4.customerName2.value ) + "&gender2=" + encodeURIComponent( document.frm4.gender2.value ) + "&nationality2=" + encodeURIComponent( document.frm4.nationality2.value ) + "&bed=" + encodeURIComponent( document.frm4.bed.value ) + "&airport=" + encodeURIComponent( document.frm4.airport.value ) + "¬es=" + encodeURIComponent( document.frm4.notes.value ) + "&hearFrom=" + encodeURIComponent( document.frm4.hearFrom.value ) + "&price=" + encodeURIComponent( document.frm4.price.value ); pause(500); ajaxpage('/calendar/load-bookingform.php?ac=book&cid=4&'+poststr,'DateBookings4','get'); } else { alert("You have to accept our Terms & Conditions"); } } function submitBooking5(from, to, sMonth, sYear) { if(document.frm5.terms.checked == true){ var poststr = "ac=book&startDate="+from+"&endDate="+to + "&customerName=" + encodeURIComponent( document.frm5.customerName.value ) + "&email=" + encodeURIComponent( document.frm5.email.value ) + "&mobilePhone=" + encodeURIComponent( document.frm5.mobilePhone.value ) + "&phone=" + encodeURIComponent( document.frm5.phone.value ) + "&gender=" + encodeURIComponent( document.frm5.gender.value ) + "&nationality=" + encodeURIComponent( document.frm5.nationality.value ) + "&address=" + encodeURIComponent( document.frm5.address.value ) + "&town=" + encodeURIComponent( document.frm5.town.value ) + "&state=" + encodeURIComponent( document.frm5.state.value ) + "&zip=" + encodeURIComponent( document.frm5.zip.value ) + "&country=" + encodeURIComponent( document.frm5.country.value ) + "&customerName2=" + encodeURIComponent( document.frm5.customerName2.value ) + "&gender2=" + encodeURIComponent( document.frm5.gender2.value ) + "&nationality2=" + encodeURIComponent( document.frm5.nationality2.value ) + "&bed=" + encodeURIComponent( document.frm5.bed.value ) + "&airport=" + encodeURIComponent( document.frm5.airport.value ) + "¬es=" + encodeURIComponent( document.frm5.notes.value ) + "&hearFrom=" + encodeURIComponent( document.frm5.hearFrom.value ) + "&price=" + encodeURIComponent( document.frm5.price.value ); pause(500); ajaxpage('/calendar/load-bookingform.php?ac=book&cid=5&'+poststr,'DateBookings5','get'); } else { alert("You have to accept our Terms & Conditions"); } } function submitBooking6(from, to, sMonth, sYear) { if(document.frm6.terms.checked == true){ var poststr = "ac=book&startDate="+from+"&endDate="+to + "&customerName=" + encodeURIComponent( document.frm6.customerName.value ) + "&email=" + encodeURIComponent( document.frm6.email.value ) + "&mobilePhone=" + encodeURIComponent( document.frm6.mobilePhone.value ) + "&phone=" + encodeURIComponent( document.frm6.phone.value ) + "&gender=" + encodeURIComponent( document.frm6.gender.value ) + "&nationality=" + encodeURIComponent( document.frm6.nationality.value ) + "&address=" + encodeURIComponent( document.frm6.address.value ) + "&town=" + encodeURIComponent( document.frm6.town.value ) + "&state=" + encodeURIComponent( document.frm6.state.value ) + "&zip=" + encodeURIComponent( document.frm6.zip.value ) + "&country=" + encodeURIComponent( document.frm6.country.value ) + "&customerName2=" + encodeURIComponent( document.frm6.customerName2.value ) + "&gender2=" + encodeURIComponent( document.frm6.gender2.value ) + "&nationality2=" + encodeURIComponent( document.frm6.nationality2.value ) + "&bed=" + encodeURIComponent( document.frm6.bed.value ) + "&airport=" + encodeURIComponent( document.frm6.airport.value ) + "¬es=" + encodeURIComponent( document.frm6.notes.value ) + "&hearFrom=" + encodeURIComponent( document.frm6.hearFrom.value ) + "&price=" + encodeURIComponent( document.frm6.price.value ); pause(500); ajaxpage('/calendar/load-bookingform.php?ac=book&cid=6&'+poststr,'DateBookings6','get'); } else { alert("You have to accept our Terms & Conditions"); } } loadCalendar = '
 
 
 
'; document.writeln(loadCalendar);