Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.SearchResultsViewModeBehavior=function(A){VacationRoost.VR.SearchResultsViewModeBehavior.initializeBase(this,[A]);this._listView=null;this._galleryView=null;this._mapview=null;this._listViewClickDelegate=Function.createDelegate(this,this._listViewClickHandler);this._galleryViewClickDelegate=Function.createDelegate(this,this._galleryViewClickHandler);this._mapViewClickDelegate=Function.createDelegate(this,this._mapViewClickHandler)};VacationRoost.VR.SearchResultsViewModeBehavior.prototype={initialize:function(){VacationRoost.VR.SearchResultsViewModeBehavior.callBaseMethod(this,"initialize");Sys.UI.DomEvent.addHandler(this._listView,"click",this._listViewClickDelegate);Sys.UI.DomEvent.addHandler(this._galleryView,"click",this._galleryViewClickDelegate);Sys.UI.DomEvent.addHandler(this._mapView,"click",this._mapViewClickDelegate);if($.cookie("searchResultsViewPreference")=="list"){$(this._listView).removeClass("listOff");$(this._listView).addClass("listOn");$(this._galleryView).addClass("galleryOff");$(this._mapView).addClass("mapOff")}if($.cookie("searchResultsViewPreference")=="gallery"){$(this._galleryView).removeClass("galleryOff");$(this._galleryView).addClass("galleryOn");$(this._listView).addClass("listOff");$(this._mapView).addClass("mapOff")}if($.cookie("searchResultsViewPreference")=="map"){$(this._mapView).removeClass("mapOff");$(this._mapView).addClass("mapOn");$(this._galleryView).addClass("galleryOff");$(this._listView).addClass("listOff")}},_listViewClickHandler:function(A){$.cookie("searchResultsViewPreference","list",{path:"/"});VacationRoost.VR.SearchFilterController.loadSearch();A.preventDefault()},_galleryViewClickHandler:function(A){$.cookie("searchResultsViewPreference","gallery",{path:"/"});VacationRoost.VR.SearchFilterController.loadSearch();A.preventDefault()},_mapViewClickHandler:function(A){$.cookie("searchResultsViewPreference","map",{path:"/"});VacationRoost.VR.SearchFilterController.loadSearch();A.preventDefault()},get_listView:function(){return this._listView},set_listView:function(A){this._listView=A},get_galleryView:function(){return this._galleryView},set_galleryView:function(A){this._galleryView=A},get_mapView:function(){return this._mapView},set_mapView:function(A){this._mapView=A},dispose:function(){VacationRoost.VR.SearchResultsViewModeBehavior.callBaseMethod(this,"dispose")}};VacationRoost.VR.SearchResultsViewModeBehavior.registerClass("VacationRoost.VR.SearchResultsViewModeBehavior",Sys.UI.Behavior);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.VR");VacationRoost.VR.SearchSortDropDownBehavior=function(A){VacationRoost.VR.SearchSortDropDownBehavior.initializeBase(this,[A]);this._valueToSortMapping=null;this._changeDelegate=Function.createDelegate(this,this._changeHandler);this._unsortedUrl=null;this._selectedSortValue=null};VacationRoost.VR.SearchSortDropDownBehavior.prototype={initialize:function(){VacationRoost.VR.SearchSortDropDownBehavior.callBaseMethod(this,"initialize");Sys.UI.DomEvent.addHandler(this.get_element(),"change",this._changeDelegate);this._setSelectSortOption()},_setSelectSortOption:function(){for(var A in this._valueToSortMapping){if(this._valueToSortMapping[A]==this._selectedSortValue){this.get_element().value=A}}},_changeHandler:function(){var B=this.get_element();var C=B.options[B.selectedIndex].value;var A=this._valueToSortMapping[C];if(A){document.location.href=this._unsortedUrl+((this._unsortedUrl.indexOf("?")==-1)?"?":"&")+"Ns="+A}else{document.location.href=this._unsortedUrl}},get_valueToSortMapping:function(){return this._valueToSortMapping},set_valueToSortMapping:function(A){this._valueToSortMapping=A},get_unsortedUrl:function(){return this._unsortedUrl},set_unsortedUrl:function(A){this._unsortedUrl=A},get_selectedSortValue:function(){return this._selectedSortValue},set_selectedSortValue:function(A){this._selectedSortValue=A},dispose:function(){VacationRoost.VR.SearchSortDropDownBehavior.callBaseMethod(this,"dispose")}};VacationRoost.VR.SearchSortDropDownBehavior.registerClass("VacationRoost.VR.SearchSortDropDownBehavior",Sys.UI.Behavior);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
Type.registerNamespace("VacationRoost.Athena");VacationRoost.Athena.AddToShortListButton=function(A){VacationRoost.Athena.AddToShortListButton.initializeBase(this,[A]);this._messageContainer=null;this._rentalUnitId=null;this._checkIn=null;this._checkOut=null};VacationRoost.Athena.AddToShortListButton.prototype={initialize:function(){VacationRoost.Athena.AddToShortListButton.callBaseMethod(this,"initialize");$addHandler(this.get_element(),"click",Function.createDelegate(this,this._click))},_click:function(A){A.preventDefault();VacationRoost.Athena.ShortListService.addAccommodation(this._rentalUnitId,this._checkIn,this._checkOut,Function.createDelegate(this,this._onMethodComplete),Function.createDelegate(this,this._onMethodError))},_onMethodComplete:function(A,D,C){$(this._messageContainer).text("Property Added").fadeIn("normal");var B=this;setTimeout(function(){$(B._messageContainer).fadeOut("normal")},5000)},_onMethodError:function(A,C,B){alert(A.get_statusCode())},get_messageContainer:function(){return this._messageContainer},set_messageContainer:function(A){this._messageContainer=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},dispose:function(){VacationRoost.Athena.AddToShortListButton.callBaseMethod(this,"dispose")}};VacationRoost.Athena.AddToShortListButton.registerClass("VacationRoost.Athena.AddToShortListButton",Sys.UI.Control);if(typeof (Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};
