LMI.Listings=(function(){var G,H={};function D(){return G}function C(I,J){if(!(I in H)){H[I]={}}if(!(J in H[I])){H[I][J]=LMI.Lang.filter(G,function(K){return K[I]===J})}return H[I][J]}function F(I){return C("id",I)[0]}function A(I){G.push(I);for(o in H){if(o in I){for(p in H[o]){if(I[o]==p){H[o][p].push(I)}}}}}function E(){G=[];H={}}function B(K){var J=F(K),I;if(J){for(o in H){if(o in J){for(p in H[o]){if(J[o]==p){for(I=0;I<H[o][p].length;I++){if(H[o][p][I]==J){H[o][p].splice(I,1);break}}}}}}for(I=0;I<G.length;I++){if(G[I]==J){G.splice(I,1);break}}}}LMI.Init.addFunction(function(){if("listings" in LMI.Data){G=LMI.Data.listings}else{G=[]}},30);return{getListings:D,getListingsByProperty:C,getById:F,addListing:A,removeListings:E,removeListingById:B}})();LMI.MapControls=(function(){var D=YAHOO.util.Event,I=LMI.Element;var A;function F(J){A.setZoomLevel(1);D.stopEvent(J)}function B(J){A.setZoomLevel(19);D.stopEvent(J)}function G(J){A.bestFit();D.stopEvent(J)}function C(J){A.zoomIn();D.stopEvent(J)}function E(J){A.zoomOut();D.stopEvent(J)}var H={init:function(J,K){K=K||{};A=J;var L=YAHOO.widget.Slider.getHorizSlider("zoomSlider","zoomThumb",0,197);A.addZoomSlider(L,0,197,true);D.on("zoomStreet","click",F);D.on("zoomCountry","click",B);D.on("zoomReset","click",(("resetZoomFunc" in K)?K.resetZoomFunc:G));D.on("zoomIn","click",C);D.on("zoomOut","click",E)}};LMI.Init.addFunction(function(){LMI.Lang.forEach(I.getAll("#zoomIn img,#zoomOut img,#zoomThumb img,#zoomReset img"),function(J){I.setImageSrc(J,I.getImageSrc(J))})});return H})();LMI.Mapping.Controls.DS_LARGE_CONTROLS=function(C){if(typeof C==="undefined"){C=LMI.Mapping.Map.Defaults.imageBase}C+="ds_large_controls/";var B=LMI.Mapping.InteractiveMap.prototype,A={left:3,top:10,zIndex:100};return{misc:[[C+"map_pan_n.png","pan","Pan North",{left:A.left+21,top:A.top,zIndex:A.zIndex,width:19,height:21},{click:B.panNorth}],[C+"map_pan_ne.png","pan","",{left:A.left+40,top:A.top,zIndex:A.zIndex,width:24,height:21},{}],[C+"map_pan_nw.png","pan","",{left:A.left,top:A.top,zIndex:A.zIndex,width:21,height:21},{}],[C+"map_pan_s.png","pan","Pan South",{left:A.left+21,top:A.top+40,zIndex:A.zIndex,width:19,height:24},{click:B.panSouth}],[C+"map_pan_se.png","pan","",{left:A.left+40,top:A.top+40,zIndex:A.zIndex,width:24,height:24},{}],[C+"map_pan_sw.png","pan","",{left:A.left,top:A.top+40,zIndex:A.zIndex,width:21,height:24},{}],[C+"map_pan_e.png","pan","Pan East",{left:A.left+40,top:A.top+21,zIndex:A.zIndex,width:24,height:19},{click:B.panEast}],[C+"map_pan_w.png","pan","Pan West",{left:A.left,top:A.top+21,zIndex:A.zIndex,width:21,height:19},{click:B.panWest}],[C+"map_pan_center.png","pan","Best Fit",{left:A.left+21,top:A.top+21,zIndex:A.zIndex,width:19,height:19},{click:LMI.Mapping.Map.prototype.bestFitEventHandler}],[C+"map_circle.png","pan","",{left:A.left,top:A.top,zIndex:A.zIndex-1,width:63,height:63},{}],[C+"map_clockwise.png","rotate","Rotate the camera angle clockwise",{left:A.left+19,top:A.top+65,zIndex:A.zIndex,width:26,height:26},{click:B.rotateClockwise}],[C+"map_counterclockwise.png","rotate","Rotate the camera angle counter-clockwise",{left:A.left+19,top:A.top+95,zIndex:A.zIndex,width:26,height:26},{click:B.rotateCounterClockwise}]],options:{contextMenu:true}}};(function(){var B=YAHOO.util,N=B.Dom,M=B.Event,P=LMI.Element,D=P.getOne,J=P.getAll;var C=[],L,H,I,F={visible:false,constraintoviewport:false,monitorresize:false,zIndex:1000,width:"340px",effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}};function R(Z){var W,U=Z.smallImages.length,V,X=P.create("div",document.body,{id:"previewBox_"+Z.id,className:"previewBox bd",children:[{tag:"div",className:"previewShadow"},{tag:"img",className:"previewPointer",src:LMI.Urls.getImg("flyout_tail_results.gif"),alt:""},{tag:"div",className:"hdr",textValue:LMI.Strings.getString("js.results.additional.photos")}]}),T=P.create("div",X,{className:"previewCont"}),Y;for(W=1;W<U&&W<7;W++){V=Z.smallImages[W];P.create("div",T,{className:"image",children:[{tag:"img",src:V.src,alt:V.altText}]})}P.create("div",T,{className:"clearer"});if(U>7){Y=(U==8)?"js.results.more.photos.single":"js.results.more.photos";P.create("p",T,{textValue:LMI.Strings.getString(Y,U-7)})}return X}function G(a,V){var X=N.getY(I),c=V+50,b=X-(0.4*a.element.offsetHeight),Y=N.getViewportWidth(),W=N.getViewportHeight(),T=LMI.Window.getScrollTop(),U=LMI.Window.getScrollLeft(),Z=D(".previewPointer",a.element);if(X<T+15||X>T+W-44){return false}if(c+a.element.offsetWidth>(Y+U)){c=c-(c+a.element.offsetWidth-(Y+U))-10}if(b+a.element.offsetHeight>(W+T)){b=b-(b+a.element.offsetHeight-(W+T))-10}if(c<U){c=c+(U-c)+10}if(b<T){b=b+(T-b)+10}a.cfg.setProperty("xy",[c,b]);N.setY(Z,X);return true}function A(V,T){var U=C[V];if(U){if(G(U,T)){U.show()}}}function Q(T){var U;if(!(T in C)){U=LMI.Listings.getListingsByProperty("id",T)[0];if(!U||U.smallImages.length<=1){C[T]=null}else{C[T]=new YAHOO.widget.Overlay(R(U),F);N.addClass(C[T].element,"previewBoxCont");if(YAHOO.env.ua.ie===6){}}}return !!C[T]}function O(T){return T.id.match(/^(?:logo)?preview_(.+)$/)[1]}function K(U){var V=O(this);I=this;var T=M.getPageX(U);if(H){window.clearTimeout(H)}if(Q(V)){H=window.setTimeout(function(){A(V,T);H=null},500)}}function S(W,U){var Y,T=M.getPageX(W),X=M.getPageY(W),V=N.getRegion(U);if(!V.contains(new B.Region(X,T,X,T))){M.removeListener(this,"mousemove",S);L=false;Y=O(U);if(C[Y]){C[Y].hide()}}}function E(V){var X=O(this),T=M.getPageX(V),W=M.getPageY(V),U=N.getRegion(this);if(H){window.clearTimeout(H);H=null}if(C[X]){if(!U.contains(new B.Region(W,T,W,T))){C[X].hide()}else{if(!L){M.on(document.body,"mousemove",S,this);L=true}}}}LMI.Init.addFunction(function(){LMI.Lang.forEach(J("#resultsCont .openPreview"),function(T){M.on(T,"mouseover",K);M.on(T,"mouseout",E)})})})();(function(){var C=LMI.Element;function B(I){var E=LMI.PopupFormCollection.getPopupByName("agentBrokerEmail"),H=C.create("span",null,{textValue:LMI.Strings.getString("js.listing.company.email")}),D=(LMI.Data.listings[0].listingType.name==="BROKER"?LMI.Data.listings[0].brokerEmail:LMI.Data.listings[0].agentEmail),G=C.create("a",null,{href:"#",textValue:D,events:{click:function(J){E.togglePopupForm();YAHOO.util.Event.stopEvent(J)}}}),F=this.parentNode;C.truncate(F);F.appendChild(H);F.appendChild(G);YAHOO.util.Event.stopEvent(I)}LMI.LinkBehavior.add("emailToggle",B);function A(){if(C.getOne("#mapImage")){var E,F=LMI.Data.listings[0],D;LMI.Data.mapOptions.enableResize=false;D=new LMI.Mapping.DSMap("#mapImage",LMI.Data.mapOptions);E=new LMI.Mapping.CenterIcon(F,F.listingType.name);D.addObject(E);D.addControls();LMI.MapControls.init(D);D.bestFit();if("TileSwitcher" in LMI.Mapping){LMI.Mapping.TileSwitcher.init(D)}}}LMI.Init.addFunction(A)})();