function ValidateEmailOrPhoneNotEmpty(C,A){if(A.Value!==""){A.IsValid=true;return }var B=ValidatorGetValue(C.PhoneBoxId);if(B===""){A.IsValid=false;return }A.IsValid=true}Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.ParseTextToDate=function(B){var A=null;if(B){A=Date.parseLocale(B,"d")}if(isNaN(A)){A=null}return A};VacationRoost.VR.GetFirstChildWithNodeName=function(B,C){for(var A=0;A<B.childNodes.length;A++){if(B.childNodes[A].nodeName==C){return B.childNodes[A]}}return null};VacationRoost.VR.SetCheckInOutCookie=function setCheckInOutCookie(A,B){document.cookie="checkin="+A+"; path=/";document.cookie="checkout="+B+"; path=/"};VacationRoost.VR.ClearDates=function clearDates(B,A){try{document.getElementById(B).value=""}catch(C){}try{document.getElementById(A).value=""}catch(C){}VacationRoost.VR.SetCheckInOutCookie("","")};VacationRoost.VR.SubmitDefaultSearch=function(A,B){var C=Page_ClientValidate("TravelDates");if(C){VacationRoost.VR.SetCheckInOutCookie(A.value,B.value);document.location.href="/lodging/search"}};VacationRoost.VR.SubmitDestinationSearch=function(A,B,D){var E=Page_ClientValidate("TravelDates");if(E){VacationRoost.VR.SetCheckInOutCookie(B.value,D.value);var C=A.options[A.selectedIndex].value;if(isNaN(parseInt(C))){if(C&&C!="all"){document.location.href="/search-results.aspx?destination="+C}else{document.location.href="/lodging/search"}}else{document.location.href="/search-results.aspx?N="+C}}};VacationRoost.VR.SubmitPropertySearch=function(E,B,G,D){if(Page_ClientValidate()){var A="",C="",F="";if(!D){D="search-results.aspx"}if(B){A=B.value}if(G){C=G.value}if(E&&E.value){F="Ntt="+escape(E.value)+"&Ntk=Property"}setCheckInOutCookie(A,C);document.location.href=D+"?"+F}};VacationRoost.VR.SetTravelDatesCookie=function(B,A){if(B&&A){document.cookie="checkin="+B.localeFormat("d")+"; path=/";document.cookie="checkout= "+A.localeFormat("d")+"; path=/"}else{document.cookie="checkin=; path=/";document.cookie="checkout=; path=/"}};if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.RateCalendar=function(A){VacationRoost.VR.RateCalendar.initializeBase(this,[A]);this._checkIn=null;this._checkOut=null};VacationRoost.VR.RateCalendar.prototype={initialize:function(){VacationRoost.VR.RateCalendar.callBaseMethod(this,"initialize");VacationRoost.VR.TravelDateSynchronizer.add(this)},_dateCellClickInternal:function(D){if(this._checkIn&&this._checkOut==null){var A=D.date;var B=this._checkIn;if(A>B){this._setTravelDates(B,A)}else{if(B.valueOf()==A.valueOf()){this.clearTravelDates()}else{this._setTravelDates(A,B)}}}else{if(D.date>this._checkIn&&D.date<this._checkOut){this.clearTravelDates()}else{if(this._checkIn&&this._checkOut&&this._checkAdjacent(this._checkOut,D.date)){if(this._checkIn>D.date){this._setTravelDates(D.date,this._checkOut)}else{if(this._checkOut<D.date){this._setTravelDates(this._checkIn,D.date)}else{this.clearTravelDates()}}}else{var C=this._cellProperties[D.date.localeFormat("d")];if(!C||!C.checkInDisabled){this._checkIn=D.date;this._checkOut=null;this._updateDayCells()}}}}},_checkAdjacent:function(D,C){var A=D.getDate()+1;var B=D.getDate()-1;if(A<=C||B>=C){return true}else{return false}},_getCellCssClass:function(A){if(A.date<this._earliestAllowedCheckIn){return"unavailable"}var B=A.checkInDisabled;var C=A.checkOutDisabled;if(this._checkIn&&this._checkOut){if(this._checkOut.valueOf()==A.date.valueOf()&&B&&!C){return"selected availableForCheckOut"}if(this._checkIn.valueOf()==A.date.valueOf()&&C&&!B){return"selected availableForCheckIn"}if(this._checkOut.valueOf()==A.date.valueOf()&&B&&C){return"conflicted"}if(this._checkIn.valueOf()<=A.date.valueOf()&&this._checkOut.valueOf()>A.date.valueOf()&&B){return"conflicted"}if(this._checkIn.valueOf()<=A.date.valueOf()&&this._checkOut.valueOf()>=A.date.valueOf()){return"selected"}}if(this._checkIn&&this._checkIn.valueOf()==A.date.valueOf()){if(this._checkIn.valueOf()==A.date.valueOf()&&C&&!B){return"selected availableForCheckIn"}return"selected"}if(B&&C){return"unavailable"}if(B){return"availableForCheckOut"}if(C){return"availableForCheckIn"}return""},add_travelDatesChanged:function(A){this.get_events().addHandler("travelDatesChanged",A)},remove_travelDatesChanged:function(A){this.get_events().removeHandler("travelDatesChanged",A)},raiseTravelDatesChanged:function(A){var B=this.get_events().getHandler("travelDatesChanged");if(B){B(this,A)}},setTravelDates:function(B,A){this._checkIn=B;this._checkOut=A;this._changeFirstDate(new Date(B.getFullYear(),B.getMonth(),1))},clearTravelDates:function(){this._checkIn=null;this._checkOut=null;this._updateDayCells()},_setTravelDates:function(C,A){this._checkIn=C;this._checkOut=A;this._updateDayCells();var B=new Sys.EventArgs();B.checkIn=C;B.checkOut=A;this.raiseTravelDatesChanged(B)},get_checkIn:function(){return this._checkIn},set_checkIn:function(A){this._checkIn=A},get_checkOut:function(){return this._checkOut},set_checkOut:function(A){this._checkOut=A},dispose:function(){VacationRoost.VR.RateCalendar.callBaseMethod(this,"dispose")}};VacationRoost.VR.RateCalendar.registerClass("VacationRoost.VR.RateCalendar",VacationRoost.Web.Common.CalendarBase);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.Athena");VacationRoost.Athena.CalendarPair=function(){VacationRoost.Athena.CalendarPair.initializeBase(this);this._checkInBox=null;this._checkOutBox=null;this._clearDatesButton=null;this._checkInCalendar=null;this._checkOutCalendar=null;this._synchronizeDates=true;var A=new Date();A=new Date(A.getFullYear(),A.getMonth(),A.getDate());A.setDate(A.getDate()+2);this._earliestAllowedCheckIn=A;this._checkOutCalendarShowingDelegate=Function.createDelegate(this,this._checkOutCalendarShowingHandler);this._travelDatesChangedDelegate=Function.createDelegate(this,this._travelDatesChangedHandler);this._clearDatesClickDelegate=Function.createDelegate(this,this._clearDatesClickHandler)};VacationRoost.Athena.CalendarPair.prototype={initialize:function(){var B=this._checkInBox,D=this._checkOutBox,A=this._clearDatesButton,E,C;E=$(B).datepicker({dateFormat:"m/d/yy",minDate:this._earliestAllowedCheckIn,onSelect:this._travelDatesChangedDelegate});this._checkInCalendar=E;$(B).prev("img").click(function(){$(B).focus()});C=$(D).datepicker({dateFormat:"m/d/yy",beforeShow:this._checkOutCalendarShowingDelegate,onSelect:this._travelDatesChangedDelegate});this._checkOutCalendar=C;$(D).prev("img").click(function(){$(D).focus()});Sys.UI.DomEvent.addHandler(B,"change",this._travelDatesChangedDelegate);Sys.UI.DomEvent.addHandler(D,"change",this._travelDatesChangedDelegate);if(A){Sys.UI.DomEvent.addHandler(A,"click",this._clearDatesClickDelegate)}VacationRoost.Athena.CalendarPair.callBaseMethod(this,"initialize");if(this._synchronizeDates){VacationRoost.VR.TravelDateSynchronizer.add(this)}},add_travelDatesChanged:function(A){this.get_events().addHandler("travelDatesChanged",A)},remove_travelDatesChanged:function(A){this.get_events().removeHandler("travelDatesChanged",A)},raiseTravelDatesChanged:function(A){var B=this.get_events().getHandler("travelDatesChanged");if(B){B(this,A)}},_checkOutCalendarShowingHandler:function(){var E=this._checkInCalendar;var B=this._checkOutCalendar;var A=E.datepicker("getDate");if(A){var C=E.datepicker("getDate");C.setDate(A.getDate()+1);B.datepicker("option","minDate",C);var D=B.datepicker("getDate");if(D&&A>D){B.datepicker("setDate",null)}}},_travelDatesChangedHandler:function(){var C=VacationRoost.VR.ParseTextToDate(this._checkInBox.value),A=VacationRoost.VR.ParseTextToDate(this._checkOutBox.value);if(C&&A&&C<A){var B=new Sys.EventArgs();B.checkIn=C;B.checkOut=A;this.raiseTravelDatesChanged(B)}},setTravelDates:function(B,A){this._checkInBox.value=B.localeFormat("d");this._checkInCalendar.datepicker("setDate",B);this._checkOutBox.value=A.localeFormat("d");this._checkOutCalendar.datepicker("setDate",A)},clearTravelDates:function(){this._checkInBox.value="";this._checkOutBox.value=""},_clearDatesClickHandler:function(){this.clearTravelDates();var A=new Sys.EventArgs();A.checkIn=null;A.checkOut=null;this.raiseTravelDatesChanged(A)},get_checkInBox:function(){return this._checkInBox},set_checkInBox:function(A){this._checkInBox=A},get_checkOutBox:function(){return this._checkOutBox},set_checkOutBox:function(A){this._checkOutBox=A},get_synchronizeDates:function(){return this._synchronizeDates},set_synchronizeDates:function(A){this._synchronizeDates=A},get_clearDatesButton:function(){return this._clearDatesButton},set_clearDatesButton:function(A){this._clearDatesButton=A},get_earliestAllowedCheckIn:function(){return this._earliestAllowedCheckIn},set_earliestAllowedCheckIn:function(A){this._earliestAllowedCheckIn=A}};VacationRoost.Athena.CalendarPair.registerClass("VacationRoost.Athena.CalendarPair",Sys.Component);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.BookNowButton=function(A){VacationRoost.VR.BookNowButton.initializeBase(this,[A]);this._enabledCssClass="bookNow";this._disabledCssClass="bookNowDisabled";this._bookingUrl=null;this._checkInBox=null;this._checkOutBox=null;this._adultsDropDown=null;this._childrenDropDown=null;this._propertyId=null;this._bookNowUpdateImage=null;this._showLeadForm=false;this._enabled=true;this._clickDelegate=Function.createDelegate(this,this._clickHandler)};VacationRoost.VR.BookNowButton.prototype={initialize:function(){var A=this.get_element();Sys.UI.DomEvent.addHandler(A,"click",this._clickDelegate);VacationRoost.VR.BookNowButton.callBaseMethod(this,"initialize");VacationRoost.VR.PropertyPageController.registerBookNowButton(this)},update:function(A){var B=this.get_element();if(A.IsButtonEnabled){Sys.UI.DomElement.addCssClass(B,this._enabledCssClass);Sys.UI.DomElement.removeCssClass(B,this._disabledCssClass);this._enabled=true}else{Sys.UI.DomElement.addCssClass(B,this._disabledCssClass);Sys.UI.DomElement.removeCssClass(B,this._enabledCssClass);this._enabled=false}this._showLeadForm=A.ShowsLeadForm},bookNow:function(){if(Page_ClientValidate("BookNow")){var B=VacationRoost.VR.ParseTextToDate(this._checkInBox.value),F=VacationRoost.VR.ParseTextToDate(this._checkOutBox.value),A=this._adultsDropDown,D=this._childrenDropDown,G=this._propertyId,J=this._bookNowUpdateImage;if(this._enabled){if(this._showLeadForm||this._bookingUrl==null){var H=parseInt(A.options[A.selectedIndex].value);var E=parseInt(D.options[D.selectedIndex].value);var I=this.get_leadForm();if(typeof (I.set_adults)=="function"){I.set_adults(H)}if(typeof (I.set_children)=="function"){I.set_children(E)}if(this._showLeadForm){I.open(true)}else{if(this._bookingUrl==null){I.open(false)}}}else{J.style.display="";this.get_element().style.display="none";var C=this._getBookingUrl();if(typeof (_gat)!="undefined"){C=_gat._getTrackerByName("pageTracker")._getLinkerUrl(C)}document.location.href=C}}else{VacationRoost.VR.PropertyPageController.showDateErrorPanels();VacationRoost.VR.PropertyPageController.showMessage({Message:"Please select your dates of stay.",IsError:false})}}},_clickHandler:function(){this.bookNow();return false},_getBookingUrl:function(){var E=VacationRoost.VR.ParseTextToDate(this._checkInBox.value),A=VacationRoost.VR.ParseTextToDate(this._checkOutBox.value),H=this._adultsDropDown,F=this._childrenDropDown;var B=parseInt(H.options[H.selectedIndex].value);var G=parseInt(F.options[F.selectedIndex].value);var D=this._bookingUrl;D+="&checkin="+E.localeFormat("d");D+="&checkout="+A.localeFormat("d");D+="&adults="+B;D+="&children="+G;var C=this._getEmailId();if(C){D+="&EID="+C}return D},_getEmailId:function(){var C="EID=";var A=document.cookie.split(";");for(var B=0;B<A.length;B++){var D=A[B];while(D.charAt(0)==" "){D=D.substring(1,D.length)}if(D.indexOf(C)==0){return D.substring(C.length,D.length)}}return""},get_enabled:function(){return this._enabled},set_enabled:function(A){this._enabled=A},get_propertyId:function(){return this._propertyId},set_propertyId:function(A){this._propertyId=A},get_bookNowUpdateImage:function(){return this._bookNowUpdateImage},set_bookNowUpdateImage:function(A){this._bookNowUpdateImage=A},get_bookingUrl:function(){return this._bookingUrl},set_bookingUrl:function(A){this._bookingUrl=A},get_leadForm:function(){return VacationRoost.VR.PropertyPageController.get_leadForm()},get_showLeadForm:function(){return this._showLeadForm},set_showLeadForm:function(A){this._showLeadForm=A},get_checkInBox:function(){return this._checkInBox},set_checkInBox:function(A){this._checkInBox=A},get_checkOutBox:function(){return this._checkOutBox},set_checkOutBox:function(A){this._checkOutBox=A},get_adultsDropDown:function(){return this._adultsDropDown},set_adultsDropDown:function(A){this._adultsDropDown=A},get_childrenDropDown:function(){return this._childrenDropDown},set_childrenDropDown:function(A){this._childrenDropDown=A},dispose:function(){VacationRoost.VR.BookNowButton.callBaseMethod(this,"dispose")}};VacationRoost.VR.BookNowButton.registerClass("VacationRoost.VR.BookNowButton",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.Athena");VacationRoost.Athena.BookingOptionsButton=function(A){VacationRoost.Athena.BookingOptionsButton.initializeBase(this,[A]);this._menuElement=null;this._leadFormButton=null;this._shortListButton=null;this._rentalUnitId=null;this._checkIn=null;this._checkOut=null};VacationRoost.Athena.BookingOptionsButton.prototype={initialize:function(){VacationRoost.Athena.BookingOptionsButton.callBaseMethod(this,"initialize");$(this.get_element()).closest("div").hover(function(){$(this).find(".BookingOptionsList").stop(true,true).slideDown("normal")},function(){$(this).find(".BookingOptionsList").stop(true,true).slideUp("normal")});if(this._leadFormButton){$addHandler(this._leadFormButton,"click",Function.createDelegate(this,this._leadFormButtonClick))}if(this._shortListButton){$addHandler(this._shortListButton,"click",Function.createDelegate(this,this._shortListButtonClick))}VacationRoost.VR.TravelDateSynchronizer.add(this)},clearTravelDates:function(){this._checkIn=null;this._checkOut=null},setTravelDates:function(B,A){this._checkIn=B;this._checkOut=A},_mouseover:function(A){$(this._menuElement).slideDown("normal")},_mouseout:function(A){if(A.target.nodeName=="UL"){$(this._menuElement).slideUp("normal")}},_click:function(A){$(this._menuElement).slideDown("normal")},_leadFormButtonClick:function(A){VacationRoost.Athena.ModalLeadForm.set_googleTrackingPageName("/property-details-lead");VacationRoost.Athena.ModalLeadForm.open()},_shortListButtonClick:function(A){$(this._menuElement).slideUp("normal");VacationRoost.Athena.ShortListService.addAccommodation(this._rentalUnitId,$.cookie("checkin"),$.cookie("checkout"),Function.createDelegate(this,this._onMethodComplete),Function.createDelegate(this,this._onMethodError))},_onMethodComplete:function(A,D,C){$(this._notificationElement).text("Property Added");var B=this;setTimeout(function(){$(B._notificationElement).fadeTo(800,0)},5000)},_onMethodError:function(A,C,B){alert(A.get_statusCode())},get_menuElement:function(){return this._menuElement},set_menuElement:function(A){this._menuElement=A},get_rentalUnitId:function(){return this._rentalUnitId},set_rentalUnitId:function(A){this._rentalUnitId=A},get_checkIn:function(){return this._checkIn},set_checkIn:function(A){this._checkIn=A},get_checkOut:function(){return this._checkOut},set_checkOut:function(A){this._checkOut=A},get_leadFormButton:function(){return this._leadFormButton},set_leadFormButton:function(A){this._leadFormButton=A},get_shortListButton:function(){return this._shortListButton},set_shortListButton:function(A){this._shortListButton=A},get_notificationElement:function(){return this._notificationElement},set_notificationElement:function(A){this._notificationElement=A},dispose:function(){VacationRoost.Athena.BookingOptionsButton.callBaseMethod(this,"dispose")}};VacationRoost.Athena.BookingOptionsButton.registerClass("VacationRoost.Athena.BookingOptionsButton",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.TravelDateValidationSummary=function(A){VacationRoost.VR.TravelDateValidationSummary.initializeBase(this,[A]);this._messageList=null};VacationRoost.VR.TravelDateValidationSummary.prototype={initialize:function(){var A=this.get_element();this._messageList=$("ul",A).get(0);this._conflictedDatesElement=$("li",this._messageList).get(0);VacationRoost.VR.TravelDateValidationSummary.callBaseMethod(this,"initialize");if(typeof (VacationRoost.VR.PropertyPageController)!=="undefined"){VacationRoost.VR.PropertyPageController.registerTravelDateValidationSummary(this)}},update:function(B){this.clearMessages();if(B.length==0){this.get_element().style.display="none"}else{for(var A=0;A<B.length;A++){this.appendMessage(B[A])}}},clearMessages:function(){var A=this._messageList;while(A.childNodes.length>0){A.removeChild(A.firstChild)}},appendMessage:function(B){var A=document.createElement("LI");A.appendChild(document.createTextNode(B.Message));if(!B.IsError){A.className="info"}this._messageList.appendChild(A);this.get_element().style.display=""},dispose:function(){VacationRoost.VR.TravelDateValidationSummary.callBaseMethod(this,"dispose")}};VacationRoost.VR.TravelDateValidationSummary.registerClass("VacationRoost.VR.TravelDateValidationSummary",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.Athena");VacationRoost.Athena._MinNightMessage=function(){VacationRoost.Athena._MinNightMessage.initializeBase(this);this._minNightMessageUrl=null};VacationRoost.Athena._MinNightMessage.prototype={initialize:function(){VacationRoost.Athena._MinNightMessage.callBaseMethod(this,"initialize");VacationRoost.VR.PropertyPageController.registerMinNightMessage(this)},show:function(){VacationRoost.VR.ModalIFrame.show(this._minNightMessageUrl,280,400)},get_minNightMessageUrl:function(){return this._minNightMessageUrl},set_minNightMessageUrl:function(A){this._minNightMessageUrl=A},dispose:function(){VacationRoost.Athena._MinNightMessage.callBaseMethod(this,"dispose")}};VacationRoost.Athena._MinNightMessage.registerClass("VacationRoost.Athena._MinNightMessage",Sys.Component);VacationRoost.Athena.MinNightMessage=$create(VacationRoost.Athena._MinNightMessage);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
