<\/div><\/div><\/div>')}function InitializeBookings(){$(".cs-bw-booking-BookingFormWide-Findhotelexp").hide();$(".cs-bw-booking-findhoteloptions").show();$(".cs-bw-booking-BookingFormWide-Checkreservationexp").show();$(".cs-bw-booking-BookingFormWide-Checkreservationoptions").hide();$(".cs-bw-booking-findHotel").each(function(){var n=$(this);$(n.find(".cs-bw-booking-BookingFormWide-Findhotelexp")).on("click",function(){$(n.find(".cs-bw-booking-BookingFormWide-Findhotelexp")).hide();$(n.find(".cs-bw-booking-findhoteloptions")).show();$(n.find(".cs-bw-booking-BookingFormWide-Checkreservationexp")).show();$(n.find(".cs-bw-booking-BookingFormWide-Checkreservationoptions")).hide()});$(n.find(".cs-bw-booking-BookingFormWide-Checkreservationexp")).on("click",function(){$(n.find(".cs-bw-booking-BookingFormWide-Findhotelexp").show());$(n.find(".cs-bw-booking-findhoteloptions").hide());$(n.find(".cs-bw-booking-BookingFormWide-Checkreservationexp").hide());$(n.find(".cs-bw-booking-BookingFormWide-Checkreservationoptions").show());$(n.find(".cs-bw-booking-BookingFormWide-Roomscontainer").hide())});$("#booking-calendar").on("click",function(){$(".cs-bw-booking-datepicker").show();CloseOthersBookingElements(this)});$(".cs-bw-booking-datepicker").on("click",function(){event.stopPropagation()});$("#booking-rooms").on("click",function(){document.getElementById("booking-rooms-panel").style.display="flex";CloseOthersBookingElements(this)});$("#booking-rooms-panel").on("click",function(){event.stopPropagation()});$("#booking-close-rooms").on("click",function(){document.getElementById("booking-rooms-panel").style.display="none"});$("#booking-add-chambre").on("click",function(){if(AddRoom(),AddChambre(),OnAddRoomScroll(),rooms.length>=9){var n=document.getElementsByClassName("cs-bw-booking-rooms-panel__add-chambre")[0];n.style.display="none"}});$("#booking-codes").on("click",function(){document.getElementsByClassName("cs-bw-booking-codes-panel")[0].style.display="flex";document.getElementById("booking-codes-arrow").setAttribute("rotate","");CloseOthersBookingElements(this)});$("#booking-codes-close").on("click",function(){document.getElementsByClassName("cs-bw-booking-codes-panel")[0].style.display="none";document.getElementById("booking-codes-arrow").removeAttribute("rotate")});$("#booking-codes-panel").on("click",function(){event.stopPropagation()});AddRoom();AddChambre();SetRoomsScrollEvent();InitializeBookingPostButton(n)})}function InitializeBookingPostButton(n){var t;$(".Loader-Container").appendTo(document.body);t=$(n).find("#BookingHyperLinkBox").length>0?$(n).find("#BookingHyperLinkBox"):$(n).find("#BookingHyperLinkButton");$(t).on("click",function(t){StartBooking(t,n[0],this)})}function CloseOthersBookingElements(n){var t=$("#booking-calendar"),i=$("#booking-rooms"),r=$("#booking-codes");t[0].id!=n.id&&$(".cs-bw-booking-datepicker").hide();i[0].id!=n.id&&$(".cs-bw-booking-rooms-panel").hide();r[0].id!=n.id&&($(".cs-bw-booking-codes-panel").hide(),document.getElementById("booking-codes-arrow").removeAttribute("rotate"))}function SetBookingsFeaturesPosition(n,t){var i=$(n)[0].offsetWidth,r=$(t)[0].offsetWidth;i
=9||(rooms.push(new RoomObject(1,[])),UpdateBookingCalculations())}function RemoveRoom(n){rooms.splice(n,1);UpdateBookingCalculations()}function AddChild(n,t){var i=rooms[n].childrensAge.length;i>=5||(rooms[n].childrensAge.push(t),UpdateBookingCalculations())}function RemoveChild(n){rooms[n].childrensAge.pop();UpdateBookingCalculations()}function AddAdult(n){var t=rooms[n].adultCount;t>=6||(rooms[n].adultCount+=1,UpdateBookingCalculations())}function RemoveAdult(n){var t=rooms[n].adultCount;t<=1||(rooms[n].adultCount-=1,UpdateBookingCalculations())}function UpdateChildrensAge(n,t,i){rooms[n].childrensAge[t]=i.value}function UpdateBookingCalculations(){for(var u,i=rooms.length,n=0,t=0,r=0;r0?n+" "+e+", "+t+" "+s+", "+i+" "+o:n+" "+e+", "+i+" "+o;document.getElementById("booking-rooms-calculations").value=f;document.getElementById("booking-calculations").innerText=f}function ScrollInRoomsPanel(){var n=document.getElementById("rooms-panel-chambers");n&&(n.scrollTop=roomsScrollTopPosition)}function SetRoomsScrollEvent(){var n=document.getElementById("rooms-panel-chambers");n&&n.addEventListener("scroll",n=>{roomsScrollTopPosition=n.target.scrollTop})}function OnAddRoomScroll(){var n=document.getElementById("rooms-panel-chambers").scrollHeight;document.getElementById("rooms-panel-chambers").scrollTop=n}function GetFormattedDate(n){return dateFormatter.format(new Date(n)).split(".").join("")}function setPathToImages(n){pathToImages=n}function __setcaltodaysdate(n){todaysdate=n}function __setcalnextyeardate(n){nextyeardate=n}function EIS_FIX_EI1(n){if(iframeObj2){var t=$(ParentContainerToAddCalendar).find("#"+n)[0];iframeObj2.style.display="block";iframeObj2.style.height=t.offsetHeight+1;iframeObj2.style.width=t.offsetWidth;iframeObj2.style.left=getleftPos(t)+1-calendar_offsetLeft;iframeObj2.style.top=getTopPos(t)-t.offsetHeight-calendar_offsetTop}}function EIS_Hide_Frame(){iframeObj2&&(iframeObj2.style.display="none")}function cancelCalendarEvent(){return!1}function isLeapYear(n){return n%400==0||n%4==0&&n%100!=0?!0:!1}function highlightMonthYear(){activeSelectBoxMonth&&(activeSelectBoxMonth.className="");activeSelectBox=this;this.className=="monthYearActive"?this.className="":(this.className="monthYearActive",activeSelectBoxMonth=this);this.innerHTML.indexOf("-")>=0||this.innerHTML.indexOf("+")>=0?(selectBoxMovementInProgress=this.className=="monthYearActive"?!0:!1,activeSelectBoxDirection=this.innerHTML.indexOf("-")>=0?-1:1):selectBoxMovementInProgress=!1}function showMonthDropDown(){month.style.display=="block"?(month.style.display="none",EIS_Hide_Frame()):(month.style.display="block",year.style.display="none",MSIE&&EIS_FIX_EI1("monthDropDown"))}function showYearDropDown(){year.style.display=="block"?(year.style.display="none",EIS_Hide_Frame()):(year.style.display="block",month.style.display="none",MSIE&&EIS_FIX_EI1("yearDropDown"))}function selectMonth(){$(ParentContainerToAddCalendar).find("#calendar_month_txt")[0].innerHTML=this.innerHTML;currentMonth=this.id.replace(/[^\d]/g,"");month.style.display="none";EIS_Hide_Frame();for(var n=0;n=0?(currentMonth=currentMonth-1,currentMonth<0&&(currentMonth=11,currentYear=currentYear-1)):(currentMonth=currentMonth+1,currentMonth>11&&(currentMonth=0,currentYear=currentYear/1+1));writeCalendarContent()}function createMonthDiv(){var i=document.createElement("DIV"),t,n;for(i.className="monthYearPicker",i.id="monthPicker",t=0;t=0?(u=r[1].innerHTML/1-1,activeSelectBoxYear&&(activeSelectBoxYear.style.color="")):(u=r[1].innerHTML/1+1,activeSelectBoxYear&&(activeSelectBoxYear.style.color="")),i=1;i0&&(activeSelectBoxYear=$(ParentContainerToAddCalendar).find("#yearDiv"+currentYear),activeSelectBoxYear.style.color=selectBoxHighlightColor))}function changeSelectBoxHour(n,t){var u,i,f,r;for(t||(t=this),u=t.parentNode.getElementsByTagName("DIV"),t.innerHTML.indexOf("-")>=0?(i=u[1].innerHTML/1-1,i<0&&(i=0),activeSelectBoxHour&&(activeSelectBoxHour.style.color="")):(i=u[1].innerHTML/1+1,i>14&&(i=14),activeSelectBoxHour&&(activeSelectBoxHour.style.color="")),f="",r=1;r0&&(activeSelectBoxHour=$(ParentContainerToAddCalendar).find("#hourDiv"+currentHour),activeSelectBoxHour.style.color=selectBoxHighlightColor))}function updateYearDiv(){var i=5,r,t,n;for(turnOffYearSpan&&(i=0),r=year,t=r.getElementsByTagName("DIV"),n=1;n=0?pathToImages+"close.png":pathToImages+"close-omo.png"}function closeCalendar(){year.style.display="none";month.style.display="none";calendarDiv.style.display="none";iframeObj&&(iframeObj.style.display="none",EIS_Hide_Frame());activeSelectBoxMonth&&(activeSelectBoxMonth.className="");activeSelectBoxYear&&(activeSelectBoxYear.className="");$(".calendarInputIn").removeClass("calendarOpen");$(".calendarInputOut").removeClass("calendarOpen")}function writeTopBar(){var i=document.createElement("DIV"),t,u,r,n;i.className="topBar";i.id="topBar";calendarDiv.appendChild(i);t=document.createElement("DIV");t.id="monthSelect";t.onclick=showMonthDropDown;u=document.createElement("SPAN");u.innerHTML=monthArray[currentMonth];u.id="calendar_month_txt";t.appendChild(u);i.appendChild(t);r=createMonthDiv();r.style.left="35px";r.style.top=t.offsetTop+t.offsetHeight+8+"px";r.id="monthDropDown";calendarDiv.appendChild(r);YearSelector(t,i);n=document.createElement("IMG");n.src=pathToImages+"close.png";n.style.styleFloat="right";n.onmouseover=highlightClose;n.onmouseout=highlightClose;n.onclick=closeCalendar;i.appendChild(n);document.all||(n.style.position="absolute",n.style.right="6px")}function YearSelector(n,t){var u=document.createElement("DIV"),r,i;u.onclick=showYearDropDown;r=document.createElement("SPAN");r.innerHTML=currentYear;r.id="calendar_year_txt";u.appendChild(r);t.appendChild(u);i=createYearDiv();i.style.left="118px";i.style.top=n.offsetTop+n.offsetHeight+8+"px";i.id="yearDropDown";calendarDiv.appendChild(i)}function writeCalendarContent(){var l=!0,r,u,c,f,e,s,h,t,i,o,n;for(calendarDiv=$(ParentContainerToAddCalendar).find("#calendarDiv")[0],$(ParentContainerToAddCalendar).find("#calendarDiv").find(".calendarContent").length==0&&(calendarContentDiv=document.createElement("DIV"),calendarContentDiv.className="calendarContent",calendarDiv.appendChild(calendarContentDiv),l=!1),currentMonth=currentMonth/1,r=new Date,r.setFullYear(currentYear),r.setDate(1),r.setMonth(currentMonth),dc=new Date,dc.setFullYear(currentYear),dc.setDate(1),dc.setMonth(currentMonth),dc.setHours(23),u=r.getDay(),weekStartsOnSunday||(u==0&&(u=7),u--),$(ParentContainerToAddCalendar).find("#calendar_year_txt")[0].innerHTML=currentYear,$(ParentContainerToAddCalendar).find("#calendar_month_txt")[0].innerHTML=monthArray[currentMonth],c=calendarContentDiv.getElementsByTagName("TABLE"),c.length>0&&calendarContentDiv.removeChild(c[0]),f=document.createElement("TABLE"),f.width="100%",f.cellSpacing="0",calendarContentDiv.appendChild(f),e=document.createElement("TBODY"),f.appendChild(e),i=e.insertRow(-1),i.className="calendar_week_row",showWeekNumber&&(n=i.insertCell(-1),n.innerHTML=weekString,n.className="calendar_week_column",n.style.backgroundColor=selectBoxRolloverBgColor),t=0;t0&&s%7==0&&(i=e.insertRow(-1),showWeekNumber&&(n=i.insertCell(-1),n.className="calendar_week_column",o=getWeek(currentYear,currentMonth,t),n.innerHTML=o,n.style.backgroundColor=selectBoxRolloverBgColor)),n=i.insertCell(-1),currentYear==inputYear&¤tMonth==inputMonth&&t==inputDay&&(n.className="activeDay"),calendar_pers&&(dc<=todaysdate||dc>nextyeardate)&&(n.className="linethrough"),n.innerHTML=t,(dc>=todaysdate&&dc<=nextyeardate&&calendar_pers||!calendar_pers)&&(n.onclick=pickDate),s++;document.all||calendarContentDiv.offsetHeight||($(ParentContainerToAddCalendar).find("#topBar")[0].style.top="",$(ParentContainerToAddCalendar).find("#topBar")[0].style.bottom="0px");iframeObj&&(l?setTimeout("resizeIframe()",10):setTimeout("resizeIframe()",350))}function resizeIframe(){iframeObj.style.width=calendarDiv.offsetWidth+"px";iframeObj.style.height=calendarDiv.offsetHeight+"px"}function pickTodaysDate(){var n=new Date;currentMonth=n.getMonth();currentYear=n.getFullYear();pickDate(!1,n.getDate())}function pickDate(n,i){var u=currentMonth/1+1,f,r;if(u<10&&(u="0"+u),f=!i&&this?this.innerHTML:i,f/1<10&&(f="0"+f),returnFormat){returnFormat=returnFormat.replace("dd",f);returnFormat=returnFormat.replace("mm",u);returnFormat=returnFormat.replace("yyyy",currentYear);returnFormat=returnFormat.replace("hh",currentHour);returnFormat=returnFormat.replace("ii",currentMinute);returnFormat=returnFormat.replace("d",f/1);returnFormat=returnFormat.replace("m",u/1);returnDateTo.value=returnFormat;try{returnDateTo.onchange()}catch(n){}}else{if(calendar_pers){for(r=0;r"+dayArray1[parseInt(tp.getDay())]+" "+p+"<\/option>";getById("daySSel")==returnDateToDay?($("#daySSel").html(st),$("#DateRangeStart").val(f+"/"+u+"/"+currentYear),UpdateDateRangeEndSel()):getById("dayESel")==returnDateToDay&&($("#dayESel").html(st),$("#DateRangeEnd").val(f+"/"+u+"/"+currentYear));UpdateDateRangeDuration();getDaysOfMonth("monthyearESel","dayESel")}else{for(r=0;r6)if(t.value.match(/^[0-9]*?$/gi))b=i.indexOf("mm"),currentMonth=t.value.substr(b,2)/1-1,k=i.indexOf("yyyy"),currentYear=t.value.substr(k,4),d=i.indexOf("dd"),tmpDay=t.value.substr(d,2),y=i.indexOf("hh"),y>=0?(tmpHour=t.value.substr(y,2),currentHour=tmpHour):currentHour="00",p=i.indexOf("ii"),p>=0?(tmpMinute=t.value.substr(p,2),currentMinute=tmpMinute):currentMinute="00";else{for(h=t.value.split(/[^0-9]/gi),f=[],f.m=i.indexOf("mm"),f.m==-1&&(f.m=i.indexOf("m")),f.d=i.indexOf("dd"),f.d==-1&&(f.d=i.indexOf("d")),f.y=i.indexOf("yyyy"),f.h=i.indexOf("hh"),f.i=i.indexOf("ii"),e=Array(),e[0]=f.m,e[1]=f.d,e[2]=f.y,e[3]=f.h,e[4]=f.i,e=e.sort(calendarSortItems),s=-1,currentHour="00",currentMinute="00",o=0;o{positionCalendar(r)})}}function onResizeSetCalendarPosition(n){$(window).resize(function(){n()})}function displayCalendarSelectBox(n,t,i,r,u,f){calendarDisplayTime=r?!0:!1;currentMonth=t.options[t.selectedIndex].value/1-1;currentYear=n.options[n.selectedIndex].value;r&&(currentHour=r.options[r.selectedIndex].value,inputHour=currentHour/1);u&&(currentMinute=u.options[u.selectedIndex].value,inputMinute=currentMinute/1);inputYear=n.options[n.selectedIndex].value;inputMonth=t.options[t.selectedIndex].value/1-1;inputDay=i.options[i.selectedIndex].value/1;calendarDiv?writeCalendarContent():initCalendar();returnDateToYear=n;returnDateToMonth=t;returnDateToDay=i;returnDateToHour=r;returnDateToMinute=u;returnFormat=!1;returnDateTo=!1;positionCalendar(f);moveCalendarMarker(f);calendarDiv.style.visibility="visible";calendarDiv.style.display="block";iframeObj&&(iframeObj.style.display="",iframeObj.style.height=calendarDiv.offsetHeight+"px",iframeObj.style.width=calendarDiv.offsetWidth+"px",iframeObj2.style.display="",iframeObj2.style.height=calendarDiv.offsetHeight+"px",iframeObj2.style.width=calendarDiv.offsetWidth+"px");updateYearDiv();updateMonthDiv()}function displayCalendarSelectBoxPers(n,t,i,r,u,f){_OverCal=!0;n&&(calendar_pers=!0);calendarDisplayTime=r?!0:!1;ym=t.value.split("/");yy=ym[1];mm=ym[0];currentMonth=mm-1;currentYear=yy;r&&(currentHour=r.options[r.selectedIndex].value,inputHour=currentHour/1);u&&(currentMinute=u.options[u.selectedIndex].value,inputMinute=currentMinute/1);inputYear=yy;inputMonth=mm/1-1;inputDay=i.options[i.selectedIndex].value/1;calendarDiv?writeCalendarContent():initCalendar();returnDateToMonthYear=t;returnDateToDay=i;returnDateToHour=r;returnDateToMinute=u;returnFormat=!1;returnDateTo=!1;positionCalendar(f);moveCalendarMarker(f);calendarDiv.style.visibility="visible";calendarDiv.style.display="block";iframeObj&&(iframeObj.style.display="",iframeObj.style.height=calendarDiv.offsetHeight+"px",iframeObj.style.width=calendarDiv.offsetWidth+"px",iframeObj2.style.display="",iframeObj2.style.height=calendarDiv.offsetHeight+"px",iframeObj2.style.width=calendarDiv.offsetWidth+"px");updateYearDiv();updateMonthDiv()}function getDaysOfMonth(n,i){for(dte=$("#"+n).val().split("/"),t=new Date,t.setFullYear(dte[1]),t.setMonth(dte[0]),t.setDate(0),lastday=t.getDate(),st="",p=1;p<=lastday;p++)tp=new Date(dte[1],dte[0]-1,p),sel="",ddd=p,p<10&&(ddd="0"+p),$("#"+i).val()==ddd&&(sel=' selected="selected"'),st+='