var flagCaptcha = false; var flagFields = true; var message = 'Please fill in all mandatory fields ! \n'; var halfbooked = true; 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 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 ShowSelection(direction,index,leftrange,rightrange,startSelectedstatus,endSelectedstatus) { if(leftrange > 0 ){ var nox=1; while(nox < leftrange){ document.getElementById('m1_'+ nox).style.background='#DBE6DB'; nox++; } if(startSelectedstatus == 1){ document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=F4E6E6&color2=DBE6DB) center'; }else if(startSelectedstatus == 2){ document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=FFFF99&color2=DBE6DB) center'; } else { document.getElementById('m1_'+ nox).style.background='#DBE6DB'; } } var nox=0; while(nox < rightrange){ document.getElementById('m2_'+ nox).style.background='#DBE6DB'; nox++; } if(endSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=F4E6E6) center'; }else if(endSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FFFF99) center'; } else { document.getElementById('m2_'+ nox).style.background='#DBE6DB'; } if(direction == 1){ if(leftrange > 0 ){ var nox=0; if(leftrange == 0 ){ if(startSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=F4E6E6&color2=FED19A) center'; }else if(startSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FFFF99&color2=FED19A) center'; }else if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; } else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FED19A) center'; } }else if(rightrange == 0){ if(endSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=F4E6E6) center'; }else if(endSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=FFFF99) center'; }else if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; } else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=DBE6DB) center'; } } else { if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; }else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=DBE6DB) center'; } } var nox=1; while(nox < index){ document.getElementById('m1_'+ nox).style.background='#FED19A'; nox++; } if(index == leftrange ){ if(startSelectedstatus == 1){ document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=F4E6E6&color2=FED19A) center'; }else if(startSelectedstatus == 2){ document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=FFFF99&color2=FED19A) center'; }else if(halfbooked == false){ document.getElementById('m1_'+ nox).style.background='#FED19A'; } else { document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FED19A) center'; } } else { if(halfbooked == false){ document.getElementById('m1_'+ nox).style.background='#FED19A'; }else { document.getElementById('m1_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FED19A) center'; } } } } if(direction == 2){ var nox=0; if(leftrange == 0 ){ if(startSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=F4E6E6&color2=FED19A) center'; }else if(startSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FFFF99&color2=FED19A) center'; }else if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; } else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FED19A) center'; } }else if(rightrange == 0){ if(endSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=F4E6E6) center'; }else if(endSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=FFFF99) center'; }else if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; } else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=DBE6DB) center'; } } else { if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; }else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=DBE6DB&color2=FED19A) center'; } } var nox=1; while(nox < index){ document.getElementById('m2_'+ nox).style.background='#FED19A'; nox++; } if(index > 0 ){ if(index == rightrange ){ if(endSelectedstatus == 1){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=F4E6E6) center'; }else if(endSelectedstatus == 2){ document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=FFFF99) center'; }else if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; } else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=DBE6DB) center'; } } else { if(halfbooked == false){ document.getElementById('m2_'+ nox).style.background='#FED19A'; }else { document.getElementById('m2_'+ nox).style.background='url(/booking/image.php?color1=FED19A&color2=DBE6DB) center'; } } } } } function submitBooking(from, to, sMonth, sYear) { var poststr = "ac=book&startDate="+from+"&endDate="+to+"&customerName=" + encodeURIComponent( document.frm.customerName.value ) + "&email=" + encodeURIComponent( document.frm.email.value ) + "&phone=" + encodeURIComponent( document.frm.phone.value ) + "&guests=" + encodeURIComponent( document.frm.guests.value ) + "&address=" + encodeURIComponent( document.frm.address.value ) + "&phone2=" + encodeURIComponent( document.frm.phone2.value ) + "&city=" + encodeURIComponent( document.frm.city.value ) + "&country=" + encodeURIComponent( document.frm.country.value ) + "¬es=" + encodeURIComponent( document.frm.notes.value ) + "&price=" + encodeURIComponent( document.frm.price.value ); ajaxpage('/booking/load-bookingform.php?ac=book&cid=123&Config_lang=english&'+poststr,'DateBookings123','get'); ajaxpage('/booking/load-calendar2.php?cid=123&Config_lang=english&month='+sMonth+'&year='+sYear,'AvailabilityCalendar123','get'); }; function submitBooking3(sMonth, sYear) { var form = document.frm; if (form.customerName.value=="" || (form.phone.value=="" && form.phone2.value=="" )|| form.email.value==""){ alert("Please Enter Your Name, Email-Address And A Short Message At Least!"); } else{ var poststr = "ac=book&startDate="+encodeURIComponent( document.frm.fyear.value )+"-"+encodeURIComponent( document.frm.fmonth.value )+"-"+encodeURIComponent( document.frm.fday.value )+"&endDate="+encodeURIComponent( document.frm.tyear.value )+"-"+encodeURIComponent( document.frm.tmonth.value )+"-"+encodeURIComponent( document.frm.tday.value )+"&customerName=" + encodeURIComponent( document.frm.customerName.value ) + "&email=" + encodeURIComponent( document.frm.email.value ) + "&phone=" + encodeURIComponent( document.frm.phone.value ) + "&guests=" + encodeURIComponent( document.frm.guests.value ) + "&address=" + encodeURIComponent( document.frm.address.value ) + "&phone2=" + encodeURIComponent( document.frm.phone2.value ) + "&city=" + encodeURIComponent( document.frm.city.value ) + "&country=" + encodeURIComponent( document.frm.country.value ) + "¬es=" + encodeURIComponent( document.frm.notes.value ) + "&price=" + encodeURIComponent( document.frm.price.value ); ajaxpage('/booking/load-bookingform.php?ac=book&cid=123&Config_lang=english&'+poststr,'DateBookings123','get'); ajaxpage('/booking/load-calendar2.php?cid=123&Config_lang=english&month='+sMonth+'&year='+sYear,'AvailabilityCalendar123','get'); } }; function submitcheck() { if (Number(document.frm.tyear.value) < Number(document.frm.fyear.value )) { document.frm.tyear.value=document.frm.fyear.value; document.frm.tmonth.value=document.frm.fmonth.value; document.frm.tday.value=document.frm.fday.value; } else if ((Number(document.frm.tmonth.value) < Number(document.frm.fmonth.value ))&& (Number(document.frm.tyear.value) <= Number(document.frm.fyear.value ))){ document.frm.tmonth.value=document.frm.fmonth.value; document.frm.tday.value=document.frm.fday.value; } else if ((Number(document.frm.tday.value) < Number(document.frm.fday.value )) && (Number(document.frm.tmonth.value) <= Number(document.frm.fmonth.value )) && (Number(document.frm.tyear.value) <= Number(document.frm.fyear.value ))){ document.frm.tday.value=document.frm.fday.value; }; var poststr2 = "ac=check&from="+encodeURIComponent( document.frm.fyear.value )+"-"+encodeURIComponent( document.frm.fmonth.value )+"-"+encodeURIComponent( document.frm.fday.value )+"&to="+encodeURIComponent( document.frm.tyear.value )+"-"+encodeURIComponent( document.frm.tmonth.value )+"-"+encodeURIComponent( document.frm.tday.value )+"&customerName=" + encodeURIComponent( document.frm.customerName.value ) + "&email=" + encodeURIComponent( document.frm.email.value ) + "&phone=" + encodeURIComponent( document.frm.phone.value ) + "&guests=" + encodeURIComponent( document.frm.guests.value ) + "&address=" + encodeURIComponent( document.frm.address.value ) + "&phone2=" + encodeURIComponent( document.frm.phone2.value ) + "&city=" + encodeURIComponent( document.frm.city.value ) + "&country=" + encodeURIComponent( document.frm.country.value ) + "¬es=" + encodeURIComponent( document.frm.notes.value ) + "&price=" + encodeURIComponent( document.frm.price.value ); ajaxpage('/booking/load-bookingform.php?ac=check&cid=123&Config_lang=english&'+poststr2,'DateBookings123','get'); ajaxpage('/booking/load-calendar2.php?act=check&cid=123&Config_lang=english&month='+encodeURIComponent( document.frm.fmonth.value )+'&year='+encodeURIComponent( document.frm.fyear.value )+'&from='+encodeURIComponent( document.frm.fyear.value )+'-'+encodeURIComponent( document.frm.fmonth.value )+'-'+encodeURIComponent( document.frm.fday.value )+'&to='+encodeURIComponent( document.frm.tyear.value )+'-'+encodeURIComponent( document.frm.tmonth.value )+'-'+encodeURIComponent( document.frm.tday.value ),'AvailabilityCalendar123','get'); }; function getprice(from, to, guests, cid) { ajaxpagegetprice('/booking/getprice.php?from='+from+'&to='+to+'&guests='+guests+'&cid='+cid,'getpricediv123'); }; function submitBooking2(from, to, sMonth, sYear) { var form = document.frm; if (form.customerName.value=="" || (form.phone.value=="" && form.phone2.value=="" )|| form.email.value==""){ alert("Please Enter Your Name, Email-Address And A Short Message At Least!"); } else{ var poststr = "ac=book&startDate="+from+"&endDate="+to+"&customerName=" + encodeURIComponent( document.frm.customerName.value ) + "&email=" + encodeURIComponent( document.frm.email.value ) + "&phone=" + encodeURIComponent( document.frm.phone.value ) + "&guests=" + encodeURIComponent( document.frm.guests.value ) + "&address=" + encodeURIComponent( document.frm.address.value ) + "&phone2=" + encodeURIComponent( document.frm.phone2.value ) + "&city=" + encodeURIComponent( document.frm.city.value ) + "&country=" + encodeURIComponent( document.frm.country.value ) + "¬es=" + encodeURIComponent( document.frm.notes.value ) + "&price=" + encodeURIComponent( document.frm.price.value ); ajaxpage('/booking/load-bookingform.php?ac=book&cid=123&Config_lang=english&'+poststr,'DateBookings123','get'); ajaxpage('/booking/load-calendar2.php?cid=123&Config_lang=english&month='+sMonth+'&year='+sYear,'AvailabilityCalendar123','get'); } }; function ajaxpagegetprice(url, containerid){ 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) page_request.onreadystatechange=function(){ loadpagegetprice(page_request, containerid) } } function loadpagegetprice(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 + ' ' + '€'; document.frm.price.value=page_request.responseText; }; } loadCalendar = '
'; document.writeln(loadCalendar);