if(!MNP.Map||!MNP.Map.Maps){MNP.Map={loadVE:function(){if(!this.veLoaded){MNP.Util.writeScript(this.VEPath)}this.veLoaded=true},VEPath:MNP.mapApi||"http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1",Provider:[],Maps:[],StaticMaps:[]}}MNP.Map.Settings=function(){this.logballoon=false;this.VEPath=MNP.Map.VEPath;this.featuredListSize=3;this.propInfoUrl="/propertyinfo/{propertyKey}?ln=Map";this.cluster={radius:35.5};this.zoom={max:19,min:7,def:13};this.pan={tollerance:10,panLevel:70};this.list={autoPage:false};this.markers={delayStart:100};this.criteria=null;this.bounds={minLat:null,minLon:null,maxLat:null,maxLon:null};this.css={attach:function(A){var B=Object.extend({marker:"/css/map/marker4.css"},A||{});MNP.Util.attachCss(B.marker);this.css.attached=true}.bind(this)};this.setZoomBoundaries=function(B,A){if(A){this.zoom.max=A}if(B){this.zoom.min=B}};this.setIcons=function(A){this.icons=A};this.setCriteria=function(A){this.criteria=A};this.setBounds=function(D,A,B,C){if(D){this.bounds.minLat=D}if(A){this.bounds.minLon=A}if(B){this.bounds.maxLat=B}if(C){this.bounds.maxLon=C}};this.getMarkers=function(){if(!this.css.attached){this.css.attach()}if(this.markers){return this.markers}var A=function(F){var D=$("tmpmkr");if(!D){D=$E("div",{id:"tmpmkr",parentNode:this.mapEl})}var C;D.className="mnpmarker "+F;C=Element.getStyle(D,"background-image");if(C){var E=C.indexOf("/images/");C=C.substring(E,C.indexOf(")"));C=C.replace('"',"")}return C};var B={green:A("green"),green_hover:A("green-h"),gray:A("gray"),gray_hover:A("gray-h"),green_large:A("green-l"),gray_large:A("gray-l"),featured:A("featured"),featured_large:A("featured-l"),home:A("home"),home_large:A("home-l"),city:A("green")};if($("tmpmkr")){Element.hide("tmpmkr")}return B};this.interfaceElements={mapToggle:"maptoggle",paginationTop:"pg",paginationBottom:"pg",sortWidget:"sortwidget",propertyCount:"propertyCount",resultsTable:"results_table",searchForm:"searchCriteria"};return this};MNP.Map.Nav=function(){var l,R,U=5,C=18,Y,W,Z=0,P,j,d,F=this,a={},D;var c="closed";function A(){h("ZoomIn")}function J(){h("ZoomOut")}function b(o){h("SetZoomLevel",o)}function E(p,q,r,o){if(window.VELatLong){h("SetCenterAndZoom",new VELatLong(p,q),r)}else{h("SetCenterAndZoom",{lat:p,lon:q},r)}Z=1}function f(){document.location="/search?type=list"}function h(o,p,q){if(D){P=1;N(o,p,q)}}function m(o){Z=1;var p=Y[o];if(p){N("Pan",p[0],p[1])}}function S(o){N("SetMapStyle",o)}function N(q,p,o){MNP.Track.pageLink("Map_"+q,p);R[q](p,o);n()}function B(){n()}function V(u,t){if(G()){var p=$T("a",a[u]),r=R[t]();if(r){r=r.toString();for(var s=0,o=p.length;s<o;s++){var q=p[s],v=Q(q.href);if(v.param===r){Element.addClassName(q,"active")}else{Element.removeClassName(q,"active")}}}}}function n(){V("viewLinks","GetMapStyle");V("zoombar","GetZoomLevel")}function G(){if(l){return true}}function g(){if(G){l.hide()}}function k(o,r,q){R=r;l=$(o);if(l){l.style.display="block";O(l,"click",e);U=q.zoom.min;C=q.zoom.max;var s=q.pan.panLevel;Y={u:[0,-s],l:[-s,0],r:[s,0],d:[0,s]};W=$("nav_view_s");d=$("nav_zoombar");a.viewLinks=W;a.zoombar=d;B();n();var p=["nav_panup","nav_pandn","nav_panlt","nav_panrt"];X(p,"mouseover",M);X(p,"mouseout",L);D=true}}function T(o){D=true;R=o}function e(r){Event.stop(r);var q=Event.element(r);q.blur();var s=q.nodeName.toLowerCase();if(s!="a"&&s!="area"){q=Event.findElement(r,"a")}var o=q.href;if(o){var p=Q(o);if(p.func){MNP.Map.Nav[p.func](p.param)}}return false}function Q(o){var p=o.match(/\/\/(\w*)/)[1],q=o.match(/\#(\w*)/);if(q){q=q[1]}return{func:p,param:q}}function H(o){l=$(o);if(l){i()}}function i(){var r=["nav_dir","nav_zoom","nav_view"];for(var u=0;u<r.length;u++){var p=r[u],t=p+"_h",o=p+"_s",q=$(t);if(q){q.bid=o;if(MNP.Cache){O(q,"click",K.bind(F));var s=MNP.Cache.cGet(q.bid);if(s&&s=="false"){$(q.bid).hide();q.addClassName(c)}else{$(q.bid).show();q.removeClassName(c)}}}}}function K(r){var q=Event.findElement(r,"div"),p=$(q.bid);if(p){p.toggle();var o=p.visible();if(!o){q.addClassName(c)}else{q.removeClassName(c);if(q.id=="nav_zoom_h"){B()}}MNP.Cache.cSet(p.id,o)}}function M(o){I(o,1)}function L(o){I(o,0)}function I(r,q){var o=Event.element(r),s=Event.findElement(r,"div"),p="n";if(q){p=Q(o.href).param}s.className="hov-"+p}function X(p,s,r){for(var q=0;q<p.length;q++){var o=p[q];O(o,s,r)}}function O(o,q,p){Event.observe(o,q,p.bind(this))}return{create:H,init:k,Zoom:b,ZoomIn:A,ZoomOut:J,setView:S,Pan:m,setZoomInidicator:n,centerZoom:E,hideMap:f,hide:g,initBasic:T}}();MNP.Map.Marker={items:[],idMap:null,keyMap:null,shapes:[],shapesPKMap:null,newItems:null,markerMap:null,firstLoad:true,getByKey:function(A){if(!this.keyMap){this.keyMap=this._mapKeys()}return this.items[this.keyMap[A]]},getByProperty_id:function(A){if(!this.idMap){this.idMap=this._mapObj("property_id")}return this.items[this.idMap[A]]},getByMarkerId:function(B){if(!this.markerMap){this.markerMap=this._mapObj("id")}var C=this.markerMap[B];if(C==null){this.markerMap=this._mapObj("id");C=this.markerMap[B]}var A=this.items[C];if(A){return A}return this.getByShapeId(B)},getByShapeId:function(A){if(!this.shapesPKMap){this.shapesPKMap=this._mapShapes()}return this.items[this.shapesPKMap[A]]},isNew:function(A){return this.newItems[A]},add:function(A){this.items[this.items.length]=A},marker:function(A){return new MNP.Map.Marker.markerObject(A)},initNew:function(){this.newItems={}},_mapShapes:function(){var E={};var F=this.items;for(var C=0,B=F.length;C<B;C++){var D=F[C];var A=D.shape;if(A){var G=A.Primitives[0].iid;E[G]=C}}return E},_mapKeys:function(){var G={};var A=this.items;for(var E=0,D=A.length;E<D;E++){var C=A[E].property_id.split(",");for(var F=0,B=C.length;F<B;F++){G[C[F]]=E}}return G},_mapObj:function(D){var C={};var E=this.items;for(var B=0,A=E.length;B<A;B++){C[E[B][D]]=B}return C},resetMaps:function(){this.keyMap=null;this.markerMap=null;this.idMap=null;this.shapesPKMap=null},reset:function(){this.items=[];this.resetMaps()},fixIEPngs:function(){if(MNP.Browser.IE6){var A=this.items;for(var C=0,B=A.length;C<B;C++){this.fixIEPng(A[C])}}},fixIEPng:function(B){if(B.getId()&&!B.customIcon){var A=$(B.id);if(A){A.className="VEAPI_Pushpin "+B.style;if(B.icon&&!A.style.filter){A.style.background="none";A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B.icon+"', sizingMethod='image')"}}}},hoverIn:function(B,A){this._hoverOpts(A,this.hoverInAction)},hoverOut:function(B,A){this._hoverOpts(A,this.hoverOutAction)},_hoverOpts:function(B,C){var A=Object.extend({pk:null},B||{});if(A.pk){return C(this.getByKey(A.pk))}},hoverInAction:function(){},hoverOutAction:function(){}};MNP.Map.Marker.markerObject=Class.create();MNP.Map.Marker.markerObject.prototype={initialize:function(D,C,B){if(D){var F=(B?B:14);var E=function(J,H){if(!C.icons){C.icons=C.getMarkers()}var G=(!H)?J:J+"_"+H;var I=C.icons[G];return(!I)?C.icons.none:I};var A;D.property_id=D.id;this.lat=D.lat;this.lon=D.lon;this.title=D.title;this.style+=" "+D.style;this.type=D.style;this.property_id=D.id;this.size=F;if(D.cluster){this.content=D.cluster;this.cluster=D.cluster;this.customIcon=true}if(this.type=="city"){this.content=D.title;this.customIcon=true;this.showlabel=false;if(D.link){this.action=D.link}}if(this.size>=16){this.style+="-l large";A="large"}if(D.icon){this.icon=D.icon}else{this.icon=E(this.type,A)}if(D.url){this.url=D.url.replace("{propertyKey}",D.id)}this.zIndex="1500";if(this.type=="featured"){this.zIndex="2000"}if(this.type=="gray"){this.zIndex="1000"}this.persistInfo=false}},id:null,lat:null,lon:null,provider:null,nativeMarker:null,property_id:0,url:null,type:"green",customIcon:null,shape:null,icon:null,showlabel:true,style:"mnpmarker",persistInfo:true,getElInfo:function(C){if(!this._dim||!this.persistInfo){var A=$(this.getId());if(A){var D={};var E=Position.cumulativeOffset(A);var B=Element.getDimensions(A);D.top=E[1];D.left=E[0];D.height=B.height;D.width=B.width;this._dim=D}}return this._dim[C]},getUrl:function(){if(!this.url){this.url="/propertyinfo/"+this.property_id+"?ln=Map"}if(MNP.pn){this.url=this.url.addParam("pageSource",MNP.pn)}return this.url},getId:function(){if(!this.id){if(this.shape){this.id=this.shape.Primitives[0].iid}if(this.provider=="google"){this.id=MNP.Map.Provider.google.GetMarkerId(this.nativeMarker)}}return this.id}};MNP.Map.Popups={isMarkerVisibleArea:function(D,I){var C=D.getElInfo("top"),G=D.getElInfo("left"),F=D.getElInfo("height"),E,B;if(I&&I.mapEl){var H=I.mapEl;B=Position.cumulativeOffset(H);E=Element.getDimensions(H);if(G<B[0]){return }if(C<0){return }var A=getAbsoluteTop(I.mapParent||H.parentNode)+H.offsetTop;if((C+F)<=A){return }if(E){if(G>E.width+B[0]){return }if(C>E.height+B[1]){return }}}return[E,B]},_zoom:function(A){MNP.Map.Nav.centerZoom(marker.lat,marker.lon,12)},_getTitleWidth:function(B){var A=$("twca");if(!A){A=$E("a",{attributes:{href:"#",id:"twca"},parentNode:$E("div",{attributes:{id:"twc",className:"markerlabel"}})})}A.innerHTML=B;return getElWidth(A)+5}};MNP.Map.Label=function(K){var E=K;var N=this,F,C,D=false,G,P=180,J,I,R,S,V,L,T,H;N.oType="Label";function U(a){if(!a){return }F=a;M(F,1);var Z=F.getId();if(I){window.clearTimeout(I)}if(Z===C){return }if(!F.showlabel){return }if(Z!=C){C=Z;G=$(Z)}if(!G){return }if(J){window.clearTimeout(J)}if(!N.isMarkerVisibleArea.call(this,F,E)){return }var b=F.getElInfo("top");var h=F.getElInfo("left");var f=F.getElInfo("height");var c=F.getElInfo("width");var e=F.style;b+=f;var d=getWinWidth();var g=F.title;var Y=N._getTitleWidth(g)+c;S=A();S.style.height=f+"px";S.show();D=true;var X=L;var W=V;var i=h+c+Y+20;if(i>d){i=h+c;if(i>d){h=h-Y+c-(i-d)-10}else{h=h-Y+c}L.style.paddingRight=c+"px";L.style.paddingLeft=".5em";H.style.paddingRight=c+"px";H.style.paddingLeft=".5em";W.className=e+" setrt";W.style.left="";W.style.right="0"}else{L.style.paddingLeft=c+"px";L.style.paddingRight="0";H.style.paddingLeft=c+"px";H.style.paddingRight="0";W.className=e+" setlt";W.style.left="0";W.style.right=""}if(F.cluster){H.show();T.show();L.hide()}else{H.hide();T.hide();L.show();X.style.height=F.getElInfo("height")+"px"}S.style.width=Y+"px";S.style.top=b+"px";S.style.left=h+"px";L.innerHTML=g;T.innerHTML=g;L.href="#"+F.property_id;E.Infobox.close();MNP.UI.Popups.add(N.oType,M.bind(this))}function Q(X){Event.stop(X);var W=Event.element(X);W.blur();E.Infobox.show(F)}function M(X,W){if(D){if(X){if(X==F){return }}if(I){window.clearTimeout(I);I=null}I=window.setTimeout(function(){A().hide();D=false;MNP.UI.Popups.remove(this.oType)}.bind(this),W||1)}}function B(){MNP.Map.Nav.centerZoom(F.lat,F.lon,12)}function A(){if(!S){S=$E("div",{id:"markerLabel",className:"markerlabel",hide:true});S.style.left="-400px";V=$E("div",{parentNode:S,className:"beak",id:"markerLabelB"});var W=$E("div",{className:"lblinfo",parentNode:S});L=$E("a",{parentNode:W,id:"markerLabelS"});L.href="#";L=$(L);O(L,"click",Q);H=$E("a",{parentNode:W,id:"markerLabelZ",hide:true});H.href="#";O(H,"click",B);T=$E("span",{parentNode:H,id:"markerLabelF",text:"-"});T=$(T);H.appendChild(document.createTextNode("Zoom in to see these places"));S=$(S)}return S}function O(W,Y,X){Event.observe(W,Y,X.bindAsEventListener(N))}return{close:M,show:U}};MNP.Map.Label.prototype=MNP.Map.Popups;MNP.Map.Infobox=function(Q){var T=this,G=Q,K,A=0,B=false,L,U=390,a=84,V,e,R,b,N,M,D,W,c,J,F="",O="",f="infoboxiframe",E="infobox";function d(o,s){K=o;S(K,500);if(K&&!K.contentErr){if(K.type==="cluster"){return G.ToolTipLabel.show(K)}if(I()){J=s;var n=$("page").offsetWidth-20,l=K.getElInfo("top"),t=K.getElInfo("left"),r=K.getElInfo("height"),m=K.getElInfo("width"),g=c[1],p=c[0];F="";V=C();V.className=E;var i=t-(U/2)+(m/2);var k=l;var h=(U/2)-(a/2);if(g){if(i<g[0]){h-=(g[0]-i);if(h<25){h=t-g[0];F="left";O="align-"+F;Element.addClassName(V,O)}i=g[0]}}if(i+U>n){var j=(i+U)-n-(m/2);i-=j;h+=j;if(h>(U-a)){F="right";O="align-"+F;Element.addClassName(V,O);h-=a/2}}e.style.left=h+"px";if(D){D.transport.abort()}if(!K.content){if(G.staticContentPrefix){var q=$(G.staticContentPrefix+"_"+K.property_id);if(q){K.content=q.innerHTML;P(K,k,i)}}else{D=new MNP.Ajax.Request(K.getUrl(),{method:"get",onSuccess:function(u){K.content=u.responseText;K.content=K.content.replace("_"+K.property_id,"_"+K.property_id+"_info");P(K,k,i);D=null}.bind(this),onFailure:function(u){K.contentErr=1}.bind(this)})}}else{P(K,k,i)}MNP.UI.Popups.add(E,Z.bind(this));G.ToolTipLabel.close()}}else{S()}}function I(){var g=K.getId();if(M){window.clearTimeout(M);M=null}if(g===A){if(B){return }}if(g!=A){if(!K.showlabel){return }A=g;L=$(g)}if(!L){return }c=T.isMarkerVisibleArea.call(this,K,G);if(!c){return }if(Q.UI.isEnabled&&!Q.UI.isEnabled()){return }return true}function P(h,i,j){if(!h.contentErr){MnpEffect.Opacity(V,0);Element.show(V);W.innerHTML=h.content;var g=$C("rr",W)[0];if(g){g.pk=h.property_id;g.pkelid=g.id}i-=V.offsetHeight-10;if(i<getScrollTop()){i=X()}V.style.top=i+"px";V.style.left=j+"px";G.Label.close();MnpEffect.Opacity(V,1);B=true;H(V)}else{S()}}function X(){var g=K.getElInfo("top"),h=K.getElInfo("height");Element.removeClassName(V,O);O="align-top";if(F){O+="-"+F}Element.addClassName(V,O);return g+h}function Z(){S(null,null,1)}function S(i,g,h){if(i){if(i===K){return }else{K=i}}if(M){window.clearTimeout(M);M=null}if(J&&!h){return }M=window.setTimeout(function(){C().hide();if(MNP.Browser.IE){var j=$(f);if(j){Element.hide(j)}}B=false;MNP.UI.Popups.remove(E)}.bind(this),g||1)}function C(){if(!V){var i="div";var g=$E(i,{id:E,className:E,hide:true});var h=$E(i,{className:Y("content"),parentNode:g});W=$E(i,{className:Y("content-container"),parentNode:h});$E(i,{className:Y("content-bottom"),parentNode:h});e=$E(i,{parentNode:g,className:"beak",id:Y("beak")});if(window.Cons){Event.observe(W,"click",Cons.Plist.click.bindAsEventListener(Cons.Plist))}V=$(g)}return V}function Y(g){return E+"-"+g}function H(g){if(window.setHideFrame){setHideFrame(g,f)}}return{show:d,close:S}};MNP.Map.Infobox.prototype=MNP.Map.Popups;MNP.Map.ToolTipLabel=function(L){var E=L;var N=this,F,C,D=false,G,P=180,R=17,T=28,K=30,J,I,Q,S,A,H;N.oType="Label";function U(X){if(!X){return }F=X;M(F,1);var W=F.getId();if(I){window.clearTimeout(I)}if((W===C)&&D){return }if(!F.showlabel){return }if(W!=C){C=W;G=$(W)}if(!G){return }if(J){window.clearTimeout(J)}if(!N.isMarkerVisibleArea.call(this,F,E)){return }var Z=F.getElInfo("top");var f=F.getElInfo("left");var d=F.getElInfo("height");var a=F.getElInfo("width");var c=F.style;Z+=d;var b=getWinWidth()-20;var e=F.title;var V=N._getTitleWidth(e)+K;S=B();S.show();A.show();A.innerHTML=e;D=true;var g=f+V;if(g>b){f=f-V;f=f+T+(a/2);Element.addClassName(S,"align-right")}else{Element.removeClassName(S,"align-right");var Y=T-(a/2);f-=Y}S.style.width=V+"px";S.style.top=Z+"px";S.style.left=f+"px";E.Infobox.close();MNP.UI.Popups.add(N.oType,M.bind(this))}function M(W,V){if(D){if(W){if(W==F){return }}if(I){window.clearTimeout(I);I=null}I=window.setTimeout(function(){B().hide();D=false;MNP.UI.Popups.remove(this.oType)}.bind(this),V||1)}}function B(){if(!S){var W="div";S=$E(W,{className:"markertooltip",anonymous:true});S.style.left="-400px";var V=$E(W,{className:"lblinfo",par:S});$E(W,{par:S,className:"lpl-rcap"});$E(W,{par:S,className:"beak"});A=$E("span",{par:V});$T("body")[0].appendChild(S);O(S,"mousemove",M);S=$(S)}if(F.cluster){H="clustertooltip"}else{H="markertooltip"}S.className=H;return S}function O(V,X,W){Event.observe(V,X,W.bindAsEventListener(N))}return{close:M,show:U}};MNP.Map.ToolTipLabel.prototype=MNP.Map.Popups;var mnpMsMap=Class.create();mnpMsMap.prototype={Marker:MNP.Map.Marker,Label:null,Dimensions:null,map:null,mapEl:null,mapParent:null,props:[],veLatLongArr:null,pinID:1,pinPrefix:"mnppin",enabled:false,icons:null,markers:null,markersItr:0,settings:null,finish:[],finishItr:0,curFin:0,initialize:function(B,A){this.UI.parentObj=this;this.Events.parentObj=this;this.Label=new MNP.Map.Label(this);this.ToolTipLabel=new MNP.Map.ToolTipLabel(this);this.Infobox=new MNP.Map.Infobox(this);this.veLatLongArr=[];this.markers=[];this.init(B,A)},dimensions:{getSize:function(A,B){var C={width:B.offsetWidth,height:B.offsetHeight};this[A]=C;return C},map:null,mapParent:null},init:function(D){this.options=Object.extend({defaultId:"map",latitude:"39.0000",longitude:"-98.0000",zoom:4,style:"r",mode:1,showSwitch:true,showBalloon:true,fixed:false,slide:true,resize:false,listArea:"plistcol",listEl:"results_table",pageContentArea:"content",mapFooter:"map_footer",mapHeader:"map_header",bounds:null,scrollList:false,settings:null},arguments[1]||{});var C=this.options;if(D==""||D=="null"){D=C.defaultId}C.id=D;this.enabled=true;var B=$(C.id);if(B){MNP.Util.attachCss("/css/map/map.css");this.settings=(C.settings!=null)?C.settings:new MNP.Map.Settings();B.style.width=Element.getStyle(B,"width");B.style.height=Element.getStyle(B,"height");this.dimensions.getSize("map",B);this.mapEl=B;this.options.mapFooter=$(this.options.mapFooter);this.options.mapHeader=$(this.options.mapHeader);this.options.pageContentArea=$(this.options.pageContentArea);var A=$("map_column");if(!A){this.mapParent=this.mapEl.parentNode}else{this.mapParent=A.parentNode}if(this.options.pageContentArea){this.mapParent=this.options.pageContentArea}if(C.slide&&!C.scrollList){this._initResize();this.addToFinish(this._initScroll.bind(this),11)}else{if(C.resize){this._initResize()}}Element.addClassName(B,"mapani");if(C.scrollList){this.listArea=C.listArea;this.footerArea="mnpfooter";this.listEl=C.listEl;this.Dimensions=new MNP.Map.Dimensions(this,this.listArea,this.footerArea,this.listEl,C.id);this._initScrollList($(this.listEl))}this.addToFinish(function(){MNP.Map.Nav.create("nav_dashboard")}.bind(this),5)}},nomap:function(){return false},show:function(){var D=this.options;try{this.map=new VEMap(D.id);this.map.SetClientToken(D.token)}catch(F){return this.nomap()}var E=new VELatLong(D.latitude,D.longitude);var C=this.UI;var B=this.mapEl;var A=this.map;A.HideDashboard();if(window.VEMapOptions){VEMapOptions.EnableBirdseye=false;A.LoadMap(E,D.zoom,D.style,D.fixed,D.mode,false,0)}else{A.LoadMap(E,D.zoom,D.style,D.fixed,D.mode,false,0)}A.AttachEvent("onmousewheel",returnTrue);A.AttachEvent("onmouseover",returnTrue);A.AttachEvent("onstartzoom",C.reset.bind(C));A.AttachEvent("onstartpan",C.reset.bind(C));this.addToFinish(function(){if(isMSIE6){A.AttachEvent("onendpan",this._fixIEPngs.bind(this));A.AttachEvent("onendzoom",this._fixIEPngs.bind(this));A.AttachEvent("onchangeview",this._fixIEPngs.bind(this))}A.AttachEvent("onendpan",C.drag.bind(this));MNP.Map.Nav.init("nav_dashboard",A,this.settings);if(D.showBalloon){Event.observe(B,"mouseover",C.mouseover.bindAsEventListener(C))}Event.observe(B,"mouseout",C.mouseout.bindAsEventListener(C));Event.observe(B,"mousewheel",C.mousescroll.bindAsEventListener(C));Event.observe(B,"DOMMouseScroll",C.mousescroll.bindAsEventListener(C));if(D.showBalloon){Event.observe(B,"click",C.click.bindAsEventListener(C))}Event.observe(B,"dblclick",C.dblclick.bindAsEventListener(C));MNP.Map.Marker.hoverInAction=this.Events.mouseover.bind(this.Events);MNP.Map.Marker.hoverOutAction=this.Events.mouseout.bind(this.Events)}.bind(this),10);if(MNP.Browser.FF){Event.observe(window,"unload",function(){window.scrollBy(0,-1)}.bind(this))}},_fixIEPngs:function(){setTimeout(this.Marker.fixIEPngs.bind(this.Marker),200)},centerZoomMap:function(){var A=this.options.bounds;if(!A){A=this.markers}var B=this.addMarkersToLatLong(A);if(B.length>1){this.map.SetMapView(B)}else{this.map.SetCenter(B[0],B[1])}if(this.map.GetZoomLevel()>15){this.map.SetZoomLevel(15)}},addMarker:function(A){this.markers[this.markers.length]=Object.extend({lat:null,lon:null,style:"green",url:this.settings.propInfoUrl},A||{});this.markersItr++},addMarkers:function(B){for(var A=0;A<B.length;A++){this.addMarker(B[A])}},addMarkersToLatLong:function(B){var E=B.length;var D=this.veLatLongArr;for(var C=0;C<E;C++){var A=B[C];A.latlong=new VELatLong(A.lat,A.lon);D[D.length]=A.latlong}return D},addMarkersToMap:function(){var A=[];function C(F,E){var H=F.lon*-1;var G=E.lon*-1;if(H>G){return 1}if(H<G){return -1}return 0}this.markers.sort(C);for(var B=this.markersItr-1;B>=0;B--){var D=this._add(this.markers[B]);this.Marker.add(D);A[A.length]=D.shape}this.shapes=A},_add:function(B){if(!B){return }if(!B.lat||!B.lon){return }B=new MNP.Map.Marker.markerObject(B,this.settings);var A=new VEShape(VEShapeType.Pushpin,new VELatLong(parseFloat(B.lat),parseFloat(B.lon)));A.IconUrl=B.icon;A.pk=B.property_id;if(B.customIcon){A.SetCustomIcon("<div class='"+B.style+"'><span>"+B.content+"</span></div>")}B.shape=A;return B},complete:function(){if(this.enabled){if(!this.isVELoaded()){if(!window.mnpLoadingVE){var A=[];window.mnpLoadingVE=1;A.push(this.settings.VEPath);LazyLoad.js(A,this.complete.bind(this))}else{if(window.mnpLoadingVE<35){window.mnpLoadingVE++;window.setTimeout(this.complete.bind(this),1000)}else{this._complete()}}}else{this._complete()}}},isVELoaded:function(){if(!window.VELatLong){return }if(MNP.Browser.FF){try{if(!window.Web.Browser._isMozilla){return }}catch(A){return }}return true},_complete:function(){this.show();if(this.map){this.centerZoomMap();this.addToFinish(this.addMarkersToMap,3);this.addToFinish(function(){this.map.AddShape(this.shapes)},4);if(isMSIE6){this.addToFinish(function(){this.Marker.fixIEPngs()},6)}this.addToFinish(this.Marker.resetMaps,5);this.addToFinish(function(){if(window.Cons){Cons.Plist.attachMap(this)}if(this.options.afterFinish){this.options.afterFinish()}},11);window.setTimeout(this.runFinish.bind(this),100);MNP.Cache.cSet("ve",1)}},runFinish:function(){var B=this.finish;if(!this.curFin){function A(D,C){if(D.o>C.o){return 1}if(D.o<C.o){return -1}return 0}B.sort(A)}if(this.curFin<this.finishItr){B[this.curFin].f.call(this);this.curFin++;window.setTimeout(this.runFinish.bind(this),100)}},addToFinish:function(B,A){this.finish[this.finishItr]={f:B,o:A||0};this.finishItr++},_initScroll:function(){if(!this.dimensions.mapParent){this.dimensions.getSize("mapParent",this.mapParent)}Event.observe(window,"scroll",this._scroll.bindAsEventListener(this));this._scroll()},_scroll:function(){if(this.mscrltm){window.clearTimeout(this.mscrltm)}this.mscrltm=window.setTimeout(this._slide.bind(this),500)},_slide:function(){var J=0;var C=getScrollTop();var D=this.mapEl;var I=$("nav_dashboard");var G=this.dimensions.mapParent.height;var H=this.dimensions.map.height;var F=this.options.mapFooter;if(F){H+=F.offsetHeight+20}var A=this.options.mapHeader;if(A){H+=A.offsetHeight}var K=getAbsoluteTop(this.mapEl.parentNode);if(C<K){C=0}else{C-=K}var B=C+H;if(B>=G){C=G-H}if(C<0){C=1}C+="px";var E=D.style.marginTop;if(E!=C){J=1}D.style.marginTop=C;I.style.marginTop=C;window.setTimeout(this._resizeForce.bind(this),200);if(J){this.UI.reset(this)}this.mscrltm=null},_initResize:function(){var A=$(this.options.listEl);if(A){this.dimensions.getSize("plist",A);Event.observe(window,"resize",this._resize.bindAsEventListener(this));this._resizeForce()}else{this.options.resize=null}},_resize:function(E){this.dimensions.getSize("mapParent",this.mapParent);var H=this.dimensions.mapParent.width-this.dimensions.plist.width-10;this.mapEl.style.width=H+"px";var J=this.dimensions.map.height;var G=getScrollTop();var K=getAbsoluteTop(this.mapEl.parentNode);var I=this.dimensions.mapParent.height;var C=getWinHeight();if((C==window.curWinHeight)&&(window.curScrollTop==G)&&E){return }var D;var B=0;if(G<K){B=K-G}D=C-B;if(this.options.mapFooter){D-=this.options.mapFooter.offsetHeight+10}if(D>=I){D-=(D-I)}var F=getAbsoluteTop(this.mapEl)-getAbsoluteTop(this.mapParent);var A=F+D;if(this.options.mapHeader){A+=this.options.mapHeader.offsetHeight}if(A>I){D-=(A-I)}if(D<300){D=300}this.mapEl.style.height=D+"px";this.dimensions.map.height=D;this.dimensions.map.width=H;if(D!=J){if(this.map){this.map.Resize(this.dimensions.map.width,this.dimensions.map.height)}this.UI.reset(this)}window.curWinHeight=getWinHeight();window.curScrollTop=G},_initScrollList:function(A){A=$(A);if(A){A.addClassName("isScroller");var C=$("bxc");if(C){C.style.minHeight="0";C.style.height="auto"}var B=$("pagination2");if(B){this.Dimensions.listEl.appendChild(B)}this.resizeMapHelper(true);Event.observe(window,"resize",this._resizeMapReset.bindAsEventListener(this))}},_resizeForce:function(){this._resize(1)},UI:{parentObj:null,mouseover:function(C){var B=this._getEl(C);if(B){var A=MNP.Map.Marker.getByShapeId(B.id);this.parentObj.Events.mouseover(A)}},mouseout:function(A){this.parentObj.Events.mouseout()},click:function(C){var B=this._getEl(C);if(B){var A=MNP.Map.Marker.getByShapeId(B.id);if(A){this.parentObj.Infobox.show(A,1)}}},dblclick:function(A){MNP.Track.link("Map_DblClick")},drag:function(A){if(A.clientX&&(A.clientX!==0)){MNP.Track.link("Map_Drag")}},mousescroll:function(B){var A=this._mouseWheelDelta(B);var C=0;if(A>0){C=-35}else{if(A<0){C=35}}window.scrollBy(0,C)},_mouseWheelDelta:function(A){var B=0;if(!A){A=window.event}if(A.wheelDelta){B=A.wheelDelta;if(window.opera){B=-B}}else{if(A.detail){B=-A.detail}}return Math.round(B)},_getEl:function(C){try{var A=Event.element(C);if(A.nodeName=="svg"){return }if(A.isVEMarker){return A}if(!A.markerId){var B=getParentByClassName(A,"VEAPI_Pushpin");if(B){A.markerId=B.id;B.isVEMarker=true}else{return false}}return $(A.markerId)}catch(D){}},reset:function(){this.parentObj.Label.close(0);this.parentObj.Infobox.close(null,null,1)}},Events:{parentObj:null,mouseover:function(A){this.parentObj.ToolTipLabel.show(A)},mouseout:function(A){this.parentObj.ToolTipLabel.close(A,10)}},resizeMapHelper:function(F){var E=this.mapEl;var D=getElWidth(E);var B=getElHeight(E);var C=this.Dimensions.areaWidth();var A=this.Dimensions.areaHeight();E.style.height=A+"px";E.parentNode.style.height=A+"px";E.style.width=C+"px";if(Math.abs(D-C)>15||Math.abs(B-A)>15){if(this.map){this.map.Resize(C,A)}this.Label.close()}if(F==true){if(this.map){E.style.height=A+"px";E.parentNode.style.height=A+"px";E.style.width=C+"px";this.map.Resize(C,A)}this.Label.close()}setTimeout(this.setupMapControls.bind(this),100)},_resizeMapReset:function(){this.Dimensions.setArea();this.resizeMapHelper()},setupMapControls:function(){var B=this.Dimensions;var A=B.areaHeight();B.listArea.style.height=A+"px";if(A>B.listEl.offsetTop){B.listEl.style.height=(A-B.listEl.offsetTop)+"px"}}};MNP.Map.Dimensions=Class.create();Object.extend(MNP.Map.Dimensions.prototype,{initialize:function(C,B,A,E,D){this.parentObj=C;this.listArea=$(B);this.footerArea=$(A);this.listEl=$(E);this.mapArea=$(D)},parentObj:null,footerArea:null,listArea:null,listEl:null,mapArea:null,topLeft:function(){return map.GetMapView().TopLeftLatLong},bottomRight:function(){return map.GetMapView().BottomRightLatLong},areaWidth:function(){if(!this.aw){this.setArea()}return this.aw},areaHeight:function(){if(!this.ah){this.setArea()}return this.ah},setArea:function(){var C=0;var B=this.parentObj;var D=getElWidth(this.mapArea.parentNode);if(this.listArea){if(Element.visible(this.listArea)){C=getElWidth(this.listArea)}}this.aw=D-C;var A=getWinHeight()-(getAbsoluteTop(this.mapArea)+5)-this.footerArea.clientHeight-2;if(A<300){A=300}this.ah=A}});function returnTrue(){return true}if(MNP.Browser.Saf){MNP.Map.loadVE()};