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.VR");VacationRoost.VR.TravelDatesElement=function(A){VacationRoost.VR.TravelDatesElement.initializeBase(this,[A]);this._noTravelDatesText="N/A"};VacationRoost.VR.TravelDatesElement.prototype={initialize:function(){VacationRoost.VR.TravelDatesElement.callBaseMethod(this,"initialize");VacationRoost.VR.TravelDateSynchronizer.add(this)},setTravelDates:function(C,A){var B=this.get_element();B.innerHTML=C.localeFormat("d")+" to "+A.localeFormat("d")},clearTravelDates:function(){var A=this.get_element();A.innerHTML=this._noTravelDatesText},dispose:function(){VacationRoost.VR.TravelDatesElement.callBaseMethod(this,"dispose")}};VacationRoost.VR.TravelDatesElement.registerClass("VacationRoost.VR.TravelDatesElement",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.LeadFactory=function(){VacationRoost.VR.LeadFactory.initializeBase(this);this._siteId=null;this._checkInBox=null;this._checkIn=null;this._checkOutBox=null;this._checkOut=null;this._firstNameBox=null;this._lastNameBox=null;this._emailBox=null;this._signupForNewsletterCheckbox=null;this._phoneBox=null;this._bedroomsDropDown=null;this._adultsDropDown=null;this._childrenDropDown=null;this._commentsBox=null;this._leadInformation=null;this._destinationId=null;this._inventoryId=null;this._agentUserName=null};VacationRoost.VR.LeadFactory.prototype={getLead:function(){var A=true;if(this._signupForNewsletterCheckbox){A=this._signupForNewsletterCheckbox.checked}var B={SiteId:this._siteId,FirstName:this._firstNameBox.value,LastName:this._lastNameBox.value,Email:this._emailBox.value,SignupForNewsletter:A,Phone:this._phoneBox.value,EmailId:this._getEmailId(),AgentUserName:this._agentUserName};B.CheckIn=this._determineCheckIn();B.CheckOut=this._determineCheckOut();if(this._bedroomsDropDown){B.Bedrooms=this._getDropDownValue(this._bedroomsDropDown)}if(this._adultsDropDown){B.Adults=this._getDropDownValue(this._adultsDropDown)}if(this._childrenDropDown){B.Children=this._getDropDownValue(this._childrenDropDown)}if(this._commentsBox){B.Comments=this._commentsBox.value}B.LeadInformation=this._leadInformation;B.DestinationId=this._destinationId;B.InventoryId=this._inventoryId;return B},_determineCheckIn:function(){if(this._checkInBox){return this._checkInBox.value}return this._checkIn},_determineCheckOut:function(){if(this._checkOutBox){return this._checkOutBox.value}return this._checkOut},_getDropDownValue:function(D,A){var C=A;var B=D.options[D.selectedIndex].value;if(B){C=parseInt(B)}return C},_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_siteId:function(){return this._siteId},set_siteId:function(A){this._siteId=A},get_destinationId:function(){return this._destinationId},set_destinationId:function(A){this._destinationId=A},get_inventoryId:function(){return this._inventoryId},set_inventoryId:function(A){this._inventoryId=A},get_checkInBox:function(){return this._checkInBox},set_checkInBox:function(A){this._checkInBox=A},get_checkIn:function(){return this._checkIn},set_checkIn:function(A){this._checkIn=A},get_checkOutBox:function(){return this._checkOutBox},set_checkOutBox:function(A){this._checkOutBox=A},get_checkOut:function(){return this._checkOut},set_checkOut:function(A){this._checkOut=A},get_firstNameBox:function(){return this._firstNameBox},set_firstNameBox:function(A){this._firstNameBox=A},get_lastNameBox:function(){return this._lastNameBox},set_lastNameBox:function(A){this._lastNameBox=A},get_emailBox:function(){return this._emailBox},set_emailBox:function(A){this._emailBox=A},get_signupForNewsletterCheckbox:function(){return this._signupForNewsletterCheckbox},set_signupForNewsletterCheckbox:function(A){this._signupForNewsletterCheckbox=A},get_phoneBox:function(){return this._phoneBox},set_phoneBox:function(A){this._phoneBox=A},get_bedroomsDropDown:function(){return this._bedroomsDropDown},set_bedroomsDropDown:function(A){this._bedroomsDropDown=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},get_commentsBox:function(){return this._commentsBox},set_commentsBox:function(A){this._commentsBox=A},get_leadInformation:function(){return this._leadInformation},set_leadInformation:function(A){this._leadInformation=A},get_agentUserName:function(){return this._agentUserName},set_agentUserName:function(A){this._agentUserName=A},addLeadInformation:function(A){if(!this._leadInformation){this._leadInformation=""}this._leadInformation+=A}};VacationRoost.VR.LeadFactory.registerClass("VacationRoost.VR.LeadFactory",Sys.Component);VacationRoost.VR.LeadService=function(){VacationRoost.VR.LeadService.initializeBase(this);this._url="/AjaxServices/LeadService.svc/ajaxEndpoint"};VacationRoost.VR.LeadService.prototype={submitJavaScriptLead:function(B,A){var C={lead:B};Sys.Net.WebServiceProxy.invoke(this._url,"SubmitJavaScriptLead",false,C,A,null,null)},submitShortListLead:function(C,B,A){var D={lead:C,productOfferId:B};Sys.Net.WebServiceProxy.invoke(this._url,"SubmitShortListLead",false,D,A,null,null)},_jsonEscape:function(A){return A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r?\n/g,"\\n")}};VacationRoost.VR.LeadService.registerClass("VacationRoost.VR.LeadService",Sys.Component);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.SubmitLeadButton=function(A){VacationRoost.VR.SubmitLeadButton.initializeBase(this,[A]);this._clickDelegate=Function.createDelegate(this,this._clickHandler);this._submittedDelegate=Function.createDelegate(this,this._submittedHandler);this._leadService=null;this._leadFactory=null;this._siteId=null;this._inventoryId=null;this._checkIn=null;this._checkInBox=null;this._checkOut=null;this._checkOutBox=null;this._firstNameBox=null;this._lastNameBox=null;this._emailBox=null;this._phoneBox=null;this._commentsBox=null;this._adultsDropDown=null;this._childrenDropDown=null;this._submittingElement=null;this._redirectUrl=null;this._leadFormContainer=null;this._thankYouContainer=null;this._thankYouImage=null;this._thankYouImageUrl=null;this._destinationId=null;this._leadInformation=null;this._googleTrackingPageName=null;this._searchAdConversionCodePath=null};VacationRoost.VR.SubmitLeadButton.prototype={initialize:function(){var A=this.get_element();this._leadFactory=$create(VacationRoost.VR.LeadFactory,{siteId:this._siteId,checkIn:this._checkIn,checkInBox:this._checkInBox,checkOut:this._checkOut,checkOutBox:this._checkOutBox,firstNameBox:this._firstNameBox,lastNameBox:this._lastNameBox,emailBox:this._emailBox,phoneBox:this._phoneBox,commentsBox:this._commentsBox,adultsDropDown:this._adultsDropDown,childrenDropDown:this._childrenDropDown,destinationId:this._destinationId,leadInformation:this._leadInformation,inventoryId:this._inventoryId});this._leadService=new VacationRoost.VR.LeadService();Sys.UI.DomEvent.addHandler(A,"click",this._clickDelegate);VacationRoost.VR.SubmitLeadButton.callBaseMethod(this,"initialize");if(typeof (VacationRoost.VR.TravelDateSynchronizer!=="undefined")){VacationRoost.VR.TravelDateSynchronizer.add(this)}},_clickHandler:function(A){this._submitLead()},_submitLead:function(){var D=Page_ClientValidate("SubmitLead");if(D){var C=this._submittingElement;if(C){var B=this.get_element();B.style.display="none";C.style.display=""}var A=this._leadFactory.getLead();this._leadService.submitJavaScriptLead(A,this._submittedDelegate)}},_submittedHandler:function(A){if(this._googleTrackingPageName){_gat._getTrackerByName("pageTracker")._trackPageview(this._googleTrackingPageName);_gat._getTrackerByName("rollupTracker")._trackPageview(this._googleTrackingPageName)}if(this._redirectUrl){window.location=this._redirectUrl}else{if(this._leadFormContainer&&this._thankYouContainer){if(this._searchAdConversionCodePath){var B=document.createElement("iframe");B.src=this._searchAdConversionCodePath;B.style.position="absolute";B.style.top="0px";B.style.left="-9999px";document.getElementsByTagName("body")[0].appendChild(B)}if(this._thankYouImage){this._thankYouImage.src=this._thankYouImageUrl}this._leadFormContainer.style.display="none";this._thankYouContainer.style.display=""}else{alert("You need to set this up to either redirect, or swap visibility on two elements.")}}},clearTravelDates:function(){this._leadFactory.set_checkIn(null);this._leadFactory.set_checkOut(null)},setTravelDates:function(B,A){this._leadFactory.set_checkIn(B.localeFormat("d"));this._leadFactory.set_checkOut(A.localeFormat("d"))},get_siteId:function(){return this._siteId},set_siteId:function(A){this._siteId=A},get_inventoryId:function(){return this._inventoryId},set_inventoryId:function(A){this._inventoryId=A},get_checkIn:function(){return this._checkIn},set_checkIn:function(A){this._checkIn=A},get_checkInBox:function(){return this._checkInBox},set_checkInBox:function(A){this._checkInBox=A},get_checkOut:function(){return this._checkOut},set_checkOut:function(A){this._checkOut=A},get_checkOutBox:function(){return this._checkOutBox},set_checkOutBox:function(A){this._checkOutBox=A},get_firstNameBox:function(){return this._firstNameBox},set_firstNameBox:function(A){this._firstNameBox=A},get_lastNameBox:function(){return this._lastNameBox},set_lastNameBox:function(A){this._lastNameBox=A},get_emailBox:function(){return this._emailBox},set_emailBox:function(A){this._emailBox=A},get_phoneBox:function(){return this._phoneBox},set_phoneBox:function(A){this._phoneBox=A},get_commentsBox:function(){return this._commentsBox},set_commentsBox:function(A){this._commentsBox=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},get_submittingElement:function(){return this._submittingElement},set_submittingElement:function(A){this._submittingElement=A},get_redirectUrl:function(){return this._redirectUrl},set_redirectUrl:function(A){this._redirectUrl=A},get_leadFormContainer:function(){return this._leadFormContainer},set_leadFormContainer:function(A){this._leadFormContainer=A},get_thankYouContainer:function(){return this._thankYouContainer},set_thankYouContainer:function(A){this._thankYouContainer=A},get_thankYouImage:function(){return this._thankYouImage},set_thankYouImage:function(A){this._thankYouImage=A},get_thankYouImageUrl:function(){return this._thankYouImageUrl},set_thankYouImageUrl:function(A){this._thankYouImageUrl=A},get_destinationId:function(){return this._destinationId},set_destinationId:function(A){this._destinationId=A},get_leadInformation:function(){return this._leadInformation},set_leadInformation:function(A){this._leadInformation=A},get_googleTrackingPageName:function(){return this._googleTrackingPageName},set_googleTrackingPageName:function(A){this._googleTrackingPageName=A},get_searchAdConversionCodePath:function(){return this._searchAdConversionCodePath},set_searchAdConversionCodePath:function(A){this._searchAdConversionCodePath=A},dispose:function(){if(this._clickDelegate){var A=this.get_element();Sys.UI.DomEvent.removeHandler(A,"click",this._clickDelegate);delete this._clickDelegate}VacationRoost.VR.SubmitLeadButton.callBaseMethod(this,"dispose")}};VacationRoost.VR.SubmitLeadButton.registerClass("VacationRoost.VR.SubmitLeadButton",Sys.UI.Control);VacationRoost.VR.LeadForm=function(){VacationRoost.VR.LeadForm.initializeBase(this);this._defaultMessageContainer=null;this._noRatesMessageContainer=null;this._adultsDropDown=null;this._childrenDropDown=null;this._tabControl=null;this._tabIndex=null};VacationRoost.VR.LeadForm.prototype={initialize:function(){VacationRoost.VR.LeadForm.callBaseMethod(this,"initialize");if(typeof (VacationRoost.VR.PropertyPageController)!=="undefined"){VacationRoost.VR.PropertyPageController.registerLeadForm(this)}},open:function(A){if(A&&this._noRatesMessageContainer&&this._defaultMessageContainer){this._noRatesMessageContainer.style.display="";this._defaultMessageContainer.style.display="none"}else{if(this._noRatesMessageContainer&&this._defaultMessageContainer){this._noRatesMessageContainer.style.display="none";this._defaultMessageContainer.style.display=""}}if(this._tabControl&&this._tabIndex){this._tabControl.selectTab(this._tabIndex)}},get_defaultMessageContainer:function(){return this._defaultMessageContainer},set_defaultMessageContainer:function(A){this._defaultMessageContainer=A},get_noRatesMessageContainer:function(){return this._noRatesMessageContainer},set_noRatesMessageContainer:function(A){this._noRatesMessageContainer=A},get_adultsDropDown:function(){return this._adultsDropDown},set_adultsDropDown:function(A){this._adultsDropDown=A},get_isModal:function(){return this._isModal},set_isModal:function(A){this._isModal=A},get_childrenDropDown:function(){return this._childrenDropDown},set_childrenDropDown:function(A){this._childrenDropDown=A},get_tabIndex:function(){return this._tabIndex},set_tabIndex:function(A){this._tabIndex=A},get_tabControl:function(){return this._tabControl},set_tabControl:function(A){this._tabControl=A},set_adults:function(A){if(this._adultsDropDown){this._adultsDropDown.value=A}},set_children:function(A){if(this._childrenDropDown){this._childrenDropDown.value=A}},dispose:function(){VacationRoost.VR.LeadForm.callBaseMethod(this,"dispose")}};VacationRoost.VR.LeadForm.registerClass("VacationRoost.VR.LeadForm",Sys.Component);VacationRoost.VR.ModalLeadForm=function(){VacationRoost.VR.ModalLeadForm.initializeBase(this);this._popupContainer=null;this._fakeOpenButton=null;this._modalPopup=null;this._closeButtons=null;this._closeClickDelegate=Function.createDelegate(this,this._closeClickHandler)};VacationRoost.VR.ModalLeadForm.prototype={initialize:function(){VacationRoost.VR.ModalLeadForm.callBaseMethod(this,"initialize");var B=document.createElement("a");B.style.display="none";document.getElementsByTagName("body")[0].appendChild(B);this._fakeOpenButton=B;this._modalPopup=$create(AjaxControlToolkit.ModalPopupBehavior,{id:"LeadFormModalPopup",PopupControlID:this._popupContainer.id,BackgroundCssClass:"modalBackground"},null,null,B);for(var A=0;A<this._closeButtons.length;A++){Sys.UI.DomEvent.addHandler(this._closeButtons[A],"click",this._closeClickDelegate)}},open:function(A){VacationRoost.VR.ModalLeadForm.callBaseMethod(this,"open",[A]);this._modalPopup.show()},close:function(){this._modalPopup.hide()},_closeClickHandler:function(A){this.close()},get_closeButtons:function(){return this._closeButtons},set_closeButtons:function(A){this._closeButtons=A},get_popupContainer:function(){return this._popupContainer},set_popupContainer:function(A){this._popupContainer=A},dispose:function(){VacationRoost.VR.ModalLeadForm.callBaseMethod(this,"dispose")}};VacationRoost.VR.ModalLeadForm.registerClass("VacationRoost.VR.ModalLeadForm",VacationRoost.VR.LeadForm);
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.BookingTabControl=function(A){VacationRoost.VR.BookingTabControl.initializeBase(this,[A]);this._isInquiryTabSelected=false};VacationRoost.VR.BookingTabControl.prototype={initialize:function(){VacationRoost.VR.BookingTabControl.callBaseMethod(this,"initialize");this._control=$(this.get_element()).tabs();if(this._isInquiryTabSelected){this._control.tabs("select",1)}},selectTab:function(A){this._control.tabs("select",A)},get_isInquiryTabSelected:function(){return this._isInquiryTabSelected},set_isInquiryTabSelected:function(A){this._isInquiryTabSelected=A},dispose:function(){VacationRoost.VR.BookingTabControl.callBaseMethod(this,"dispose")}};VacationRoost.VR.BookingTabControl.registerClass("VacationRoost.VR.BookingTabControl",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
