var isSorting=false;function ResultImpressions(linkObject,productIdString,LinkName){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.pageName=linkObject;if(linkObject.indexOf('sn_r')!=-1){s.prop18="search:search homes";}else if(linkObject.indexOf('sh_r')!=-1){s.prop18="search:search homes";}else{s.prop18="search:search agents";}s.products="";s.events="";if(s.prop15!=""&&s.prop15!=undefined){if(s.prop3.indexOf(",")!=-1)s.prop3=s.prop15+s.prop3.substring(s.prop3.indexOf(','),s.prop3.length);else s.prop3=s.prop15;}if(isSorting==true){s.prop16="";s.t();isSorting=false;}else{s.t();}if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='products,events';s.linkTrackEvents='event6,event8,event11';s.products=productIdString;s.events='event6,event8,event11'
s.tl(this,'o','products server call');if(s.prop15!=""){s.prop15="";s.eVar15="";}if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmFeaturedImpressionClick(linkObject,productId,EventId,LinkName,featuredObjectType,pageName,codefeatured,booknumber){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;if(EventId==7){s.linkTrackVars='eVar16,eVar20,eVar44,eVar43,products,events';s.linkTrackEvents='event7';s.eVar16=productId;s.events='event7';}else{s.linkTrackVars='eVar17,eVar20,eVar44,eVar43,products,events';s.linkTrackEvents='event12';s.eVar17=productId;s.events='event12';}s.products=";"+productId+";;;;evar41="+booknumber+"|evar44="+codefeatured+"|evar43="+pageName;s.eVar20=featuredObjectType;s.tl(linkObject,'o',LinkName);if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmProp(PropID,propertyString){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='prop'+PropID;var sprop='prop'+PropID;eval("s.prop"+PropID+"="+"'"+propertyString+"'");s.tl('property object','o','omniture property linkName');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmEvent(linkObject,EventId,LinkName){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='events';s.linkTrackEvents='event'+EventId;s.events='event'+EventId;s.tl(linkObject,'o',LinkName);if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function omVirtualtour(linkObject,propertyID,propertyType,LinkName){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='eVar34,eVar36,products,events';s.linkTrackEvents='event18';s.eVar34=propertyID;s.eVar36='inView';s.events='event18';s.tl(linkObject,'e',LinkName);if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmSingleEventandEvar(linkObject,EventId,LinkName,evarID,evarstring){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;if(EventId==19){s.linkTrackVars='eVar'+evarID+',products,events';var SEOPath=window.location.href.substring(window.location.href.indexOf('#')+1);var start=SEOPath.indexOf("/listing/")+9;var end=SEOPath.indexOf("/",start);var propertyListing="";if(end!=-1)propertyListing=SEOPath.substring(start,end);else propertyListing=SEOPath.substring(start,SEOPath.length);}else if(EventId==15){s.linkTrackVars='products,events';}else if(EventId==5){s.linkTrackVars='prop24,eVar22,eVar31,eVar46,eVar24,products,events';}else if(EventId==19){s.linkTrackVars='eVar'+evarID+',products,events';}else{s.linkTrackVars='eVar'+evarID+',events';}s.linkTrackEvents='event'+EventId;var evar_string='eVar'+evarID;if(EventId!=5)eval("s.eVar"+evarID+"="+"'"+evarstring+"'");s.events='event'+EventId;if(EventId==19){s.tl(linkObject,'e',LinkName);}else{s.tl(linkObject,'o',LinkName);}if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function omNeighbourhoodInformation(neighbourhoodType){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.prop34=neighbourhoodType;s.linkTrackVars='prop34,eVar38';s.eVar38=neighbourhoodType;s.tl('Neighbourhood Information','o','neighbourhoodType');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmAdvertisingCenter(linkObject,EventId,LinkName,advertisingCenterName){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='eVar32,events';s.linkTrackEvents='event'+EventId;s.eVar32=advertisingCenterName;s.events='event'+EventId;s.tl(linkObject,'e',LinkName);if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmReport(linkObject,Type,Query){if(Type=="refine"||Type=="sort"||Type=="remove"||Type=="pagination"){ReloadFrameAds();}Query=escape(Query.replace(/&amp;/gi,'&'));var strURL=String.format("{0}Controls/AjaxCalls/ReportOm.aspx?Type={1}&Query={2}",WebRoot,Type,Query);$AJAX.GetForDelegate(function(AjaxResponse){eval(AjaxResponse);},strURL);}function OmReportRefine(linkObject,Type,DimName,DimValue,channelType){var s_account=gets_account();var s=s_gi(s_account);if(Type=="refine"||Type=="sort"||Type=="remove"||Type=="pagination"){}if(Type=="refine"){if(channelType=="foreclosures"){s.prop1="rsf";s.eVar1="rsf";}else{s.prop1="rsh";s.eVar1="rsh";}}if(Type=="refine"&&DimName=="Price Range"){if(DimValue.search('-')!=-1){var omMinPrice=DimValue.substring(0,DimValue.indexOf('-'));var omMaxPrice=DimValue.substring(DimValue.indexOf('-')+1,DimValue.length);s.prop4=omMinPrice;s.prop5=omMaxPrice;}else if(DimValue.search("Under")!=-1){var omMaxPrice=DimValue.substring(DimValue.indexOf('r')+1,DimValue.length);s.prop5=omMaxPrice;}else if(DimValue.search("Over")!=-1){var omMinPrice=DimValue.substring(DimValue.indexOf('r')+1,DimValue.length);s.prop4=omMinPrice;}}if(Type=="remove"&&DimName=="Price Range"){s.prop5='-';s.prop4='-';}if(Type=="refine"&&DimName=="Bedrooms"){s.prop6=DimValue;}if(Type=="remove"&&DimName=="Bedrooms"){s.prop6='-';}if(Type=="refine"&&DimName=="Bathrooms"){s.prop7=DimValue;}if(Type=="remove"&&DimName=="Bathrooms"){s.prop7='-';}if(Type=="refine"&&DimName=="Square Foot"){s.prop12=DimValue;}if(Type=="remove"&&DimName=="Square Foot"){s.prop12='-';}if(Type=="refine"&&DimName=="Property Type"){s.prop13=DimValue;}if(Type=="remove"&&DimName=="Property Type"){s.prop13='-';}if(Type=="refine"&&DimName=="Amenities"){s.prop14=DimValue;}if(Type=="remove"&&DimName=="Amenities"){s.prop14='-';}if(Type.toLowerCase().search("nearby_cities")!=-1||Type.toLowerCase().search("nearby_neighborhoods")!=-1){s.prop15=DimValue;}if(Type=="sort"){switch(DimValue){case"Price High-Low":DimValue="H";break;case"New Listings":DimValue="N";break;case"Price Low-High":DimValue="L";break;case"Bedrooms":DimValue="B";break;case"Bathrooms":DimValue="A";break;case"SqFt":DimValue="S";break;case"AgentName A-Z":DimValue="AA";break;case"AgentName Z-A":DimValue="AZ";break;case"Brokerage A-Z":DimValue="BA";break;case"Brokerage Z-A":DimValue="BZ";break;case"Featured Agents":DimValue="F";break;}s.prop17=DimValue;s.eVar39=DimValue;isSorting=true;}var strURL=String.format("{0}Controls/AjaxCalls/ReportOm.aspx?Type={1}&DimName={2}&DimValue={3}",WebRoot,Type,escape(DimName),escape(DimValue));$AJAX.GetForDelegate(function(AjaxResponse){eval(AjaxResponse);},strURL);}function OmReportNearby(linkObject,RegionName,Type){var s_account=gets_account();var s=s_gi(s_account);s.prop15=RegionName;var strURL=String.format("{0}Controls/AjaxCalls/ReportOm.aspx?Type={1}&DimName={2}&DimValue={3}",WebRoot,Type,escape(RegionName),escape(window.location.href));$AJAX.GetForDelegate(function(AjaxResponse){eval(AjaxResponse);},strURL);}function OmReportSignInSuccess(linkObject){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars="eVar35,eVar23,eVar33,events";s.linkTrackEvents="event13";s.eVar35="m";s.eVar33="sign in";s.events="event13";s.tl(linkObject,'o','sign-in success');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmPropertyActivity(linkObject,activityString){var SEOPath=window.location.href.substring(window.location.href.indexOf('#')+1);var start=SEOPath.indexOf("/listing/")+9;var end=SEOPath.indexOf("/",start);var propertyString="";if(end!=-1)propertyString=SEOPath.substring(start,end);else propertyString=SEOPath.substring(start,SEOPath.length);var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars="prop25,eVar25,products,events";s.linkTrackEvents="event17";s.prop25=activityString;s.eVar25=activityString;s.events="event17";s.tl(linkObject,'o','property activity');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmViewRss(linkObject){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars="eVar33,events";s.linkTrackEvents="event13";s.eVar33="view rss";s.events="event13";s.tl(linkObject,'e','property activity');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function OmMapInteraction(linkObject,propertyID,codeFeaturedNumber){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars="eVar18,products,events";s.linkTrackEvents="event14";s.eVar18=propertyID;s.products=";"+propertyID+";;;;evar44="+codeFeaturedNumber;s.events="event14";s.tl(linkObject,'o','property activity');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function omExtraFeaturedListings(productsString){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='products,events';s.linkTrackEvents='event6';s.products=productsString;s.events='event6';s.tl('Featured Listing Impressions','o','Search Results Page');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function omregisterProducts(productId,codeFeaturedNumber,booknumber){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.products=";"+productId+";;;;evar41="+booknumber+"|evar44="+codeFeaturedNumber;if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function omLeadLocation(location,id){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.prop24=location;s.eVar24=location;if(location=="prop:srch res:contact agent"||location=="prop:srch res:request info"){s.eVar22=id;s.eVar46=id;}if(location=="agent:srch res:request info"){s.eVar31=id;s.eVar46=id;}if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}function modifyRefinementForNewHomes(refinement){if(refinement=="-"||refinement==undefined)return"-new";else if(refinement.indexOf("-new")>-1)return refinement;else return refinement+"-new";}function modifyRefinementForHomes(refinement){if(refinement=="-new"||refinement==undefined)return"-";else if(refinement.indexOf("-new")>-1)return refinement.replace('-new','');else return refinement;}function omAgentPagination(productsString){var s_account=gets_account();var s=s_gi(s_account);s.templtv=s.linkTrackVars;s.templte=s.linkTrackEvents;s.linkTrackVars='products,events';s.linkTrackEvents='event6,event8,event11';s.products=productsString;s.events='event6,event8,event11';s.tl('agent pagination','o','agent detail page');if(s.templtv)s.linkTrackVars=s.templtv;if(s.templte)s.linkTrackEvents=s.templte;}