if(GoogleMapsVersion==3){try{var GEvent=google.maps.event;var GLatLng=google.maps.LatLng;var GMap3=google.maps.Map;var GLatLngBounds=google.maps.LatLngBounds;var GIcon=google.maps.MarkerImage;var GSize=google.maps.Size;var GPoint=google.maps.Point;var GMarker=google.maps.Marker;var GInfoWindow=null;var GInfoCenter=null;var GInfoZoom=null;var GJustClosed=false;function CloseGInfoWindow(){GInfoWindow.close();GJustClosed=true;Map.panTo(GInfoCenter);if(GInfoZoom!=Map.getZoom()){Map.setZoom(GInfoZoom)}GInfoCenter=null;GInfoZoom=null;GInfoWindow=null}}catch(Error){}}function GetInfoWindowHtml(l,d){var b="<div class='hlisting infoWindowSmall'>                        <h2 class='header'><a href='{1}' onclick=\"{7}('{6}','list')\">{0}</a></h2>                        <div class='group'>                            <a class='photo' href='{1}' onclick=\"{7}('{6}','list')\">                                <img src='{2}' width='90' height='67.5' />                            </a>                            <div class='summary'>                                <div class='price'>{3}</div>                                <div>{4}</div>                                <div>{5}</div>                            </div>                        </div>                    </div>";var a="#LS"+l;var h=$("h2>a",a).text();var f="";$(a+" .price").each(function(m){f+=$(this).html().replace(/\$/g,"&#36;")+"<br />"});var g=$(a+" a[rel='bookmark']").attr("href");var j=$("#THUM-"+l).attr("src");var c=$(a+" .infoWindow_3").html();if(c==null){c=""}var i=$(a+" .infoWindow_4").html();if(i==null){i=""}var k="";switch(d){case RecordType.Broker:k="GoBrkMap";break;case RecordType.Community:k="GoComMap";break;default:k="GoLstMap";break}var e=String.Format(b,h,g,j,f,c,i,trim(l),k);return e}function SumPadding(c,b,a){b=b*a;c+=b;return c}var rad=function(a){return a*Math.PI/180};var oneMileKilometer=0.621371192;function HaversineDistance(b,e){var g=6371;var i=rad(e.lat()-b.lat());var f=rad(e.lng()-b.lng());var j=Math.sin(i/2)*Math.sin(i/2)+Math.cos(rad(b.lat()))*Math.cos(rad(e.lat()))*Math.sin(f/2)*Math.sin(f/2);var h=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));var k=(g*h)*oneMileKilometer;return k.toFixed(3)}function PadGLatLngBounds(d,o){if(d==null){return null}return d;if(o==undefined){o=0}var j=d.getSouthWest();var h=d.getNorthEast();var a=j.lat();var b=h.lat();var p=j.lng();var n=h.lng();var i;var k;var f=0.0144569853911471;var c=f/1609.344;k=HaversineDistance(new GLatLng(a,p),new GLatLng(b,p))*c;i=HaversineDistance(new GLatLng(a,p),new GLatLng(a,n))*c;var e=(k/100)*(o/2);var l=(i/100)*(o/2);var m=new GLatLng(SumPadding(j.lat(),e,-1),SumPadding(j.lng(),l,-1));var g=new GLatLng(SumPadding(h.lat(),e,+1),SumPadding(h.lng(),l,+1));return new GLatLngBounds(m,g)}function AdvancedLocationToolTips(){BuildIconToolTip(".tooltip[title!='']")}function BuildIconToolTip(a){$(a).qtip({style:{name:"blue",tip:"bottomLeft"},position:{corner:{target:"topRight",tooltip:"bottomLeft"}},show:{delay:0,when:{event:"mouseover"}},hide:{delay:0,when:{event:"mouseout"}}});$(a).click(function(){$(".qtip").remove()})}function SetListingsTooltip(a){return}var MarkersOnMapCollection=new Array();var MarkersOnMapCollection_Last=new Array();var MarkersOnMapCollection_Next=new Array();var OverlaysOnMapCollection=new Array();function Map_clearMarkers(a){if(a.length>0&&a.length<5000){for(var c=0;c<a.length;c++){try{if(a[c].getMap!=undefined&&a[c].getMap()!=null){a[c].setMap(null)}}catch(b){}}}else{if(a.count()>0){for(var c in a){try{if(a[c].getMap!=undefined&&a[c].getMap()!=null){a[c].setMap(null)}}catch(b){}}}}}function Map_clearOverlays(a){if(OverlaysOnMapCollection.length>0){for(var c=0;c<OverlaysOnMapCollection.length;c++){try{OverlaysOnMapCollection[c].setMap(null)}catch(b){window.alert("This Overlay requires a definition for onRemove")}}}if(a){MarkersOnMapCollection=new Array()}}if(GoogleMapsVersion==3){function InfoMarkerOverlay(c,e,b,a,g,f,d){this.div_=null;this.set("div",this.div_);this.CssClass=f;this.data=d;this.pane=b;this.marker=e;this.offsetX=a;this.offsetY=g;this.setMap(c)}InfoMarkerOverlay.prototype=new google.maps.OverlayView();InfoMarkerOverlay.prototype.onAdd=function(){var div=document.createElement("DIV");div.className=this.CssClass;div.style.zIndex=this.marker.getZIndex()+1;div.innerHTML=this.data;this.div_=div;this.set("div",div);var panes=this.getPanes();eval("panes."+this.pane+".appendChild(div);")};InfoMarkerOverlay.prototype.draw=function(){var b=this.getProjection();var a=b.fromLatLngToDivPixel(this.marker.getPosition());if(a!=null){this.div_.style.left=(a.x+this.offsetX)+"px";this.div_.style.top=(a.y+this.offsetY)+"px"}};InfoMarkerOverlay.prototype.onRemove=function(){this.div_.parentNode.removeChild(this.div_);this.div_=null}}function LSGroupListing(e,b,d,g,f,a,c){this.Latitude=e;this.Longitude=b;this.Address=g;this.IdListing=d;this.LSGroupName=f;this.GeoStatus=a;this.Status=c}function LSGroup(a){this.Latitude=a.Latitude;this.Longitude=a.Longitude;this.LSGroupListings=new Array(a)}LSGroup.prototype.GetLSGroupName=function(){var b=null;for(var a=0;a<this.LSGroupListings.length;a++){if(this.LSGroupListings[a].LSGroupName!="null"){b=this.LSGroupListings[a].LSGroupName;break}else{b="This Location";break}}if(b==null){for(var a=0;a<this.LSGroupListings.length;a++){if(this.LSGroupListings[a].Address!=""){b=this.LSGroupListings[a].Address;break}}}if(b==null){b="Listing Group"}return b};LSGroup.prototype.GetListingIdsArray=function(){var a=new Array();for(var b=0;b<this.LSGroupListings.length;b++){a.push(this.LSGroupListings[b].IdListing)}return a};function LSGroupCollectionObject(){this.LSGroups=new Array()}LSGroupCollectionObject.prototype.indexOf=function(lat,lng){with(this){if(LSGroups.length>0){for(var x=0;x<LSGroups.length;x++){if(LSGroups[x].Latitude==lat&&LSGroups[x].Longitude==lng){return x}}}return -1}};LSGroupCollectionObject.prototype.Add=function(LSGroupListing){with(this){var lat=LSGroupListing.Latitude;var lng=LSGroupListing.Longitude;if(indexOf(lat,lng)>-1){LSGroups[indexOf(lat,lng)].LSGroupListings.push(LSGroupListing)}else{LSGroups.push(new LSGroup(LSGroupListing))}}};LSGroupCollectionObject.prototype.Build=function(){with(this){if(LSGroups.length>0){var TempLSGroups=new Array();for(var x=0;x<LSGroups.length;x++){if(LSGroups[x].LSGroupListings.length>1){TempLSGroups.push(LSGroups[x])}}LSGroups=TempLSGroups}}};function PlotMarkersGetBounds(e,d){var l=null;var c=new LSGroupCollectionObject();var a=new LSGroupCollectionObject();if(ListingMrkrs.length>0){var m=new Array();for(var k=0;k<ListingMrkrs.length;k++){var f=ListingMrkrs[k];if(f==false){continue}var i=new LSGroupListing(f[2],f[3],f[0],f[4],f[5],f[6],f[8]);if(i.GeoStatus==5){if(!a.indexOf(i.Latitude,i.Longitude)>-1){a.Add(i)}}else{if(!c.indexOf(i.Latitude,i.Longitude)>-1){c.Add(i)}}}c.Build();a.Build();l=new GLatLngBounds();for(var k=0;k<ListingMrkrs.length;k++){var f=ListingMrkrs[k];if(f==false){continue}var b=f[2];var n=f[3];if(b==null||n==null||b==""||n==""||b==0||n==0){continue}var j=f[6],g=f[8];if(c.indexOf(b,n)==-1&&a.indexOf(b,n)==-1){var h=GetListingMarker(f[0],f[1],f[2],f[3],k,e,j,g);l.extend(h.getPosition());MarkersOnMapCollection.push(h)}}if(c.LSGroups.length>0){for(var k=0;k<c.LSGroups.length;k++){var h=GetBuildingMarker(c.LSGroups[k],e);l.extend(h.getPosition());MarkersOnMapCollection.push(h)}}if(a.LSGroups.length>0){for(var k=0;k<a.LSGroups.length;k++){var h=GetZipMarker(a.LSGroups[k]);l.extend(h.getPosition()),e;MarkersOnMapCollection.push(h)}}}else{l=CacheObject.DefaultMapBounds}if(d!=undefined&&d!=null&&$.isFunction(d)){d.apply()}return l}function GetGLatLngBoundsFromSEOQuery(o){var h=new GLatLngBounds();var j=/^(.+?)\/(\-?[\.0-9]+)\-(\-?[\.0-9]+)\-(\-?[\.0-9]+)\-(\-?[\.0-9]+)\-map(.*)$/i;if(j.test(o)){var n=o.replace(j,"$2");var e=o.replace(j,"$3");var l=o.replace(j,"$4");var d=o.replace(j,"$5");var i=parseFloat(n);var b=parseFloat(e);var f=parseFloat(l);var a=parseFloat(d);var k;var p;if(i<f){p=i;k=f}else{p=f;k=i}var q=[p,k];if(b<a){p=b;k=a}else{p=a;k=b}var m=[p,k];var c=new GLatLng(q[0],m[0]);var g=new GLatLng(q[1],m[1]);h=new GLatLngBounds(c,g)}return h}var iconPath=Static+"/reno/custom/wrappers/gabriels/images/icons/MapIcons.gif",iconSize18x24=new GSize(18,24),iconSize18x22=new GSize(18,22),iconSize22x26=new GSize(22,26),iconSize27x20=new GSize(27,20),ListingIconModel=new Object(),ListingIconModelNew=new Object(),ListingIconModelPR=new Object(),ListingIconModelOH=new Object(),ListingIconModelSaved=new Object(),BuildingIconModel=new Object(),BuildingIconModelNew=new Object(),BuildingIconModelPR=new Object(),BuildingIconModelOH=new Object(),BuildingIconModelSaved=new Object(),OfficeIconModel=new Object(),OfficeIconModelSaved=new Object(),CommunityIconModel=new Object(),CommunityIconModelSaved=new Object(),ZipIconModel=new Object(),ZipIconModelNew=new Object(),ZipIconModelPR=new Object(),ZipIconModelOH=new Object(),ZipIconModelSaved=new Object(),FeaturedIconModel=new Object(),FeaturedIconModelNew=new Object(),FeaturedIconModelPR=new Object(),FeaturedIconModelOH=new Object(),FeaturedIconModelSaved=new Object();function reloadGMIcons(){if(GoogleMapsVersion==3){try{ListingIconModel=new GIcon(iconPath,iconSize18x24,new GPoint(3,0));ListingIconModelNew=new GIcon(iconPath,iconSize18x24,new GPoint(63,0));ListingIconModelPR=new GIcon(iconPath,iconSize18x24,new GPoint(43,0));ListingIconModelOH=new GIcon(iconPath,iconSize18x24,new GPoint(23,0));ListingIconModelSaved=new GIcon(iconPath,iconSize18x24,new GPoint(103,1));BuildingIconModel=new GIcon(iconPath,iconSize18x22,new GPoint(2,56));BuildingIconModelNew=new GIcon(iconPath,iconSize18x22,new GPoint(66,56));BuildingIconModelPR=new GIcon(iconPath,iconSize18x22,new GPoint(45,56));BuildingIconModelOH=new GIcon(iconPath,iconSize18x22,new GPoint(24,56));BuildingIconModelSaved=new GIcon(iconPath,iconSize18x22,new GPoint(109,56));OfficeIconModel=new GIcon(iconPath,iconSize22x26,new GPoint(3,84));OfficeIconModelSaved=new GIcon(iconPath,iconSize22x26,new GPoint(124,84));CommunityIconModel=new GIcon(iconPath,iconSize22x26,new GPoint(1,26));CommunityIconModelSaved=new GIcon(iconPath,iconSize22x26,new GPoint(121,27));ZipIconModel=new GIcon(iconPath,iconSize27x20,new GPoint(2,143));ZipIconModelNew=new GIcon(iconPath,iconSize27x20,new GPoint(99,143));ZipIconModelPR=new GIcon(iconPath,iconSize27x20,new GPoint(66,143));ZipIconModelOH=new GIcon(iconPath,iconSize27x20,new GPoint(34,143));ZipIconModelSaved=new GIcon(iconPath,iconSize27x20,new GPoint(163,143));FeaturedIconModel=new GIcon(iconPath,iconSize22x26,new GPoint(3,192));FeaturedIconModelNew=new GIcon(iconPath,iconSize22x26,new GPoint(87,192));FeaturedIconModelPR=new GIcon(iconPath,iconSize22x26,new GPoint(59,192));FeaturedIconModelOH=new GIcon(iconPath,iconSize22x26,new GPoint(31,192));FeaturedIconModelSaved=new GIcon(iconPath,iconSize22x26,new GPoint(143,192))}catch(a){ListingIconModel=new Object();ListingIconModelNew=new Object();ListingIconModelPR=new Object();ListingIconModelOH=new Object();ListingIconModelSaved=new Object();BuildingIconModel=new Object();BuildingIconModelNew=new Object();BuildingIconModelPR=new Object();BuildingIconModelOH=new Object();BuildingIconModelSaved=new Object();OfficeIconModel=new Object();OfficeIconModelSaved=new Object();CommunityIconModel=new Object();CommunityIconModelSaved=new Object();ZipIconModel=new Object();ZipIconModelNew=new Object();ZipIconModelPR=new Object();ZipIconModelOH=new Object();ZipIconModelSaved=new Object();FeaturedIconModel=new Object();FeaturedIconModelNew=new Object();FeaturedIconModelPR=new Object();FeaturedIconModelOH=new Object();FeaturedIconModelSaved=new Object()}}}$(document).ready(function(){reloadGMIcons()});function GetLSGroupListViewInfoWindowHtml(a,b){var d="<div class='group-window-wrapper' id='group_info_window'>                                    <ul class='group'>";for(var c=0;c<a.LSGroupListings.length;c++){d+="<li>";d+=GetInfoWindowHtml(a.LSGroupListings[c].IdListing,b);d+="</li>"}d+="</ul>                                   <div class='pagination'>                                       <a class='previous'>&laquo; Prev</a>                                       <span class='index'><span id='group_info_window_index'>1</span> of "+a.LSGroupListings.length+"</span>                                       <a class='next'>Next &raquo;</a>                                   </div>                               </div>";return d}function GetBuildingMarker(a,c){var j,d;switch(c){case RecordType.Community:d=CommunityIconModel;j=a.LSGroupListings.length+" Communities at "+a.GetLSGroupName();break;case RecordType.Broker:d=OfficeIconModel;j=a.LSGroupListings.length+" Offices at "+a.GetLSGroupName();break;default:d=BuildingIconModel;var h=new Array();for(var g=0;g<a.LSGroupListings.length;g++){h.push(a.LSGroupListings[g].Status)}if($.inArray("New",h)>-1){d=BuildingIconModelNew}if($.inArray("Reduction",h)>-1){d=BuildingIconModelPR}if($.inArray("Open House",h)>-1){d=BuildingIconModelOH}j=a.LSGroupListings.length+" listings at "+a.GetLSGroupName()}if(typeof(d.b)=="undefined"){reloadGMIcons()}var l=new GLatLng(a.Latitude,a.Longitude);var e={position:l,icon:d,zIndex:500,isListingMarker:false,isZipMarker:false,isBuildingMarker:true};var b=new GMarker(e);GEvent.addListener(b,"mouseover",function(){if(typeof window[a.GetLSGroupName()+"_tip"]!="object"){window[a.GetLSGroupName()+"_tip"]=new toolTip({offset:{x:20,y:-15},tip:true,content:j})}window[a.GetLSGroupName()+"_tip"].showTip()});GEvent.addListener(b,"mouseout",function(){window[a.GetLSGroupName()+"_tip"].hide()});var f=GetSearchType(CacheObject.SEOQuery);var k=GetViewType(CacheObject.SEOQuery);if(k=="map"){GEvent.addListener(b,"click",function(){if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),pixelOffset:new GSize(5,-25),maxWidth:730,content:'<p class="InfoWindowLoading">Loading '+a.LSGroupListings.length+" Listings<br/>At "+a.GetLSGroupName()+"<br/>Please Wait...</p>"});GInfoWindow.open(Map);GetListingGroupInfoWindowHTML(a.GetLSGroupName(),a.GetListingIdsArray(),function(){if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),pixelOffset:new GSize(5,-25),maxWidth:800,content:ListingGroupHTML});GInfoWindow.open(Map);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow)})})}else{GEvent.addListener(b,"click",function(){var i=GetLSGroupListViewInfoWindowHtml(a,c);if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),content:i});GInfoWindow.open(Map);window.setTimeout(function(){$("#group_info_window").jCarouselLite({btnNext:"#group_info_window .next",btnPrev:"#group_info_window .previous",visible:1,circular:false,index:$("#group_info_window_index")})},500);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow)})}return b}function GetZipMarker(a,c){var d=ZipIconModel,j;switch(c){case RecordType.Community:j=a.LSGroupListings.length+" communities in Postal Code "+a.GetLSGroupName();break;case RecordType.Broker:j=a.LSGroupListings.length+" offices in Postal Code "+a.GetLSGroupName();break;default:var h=new Array();for(var g=0;g<a.LSGroupListings.length;g++){h.push(a.LSGroupListings[g].Status)}if($.inArray("New",h)>-1){d=ZipIconModelNew}if($.inArray("Reduction",h)>-1){d=ZipIconModelPR}if($.inArray("Open House",h)>-1){d=ZipIconModelOH}j=a.LSGroupListings.length+" listings in Postal Code "+a.GetLSGroupName()}if(typeof(ZipIconModel.b)=="undefined"){reloadGMIcons()}var l=new GLatLng(a.Latitude,a.Longitude);var e={position:l,icon:d,zIndex:100,isListingMarker:false,isZipMarker:true,isBuildingMarker:false};var b=new GMarker(e);GEvent.addListener(b,"mouseover",function(){if(typeof window[a.GetLSGroupName()+"_tip"]!="object"){window[a.GetLSGroupName()+"_tip"]=new toolTip({offset:{x:20,y:-15},tip:true,content:j})}window[a.GetLSGroupName()+"_tip"].showTip()});GEvent.addListener(b,"mouseout",function(){window[a.GetLSGroupName()+"_tip"].hide()});var f=GetSearchType(CacheObject.SEOQuery);var k=GetViewType(CacheObject.SEOQuery);if(k=="map"){GEvent.addListener(b,"click",function(){if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),pixelOffset:new GSize(5,-25),maxWidth:730,content:'<p class="InfoWindowLoading">Loading '+a.LSGroupListings.length+" Listings<br/>In Zip Code "+a.GetLSGroupName()+"<br/>Please Wait...</p>"});GInfoWindow.open(Map);GetListingGroupInfoWindowHTML(a.GetLSGroupName(),a.GetListingIdsArray(),function(){if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),pixelOffset:new GSize(5,-25),maxWidth:800,content:ListingGroupHTML});GInfoWindow.open(Map);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow)})})}else{GEvent.addListener(b,"click",function(){var i=GetLSGroupListViewInfoWindowHtml(a,c);if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({position:b.getPosition(),pixelOffset:new GSize(-5,0),content:i});GInfoWindow.open(Map);window.setTimeout(function(){$("#group_info_window").jCarouselLite({btnNext:"#group_info_window .next",btnPrev:"#group_info_window .previous",visible:1,circular:false,index:$("#group_info_window_index")})},500);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow)})}return b}function GetListingMarker(IdListing,ToolTip,Lat,Lng,Index,RecType,GeoStatus,Status){var IconType;if(RecType==RecordType.Listing){if(Status.indexOf("featured")>-1){IconType=FeaturedIconModel;if(Status.indexOf("new")>-1){IconType=FeaturedIconModelNew}if(Status.indexOf("reduction")>-1){IconType=FeaturedIconModelPR}if(Status.indexOf("openhouse")>-1){IconType=FeaturedIconModelOH}}else{IconType=ListingIconModel;if(Status.indexOf("new")>-1){IconType=ListingIconModelNew}if(Status.indexOf("reduction")>-1){IconType=ListingIconModelPR}if(Status.indexOf("openhouse")>-1){IconType=ListingIconModelOH}}}else{if(RecType=RecordType.Community){IconType=CommunityIconModel}else{if(RecType==RecordType.Broker){IconType=OfficeIconModel}else{IconType=ListingIconModel}}}if(GeoStatus==5){IconType=ZipIconModel;if(Status=="Reduction"){IconType=ZipIconModelPR}if(Status=="New"){IconType=ZipIconModelNew}if(Status=="Open House"){IconType=ZipIconModelOH}}var CenterPoint=new GLatLng(Lat,Lng);if(typeof(IconType.b)=="undefined"){reloadGMIcons()}var Options={position:CenterPoint,IdListing:IdListing,icon:IconType,zIndex:1000,isListingMarker:true,isZipMarker:false,isBuildingMarker:false};var Marker=new GMarker(Options);GEvent.addListener(Marker,"mouseover",function(){if(typeof window[IdListing+"_tip"]!="object"){window[IdListing+"_tip"]=new toolTip({offset:{x:20,y:-15},tip:true,content:ToolTip})}window[IdListing+"_tip"].showTip()});GEvent.addListener(Marker,"mouseout",function(){window[IdListing+"_tip"].hide()});if(GetViewType(CacheObject.SEOQuery)=="map"){GEvent.addListener(Marker,"click",function(){try{DoReport(ListingReporting[Index],100);var NewId="InfoWindowBubble-"+IdListing;var XMLPath="";var XSLPath="";var ClassName="";var LangPrefix="";if(SiteLang!=null){LangPrefix="/"+SiteLang}switch(RecType){case RecordType.Listing:XMLPath=LangPrefix+"/info-window/listing/"+IdListing+"/xml-out";XSLPath=LangPrefix+"/reno/listings/salesrentals/xsl/MapView_ListingInfoBubble.xslt";ClassName="MapView_ListingInfoBubble";break;case RecordType.Community:XMLPath=LangPrefix+"/info-window/community/"+IdListing+"/xml-out";XSLPath=LangPrefix+"/reno/listings/communities/xsl/MapView_CommunityInfoBubble.xslt";ClassName="MapView_CommunityInfoBubble";break;case RecordType.Broker:XMLPath=LangPrefix+"/info-window/office/"+IdListing+"/xml-out";XSLPath=LangPrefix+"/reno/brokers/xsl/MapView_BrokerInfoBubble.xslt";ClassName="MapView_BrokerInfoBubble";break}var InfoWindowDiv='<div id="'+NewId+'" class="'+ClassName+'">Loading...</div>';var Params={params:{LabelNewDaysLEQ:LabelNewDaysLEQ,AgentDirectory_Root:AgentDirectory_Root,StaticServer:Static,ImageProxyServer:ImageProxyServer},eval:false,callback:function(){if(typeof(ListingIconModel.b)=="undefined"){reloadGMIcons()}ReloadSavedListings()}};var Message=InfoWindowDiv;if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({content:Message,position:Marker.getPosition()});GInfoWindow.open(Map);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow);var DoUntilReps=0;if(document.all){window.setTimeout(function(){$("#"+NewId).getTransform(XSLPath,XMLPath,Params)},1200)}else{var DoUntil=window.setInterval(function(){if($("#"+NewId).length||DoUntilReps==100){$("#"+NewId).getTransform(XSLPath,XMLPath,Params);window.clearInterval(DoUntil)}DoUntilReps++},100)}}catch(ex){}})}else{GEvent.addListener(Marker,"click",function(){var Message=GetInfoWindowHtml(IdListing,RecType);if(GInfoWindow==null){GInfoCenter=Map.getCenter();GInfoZoom=Map.getZoom()}else{GInfoWindow.close()}GInfoWindow=new google.maps.InfoWindow({content:Message,position:Marker.getPosition()});GInfoWindow.open(Map);GEvent.addListener(GInfoWindow,"closeclick",CloseGInfoWindow);DoReport(ListingReporting[Index],126)})}return Marker}var GoogleGlobalsLoadedFlag=new Object();var ListingGroupHTML=null;var ListingGroupDATA=null;function GetListingGroupInfoWindowHTML(c,a,d){ListingGroupHTML="";ListingGroupDATA=null;if(CacheObject.RecordType==RecordType.Broker){var b="/reno/brokers/getbrokergroup.aspx?brokerids="+a.join(",")+"&language="+SiteLang;$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:b,data:"{}",dataType:"jsonp",error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(f){if(f.ls&&f.ls.length>0){ListingGroupDATA=f;ListingGroupHTML+='<div id="lsdata-listing-wrap" class="hlisting">'+GetOfficeHTML(f.ls[0])+"</div>";if(f.ls.length>1){ListingGroupHTML+="<h3>"+f.ls.length+" Offices mapped to "+c+"</h3>";ListingGroupHTML+='<table class="table"><thead><th>Office Name</th><th>Address</th></thead>';for(var e=0;e<f.ls.length;e++){ListingGroupHTML+=GetOfficesTableHTML(f.ls[e],e)}ListingGroupHTML+="</table>";if(d!=undefined&&d!=null&&$.isFunction(d)){d.apply()}}}else{alert("Error retrieving data")}}})}else{if(CacheObject.RecordType==RecordType.Community){var b="/reno/listings/communities/getlistinggroup.aspx?listingids="+a.join(",")+"&language="+SiteLang;$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:b,data:"{}",dataType:"jsonp",error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(g){if(g.ls&&g.ls.length>0){ListingGroupDATA=g;ListingGroupHTML+='<div id="lsdata-listing-wrap" class="hlisting sell offer">'+GetCommunityHtml(g.ls[0])+"</div>";if(g.ls.length>1){if(!isNaN(c)){c="Postal Code "+c}var f=new Object();for(var e=0;e<g.ls.length;e++){if(g.ls[e].psmn||g.ls[e].psmx){f.studio=true}if(g.ls[e].p1mn||g.ls[e].p1mx){f.one=true}if(g.ls[e].p2mn||g.ls[e].p2mx){f.two=true}if(g.ls[e].p3mn||g.ls[e].p3mx){f.three=true}if(g.ls[e].p4mn||g.ls[e].p4mx){f.four=true}}ListingGroupHTML+="<h3>"+g.ls.length+" Communities Mapped to "+c+"</h3>";ListingGroupHTML+='<ul class="table-header group"><li class="t-address">Address</li><li class="t-type">Type</li>';if(f.studio){ListingGroupHTML+='<li class="t-price">0bd</li>'}if(f.one){ListingGroupHTML+='<li class="t-price">1bd</li>'}if(f.two){ListingGroupHTML+='<li class="t-price">2bd</li>'}if(f.three){ListingGroupHTML+='<li class="t-price">3bd</li>'}if(f.four){ListingGroupHTML+='<li class="t-price">4bd</li>'}ListingGroupHTML+='</ul><div id="table-content">';for(var e=0;e<g.ls.length;e++){ListingGroupHTML+=GetCommunityGroupRow(g.ls[e],e,f)}ListingGroupHTML+="</div>";if(d!=undefined&&d!=null&&$.isFunction(d)){d.apply()}}}else{alert("Error retrieving data")}}})}else{var b="/reno/listings/salesrentals/getlistinggroup.aspx?listingids="+a.join(",")+"&language="+SiteLang;$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:b,data:"{}",dataType:"jsonp",error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(f){if(f.ls&&f.ls.length>0){ListingGroupDATA=f;ListingGroupHTML+='<div id="lsdata-listing-wrap" class="hlisting sell offer">'+GetListingGroupListingHTML(f.ls[0])+"</div>";if(f.ls.length>1){if(!isNaN(c)){c="Postal Code "+c}ListingGroupHTML+="<h3>"+f.ls.length+" Listings mapped to "+c+"</h3>";ListingGroupHTML+='<ul class="table-header group"><li class="t-address">Address</li><li class="t-price">Price</li><li class="t-bd">Bd</li><li class="t-ba">Ba</li><li class="t-sqft">Sqft</li><li class="t-type">Type</li></ul><div id="table-content">';for(var e=0;e<f.ls.length;e++){ListingGroupHTML+=GetListingGroupRow(f.ls[e],e)}ListingGroupHTML+="</div>";if(d!=undefined&&d!=null&&$.isFunction(d)){d.apply()}}}else{alert("Error retrieving data")}}})}}}function HighlightListingGroupListing(a){$(".lsgroup-row").each(function(){$(this).removeClass("selected")});$("#lsgroup-row-"+a).addClass("selected")}function SwitchListingGroupListing(b){var c=ListingGroupDATA.ls[b];var a=GetListingGroupListingHTML(c);$("#lsdata-listing-wrap").html(a);HighlightListingGroupListing(c.id)}function SwitchOffice(b){var c=ListingGroupDATA.ls[b];var a=GetOfficeHTML(c);$("#lsdata-listing-wrap").html(a);HighlightListingGroupListing(c.id)}function SwitchCommunity(b){var c=ListingGroupDATA.ls[b];var a=GetCommunityHtml(c);$("#lsdata-listing-wrap").html(a);HighlightListingGroupListing(c.id)}function GetOfficeHTML(b){this.JSonLS=b;var a=(this.JSonLS.elnk==undefined)?this.JSonLS.llnk:this.JSonLS.elnk;this.header="<div class='header'><h2 class='item'><a class='n' rel='bookmark' href='"+a+"'>"+this.JSonLS.anme+"</a></h2></div>";this.addr=this.JSonLS.add2.split(",");this.addr=String.Format("<span class='locality'>{0}, </span><span class='region'>{1}, </span><span class='postal-code'>{2}</span><div class='country'>{3}</div>",this.addr[0],this.addr[1],this.addr[2],this.addr[3]);this.address="<div class='street-address'>"+this.JSonLS.add1+"</div>"+this.addr;this.tel="<div class='tel'><span class='icon icon-mobile-on'></span><span id='cc-"+this.JSonLS.id+"' class='icon-text'>&#160;<a onclick='ClickToCall(\""+this.JSonLS.id+'","'+this.JSonLS.aphn+"\")'>Click To Call</a></span></div>";this.email=String.Format("<span class='icon icon-email'></span>&#160;<a class='icon-text' onclick='EmailBroker(\"{0}\",\"{1}\"); DoReport(\"{2}\",222)' class='icon-text'>Email</a>",this.JSonLS.id,this.JSonLS.arpt,this.JSonLS.arpt);this.photosrc=ImageProxyUrl(ImageProxyServer,IdClient,this.JSonLS.id,167,125,this.JSonLS.apho);this.photo=String.Format("<img id='THUM-{0}' class='photo' width='77' height='58' onerror='ImgProxyReloader(\"IPX_ListView\",this)' src='{1}' alt='Office {2} Photo'",this.JSonLS.id,this.photosrc,this.JSonLS.id);this.vcard="<div class='group vcard'><a class='logo' href='"+a+"'><img width='120' height='60' src='"+this.JSonLS.logo+"' alt='Office "+this.JSonLS.id+" Logo' onerror='ImgProxyReloader(\"IPX_ListViewAgentLogo\",this)' /></a><div class='group'>"+this.address+this.tel+this.email+"</div>"+this.photo+"</div>";return(this.header+this.vcard)}function GetOfficesTableHTML(e,d){var c=((d%2)==0)?"even":"odd";var b=(d==0)?" selected":"";this.JSonLS=e;this.addr=e.add1;this.name=e.anme;var a='	<tr class="lsgroup-row clearfix '+c+b+'" id="lsgroup-row-'+this.JSonLS.id+'" onclick="SwitchOffice('+d+')">		<td>'+this.name+"</td>		<td>"+this.addr+"</td>	</tr>";return a}function GetListingGroupListingHTML(i){DoReport(i.lrpt,126);var d="";var b=(i.prcedisp!=undefined&&i.prcedisp!="");if(b){d="<li class='price'>"+i.prcedisp}else{d="<li class='price'>"+i.prce;if(i.prcr==undefined){i.prcr=""}d+=" <em>"+i.prcr+"</em></li>";if(i.prcr!=""&&i.prcr!=i.plcr){d+="<li class='price'>"+i.ploc+" <em>"+i.plcr+"</em></li>"}}var c=(i.beds==undefined||i.beds==0)?"--":i.beds;var t=(i.bths==undefined||i.bths==0)?"--":i.bths;var e="";if(c!="--"&&t!="--"){e=String.Format("{0} BD / {1} BA",c,t)}else{if(c!="--"&&t=="--"){e=String.Format("{0} BD",c)}else{if(c=="--"&&t!="--"){e=String.Format("{0} BA",t)}}}var y=(i.sqft==undefined)?"--":(i.sqft==""||i.sqft==0)?"--":i.sqft;var p=(i.ptyp==undefined)?"--":i.ptyp;var r=(i.dom==undefined)?"--":(i.dom<=7)?"<b style='color:red'>NEW</b>":"Posted:"+i.dom+" days ago";var m=(i.pchg==undefined)?"--":(i.pchg<=0)?"<b>"+i.pchg+"%</b>":"<i>"+i.pchg+"%</i>";var g=(i.elnk==undefined)?"":'target="_external"';var a=(i.elnk==undefined)?i._llnk:i.elnk;var o='<a href="'+a+'" onclick="GoLstMap(\''+i.id+"','map')\" "+g+">";var w=0;if(i.phto!=undefined&&$.isArray(i.phto)&&i.phto.length>0){w=i.phto.length}var A="<ul class='tools'>	                    <li class='user-tools'>	                        <ul class='group'>	                            <li><a class='icon icon-folder-add' id='folico-"+i.id+"' title='Save Listing' onclick='SaveListing(\""+i.id+"\")'></a></li>	                        </ul>	                    </li>	                    <li class='listing-tools'>	                        <img alt='Listing Tools' src='/reno/custom/wrappers/common/images/1x1.gif' class='icon icon-cog' />	                        <ul>";if(i.flgv==1){A+="<li><img onclick='VideoOnDemand(\""+i.id+"\")' alt='VOD' src='/reno/custom/wrappers/common/images/1x1.gif' class='icon icon-film-strip' /></li>"}A+="<li><img onclick=\"MortgageCalc('"+d+"'); DoReport('"+i.lrpt.replace("'","\\'")+'\', 120)" alt="Mortagage Calcualtor" src="/reno/custom/wrappers/common/images/1x1.gif" class="icon icon-calculator" /></li>';A+='<li><a href="/listing/print-brochure/'+i.id+'" target="_PrintBrochure" onclick="DoReport(\''+i.lrpt.replace("'","\\'")+'\', 123)" alt="Print Brochure" src="/reno/custom/wrappers/common/images/1x1.gif" class="icon icon-print"></a></li>';if(i.vtor!=undefined&&trim(i.vtor).length>0){i.vtor=trim(i.vtor).toLowerCase();if(i.vtor.substring(0,3)=="www"){i.vtor="http://"+i.vtor}A+='<li><a href="'+i.vtor+'" target="_VirtualTour" onclick="DoReport(\''+i.lrpt.replace("'","\\'")+'\', 130)" alt="Virtual Tour" src="/reno/custom/wrappers/common/images/1x1.gif" class="icon icon-camera-black"></a></li>'}A+="<li><img onclick=\"EmailFriend('"+i.id+"', 'idlisting', '"+i.lrpt.replace("'","\\'")+"'); DoReport('"+i.lrpt.replace("'","\\'")+'\',113)" alt="Email Friend" src="/reno/custom/wrappers/common/images/1x1.gif" class="icon icon-email" /></li>';A+="</ul>	                    </li>	                </ul>";var v=(i.unit==undefined)?"":" ("+i.unit+")";var n='<div class="header adr">'+A+'<h2 class="item">'+o+i.add1+v+"</a></h2><div>"+i.add2+"</div></div>";var k="";var f="";var q;var z=Static+"/Reno/GlobalResources/Images/NoPhoto_150x118.jpg";var q;if(w==0){q=z}else{q=ImageProxyUrl(ImageProxyServer,IdClient,i.id,167,125,i.phto[0])}f='<div class="photo">'+o+'<img width="167" height="125" src="'+q+'" id="THUM-'+i.id+'" onerror="ImgProxyReloader(\'IPX_ListView\', this)" onload="THUMLoaded(\''+i.id+"')\"/></a>";if(w>1){ArrLImg[i.id]=new Array();for(var F=0;F<i.phto.length;F++){ArrLImg[i.id].push(ImageProxyUrl(ImageProxyServer,IdClient,i.id,167,125,i.phto[F]))}f+='<div class="thumb-pager clearfix">			            <div class="thumb-pager-bg"></div>			            <div class="thumb-pager-content">				            <a class="thumbs-next" onclick="THUMnext(\''+i.id+'\')"></a>				            <a class="thumbs-prev" onclick="THUMprev(\''+i.id+'\')"></a>				            <span id="thum-pgs-'+i.id+'">					            1 of '+w+"				            </span>			            </div>		            </div>"}f+="</div>";var h="--";if(y!="--"){h=y+" SqFt"}var s=" ";if(i.desc!=undefined&&trim(i.desc).length>0){s=i.desc}else{s="<br/><br/><br/><br/><br/>"}var G='<ul class="summary">'+d+"<li>"+c+" Bedrooms</li><li>"+t+" Bathrooms</li><li>"+y+" Sq. Ft.</li><li>"+p+"</li><li>"+r+"</li><li>"+o+" View Details &raquo;</a></li></ul>";var B='<div class="vcard">';if(i.algo!=undefined&&i.algo.length>0){var E="";i.algo=i.algo.replace("209.11.106.151","re.gabriels.net");var u=ImageProxyUrl(ImageProxyServer,IdClient,i.id,120,60,i.algo);if(i.alnk!=undefined&&i.alnk.length>0){E='<a class="org url" href="'+i.alnk+'" target="_advertiser" onclick="DoReport(\''+i.lrpt.replace("'","'")+'\', 507)"><img class="logo" id="Logo-'+i.id+'" src="'+u+'" width="120" height="60" border="0" onerror="ImgProxyReloader(\'IPX_ListViewAgentLogo\', this)"/></a>'}else{E='<img class="logo org" id="Logo-'+i.id+'" src="'+u+'" width="120" height="60" border="0" onerror="ImgProxyReloader(\'IPX_ListViewAgentLogo\', this)"/>'}B+=E}if(i.apho!=undefined&&i.apho.length>0){var j="";var l=ImageProxyUrl(ImageProxyServer,IdClient,i.id,50,65,i.apho);if(i.flga!=undefined&&i.flga==1){j+='<a class="photo url" onclick="DoReport(\''+i.lrpt.replace("'","'")+'\', 502)" href="/'+AgentDirectory_Root+"/"+i.aseo+'"><img id="agent-photo-id'+i.id+'" src="'+l+'" width="45" height="60" border="0" alt="'+i.anme+'" title="'+i.anme+'" onerror="ImgProxyReloader(\'IPX_ListViewAgentPhoto\', this)"/></a>'}else{j='<img class="photo" id="agent-photo-id'+i.id+'" src="'+l+'" width="45" height="60" border="0" alt="'+i.anme+'" title="'+i.anme+'" onerror="ImgProxyReloader(\'IPX_ListViewAgentPhoto\', this)"/>'}B+=j}if(i.anme!=undefined&&trim(i.anme).length>1){var D="";if(i.flga!=undefined&&i.flga==1){D='<a class="n url" onclick="DoReport(\''+i.lrpt.replace("'","'")+'\', 502)" href="/'+AgentDirectory_Root+"/"+i.aseo+'">'+i.anme+"</a>"}else{D='<span class="n">'+i.anme+"</span>"}B+=D}if(i.aphn!=undefined&&i.aphn!=""){B+='<span id="cc-'+i.id+'"><a class="tel" href="javascript:ClickToCall(\''+i.id+"', '"+i.aphn+"')\" onclick=\"DoReport('"+i.lrpt.replace("'","\\'")+'\', 116)"><span class="icon-img click-call"><trans_lang key="global:click to call" /></span></a></span>'}if(i.flge!=undefined&&i.flge==1){B+='<a class="email" href="javascript:EmailAgent(\''+i.id+"', 'idlisting', '"+i.lrpt.replace("'","\\'")+'\')"><trans_lang key="global:e-mail me" /></a>'}B+="</div>";var C='<div class="group">'+f+G+B+"</div>";C+="<script type='text/javascript'>PAGEshow();</script>";return n+C}function GetListingGroupRow(j,d){var g=((d%2)==0)?"even":"odd";var n=j.add1;var k=(j.unit==undefined)?"--":j.unit;var a=(j.prcedisp==undefined||j.prcedisp==0)?"":j.prcedisp.replace(/\$/g,"&#36;");if(a==""){a=(j.prce==undefined||j.prce==0)?"":j.prce.replace(/\$/g,"&#36;")}var m=(j.beds==undefined)?"--":j.beds;var l=(j.bths==undefined)?"--":j.bths;var h=(j.sqft==undefined)?"--":(j.sqft=="")?"--":j.sqft;var b=(j.ptyp==undefined)?"--":j.ptyp;var f=(j.dom==undefined)?"--":(j.dom<=7)?"<b>NEW</b>":j.dom;var c=(j.pchg==undefined)?"--":(j.pchg<=0)?"<b>"+j.pchg+"%</b>":"<i>"+j.pchg+"%</i>";var i=(d==0)?" selected":"";var e='	<ul class="lsgroup-row group '+g+i+'" id="lsgroup-row-'+j.id+'" onclick="SwitchListingGroupListing('+d+')">		<li class="t-address">'+n+'</li>		<li class="t-price">'+a+'</li>		<li class="t-bd">'+m+'</li>		<li class="t-ba">'+l+'</li>		<li class="t-sqft">'+h+'</li>		<li class="t-type">'+b+"</li>	</ul>";return e}function GetCommunityHtml(h){var i=(h.elnk==undefined)?h.llnk:h.elnk;var p=h.add2.split(",");p=String.Format("<span class='locality'>{0}, </span><span class='region'>{1}, </span><span class='postal-code'>{2}</span>",p[0],p[1],p[2]);var b="<div class='header adr'><ul class='tools'><li class='user-tools'><ul class='group'><li><a title='Save Community' id='folico-"+h.id+"' class='icon icon-folder-add' onclick='SaveCommunity(\""+h.id+"\")'></a></li></ul></li><li class='listing-tools'><img title='Email Friend' class='icon icon-email' src='/reno/custom/wrappers/common/images/1x1.gif' onclick='EmailFriend(\""+h.id+'","idCommunity","'+h.lrpt.replace("'","'")+'","'+i+"\")' /></li></ul><h2 class='item street-address'><a href='"+i+"' onclick='GoComMap(\""+h.id+'","map")\'>'+h.add1+"</a></h2>"+p+"</div>";var k=Static+"/Reno/GlobalResources/Images/NoPhoto_150x118.jpg",g=k;if(h.phto.length>0){g=ImageProxyUrl(ImageProxyServer,IdClient,h.id,167,125,h.phto[0])}var l="<a href='"+i+"' onclick='GoComMap(\""+h.id+'","map")\'>                    <img src=\''+g+"' height='125' width='167' id='THUM-"+h.id+"' alt='Listing "+h.id+" Thumbnail' onerror='ImgProxyReloader(\"IPX_ListView\", this)' onload='THUMLoaded(\""+h.id+"\")' />                </a>";if(h.phto.length>1){ArrLImg[h.id]=new Array();for(var o=0;o<h.phto.length;o++){ArrLImg[h.id].push(ImageProxyUrl(ImageProxyServer,IdClient,h.id,167,125,h.phto[o]))}l+='<div class="thumb-pager clearfix">			            <div class="thumb-pager-bg"></div>			            <div class="thumb-pager-content">				            <a class="thumbs-next" onclick="THUMnext(\''+h.id+'\')"></a>				            <a class="thumbs-prev" onclick="THUMprev(\''+h.id+'\')"></a>				            <span id="thum-pgs-'+h.id+'">					            1 of '+h.phto.length+"				            </span>			            </div>		            </div>"}var f="";if(h.ptyp){f+="<thead><tr><th colspan='2'>";if(h.ptyp.toLowerCase()=="single family"){f+="Single Family Homes"}else{if(h.ptyp.toLowerCase()=="condominium"){f+="Condominiums"}else{f+=h.ptyp}}f+="</th></tr></thead>"}f+="<tbody>";function c(r,t){var s;if(r&&t){s=r+"+"}else{if(r){s=r}else{if(t){s=t}}}return s}if(h.psmn||h.psmx){f+="<tr><td class='first-child'>0 bd</td><td class='price'>"+c(h.psmn,h.psmx)+"<em> "+h.prcr+"</em></td></tr>"}if(h.p1mn||h.p1mx){f+="<tr><td class='first-child'>1 bd</td><td class='price'>"+c(h.p1mn,h.p1mx)+"<em> "+h.prcr+"</em></td></tr>"}if(h.p2mn||h.p2mx){f+="<tr><td class='first-child'>2 bd</td><td class='price'>"+c(h.p2mn,h.p2mx)+"<em> "+h.prcr+"</em></td></tr>"}if(h.p3mn||h.p3mx){f+="<tr><td class='first-child'>3 bd</td><td class='price'>"+c(h.p3mn,h.p3mx)+"<em> "+h.prcr+"</em></td></tr>"}if(h.p4mn||h.p4mx){f+="<tr><td class='first-child'>4 bd</td><td class='price'>"+c(h.p4mn,h.p4mx)+"<em> "+h.prcr+"</em></td></tr>"}f+="</tbody>";var q="";if(h.algo!=undefined&&h.algo.length>0){var n="";h.algo=h.algo.replace("209.11.106.151","re.gabriels.net");var d=ImageProxyUrl(ImageProxyServer,IdClient,h.id,120,60,h.algo);if(h.alnk!=undefined&&h.alnk.length>0){n='<a class="org url" href="'+h.alnk+'" target="_advertiser" onclick="DoReport(\''+h.lrpt.replace("'","'")+'\', 507)"><img class="logo" id="Logo-'+h.id+'" src="'+d+'" width="120" height="60" border="0" onerror="ImgProxyReloader(\'IPX_ListViewAgentLogo\', this)"/></a>'}else{n='<img class="logo org" id="Logo-'+h.id+'" src="'+d+'" width="120" height="60" border="0" onerror="ImgProxyReloader(\'IPX_ListViewAgentLogo\', this)"/>'}q+=n}if(h.apho!=undefined&&h.apho.length>0){var e="";var j=ImageProxyUrl(ImageProxyServer,IdClient,h.id,50,65,h.apho);if(JSonLS.flga!=undefined&&JSonLS.flga==1){e+='<a class="photo url" onclick="DoReport(\''+h.lrpt.replace("'","'")+'\', 502)" href="/'+AgentDirectory_Root+"/"+h.aseo+'"><img id="agent-photo-id'+h.id+'" src="'+j+'" width="45" height="60" border="0" alt="'+h.anme+'" title="'+h.anme+'" onerror="ImgProxyReloader(\'IPX_ListViewAgentPhoto\', this)"/></a>'}else{e='<img class="photo" id="agent-photo-id'+h.id+'" src="'+j+'" width="45" height="60" border="0" alt="'+h.anme+'" title="'+h.anme+'" onerror="ImgProxyReloader(\'IPX_ListViewAgentPhoto\', this)"/>'}q+=e}if(h.anme){var m="";if(h.flga!=undefined&&h.flga==1){m='<a class="n url" onclick="DoReport(\''+h.lrpt.replace("'","'")+'\', 502)" href="/'+AgentDirectory_Root+"/"+h.aseo+'">'+h.anme+"</a>"}else{m='<span class="n">'+h.anme+"</span>"}q+=m}console.log(h.aphn);if(h.aphn){q+='<span id="cc-'+h.id+'"><a class="tel" href="javascript:ClickToCall(\''+h.id+"', '"+h.aphn+"')\" onclick=\"DoReport('"+h.lrpt.replace("'","\\'")+'\', 116)"><span class="icon-img click-call">click to call</span></a></span>'}if(h.flge){q+='<a class="email" href="javascript:EmailAgent(\''+h.id+"', 'idlisting', '"+h.lrpt.replace("'","\\'")+"')\">E-Mail Me</a>"}var a="<div class='group'>                    <div class='photo'>"+l+"</div>                    <table class='table summary'>"+f+"</table>                    <div class='vcard'>"+q+"</div>               </div>";a+="<script type='text/javascript'>PAGEshow();</script>";return(b+a)}function GetCommunityGroupRow(e,f,g){function a(h,k,i){var j="";if(h&&k){j=h+"+<span> "+e.prcr+"</span>"}else{if(h){j=h+"<span> "+e.prcr+"</span>"}else{if(k){j=k+"<span> "+e.prcr+"</span>"}}}return j}var d=((f%2)==0)?"even":"odd";var c=(f==0)?" selected":"";var b='	<ul class="lsgroup-row group '+d+c+'" id="lsgroup-row-'+e.id+'" onclick="SwitchCommunity('+f+')">		<li class="t-address">'+e.add1+'</li>		<li class="t-type">'+e.ptyp+"</li>";if(g.studio){b+="<li class='t-price'>"+a(e.psmn,e.psmx,e.prcr)+"</li>"}if(g.one){b+="<li class='t-price'>"+a(e.p1mn,e.p1mx,e.prcr)+"</li>"}if(g.two){b+="<li class='t-price'>"+a(e.p2mn,e.p2mx,e.prcr)+"</li>"}if(g.three){b+="<li class='t-price'>"+a(e.p3mn,e.p3mx,e.prcr)+"</li>"}if(g.four){b+="<li class='t-price'>"+a(e.p4mn,e.p4mx,e.prcr)+"</li>"}b+="</ul>";return b}var myPos,myZoom;function savePos(){myPos=map.getCenter();myZoom=map.getZoom()}function restorePos(){map.setCenter(myPos);map.setZoom(myZoom)};;$(function(){$.fn.qtip.styles.error={name:"red"};$.fn.qtip.styles.listingSave={name:"blue"};$.fn.qtip.styles.listingSaved={background:"#C2D979",color:"darkgreen",border:{color:"#A2D959"},name:"blue"};$.fn.qtip.styles.listingRemove={background:"#E5F6FE",color:"#99B7F5",border:{color:"#99B7F5"},name:"red"};$.fn.qtip.styles.listingRemoved={name:"red"};$.fn.qtip.styles.searchSave={name:"blue"};$.fn.qtip.styles.searchSaved={background:"#C2D979",color:"darkgreen",border:{color:"#A2D959"},name:"blue"};$.fn.qtip.styles.searchRemove={background:"#E5F6FE",color:"#99B7F5",border:{color:"#99B7F5"},name:"red"};$.fn.qtip.styles.searchRemoved={name:"red"}});$(function(){ReloadSavedListings()});var SavedListings=null;function ReloadSavedListings(e,d){if(e==null&&CacheObject!=null){e=CacheObject.ListingIds}if(d==null&&CacheObject!=null){d=CacheObject.Channel}if(e==null||d==null){return}var f="action=GetSavedItems";f+="&Channel="+escape(d);f+="&ListingIds="+escape(e.join(","));var c="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+f;var b=new Date();var a={ts:b.getTime()};SavedListings=null;$.get(c,a,function(h){try{$.event.trigger(RenoEvent.GetSavedItems);SavedListings=h;RefreshSavedListingsIcons(e,d,SavedListings);if(IsDetailsPhotoGalleryPage()){RefreshPhotoGallery()}else{if(IsDetailPage()){RefreshPrivatePhotos();RefreshPrivateNotes()}else{ReplaceThumbWithPrivatePhoto()}}}catch(g){console.log("~~~~~~~ PERSONALIZATION ERROR");console.log("Function: ReloadSavedListings");console.log("URL: "+c);console.log("Error: "+g.message);console.log("Details: ");alert("err:"+g.message)}})}function RefreshSavedListingsIcons(d,c,h){if(h==null){return}var b=RecordType.Listing;if(c=="sales-communities"||c=="rental-apartments"){b=RecordType.Community}var a=new Array();$(h).find("callstring").each(function(){a.push($(this).text())});for(var f=0;f<d.length;f++){var e=d[f];var g=(jQuery.inArray(e,a)>-1);ChangeListingSaveIcon(e,g,b,c)}}function EnsureChannel(a){if(a==null||a==""){a=$("#Channel").val();if((typeof(a)=="undefined")&&(typeof(CacheObject)!="undefined")&&(typeof(CacheObject.Channel)!="undefined")){a=CacheObject.Channel}}return a}function SaveListing(a,c){c=EnsureChannel(c);var d=String.format('SaveListing("{0}", "{1}");',a,c);AppendLastActionCookie(d);var f="listing";var e="type=SaveItem";e+="&entrytype="+escape(f);e+="&channel="+escape(c);e+="&callstring="+escape(a);var b="/Reno/MyPortfolio/AjaxCalls/SavedItemDialog.aspx?"+e;ShowDialog(b,0,0,VerifySaveEntryForm)}function SubmitSaveListing(a,c){var d="";d+="entrytype=listing";d+="&channel="+escape(c);d+="&callstring="+escape(a);d+="&openhousealert="+$("input[name=se_openhousealert]").is(":checked");d+="&pricereductionalert="+$("input[name=se_pricereductionalert]").is(":checked");d+="&enablealerts="+$("input[name=se_enable_email_alert]").is(":checked");d+="&action=save";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+d;var e=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(e=="success"){DoReport(null,226);CloseDialog();$.event.trigger(RenoEvent.Save);ChangeListingSaveIcon(a,true,RecordType.Listing,c);if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].content("Listing Saved");window[a+"_action_tip"].showOnNode(function(){this.content("Remove Listing");this.hide()},1500)}window.setTimeout(function(){ReloadSavedListings();RemoveAction(String.format('SaveListing("{0}", "{1}");',a,c));ExecuteLastAction()},2000)}else{if(e=="login"){Login()}else{DisplayModalError(e)}}}function EditListing(a,c){c=EnsureChannel(c);var d=String.format('EditListing("{0}", "{1}");',a,c);BuildLastActionCookie(d);var f="listing";var e="type=ModifyItem";e+="&entrytype="+escape(f);e+="&callstring="+escape(a);var b="/Reno/MyPortfolio/AjaxCalls/SavedItemDialog.aspx?"+e;ShowDialog(b,0,0,VerifySaveEntryForm)}function SubmitEditListing(a,c){var d="";d+="entrytype=listing";d+="&callstring="+escape(a);d+="&openhousealert="+$("input[name=se_openhousealert]").is(":checked");d+="&pricereductionalert="+$("input[name=se_pricereductionalert]").is(":checked");d+="&enablealerts="+$("input[name=se_enable_email_alert]").is(":checked");d+="&action=edit";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+d;var e=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(e=="success"){CloseDialog();$.event.trigger(RenoEvent.Edit);ChangeListingSaveIcon(a,true,RecordType.Listing,c);if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].content("Listing Updated");window[a+"_action_tip"].showOnNode(function(){this.content("Remove Listing");this.hide()},1500)}window.setTimeout(function(){ReloadSavedListings();RemoveAction(String.format('EditListing("{0}", "{1}");',a,c))},2000)}else{if(e=="login"){Login()}else{DisplayModalError(e)}}}function DeleteListing(a,c){c=EnsureChannel(c);var d=String.format('DeleteListing("{0}","{1}");',a,c);BuildLastActionCookie(d);var f="action=delete";f+="&EntryType=listing";f+="&CallString="+escape(a);var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+f;var g=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(g=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.Delete);RemoveAction(String.format('DeleteListing("{0}","{1}");',a,c));if(IsSavedListingsResult()){var e=NormalizeSEOQuery(CacheObject.SEOQuery).toLowerCase();if($("#expired-"+a).length){if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].remove()}ReloadExpiredList(e)}else{if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].remove()}ReloadList(e)}}else{ChangeListingSaveIcon(a,false,RecordType.Listing,c);if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].content("Listing Removed");window[a+"_action_tip"].showOnNode(function(){this.content("Save Listing");this.hide()},1500)}window.setTimeout(function(){ReloadSavedListings()},2000)}}else{if(g=="login"){Login()}else{if(typeof window[a+"_action_tip"]=="object"){window[a+"_action_tip"].remove()}}}}function SaveCommunity(a,c){c=EnsureChannel(c);var d=String.format('SaveCommunity("{0}","{1}");',a,c);AppendLastActionCookie(d);var e="";e+="entrytype=community";e+="&channel="+escape(c);e+="&callstring="+escape(a);e+="&action=save";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+e;var f=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(f=="success"){RemoveAction(d);CloseDialog();$.event.trigger(RenoEvent.Save);ChangeListingSaveIcon(a,true,RecordType.Community,c);if(typeof $("#folico-"+a).data("qtip")=="object"){$("#folico-"+a).qtip("destroy")}ShowToolTip("#folico-"+a,"listingSaved",CreateToolTipContent("listingSaved","Community Saved"));window.setTimeout(function(){ReloadSavedListings();ExecuteLastAction()},2000)}else{if(f=="login"){Login()}else{if(typeof $("#folico-"+a).data("qtip")=="object"){$("#folico-"+a).qtip("destroy")}ShowToolTip("#folico-"+a,"error",CreateToolTipContent("error",f))}}}function DeleteCommunity(a,c){c=EnsureChannel(c);var d=String.format('DeleteCommunity("{0}");',a);BuildLastActionCookie(d);var f="action=delete";f+="&EntryType=community";f+="&CallString="+escape(a);var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+f;var g=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(g=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.Delete);if(IsSavedListingsResult()){var e=NormalizeSEOQuery(CacheObject.SEOQuery).toLowerCase();if($("#expired-"+a).length){if(typeof $("#expired-"+a).data("qtip")=="object"){$("#expired-"+a).qtip("destroy")}ReloadExpiredList(e)}else{if(typeof $("#folico-"+a).data("qtip")=="object"){$("#folico-"+a).qtip("destroy")}ReloadList(e)}}else{ChangeListingSaveIcon(a,false,RecordType.Community,c);if(typeof $("#folico-"+a).data("qtip")=="object"){$("#folico-"+a).qtip("destroy")}ShowToolTip("#folico-"+a,"listingRemoved",CreateToolTipContent("listingRemoved","Community Removed"));window.setTimeout(function(){ReloadSavedListings()},2000)}}else{if(g=="login"){Login()}else{if(typeof $("#folico-"+a).data("qtip")=="object"){$("#folico-"+a).qtip("destroy")}ShowToolTip("#folico-"+a,"error",CreateToolTipContent("error",g))}}}function RefreshPrivateNotes(){if($("#saved_notes_data").length==0){return}if($(SavedListings).find("savedlisting").length==0){$("#saved_notes_data").hide();$("#saved_notes_data").html="";return}$(SavedListings).find("savedlisting").each(function(){RefreshPrivateNote(this)})}function RefreshPrivateNote(a){$("#saved_notes_data").overlay();var b=$(a).find("callstring").text();var c="/Reno/MyPortfolio/NotesPhotos/PrivateNotes.aspx?ListingId="+escape(b);$.ajax({type:"GET",url:c,data:"{}",error:function(e,d,f){$.overlay.die();$.log("Json Error Message: error("+f+') "'+d+'"')},success:function(d){if(d.trim()!=""){$("#saved_notes_data").html(d);$("#saved_notes_data").show()}else{$("#saved_notes_data").html("");$("#saved_notes_data").hide()}}})}function CancelNote(){$("#new_note_wrapper").hide();$(".edit-note").hide();$(".saved_note a").show();$("#addNoteBtn").show()}function AddNote(a){CancelNote();$("#addNoteBtn").hide();$("#new_note_content").val("");$("#new_note_wrapper").show()}function SaveNote(a,e){e=e.replace(/[^a-zA-Z 0-9]+/g,"");var c=String.format('SaveNote("{0}", "{1}");',a,e);BuildLastActionCookie(c);var d="CallString="+escape(a);d+="&title="+escape(e.trim());d+="&EntryType=listing";d+="&action=savenote";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+d;var f=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(f=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.SaveNote);CancelNote();ReloadSavedListings()}else{if(f=="login"){Login()}else{if(f=="savelisting"){SaveListing(a)}else{ClearLastActionCookie();alert(f)}}}}function EditNote(a){CancelNote();var b=$("#note_text"+a).text();$("#edit_note_content"+a).val(b);$("#note_text"+a).hide();$("#saved_note_wrapper"+a).show()}function UpdateNote(a,d,f){var c=String.format('EditNote("{0}", "{1}", "{2}");',a,d,f);BuildLastActionCookie(c);var e="callstring="+escape(a);e+="&noteid="+escape(d);e+="&title="+escape(f.trim());e+="&EntryType=listing";e+="&action=editNote";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+e;$.ajax({type:"GET",url:b,data:"{}",error:function(h,g,j){ClearLastActionCookie();$.log("Json Error Message: error("+j+') "'+g+'"')},success:function(g){if(g=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.EditNote);ReloadSavedListings()}else{if(g=="login"){Login()}else{ClearLastActionCookie();alert(g)}}}})}function DeleteNote(a,d){var c=String.format('DeleteNote("{0}", "{1}");',a,d);BuildLastActionCookie(c);var e="action=deletenote";e+="&CallString="+escape(a);e+="&NoteId="+escape(d);e+="&EntryType=listing";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+e;var f=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(f=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.DeleteNote);ReloadSavedListings()}else{if(f=="login"){Login()}else{ClearLastActionCookie();alert(f)}}}var MultiFileSelector=null;function RefreshPrivatePhotos(){if($(SavedListings).find("savedlisting").length==0){if(typeof(detailPageCarousel)!=="undefined"){detailPageCarousel.clearAllPrivateImages()}return}$(SavedListings).find("savedlisting").each(function(){var a=$(this).find("callstring").text();var b=new Array();$(this).find("privatephotos privateitem").each(function(){var c=$(this).find("url").text();if(c!=""){b.push(c)}});b.reverse();AddToCarousel(b,a)})}function RefreshPhotoGallery(){if((typeof(PhotoGallery)=="undefined")||(typeof(detailsPhotoArr)=="undefined")){return}PhotoGallery.Refresh(SavedListings)}function ReplaceThumbWithPrivatePhoto(){return}function CancelUpload(){$("#uploadForm").hide();$("#uploadForm input:file").remove();$("#selectedFiles").html("");$("#uploadForm #loading").hide();$("#addPhotosBtn").show()}function AddPhotos(){CancelUpload();if(a==null){var a=new MultiSelector(document.getElementById("selectedFiles"),3);$("#uploadForm").prepend('<input type="file" id="fileUploadElement">');a.addElement(document.getElementById("fileUploadElement"))}else{a.reset()}$("#addPhotosBtn").hide();a.reset();$("#uploadForm").show()}function Upload(){var b=String.format("Upload();");BuildLastActionCookie(b);var a=$("#uploadForm #CallString").val();$("#loading").ajaxStart(function(){$(this).show()}).ajaxComplete(function(){$(this).hide()});$.ajaxFileUpload({url:"/reno/myportfolio/notesphotos/uploadphoto.aspx?CallString="+escape(a),secureuri:false,formElementId:"uploadForm",dataType:"xml",success:function(e,d){if((typeof(e.error)=="undefined")&&(e.error!="")){var c=$(e).find("status:first").text();if(c=="success"){DisplayPhotosInCarousel(e);ClearLastActionCookie();CancelUpload();$.event.trigger(RenoEvent.SavePhoto)}else{if(c=="login"){Login()}else{if(c=="savelisting"){alert("Listing needs to be saved first!")}else{console.log("~~~~~~~ PERSONALIZATION ERROR");console.log("Function: Upload");console.log("URL: "+a);console.log("Error: "+e.error);console.log("Details: response received, but status cannot be determined");console.log("uploadStatus: "+c);console.log("data Status: "+d);alert("err: "+c);ClearLastActionCookie();CancelUpload()}}}}else{console.log("~~~~~~~ PERSONALIZATION ERROR");console.log("Function: Upload");console.log("URL: "+a);console.log("Error: "+e.error);console.log("Details: response received, but with error");console.log("data Status: "+d);console.log("data msg: "+e.msg);alert("data.msg: "+e.msg)}},error:function(f,d,c){ClearLastActionCookie();console.log("~~~~~~~ PERSONALIZATION ERROR");console.log("Function: Upload");console.log("URL: "+URL);console.log("Error: "+err.message);console.log("Details: error event");console.log("data: "+f);console.log("status: "+d);console.log("e: "+c);alert("data: "+f+"; status: "+d+"; e: "+c)}});return false}function DisplayPhotosInCarousel(d){var c=$(d).find("idlisting").text();var b="";var a=new Array();$(d).find("photo").each(function(){var e=$(this).find("status").text();if(e=="success"){a.push($(this).find("url").text())}else{b+="File: "+$(this).find("file").text()+"\n";b+="Reason: "+e+"\n\n"}});a.reverse();AddToCarousel(a,c);if(b!=""){alert("Some files could not be uploaded: \n\n"+b)}}function AddToCarousel(b,a){if(typeof(detailPageCarousel)==="undefined"||b.length==0){return}detailPageCarousel.prependImages(b,a);for(i=0;i<detailsPhotoArr.length;i++){b.push(detailsPhotoArr[i])}detailsPhotoArr=b;if(detailsPhotoArr.length>=1){$(".carousel .thumbs").show();$(".carousel .previous").show();$(".carousel .next").show();detailPageCarousel.refreshDeleteButtons()}else{$(".carousel .thumbs").hide();$(".carousel .previous").hide();$(".carousel .next").hide()}}function DeletePhoto(a,d){var c=String.format('DeletePhoto("{0}", "{1}");',a,d);BuildLastActionCookie(c);var e="action=deletephoto";e+="&CallString="+escape(a);e+="&PhotoUrl="+escape(d);e+="&EntryType=listing";var b="/Reno/MyPortfolio/AjaxCalls/SavedItemAction.aspx?"+e;var f=$.ajax({type:"GET",url:b,data:"{}",async:false}).responseText;if(f=="success"){ClearLastActionCookie();$.event.trigger(RenoEvent.DeletePhoto);if(IsDetailsPhotoGalleryPage()){if((typeof(PhotoGallery)=="undefined")||(typeof(detailsPhotoArr)=="undefined")){return}PhotoGallery.Remove(d)}else{if(IsDetailPage()&&(typeof(detailPageCarousel)!="undefined")){detailPageCarousel.removeImage(d);detailsPhotoArr=new Array();detailPageCarousel.$images.each(function(g){detailsPhotoArr.push($(this).attr("alt"))});if(detailsPhotoArr.length>=1){$(".carousel .thumbs").show();$(".carousel .previous").show();$(".carousel .next").show();detailPageCarousel.refreshDeleteButtons()}else{$(".carousel .thumbs").hide();$(".carousel .previous").hide();$(".carousel .next").hide()}}}}else{if(f=="login"){Login()}else{ClearLastActionCookie();alert(f)}}}function ShowToolTip(c,b,d){var a=$(c).qtip({style:{name:b,tip:"bottomLeft"},content:d,position:{corner:{target:"topRight",tooltip:"bottomLeft"}},show:{when:{event:"opentooltip"},ready:true,solo:true},hide:{when:{event:"closetooltip"}}});$(c).trigger("opentooltip");window.setTimeout(function(){$(c).trigger("closetooltip")},3500)}function CreateToolTipContent(a,b){return'<div><span class="icon icon '+a+'"></span><span class="icon-text">'+b+"</span></div>"}function ChangeListingSaveIcon(e,c,a,f){var d="#folico-"+e;var b=$(d);var h=$("#editli-"+e);var g=$("#LS"+e+" > .header");if(b.length==0){return}if(typeof window[e+"_action_tip"]!="object"){window[e+"_action_tip"]=new toolTip({node:b[0],content:b[0].title,tip:true,offset:{x:20,y:-10}})}if(c){b.removeClass("icon-folder-add");b.addClass("icon-folder-remove");if(a==RecordType.Community){b.attr("href","javascript:DeleteCommunity('"+e+"','"+f+"')");window[e+"_action_tip"].content("Remove Saved Community")}else{b.attr("href","javascript:DeleteListing('"+e+"','"+f+"')");window[e+"_action_tip"].content("Remove Saved Listing");h.removeClass("none")}g.addClass("saved")}else{b.removeClass("icon-folder-remove");b.addClass("icon-folder-add");if(a==RecordType.Community){b.attr("href","javascript:SaveCommunity('"+e+"','"+f+"')");window[e+"_action_tip"].content("Save Community")}else{b.attr("href","javascript:SaveListing('"+e+"','"+f+"')");window[e+"_action_tip"].content("Save Listing");h.addClass("none")}g.removeClass("saved")}}$(function(){SetIconToolTips()});function BuildIconToolTip(b,a){if(a==null){a="blue"}$(b).qtip({style:{name:a,tip:"bottomLeft"},position:{corner:{target:"topRight",tooltip:"bottomLeft"}},show:{delay:100,when:{event:"mouseover"}}})}function SetIconToolTips(){$(".tip.icon[title!='']").each(function(){new toolTip({node:this,content:this.title,tip:true,offset:{x:20,y:-10}})})};;CacheObject.doReloadMap=true;var CONST_RGX_RADIUS_CUSTOM=/(.+?)\/(\-?[0-9\.]+)\-(\-?[0-9\.]+)\-([0-9\.]+)\-radius(\/?.*)/i;var RadiusOpts=new Array();var RadiusCustom="";var RadiusOptionIndex=20;function ProcessRadiusOpts(a){var b=new Array();for(var c=0;c<a.length;c++){b.push(parseFloat(a[c].replace(" MILES","")))}return b}function BuildRadiusSelector(){if(!CONST_RGX_RADIUS_CUSTOM.test(window.location.href)){RadiusCustom=""}if(RadiusCustom!=""){RadiusCustom="/abc/"+RadiusCustom;var b=RadiusCustom.replace(CONST_RGX_RADIUS_CUSTOM,"$2");var a=RadiusCustom.replace(CONST_RGX_RADIUS_CUSTOM,"$3");RadiusCustom=b+"-"+a+"-"}$(function(){$("#distance_amount").text(RadiusOpts[RadiusOptionIndex]+" Miles");$("#distance-slider").slider({range:"min",min:0,max:RadiusOpts.length-1,step:1,value:RadiusOptionIndex,slide:function(d,c){$("#distance_amount").text(RadiusOpts[c.value]+" Miles")},stop:function(d,c){SwitchRadiusOption(RadiusCustom+RadiusOpts[c.value]+"-radius");RadiusOptionIndex=c.value}})})}function FlyOutSearch(b,a){b=NormalizeSEOQuery(b);$("input[name=check-"+a+"]").each(function(){b=b.replace($(this).val().toLowerCase(),"")});$("input[name="+a+"]:checked").each(function(){b+="/"+$(this).val().toLowerCase()});b=NormalizeSEOQuery(b);ReloadList(b);LoadFlyout("off","flyout-"+a)}function GetKeyword(){var a=$("#keyword").val();a=ReplacePotentiallyDangerous(a);a=trim(a);a=a.replace(/\s{1,}/gi," ");a=a.replace(/,/g," ");a=a.replace(/\s+/g," ");if(!ValidPhrase(a)){window.alert("Please wrap your keyword phrase in quotes.");return null}if(a.length==0){return""}return escape(a)}function ValidPhrase(b){if(b.indexOf('"')==-1){return true}var c=/^"/gi;var a=/"$/gi;if(b.match(c)&&b.match(a)){return true}return false}function ReplacePotentiallyDangerous(b){var a=/[^a-z0-9\s-,()\/\:'\&"]/gi;return b.replace(a,"")}$(function(){var a=/\/[^\/]+?\-keyword/g;if(a.test(CacheObject.SEOQueryRootSort)){var b=CacheObject.SEOQueryRootSort;var c=b.replace(/(.+?)\/([^\/]+?)\-keyword(.*)/g,"$2").trim();b=b.replace(/\/[^\/]+?\-keyword/g,"");$("#keyword").val(c);$("#keyword-rem").html('<a href="'+b+'">remove</a>')}$("#keyword").keydown(function(d){if(d.keyCode==13){return false}});$("#keyword").keyup(function(e){var d;if(window.event){d=e.keyCode}else{if(e.which){d=e.which}}switch(d){case 13:var g=GetKeyword();if(g.length>0){var f=CacheObject.SEOQueryRootSort;f=f.replace(/\/[^\/]+?\-keyword/g,"");f=f+"/"+g+"-keyword";window.location.href=f}break;default:break}return false})});var sqftmin=0;var sqftmax=10000;$(function(){if($("#SqFtRange").length==0){return}$("#SqFtRange").slider({orientation:"horizontal",range:true,min:sqftmin,max:sqftmax,step:1000,values:[SqFtMin,SqFtMax],slide:function(b,a){$("#SqFtRange-amount").text(""+FormatNumber(a.values[0])+" - "+GetMaxSqFt(a.values[1],0,true));$("#SqMRange-amount").text(""+FormatNumber(SqFeetToSqMeters(a.values[0]))+" - "+SqFeetToSqMeters(GetMaxSqFt(a.values[1],0,false)))},stop:function(b,a){var c=CacheObject.SEOQueryRootSqFt;if(a.values[0]!=sqftmin||a.values[1]!=sqftmax){c+="/"+a.values[0]+"-"+GetMaxSqFt(a.values[1],1)+"-sqft"}ReloadList(c)}}).addClass("handle");$("#SqFtRange-amount").text(""+FormatNumber($("#SqFtRange").slider("values",0))+" - "+GetMaxSqFt($("#SqFtRange").slider("values",1),0,true));$("#SqMRange-amount").text(""+FormatNumber(SqFeetToSqMeters($("#SqFtRange").slider("values",0)))+" - "+SqFeetToSqMeters(GetMaxSqFt($("#SqFtRange").slider("values",1),0,false)))});function GetMaxSqFt(c,a,b){if(a==0){if(c>=sqftmax){return"Max"}else{if(b){return FormatNumber(c)}else{return c}}}else{if(c>=sqftmax){return 1000000}else{return c}}}$(function(){if($("#PriceRange").length==0){return}$("#PriceRange").slider({orientation:"horizontal",range:true,min:0,max:PriceMinOpts.length-1,step:1,values:[GetPriceMinDefault(PriceMin),GetPriceMaxDefault(PriceMax)],slide:function(b,a){$("#PriceRange-amount").text(""+GetMinPrice(a.values[0],0).replace("Min","0")+" - "+GetMaxPrice(a.values[1],0))},stop:function(b,a){var c=GetPriceRoot()+"/"+GetMinPrice(a.values[0],1)+"-"+GetMaxPrice(a.values[1],1)+"-price";ReloadList(c)}}).addClass("handle");$("#PriceRange-amount").text(""+GetMinPrice($("#PriceRange").slider("values",0),0).replace("Min","0")+" - "+GetMaxPrice($("#PriceRange").slider("values",1),0))});function GetPriceRoot(){var a=CacheObject.SEOQuery;a=a.replace(/\/[^\/]+?\-price/i,"");a=a.replace(/\/[^\/]+?\-pg/i,"");return a}function GetMinPrice(b,a){if(a==0){return AddCurrencySymbol(PriceMinOpts[b][a])}else{return PriceMinOpts[b][a]}}function GetMaxPrice(b,a){if(a==0){if(PriceMaxOpts[b][a].toLowerCase()=="max"){return PriceMaxOpts[b][a]}else{return AddCurrencySymbol(PriceMaxOpts[b][a])}}else{return PriceMaxOpts[b][a]}}function GetPriceMinDefault(b){for(var a=0;a<PriceMinOpts.length;a++){if(parseFloat(b)<=parseFloat(PriceMinOpts[a][1])){return a}}return 0}function GetPriceMaxDefault(b){for(var a=PriceMaxOpts.length-1;a>=0;a--){if(parseFloat(b)>=parseFloat(PriceMaxOpts[a][1])){return a}}return PriceMaxOpts.length-1}$(function(){if($("#AcresRange").length==0){return}$("#AcresRange").slider({orientation:"horizontal",range:true,min:0,max:AcresMinOpts.length-1,step:1,values:[GetAcresMinDefault(Acres.Min),GetAcresMaxDefault(Acres.Max)],slide:function(b,a){$("#AcresRange-amount").text(""+GetMinAcres(a.values[0],0).replace("Min","0")+" - "+GetMaxAcres(a.values[1],0))},stop:function(b,a){var c=GetAcresRoot();if(GetMinAcres(a.values[0],1)!=parseFloat(AcresMinOpts[0][1])||GetMaxAcres(a.values[1],1)!=parseFloat(AcresMaxOpts[AcresMaxOpts.length-1][1])){c+="/"+GetMinAcres(a.values[0],1)+"-"+GetMaxAcres(a.values[1],1)+"-acre"}ReloadList(c)}}).addClass("handle");$("#AcresRange-amount").text(""+GetMinAcres($("#AcresRange").slider("values",0),0).replace("Min","0")+" - "+GetMaxAcres($("#AcresRange").slider("values",1),0))});function GetAcresRoot(){var a=CacheObject.SEOQuery;a=a.replace(/\/[^\/]+?\-acre/i,"");a=a.replace(/\/[^\/]+?\-pg/i,"");return a}function GetMinAcres(b,a){return AcresMinOpts[b][a]}function GetMaxAcres(b,a){return AcresMaxOpts[b][a]}function GetAcresMinDefault(b){for(var a=0;a<AcresMinOpts.length;a++){if(parseFloat(b)<=parseFloat(AcresMinOpts[a][1])){return a}}return 0}function GetAcresMaxDefault(b){for(var a=AcresMaxOpts.length-1;a>=0;a--){if(parseFloat(b)>=parseFloat(AcresMaxOpts[a][1])){return a}}return AcresMaxOpts.length-1}$(function(){if(SchoolDistrictsEnabled){if($("#school_districts").length>0){var b=CacheObject.SEOQuery;b=b.replace(/^(.+?)((?:\/[^\/]+?)-school-district)(.*)$/,"$1$3");var a="/reno/utility/GetSchoolDistricts.aspx";$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:a,data:"{}",cache:false,dataType:"jsonp",error:function(d,c,e){$.log("School districts failed to load")},success:function(c){if(c.length>0){var e=document.createElement("label");e.appendChild(document.createTextNode("School Districts"));var h=document.createElement("select");var d;var j;var g=-1;d=document.createElement("option");d.text="Any district";d.value="";h.options.add(d);for(var i=0;i<c.length;i++){j=c[i];d=document.createElement("option");d.text=j.Name;d.value=j.SEO;if(CacheObject.SEOQuery.indexOf(j.SEO)>-1){g=i+1}h.options.add(d)}var f=document.createElement("div");f.setAttribute("class","single-rule");f.appendChild(document.createElement("hr"));$("#school_districts").html("").append(e,h,f);if(g>-1){h.selectedIndex=g}$(h).change(function(){var k=NormalizeSEOQuery(b+"/"+$(this).val());ReloadList(k)})}}})}}});function JumpPrice(c,b){if($("#"+c+" :selected").val()==""||$("#"+b+" :selected").val()==""){window.alert("Please provide a minimum and maximum price");return}var a=parseFloat($("#"+c+" :selected").val());var e=parseFloat($("#"+b+" :selected").val());if(isNaN(a)||isNaN(e)){window.alert("Price values must not contain dollar sign, comma or decimal");return}if(e<=a){window.alert("Maximum price must be greater than minimum price");return}tb_remove();var d=CacheObject.SEOQueryRootPrice+String.Format("/{0}-{1}-price",a,e);ReloadList(d)}function ReloadExpiredList(SEOQuery){var ViewType=GetViewType(CacheObject.SEOQuery);var SearchType=GetSearchType(CacheObject.SEOQuery);if(SEOQuery=="#"||SEOQuery==""){return}if(SearchType=="map"||ViewType=="map"){ReloadListByMap(SEOQuery);return}$("#expired-result-list-wrap").fadeTo(50,0.33,function(){LoadingList("off",function(){var XMLPath=NormalizeSEOQuery(SEOQuery,"/xml-out");var XSLPath="/reno/myportfolio/xsl/Result_ExpiredSavedListings.xslt";var Params={eval:false,callback:function(){$("#expired-result-list-wrap").fadeTo(50,1,function(){SetIconToolTips()})}};$("#expired-result-list-wrap").getTransform(XSLPath,XMLPath,Params);XSLPath="/reno/widgets/video/FeaturedAgent/xsl/FeaturedAgent.xslt";Params={params:{layout:"vertical",CanonicalWebRoot:WebRoot,AgentDirectory_Root:AgentDirectory_Root},eval:false};$("#featured_agent_carousel").getTransform(XSLPath,XMLPath,Params)})});var NewQuery=NormalizeSEOQuery(SEOQuery.replace("xml-out",""));window.location.href="#"+NewQuery;CacheObject.SEOQuery=NewQuery}function ReloadList(SEOQuery,doRecenterMap){if(doRecenterMap==undefined){doRecenterMap=true}isLoading=true;if(GInfoWindow!=null){CloseGInfoWindow()}DYMClose();var ViewType=GetViewType(CacheObject.SEOQuery);var SearchType=GetSearchType(CacheObject.SEOQuery);if(SEOQuery=="#"||SEOQuery==""){return}if(SearchType=="map"||ViewType=="map"){isLoading=false;ReloadListByMap(SEOQuery);return}$("#result_list_wrapper").overlay({opacity:0.5});var XMLPath=NormalizeSEOQuery(SEOQuery,"/xml-out");var XMLDoc=$.xsl.load(XMLPath);var XSLPath="/reno/listings/salesrentals/xsl/result_listinglist_"+ViewType+"view.xslt";var FeaturedAgentXSLPath="/reno/widgets/video/FeaturedAgent/xsl/FeaturedAgent.xslt";var FeaturedListingXSLPath="/reno/widgets/video/FeaturedListing/xsl/FeaturedListing.xslt";var JavaScriptXSLPath="/reno/listings/salesrentals/xsl/result_javascript.xslt";if(ViewTypeXSLDoc==null){ViewTypeXSLDoc=$.xsl.load(XSLPath)}if(FeaturedAgentXSLDoc==null){FeaturedAgentXSLDoc=$.xsl.load(FeaturedAgentXSLPath)}if(FeaturedListingXSLDoc==null){FeaturedListingXSLDoc=$.xsl.load(FeaturedListingXSLPath)}if(JavaScriptXSLDoc==null){JavaScriptXSLDoc=$.xsl.load(JavaScriptXSLPath)}var Params={params:{LabelNewDaysLEQ:7,ListingsPerPage:10,StaticServer:Static,TopLevelSupported:SearchTopLevelSupported,ImageProxyServer:ImageProxyServer,ViewType:ViewType,CurrencyConversionEnabled:CurrencyConversionEnabled},eval:false,callback:function(){$("#result_list_wrapper").html($("#result_list_wrapper").html().replace(/&amp;amp;/g,"&").replace(/&amp;/g,"&"));SetupPagination();ReloadSavedListings();ActivateSearchType();if(SearchType=="location"){LoadMapRegionsForLocation("reload_list")}isLoading=false}};$("#result_list_wrapper").getTransform(ViewTypeXSLDoc,XMLDoc,Params);$("#JavaScriptWrap").getTransform(JavaScriptXSLDoc,XMLDoc,Params);PAGEshow();BuildIconToolTip(".icon[title!='']");Params={params:{layout:"vertical",CanonicalWebRoot:WebRoot,AgentDirectory_Root:AgentDirectory_Root,StaticServer:Static,ImageProxyServer:ImageProxyServer},eval:false};$("#featured_agent_carousel").getTransform(FeaturedListingXSLDoc,XMLDoc,Params);var NewQuery=NormalizeSEOQuery(SEOQuery.replace("xml-out",""));window.location.href="#"+NewQuery;CacheObject.SEOQuery=NewQuery;return XMLDoc}var ViewTypeXSLDoc=null;var FeaturedAgentXSLDoc=null;var FeaturedListingXSLDoc=null;var JavaScriptXSLDoc=null;function LoadingList(a,b){if(a=="on"){$("#loadingDialog").dialog({modal:true,autoOpen:true,title:null,width:150,height:45,draggable:false,resizable:false});$(".ui-dialog-titlebar").hide()}else{$("#loadingDialog").dialog("destroy")}if(b!=undefined){window.setTimeout(function(){b()},50)}}function CheckAct(a){var c=NormalizeSEOQuery(CacheObject.SEOQuery).toLowerCase();c=c.replace(/(\/[0-9]+\-pg)/,"");var b="/"+a.getAttribute("id").toLowerCase();if(c.indexOf(b)>-1){a.checked=false;c=c.replace(b,"")}else{a.checked=true;c=c+b}ReloadList(c)}function SelectAct(b,a){var c=NormalizeSEOQuery(CacheObject.SEOQuery).toLowerCase();c=c.replace(/(\/[0-9]+\-pg)/,"");c=(c+"/").replace("//","/");var d=new RegExp("\\/[^\\/]+\\-"+b,"g");if(d.test(c)){c=c.replace(d,"");while(d.test(c)){c=c.replace(d,"")}}if(a!=""){c+="/"+a}ReloadList(c)}function PAGEshow(){var a=$("div.hlisting div.photo");a.each(function(){$(this).hover(function(){$(this).find(".thumb-pager").stop(true,true).fadeIn(250)},function(){$(this).find(".thumb-pager").stop(true,true).fadeOut(250)})});$("div.hlisting ul.tools>li:last-child").hover(function(){$(">ul",this).show()},function(){$(">ul",this).hide()});var b=$("div.hlisting .view-toggle");b.each(function(c){this.sealed=true;this.index=c}).bind("click.toggleDescription",function(){b.prev().stop(true,false).slideUp();b.not(this).children().eq(0).removeClass("icon-minus-medium");$(this).prev().stop(true,false).slideToggle();$("span.icon",this).toggleClass("icon-minus-medium");if(this.sealed&&ListingMrkrs[this.index]!="false"){var e=new GMap3($(this).prev().find(".map")[0],{zoom:15,center:new GLatLng(ListingMrkrs[this.index][2],ListingMrkrs[this.index][3]),mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:false,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeControl:false,scaleControl:false});if(typeof(ListingIconModel.b)=="undefined"){reloadGMIcons()}var c=ListingIconModel;if(ListingMrkrs[this.index][6]==5){c=ZipIconModel;if(ListingMrkrs[this.index][8]=="New"){c=ZipIconModelNew}if(ListingMrkrs[this.index][8]=="Reduction"){c=ZipIconModelPR}if(ListingMrkrs[this.index][8]=="Open House"){c=ZipIconModelOH}}else{if(ListingMrkrs[this.index][8]=="Featured"){c=FeaturedIconModel}if(ListingMrkrs[this.index][8]=="New"){c=ListingIconModelNew}if(ListingMrkrs[this.index][8]=="Reduction"){c=ListingIconModelPR}if(ListingMrkrs[this.index][8]=="Open House"){c=ListingIconModelOH}}var d=new GMarker({position:e.getCenter(),icon:c,cursor:"inherit"});d.setMap(e);this.sealed=false}}).prev().hide()}$(function(){PAGEshow()});var ArrLImg=new Array();var ErrorImg=Static+"/Reno/GlobalResources/Images/NoPhoto_150x118.jpg";var ArrImgCurrentPos=new Array();function THUMshow(c,a){var b=ArrLImg[c][a];b=b.replace(/&amp;/gi,"&");$("#THUM-"+c).fadeTo(1,0.2);$("#THUM-"+c).attr("src",b);$("#thum-pgs-"+c).html(String.Format("{0} of {1}",a+1,ArrLImg[c].length))}function THUMprev(a){if(ArrImgCurrentPos[a]==null||ArrImgCurrentPos[a]==undefined){ArrImgCurrentPos[a]=0}else{ArrImgCurrentPos[a]-=1;$("#LS"+a+" .thumbs-next").css("display","block");if(ArrImgCurrentPos[a]<=0){ArrImgCurrentPos[a]=0;$("#LS"+a+" .thumbs-prev").css("display","none")}else{if(ArrImgCurrentPos[a]>0){$("#LS"+a+" .thumbs-prev").css("display","block")}}}THUMshow(a,ArrImgCurrentPos[a])}function THUMnext(a){if(ArrImgCurrentPos[a]==null||ArrImgCurrentPos[a]==undefined){ArrImgCurrentPos[a]=1}else{ArrImgCurrentPos[a]+=1;if(ArrImgCurrentPos[a]>=(ArrLImg[a].length-1)){ArrImgCurrentPos[a]=(ArrLImg[a].length-1);$("#LS"+a+" .thumbs-next").css("display","none")}else{if(ArrImgCurrentPos[a]<(ArrLImg[a].length-1)){$("#LS"+a+" .thumbs-next").css("display","block")}}}$("#LS"+a+" .thumbs-prev").css("display","block");THUMshow(a,ArrImgCurrentPos[a])}function THUMLoaded(a){$(".thumb-loader").hide();$("#THUM-"+a).fadeTo(1,1)}function THUMErr(a){$("#THUM-"+a).attr("src",ErrorImg);THUMLoaded(a)}var ListingReporting=new Array();$(function(){SetupPagination()});function SetupPagination(){$(".txtPager").each(function(){$(this).focus(function(){txtPagerTempVal=$(this).val();$(this).val("")});$(this).blur(function(){$(this).val(txtPagerTempVal)});$(this).keyup(function(a){if(a.keyCode==13){if(isNaN($(this).val())){return false}else{if(parseFloat($(this).val())>parseFloat(CacheObject.PageTotal)){$(this).val(CacheObject.PageTotal)}else{if(parseFloat($(this).val())<1){$(this).val("1")}else{if(trim($(this).val())==""){$(this).val("1")}}}}window.location.href=CacheObject.SEOQueryRootPage+((parseInt($(this).val())>1)?"/"+$(this).val()+"-pg":"")}return false});$(this).keydown(function(a){if(a.keyCode==13){return false}})})}function BuildSearchCookie(){var a=new SearchCookie(RecordType.Listing);a.Clear();a.SearchListingIds=CacheObject.ListingIds;a.SearchPage=CacheObject.Page;a.SearchPageTotal=CacheObject.PageTotal;a.SearchPerPage=CacheObject.PerPage;a.SearchSEOQuery=CacheObject.SEOQuery;a.SearchListingTotal=CacheObject.ListingTotal;a.SearchDetailIndex=CacheObject.DetailIndex;a.SearchLastViewType="";a.Save()}function MinimumOneAlert(a){window.alert("You must have at least one location for your search");$(a).attr("checked",true)};;var Map=null;var LoadResultsMapListings=function(){};var ListingMrkrs=new Array();var ListingBounds;$(document).ready(function(){ListingBounds=new GLatLngBounds()});var CrosshairControl;var isFirstLoad=true;var isLoading=true;var MapOptions;var minZoom=2;var maxZoom=14;$(function(){if(GetViewType(CacheObject.SEOQuery)=="list"){minZoom=1}MapOptions={zoom:8,scrollwheel:false,mapTypeId:google.maps.MapTypeId.ROADMAP,navigationControl:true,streetViewControl:false,scrollwheel:false,minZoom:minZoom,maxZoom:maxZoom,navigationControlOptions:{style:google.maps.NavigationControlStyle.DEFAULT},mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scaleControl:true}});var ensureBounds=function(){var b=Map.getBounds().getSouthWest();var c=Map.getBounds().getNorthEast();var a;if(c.lat()>85){a=new GLatLngBounds(b,new GLatLng(85,c.lng()));Map.fitBounds(a)}else{if(b.lat()<-85){a=new GLatLngBounds(new GLatLng(-85,b.lng()),c);Map.fitBounds(a)}}};$(function(){var b=GetSearchType(CacheObject.SEOQuery);var a=GetViewType(CacheObject.SEOQuery);if(GetViewType(CacheObject.SEOQuery)=="gallery"){return}if($("#result-map").length<=0){return}Map=new GMap3($("#result-map")[0],MapOptions);if(Map==null){return}GEvent.addListener(Map,"drag",function(){ensureBounds()});GEvent.addListener(Map,"dragend",function(){ensureBounds()});if(b!="map"){if(CacheObject.DefaultMapBounds!=null){ListingBounds=CacheObject.DefaultMapBounds;Map.fitBounds(ListingBounds)}else{Map.setCenter(new GLatLng(0,0),0)}}if(a=="map"){LoadMapViewData()}else{PostLoadMap()}});function DoRequeryOnMapBounds(b){if(!isFirstLoad){var a=0;if(b=="zoom_changed"){a=100}window.setTimeout(function(){var d=/(.+?)(\/[\(\)\-a-z0-9\.]+?\-(?:loc|map|center))(.*)/i;var e=/^\/([^\/]+?)\/([^\/]+?)\/(.*)$/i;var f=Map.getBounds();if(f!=null){var c=String.format("/{0}-{1}-{2}-{3}-map",(Math.round(f.getNorthEast().lat()*1000000)/1000000),(Math.round(f.getNorthEast().lng()*1000000)/1000000),(Math.round(f.getSouthWest().lat()*1000000)/1000000),(Math.round(f.getSouthWest().lng()*1000000)/1000000));var g=CacheObject.SEOQuery.replace(d,"$1$3/")+c;g=g.replace(/(.+?)(\/[0-9]+\-pg)(.*)/gi,"$1$3");ReloadListByMap(NormalizeSEOQuery(g+"/action-recenter"))}},a)}}var SelectedLocations=new Array();function LoadMapRegionsForLocation(a){if(Map==null){return}if(a=="zoom_changed"){Map_clearMarkers(MarkerCollection);MarkerCollection=new Array()}JSONUrl=String.Format("/reno/mapping/GetMapRegionsData.aspx?SEOQuery={0}&NorthEast={1}&SouthWest={2}&Zoom={3}",escape(CacheObject.SEOQuery),Map.getBounds().getNorthEast().toString().replace(/[\(\)]+/g,""),Map.getBounds().getSouthWest().toString().replace(/[\(\)]+/g,""),Map.getZoom());$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:JSONUrl,data:MarkerCollection.keys().join(","),dataType:"json",error:function(c,b,d){$.log("Json Error Message: error("+d+') "'+b+'"')},success:function(g){if(g.group&&g.group.length>0){CacheObject.SelectedLocations=new Array();$("input[name='selected-location']:checked").each(function(){CacheObject.SelectedLocations.push($(this).attr("id"))});for(var f=0;f<g.group.length;f++){var e=g.group[f].name;for(var d=0;d<g.group[f].option.length;d++){var b=g.group[f].option[d];if(MarkerCollection.keys().indexOf(b.valuegid)==-1){var c=GetRegionLocationMarker(b.value,b.count,b.valuegid,b.valuelatlng.split(",")[0],b.valuelatlng.split(",")[1],e);c.setMap(Map)}}}}else{}}})}var XSLDocListings=null;var XSLDocLocations=null;var JavaScriptXSLDoc=null;function ReloadListByMap(SEOQuery){if(isLoading==true){return}isLoading=true;SEOQuery=NormalizeSEOQuery(SEOQuery);var ViewType=GetViewType(SEOQuery);var SearchType=GetSearchType(SEOQuery);if(SEOQuery=="#"||SEOQuery==""){return}if(!document.all){$("#result-map").fadeTo(0,0.66)}LoadingList("off",function(){var XMLPath=NormalizeSEOQuery(SEOQuery,"/xml-out");var XSLPathListings="/reno/listings/salesrentals/xsl/result_listinglist_"+ViewType+"view.xslt";var XSLPathLocations="/reno/listings/salesrentals/xsl/result_locations.xslt";var JavaScriptXSLPath="/reno/listings/salesrentals/xsl/result_javascript.xslt";var Params={params:{LabelNewDaysLEQ:"7",ListingsPerPage:"250",StaticServer:Static,ViewType:ViewType,SearchType:SearchType,TopLevelSupported:SearchTopLevelSupported,CurrencyConversionEnabled:CurrencyConversionEnabled},eval:false,callback:function(){SetupPagination()}};var ParamsLocations={params:{LabelNewDaysLEQ:"7",ListingsPerPage:"250",StaticServer:Static,ViewType:ViewType,SearchType:SearchType,TopLevelSupported:SearchTopLevelSupported},eval:false,callback:function(){SetUpLocationSuggest();ActivateSearchType();$("#map_view_type_message").html("Displaying listings "+trim($("#location_names").html().replace(/^&nbsp;/,"")))}};var XMLDoc=$.xsl.load(XMLPath);if(XSLDocListings==null){XSLDocListings=$.xsl.load(XSLPathListings)}if(XSLDocLocations==null){XSLDocLocations=$.xsl.load(XSLPathLocations)}if(JavaScriptXSLDoc==null){JavaScriptXSLDoc=$.xsl.load(JavaScriptXSLPath)}$("#result_list_wrapper").getTransform(XSLDocListings,XMLDoc,Params);$("#search_by_location_wrapper").getTransform(XSLDocLocations,XMLDoc,ParamsLocations);$("#JavaScriptWrap").getTransform(JavaScriptXSLDoc,XMLDoc,Params);var NewQuery=SEOQuery.replace("/xml-out","");NewQuery=NewQuery.replace("/action-recenter","");NewQuery=NormalizeSEOQuery(NewQuery);window.location.href="#"+NewQuery;CacheObject.SEOQuery=NewQuery;if(Map==null){return}if(ViewType=="list"){PAGEshow()}if(ViewType=="map"){if(OverlaysOnMapCollection.length>0){for(var x=0;x<OverlaysOnMapCollection.length;x++){OverlaysOnMapCollection[x].setMap(null)}OverlaysOnMapCollection=new Array()}LoadMapViewData()}else{if(ViewType=="location"){PostLoadMap()}}})}function PostLoadMap(){try{if(Map==null){return}}catch(g){return}var c=GetSearchType(CacheObject.SEOQuery);var h=GetViewType(CacheObject.SEOQuery);var f=null;if(c=="radius"){var b=GetSearchRadius(CacheObject.SEOQuery);if(CacheObject.DefaultMapBounds!=null){f=CacheObject.DefaultMapBounds}else{f=PlotMarkersGetBounds(RecordType.Listing);if(f==null){Map.setCenter(new GLatLng(33,-33));f=Map.getBounds()}}var a;if(isCustomRadius(CacheObject.SEOQuery)){a=GetCustomRadiusCenter(CacheObject.SEOQuery)}else{a=f.getCenter()}f=DrawRadius(Map,a,b);PlotMarkersGetBounds(RecordType.Listing);if(isFirstLoad){Map.fitBounds(f);DrawRadiusSearchHelperControl(Map)}else{var d=new GLatLngBounds(Map.getBounds().getSouthWest(),Map.getBounds().getNorthEast());d=d.union(f);if(!d.equals(Map.getBounds())){Map.fitBounds(f)}}}else{if(c=="map"){PlotMarkersGetBounds(RecordType.Listing);if(isFirstLoad){f=GetGLatLngBoundsFromSEOQuery(CacheObject.SEOQuery);Map.fitBounds(f)}}else{f=PlotMarkersGetBounds(RecordType.Listing);if(CacheObject.TopLevelSupported=="international"){if(f==null||f.equals(new GLatLngBounds())){if(CacheObject.DefaultMapBounds!=null){Map.fitBounds(CacheObject.DefaultMapBounds)}else{var e=new GLatLngBounds(new GLatLng(-51.7696683322364,-146.5136715),new GLatLng(81.4821105945583,63.0175785));Map.fitBounds(e)}}else{if(CacheObject.doReloadMap){Map.fitBounds(f)}else{CacheObject.doReloadMap=true}}}else{if(f==null){f=CacheObject.DefaultMapBounds}if(CacheObject.doReloadMap){Map.fitBounds(f)}else{CacheObject.doReloadMap=true}}}}if(isFirstLoad&&c=="location"){window.setTimeout(function(){LoadMapRegionsForLocation("isFirstLoad")},1000)}if(c=="map"){if(isFirstLoad){GEvent.addListener(Map,"idle",function(){LoadMarkerManager(function(){GEvent.addListener(Map,"bounds_changed",function(){if(GInfoWindow==null&&!GJustClosed){if(RequeryTimer!=null){window.clearTimeout(RequeryTimer)}RequeryTimer=window.setTimeout(function(){DoRequeryOnMapBounds("bounds_changed");RequeryTimer=null},500)}else{window.setTimeout(function(){GJustClosed=false},5)}});GEvent.clearListeners(Map,"idle")})})}else{LoadMarkerManager()}}else{if(isFirstLoad){GEvent.addListener(Map,"idle",function(){if(c=="location"){GEvent.addListener(Map,"dragend",function(){LoadMapRegionsForLocation("dragend")});GEvent.addListener(Map,"zoom_changed",function(){LoadMapRegionsForLocation("zoom_changed")})}GEvent.clearListeners(Map,"idle")})}LoadMarkerManager()}if(isFirstLoad){window.setTimeout(function(){Map.setOptions({maxZoom:null})},1000)}isFirstLoad=false;isLoading=false;if(!document.all){$("#result-map").fadeTo(0,1)}}function GetIsLoadingStatus(){return isLoading}var MMgr=null;var RequeryTimer=null;function LoadMarkerManager(a){Map_clearMarkers(MarkersOnMapCollection_Last);MarkersOnMapCollection_Last=new Array();if(MarkersOnMapCollection.length>0){for(var b=0;b<MarkersOnMapCollection.length;b++){MarkersOnMapCollection[b].setMap(Map);MarkersOnMapCollection_Last.push(MarkersOnMapCollection[b])}MarkersOnMapCollection=new Array()}if(a!=undefined){a()}};;
