(function(b){var a=[];b.preLoadImages=function(){var e=arguments.length;for(var c=e;c--;){var d=document.createElement("img");d.src=arguments[c];a.push(d)}}})(jQuery);(function(a){a.fn.createClickEvents=function(c){defaults={urlReference:null};var b=a.extend(defaults,c);a(this).each(function(){a(this).click(function(){window.location.assign(b.urlReference)})})}})(jQuery);function ActivityLogging(){var b=this;var a=null;var c=null;var d={URL:"http://aprojdev1s1.apts.classifiedventures.com:81",Type:"POST",DataType:"jsonp",Token:null,PageCollection:null,SiteCollection:null};this.Init=function(f){try{$.extend(d,f);a=b.ReadCookie("activitylogging");c=b.ReadCookie("userSite")}catch(e){b.Log(e)}};this.Log=function(h){try{var g=false;if(g){$.Console(h)}}catch(f){alert(ex)}};this.LogImpression=function(f,n,l,i,m,h,p,g,j,k){try{var e={PageTypeId:b.GetPageId(f),SearchId:l,PropertyId:i,ModelId:m,ProductId:h,ContainerTypeId:p,EventTypeId:g,ContainerContent:"",ListingPosition:j,IsBestMatch:k,VisitorId:b.GetVisitorId(),VisitId:b.GetVisitId(),SiteId:b.GetSiteId(n),SubSiteId:b.GetSubSiteId(),FrontDoorAffiliateId:b.GetFrontDoorAffiliateId()};b.WriteActivity(e,"/ActivityLogging/LogImpressionActivity")}catch(o){b.Log(o)}};this.LogClickThru=function(h,j,l,i,g,k,f){try{var e={PageTypeIdFrom:b.GetPageId(h),PageTypeIdTo:b.GetPageId(j),SearchId:i,PropertyId:g,ModelId:k,ProductId:f,VisitorId:b.GetVisitorId(),VisitId:b.GetVisitId(),SiteId:b.GetSiteId(l),SubSiteId:b.GetSubSiteId(),FrontDoorAffiliateId:b.GetFrontDoorAffiliateId()};b.WriteActivity(e,"/ActivityLogging/LogClickThruActivity")}catch(m){b.Log(m)}};this.LogLeads=function(f){try{var f={};b.WriteActivity(f,"/ActivityLogging/LogLeadActivity")}catch(e){b.Log(e)}};this.LogVisitor=function(f){try{var f={};b.WriteActivity(f,"/ActivityLogging/LogVisitActivity")}catch(e){b.Log(e)}};this.LogSearch=function(){try{var f={};b.WriteActivity(f,"/ActivityLogging/LogSearchActivity")}catch(e){b.Log(e)}};this.WriteActivity=function(e,g){try{$.ajax({type:d.Type,url:d.URL+g+"?callback=ActivitySuccess",dataType:d.DataType,jsonpCallback:"ActivitySuccess",data:{Token:d.Token,ActivityLogging:e},success:b.OnSuccess,error:b.OnError})}catch(f){b.Log(f)}};this.OnSuccess=function(h,e,g){try{if(h!=null){b.Log(h.Message);b.Log(h.ErrorCode)}if(e!=null){b.Log(e)}}catch(f){b.Log(f)}};this.OnError=function(g,e,h){try{if((h!=null)&&(e!=null)&&(g!=null)){b.Log("ErrorThrown "+h+", TextStatus "+e+", XMLHttpRequest "+g)}}catch(f){b.Log(f)}};this.GetPageId=function(g){try{for(var e=0;e<d.PageCollection.length;e++){if(d.PageCollection[e].WebRefCd==g){return d.PageCollection[e].Id.toString();break}}}catch(f){b.Log(f)}};this.GetVisitorId=function(){try{return b.ParseCookie(a,"visitorid","&","=")}catch(e){b.Log(e)}};this.GetVisitId=function(){try{return b.ParseCookie(a,"visitid","&","=")}catch(e){b.Log(e)}};this.GetSiteId=function(g){try{for(var e=0;e<d.SiteCollection.length;e++){if(d.SiteCollection[e].Type==g){return d.SiteCollection[e].Id.toString();break}}}catch(f){b.Log(f)}};this.GetSubSiteId=function(){try{return b.ParseCookie(c,"BetaNumber","@","|")}catch(e){b.Log(e)}};this.GetFrontDoorAffiliateId=function(){try{var e=jQuery.url.setUrl(window.location.href);if(e.param("frontdoor")!=null&&e.param("frontdoor").length>0){return e.param("frontdoor")}else{return b.ParseCookie(a,"lastfrontdoor","&","=")}}catch(f){b.Log(f)}};this.ReadCookie=function(h){try{var i=""+document.cookie;var g=i.indexOf(h);if(g==-1||h==""){return""}var f=i.indexOf(";",g);if(f==-1){f=i.length}return unescape(i.substring(g+h.length+1,f))}catch(e){b.Log(e)}};this.ParseCookie=function(l,f,k,h){try{if(l!=null){var e=l.split(k);f=f.toLowerCase();for(var g=0;g<e.length;g++){if(e[g].toLowerCase().search(f)>-1){return e[g].split(h)[1]}}}}catch(j){b.Log(j)}};jQuery.url=function(){var l={};var j={};var h={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var i=function(){str=decodeURI(h.url);var p=h.parser[h.strictMode?"strict":"loose"].exec(str);var n={};var o=14;while(o--){n[h.key[o]]=p[o]||""}n[h.q.name]={};n[h.key[12]].replace(h.q.parser,function(r,m,q){if(m){n[h.q.name][m]=q}});return n};var g=function(m){if(!j.length){f()}if(m=="base"){if(j.port!==null&&j.port!==""){return j.protocol+"://"+j.host+":"+j.port+"/"}else{return j.protocol+"://"+j.host+"/"}}return(j[m]==="")?null:j[m]};var e=function(m){if(!j.length){f()}return(j.queryKey[m]===null)?null:j.queryKey[m]};var f=function(){j=i();k()};var k=function(){var m=j.path;l=[];l=j.path.length==1?{}:(m.charAt(m.length-1)=="/"?m.substring(1,m.length-1):path=m.substring(1)).split("/")};return{setMode:function(m){strictMode=m=="strict"?true:false;return this},setUrl:function(m){h.url=m===undefined?window.location:m;f();return this},segment:function(m){if(!j.length){f()}if(m===undefined){return l.length}return(l[m]===""||l[m]===undefined)?null:l[m]},attr:g,param:e}}()}(function(a){a.fn.plusMinusSlider=function(d){var f={offClass:"pluslnk",onClass:"minuslnk",expandedElement:"the-cities",expanderElement:"the-cities-spacing",slideEffect:"jswing",plusHeightOffset:25,plusScrollPositionOffset:185,minusScrollPositionOffset:300,theDuration:4500,needsToScroll:true};var b=a.extend(f,d);var e=function(h){switch(h){case b.offClass:var g=a("#"+b.expanderElement).height()+b.plusHeightOffset;a("#"+b.expandedElement).animate({height:g},{duration:b.theDuration,easing:b.slideEffect});break;case b.onClass:a("#"+b.expandedElement).animate({height:"0"},{duration:b.theDuration,easing:b.slideEffect});break}};var c=function(g){var h=0;switch(g){case b.offClass:h=a(window).height()+a(window).scrollTop()-b.plusScrollPositionOffset;a("html,body").animate({scrollTop:h},{duration:b.theDuration,easing:b.slideEffect});break;case b.onClass:h=a(window).height()+a(window).scrollTop()-b.minusScrollPositionOffset;a("html,body").animate({scrollTop:h},{duration:b.theDuration,easing:b.slideEffect});break}};a(this).each(function(){var g=a(this);if(g.hasClass(b.offClass)){g.removeClass(b.offClass).addClass(b.onClass);e(b.offClass);if(b.needsToScroll){c(b.offClass)}}else{if(g.hasClass(b.onClass)){g.removeClass(b.onClass).addClass(b.offClass);e(b.onClass);if(b.needsToScroll){c(b.onClass)}}}})}})(jQuery);function OmnitureObj(b){var c=this;var d={affiliateName:"",beta:"",domainMetrics:"",enableActivityLogging:b};var a={pageName:"",numSearchResults:"",siteSection:"",subSection:"",subSection2:"",searchState:"",searchCity:"",searchQuery:"",searchMaxPrice:"",searchMinPrice:"",searchZipCode:"",searchSqFtMax:"",searchSqFtMin:"",searchRegion:"",searchAreaName:"",searchSubAreaName:"",housingType:"",numBedrooms:"",apartmentAmenities:"",searchType:"",communityAmenities:"",listingsPerPage:"",searchNeighborhood:"",events:"",Amenity:""};this.Log=function(h){try{var g=false;if(g){$.Console(h)}}catch(f){alert(ex)}};this.Init=function(e){$.extend(d,e)};this.PageView=function(e){c.Log("In Omniture Page View");c.Log(e);c.ResetPageVariables();$.extend(a,e);c.SubmitPageView()};this.PropertyUpdate=function(g){c.Log("In omniture property update");c.Log(g);var j;if(g.ApartmentAmenity!=null){j=g.ApartmentAmenity}else{if(g.Amenity!=null){j=g.Amenity}}if(j){j=j.replace(/, /g,":")}var h=g.CommunityAmenity;if(h){h=h.replace(/, /g,":")}var m={pageName:"results",numSearchResults:g.AdListCount,siteSection:"results",subSection:"results",subSection2:"results",searchState:g.CurrentState,searchCity:g.CurrentCity,searchQuery:g.Query,searchMaxPrice:g.MaxRent,searchMinPrice:g.MinRent,searchZipCode:g.CurrentZip,searchSqFtMax:g.MaxSQFT,searchSqFtMin:g.MinSQFT,searchRegion:"",searchAreaName:"",searchSubAreaName:"",housingType:g.HousingType,numBedrooms:g.Bed,apartmentAmenities:j,searchType:g.SearchType,communityAmenities:h,listingsPerPage:g.ResultsPerPage,searchNeighborhood:g.Neighborhood,events:"event2",Amenity:""};if((m.searchState=="")&&(m.searchCity=="")&&(m.searchZipCode=="")){var e=g.Query;if(isNaN(e)==false){m.searchZipCode=e}else{var l=e.replace(/[^,]/g,"").length;if(l==1){var k=e.split(",");m.searchCity=$.trim(k[0]);m.searchState=$.trim(k[1]);var f=$.trim(k[1]).replace(/[^ ]/g,"").length;if(f==1){var i=$.trim(k[1]).split(" ");m.searchState=$.trim(i[0]);if(isNaN(m.searchZipCode)==false){m.searchZipCode=$.trim(i[1])}}}}}c.Log(m);c.PageView(m)};this.SubmitGenericEventCustomLinkTracking=function(f,e){c.Log("Submit Generic Event Custom Link Tracking");if(d.enableActivityLogging==true){s_clven.events=f;s_clven.linkTrackVars="events";s_clven.linkTrackEvents=s_clven.events;s_clven.tl(true,"o",e)}};this.SubmitSearchCustomLinkTracking=function(f,e,g){c.Log("Submit Search Custom Link Tracking");if(d.enableActivityLogging==true){s_clven.prop29=e;s_clven.eVar25=e;s_clven.events="event8";s_clven.linkTrackVars="prop29,eVar25,events";s_clven.linkTrackEvents=s_clven.events;s_clven.tl(f,"o",g)}};this.SubmitEventSearchError=function(e){if(d.enableActivityLogging==true){s_clven.eVar47=e;s_clven.events="event27";s_clven.linkTrackVars="eVar47,events";s_clven.linkTrackEvents=s_clven.events;s_clven.tl(true,"o",e);c.Log("Submit Search Error Event -  evar47='"+e+"' and event27 was fired")}};this.SubmitEvent7CustomLinkTracking=function(e){c.Log("Submit Event7 Custom Link Tracking");if(d.enableActivityLogging==true){s_clven.eVar34=e;s_clven.events="event7";s_clven.linkTrackVars="eVar34,events";s_clven.linkTrackEvents=s_clven.events;s_clven.tl(true,"o",e)}};this.SubmitPaidLinkCustomLinkTrackingAppendId=function(f,g){c.Log("Submit Paid Link Custom Link Tracking Append Id");c.Log(f);c.Log(g);if(d.enableActivityLogging==true){var e="";if(f.id!=""){e=g+":"+f.id}else{e=g}c.SubmitPaidLinkCustomLinkTracking(f,e)}};this.SubmitDropDownTracking=function(f,g){c.Log("Submit Paid Link Custom Link Tracking Append Id");c.Log(f);c.Log(g);if(d.enableActivityLogging==true){var e="";var h=f.attr("id");$("#"+h+" option:selected").each(function(){e=g+h+":"+this.id});c.SubmitPaidLinkCustomLinkTracking(f,e)}};this.SubmitPaidLinkCustomLinkTracking=function(e,f){c.Log("Submit Paid Link Custom Link Tracking");c.Log(e);c.Log(f);c.Log("Activity Logging is enabled: "+d.enableActivityLogging);if(d.enableActivityLogging==true){s_clven.eVar34=f;s_clven.events="event17";s_clven.linkTrackVars="eVar34,events";s_clven.linkTrackEvents=s_clven.events;s_clven.tl(e,"o",f)}};this.SubmitPageView=function(){c.Log("Submit Page View");s_clven.pageName=a.pageName;s_clven.server="";s_clven.channel="";s_clven.pageType="";s_clven.prop1="";s_clven.prop2=a.numSearchResults;s_clven.prop3="";s_clven.prop4="";s_clven.prop5="";s_clven.prop6=a.siteSection;s_clven.prop7=a.subSection;s_clven.prop8=a.subSection2;s_clven.prop9="";s_clven.prop10="";s_clven.prop11="";s_clven.prop12="";s_clven.prop13="";s_clven.prop14=d.affiliateName;s_clven.prop15=d.affiliateName+":"+a.pageName;s_clven.prop16=a.searchState;s_clven.prop17=a.searchCity;s_clven.prop18=a.searchMaxPrice;s_clven.prop19=a.searchMinPrice;s_clven.prop20=a.searchZipCode;s_clven.prop21=a.searchSqFtMin+":"+a.searchSqFtMax;s_clven.prop22=d.domainMetrics;s_clven.prop23=a.searchRegion;s_clven.prop24=a.searchAreaName;s_clven.prop25=a.searchSubAreaName;s_clven.prop26=a.housingType;s_clven.prop27=a.numBedrooms;s_clven.prop28=(a.apartmentAmenities!=null)?a.apartmentAmenities:a.Amenity;s_clven.prop29=a.searchType;s_clven.prop30=a.communityAmenities;s_clven.prop31="";s_clven.prop32="";s_clven.prop33="";s_clven.prop34="";s_clven.prop35="";s_clven.prop36="";s_clven.prop37="";s_clven.prop38="";s_clven.prop39=a.searchQuery;s_clven.prop40=a.listingsPerPage;s_clven.prop41=a.searchNeighborhood;s_clven.prop42="";s_clven.prop43="";s_clven.prop44=d.beta;s_clven.prop45="";s_clven.prop46="";s_clven.prop47="";s_clven.prop48="";s_clven.prop49="";s_clven.prop50="";s_clven.hier1="";s_clven.hier2="";s_clven.hier3="";s_clven.hier4="";s_clven.hier5="";s_clven.campaign="";s_clven.state="";s_clven.zip="";s_clven.events=a.events;s_clven.products="";s_clven.purchaseID="";s_clven.eVar1="";s_clven.eVar2=a.pageName;s_clven.eVar3="";s_clven.eVar4="";s_clven.eVar5="";s_clven.eVar6=a.siteSection;s_clven.eVar7=a.subSection;s_clven.eVar8=a.subSection2;s_clven.eVar9="";s_clven.eVar10="";s_clven.eVar11="";s_clven.eVar12="";s_clven.eVar13="";s_clven.eVar14="";s_clven.eVar15="";s_clven.eVar16=d.affiliateName;s_clven.eVar17="";s_clven.eVar18=a.searchState;s_clven.eVar19=a.searchCity;s_clven.eVar20=a.searchMaxPrice;s_clven.eVar21=a.searchMinPrice;s_clven.eVar22=a.searchZipCode;s_clven.eVar23=a.housingType;s_clven.eVar24=a.numBedrooms;s_clven.eVar25=a.searchType;s_clven.eVar26="";s_clven.eVar27=d.domainMetrics;s_clven.eVar28="";s_clven.eVar29=a.searchRegion;s_clven.eVar30=a.searchAreaName;s_clven.eVar31=a.searchSubAreaName;s_clven.eVar32="";s_clven.eVar33=d.beta;s_clven.eVar34="";s_clven.eVar35="";s_clven.eVar36=a.searchSqFtMin+":"+a.searchSqFtMax;s_clven.eVar37="";s_clven.eVar38="";s_clven.eVar39=a.searchQuery;s_clven.eVar40=a.listingsPerPage;s_clven.eVar41=a.searchNeighborhood;s_clven.eVar42="";s_clven.eVar43="";s_clven.eVar44="";s_clven.eVar54="";s_clven.eVar46="";s_clven.eVar47="";s_clven.eVar48="";s_clven.eVar49="";s_clven.eVar50="";if(d.enableActivityLogging==true){void (s_clven.t())}};this.ResetPageVariables=function(){c.Log("Reset Page Variables");a.pageName="";a.numSearchResults="";a.siteSection="";a.subSection="";a.subSection2="";a.affiliatePageName="";a.searchState="";a.searchCity="";a.searchMaxPrice="";a.searchMinPrice="";a.searchZipCode="";a.searchQuery="";a.searchSqFtMax="";a.searchSqFtMin="";a.searchRegion="";a.searchAreaName="";a.searchSubAreaName="";a.housingType="";a.numBedrooms="";a.apartmentAmenities="";a.searchType="";a.communityAmenities="";a.listingsPerPage="";a.searchNeighborhood="";a.events=""};this.RetrieveApartmentAmenities=function(){c.Log("Retrieve Apartment Amenities")}}function CheckBoxGroup(){var a=this;this.currentTickBoxs=null;this.AnyCheckBox=null;this.anyTickBoxClass=null;this.anchorTag=null;this.hiddenInputName=null;this.radioButtonsContainer=null;this.whatRadioIsDefault=null;this.areWeRHP=null;this.Init=function(i,d,g,e,j,l,h,c,f,k,b){a.anyTickBoxClass=i;$(i).live("click",a.AnyCheckBoxClickedBeforeSave);$(d).live("click",a.CheckBoxClicked);$(j).live("click",function(){a.ClearSelectionsBeforeSave();return false});a.anchorTag=d;a.currentTickBoxs="input[name="+g+"]";a.hiddenInputName=g;a.AnyCheckBox="input[name="+e+"]";a.radioButtonsContainer=l;a.whatRadioIsDefault=h;a.displaySpan=c;a.type=f;a.PartnerClass=k;a.UnsavedChecks=new Array();a.areWeRHP=b};this.GetHiddenInputTagByTitle=function(b){return $('input[value="'+b+'"]')};this.GetHiddenDivByTitle=function(b){return $('div[title="'+b+'"]')};this.updateRadioButtons=function(c,b){c.each(function(){if($(this).attr("checked")&&$(this).val()=="Must Have"){if(a.GetHiddenInputTagByTitle(b.attr("title")).hasClass("nice-to-have")){a.GetHiddenInputTagByTitle(b.attr("title")).removeClass("nice-to-have")}a.GetHiddenInputTagByTitle(b.attr("title")).addClass("must-have")}else{if($(this).attr("checked")&&$(this).val()=="Nice To Have"){if(a.GetHiddenInputTagByTitle(b.attr("title")).hasClass("must-have")){a.GetHiddenInputTagByTitle(b.attr("title")).removeClass("must-have")}a.GetHiddenInputTagByTitle(b.attr("title")).addClass("nice-to-have")}}})};this.ClearSelectionsBeforeSave=function(){a.AnyCheckBoxClickedBeforeSave()};this.AnyCheckBoxClickedBeforeSave=function(){$(a.anchorTag+".checkbox-ticked").each(function(){a.UnsavedChecks.push($(this))});$(a.anchorTag+".checkbox-ticked").removeClass("checkbox-ticked").addClass("checkbox-unticked");a.UpdateAnyBeforeSave();if(a.radioButtonsContainer!=""){$("."+a.radioButtonsContainer).removeClass("show").addClass("hide");$("."+a.radioButtonsContainer).find('input[type="radio"]').each(function(){$(this).attr("checked",false)})}return false};this.UpdateHiddenValues=function(){if(a.type=="Beds"){if(a.SaveClick()==""){$("#"+a.displaySpan).text("Any")}else{var f=a.SaveClick();var c="";f=f.split(", ");for(var b in f){if(isNaN(parseInt(f[b]))){c+=f[b]+", "}else{if(parseInt(f[b])==4){if(a.areWeRHP==true){c+=parseInt(f[b])+", "}else{c+=parseInt(f[b])+"+, "}}else{if(parseInt(f[b])==6){c+=parseInt(f[b])+"+, "}else{c+=parseInt(f[b])+", "}}}}c=c.substring(0,c.length-2);$("#"+a.displaySpan).text(c).ellipsis()}$("#"+a.hiddenInputName).val($("#"+a.displaySpan).text())}else{if(a.type=="Baths"){if(a.SaveClick()==""){$("#"+a.displaySpan).text("Any")}else{var f=a.SaveClick();var c="";f=f.split(", ");for(var b in f){if(parseFloat(f[b])==1.5||parseFloat(f[b])==2.5){c+=parseFloat(f[b])+", "}else{if(parseInt(f[b])==1||parseInt(f[b])==2){c+=parseInt(f[b])+", "}else{if(parseInt(f[b])==3){c+=parseInt(f[b])+"+, "}}}}c=c.substring(0,c.length-2);$("#"+a.displaySpan).text(c).ellipsis()}$("#"+a.hiddenInputName).val($("#"+a.displaySpan).text())}else{if(a.type=="Housing"||a.type=="Property"){if(a.SaveClick()==""&&a.PartnerClass.SaveClick()==""){$("#housing-prop-type-box").text("Any")}else{var f="";if(a.SaveClick()==""){f=a.PartnerClass.SaveClick()}else{if(a.PartnerClass.SaveClick()==""){f=a.SaveClick()}else{f=a.SaveClick()+", "+a.PartnerClass.SaveClick()}}$("#housing-prop-type-box").text(f).ellipsis()}}else{if(a.type=="Amenity-Com"||a.type=="Amenity-Apt"){if(a.SaveClick()==""&&a.PartnerClass.SaveClick()==""){$("#amenities-box").text("Any")}else{var f="";if(a.SaveClick()==""){f=a.PartnerClass.SaveClick()}else{if(a.PartnerClass.SaveClick()==""){f=a.SaveClick()}else{f=a.SaveClick()+", "+a.PartnerClass.SaveClick()}}$("#amenities-box").text(f).ellipsis()}}else{if(a.type=="Neighborhoods"){try{if(a.SaveClick()==""){$("#housing-hoods-box").text("Any")}else{var f=a.SaveClick();$("#housing-hoods-box").html(f).text().ellipsis()}}catch(d){}}else{if(a.type=="Amenity-RHP"){try{if(a.SaveClick()==""){$("#amenities-box").text("Any")}else{var f=a.SaveClick();$("#amenities-box").html(f).text().ellipsis()}}catch(d){}}}}}}}};this.UpdateAnyBeforeSave=function(){if($(a.anchorTag+".checkbox-ticked").length>0){$(a.anyTickBoxClass).removeClass("checkbox-ticked").addClass("checkbox-unticked");if($(a.anchorTag+".checkbox-ticked:visible").length==0){$(a.anyTickBoxClass).removeClass("checkbox-unticked").addClass("checkbox-ticked")}}else{$(a.anyTickBoxClass).removeClass("checkbox-unticked").addClass("checkbox-ticked")}a.SaveChanges();a.UpdateHiddenValues()};this.SaveChanges=function(){$(a.anchorTag+":visible").each(function(){var b=$(this);if($(this).hasClass("checkbox-ticked")){a.GetHiddenInputTagByTitle($(this).attr("title")).addClass("checked");if(a.radioButtonsContainer!=""){var c=a.GetHiddenDivByTitle($(this).attr("title"));var d=c.find('input[type="radio"]:visible');a.updateRadioButtons(d,b)}}else{if($(this).hasClass("checkbox-unticked")){a.GetHiddenInputTagByTitle($(this).attr("title")).removeClass("checked")}}})};this.CheckBoxClicked=function(){if($(this).hasClass("checkbox-ticked")){$(this).removeClass("checkbox-ticked").addClass("checkbox-unticked");if(a.radioButtonsContainer!=""){var b=a.GetHiddenDivByTitle($(this).attr("title"));b.removeClass("show").addClass("hide");var c=b.find('input[type="radio"]');c.each(function(){if($(this).val()==a.whatRadioIsDefault){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}}else{$(this).removeClass("checkbox-unticked").addClass("checkbox-ticked");if(a.radioButtonsContainer!=""){var b=a.GetHiddenDivByTitle($(this).attr("title"));b.removeClass("hide").addClass("show");var c=b.find('input[type="radio"]');c.each(function(){if($(this).val()==a.whatRadioIsDefault){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}}a.UpdateAnyBeforeSave();a.UnsavedChecks.push($(this));return false};this.Cancel=function(){$.each(a.UnsavedChecks,function(){if($(this).hasClass("checkbox-ticked")){$(this).removeClass("checkbox-ticked").addClass("checkbox-unticked");if(a.radioButtonsContainer!=""){var b=a.GetHiddenDivByTitle($(this).attr("title"));b.removeClass("show").addClass("hide");var c=b.find('input[type="radio"]');c.each(function(){if($(this).val()==a.whatRadioIsDefault){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}}else{$(this).removeClass("checkbox-unticked").addClass("checkbox-ticked");if(a.radioButtonsContainer!=""){var b=a.GetHiddenDivByTitle($(this).attr("title"));b.removeClass("hide").addClass("show");var c=b.find('input[type="radio"]');c.each(function(){if($(this).val()==a.whatRadioIsDefault){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}}a.UpdateAnyBeforeSave();a.UnsavedChecks=new Array()})};this.reloadCheckboxes=function(){a.UpdateAny();if(a.radioButtonsContainer!=""){if($(a.currentTickBoxs+".checked").length>0){$("."+a.radioButtonsContainer).removeClass("show").addClass("hide");$("."+a.radioButtonsContainer).find('input[type="radio"]').each(function(){$(this).attr("checked",false)});$(a.currentTickBoxs).each(function(){if($('a[title="'+$(this).val()+'"]').hasClass("checkbox-ticked")){if($(this).hasClass("must-have")){a.GetHiddenDivByTitle($(this).val()).removeClass("hide").addClass("show");var b=a.GetHiddenDivByTitle($(this).val()).find('input[type="radio"]:visible');a.GetHiddenDivByTitle($(this).val()).find('input[type="radio"]:visible').each(function(){if($(this).val()=="Must Have"){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}else{if($(this).hasClass("nice-to-have")){a.GetHiddenDivByTitle($(this).val()).removeClass("hide").addClass("show");a.GetHiddenDivByTitle($(this).val()).find('input[type="radio"]:visible').each(function(){if($(this).val()=="Nice To Have"){$(this).attr("checked",true)}else{$(this).attr("checked",false)}})}}}})}else{$("."+a.radioButtonsContainer).removeClass("show").addClass("hide");$("."+a.radioButtonsContainer).find('input[type="radio"]').each(function(){$(this).attr("checked",true)})}}};this.UpdateAny=function(){var b="";var d=null;var c=null;if($(a.currentTickBoxs+".checked").length>0){$(a.anyTickBoxClass).removeClass("checkbox-ticked").addClass("checkbox-unticked");$(a.AnyCheckBox).removeClass("anyChecked");$(a.anchorTag).removeClass("checkbox-ticked").addClass("checkbox-unticked");$(a.currentTickBoxs+".checked").each(function(){b=$(this).attr("value");d=$('a[title="'+b+'"]');d.each(function(){if($(this).hasClass(a.hiddenInputName)){$(this).addClass("checkbox-ticked").removeClass("checkbox-unticked")}})})}else{$(a.anyTickBoxClass).removeClass("checkbox-unticked").addClass("checkbox-ticked");$(a.AnyCheckBox).addClass("anyChecked");$(a.currentTickBoxs).each(function(){b=$(this).attr("value");d=$('a[title="'+b+'"]');d.each(function(){if($(this).hasClass(a.hiddenInputName)){$(this).addClass("checkbox-unticked").removeClass("checkbox-ticked")}})})}};this.ClearSelections=function(){var b="";var c=null;$(a.currentTickBoxs+".checked").each(function(){b=$(this).attr("value");c=$('a[title="'+b+'"]');c.removeClass("checkbox-ticked").addClass("checkbox-unticked");$(this).removeClass("checked")});a.UpdateAny();return false};this.SaveClick=function(){var d="";var b="";var c=null;$(a.currentTickBoxs+".checked").each(function(){b=$(this).attr("value");c=$('a[title="'+b+'"]');d=d+c.html()+", "});if(d==""){return d}else{return d.substring(0,d.length-2)}};this.CheckBoxCount=function(){return $(a.currentTickBoxs+".checked").length};this.GetIds=function(){var b="";$(a.currentTickBoxs+".checked.nice-to-have").each(function(){b=b+$(this).attr("id")+"-NTH, "});$(a.currentTickBoxs+".checked").each(function(){if(!$(this).hasClass("nice-to-have")){b=b+$(this).attr("id")+", "}});if(b==""){return b}else{return b.substring(0,b.length-2)}}}function SearchSubmitButton(g){var c={BaseURL:null,Controller:null,Action:null,SearchType:null,Query:null,CurrentCity:null,CurrentState:null,CurrentZip:null,MinRent:null,MaxRent:null,MinSQFT:null,MaxSQFT:null,Bed:null,Bath:null,Neighborhood:null,PropertyType:null,HousingType:null,Amenity:null,ApartmentAmenity:null,CommunityAmenity:null,ResultsPerPage:null,SearchCriteria:null,FrontDoor:null,UrlCarryThroughs:null};$.extend(c,g);var e="";if(c.BaseURL!=null){e+=c.BaseURL+"/"}if(c.Controller!=null){e+=c.Controller+"/"}if(c.Query!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="query="+c.Query}if(c.MinSQFT!=null&&c.MinSQFT!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="MinSQFT="+c.MinSQFT}if(c.MaxSQFT!=null&&c.MaxSQFT!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="MaxSQFT="+c.MaxSQFT}if(c.MinRent!=null&&c.MinRent!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="rentmin="+c.MinRent}if(c.MaxRent!=null&&c.MaxRent!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="rentmax="+c.MaxRent}if(c.Bed!=null&&c.Bed!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="bedchkvalue="+c.Bed}if(c.Bath!=null&&c.Bath!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="bathchkvalue="+c.Bath}if(c.Neighborhood!=null&&c.Neighborhood!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="Neighborhoods="+c.Neighborhood.toString()}if(c.PropertyType!=null&&c.PropertyType!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="PropertyType="+c.PropertyType.toString()}if(c.HousingType!=null&&c.HousingType!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="HousingType="+c.HousingType.toString()}if(c.Amenity!=null&&c.Amenity!="Any"){e+=(e.indexOf("?")>-1)?"&":"?";e+="Amenity="+c.Amenity.toString()}if(c.ResultsPerPage&&c.Amenity!="10"){e+=(e.indexOf("?")>-1)?"&":"?";e+="numListings="+c.ResultsPerPage.toString()}if(c.StateList!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="statelist="+c.StateList}if(c.PropertyName!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="propertyname="+c.PropertyName}if(c.PropertyCityStateZip!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="propertycitystatezip="+c.PropertyCityStateZip}if(c.WebId!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="webid="+c.WebId}if(c.SearchCriteria!=null&&c.SearchCriteria!=""){e+=(e.indexOf("?")>-1)?"&":"?";e+="searchCriteria="+c.SearchCriteria}if(c.FrontDoor!=null&&c.FrontDoor!=""){e+=(e.indexOf("?")>-1)?"&":"?";e+="FrontDoor="+c.FrontDoor}if(c.UrlCarryThroughs!=null&&c.UrlCarryThroughs!=""){var d=c.UrlCarryThroughs,a=/stype=/gi,b="";d=d.replace("&","").split("&");for(var f in d){if(d[f].match(a)!="stype="){b+="&"+d[f]}}e+=b}if(c.SearchType!=null){e+=(e.indexOf("?")>-1)?"&":"?";e+="stype="+c.SearchType}window.location=e;return false}function AutoCompleteSetup(b,a,c){return{source:function(d,e){$.ajax({url:b,dataType:"jsonp",jsonpCallback:a,data:{method:c,q:d.term,callback:a},success:function(h){var g;var f=new Array();for(g in h.Data){if(g<7){f[g]=jQuery.trim(h.Data[g])}if(g==7){break}++g}e($.map(f,function(i){return{label:i,value:i}}))}})},delay:5,minLength:3,select:function(e,d){},open:function(){$(this).removeClass("ui-corner-all").addClass("ui-corner-top")},close:function(){$(this).removeClass("ui-corner-top").addClass("ui-corner-all")}}}(function(a){a.fn.TextInputs=function(c){var d={textInitialValue:"change this",textInitialValue2:"change this2",noInputClass:"query-no-input",withInputClass:"query-with-input"};var b=a.extend(d,c);a(this).each(function(){a(this).focus(function(){if(a(this).attr("value")==b.textInitialValue||a(this).attr("value")==b.textInitialValue2){a(this).attr("value","").removeClass(b.noInputClass).addClass(b.withInputClass)}}).blur(function(){if(a(this).attr("value")==""){a(this).attr("value",b.textInitialValue).removeClass(b.withInputClass).addClass(b.noInputClass)}});if(a(this).attr("value")==""||a(this).attr("value")==b.textInitialValue||a(this).attr("value")==b.textInitialValue2){a(this).attr("value",b.textInitialValue).removeClass(b.withInputClass).addClass(b.noInputClass)}else{a(this).removeClass(b.noInputClass).addClass(b.withInputClass)}});return a(this)}})(jQuery);(function(a){a.fn.SelectInputs=function(c){var d={notSelected:"",isSelected:""};var b=a.extend(d,c);a(this).each(function(){a(this).change(function(){if(a(this).attr("value")==""){a(this).removeClass(b.isSelected).addClass(b.notSelected)}else{a(this).removeClass(b.notSelected).addClass(b.isSelected)}})}).change()}})(jQuery);(function(a){a.fn.clearForm=function(){return this.each(function(){var b=this.type,c=this.tagName.toLowerCase();if(c=="form"){return a(":input",this).clearForm()}if(b=="text"||b=="password"||c=="textarea"){this.value=""}else{if(b=="checkbox"||b=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=0}}}})}})(jQuery);(function(a){a.fn.ellipsis=function(c){var b=document.documentElement.style;if(!("textOverflow" in b||"OTextOverflow" in b)){return this.each(function(){var d=a(this);if(d.css("overflow")=="hidden"){var i=d.html();var g=d.width();var h=a(this.cloneNode(true)).hide().css({position:"absolute",width:"auto",overflow:"visible","max-width":"inherit"});d.after(h);var f=i;while(f.length>0&&h.width()>d.width()){f=f.substr(0,f.length-1);h.html(f+"...")}d.html(h.html());h.remove();if(c==true){var e=d.width();setInterval(function(){if(d.width()!=e){e=d.width();d.html(i);d.ellipsis()}},200)}}})}else{return this}}})(jQuery);function SmallMapClass(k,h){var l=this;var f=null;var m=".";var d=null;var g=null;var i=null;var b=k;var c=true;var j=null;var e=null;var a=null;l.overlayDiv=null;l.intervalID=0;l.initialLoad=true;this.Log=function(p){try{var o=false;if(o){$.Console(p)}}catch(n){alert(ex)}};this.Init=function(t,q,s,u,n,r,v,o){l.initialLoad=true;l.VEmap=new VEMap(t);l.VEmap.SetDashboardSize(VEDashboardSize.Small);l.mapToken=h;l.VEmap.SetCredentials(l.mapToken);l.currentSite=k;l.hasProperty=false;l.geoIsClicked=false;l.shapesAdjusted=false;l.propertyDiv="."+q;l.VEmap.LoadMap();l.Layer=new VEShapeLayer();l.VEmap.AddShapeLayer(l.Layer);l.PropertyUpdate(true);l.VEmap.AttachEvent("onmouseover",l.HoverOverGEO);l.VEmap.AttachEvent("onmouseout",l.HoverOutGEO);l.VEmap.AttachEvent("onclick",l.ClickOnGEO);l.VEmap.AttachEvent("onendpan",l.PanDone);l.VEmap.AttachEvent("onendzoom",l.ZoomDone);i=r;g=new ActivityLogging();var p={URL:s,Type:"POST",DataType:"jsonp",Token:v,PageCollection:u,SiteCollection:n};setTimeout(function(){g.Init(p)},750);l.VEmap.AttachEvent("onmouseover",l.HoverOverGEO);l.VEmap.AttachEvent("onmouseout",l.HoverOutGEO);l.VEmap.AttachEvent("onclick",l.ClickOnGEO);l.VEmap.AttachEvent("onendpan",l.PanDone);l.VEmap.AttachEvent("onendzoom",l.ZoomDone);l.omnitureActivityLogging=o};this.PropertyUpdate=function(n){if(n){setTimeout(function(){l.doTheUpdate()},500)}else{l.doTheUpdate()}};this.doTheUpdate=function(){l.Layer.DeleteAllShapes();l.hasProperty=false;l.addPinpointDropshadows();l.addPinPoints();if(!l.shapesAdjusted){var n=l.Layer.GetBoundingRectangle();l.VEmap.SetMapView(n)}if(l.hasProperty==false){$(".small-map").block({message:'<img src="'+akamiImageServer+'/ACW/Shared/Images/map-no-results.png" class="floatLeft" alt="Map Information Unavailable" />',css:{margin:"0 auto",cursor:"auto",top:"15px",background:"none",width:"205px",height:"75px",padding:"0"},overlayCSS:{cursor:"auto"}})}else{$(".small-map").unblock()}};this.addPinpointDropshadows=function(){if(!($.browser.msie&&($.browser.version=="6.0"||$.browser.version=="7.0"))){$(l.propertyDiv).each(function(r){var o=$(this);if((o.attr("lat")!=0)&&(o.attr("long")!=0)){if(l.shapesAdjusted){var n=l.VEmap.LatLongToPixel(new VELatLong(o.attr("lat"),o.attr("long")));n.y=n.y-25;var s=l.VEmap.PixelToLatLong(n)}else{var n=l.VEmap.LatLongToPixel(new VELatLong(o.attr("lat"),o.attr("long")));var s=l.VEmap.PixelToLatLong(n)}var p='<div class="dropshadow1" style="cursor:default;"><img src="'+akamiImageServer+'/ACW/Shared/Images/icon-shadow.png" /></div>';var q=new VEShape(VEShapeType.Pushpin,s);q.SetCustomIcon(p);q.Hover=false;l.VEmap.ClearInfoBoxStyles();l.Layer.AddShape(q)}})}};this.addPinPoints=function(){$(l.propertyDiv+'[type="best-match"],'+l.propertyDiv+'[type="close-match"]').each(function(o){var n=$(this);l.SetListingData(n)});$(l.propertyDiv+'[type = "fcl"]').each(function(o){var n=$(this);l.SetListingData(n)})};this.createPinShape=function(o){if(l.shapesAdjusted){var p=l.VEmap.LatLongToPixel(new VELatLong(o.attr("lat"),o.attr("long")));p.y=p.y-25;var n=l.VEmap.PixelToLatLong(p);return new VEShape(VEShapeType.Pushpin,n)}else{return new VEShape(VEShapeType.Pushpin,new VELatLong(o.attr("lat"),o.attr("long")))}};this.SetListingData=function(A){var t=null,B=null,r=null,p=null,v=null,s=null,D=null,u=null,C=null,o=null,z=null,y={};var n=l.createPinShape(A);if((A.attr("type"))=="best-match"){t=true}else{t=false}B=$(".property-name",A).html();r=B.substring(0,40);if(B.length>40){r=r+"..."}p=B.substring(0,24);if(B.length>24){p=p+"..."}v=$(".property-neighborhood",A).html();if(v){s=v.substring(0,24);if(v.length>24){s=s+"..."}}D=$(".property-city",A).html()+", "+$(".property-state",A).html()+" "+$(".property-zip",A).html();u=D.substring(0,24);if(D.length>24){u=u+"..."}if(A.attr("type")=="fcl"){C="FEATURED"}if(A.attr("type")=="best-match"){C="BEST MATCH"}if(A.attr("type")=="close-match"){C="CLOSE MATCH"}o=A.attr("lat");z=A.attr("long");if(((o!=0&&o!=null)&&(z!=0&&z!=null))&&r!=null){var w;try{if($(".property-url",A).attr("href")!=null){w=$(".property-url",A).attr("href").replace("prvpg=7","prvpg=121")}else{w=""}}catch(q){l.Log("Propery Url Error: "+q)}y={propertyID:A.attr("propertyID"),propertyNum:A.attr("listingNum"),propertyType:C,propertyURL:w,isBestMatch:t,matchClass:l.currentSite+"-"+A.attr("type"),latitude:A.attr("lat"),longitude:A.attr("long"),listingClass:"listing"+A.attr("listingNum"),iconClass:l.currentSite+"-"+A.attr("type")+"-icon",name:r,fullName:B,clickName:p,neighborhood:s,fullNeighborhood:v,city:$(".property-city",A).html(),state:$(".property-state",A).html(),zip:$(".property-zip",A).html(),cityStateZip:u,fullCityStateZip:D,bedrooms:$(".property-bedrooms",A).html(),bathrooms:$(".property-bathrooms",A).html(),minRent:$(".property-min-rent",A).html(),maxRent:$(".property-max-rent",A).html(),imageURL:$(".imageURL",A).attr("src"),ProductId:A.attr("productid")};l.ChangeIcon(n,y);n.listingData=y;l.Layer.AddShape(n);l.hasProperty=true}};this.HoverOverGEO=function(n){if(l.intervalID==0){l.intervalID=setTimeout(function(o){l.doHover(n)},200)}else{clearTimeout(l.intervalID);l.intervalID=0}};this.doHover=function(p){if(p){if(p.elementID!=null){hoveredShape=l.VEmap.GetShapeByID(p.elementID);if(hoveredShape&&hoveredShape.Hover!=false){try{var n=new VELatLong(hoveredShape.listingData.latitude,hoveredShape.listingData.longitude);var o=l.VEmap.LatLongToPixel(n);if(l.geoIsClicked==false){l.ShowOverlay(o,hoveredShape)}$("#"+hoveredShape.listingData.listingClass).removeClass(hoveredShape.listingData.iconClass).addClass(l.currentSite+"-active-icon")}catch(q){l.Log(q);l.Log("error on hover stuff")}l.hoverActivityLogging(hoveredShape)}}}};this.hoverActivityLogging=function(q){try{if(c){c=false;var s=b.toString().substring(0,1);var p=q.listingData.propertyID;var u=0;var n=q.listingData.ProductId;var r=q.listingData.propertyNum;var o=q.listingData.isBestMatch;g.LogImpression("searchresultsmap",s.toUpperCase(),i,p,u,n,0,1,r,o)}}catch(t){}};this.HoverOutGEO=function(n){if(l.intervalID!=0){clearInterval(l.intervalID);l.intervalID=0;l.doHoverOut(n)}};this.doHoverOut=function(n){if(n){if(n.elementID!=null){try{hoveredShape=l.VEmap.GetShapeByID(n.elementID);if(hoveredShape&&hoveredShape.Hover!=false){c=true;l.CloseHoveredOverlay();$("#"+hoveredShape.listingData.listingClass).removeClass(l.currentSite+"-active-icon").addClass(hoveredShape.listingData.iconClass)}}catch(o){l.Log("Hover out GEO error");l.Log(o)}}}};this.ClickOnGEO=function(n){if(n.elementID){try{var r=l.VEmap.GetShapeByID(n.elementID);if(r&&r.Hover!=false){l.CloseAllOverlay();var t=new VELatLong(r.listingData.latitude,r.listingData.longitude);var v=l.VEmap.LatLongToPixel(t);l.ShowOverlay(v,r,true);l.geoIsClicked=true;var q=b.toString().substring(0,1);var p=r.listingData.propertyID;var u=0;var o=r.listingData.ProductId;g.LogClickThru("searchresultsmap","searchresultsmappopup",q.toUpperCase(),i,p,u,o)}}catch(s){l.Log("Bing error on map click: "+s)}}};this.ZoomDone=function(n){l.CloseAllOverlay();l.shapesAdjusted=true;var o=new OmnitureObj(l.omnitureActivityLogging);if(!l.initialLoad){o.SubmitGenericEventCustomLinkTracking("event23","map-interaction")}l.PropertyUpdate(false);if(l.initialLoad){l.initialLoad=false}};this.PanDone=function(n){l.CloseAllOverlay();var o=new OmnitureObj(l.omnitureActivityLogging);o.SubmitGenericEventCustomLinkTracking("event23","map-interaction")};this.ShowOverlay=function(r,q,n){var t=0;var u=0;var o=null,p=null,v=null,y=null,s=null,w=null;if(n){o="arrow-top-big-overlay";u=r.x-242;if(l.shapesAdjusted){t=r.y-160}else{t=r.y-135}w=l.ConvertTemplate("overlay_Template",q.listingData);p="clicked-overlay";v="<div class='overlay-close-button'></div>"}else{o="arrow-top-overlay-container";y=$("<h1 style='position:absolute;visibility:hidden;display:block;' class='overlay'>"+q.listingData.name+"</h1>");$("#mapContainer").prepend(y);y=$(y).width();if(y<95){s=113}else{s=y+23}u=r.x-s;if(l.shapesAdjusted){t=r.y-88}else{t=r.y-63}w=l.ConvertTemplate("small_overlay_Template",q.listingData);p="hovered-overlay";v="";$("h1.overlay").remove()}l.doActivityLoggingForOverlay(q);l.overlayDiv=$("<div propertyID='"+q.listingData.propertyID+"' id='"+p+"' style='top: "+t+"px; left: "+u+"px;' class='"+o+"'>"+v+" "+w+"</div>");$("#mapContainer").prepend(l.overlayDiv);$(".overlay-close-button").click(function(){l.CloseAllOverlay()});$("#"+p).click(function(){window.location=q.listingData.propertyURL;return false})};this.doActivityLoggingForOverlay=function(q){try{if(c){c=false;var s=b.toString().substring(0,1);var p=q.listingData.propertyID;var u=0;var n=q.listingData.ProductId;var r=q.listingData.propertyNum;var o=q.listingData.isBestMatch;g.LogImpression("searchresultsmappopup",s.toUpperCase(),i,p,u,n,0,1,r,o)}}catch(t){}};this.CloseAllOverlay=function(n){l.CloseHoveredOverlay();l.CloseClickedOverlay();l.geoIsClicked=false};this.CloseHoveredOverlay=function(n){if($("#hovered-overlay").length>0){$("#hovered-overlay").remove()}};this.CloseClickedOverlay=function(n){if($("#clicked-overlay").length>0){$("#clicked-overlay").remove();l.geoIsClicked=false}};this.ChangeIcon=function(r,q){var o=null;if(q.propertyNum.length>2){o="shrinkText"}else{o=""}var p={listingNumData:q.propertyNum,shrinkTextClass:o,iconClassData:q.iconClass,propertyID:q.propertyID};var n=l.ConvertTemplate("icon_Template",p);r.SetCustomIcon(n);l.VEmap.ClearInfoBoxStyles()};this.ConvertTemplate=function(p,q){var n={};var o=!/\W/.test(p)?n[p]=n[p]||l.ConvertTemplate(document.getElementById(p).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+p.replace(/[\r\t\n]/g," ").split("<#").join("\t").replace(/((^|#>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)#>/g,"',$1,'").split("\t").join("');").split("#>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return q?o(q):o}}function SearchResult(){var a=this;a.AdList=null;a.currentSearchCriteriaHash=null;a.OnAjaxLoad=null;a.Settings=null;a.MessageURL=null;a.LoaderURL=null;a.ShouldIUpdateRefineRadios=true;this.Log=function(d){try{var c=false;if(c){$.Console(d)}}catch(b){alert(ex)}};this.Init=function(e,c,b,d){a.currentSearchCriteriaHash=e;a.OnAjaxLoad=c;a.MessageURL=b;a.LoaderURL=d};this.GetName=function(){return a.currentSearchCriteriaHash};this.NewSearch=function(b){$(".rContain").block({message:'<img src="'+a.MessageURL+'" class="floatLeft" alt="LOADING" title="LOADING" /><img src="'+a.LoaderURL+'" class="floatRight" alt="LOADING" title="LOADING" />',centerY:false,overlayCSS:{backgroundColor:"#ffffff"}});a.Settings={SearchType:null,Query:null,CurrentCity:null,CurrentState:null,CurrentZip:null,MinRent:null,MaxRent:null,MinSQFT:null,MaxSQFT:null,Bed:null,Bath:null,Neighborhood:null,PropertyType:null,HousingType:null,Amenity:null,ApartmentAmenity:null,CommunityAmenity:null,FrontDoor:null,UrlCarryThroughs:null};$.extend(a.Settings,b);a.ShouldIUpdateRefineRadios=true;$.ajax({type:"post",url:"/Search/AjaxSearch/",data:a.createQueryString(a.Settings),dataType:"xml",success:a.SearchReturn,error:a.SearchReturnError});return false};this.createQueryString=function(c){var b="";if(c.Query!=null){b+="query="+c.Query}if(c.MinRent!=null&&c.MinRent!="Any"){b+="&rentmin="+c.MinRent}if(c.MaxRent!=null&&c.MaxRent!="Any"){b+="&rentmax="+c.MaxRent}if(c.MinSQFT!=null&&c.MinSQFT!="Any"){b+="&MinSQFT="+c.MinSQFT}if(c.MaxSQFT!=null&&c.MaxSQFT!="Any"){b+="&MaxSQFT="+c.MaxSQFT}if(c.Bed!=null&&c.Bed!="Any"){b+="&bedchkvalue="+c.Bed.toString().ReplaceAll("Bedrooms","").ReplaceAll("Bedroom","")}if(c.Bath!=null&&c.Bath!="Any"){b+="&bathchkvalue="+c.Bath.toString().ReplaceAll("Bathrooms","").ReplaceAll("Bathroom","")}if(c.Neighborhood!=null&&c.Neighborhood!="Any"){var d=c.Neighborhood.toString().split(",",1);if(d!="null"){b+="&Neighborhoods="+c.Neighborhood.toString()}}if(c.PropertyType!=null&&c.PropertyType!="Any"){b+="&PropertyType="+c.PropertyType.toString()}if(c.HousingType!=null&&c.HousingType!="Any"){b+="&HousingType="+c.HousingType.toString()}if(c.Amenity!=null&&c.Amenity!="Any"){b+="&Amenity="+c.Amenity.toString()}if(c.ResultsPerPage&&c.Amenity!="10"){b+="&numListings="+c.ResultsPerPage.toString()}if(c.UrlCarryThroughs!=null&&c.UrlCarryThroughs!=""){b+=a.removeCarryThroughQueryString("stype=",c);b+=a.removeCarryThroughQueryString("frontdoor=",c)}if(c.FrontDoor!=null&&c.FrontDoor!=""){b+="&FrontDoor="+c.FrontDoor}if(c.SearchType!=null){b+="&stype="+c.SearchType}a.Log("The Query String: "+b);return b};this.removeCarryThroughQueryString=function(d,g){var e=g.UrlCarryThroughs,b=new RegExp(d,"gi"),c="";e=e.replace("&","").split("&");for(var f in e){if(e[f].toLowerCase().match(b)!=d.toLowerCase()){c+="&"+e[f]}}return c};this.SortChange=function(b,c){a.GetResultSetWithHash("sortType="+b,c)};this.ManagmentCompanySearch=function(b,c){a.GetResultSetWithHash("ManagmentCompanyId="+b+"&stype=mgmtcompanyproperties",c)};this.NewSearchWithHash=function(c,d){var b="searchCriteria="+c.toString()+"&pagen="+d;$(".rContain").block({message:'<img src="'+a.MessageURL+'" class="floatLeft" alt="LOADING" title="LOADING" /><img src="'+a.LoaderURL+'" class="floatRight" alt="LOADING" title="LOADING" />',centerY:false,overlayCSS:{backgroundColor:"#ffffff"}});$("body").scrollTop(0);a.ShouldIUpdateRefineRadios=true;$.ajax({type:"get",url:"/Search/AjaxSearch/",data:b,dataType:"xml",success:a.SearchReturn,error:a.SearchReturnError})};this.PageChange=function(b,c){a.GetResultSetWithHash("pagen="+b,c)};this.NumberOfListingsChange=function(b,c){a.GetResultSetWithHash("numListings="+b,c)};this.AdTypeFilterChange=function(b,c){a.GetResultSetWithHash("adtypefilter="+b,c)};this.GetResultSetWithHash=function(c,d){a.Settings={SearchType:null,Query:null,CurrentCity:null,CurrentState:null,CurrentZip:null,MinRent:null,MaxRent:null,MinSQFT:null,MaxSQFT:null,Bed:null,Bath:null,Neighborhood:null,PropertyType:null,HousingType:null,Amenity:null,ApartmentAmenity:null,CommunityAmenity:null,FrontDoor:null,UrlCarryThroughs:null};$.extend(a.Settings,d);var b="searchCriteria="+a.currentSearchCriteriaHash.toString()+"&"+c+a.getHashURL(a.Settings);$(".rContain").block({message:'<img src="'+a.MessageURL+'" class="floatLeft" alt="LOADING" title="LOADING" /><img src="'+a.LoaderURL+'" class="floatRight" alt="LOADING" title="LOADING" />',centerY:false,overlayCSS:{backgroundColor:"#ffffff"}});$("body").scrollTop(0);a.ShouldIUpdateRefineRadios=true;$.ajax({type:"get",url:"/Search/AjaxSearch/",data:b,dataType:"xml",success:a.SearchReturn,error:a.SearchReturnError})};this.getHashURL=function(c){var b="";if(c.UrlCarryThroughs!=null&&c.UrlCarryThroughs!=""){b+=a.removeCarryThroughQueryString("stype=",c);b+=a.removeCarryThroughQueryString("frontdoor=",c)}if(c.FrontDoor!=null&&c.FrontDoor!=""){b+="&FrontDoor="+c.FrontDoor}return b};this.SearchReturn=function(c){try{$(".rContain").html($(c).find("html").text());jsonData=jQuery.parseJSON($(c).find("json").text());$(".box518").html($(c).find("NRefineList").text());a.UpdateNeighborHood($(c).find("NRefineListCheckbox").text());$("#RefineHiddenFields").html($(c).find("RefineHiddenFields").text());a.UpdateHelpers(jsonData);a.OnAjaxLoad(a.Settings)}catch(b){a.Log("ERROR");a.Log(b);$.ajax({type:"get",url:"/Error/JavascriptError/",data:"&javaErrorMessage="+b})}};this.UpdateNeighborHood=function(b){try{b=jQuery.trim(b);if(b.length>0){$(".HasNeighborhoods").show();$(".NoNeighborhoods").hide();$(".nhood").html(b)}else{$(".NoNeighborhoods").show();$(".HasNeighborhoods").hide()}}catch(c){a.Log("ERROR");a.Log(c);$.ajax({type:"get",url:"/Error/JavascriptError/",data:"&javaErrorMessage="+c})}};this.updateResultsTitleAndRadios=function(b){$("#CurrentCity").html(b.CurrentCity);$("#CurrentState").html(b.CurrentState);$("#CurrentZip").html(b.CurrentZip);$(".misspellGeo").html(b.Spelling);if(!b.GeographySearched){$(".displayListingInfo").html("")}else{$(".displayListingInfo").html("<div class='num-listings'><span class='listingNumbers'>"+b.TotalListings+"</span>&nbsp;</div> "+b.DisplayListingInfo+" <span class='listingGeo'>"+b.GeographySearched+"</span>")}if(b.Spelling==""){$(".did-you-mean").hide()}else{$(".did-you-mean").show();$(".did-you-mean").removeClass("hidden")}if(a.ShouldIUpdateRefineRadios==true){if(b.PropertyGroup.Managed==0){$("#Managed").attr("disabled","disabled")}else{$("#Managed").removeAttr("disabled")}$(".ManagedNumbers").html(b.PropertyGroup.Managed);if(b.PropertyGroup.ByOwner==0){$("#ByOwner").attr("disabled","disabled")}else{$("#ByOwner").removeAttr("disabled")}$(".ByOwnerNumbers").html(b.PropertyGroup.ByOwner);if(b.PropertyGroup.Newspaper==0){$("#Newspaper").attr("disabled","disabled")}else{$("#Newspaper").removeAttr("disabled")}$(".NewspaperNumbers").html(b.PropertyGroup.Newspaper);a.ShouldIUpdateRefineRadios=false}};this.fixPageView=function(d,b){var c=$("."+b);if($(".page-name").attr("id")=="rhp-results"){if(d>0){$(".HideOnNoData, .zoom-area, .view-switcher").show();$(".noSearch").removeClass("paddingTop20")}else{$(".HideOnNoData, .zoom-area, .view-switcher").hide();$(".noSearch").addClass("paddingTop20")}}else{if(d>0){$(".HideOnNoData, .zoom-area, .view-switcher").show();if($('div[type="fcl"]').length>0){c.addClass("paddingTop27")}}else{$(".HideOnNoData, .zoom-area, .view-switcher").hide();c.removeClass("paddingTop27")}}};this.setAdSorters=function(c){var b=c.SortBy;if(b!=""&&b.search(/scopedefault/i)==-1){$(".results-sort-by").val(b)}if(c.PropertyVideoCount<=0){$(".results-sort-by option[value='VideoWalkthrough']").remove()}else{if($(".results-sort-by option[value='VideoWalkthrough']").length<=0){$(".results-sort-by").append($("<option></option>").val("VideoWalkthrough").html("Video Walkthrough").attr("Id","VideoWalkthrough"))}}if(c.PropertySpecialOfferCount<=0){$(".results-sort-by option[value='SpecialOffer']").remove()}else{if($(".results-sort-by option[value='SpecialOffer']").length<=0){$(".results-sort-by").append($("<option></option>").val("SpecialOffer").html("Special Offer").attr("Id","SpecialOffer"))}}if(c.NewAdsCount<=0){$(".results-sort-by option[value='New']").remove()}else{if($(".results-sort-by option[value='New']").length<=0){$(".results-sort-by").append($("<option></option>").val("New").html("New").attr("Id","New"))}}if(c.UpdatedAdsCount<=0){$(".results-sort-by option[value='Updated']").remove()}else{if($(".results-sort-by option[value='Updated']").length<=0){$(".results-sort-by").append($("<option></option>").val("Updated").html("Updated").attr("Id","Updated"))}}$(".results-per-page").val(c.NumberPerPage);$(".listing-selections-adtype").removeAttr("checked");$("#"+c.ManagementType).attr("checked","checked")};this.updateRefineBarInputs=function(c){var b=jQuery.url.setUrl(window.location);if($("#rent-min").val()=="Any"&&b.param("rentmin")==null){$("#rent-min").val("Any")}else{if($("#rent-min").val()=="Any"){$("#rent-min").val("Any")}else{$("#rent-min").val(c.MinRent)}}if($("#rent-max").val()=="Any"&&b.param("rentmax")==null){$("#rent-max").val("Any")}else{if($("#rent-max").val()=="Any"){$("#rent-max").val("Any")}else{$("#rent-max").val(c.MaxRent)}}if($("#square-feet-min").val()=="Any"&&b.param("MinSQFT")==null){$("#square-feet-min").val("Any")}else{if($("#square-feet-min").val()=="Any"){$("#square-feet-min").val("Any")}else{$("#square-feet-min").val(c.MinSQFT)}}if($("#square-feet-max").val()=="Any"&&b.param("MaxSQFT")==null){$("#square-feet-max").val("Any")}else{if($("#square-feet-max").val()=="Any"){$("#square-feet-max").val("Any")}else{$("#square-feet-max").val(c.MaxSQFT)}}$("#NumberOfbeds").html(c.NumberOfbeds);$("#NumberOfbaths").html(c.NumberOfbaths)};this.updateRefineBarCheckboxes=function(g){var b=g.HousingType.split(",");var h=g.PropertyType.split(",");var e=new String();for(var c=0;c<b.length;c++){if(jQuery.trim(b[c].toLowerCase())!="any"){if(e.length>0){e=e+", "}e=e+$("a[compressedtitle='"+jQuery.trim(b[c].toLowerCase())+"']").attr("title")}}for(var c=0;c<h.length;c++){if(jQuery.trim(h[c].toLowerCase())!="any"){if(e.length>0){e=e+", "}e=e+$("a[compressedtitle='"+jQuery.trim(h[c].toLowerCase())+"']").attr("title")}}if(e.length<=0){e="Any"}$("#housing-prop-type-box").html(e);$("#housing-prop-type").val(e);var d=g.Amenities.split(",");var f=new String();for(var c=0;c<d.length;c++){if(jQuery.trim(d[c].toLowerCase())!="any"){if(f.length>0){f=f+", "}f=f+$("a[compressedtitle='"+jQuery.trim(d[c].toLowerCase())+"']").attr("title")}else{f="Any"}}$("#amenities-box").html(f);$("#amenity-type").val(f);$("#housing-hoods-box").html(g.Neighborhoods)};this.fixPager=function(b){if(b.NextPageNumber){$(".nextPage").attr("href",b.NextPageNumber)}if(b.PreviousPageNumber){$(".prevPage").attr("href",b.PreviousPageNumber)}$(".PageNumberTemplate").attr("href","/results?searchCriteria="+b.Hash+"&pagen=")};this.UpdateHelpers=function(b){a.updateResultsTitleAndRadios(b);a.fixPageView(b.TotalListings,"box300R");a.currentSearchCriteriaHash=b.Hash;a.setAdSorters(b);a.updateRefineBarInputs(b);a.updateRefineBarCheckboxes(b);a.fixPager(b)};this.SearchReturnError=function(c){a.Log("SearchReturnError");try{$(".rContain").block({message:"ERROR",centerY:false,overlayCSS:{backgroundColor:"#ffffff"},timeout:1000});a.OnAjaxLoad()}catch(b){a.Log(b)}}}function AdContainer(b){var a=this;a.allAds=new Array();a.SearchData=null;a.baseURL=b;a.passThrough=true;this.PushAd=function(c){a.allAds.push(c)};this.PropertyUpdate=function(d){a.SearchData=d;if(d){var e;for(e in a.allAds){if(d.MinRent){a.allAds[e].keyValues.defaultUrlParams.minr=d.MinRent+";"}if(d.MaxRent){a.allAds[e].keyValues.defaultUrlParams.maxr=d.MaxRent+";"}housingParamString="";if(d.HousingType!=null){housingArr=d.HousingType.split(",");for(var h=housingArr.length-1;h>=0;--h){housing=housingArr[h].replace("housing","");housing=jQuery.trim(housing);if(housing=="campus"){housing="NearCampus"}if(housing){housing=housing+"_";housingParamString+=housing}}}if(d.PropertyType!=null){propertyArr=d.PropertyType.split(",");for(var h=propertyArr.length-1;h>=0;--h){property=propertyArr[h].replace("housingtype","");property=jQuery.trim(property);if(property){property=property+"_";housingParamString+=property}}}housingParamString=housingParamString.slice(0,housingParamString.lastIndexOf("_"));if(!housingParamString){housingParamString="Any"}a.allAds[e].keyValues.defaultUrlParams.htype=housingParamString+";";bedParamString="";if(d.Bed!=null){bedsArr=d.Bed.split(",");for(var h=0;h<=bedsArr.length-1;h++){if(bedsArr[h]=="Studio"){bedParamString+="Studio."}else{bed=bedsArr[h].replace(" Bedroom","");bed=bed.replace("s","");bed=jQuery.trim(bed);if(bed=="1"){bedParamString+="One_"}if(bed=="2"){bedParamString+="Two_"}if(bed=="3"){bedParamString+="Three_"}if(bed=="4"){bedParamString+="Four_"}if(bed=="4+"){bedParamString+="FourPlus_"}if(bed=="5"){bedParamString+="Five_"}if(bed=="6"){bedParamString+="Six_"}if(bed=="6+"){bedParamString+="SixPlus_"}}}bedParamString=bedParamString.slice(0,bedParamString.lastIndexOf("_",0))}if(!bedParamString){bedParamString="Any"}a.allAds[e].keyValues.defaultUrlParams.beds=bedParamString+";";var c=";";var f=";";var l=";";if(d.Amenity){amenitiesArr=d.Amenity.split(",");for(var h=amenitiesArr.length-1;h>=0;--h){NTHindex=amenitiesArr[h].indexOf("-NTH");if(NTHindex>0){amenity=amenitiesArr[h].slice(0,NTHindex)}else{amenity=amenitiesArr[h]}amenity=jQuery.trim(amenity);if(amenity=="dogsallowed"||amenity=="catsallowed"||amenity=="smalldogsallowed"){c="Pets;"}else{if(amenity=="internetaccess"){f="HighSpeedInternet;"}else{if(amenity=="fitnesscenter"){l="HealthFacilities;"}}}}}a.allAds[e].keyValues.defaultUrlParams.am1=c;a.allAds[e].keyValues.defaultUrlParams.am2=f;a.allAds[e].keyValues.defaultUrlParams.am3=l;var g=jQuery.trim($("#firstZip").html());if(!g){g=""}a.allAds[e].keyValues.defaultUrlParams.zip=g+";";var j=jQuery.trim($("#firstState").html());if(!j){j=""}a.allAds[e].keyValues.defaultUrlParams.state=j+";";var k=jQuery.trim($("#firstCity").html());if(!k){k=""}k=k.replace(".","");k=k.replace(" ","");a.allAds[e].keyValues.defaultUrlParams.city=k+";";a.allAds[e].GenURL()}}a.RefreshAds()};this.RefreshAds=function(){a.LoadAds()};this.LoadAds=function(){var c;for(x in a.allAds){if(a.allAds[x].isPCL=="true"){}else{a.RenderAd(a.allAds[x].iframeID,a.allAds[x].url)}}};this.RenderAd=function(f,g){try{var d=false;if(("#"+f).length!=0){$("#"+f)[0].contentWindow.location.replace(g);if(d){$.Console(f+" - "+g)}}}catch(c){$.Console("Error writing ad source to iframe")}};this.RenderPCL=function(d,e){var c;if(a.passThrough){c=a.baseURL+"/home/passthrough/?url="+e}else{c=e}$.ajax({url:c,success:function(f){$("."+d).html(f)}})}}var Ord=Math.floor(Math.random()*10000000000);function Ad(c,a){var b=this;b.url=null;b.randomNumber=null;b.pageID=null;b.keyValues=a.keyValues;b.iframeID=a.iframeID;b.divClass=a.divClass;b.adServer=a.adServer;b.isPCL=a.isPCL;this.Init=function(){b.SetRandomNumber();b.SetPageID();b.GenURL();c.PushAd(b)};this.GenURL=function(){b.url=b.adServer+"ord="+Ord+";";for(var e in b.keyValues){if(e=="defaultUrlParams"){for(var d in b.keyValues[e]){b.url+=d+"="+b.keyValues[e][d]}}else{if(e=="SOV"){b.url+=e+"="+b.GetSOV()+"/"}else{b.url+=e+"="+b.keyValues[e]}}}};this.SetRandomNumber=function(){b.randomNumber=Math.floor(Math.random()*10000000000)};this.SetPageID=function(){b.pageID=Math.floor(Math.random()*1000000)};this.GetSOV=function(){var d=Math.round(Math.random()*100000000);var e=d%4;return e}}function CookieReader(){var b=this;var a=null;var c=null;this.Log=function(g){try{var f=false;if(f){$.Console(g)}}catch(d){alert(ex)}};this.Init=function(){try{a=b.ReadCookie("activitylogging");c=b.ReadCookie("userSite")}catch(d){b.Log(d)}};this.GetVisitorId=function(){try{return b.ParseCookie(a,"visitorid","&","=")}catch(d){b.Log(d)}};this.GetVisitId=function(){try{return b.ParseCookie(a,"visitid","&","=")}catch(d){b.Log(d)}};this.GetSubSiteId=function(){try{return b.ParseCookie(c,"BetaNumber","@","|")}catch(d){b.Log(d)}};this.GetFrontDoorAffiliateId=function(){try{return b.ParseCookie(a,"lastfrontdoor","&","=")}catch(d){b.Log(d)}};this.ReadCookie=function(g){try{var h=""+document.cookie;var f=h.indexOf(g);if(f==-1||g==""){return""}var e=h.indexOf(";",f);if(e==-1){e=h.length}return unescape(h.substring(f+g.length+1,e))}catch(d){b.Log(d)}};this.ParseCookie=function(k,e,j,g){try{if(k!=null){var d=k.split(j);e=e.toLowerCase();for(var f=0;f<d.length;f++){if(d[f].toLowerCase().search(e)>-1){return d[f].split(g)[1]}}}}catch(h){b.Log(h)}}}var PartnerValue;function SaveToFavorites(b){var a=this;a.OasisLegacyRedirect=b;a.initResults=function(c){a.saveToFavLink=c;a.site=a.saveToFavLink.attr("st");a.PropertyId=a.saveToFavLink.attr("p");a.PropertyName=a.saveToFavLink.attr("n");a.pageName=a.saveToFavLink.attr("pg");a.BMIndex=a.FindBookMark(a.PropertyId);a.BMCount=a.getBMCount();a.ProperyNameSplit=a.PropertyName.split("<br>")[0];a.MonthsStored=1;a.MaxCookies=10;a.theHash=a.saveToFavLink.attr("hash");a.bookmark=a.BookMark()};a.BookMark=function(){if(a.BMIndex<0){if(a.BMCount==a.MaxCookies){alert("YOU HAVE NO MORE BOOKMARKS LEFT !")}else{Cookie.PackedSave("bookmark","p"+a.BMCount,a.PropertyId,a.MonthsStored);Cookie.PackedSave("bookmark","pn"+a.BMCount,a.ProperyNameSplit,a.MonthsStored);Cookie.PackedSave("bookmark","v"+a.BMCount,a.pageName,a.MonthsStored);Cookie.PackedSave("bookmark","hash"+a.BMCount,a.theHash,a.MonthsStored)}}else{a.DeleteBookMark()}a.ToggleFavoritesLink()};a.ViewFavorites=function(){window.open(a.OasisLegacyRedirect+"/ViewBookMark.aspx","book","height=400,width=440,scrollbars=1")};a.DeleteBookMark=function(h){a.MonthsStored=1;a.MaxCookies=10;var d,g,f,e,j;d=h;if(a.BMIndex){d=a.BMIndex}for(var c=d;c<a.MaxCookies;c++){if(c==a.MaxCookies-1){g="";f="";e="";j=""}else{g=Cookie.PackedRetrieve("bookmark","p"+(c+1));f=Cookie.PackedRetrieve("bookmark","pn"+(c+1));e=Cookie.PackedRetrieve("bookmark","v"+(c+1));j=Cookie.PackedRetrieve("bookmark","hash"+(c+1))}Cookie.PackedSave("bookmark","p"+c,g,a.MonthsStored);Cookie.PackedSave("bookmark","pn"+c,f,a.MonthsStored);Cookie.PackedSave("bookmark","v"+c,e,a.MonthsStored);Cookie.PackedSave("bookmark","hash"+c,j,a.MonthsStored);if(g==""){break}Cookie.PackedSave("bookmark","p"+(c+1),"",a.MonthsStored);Cookie.PackedSave("bookmark","pn"+(c+1),"",a.MonthsStored);Cookie.PackedSave("bookmark","v"+(c+1),"",a.MonthsStored);Cookie.PackedSave("bookmark","hash"+(c+1),"",a.MonthsStored)}};a.FindBookMark=function(c){BMCount=this.getBMCount();for(var d=0;d<=BMCount;d++){if(Cookie.PackedRetrieve("bookmark","p"+d)==c){return d}}return -1};a.getBMCount=function(){var c=0;for(c;c<a.MaxCookies;c++){if(Cookie.PackedRetrieve("bookmark","p"+c)==""){break}}return c};a.setSavedFavorite=function(){if(a.saveToFavLink){if((PartnerValue=="terra")||(PartnerValue=="univision")){a.saveToFavLink.html("Guardar en Favoritos")}else{a.saveToFavLink.html("Save to Favorites")}a.saveToFavLink.removeClass("view-favorites").addClass("add-to-favorites")}};a.setViewFavorite=function(){if(a.saveToFavLink){if((PartnerValue=="terra")||(PartnerValue=="univision")){a.saveToFavLink.html("Ver favoritos")}else{a.saveToFavLink.html("View Favorites")}a.saveToFavLink.removeClass("add-to-favorites").addClass("view-favorites")}};a.ToggleFavoritesLink=function(c){if(c){a.initResults(c);if(a.BMCount==a.MaxCookies){a.setViewFavorite()}else{if(a.FindBookMark(a.PropertyId)<0){a.setSavedFavorite()}else{a.setViewFavorite()}}}else{if(a.PropertyId){if(a.BMCount==a.MaxCookies){a.setViewFavorite()}else{if(a.FindBookMark(a.PropertyId)<0){a.setSavedFavorite()}else{a.setViewFavorite()}}}}}}Cookie={PackedSave:function(d,e,f,b){var a=this.Retrieve(d);var c=this.Pack(a,e,f);this.Create(d,c,b)},PackedRetrieve:function(a,b){var c;c=this.Retrieve(a);return this.Unpack(c,b)},Retrieve:function(c){var f=new String();var e=document.cookie;var d=e.indexOf(c+"=");if(d!=-1){var a,b;a=d+c.length+1;b=e.indexOf(";",a);if(b==-1){b=e.length}f=unescape(e.substring(a,b))}return f},Create:function(c,d,b){var a=new Date();if(a.getMonth()+b>11){a.setFullYear(a.getFullYear()+1);a.setMonth(a.getMonth()-(a.getMonth()-b))}else{a.setMonth(a.getMonth()+b)}document.cookie=c+"="+escape(d)+";expires="+a.toGMTString()+";path=/"},Pack:function(c,d,e){var b,f;var a=escape(d)+"="+escape(e);var g=c.split("&");for(b=0;b<g.length;++b){f=g[b];if(f.length>0){f=f.split("=");if(d==unescape(f[0])){break}}}if(b<g.length){g[b]=a}else{g=g.concat(a)}c="";for(b=0;b<g.length;++b){f=g[b];if(f.length>0){f=f.split("=");if(f.length>1){if(f[1].length>0){if(c.length>0){c+="&"}c+=g[b]}}}}return c},Unpack:function(b,c){var a,f,g;var d="";var e=b.split("&");g=false;for(a=0;a<e.length;++a){f=e[a];if(f.length>0){f=f.split("=");if(c==unescape(f[0])){d=unescape(f[1]);break}}}return d}};
