var s_id112=0; var cur_id112=0; var first112=0; var last112=0; var sum112=0; var half_day112=0; var calendar_id112=112; var total_msg='Total nights so far: '; var min_bl112=3; var max_bl112=99; var res_ids112=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint112(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first112==1) { half_day112=0; sum112=0; last112=0; for (var i=0;i < res_ids112.length;i++) { if ((s_id112 < res_ids112[i] && res_ids112[i] < o_id)||(s_id112 > res_ids112[i] && res_ids112[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id112))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl112) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl112 + ' nights'; ; return; } if (o_id>s_id112) { for (var i=s_id112;i<=o_id;i=i+(60*60*24)) { try { if (last112) { cur_id112=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id112) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id112=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last112=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last112=1; } else if (thestyle.scope==1) { if (s_id112==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum112=parseFloat(sum112)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id112;i>=o_id;i=i-(60*60*24)) { try { if (last112) { cur_id112=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last112=1; if (i==s_id112) { half_day112=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last112=1; if (i==s_id112) { half_day112=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id112) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day112=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day112=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id112=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id112==i) { if (s_id112==o_id) { var e = (window.event) ? window.event : evnt; var half112=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum112=parseFloat(sum112)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id112>o_id && o_id>=s_id112) { var i=o_id; for (i=i+(60*60*24);i<=cur_id112;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id112 < s_id112 && o_id>=s_id112) { var i=cur_id112; for (i;i < s_id112;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id112 < o_id && o_id<=s_id112) { var i=cur_id112; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id112>s_id112 && o_id<=s_id112) { var i=s_id112; for (i=i+(60*60*24);i<=cur_id112;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id112=o_id; } if (o_id==-1) { var i=s_id112; for (i;i <= cur_id112;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id112+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes112() { cal_id_len=0; temp_cal_id=calendar_id112; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids112.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick112(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl112 = min_booking; if (first112==1) { var tdays=Math.abs(eval(o_id-s_id112))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id112+cur_id112);sum112=parseFloat(sum112)-parseFloat(thestyle.abbr); if (tdays < min_bl112) { document.getElementById("Messages").innerHTML='Minimum '+min_bl112+' nights per booking'; } else { if (s_id112>cur_id112) { var sdate = new Date(cur_id112 * 1000); var edate = new Date(s_id112 * 1000); } else { var sdate = new Date(s_id112 * 1000); var edate = new Date(cur_id112 * 1000); } if (s_id112!=cur_id112) { half_day112=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day112+'&from='+s_id112+'&to='+cur_id112+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first112=0; res_ids112=new Array(); } else { if (s_id112>0) { if (s_id112>cur_id112) { var tmp_id=s_id112; s_id112=cur_id112; cur_id112=tmp_id; } updatePaint112(evnt,'-1',s_col,f_col,p_col,b_col,url); } first112=1; s_id112=o_id; cur_id112=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint112(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes112(); }; } 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 checkUserRegistrationForm112(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm112.customerName.value; address = document.frm112.address.value; zip = document.frm112.zip.value; country = document.frm112.country.value; email = document.frm112.email.value; phone = document.frm112.phone.value; confirm_email = document.frm112.confirm_email.value; terms = document.frm112.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice112(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm112.guests.value) + parseInt(document.frm112.children.value) + parseInt(document.frm112.infant.value); document.getElementById("priceDiv112").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv112").innerHTML = deposit[(totalGuests-1)]; document.frm112.price.value = prices[(totalGuests-1)]; } function ProcessingBooking112() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking112(from, to, sMonth, sYear) { if(checkUserRegistrationForm112()){ s_id112=0; cur_id112=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm112.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm112.customerName.value ) + "&address=" + encodeURIComponent( document.frm112.address.value ) + "&zip=" + encodeURIComponent( document.frm112.zip.value ) + "&country=" + encodeURIComponent( document.frm112.country.value ) + "&phone=" + encodeURIComponent( document.frm112.phone.value ) + "&email=" + encodeURIComponent( document.frm112.email.value ) + "&guests=" + encodeURIComponent( document.frm112.guests.value ) + "&children=" + encodeURIComponent( document.frm112.children.value ) + "&infant=" + encodeURIComponent( document.frm112.infant.value ) + "¬es=" + encodeURIComponent( document.frm112.notes.value ) + "&price=" + encodeURIComponent( document.frm112.price.value ) + "&payment_type=" + encodeURIComponent( document.frm112.payment_type.value ) + "&code=" + encodeURIComponent( document.frm112.code.value ) + "&flight_no=" + encodeURIComponent( document.frm112.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm112.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm112.flight_time.value ); ProcessingBooking112(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=112&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF112(){ document.getElementById('TopMessage112').innerHTML=''; }; var s_id115=0; var cur_id115=0; var first115=0; var last115=0; var sum115=0; var half_day115=0; var calendar_id115=115; var total_msg='Total nights so far: '; var min_bl115=3; var max_bl115=99; var res_ids115=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint115(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first115==1) { half_day115=0; sum115=0; last115=0; for (var i=0;i < res_ids115.length;i++) { if ((s_id115 < res_ids115[i] && res_ids115[i] < o_id)||(s_id115 > res_ids115[i] && res_ids115[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id115))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl115) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl115 + ' nights'; ; return; } if (o_id>s_id115) { for (var i=s_id115;i<=o_id;i=i+(60*60*24)) { try { if (last115) { cur_id115=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id115) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id115=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last115=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last115=1; } else if (thestyle.scope==1) { if (s_id115==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum115=parseFloat(sum115)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id115;i>=o_id;i=i-(60*60*24)) { try { if (last115) { cur_id115=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last115=1; if (i==s_id115) { half_day115=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last115=1; if (i==s_id115) { half_day115=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id115) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day115=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day115=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id115=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id115==i) { if (s_id115==o_id) { var e = (window.event) ? window.event : evnt; var half115=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum115=parseFloat(sum115)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id115>o_id && o_id>=s_id115) { var i=o_id; for (i=i+(60*60*24);i<=cur_id115;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id115 < s_id115 && o_id>=s_id115) { var i=cur_id115; for (i;i < s_id115;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id115 < o_id && o_id<=s_id115) { var i=cur_id115; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id115>s_id115 && o_id<=s_id115) { var i=s_id115; for (i=i+(60*60*24);i<=cur_id115;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id115=o_id; } if (o_id==-1) { var i=s_id115; for (i;i <= cur_id115;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id115+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes115() { cal_id_len=0; temp_cal_id=calendar_id115; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids115.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick115(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl115 = min_booking; if (first115==1) { var tdays=Math.abs(eval(o_id-s_id115))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id115+cur_id115);sum115=parseFloat(sum115)-parseFloat(thestyle.abbr); if (tdays < min_bl115) { document.getElementById("Messages").innerHTML='Minimum '+min_bl115+' nights per booking'; } else { if (s_id115>cur_id115) { var sdate = new Date(cur_id115 * 1000); var edate = new Date(s_id115 * 1000); } else { var sdate = new Date(s_id115 * 1000); var edate = new Date(cur_id115 * 1000); } if (s_id115!=cur_id115) { half_day115=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day115+'&from='+s_id115+'&to='+cur_id115+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first115=0; res_ids115=new Array(); } else { if (s_id115>0) { if (s_id115>cur_id115) { var tmp_id=s_id115; s_id115=cur_id115; cur_id115=tmp_id; } updatePaint115(evnt,'-1',s_col,f_col,p_col,b_col,url); } first115=1; s_id115=o_id; cur_id115=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint115(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes115(); }; } 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 checkUserRegistrationForm115(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm115.customerName.value; address = document.frm115.address.value; zip = document.frm115.zip.value; country = document.frm115.country.value; email = document.frm115.email.value; phone = document.frm115.phone.value; confirm_email = document.frm115.confirm_email.value; terms = document.frm115.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice115(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm115.guests.value) + parseInt(document.frm115.children.value) + parseInt(document.frm115.infant.value); document.getElementById("priceDiv115").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv115").innerHTML = deposit[(totalGuests-1)]; document.frm115.price.value = prices[(totalGuests-1)]; } function ProcessingBooking115() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking115(from, to, sMonth, sYear) { if(checkUserRegistrationForm115()){ s_id115=0; cur_id115=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm115.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm115.customerName.value ) + "&address=" + encodeURIComponent( document.frm115.address.value ) + "&zip=" + encodeURIComponent( document.frm115.zip.value ) + "&country=" + encodeURIComponent( document.frm115.country.value ) + "&phone=" + encodeURIComponent( document.frm115.phone.value ) + "&email=" + encodeURIComponent( document.frm115.email.value ) + "&guests=" + encodeURIComponent( document.frm115.guests.value ) + "&children=" + encodeURIComponent( document.frm115.children.value ) + "&infant=" + encodeURIComponent( document.frm115.infant.value ) + "¬es=" + encodeURIComponent( document.frm115.notes.value ) + "&price=" + encodeURIComponent( document.frm115.price.value ) + "&payment_type=" + encodeURIComponent( document.frm115.payment_type.value ) + "&code=" + encodeURIComponent( document.frm115.code.value ) + "&flight_no=" + encodeURIComponent( document.frm115.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm115.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm115.flight_time.value ); ProcessingBooking115(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=115&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF115(){ document.getElementById('TopMessage115').innerHTML=''; }; var s_id105=0; var cur_id105=0; var first105=0; var last105=0; var sum105=0; var half_day105=0; var calendar_id105=105; var total_msg='Total nights so far: '; var min_bl105=3; var max_bl105=99; var res_ids105=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint105(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first105==1) { half_day105=0; sum105=0; last105=0; for (var i=0;i < res_ids105.length;i++) { if ((s_id105 < res_ids105[i] && res_ids105[i] < o_id)||(s_id105 > res_ids105[i] && res_ids105[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id105))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl105) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl105 + ' nights'; ; return; } if (o_id>s_id105) { for (var i=s_id105;i<=o_id;i=i+(60*60*24)) { try { if (last105) { cur_id105=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id105) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id105=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last105=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last105=1; } else if (thestyle.scope==1) { if (s_id105==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum105=parseFloat(sum105)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id105;i>=o_id;i=i-(60*60*24)) { try { if (last105) { cur_id105=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last105=1; if (i==s_id105) { half_day105=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last105=1; if (i==s_id105) { half_day105=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id105) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day105=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day105=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id105=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id105==i) { if (s_id105==o_id) { var e = (window.event) ? window.event : evnt; var half105=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum105=parseFloat(sum105)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id105>o_id && o_id>=s_id105) { var i=o_id; for (i=i+(60*60*24);i<=cur_id105;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id105 < s_id105 && o_id>=s_id105) { var i=cur_id105; for (i;i < s_id105;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id105 < o_id && o_id<=s_id105) { var i=cur_id105; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id105>s_id105 && o_id<=s_id105) { var i=s_id105; for (i=i+(60*60*24);i<=cur_id105;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id105=o_id; } if (o_id==-1) { var i=s_id105; for (i;i <= cur_id105;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id105+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes105() { cal_id_len=0; temp_cal_id=calendar_id105; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids105.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick105(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl105 = min_booking; if (first105==1) { var tdays=Math.abs(eval(o_id-s_id105))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id105+cur_id105);sum105=parseFloat(sum105)-parseFloat(thestyle.abbr); if (tdays < min_bl105) { document.getElementById("Messages").innerHTML='Minimum '+min_bl105+' nights per booking'; } else { if (s_id105>cur_id105) { var sdate = new Date(cur_id105 * 1000); var edate = new Date(s_id105 * 1000); } else { var sdate = new Date(s_id105 * 1000); var edate = new Date(cur_id105 * 1000); } if (s_id105!=cur_id105) { half_day105=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day105+'&from='+s_id105+'&to='+cur_id105+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first105=0; res_ids105=new Array(); } else { if (s_id105>0) { if (s_id105>cur_id105) { var tmp_id=s_id105; s_id105=cur_id105; cur_id105=tmp_id; } updatePaint105(evnt,'-1',s_col,f_col,p_col,b_col,url); } first105=1; s_id105=o_id; cur_id105=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint105(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes105(); }; } 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 checkUserRegistrationForm105(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm105.customerName.value; address = document.frm105.address.value; zip = document.frm105.zip.value; country = document.frm105.country.value; email = document.frm105.email.value; phone = document.frm105.phone.value; confirm_email = document.frm105.confirm_email.value; terms = document.frm105.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice105(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm105.guests.value) + parseInt(document.frm105.children.value) + parseInt(document.frm105.infant.value); document.getElementById("priceDiv105").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv105").innerHTML = deposit[(totalGuests-1)]; document.frm105.price.value = prices[(totalGuests-1)]; } function ProcessingBooking105() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking105(from, to, sMonth, sYear) { if(checkUserRegistrationForm105()){ s_id105=0; cur_id105=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm105.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm105.customerName.value ) + "&address=" + encodeURIComponent( document.frm105.address.value ) + "&zip=" + encodeURIComponent( document.frm105.zip.value ) + "&country=" + encodeURIComponent( document.frm105.country.value ) + "&phone=" + encodeURIComponent( document.frm105.phone.value ) + "&email=" + encodeURIComponent( document.frm105.email.value ) + "&guests=" + encodeURIComponent( document.frm105.guests.value ) + "&children=" + encodeURIComponent( document.frm105.children.value ) + "&infant=" + encodeURIComponent( document.frm105.infant.value ) + "¬es=" + encodeURIComponent( document.frm105.notes.value ) + "&price=" + encodeURIComponent( document.frm105.price.value ) + "&payment_type=" + encodeURIComponent( document.frm105.payment_type.value ) + "&code=" + encodeURIComponent( document.frm105.code.value ) + "&flight_no=" + encodeURIComponent( document.frm105.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm105.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm105.flight_time.value ); ProcessingBooking105(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=105&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF105(){ document.getElementById('TopMessage105').innerHTML=''; }; var s_id109=0; var cur_id109=0; var first109=0; var last109=0; var sum109=0; var half_day109=0; var calendar_id109=109; var total_msg='Total nights so far: '; var min_bl109=3; var max_bl109=99; var res_ids109=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint109(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first109==1) { half_day109=0; sum109=0; last109=0; for (var i=0;i < res_ids109.length;i++) { if ((s_id109 < res_ids109[i] && res_ids109[i] < o_id)||(s_id109 > res_ids109[i] && res_ids109[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id109))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl109) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl109 + ' nights'; ; return; } if (o_id>s_id109) { for (var i=s_id109;i<=o_id;i=i+(60*60*24)) { try { if (last109) { cur_id109=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id109) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id109=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last109=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last109=1; } else if (thestyle.scope==1) { if (s_id109==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum109=parseFloat(sum109)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id109;i>=o_id;i=i-(60*60*24)) { try { if (last109) { cur_id109=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last109=1; if (i==s_id109) { half_day109=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last109=1; if (i==s_id109) { half_day109=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id109) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day109=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day109=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id109=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id109==i) { if (s_id109==o_id) { var e = (window.event) ? window.event : evnt; var half109=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum109=parseFloat(sum109)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id109>o_id && o_id>=s_id109) { var i=o_id; for (i=i+(60*60*24);i<=cur_id109;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id109 < s_id109 && o_id>=s_id109) { var i=cur_id109; for (i;i < s_id109;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id109 < o_id && o_id<=s_id109) { var i=cur_id109; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id109>s_id109 && o_id<=s_id109) { var i=s_id109; for (i=i+(60*60*24);i<=cur_id109;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id109=o_id; } if (o_id==-1) { var i=s_id109; for (i;i <= cur_id109;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id109+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes109() { cal_id_len=0; temp_cal_id=calendar_id109; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids109.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick109(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl109 = min_booking; if (first109==1) { var tdays=Math.abs(eval(o_id-s_id109))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id109+cur_id109);sum109=parseFloat(sum109)-parseFloat(thestyle.abbr); if (tdays < min_bl109) { document.getElementById("Messages").innerHTML='Minimum '+min_bl109+' nights per booking'; } else { if (s_id109>cur_id109) { var sdate = new Date(cur_id109 * 1000); var edate = new Date(s_id109 * 1000); } else { var sdate = new Date(s_id109 * 1000); var edate = new Date(cur_id109 * 1000); } if (s_id109!=cur_id109) { half_day109=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day109+'&from='+s_id109+'&to='+cur_id109+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first109=0; res_ids109=new Array(); } else { if (s_id109>0) { if (s_id109>cur_id109) { var tmp_id=s_id109; s_id109=cur_id109; cur_id109=tmp_id; } updatePaint109(evnt,'-1',s_col,f_col,p_col,b_col,url); } first109=1; s_id109=o_id; cur_id109=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint109(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes109(); }; } 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 checkUserRegistrationForm109(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm109.customerName.value; address = document.frm109.address.value; zip = document.frm109.zip.value; country = document.frm109.country.value; email = document.frm109.email.value; phone = document.frm109.phone.value; confirm_email = document.frm109.confirm_email.value; terms = document.frm109.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice109(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm109.guests.value) + parseInt(document.frm109.children.value) + parseInt(document.frm109.infant.value); document.getElementById("priceDiv109").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv109").innerHTML = deposit[(totalGuests-1)]; document.frm109.price.value = prices[(totalGuests-1)]; } function ProcessingBooking109() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking109(from, to, sMonth, sYear) { if(checkUserRegistrationForm109()){ s_id109=0; cur_id109=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm109.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm109.customerName.value ) + "&address=" + encodeURIComponent( document.frm109.address.value ) + "&zip=" + encodeURIComponent( document.frm109.zip.value ) + "&country=" + encodeURIComponent( document.frm109.country.value ) + "&phone=" + encodeURIComponent( document.frm109.phone.value ) + "&email=" + encodeURIComponent( document.frm109.email.value ) + "&guests=" + encodeURIComponent( document.frm109.guests.value ) + "&children=" + encodeURIComponent( document.frm109.children.value ) + "&infant=" + encodeURIComponent( document.frm109.infant.value ) + "¬es=" + encodeURIComponent( document.frm109.notes.value ) + "&price=" + encodeURIComponent( document.frm109.price.value ) + "&payment_type=" + encodeURIComponent( document.frm109.payment_type.value ) + "&code=" + encodeURIComponent( document.frm109.code.value ) + "&flight_no=" + encodeURIComponent( document.frm109.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm109.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm109.flight_time.value ); ProcessingBooking109(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=109&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF109(){ document.getElementById('TopMessage109').innerHTML=''; }; var s_id20=0; var cur_id20=0; var first20=0; var last20=0; var sum20=0; var half_day20=0; var calendar_id20=20; var total_msg='Total nights so far: '; var min_bl20=3; var max_bl20=99; var res_ids20=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint20(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first20==1) { half_day20=0; sum20=0; last20=0; for (var i=0;i < res_ids20.length;i++) { if ((s_id20 < res_ids20[i] && res_ids20[i] < o_id)||(s_id20 > res_ids20[i] && res_ids20[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id20))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl20) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl20 + ' nights'; ; return; } if (o_id>s_id20) { for (var i=s_id20;i<=o_id;i=i+(60*60*24)) { try { if (last20) { cur_id20=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id20) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id20=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last20=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last20=1; } else if (thestyle.scope==1) { if (s_id20==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum20=parseFloat(sum20)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id20;i>=o_id;i=i-(60*60*24)) { try { if (last20) { cur_id20=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last20=1; if (i==s_id20) { half_day20=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last20=1; if (i==s_id20) { half_day20=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id20) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day20=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day20=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id20=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id20==i) { if (s_id20==o_id) { var e = (window.event) ? window.event : evnt; var half20=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum20=parseFloat(sum20)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id20>o_id && o_id>=s_id20) { var i=o_id; for (i=i+(60*60*24);i<=cur_id20;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id20 < s_id20 && o_id>=s_id20) { var i=cur_id20; for (i;i < s_id20;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id20 < o_id && o_id<=s_id20) { var i=cur_id20; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id20>s_id20 && o_id<=s_id20) { var i=s_id20; for (i=i+(60*60*24);i<=cur_id20;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id20=o_id; } if (o_id==-1) { var i=s_id20; for (i;i <= cur_id20;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id20+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes20() { cal_id_len=0; temp_cal_id=calendar_id20; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids20.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick20(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl20 = min_booking; if (first20==1) { var tdays=Math.abs(eval(o_id-s_id20))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id20+cur_id20);sum20=parseFloat(sum20)-parseFloat(thestyle.abbr); if (tdays < min_bl20) { document.getElementById("Messages").innerHTML='Minimum '+min_bl20+' nights per booking'; } else { if (s_id20>cur_id20) { var sdate = new Date(cur_id20 * 1000); var edate = new Date(s_id20 * 1000); } else { var sdate = new Date(s_id20 * 1000); var edate = new Date(cur_id20 * 1000); } if (s_id20!=cur_id20) { half_day20=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day20+'&from='+s_id20+'&to='+cur_id20+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first20=0; res_ids20=new Array(); } else { if (s_id20>0) { if (s_id20>cur_id20) { var tmp_id=s_id20; s_id20=cur_id20; cur_id20=tmp_id; } updatePaint20(evnt,'-1',s_col,f_col,p_col,b_col,url); } first20=1; s_id20=o_id; cur_id20=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint20(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes20(); }; } 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 checkUserRegistrationForm20(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm20.customerName.value; address = document.frm20.address.value; zip = document.frm20.zip.value; country = document.frm20.country.value; email = document.frm20.email.value; phone = document.frm20.phone.value; confirm_email = document.frm20.confirm_email.value; terms = document.frm20.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice20(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm20.guests.value) + parseInt(document.frm20.children.value) + parseInt(document.frm20.infant.value); document.getElementById("priceDiv20").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv20").innerHTML = deposit[(totalGuests-1)]; document.frm20.price.value = prices[(totalGuests-1)]; } function ProcessingBooking20() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking20(from, to, sMonth, sYear) { if(checkUserRegistrationForm20()){ s_id20=0; cur_id20=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm20.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm20.customerName.value ) + "&address=" + encodeURIComponent( document.frm20.address.value ) + "&zip=" + encodeURIComponent( document.frm20.zip.value ) + "&country=" + encodeURIComponent( document.frm20.country.value ) + "&phone=" + encodeURIComponent( document.frm20.phone.value ) + "&email=" + encodeURIComponent( document.frm20.email.value ) + "&guests=" + encodeURIComponent( document.frm20.guests.value ) + "&children=" + encodeURIComponent( document.frm20.children.value ) + "&infant=" + encodeURIComponent( document.frm20.infant.value ) + "¬es=" + encodeURIComponent( document.frm20.notes.value ) + "&price=" + encodeURIComponent( document.frm20.price.value ) + "&payment_type=" + encodeURIComponent( document.frm20.payment_type.value ) + "&code=" + encodeURIComponent( document.frm20.code.value ) + "&flight_no=" + encodeURIComponent( document.frm20.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm20.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm20.flight_time.value ); ProcessingBooking20(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=20&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF20(){ document.getElementById('TopMessage20').innerHTML=''; }; var s_id24=0; var cur_id24=0; var first24=0; var last24=0; var sum24=0; var half_day24=0; var calendar_id24=24; var total_msg='Total nights so far: '; var min_bl24=3; var max_bl24=99; var res_ids24=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint24(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first24==1) { half_day24=0; sum24=0; last24=0; for (var i=0;i < res_ids24.length;i++) { if ((s_id24 < res_ids24[i] && res_ids24[i] < o_id)||(s_id24 > res_ids24[i] && res_ids24[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id24))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl24) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl24 + ' nights'; ; return; } if (o_id>s_id24) { for (var i=s_id24;i<=o_id;i=i+(60*60*24)) { try { if (last24) { cur_id24=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id24) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id24=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last24=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last24=1; } else if (thestyle.scope==1) { if (s_id24==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum24=parseFloat(sum24)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id24;i>=o_id;i=i-(60*60*24)) { try { if (last24) { cur_id24=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last24=1; if (i==s_id24) { half_day24=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last24=1; if (i==s_id24) { half_day24=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id24) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day24=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day24=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id24=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id24==i) { if (s_id24==o_id) { var e = (window.event) ? window.event : evnt; var half24=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum24=parseFloat(sum24)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id24>o_id && o_id>=s_id24) { var i=o_id; for (i=i+(60*60*24);i<=cur_id24;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id24 < s_id24 && o_id>=s_id24) { var i=cur_id24; for (i;i < s_id24;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id24 < o_id && o_id<=s_id24) { var i=cur_id24; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id24>s_id24 && o_id<=s_id24) { var i=s_id24; for (i=i+(60*60*24);i<=cur_id24;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id24=o_id; } if (o_id==-1) { var i=s_id24; for (i;i <= cur_id24;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id24+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes24() { cal_id_len=0; temp_cal_id=calendar_id24; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids24.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick24(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl24 = min_booking; if (first24==1) { var tdays=Math.abs(eval(o_id-s_id24))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id24+cur_id24);sum24=parseFloat(sum24)-parseFloat(thestyle.abbr); if (tdays < min_bl24) { document.getElementById("Messages").innerHTML='Minimum '+min_bl24+' nights per booking'; } else { if (s_id24>cur_id24) { var sdate = new Date(cur_id24 * 1000); var edate = new Date(s_id24 * 1000); } else { var sdate = new Date(s_id24 * 1000); var edate = new Date(cur_id24 * 1000); } if (s_id24!=cur_id24) { half_day24=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day24+'&from='+s_id24+'&to='+cur_id24+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first24=0; res_ids24=new Array(); } else { if (s_id24>0) { if (s_id24>cur_id24) { var tmp_id=s_id24; s_id24=cur_id24; cur_id24=tmp_id; } updatePaint24(evnt,'-1',s_col,f_col,p_col,b_col,url); } first24=1; s_id24=o_id; cur_id24=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint24(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes24(); }; } 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 checkUserRegistrationForm24(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm24.customerName.value; address = document.frm24.address.value; zip = document.frm24.zip.value; country = document.frm24.country.value; email = document.frm24.email.value; phone = document.frm24.phone.value; confirm_email = document.frm24.confirm_email.value; terms = document.frm24.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice24(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm24.guests.value) + parseInt(document.frm24.children.value) + parseInt(document.frm24.infant.value); document.getElementById("priceDiv24").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv24").innerHTML = deposit[(totalGuests-1)]; document.frm24.price.value = prices[(totalGuests-1)]; } function ProcessingBooking24() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking24(from, to, sMonth, sYear) { if(checkUserRegistrationForm24()){ s_id24=0; cur_id24=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm24.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm24.customerName.value ) + "&address=" + encodeURIComponent( document.frm24.address.value ) + "&zip=" + encodeURIComponent( document.frm24.zip.value ) + "&country=" + encodeURIComponent( document.frm24.country.value ) + "&phone=" + encodeURIComponent( document.frm24.phone.value ) + "&email=" + encodeURIComponent( document.frm24.email.value ) + "&guests=" + encodeURIComponent( document.frm24.guests.value ) + "&children=" + encodeURIComponent( document.frm24.children.value ) + "&infant=" + encodeURIComponent( document.frm24.infant.value ) + "¬es=" + encodeURIComponent( document.frm24.notes.value ) + "&price=" + encodeURIComponent( document.frm24.price.value ) + "&payment_type=" + encodeURIComponent( document.frm24.payment_type.value ) + "&code=" + encodeURIComponent( document.frm24.code.value ) + "&flight_no=" + encodeURIComponent( document.frm24.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm24.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm24.flight_time.value ); ProcessingBooking24(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=24&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF24(){ document.getElementById('TopMessage24').innerHTML=''; }; var s_id39=0; var cur_id39=0; var first39=0; var last39=0; var sum39=0; var half_day39=0; var calendar_id39=39; var total_msg='Total nights so far: '; var min_bl39=3; var max_bl39=99; var res_ids39=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint39(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first39==1) { half_day39=0; sum39=0; last39=0; for (var i=0;i < res_ids39.length;i++) { if ((s_id39 < res_ids39[i] && res_ids39[i] < o_id)||(s_id39 > res_ids39[i] && res_ids39[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id39))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl39) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl39 + ' nights'; ; return; } if (o_id>s_id39) { for (var i=s_id39;i<=o_id;i=i+(60*60*24)) { try { if (last39) { cur_id39=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id39) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id39=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last39=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last39=1; } else if (thestyle.scope==1) { if (s_id39==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum39=parseFloat(sum39)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id39;i>=o_id;i=i-(60*60*24)) { try { if (last39) { cur_id39=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last39=1; if (i==s_id39) { half_day39=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last39=1; if (i==s_id39) { half_day39=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id39) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day39=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day39=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id39=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id39==i) { if (s_id39==o_id) { var e = (window.event) ? window.event : evnt; var half39=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum39=parseFloat(sum39)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id39>o_id && o_id>=s_id39) { var i=o_id; for (i=i+(60*60*24);i<=cur_id39;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id39 < s_id39 && o_id>=s_id39) { var i=cur_id39; for (i;i < s_id39;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id39 < o_id && o_id<=s_id39) { var i=cur_id39; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id39>s_id39 && o_id<=s_id39) { var i=s_id39; for (i=i+(60*60*24);i<=cur_id39;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id39=o_id; } if (o_id==-1) { var i=s_id39; for (i;i <= cur_id39;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id39+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes39() { cal_id_len=0; temp_cal_id=calendar_id39; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids39.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick39(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl39 = min_booking; if (first39==1) { var tdays=Math.abs(eval(o_id-s_id39))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id39+cur_id39);sum39=parseFloat(sum39)-parseFloat(thestyle.abbr); if (tdays < min_bl39) { document.getElementById("Messages").innerHTML='Minimum '+min_bl39+' nights per booking'; } else { if (s_id39>cur_id39) { var sdate = new Date(cur_id39 * 1000); var edate = new Date(s_id39 * 1000); } else { var sdate = new Date(s_id39 * 1000); var edate = new Date(cur_id39 * 1000); } if (s_id39!=cur_id39) { half_day39=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day39+'&from='+s_id39+'&to='+cur_id39+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first39=0; res_ids39=new Array(); } else { if (s_id39>0) { if (s_id39>cur_id39) { var tmp_id=s_id39; s_id39=cur_id39; cur_id39=tmp_id; } updatePaint39(evnt,'-1',s_col,f_col,p_col,b_col,url); } first39=1; s_id39=o_id; cur_id39=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint39(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes39(); }; } 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 checkUserRegistrationForm39(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm39.customerName.value; address = document.frm39.address.value; zip = document.frm39.zip.value; country = document.frm39.country.value; email = document.frm39.email.value; phone = document.frm39.phone.value; confirm_email = document.frm39.confirm_email.value; terms = document.frm39.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice39(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm39.guests.value) + parseInt(document.frm39.children.value) + parseInt(document.frm39.infant.value); document.getElementById("priceDiv39").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv39").innerHTML = deposit[(totalGuests-1)]; document.frm39.price.value = prices[(totalGuests-1)]; } function ProcessingBooking39() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking39(from, to, sMonth, sYear) { if(checkUserRegistrationForm39()){ s_id39=0; cur_id39=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm39.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm39.customerName.value ) + "&address=" + encodeURIComponent( document.frm39.address.value ) + "&zip=" + encodeURIComponent( document.frm39.zip.value ) + "&country=" + encodeURIComponent( document.frm39.country.value ) + "&phone=" + encodeURIComponent( document.frm39.phone.value ) + "&email=" + encodeURIComponent( document.frm39.email.value ) + "&guests=" + encodeURIComponent( document.frm39.guests.value ) + "&children=" + encodeURIComponent( document.frm39.children.value ) + "&infant=" + encodeURIComponent( document.frm39.infant.value ) + "¬es=" + encodeURIComponent( document.frm39.notes.value ) + "&price=" + encodeURIComponent( document.frm39.price.value ) + "&payment_type=" + encodeURIComponent( document.frm39.payment_type.value ) + "&code=" + encodeURIComponent( document.frm39.code.value ) + "&flight_no=" + encodeURIComponent( document.frm39.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm39.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm39.flight_time.value ); ProcessingBooking39(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=39&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF39(){ document.getElementById('TopMessage39').innerHTML=''; }; var s_id31=0; var cur_id31=0; var first31=0; var last31=0; var sum31=0; var half_day31=0; var calendar_id31=31; var total_msg='Total nights so far: '; var min_bl31=3; var max_bl31=99; var res_ids31=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint31(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first31==1) { half_day31=0; sum31=0; last31=0; for (var i=0;i < res_ids31.length;i++) { if ((s_id31 < res_ids31[i] && res_ids31[i] < o_id)||(s_id31 > res_ids31[i] && res_ids31[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id31))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl31) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl31 + ' nights'; ; return; } if (o_id>s_id31) { for (var i=s_id31;i<=o_id;i=i+(60*60*24)) { try { if (last31) { cur_id31=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id31) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id31=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last31=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last31=1; } else if (thestyle.scope==1) { if (s_id31==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum31=parseFloat(sum31)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id31;i>=o_id;i=i-(60*60*24)) { try { if (last31) { cur_id31=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last31=1; if (i==s_id31) { half_day31=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last31=1; if (i==s_id31) { half_day31=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id31) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day31=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day31=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id31=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id31==i) { if (s_id31==o_id) { var e = (window.event) ? window.event : evnt; var half31=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum31=parseFloat(sum31)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id31>o_id && o_id>=s_id31) { var i=o_id; for (i=i+(60*60*24);i<=cur_id31;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id31 < s_id31 && o_id>=s_id31) { var i=cur_id31; for (i;i < s_id31;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id31 < o_id && o_id<=s_id31) { var i=cur_id31; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id31>s_id31 && o_id<=s_id31) { var i=s_id31; for (i=i+(60*60*24);i<=cur_id31;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id31=o_id; } if (o_id==-1) { var i=s_id31; for (i;i <= cur_id31;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id31+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes31() { cal_id_len=0; temp_cal_id=calendar_id31; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids31.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick31(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl31 = min_booking; if (first31==1) { var tdays=Math.abs(eval(o_id-s_id31))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id31+cur_id31);sum31=parseFloat(sum31)-parseFloat(thestyle.abbr); if (tdays < min_bl31) { document.getElementById("Messages").innerHTML='Minimum '+min_bl31+' nights per booking'; } else { if (s_id31>cur_id31) { var sdate = new Date(cur_id31 * 1000); var edate = new Date(s_id31 * 1000); } else { var sdate = new Date(s_id31 * 1000); var edate = new Date(cur_id31 * 1000); } if (s_id31!=cur_id31) { half_day31=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day31+'&from='+s_id31+'&to='+cur_id31+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first31=0; res_ids31=new Array(); } else { if (s_id31>0) { if (s_id31>cur_id31) { var tmp_id=s_id31; s_id31=cur_id31; cur_id31=tmp_id; } updatePaint31(evnt,'-1',s_col,f_col,p_col,b_col,url); } first31=1; s_id31=o_id; cur_id31=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint31(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes31(); }; } 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 checkUserRegistrationForm31(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm31.customerName.value; address = document.frm31.address.value; zip = document.frm31.zip.value; country = document.frm31.country.value; email = document.frm31.email.value; phone = document.frm31.phone.value; confirm_email = document.frm31.confirm_email.value; terms = document.frm31.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice31(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm31.guests.value) + parseInt(document.frm31.children.value) + parseInt(document.frm31.infant.value); document.getElementById("priceDiv31").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv31").innerHTML = deposit[(totalGuests-1)]; document.frm31.price.value = prices[(totalGuests-1)]; } function ProcessingBooking31() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking31(from, to, sMonth, sYear) { if(checkUserRegistrationForm31()){ s_id31=0; cur_id31=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm31.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm31.customerName.value ) + "&address=" + encodeURIComponent( document.frm31.address.value ) + "&zip=" + encodeURIComponent( document.frm31.zip.value ) + "&country=" + encodeURIComponent( document.frm31.country.value ) + "&phone=" + encodeURIComponent( document.frm31.phone.value ) + "&email=" + encodeURIComponent( document.frm31.email.value ) + "&guests=" + encodeURIComponent( document.frm31.guests.value ) + "&children=" + encodeURIComponent( document.frm31.children.value ) + "&infant=" + encodeURIComponent( document.frm31.infant.value ) + "¬es=" + encodeURIComponent( document.frm31.notes.value ) + "&price=" + encodeURIComponent( document.frm31.price.value ) + "&payment_type=" + encodeURIComponent( document.frm31.payment_type.value ) + "&code=" + encodeURIComponent( document.frm31.code.value ) + "&flight_no=" + encodeURIComponent( document.frm31.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm31.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm31.flight_time.value ); ProcessingBooking31(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=31&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF31(){ document.getElementById('TopMessage31').innerHTML=''; }; var s_id25=0; var cur_id25=0; var first25=0; var last25=0; var sum25=0; var half_day25=0; var calendar_id25=25; var total_msg='Total nights so far: '; var min_bl25=3; var max_bl25=99; var res_ids25=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint25(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first25==1) { half_day25=0; sum25=0; last25=0; for (var i=0;i < res_ids25.length;i++) { if ((s_id25 < res_ids25[i] && res_ids25[i] < o_id)||(s_id25 > res_ids25[i] && res_ids25[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id25))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl25) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl25 + ' nights'; ; return; } if (o_id>s_id25) { for (var i=s_id25;i<=o_id;i=i+(60*60*24)) { try { if (last25) { cur_id25=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id25) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id25=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last25=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last25=1; } else if (thestyle.scope==1) { if (s_id25==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum25=parseFloat(sum25)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id25;i>=o_id;i=i-(60*60*24)) { try { if (last25) { cur_id25=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last25=1; if (i==s_id25) { half_day25=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last25=1; if (i==s_id25) { half_day25=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id25) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day25=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day25=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id25=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id25==i) { if (s_id25==o_id) { var e = (window.event) ? window.event : evnt; var half25=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum25=parseFloat(sum25)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id25>o_id && o_id>=s_id25) { var i=o_id; for (i=i+(60*60*24);i<=cur_id25;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id25 < s_id25 && o_id>=s_id25) { var i=cur_id25; for (i;i < s_id25;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id25 < o_id && o_id<=s_id25) { var i=cur_id25; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id25>s_id25 && o_id<=s_id25) { var i=s_id25; for (i=i+(60*60*24);i<=cur_id25;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id25=o_id; } if (o_id==-1) { var i=s_id25; for (i;i <= cur_id25;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id25+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes25() { cal_id_len=0; temp_cal_id=calendar_id25; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids25.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick25(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl25 = min_booking; if (first25==1) { var tdays=Math.abs(eval(o_id-s_id25))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id25+cur_id25);sum25=parseFloat(sum25)-parseFloat(thestyle.abbr); if (tdays < min_bl25) { document.getElementById("Messages").innerHTML='Minimum '+min_bl25+' nights per booking'; } else { if (s_id25>cur_id25) { var sdate = new Date(cur_id25 * 1000); var edate = new Date(s_id25 * 1000); } else { var sdate = new Date(s_id25 * 1000); var edate = new Date(cur_id25 * 1000); } if (s_id25!=cur_id25) { half_day25=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day25+'&from='+s_id25+'&to='+cur_id25+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first25=0; res_ids25=new Array(); } else { if (s_id25>0) { if (s_id25>cur_id25) { var tmp_id=s_id25; s_id25=cur_id25; cur_id25=tmp_id; } updatePaint25(evnt,'-1',s_col,f_col,p_col,b_col,url); } first25=1; s_id25=o_id; cur_id25=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint25(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes25(); }; } 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 checkUserRegistrationForm25(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm25.customerName.value; address = document.frm25.address.value; zip = document.frm25.zip.value; country = document.frm25.country.value; email = document.frm25.email.value; phone = document.frm25.phone.value; confirm_email = document.frm25.confirm_email.value; terms = document.frm25.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice25(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm25.guests.value) + parseInt(document.frm25.children.value) + parseInt(document.frm25.infant.value); document.getElementById("priceDiv25").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv25").innerHTML = deposit[(totalGuests-1)]; document.frm25.price.value = prices[(totalGuests-1)]; } function ProcessingBooking25() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking25(from, to, sMonth, sYear) { if(checkUserRegistrationForm25()){ s_id25=0; cur_id25=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm25.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm25.customerName.value ) + "&address=" + encodeURIComponent( document.frm25.address.value ) + "&zip=" + encodeURIComponent( document.frm25.zip.value ) + "&country=" + encodeURIComponent( document.frm25.country.value ) + "&phone=" + encodeURIComponent( document.frm25.phone.value ) + "&email=" + encodeURIComponent( document.frm25.email.value ) + "&guests=" + encodeURIComponent( document.frm25.guests.value ) + "&children=" + encodeURIComponent( document.frm25.children.value ) + "&infant=" + encodeURIComponent( document.frm25.infant.value ) + "¬es=" + encodeURIComponent( document.frm25.notes.value ) + "&price=" + encodeURIComponent( document.frm25.price.value ) + "&payment_type=" + encodeURIComponent( document.frm25.payment_type.value ) + "&code=" + encodeURIComponent( document.frm25.code.value ) + "&flight_no=" + encodeURIComponent( document.frm25.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm25.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm25.flight_time.value ); ProcessingBooking25(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=25&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF25(){ document.getElementById('TopMessage25').innerHTML=''; }; var s_id33=0; var cur_id33=0; var first33=0; var last33=0; var sum33=0; var half_day33=0; var calendar_id33=33; var total_msg='Total nights so far: '; var min_bl33=3; var max_bl33=99; var res_ids33=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint33(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first33==1) { half_day33=0; sum33=0; last33=0; for (var i=0;i < res_ids33.length;i++) { if ((s_id33 < res_ids33[i] && res_ids33[i] < o_id)||(s_id33 > res_ids33[i] && res_ids33[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id33))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl33) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl33 + ' nights'; ; return; } if (o_id>s_id33) { for (var i=s_id33;i<=o_id;i=i+(60*60*24)) { try { if (last33) { cur_id33=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id33) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id33=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last33=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last33=1; } else if (thestyle.scope==1) { if (s_id33==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum33=parseFloat(sum33)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id33;i>=o_id;i=i-(60*60*24)) { try { if (last33) { cur_id33=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last33=1; if (i==s_id33) { half_day33=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last33=1; if (i==s_id33) { half_day33=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id33) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day33=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day33=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id33=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id33==i) { if (s_id33==o_id) { var e = (window.event) ? window.event : evnt; var half33=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum33=parseFloat(sum33)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id33>o_id && o_id>=s_id33) { var i=o_id; for (i=i+(60*60*24);i<=cur_id33;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id33 < s_id33 && o_id>=s_id33) { var i=cur_id33; for (i;i < s_id33;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id33 < o_id && o_id<=s_id33) { var i=cur_id33; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id33>s_id33 && o_id<=s_id33) { var i=s_id33; for (i=i+(60*60*24);i<=cur_id33;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id33=o_id; } if (o_id==-1) { var i=s_id33; for (i;i <= cur_id33;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id33+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes33() { cal_id_len=0; temp_cal_id=calendar_id33; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids33.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick33(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl33 = min_booking; if (first33==1) { var tdays=Math.abs(eval(o_id-s_id33))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id33+cur_id33);sum33=parseFloat(sum33)-parseFloat(thestyle.abbr); if (tdays < min_bl33) { document.getElementById("Messages").innerHTML='Minimum '+min_bl33+' nights per booking'; } else { if (s_id33>cur_id33) { var sdate = new Date(cur_id33 * 1000); var edate = new Date(s_id33 * 1000); } else { var sdate = new Date(s_id33 * 1000); var edate = new Date(cur_id33 * 1000); } if (s_id33!=cur_id33) { half_day33=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day33+'&from='+s_id33+'&to='+cur_id33+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first33=0; res_ids33=new Array(); } else { if (s_id33>0) { if (s_id33>cur_id33) { var tmp_id=s_id33; s_id33=cur_id33; cur_id33=tmp_id; } updatePaint33(evnt,'-1',s_col,f_col,p_col,b_col,url); } first33=1; s_id33=o_id; cur_id33=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint33(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes33(); }; } 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 checkUserRegistrationForm33(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm33.customerName.value; address = document.frm33.address.value; zip = document.frm33.zip.value; country = document.frm33.country.value; email = document.frm33.email.value; phone = document.frm33.phone.value; confirm_email = document.frm33.confirm_email.value; terms = document.frm33.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice33(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm33.guests.value) + parseInt(document.frm33.children.value) + parseInt(document.frm33.infant.value); document.getElementById("priceDiv33").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv33").innerHTML = deposit[(totalGuests-1)]; document.frm33.price.value = prices[(totalGuests-1)]; } function ProcessingBooking33() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking33(from, to, sMonth, sYear) { if(checkUserRegistrationForm33()){ s_id33=0; cur_id33=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm33.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm33.customerName.value ) + "&address=" + encodeURIComponent( document.frm33.address.value ) + "&zip=" + encodeURIComponent( document.frm33.zip.value ) + "&country=" + encodeURIComponent( document.frm33.country.value ) + "&phone=" + encodeURIComponent( document.frm33.phone.value ) + "&email=" + encodeURIComponent( document.frm33.email.value ) + "&guests=" + encodeURIComponent( document.frm33.guests.value ) + "&children=" + encodeURIComponent( document.frm33.children.value ) + "&infant=" + encodeURIComponent( document.frm33.infant.value ) + "¬es=" + encodeURIComponent( document.frm33.notes.value ) + "&price=" + encodeURIComponent( document.frm33.price.value ) + "&payment_type=" + encodeURIComponent( document.frm33.payment_type.value ) + "&code=" + encodeURIComponent( document.frm33.code.value ) + "&flight_no=" + encodeURIComponent( document.frm33.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm33.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm33.flight_time.value ); ProcessingBooking33(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=33&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF33(){ document.getElementById('TopMessage33').innerHTML=''; }; var s_id14=0; var cur_id14=0; var first14=0; var last14=0; var sum14=0; var half_day14=0; var calendar_id14=14; var total_msg='Total nights so far: '; var min_bl14=3; var max_bl14=99; var res_ids14=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint14(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first14==1) { half_day14=0; sum14=0; last14=0; for (var i=0;i < res_ids14.length;i++) { if ((s_id14 < res_ids14[i] && res_ids14[i] < o_id)||(s_id14 > res_ids14[i] && res_ids14[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id14))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl14) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl14 + ' nights'; ; return; } if (o_id>s_id14) { for (var i=s_id14;i<=o_id;i=i+(60*60*24)) { try { if (last14) { cur_id14=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id14) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id14=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last14=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last14=1; } else if (thestyle.scope==1) { if (s_id14==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum14=parseFloat(sum14)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id14;i>=o_id;i=i-(60*60*24)) { try { if (last14) { cur_id14=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last14=1; if (i==s_id14) { half_day14=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last14=1; if (i==s_id14) { half_day14=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id14) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day14=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day14=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id14=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id14==i) { if (s_id14==o_id) { var e = (window.event) ? window.event : evnt; var half14=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum14=parseFloat(sum14)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id14>o_id && o_id>=s_id14) { var i=o_id; for (i=i+(60*60*24);i<=cur_id14;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id14 < s_id14 && o_id>=s_id14) { var i=cur_id14; for (i;i < s_id14;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id14 < o_id && o_id<=s_id14) { var i=cur_id14; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id14>s_id14 && o_id<=s_id14) { var i=s_id14; for (i=i+(60*60*24);i<=cur_id14;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id14=o_id; } if (o_id==-1) { var i=s_id14; for (i;i <= cur_id14;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id14+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes14() { cal_id_len=0; temp_cal_id=calendar_id14; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids14.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick14(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl14 = min_booking; if (first14==1) { var tdays=Math.abs(eval(o_id-s_id14))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id14+cur_id14);sum14=parseFloat(sum14)-parseFloat(thestyle.abbr); if (tdays < min_bl14) { document.getElementById("Messages").innerHTML='Minimum '+min_bl14+' nights per booking'; } else { if (s_id14>cur_id14) { var sdate = new Date(cur_id14 * 1000); var edate = new Date(s_id14 * 1000); } else { var sdate = new Date(s_id14 * 1000); var edate = new Date(cur_id14 * 1000); } if (s_id14!=cur_id14) { half_day14=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day14+'&from='+s_id14+'&to='+cur_id14+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first14=0; res_ids14=new Array(); } else { if (s_id14>0) { if (s_id14>cur_id14) { var tmp_id=s_id14; s_id14=cur_id14; cur_id14=tmp_id; } updatePaint14(evnt,'-1',s_col,f_col,p_col,b_col,url); } first14=1; s_id14=o_id; cur_id14=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint14(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes14(); }; } 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 checkUserRegistrationForm14(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm14.customerName.value; address = document.frm14.address.value; zip = document.frm14.zip.value; country = document.frm14.country.value; email = document.frm14.email.value; phone = document.frm14.phone.value; confirm_email = document.frm14.confirm_email.value; terms = document.frm14.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice14(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm14.guests.value) + parseInt(document.frm14.children.value) + parseInt(document.frm14.infant.value); document.getElementById("priceDiv14").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv14").innerHTML = deposit[(totalGuests-1)]; document.frm14.price.value = prices[(totalGuests-1)]; } function ProcessingBooking14() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking14(from, to, sMonth, sYear) { if(checkUserRegistrationForm14()){ s_id14=0; cur_id14=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm14.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm14.customerName.value ) + "&address=" + encodeURIComponent( document.frm14.address.value ) + "&zip=" + encodeURIComponent( document.frm14.zip.value ) + "&country=" + encodeURIComponent( document.frm14.country.value ) + "&phone=" + encodeURIComponent( document.frm14.phone.value ) + "&email=" + encodeURIComponent( document.frm14.email.value ) + "&guests=" + encodeURIComponent( document.frm14.guests.value ) + "&children=" + encodeURIComponent( document.frm14.children.value ) + "&infant=" + encodeURIComponent( document.frm14.infant.value ) + "¬es=" + encodeURIComponent( document.frm14.notes.value ) + "&price=" + encodeURIComponent( document.frm14.price.value ) + "&payment_type=" + encodeURIComponent( document.frm14.payment_type.value ) + "&code=" + encodeURIComponent( document.frm14.code.value ) + "&flight_no=" + encodeURIComponent( document.frm14.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm14.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm14.flight_time.value ); ProcessingBooking14(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=14&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF14(){ document.getElementById('TopMessage14').innerHTML=''; }; var s_id16=0; var cur_id16=0; var first16=0; var last16=0; var sum16=0; var half_day16=0; var calendar_id16=16; var total_msg='Total nights so far: '; var min_bl16=3; var max_bl16=99; var res_ids16=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint16(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first16==1) { half_day16=0; sum16=0; last16=0; for (var i=0;i < res_ids16.length;i++) { if ((s_id16 < res_ids16[i] && res_ids16[i] < o_id)||(s_id16 > res_ids16[i] && res_ids16[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id16))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl16) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl16 + ' nights'; ; return; } if (o_id>s_id16) { for (var i=s_id16;i<=o_id;i=i+(60*60*24)) { try { if (last16) { cur_id16=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id16) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id16=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last16=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last16=1; } else if (thestyle.scope==1) { if (s_id16==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum16=parseFloat(sum16)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id16;i>=o_id;i=i-(60*60*24)) { try { if (last16) { cur_id16=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last16=1; if (i==s_id16) { half_day16=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last16=1; if (i==s_id16) { half_day16=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id16) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day16=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day16=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id16=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id16==i) { if (s_id16==o_id) { var e = (window.event) ? window.event : evnt; var half16=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum16=parseFloat(sum16)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id16>o_id && o_id>=s_id16) { var i=o_id; for (i=i+(60*60*24);i<=cur_id16;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id16 < s_id16 && o_id>=s_id16) { var i=cur_id16; for (i;i < s_id16;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id16 < o_id && o_id<=s_id16) { var i=cur_id16; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id16>s_id16 && o_id<=s_id16) { var i=s_id16; for (i=i+(60*60*24);i<=cur_id16;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id16=o_id; } if (o_id==-1) { var i=s_id16; for (i;i <= cur_id16;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id16+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes16() { cal_id_len=0; temp_cal_id=calendar_id16; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids16.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick16(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl16 = min_booking; if (first16==1) { var tdays=Math.abs(eval(o_id-s_id16))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id16+cur_id16);sum16=parseFloat(sum16)-parseFloat(thestyle.abbr); if (tdays < min_bl16) { document.getElementById("Messages").innerHTML='Minimum '+min_bl16+' nights per booking'; } else { if (s_id16>cur_id16) { var sdate = new Date(cur_id16 * 1000); var edate = new Date(s_id16 * 1000); } else { var sdate = new Date(s_id16 * 1000); var edate = new Date(cur_id16 * 1000); } if (s_id16!=cur_id16) { half_day16=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day16+'&from='+s_id16+'&to='+cur_id16+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first16=0; res_ids16=new Array(); } else { if (s_id16>0) { if (s_id16>cur_id16) { var tmp_id=s_id16; s_id16=cur_id16; cur_id16=tmp_id; } updatePaint16(evnt,'-1',s_col,f_col,p_col,b_col,url); } first16=1; s_id16=o_id; cur_id16=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint16(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes16(); }; } 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 checkUserRegistrationForm16(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm16.customerName.value; address = document.frm16.address.value; zip = document.frm16.zip.value; country = document.frm16.country.value; email = document.frm16.email.value; phone = document.frm16.phone.value; confirm_email = document.frm16.confirm_email.value; terms = document.frm16.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice16(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm16.guests.value) + parseInt(document.frm16.children.value) + parseInt(document.frm16.infant.value); document.getElementById("priceDiv16").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv16").innerHTML = deposit[(totalGuests-1)]; document.frm16.price.value = prices[(totalGuests-1)]; } function ProcessingBooking16() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking16(from, to, sMonth, sYear) { if(checkUserRegistrationForm16()){ s_id16=0; cur_id16=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm16.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm16.customerName.value ) + "&address=" + encodeURIComponent( document.frm16.address.value ) + "&zip=" + encodeURIComponent( document.frm16.zip.value ) + "&country=" + encodeURIComponent( document.frm16.country.value ) + "&phone=" + encodeURIComponent( document.frm16.phone.value ) + "&email=" + encodeURIComponent( document.frm16.email.value ) + "&guests=" + encodeURIComponent( document.frm16.guests.value ) + "&children=" + encodeURIComponent( document.frm16.children.value ) + "&infant=" + encodeURIComponent( document.frm16.infant.value ) + "¬es=" + encodeURIComponent( document.frm16.notes.value ) + "&price=" + encodeURIComponent( document.frm16.price.value ) + "&payment_type=" + encodeURIComponent( document.frm16.payment_type.value ) + "&code=" + encodeURIComponent( document.frm16.code.value ) + "&flight_no=" + encodeURIComponent( document.frm16.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm16.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm16.flight_time.value ); ProcessingBooking16(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=16&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF16(){ document.getElementById('TopMessage16').innerHTML=''; }; var s_id37=0; var cur_id37=0; var first37=0; var last37=0; var sum37=0; var half_day37=0; var calendar_id37=37; var total_msg='Total nights so far: '; var min_bl37=3; var max_bl37=99; var res_ids37=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint37(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first37==1) { half_day37=0; sum37=0; last37=0; for (var i=0;i < res_ids37.length;i++) { if ((s_id37 < res_ids37[i] && res_ids37[i] < o_id)||(s_id37 > res_ids37[i] && res_ids37[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id37))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl37) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl37 + ' nights'; ; return; } if (o_id>s_id37) { for (var i=s_id37;i<=o_id;i=i+(60*60*24)) { try { if (last37) { cur_id37=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id37) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id37=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last37=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last37=1; } else if (thestyle.scope==1) { if (s_id37==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum37=parseFloat(sum37)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id37;i>=o_id;i=i-(60*60*24)) { try { if (last37) { cur_id37=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last37=1; if (i==s_id37) { half_day37=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last37=1; if (i==s_id37) { half_day37=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id37) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day37=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day37=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id37=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id37==i) { if (s_id37==o_id) { var e = (window.event) ? window.event : evnt; var half37=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum37=parseFloat(sum37)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id37>o_id && o_id>=s_id37) { var i=o_id; for (i=i+(60*60*24);i<=cur_id37;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id37 < s_id37 && o_id>=s_id37) { var i=cur_id37; for (i;i < s_id37;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id37 < o_id && o_id<=s_id37) { var i=cur_id37; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id37>s_id37 && o_id<=s_id37) { var i=s_id37; for (i=i+(60*60*24);i<=cur_id37;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id37=o_id; } if (o_id==-1) { var i=s_id37; for (i;i <= cur_id37;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id37+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes37() { cal_id_len=0; temp_cal_id=calendar_id37; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids37.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick37(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl37 = min_booking; if (first37==1) { var tdays=Math.abs(eval(o_id-s_id37))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id37+cur_id37);sum37=parseFloat(sum37)-parseFloat(thestyle.abbr); if (tdays < min_bl37) { document.getElementById("Messages").innerHTML='Minimum '+min_bl37+' nights per booking'; } else { if (s_id37>cur_id37) { var sdate = new Date(cur_id37 * 1000); var edate = new Date(s_id37 * 1000); } else { var sdate = new Date(s_id37 * 1000); var edate = new Date(cur_id37 * 1000); } if (s_id37!=cur_id37) { half_day37=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day37+'&from='+s_id37+'&to='+cur_id37+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first37=0; res_ids37=new Array(); } else { if (s_id37>0) { if (s_id37>cur_id37) { var tmp_id=s_id37; s_id37=cur_id37; cur_id37=tmp_id; } updatePaint37(evnt,'-1',s_col,f_col,p_col,b_col,url); } first37=1; s_id37=o_id; cur_id37=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint37(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes37(); }; } 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 checkUserRegistrationForm37(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm37.customerName.value; address = document.frm37.address.value; zip = document.frm37.zip.value; country = document.frm37.country.value; email = document.frm37.email.value; phone = document.frm37.phone.value; confirm_email = document.frm37.confirm_email.value; terms = document.frm37.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice37(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm37.guests.value) + parseInt(document.frm37.children.value) + parseInt(document.frm37.infant.value); document.getElementById("priceDiv37").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv37").innerHTML = deposit[(totalGuests-1)]; document.frm37.price.value = prices[(totalGuests-1)]; } function ProcessingBooking37() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking37(from, to, sMonth, sYear) { if(checkUserRegistrationForm37()){ s_id37=0; cur_id37=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm37.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm37.customerName.value ) + "&address=" + encodeURIComponent( document.frm37.address.value ) + "&zip=" + encodeURIComponent( document.frm37.zip.value ) + "&country=" + encodeURIComponent( document.frm37.country.value ) + "&phone=" + encodeURIComponent( document.frm37.phone.value ) + "&email=" + encodeURIComponent( document.frm37.email.value ) + "&guests=" + encodeURIComponent( document.frm37.guests.value ) + "&children=" + encodeURIComponent( document.frm37.children.value ) + "&infant=" + encodeURIComponent( document.frm37.infant.value ) + "¬es=" + encodeURIComponent( document.frm37.notes.value ) + "&price=" + encodeURIComponent( document.frm37.price.value ) + "&payment_type=" + encodeURIComponent( document.frm37.payment_type.value ) + "&code=" + encodeURIComponent( document.frm37.code.value ) + "&flight_no=" + encodeURIComponent( document.frm37.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm37.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm37.flight_time.value ); ProcessingBooking37(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=37&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF37(){ document.getElementById('TopMessage37').innerHTML=''; }; var s_id38=0; var cur_id38=0; var first38=0; var last38=0; var sum38=0; var half_day38=0; var calendar_id38=38; var total_msg='Total nights so far: '; var min_bl38=3; var max_bl38=99; var res_ids38=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint38(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first38==1) { half_day38=0; sum38=0; last38=0; for (var i=0;i < res_ids38.length;i++) { if ((s_id38 < res_ids38[i] && res_ids38[i] < o_id)||(s_id38 > res_ids38[i] && res_ids38[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id38))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl38) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl38 + ' nights'; ; return; } if (o_id>s_id38) { for (var i=s_id38;i<=o_id;i=i+(60*60*24)) { try { if (last38) { cur_id38=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id38) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id38=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last38=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last38=1; } else if (thestyle.scope==1) { if (s_id38==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum38=parseFloat(sum38)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id38;i>=o_id;i=i-(60*60*24)) { try { if (last38) { cur_id38=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last38=1; if (i==s_id38) { half_day38=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last38=1; if (i==s_id38) { half_day38=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id38) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day38=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day38=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id38=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id38==i) { if (s_id38==o_id) { var e = (window.event) ? window.event : evnt; var half38=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum38=parseFloat(sum38)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id38>o_id && o_id>=s_id38) { var i=o_id; for (i=i+(60*60*24);i<=cur_id38;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id38 < s_id38 && o_id>=s_id38) { var i=cur_id38; for (i;i < s_id38;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id38 < o_id && o_id<=s_id38) { var i=cur_id38; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id38>s_id38 && o_id<=s_id38) { var i=s_id38; for (i=i+(60*60*24);i<=cur_id38;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id38=o_id; } if (o_id==-1) { var i=s_id38; for (i;i <= cur_id38;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id38+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes38() { cal_id_len=0; temp_cal_id=calendar_id38; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids38.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick38(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl38 = min_booking; if (first38==1) { var tdays=Math.abs(eval(o_id-s_id38))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id38+cur_id38);sum38=parseFloat(sum38)-parseFloat(thestyle.abbr); if (tdays < min_bl38) { document.getElementById("Messages").innerHTML='Minimum '+min_bl38+' nights per booking'; } else { if (s_id38>cur_id38) { var sdate = new Date(cur_id38 * 1000); var edate = new Date(s_id38 * 1000); } else { var sdate = new Date(s_id38 * 1000); var edate = new Date(cur_id38 * 1000); } if (s_id38!=cur_id38) { half_day38=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day38+'&from='+s_id38+'&to='+cur_id38+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first38=0; res_ids38=new Array(); } else { if (s_id38>0) { if (s_id38>cur_id38) { var tmp_id=s_id38; s_id38=cur_id38; cur_id38=tmp_id; } updatePaint38(evnt,'-1',s_col,f_col,p_col,b_col,url); } first38=1; s_id38=o_id; cur_id38=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint38(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes38(); }; } 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 checkUserRegistrationForm38(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm38.customerName.value; address = document.frm38.address.value; zip = document.frm38.zip.value; country = document.frm38.country.value; email = document.frm38.email.value; phone = document.frm38.phone.value; confirm_email = document.frm38.confirm_email.value; terms = document.frm38.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice38(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm38.guests.value) + parseInt(document.frm38.children.value) + parseInt(document.frm38.infant.value); document.getElementById("priceDiv38").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv38").innerHTML = deposit[(totalGuests-1)]; document.frm38.price.value = prices[(totalGuests-1)]; } function ProcessingBooking38() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking38(from, to, sMonth, sYear) { if(checkUserRegistrationForm38()){ s_id38=0; cur_id38=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm38.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm38.customerName.value ) + "&address=" + encodeURIComponent( document.frm38.address.value ) + "&zip=" + encodeURIComponent( document.frm38.zip.value ) + "&country=" + encodeURIComponent( document.frm38.country.value ) + "&phone=" + encodeURIComponent( document.frm38.phone.value ) + "&email=" + encodeURIComponent( document.frm38.email.value ) + "&guests=" + encodeURIComponent( document.frm38.guests.value ) + "&children=" + encodeURIComponent( document.frm38.children.value ) + "&infant=" + encodeURIComponent( document.frm38.infant.value ) + "¬es=" + encodeURIComponent( document.frm38.notes.value ) + "&price=" + encodeURIComponent( document.frm38.price.value ) + "&payment_type=" + encodeURIComponent( document.frm38.payment_type.value ) + "&code=" + encodeURIComponent( document.frm38.code.value ) + "&flight_no=" + encodeURIComponent( document.frm38.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm38.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm38.flight_time.value ); ProcessingBooking38(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=38&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF38(){ document.getElementById('TopMessage38').innerHTML=''; }; var s_id101=0; var cur_id101=0; var first101=0; var last101=0; var sum101=0; var half_day101=0; var calendar_id101=101; var total_msg='Total nights so far: '; var min_bl101=3; var max_bl101=99; var res_ids101=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint101(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first101==1) { half_day101=0; sum101=0; last101=0; for (var i=0;i < res_ids101.length;i++) { if ((s_id101 < res_ids101[i] && res_ids101[i] < o_id)||(s_id101 > res_ids101[i] && res_ids101[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id101))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl101) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl101 + ' nights'; ; return; } if (o_id>s_id101) { for (var i=s_id101;i<=o_id;i=i+(60*60*24)) { try { if (last101) { cur_id101=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id101) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id101=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last101=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last101=1; } else if (thestyle.scope==1) { if (s_id101==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum101=parseFloat(sum101)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id101;i>=o_id;i=i-(60*60*24)) { try { if (last101) { cur_id101=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last101=1; if (i==s_id101) { half_day101=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last101=1; if (i==s_id101) { half_day101=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id101) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day101=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day101=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id101=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id101==i) { if (s_id101==o_id) { var e = (window.event) ? window.event : evnt; var half101=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum101=parseFloat(sum101)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id101>o_id && o_id>=s_id101) { var i=o_id; for (i=i+(60*60*24);i<=cur_id101;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id101 < s_id101 && o_id>=s_id101) { var i=cur_id101; for (i;i < s_id101;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id101 < o_id && o_id<=s_id101) { var i=cur_id101; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id101>s_id101 && o_id<=s_id101) { var i=s_id101; for (i=i+(60*60*24);i<=cur_id101;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id101=o_id; } if (o_id==-1) { var i=s_id101; for (i;i <= cur_id101;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id101+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes101() { cal_id_len=0; temp_cal_id=calendar_id101; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids101.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick101(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl101 = min_booking; if (first101==1) { var tdays=Math.abs(eval(o_id-s_id101))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id101+cur_id101);sum101=parseFloat(sum101)-parseFloat(thestyle.abbr); if (tdays < min_bl101) { document.getElementById("Messages").innerHTML='Minimum '+min_bl101+' nights per booking'; } else { if (s_id101>cur_id101) { var sdate = new Date(cur_id101 * 1000); var edate = new Date(s_id101 * 1000); } else { var sdate = new Date(s_id101 * 1000); var edate = new Date(cur_id101 * 1000); } if (s_id101!=cur_id101) { half_day101=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day101+'&from='+s_id101+'&to='+cur_id101+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first101=0; res_ids101=new Array(); } else { if (s_id101>0) { if (s_id101>cur_id101) { var tmp_id=s_id101; s_id101=cur_id101; cur_id101=tmp_id; } updatePaint101(evnt,'-1',s_col,f_col,p_col,b_col,url); } first101=1; s_id101=o_id; cur_id101=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint101(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes101(); }; } 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 checkUserRegistrationForm101(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm101.customerName.value; address = document.frm101.address.value; zip = document.frm101.zip.value; country = document.frm101.country.value; email = document.frm101.email.value; phone = document.frm101.phone.value; confirm_email = document.frm101.confirm_email.value; terms = document.frm101.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice101(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm101.guests.value) + parseInt(document.frm101.children.value) + parseInt(document.frm101.infant.value); document.getElementById("priceDiv101").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv101").innerHTML = deposit[(totalGuests-1)]; document.frm101.price.value = prices[(totalGuests-1)]; } function ProcessingBooking101() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking101(from, to, sMonth, sYear) { if(checkUserRegistrationForm101()){ s_id101=0; cur_id101=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm101.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm101.customerName.value ) + "&address=" + encodeURIComponent( document.frm101.address.value ) + "&zip=" + encodeURIComponent( document.frm101.zip.value ) + "&country=" + encodeURIComponent( document.frm101.country.value ) + "&phone=" + encodeURIComponent( document.frm101.phone.value ) + "&email=" + encodeURIComponent( document.frm101.email.value ) + "&guests=" + encodeURIComponent( document.frm101.guests.value ) + "&children=" + encodeURIComponent( document.frm101.children.value ) + "&infant=" + encodeURIComponent( document.frm101.infant.value ) + "¬es=" + encodeURIComponent( document.frm101.notes.value ) + "&price=" + encodeURIComponent( document.frm101.price.value ) + "&payment_type=" + encodeURIComponent( document.frm101.payment_type.value ) + "&code=" + encodeURIComponent( document.frm101.code.value ) + "&flight_no=" + encodeURIComponent( document.frm101.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm101.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm101.flight_time.value ); ProcessingBooking101(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=101&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF101(){ document.getElementById('TopMessage101').innerHTML=''; }; var s_id102=0; var cur_id102=0; var first102=0; var last102=0; var sum102=0; var half_day102=0; var calendar_id102=102; var total_msg='Total nights so far: '; var min_bl102=3; var max_bl102=99; var res_ids102=new Array(); function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { iPos = 0; while (elt != null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; } function updatePaint102(evnt,o_id,s_col,f_col,p_col,b_col,url) { if (first102==1) { half_day102=0; sum102=0; last102=0; for (var i=0;i < res_ids102.length;i++) { if ((s_id102 < res_ids102[i] && res_ids102[i] < o_id)||(s_id102 > res_ids102[i] && res_ids102[i]>o_id)) { return; } } var tdays=Math.abs(eval(o_id-s_id102))/(60*60*24); document.getElementById("Messages").innerHTML=''; if (tdays>max_bl102) { document.getElementById("Messages").innerHTML='You can book max '+ max_bl102 + ' nights'; ; return; } if (o_id>s_id102) { for (var i=s_id102;i<=o_id;i=i+(60*60*24)) { try { if (last102) { cur_id102=i-(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2 || thestyle.scope==4) { if (i==s_id102) { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; } } else { if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } cur_id102=i-(60*60*24); return; } } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; last102=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; last102=1; } else if (thestyle.scope==1) { if (s_id102==i) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum102=parseFloat(sum102)+parseFloat(thestyle.abbr); } catch (error) { } } } else { for (var i=s_id102;i>=o_id;i=i-(60*60*24)) { try { if (last102) { cur_id102=i+(60*60*24); return; } var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+s_col+")"; last102=1; if (i==s_id102) { half_day102=2; } } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+s_col+")"; last102=1; if (i==s_id102) { half_day102=2; } } else if (thestyle.scope==3 || thestyle.scope==5) { if (i==s_id102) { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+b_col+")"; half_day102=1; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+p_col+")"; half_day102=1; } } else { if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } cur_id102=i+(60*60*24); return; } } else if (thestyle.scope==1) { if (s_id102==i) { if (s_id102==o_id) { var e = (window.event) ? window.event : evnt; var half102=thestyle.offsetWidth/2; var half_sum=parseInt(half)+parseInt(getAbsX(thestyle)); if (half_sum>e.clientX) { half_day=1; thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } else { half_day=2; thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } } else { thestyle.style.backgroundImage="url("+url+"?color1="+s_col+"&color2="+f_col+")"; } } else if (i==o_id) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+s_col+")"; } else { thestyle.style.backgroundColor="#"+s_col; } } else { } sum102=parseFloat(sum102)+parseFloat(thestyle.abbr); } catch (error) { } } } if (cur_id102>o_id && o_id>=s_id102) { var i=o_id; for (i=i+(60*60*24);i<=cur_id102;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id102 < s_id102 && o_id>=s_id102) { var i=cur_id102; for (i;i < s_id102;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id102 < o_id && o_id<=s_id102) { var i=cur_id102; for (i;i < o_id;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } else if (cur_id102>s_id102 && o_id<=s_id102) { var i=s_id102; for (i=i+(60*60*24);i<=cur_id102;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } cur_id102=o_id; } if (o_id==-1) { var i=s_id102; for (i;i <= cur_id102;i=i+(60*60*24)) { try { var thestyle= window.document.getElementById('d'+calendar_id102+i); thestyle.style.backgroundImage=""; thestyle.style.backgroundPosition="center"; thestyle.style.backgroundColor=""; if (thestyle.scope==2) { thestyle.style.backgroundImage="url("+url+"?color1="+b_col+"&color2="+f_col+")"; } else if (thestyle.scope==4) { thestyle.style.backgroundImage="url("+url+"?color1="+p_col+"&color2="+f_col+")"; } else if (thestyle.scope==3) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+b_col+")"; } else if (thestyle.scope==5) { thestyle.style.backgroundImage="url("+url+"?color1="+f_col+"&color2="+p_col+")"; } else if (thestyle.scope==1) { thestyle.style.backgroundColor="#"+f_col; } } catch (error) { } } } } function updateRes102() { cal_id_len=0; temp_cal_id=calendar_id102; while(temp_cal_id>=1) { cal_id_len++; temp_cal_id=temp_cal_id/10; } var all_date=window.document.getElementsByTagName("td");; if (all_date) { for (var i=0;i < all_date.length;i++) { if (all_date[i].scope==-1 || all_date[i].scope==-2) { res_ids102.push(all_date[i].id.substr(parseInt(1)+parseInt(cal_id_len))); } } } } function uclick102(evnt,o_id,s_col,f_col,p_col,b_col,url,c_id,b_id,s_month,s_year, min_booking) { min_bl102 = min_booking; if (first102==1) { var tdays=Math.abs(eval(o_id-s_id102))/(60*60*24);var thestyle= window.document.getElementById("d"+calendar_id102+cur_id102);sum102=parseFloat(sum102)-parseFloat(thestyle.abbr); if (tdays < min_bl102) { document.getElementById("Messages").innerHTML='Minimum '+min_bl102+' nights per booking'; } else { if (s_id102>cur_id102) { var sdate = new Date(cur_id102 * 1000); var edate = new Date(s_id102 * 1000); } else { var sdate = new Date(s_id102 * 1000); var edate = new Date(cur_id102 * 1000); } if (s_id102!=cur_id102) { half_day102=0; } window.document.getElementById("DateBookings").innerHTML=''; window.document.getElementById("Messages").innerHTML=''; ajaxpage('load-bookingform-all.php?view=&half_day='+half_day102+'&from='+s_id102+'&to='+cur_id102+'&sMonth='+s_month+'&sYear='+s_year+'&cid='+c_id,"AvailabilityCalendar",'get'); } first102=0; res_ids102=new Array(); } else { if (s_id102>0) { if (s_id102>cur_id102) { var tmp_id=s_id102; s_id102=cur_id102; cur_id102=tmp_id; } updatePaint102(evnt,'-1',s_col,f_col,p_col,b_col,url); } first102=1; s_id102=o_id; cur_id102=o_id; window.document.getElementById("DateBookings").innerHTML=''; updatePaint102(evnt,o_id,s_col,f_col,p_col,b_col,url); } } var flagCaptcha = false; var flagFields = 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; updateRes102(); }; } 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 checkUserRegistrationForm102(){ re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/; var name, email, phone, dataRight = true; var message = ""; name = document.frm102.customerName.value; address = document.frm102.address.value; zip = document.frm102.zip.value; country = document.frm102.country.value; email = document.frm102.email.value; phone = document.frm102.phone.value; confirm_email = document.frm102.confirm_email.value; terms = document.frm102.terms.checked; if (name.length==0){ message += "\n - Name"; dataRight=false; } if (address.length==0){ message += "\n - Address"; dataRight=false; } if (zip.length==0){ message += "\n - Postcode/Zip"; dataRight=false; } if (country.length==0){ message += "\n - Country"; dataRight=false; } if (email.length==0){ message += "\n - Email"; dataRight=false; } if (confirm_email.length==0){ message += "\n - Re-type email address"; dataRight=false; } if (phone.length==0){ message += "\n - Phone"; dataRight=false; } if (email.length!=0 && email.match(re)==null){ dataRight=false; message += "\n - Your Email is Incorrect"; } if (confirm_email.length!=0 && confirm_email.match(re)==null){ dataRight=false; message += "\n - Re-type email is Incorrect"; } if (email!=confirm_email){ dataRight=false; message += "\n - Your email and Re-type email does not match"; } if (!terms){ dataRight=false; message += "\n - You must accept our Terms & Conditions"; } if (!dataRight){ if (message != ""){ message ="\nYou failed to correctly fill in the booking form:\n" + message; } alert(message); } return dataRight; } function ShowPrice102(totalPrice,pricesArr,depositPrice){ var total = new Array(); total = totalPrice.split(','); var deposit = new Array(); deposit = depositPrice.split(','); var prices = new Array(); prices = pricesArr.split(','); var totalGuests = parseInt(document.frm102.guests.value) + parseInt(document.frm102.children.value) + parseInt(document.frm102.infant.value); document.getElementById("priceDiv102").innerHTML = total[(totalGuests-1)]; document.getElementById("depositDiv102").innerHTML = deposit[(totalGuests-1)]; document.frm102.price.value = prices[(totalGuests-1)]; } function ProcessingBooking102() { document.getElementById('DateBookings').innerHTML=''; }; function submitBooking102(from, to, sMonth, sYear) { if(checkUserRegistrationForm102()){ s_id102=0; cur_id102=0; var poststr = "ac=book&startDate="+from+"&endDate="+to+"&half_day=" + encodeURIComponent( document.frm102.half_day.value ) + "&customerName=" + encodeURIComponent( document.frm102.customerName.value ) + "&address=" + encodeURIComponent( document.frm102.address.value ) + "&zip=" + encodeURIComponent( document.frm102.zip.value ) + "&country=" + encodeURIComponent( document.frm102.country.value ) + "&phone=" + encodeURIComponent( document.frm102.phone.value ) + "&email=" + encodeURIComponent( document.frm102.email.value ) + "&guests=" + encodeURIComponent( document.frm102.guests.value ) + "&children=" + encodeURIComponent( document.frm102.children.value ) + "&infant=" + encodeURIComponent( document.frm102.infant.value ) + "¬es=" + encodeURIComponent( document.frm102.notes.value ) + "&price=" + encodeURIComponent( document.frm102.price.value ) + "&payment_type=" + encodeURIComponent( document.frm102.payment_type.value ) + "&code=" + encodeURIComponent( document.frm102.code.value ) + "&flight_no=" + encodeURIComponent( document.frm102.flight_no.value ) + "&flight_date=" + encodeURIComponent( document.frm102.flight_date.value ) + "&flight_time=" + encodeURIComponent( document.frm102.flight_time.value ); ProcessingBooking102(); document.getElementById('AvailabilityCalendar').innerHTML=''; ajaxpage('load-bookingform-all.php?ac=book&cid=102&'+poststr,'AvailabilityCalendar','get'); }; }; function TopMessageF102(){ document.getElementById('TopMessage102').innerHTML=''; }; function LoadCalendar(){ document.getElementById('allCalendarsDiv').innerHTML='
Loading...
'; }; loadCalendar102 = '
'; document.writeln(loadCalendar102);