LMI.Event=function(){this.events={}};LMI.Event.prototype=(function(){var A={registerEvent:function(B){if(typeof this.events[B]!=="undefined"){throw ("Attempt to re-register event type: "+B)}else{this.events[B]=[]}},triggerEvent:function(D,B,E){if(typeof this.events[D]==="undefined"){throw ("Unknown event: "+D)}if(typeof B!=="object"||B===null){B={}}B.eventType=D;for(var C=0;C<this.events[D].length;++C){if(this.events[D][C](B,E)===false){return false}}return true},addListener:function(B,C){if(typeof this.events[B]==="undefined"){throw ("attempt to listen to unknown event type: "+B)}else{this.events[B].push(C)}return new LMI.Event.Token(null,B,C)},bind:function(C,F,D,B){var E=function(G,H){D.call(F,G,H,B)};return this.addListener(C,E)},removeListener:function(D,F){var C=D,E=F;if(typeof D.type!=="undefined"&&typeof D.func!=="undefined"){C=D.type;E=D.func}if(this.events[C]){for(var B=0;B<this.events[C].length;++B){if(this.events[C][B]===E){this.events[C].splice(B,1);break}}}},getListeners:function(B){return this.events[B]||[]}};return A})();LMI.Event.ExportFunctions=(function(){var A="__LMIEvents__";return{initEvents:function(){if(!this[A]){this[A]=new LMI.Event()}for(var B=0;B<arguments.length;++B){this[A].registerEvent(arguments[B])}},addEventListener:function(B,C){return this[A].addListener(B,C)},removeEventListener:function(B,C){return this[A].removeListener(B,C)},bindEvent:function(C,E,D,B){return this[A].bind(C,E,D,B)},triggerEvent:function(C,B,D){this[A].triggerEvent(C,B,D)},getListeners:function(B){return this[A].getListeners(B)}}})();LMI.Event.Token=function(C,A,B){this.elem=C;this.type=A;this.func=B};LMI.LinkBehavior=(function(){var B={};function E(G,H,F){if(typeof B[G]!="undefined"){throw ('attempted to redefine link type "'+G+'"')}else{B[G]=[F,H]}}function A(F){delete B[F]}function D(J){var G=J.tagName,H,I,F;if(G&&G.toUpperCase()=="A"){C(J)}else{H=J.getElementsByTagName("a");F=H.length;for(I=0;I<F;I++){C(H[I])}}}function C(J){var H,I=String(J.getAttribute("rel")).split(" "),G=0,F=I.length;for(;G<F;++G){H=B[I[G]];if(H){if(typeof H[0]==="function"){H[0](J)}if(typeof H[1]==="function"){YAHOO.util.Event.on(J,"click",H[1])}}}}LMI.Init.addFunction(function(){D(document)},70);return{add:E,remove:A,applyTo:D}})();(function(){var A=LMI.Lang.getObject("LMI.Utils",true);A.stringToObject=function(I){var F={},B=(I.match(/^\{(.+?)\}/)?RegExp.$1:"|"),E=I.split(B);for(var D=0;D<E.length;++D){var H=E[D].indexOf("=");H=(H>=0?H:E[D].length-1);var C=E[D].substring(0,H);var G=E[D].substring(H+1);switch(G){case"true":F[C]=true;break;case"false":F[C]=false;break;default:if(G==""+parseFloat(G)){F[C]=parseFloat(G)}else{F[C]=G}}}return F};A.getIcon=function(B,E,D){var G=parseInt(B,10);var H=E;var F=LMI.Strings.getString("js.letters");var C=(G>=0&&G<F.length?F.charAt(G):(D?"star":"blank"));switch(E){case"blue":H="blue";break;case"green":H="green";break;case"POI":case"special":C=B;break;default:H="red"}return LMI.Urls.getImg("map_nodes/"+H+"/map_icon_"+C+".png")};A.quoteMeta=function(B){return B.replace(/(\W)/g,"\\$1")}})();if(typeof (Ext)==="undefined"){Ext={}}Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={};var nonSpace=/\S/;var trimRe=/^\s*(.*?)\s*$/;var tplRe=/\{(\d+)\}/g;var modeRe=/^(\s?[\/>]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*\|]+)/;function child(p,index){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function clean(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v,re,cn){if(!v){return c}var r=[];for(var i=0,ci;ci=c[i];i++){cn=ci.className;if(cn&&(" "+cn+" ").indexOf(v)!=-1){r[r.length]=ci}}return r}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],cs;if(!ns){return result}mode=mode?mode.replace(trimRe,"$1"):"";tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(mode!="/"&&mode!=">"){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[result.length]=ci}}}else{for(var i=0,ni;ni=ns[i];i++){var cn=ni.getElementsByTagName(tagName);for(var j=0,cj;cj=cn[j];j++){if(cj.parentNode==ni){result[result.length]=cj}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var r=[];tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[r.length]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[];for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[r.length]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],st=custom=="{";var f=Ext.DomQuery.operators[op];for(var i=0;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}if((f&&f(a,value))||(!f&&a)){r[r.length]=ci}}return r}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}var isIE=window.ActiveXObject?true:false;var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){var len,c,i,r=cs,cj;if(cs===null){return[]}len=cs.length;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[r.length]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[r.length]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length;if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<len1;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function gebi(parent,id){var r=parent.getElementById(id);return r&&r.id===id?r:null}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return gebi(d,id)}ns=getNodes(ns,mode,"*");return byId(ns,null,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){while(path.substr(0,1)=="/"){path=path.substr(1)}type=type||"select";var fn=["var f = function(root){\n var mode; var n = root || document;\n"];var q=path,mode,lq;var tk=Ext.DomQuery.matchers;var tklen=tk.length;var mm;while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1]+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=gebi(document,root)}var paths=path.split(",");var results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"$1");if(!cache[p]){cache[p]=Ext.DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}return results},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"$1");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return(v===null?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=gebi(document,el)}var isArray=(el instanceof Array);var result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"$1");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0}},pseudos:{"first-child":function(c){var r=[],n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[r.length]=ci}}return r},"last-child":function(c){var r=[];for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[r.length]=ci}}return r},"nth-child":function(c,a){var r=[];if(a!="odd"&&a!="even"){for(var i=0,ci;ci=c[i];i++){var m=child(ci.parentNode,a);if(m==ci){r[r.length]=m}}return r}var p;for(var i=0,l=c.length;i<l;i++){var cp=c[i].parentNode;if(cp!=p){clean(cp);p=cp}}for(var i=0,ci;ci=c[i];i++){var m=false;if(a=="odd"){m=((ci.nodeIndex+1)%2==1)}else{if(a=="even"){m=((ci.nodeIndex+1)%2==0)}}if(m){r[r.length]=ci}}return r},"only-child":function(c){var r=[];for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[r.length]=ci}}return r},empty:function(c){var r=[];for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[r.length]=ci}}return r},contains:function(c,v){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.innerHTML.indexOf(v)!==-1){r[r.length]=ci}}return r},nodeValue:function(c,v){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[r.length]=ci}}return r},checked:function(c){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[r.length]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]},first:function(c){return c[0]},last:function(c){return c[c.length-1]},has:function(c,ss){var s=Ext.DomQuery.select;var r=[];for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[r.length]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is;var r=[];for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[r.length]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is;var r=[];for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[r.length]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;LMI.Element=function(){var B=YAHOO.util,O=B.Dom,K=B.Event,N=LMI.Lang.forEach,I,D;function L(T,S,U){switch(S){case"class":case"className":N(U.split(" "),function(V){O.addClass(T,V)});break;case"colspan":T.colSpan=U;break;case"src":C(T,U);break;case"maxlength":T.setAttribute("maxLength",U);break;case"style":if(document.all&&!window.opera){T.style.cssText=U}else{T.setAttribute(S,U)}break;default:T.setAttribute(S,U)}}function F(Z,a,T){var W,b,U,V,X,S;T=T||{};Z=Z||T.tag||T.elType;delete T.elType;delete T.tag;if(("innerHTML" in T)&&("children" in T)){throw new Error("cannot specify children with innerHTML")}if(Z==="text"){W=document.createTextNode(T.textValue||T.text)}else{if(Z==="input"&&T.name){try{W=document.createElement("<input type='"+T.type+"' name='"+T.name+"'>");delete T.type;delete T.name}catch(Y){}}if(!W){W=Z?document.createElement(Z):document.createDocumentFragment()}for(V in T){if(T.hasOwnProperty(V)){switch(V){case"children":N(T[V],function(c){F(null,W,c)});break;case"text":case"textValue":W.appendChild(document.createTextNode(T[V]));break;case"src":S=T[V];break;case"innerHTML":W.innerHTML=T[V];break;case"events":case"browserEvents":for(b in T[V]){if(T[V].hasOwnProperty(b)){X=T[V][b];if(YAHOO.lang.isFunction(X)){K.on(W,b,X)}else{if("fn" in X){U=[W,b,X.fn];if("obj" in X){U.push(X.obj);if("scope" in X){U.push(X.scope)}}K.on.apply(K,U)}}}}break;default:L(W,V,T[V])}}}}if(S){L(W,"src",S)}if(a){a.appendChild(W)}return W}I=function(){if(YAHOO&&YAHOO.env.getVersion("selector")){return function(S,T){try{return B.Selector.query(S,T)}catch(U){return[]}}}else{if(typeof Ext!=="undefined"&&("DomQuery" in Ext)){return Ext.DomQuery.select}}return function(){throw new Error("No selector lib has been loaded")}}();D=function(){if(YAHOO&&YAHOO.env.getVersion("selector")){return function(T,S){if(YAHOO.lang.isString(T)){try{return B.Selector.query(T,S,true)}catch(U){return null}}return T}}else{if(typeof Ext!=="undefined"&&("DomQuery" in Ext)){return function(T,S){if(typeof T==="string"){return Ext.DomQuery.selectNode(T,S)}else{return T}}}}return function(){throw new Error("No selector lib has been loaded")}}();function J(V,S,U){var W=S.toUpperCase(),T=!!U;while((V=V.parentNode)&&(V.nodeName!==W||(T&&!O.hasClass(V,U)))){}return V}function Q(T){var S,U,V=YAHOO.env.ua.ie;if(V&&V<7){S="DXImageTransform.Microsoft.AlphaImageLoader";U=T.filters[S];if(U){return U.src}else{if(T){return T.src}}}else{if(T){return T.src}}return""}function E(T,V,S){var U=S?', sizingMethod="'+S+'"':"";T.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+V+'"'+U+")";T.src=LMI.Urls.getImg("pixel_trans.gif")}function C(T,V,S){var U=YAHOO.env.ua.ie;if(U&&U<7){if(V.match(/\.png(;|$|\?)/)&&!O.hasClass(T,"notTransparent")){E(T,V,S)}else{if(T.src!=V){T.src=V}}}else{if(T){T.src=V}}}function G(S){var T={x:0,y:0,w:S.offsetWidth,h:S.offsetHeight};while(S){T.x+=S.offsetLeft;T.y+=S.offsetTop;S=S.offsetParent}return T}function R(S,b,V,Z,Y,U,c,X,a){var W,T="position: absolute;";if(typeof V!=="undefined"){T+="left:    "+V+"px;"}if(typeof Z!=="undefined"){T+="top:     "+Z+"px;"}if(typeof Y!=="undefined"){T+="z-index: "+Y+";"}W=F("img",b,{galleryImg:"no",style:T,title:(a?a:""),alt:(X?X:"")});C(W,S);if(U!==undefined){W.width=U}if(c!==undefined){W.height=c}return W}function P(S){K.purgeElement(S,true);if(S.parentNode){S.parentNode.removeChild(S)}}function A(S){while(S&&S.firstChild){P(S.firstChild)}}function H(S,T){if(S&&S.firstChild&&S.firstChild.nodeValue){S.firstChild.nodeValue=T}}function M(T,S){if(T){if(typeof (T)!=="object"){T=I(T)}if(typeof (T)==="object"&&T!==null){if(!T instanceof Array){T=[T]}N(T,function(V){var U=YAHOO.util.Dom.getStyle(V,"display");if(U){V.style.display="none";if(typeof (S)!=="undefined"){window.setTimeout(function(){V.style.display=U},S)}else{V.style.display=U}}})}}}return{setAttribute:L,create:F,getAll:I,getOne:D,findAncestor:J,getImageSrc:Q,setAlphaImageLoader:E,setImageSrc:C,getOffsets:G,createImage:R,destroy:P,truncate:A,changeLinkText:H,blink:M}}();function DSCollection(){this.init()}DSCollection.prototype.init=function(){this.collection=[]};DSCollection.prototype.getLength=function(){return this.collection.length};DSCollection.prototype.getByIndex=function(A){return this.collection[A]};DSCollection.prototype.push=function(){for(var A=0;A<arguments.length;++A){this.collection.push(arguments[A])}};DSCollection.prototype.remove=function(A){this.collection.splice(A,1)};function DSIterator(A){this.pos=0;this.collection=A}DSIterator.prototype.hasNext=function(){return this.pos<this.collection.getLength()};DSIterator.prototype.next=function(){if(this.hasNext()){return this.collection.getByIndex(this.pos++)}var A;return A};function DSInteraction(){}DSInteraction.Drag=function(B,A){this.init(B,A)};LMI.Lang.importFunctions(DSInteraction.Drag,LMI.Event);DSInteraction.Drag.prototype.init=function(B,A){this.element=B;this.options=A||{};if(YAHOO.env.ua.ie){document.body.ondrag=function(){return false}}this.handle=this.options.handle||this.element;this.initEvents("startDrag","drag","endDrag");this.elStartLeft=this.elStartTop=null;this.startX=0;this.startY=0;if(!this.options.disable){this.enable()}};DSInteraction.Drag.prototype.enable=function(){if(!this.enabled){this.enabled=true;YAHOO.util.Event.on(this.handle,"mousedown",this.startDrag,this,true)}};DSInteraction.Drag.prototype.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(this.handle,"mousedown",this.startDrag,this,true);this.enabled=false}};DSInteraction.Drag.prototype.getEventObject=function(){return{clickStartPosition:{x:this.startX,y:this.startY},elementCurrentPosition:{x:this.getElementLeft(),y:this.getElementTop()},elementStartPosition:{x:this.elStartLeft,y:this.elStartTop}}};DSInteraction.Drag.prototype.getElementLeft=function(){return parseInt(YAHOO.util.Dom.getStyle(this.element,"left"),10)};DSInteraction.Drag.prototype.getElementTop=function(){return parseInt(YAHOO.util.Dom.getStyle(this.element,"top"),10)};DSInteraction.Drag.prototype.startDrag=function(C){var A=C.which||C.button;if(A===1){this.startX=YAHOO.util.Event.getPageX(C);this.startY=YAHOO.util.Event.getPageY(C);this.originalPos=YAHOO.util.Dom.getStyle(this.element,"position");if(this.originalPos!="absolute"){var B=LMI.Element.getOffsets(this.element);this.element.style.position="absolute";this.element.style.top=B.y+"px";this.element.style.left=B.x+"px"}this.elStartLeft=this.getElementLeft();this.elStartTop=this.getElementTop();YAHOO.util.Event.removeListener(document,"mousemove",this.drag,this,true);YAHOO.util.Event.removeListener(document,"mouseup",this.endDrag,this,true);YAHOO.util.Event.on(document,"mousemove",this.drag,this,true);YAHOO.util.Event.on(document,"mouseup",this.endDrag,this,true);YAHOO.util.Event.on(window,"mouseout",this.endDrag,this,true);this.triggerEvent("startDrag",this.getEventObject(),this);YAHOO.util.Event.stopEvent(C)}};DSInteraction.Drag.prototype.endDrag=function(A){if(A.type!="mouseout"||!YAHOO.util.Event.getRelatedTarget(A)){YAHOO.util.Event.removeListener(document,"mousemove",this.drag);YAHOO.util.Event.removeListener(document,"mouseup",this.endDrag);YAHOO.util.Event.removeListener(window,"mouseout",this.endDrag);var B=this.getEventObject();B.clickEndPosition={x:YAHOO.util.Event.getPageX(A),y:YAHOO.util.Event.getPageY(A)};B.elementEndPosition={x:this.getElementLeft(),y:this.getElementTop()};this.startX=0;this.startY=0;if(this.originalPos!="absolute"){this.element.style.position=this.originalPos}this.triggerEvent("endDrag",B,this)}};DSInteraction.Drag.prototype.drag=function(B){if(!this.options.lockX){var A=YAHOO.util.Event.getPageX(B);var E=this.elStartLeft-(this.startX-A);if(this.options.maxX&&E>this.options.maxX){E=this.options.maxX}else{if(this.options.minX&&E<this.options.minX){E=this.options.minX}}this.element.style.left=E+"px"}if(!this.options.lockY){var D=YAHOO.util.Event.getPageY(B);var C=this.elStartTop-(this.startY-D);if(this.options.maxY&&C>this.options.maxY){C=this.options.maxY}else{if(this.options.minY&&C<this.options.minY){C=this.options.minY}}this.element.style.top=C+"px"}this.triggerEvent("drag",this.getEventObject(),this);YAHOO.util.Event.stopEvent(B)};LMI.Strings=(function(){var A=LMI.Data.strings,B=LMI.Data.strings_debug;return{setString:function(C,D){A[C]=D},setStrings:function(C){A=C},setDebug:function(C){B=C},getString:function(E){var D,C,F="";if(E in A){F=A[E];C=arguments.length;for(D=1;D<C;++D){F=F.replace(new RegExp("{"+(D-1)+"\\}","g"),arguments[D])}}else{if(B){F="Unknown Message Key: '"+E+"'"}}return F}}})();function DOMNode(){}DOMNode.findPrevSibling=function(B,A){var C=A.toUpperCase();for(B=B.previousSibling;B&&B.nodeName!=C;B=B.previousSibling){}return B};DOMNode.findNextSibling=function(B,A){var C=A.toUpperCase();for(B=B.nextSibling;B&&B.nodeName!=C;B=B.nextSibling){}return B};DOMNode.findAncestor=function(A,B){var C=B.toUpperCase();for(A=A.parentNode;A&&A.nodeName!=C;A=A.parentNode){}return A};DOMNode.findAncestorByClass=function(B,C,A){var D=C.toUpperCase();for(B=B.parentNode;B&&(B.nodeName!=D||!YAHOO.util.Dom.hasClass(B,A));B=B.parentNode){}return B};DOMNode.findFirstTextChild=function(B){var A,C;if(!B){return null}if(B.nodeType===3){return B}else{for(C=B.firstChild;C;C=C.nextSibling){A=DOMNode.findFirstTextChild(C);if(A){return A}}}return null};DOMNode.checkAttribute=function(C,B,D){var A;if(!C){return false}switch(B){case"class":A=C.className;break;default:A=C.getAttribute(B)}return(A&&A.match("\\b"+D+"\\b")==D)};DOMNode.appendAfter=function(B,A){if(A.nextSibling){A.parentNode.insertBefore(B,A.nextSibling)}else{A.parentNode.appendChild(B)}};DOMNode.getByTagAndClass=function(C,B,A){if(arguments.length<3){throw ("DOMNode.getByTagAndClass: insufficient number of arguments")}return LMI.Lang.filter(C.getElementsByTagName(B),(A?function(D){return YAHOO.util.Dom.hasClass(D,A)}:function(){return true}))};LMI.MinEvents=(function(){var C={63232:38,63233:40,63234:37,63235:39,63273:36,63275:35,63276:33,63277:34};function E(I,H,J){if(I.addEventListener){I.addEventListener(H,J,false)}else{if(I.attachEvent){I.attachEvent("on"+H,J)}else{throw new Error("addEvent: unsupported browser")}}}function G(I,H,J){if(I.removeEventListener){I.removeEventListener(H,J,false)}else{if(I.detachEvent){I.detachEvent("on"+H,J)}else{throw new Error("removeEvent: unsupported browser")}}}function B(H){var I;if(window.onload){I=window.onload}window.onload=function(){if(typeof I==="function"){I()}H()}}function D(H){if(H.stopPropagation){H.stopPropagation()}else{H.cancelBubble=true}if(H.preventDefault){H.preventDefault()}else{H.returnValue=false}}function A(I){var H=0,J=I.charCode;if(J>60000&&(J in C)){H=C[J]}else{if(!J){H=I.keyCode}}return H}function F(J,I){var H=J.target||J.srcElement;I=I.toUpperCase();while(H&&H.nodeName!==I){H=H.parentNode}return H}return{on:E,addEvent:E,addWindowLoadEvent:B,stopEvent:D,getKeyCode:A,findTarget:F,removeEvent:G}})();LMI.DropDown=(function(){var I=LMI.MinEvents,D=[],J=false,K=/\bhilite\b/,M={backspace:8,tab:9,enter:13,esc:27,pgup:33,pgdn:34,end:35,home:36,left:37,up:38,right:39,down:40,del:46};function H(Q){var O,N,P;Q=Q||window.event;P=Q.target||Q.srcElement;for(O=0,N=D.length;O<N;++O){D[O].hideIfUnrelated(P)}}function G(){if(!J){J=true;LMI.MinEvents.addEvent(document.body,"click",H)}}function E(N,O){O.appendChild(N)}function C(N,P){var O=P.nextSibling;if(O){O.parentNode.insertBefore(N,O)}else{P.parentNode.appendChild(N)}}function B(Q,P,O,S,R){var N=document.createElement(P);R=R||E;if(O){N.className=O}if(S){N.appendChild(document.createTextNode(S))}R(N,Q);return N}function L(N,O){if(N.currentStyle){O=O.replace(/\-(\w)/g,function(P,Q){return Q.toUpperCase()});return N.currentStyle[O]}else{return getComputedStyle(N,"").getPropertyValue(O)}}function F(N){var P=N,O={x:0,y:0};do{O.x+=P.offsetLeft;O.y+=P.offsetTop;if(P!==N){O.x+=parseInt(L(P,"border-left-width"),10)||0;O.y+=parseInt(L(P,"border-top-width"),10)||0}P=P.offsetParent}while(P&&L(P,"position")==="static");return O}function A(O,N){this.init(O,N)}A.prototype={init:function(O,N){this.id=O;this.options=N||{};this.textbox=document.getElementById(O);if(!this.textbox||this.textbox.id!==O){throw new TypeError('DropDown: unable to find textbox with id "'+O+'"')}this.textbox.setAttribute("autocomplete","off");if(this.options.readOnly){this.textbox.setAttribute("readOnly",true)}this.lastSection="LMIDDNoSection";this.sections={};this.eventHandlers={};this.addArrow();this.createMenu();this.addEventListeners();D.push(this);G()},isShown:function(){return this.container.style.display==="block"},syncShim:function(){var O,N;if(this.shim){O=this.container;N=this.shim;N.style.top=O.style.top;N.style.left=O.style.left;N.style.display=O.style.display;N.style.width=O.offsetWidth+"px";N.style.height=O.offsetHeight+"px"}},showMenu:function(){var P=this.container,N=this.textbox,O=F(N);P.style.top=O.y+N.offsetHeight+"px";P.style.left=O.x+"px";P.style.display="block";this.shadow.style.overflow="auto";this.syncShim()},hideMenu:function(){this.container.style.display="none";this.syncShim()},hideIfUnrelated:function(N){if(N===this.textbox||N===this.arrow){return }while(N&&!(N.nodeName==="DIV"&&N.className.match(/\bLMIDropDown\b/))){N=N.parentNode}if(!N){this.hideMenu()}},toggleMenu:function(){if(this.isShown()){this.hideMenu()}else{this.showMenu()}},addArrow:function(){if("arrowSrc" in this.options){this.arrow=B(this.textbox.parentNode,"img","LMIDDArrow");this.arrow.src=this.options.arrowSrc;this.positionArrow()}},positionArrow:function(){this.arrow.style.top=F(this.textbox).y+"px"},createMenu:function(){this.container=B(this.textbox.parentNode,"div","LMIDropDown");this.container.id="LMIDD_"+this.id;this.shadow=B(this.container,"div","LMIDDShadow");this.menu=B(this.container,"div","LMIDDMenu");this.list=B(this.menu,"dl","LMIDDList");if(document.all&&!window.opera){this.shim=B(this.textbox.parentNode,"iframe","LMIDDShim");this.shim.src="about:blank"}},addSection:function(Q,P,N){var O;N=N||{};if(this.sections[Q]){throw new Error('section "'+Q+'" already exists')}this.lastSection=Q;if(P){if(typeof P==="string"){O=B(this.list,"dt",Q);B(O,"span","",P)}if("hint" in N){if(typeof N.hint==="string"){B(O,"span","hint",N.hint)}else{if(!N.hint.className.match(/\bhint\b/)){N.hint.className+=" hint"}O.appendChild(N.hint)}}}this.sections[Q]={header:O,items:[]}},clearSection:function(S,Q){var P,N,O,R=this.sections[S];if(R){O=R.items;for(P=0,N=O.length;P<N;++P){O[P].element.parentNode.removeChild(O[P].element);O[P]=null}R.items=[]}},addItem:function(T,S,N,U){var Q,O,R,P={display:T,options:N};S=S||this.lastSection;if(!this.sections[S]){this.addSection(S)}O=this.sections[S];if(O.items.length){Q=O.items[O.items.length-1].element;R=C}else{if(O.header){Q=O.header;R=C}else{Q=this.list}}P.type=S;P.element=B(Q,"dd",S,T,R);O.items.push(P);if(N&&"selected" in N&&N.selected){this.selectItem(S,O.items.length-1)}},selectItem:function(O,N){this.selected=this.sections[O].items[N];this.textbox.value=this.selected.display;this.hideMenu();this.textbox.focus();this.eventHandler("select",this.selected)},hiliteItem:function(P,N){var O=this.sections[P].items[N];this.hilited=[P,N];if(!K.test(O.element.className)){O.element.className+=" hilite"}},unhiliteItem:function(P,N){var O;if(this.hilited){if(!P||!N){P=this.hilited[0];N=this.hilited[1]}O=this.sections[P].items[N];this.hilited=null;O.element.className=O.element.className.replace(K,"")}},previous:function(){var O,P,N,Q=this.hilited;if(Q){this.unhiliteItem(Q[0],Q[1]);O=this.sections[Q[0]].items[Q[1]].element.previousSibling;while(O&&O.nodeName!=="DD"){O=O.previousSibling}}if(!O){N=this.list.getElementsByTagName("dd");if(N.length){O=N[N.length-1]}}if(O){P=this.getItemByElement(O);this.hiliteItem(P[0],P[1])}},next:function(){var N,O,P=this.hilited;if(P){this.unhiliteItem();N=this.sections[P[0]].items[P[1]].element.nextSibling;while(N&&N.nodeName!=="DD"){N=N.nextSibling}}if(!N){N=this.list.getElementsByTagName("dd")[0]}if(N){O=this.getItemByElement(N);this.hiliteItem(O[0],O[1])}},getItemByElement:function(R){var P,N,O,Q=R.className.split(" ")[0],S=this.sections[Q];if(S){O=S.items;for(P=0,N=O.length;P<N;++P){if(O[P].element===R){return[Q,P]}}}return null},mouseHandler:function(O){var N=I.findTarget(O,"dd");if(N){N=this.getItemByElement(N);if(N){if(O.type==="click"){this.selectItem(N[0],N[1])}else{if(O.type==="mouseover"){this.hiliteItem(N[0],N[1])}else{this.unhiliteItem(N[0],N[1])}}}}},keyHandler:function(O){var N=I.getKeyCode(O);if(N===M.enter||O.charCode===M.enter||N===M.right){if(this.isShown()&&this.hilited){I.stopEvent(O);this.selectItem(this.hilited[0],this.hilited[1])}}else{if(O.type==="keydown"){switch(N){case M.up:this.showMenu();this.previous();I.stopEvent(O);break;case M.down:this.showMenu();this.next();I.stopEvent(O);break;case M.tab:if(this.isShown()){if(this.hilited){this.selectItem(this.hilited[0],this.hilited[1])}this.hideMenu()}break}}else{if(this.selected&&this.selected.display!==this.textbox.value){this.selected=null}}}},addEventListeners:function(){var N=this;this._fieldClickHandler=function(){N.textbox.focus();N.toggleMenu()};this._keyHandler=function(O){N.keyHandler(O||window.event)};this._mouseHandler=function(O){N.mouseHandler(O||window.event)};if(this.arrow){I.addEvent(this.arrow,"click",this._fieldClickHandler)}if(!("openOnFieldClick" in this.options)||this.options.openOnFieldClick){I.addEvent(this.textbox,"click",this._fieldClickHandler)}I.addEvent(this.textbox,"keydown",this._keyHandler);I.addEvent(this.textbox,"keypress",this._keyHandler);I.addEvent(this.menu,"click",this._mouseHandler);I.addEvent(this.menu,"mouseover",this._mouseHandler);I.addEvent(this.menu,"mouseout",this._mouseHandler)},eventHandler:function(Q,R){var O,N,P;if(Q in this.eventHandlers){P=this.eventHandlers[Q];for(O=0,N=P.length;O<N;++O){P[O].call(this,R)}}},addEventHandler:function(N,P){var O=this;if(!this["_"+N+"Handler"]){this["_"+N+"Handler"]=function(Q){O.eventHandler(N,Q||window.event)};if(N!=="select"){I.addEvent(this.textbox,N,this["_"+N+"Handler"])}}if(!(N in this.eventHandlers)){this.eventHandlers[N]=[]}this.eventHandlers[N].push(P)},addSubmitHandler:function(O){var N=this;if(!this._submitHandler){this._submitHandler=function(P){N.eventHandler("submit",P||window.event)};I.addEvent(this.textbox.form,"submit",this._submitHandler)}if(!("submit" in this.eventHandlers)){this.eventHandlers.submit=[]}this.eventHandlers.submit.push(O)},addModule:function(P){var O,N,R,Q=["keyup","focus","blur","select"];for(O=0,N=Q.length;O<N;++O){R=Q[O]+"Handler";if(R in P){this.addEventHandler(Q[O],P[R])}}if("submitHandler" in P){this.addSubmitHandler(P.submitHandler)}if("methods" in P){for(O in P.methods){if(P.methods.hasOwnProperty(O)){this[O]=P.methods[O]}}}}};A.getById=function(P){var O=0,N=D.length;for(;O<N;++O){if(D[O].id===P){return D[O]}}return null};return A})();LMI.DropDown.Hint=(function(){var A=/\bhintText\b/;function D(){return(this.mod_hint_text&&(this.textbox.value===""||this.textbox.value===this.mod_hint_text))}function H(){if(this.hasHint()){if(!A.test(this.textbox.className)){this.textbox.className+=" hintText"}this.textbox.value=this.mod_hint_text}}function C(){if(A.test(this.textbox.className)){this.textbox.className=this.textbox.className.replace(A,"");if(this.textbox.value===this.mod_hint_text){this.textbox.value=""}}}function B(){this.hideHintText()}function G(){this.showHintText()}function F(){this.hideHintText()}function E(I){this.mod_hint_text=I;this.showHintText()}return{blurHandler:G,focusHandler:B,submitHandler:F,selectHandler:C,methods:{hasHint:D,setHintText:E,showHintText:H,hideHintText:C}}})();LMI.DropDown.Suggest=(function(){var B=3;function A(E,F){var D=LMI.Data.Urls.suggest+"?query="+encodeURIComponent(E);LMI.XHR.makeXHRRequest(D,"get",F)}function C(D,E){return function(H){var G,F;if(D.suggest_requestId===E){D.unhiliteItem();D.clearSection("suggest");for(G=0,F=H.length;G<F;++G){D.addItem(H[G].key,"suggest")}if(H.length>0&&(!D.selected||D.selected.display!=D.textbox.value)){D.showMenu()}}}}return{keyupHandler:function(){var D=this.textbox.value;if(D.length<B){this.clearSection("suggest");this.suggest_prevSearch=""}else{if(D!==this.suggest_prevSearch){this.suggest_requestId=new Date().getTime().toString().substring(4);this.suggest_prevSearch=this.textbox.value;A(this.textbox.value,C(this,this.suggest_requestId))}}}}})();LMI.Form=function(){this.action="";this.params={};this.method="post";this.postCallback=null;this.noRefreshUrl=""};LMI.Form.prototype=(function(){return{getAction:function(){return this.action},setAction:function(A){this.action=this.parseUrl(A)},getMethod:function(){return this.method},setMethod:function(A){this.method=A},setPostCallback:function(A){this.postCallback=A},removeVar:function(A){if(this.params[A]){delete this.params[A]}},setVar:function(C,G,B,A){var E=0;if(!this.params[C]){this.params[C]=[]}if(G===null){G=""}var F=-1;for(var D=0;D<this.params[C].length;++D){if(this.params[C][D]==G){F=D}}if(F>-1){if(A){this.params[C].splice(F,1);if(this.params[C].length===0){delete this.params[C]}return }}if(!B){this.params[C]=[];this.params[C].push(G)}E++;if(B||!E){this.params[C].push(G)}},getVar:function(A){return(this.params[A]?this.params[A]:[])},SUBMIT_NORMAL:0,SUBMIT_NOREFRESH:1,SUBMIT_SESSION:2,createForm:function(B){var A=document.getElementsByTagName("body")[0],E=LMI.Element.create("form",A,{action:this.action,method:this.method,style:"display:none;position:absolute;top:-4000px;width:0;height:0"});for(var D in this.params){if(this.params.hasOwnProperty(D)){for(var C=0;C<this.params[D].length;++C){if(B===this.SUBMIT_NOREFRESH){this.noRefreshUrl+=D+"="+this.params[D][C]+"&"}else{LMI.Element.create("input",E,{name:D,value:this.params[D][C],style:"display:none;"})}}}}return E},submit:function(A){var C=this.createForm(A);if(A==this.SUBMIT_NOREFRESH){var B=document.createElement("img");B.src=this.action+";jsessionid="+LMI.Lang.getObject("LMI.Data.state.sessionId")+"?"+this.noRefreshUrl+"noresponse=1";return B.src}else{if(A==this.SUBMIT_SESSION){C.action=this.action+";jsessionid="+LMI.Lang.getObject("LMI.Data.state.sessionId");C.submit()}else{C.submit()}}return C},go:function(C,A){var D;for(var B=2;B<arguments.length;B++){if(arguments[B]=="#"){D=arguments[++B];continue}this.setVar(arguments[B],arguments[++B])}if(C){this.setAction(D?C+"#"+D:C)}this.submit(A);return false},postUrl:function(B,C){var A=this.parseUrl(B,C);if(this.postCallback){A=this.postCallback(A)}this.go(A)},parseUrl:function(B,E){var H=new LMI.Url(B);var F=H.getLocation();var A=H.getParamString();if(A){F+=";"+A}var I=H.getQueryNames();for(var D=0;D<I.length;++D){var G=H.getQueryValues(I[D]);for(var C=0;C<G.length;++C){this.setVar(I[D],G[C],E,false)}}return F},postLink:function(A,B){this.postUrl(A.href,B)},copy:function(B){if(B.action){this.setAction(B.action)}var A=this;LMI.Lang.forEach(B.elements,function(C){A.setVar(C.name,C.value)})}}})();LMI.Window=(function(){return{getHeight:function(){if(self.innerHeight){return self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(document.body){return document.body.clientHeight}}}return 0},getWidth:function(){if(self.innerWidth){return window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}else{if(document.body){return document.body.clientHeight}}}return 0},getScrollTop:function(){if(self.pageYOffset){return self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else{if(document.body){return document.body.scrollTop}}}return 0},getScrollLeft:function(){if(self.pageXOffset){return self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}else{if(document.body){return document.body.scrollLeft}}}return 0}}})();LMI.MapSearchSize=(function(){var H=65,E=101,C=305,G=133,F=94,A=535;function B(){var K=LMI.Window.getWidth()-(H+C),I=LMI.Window.getHeight()-E,M=document.getElementById("hdr"),L=document.getElementById("propertySearchForm"),J;if(document.body.id==="home"){I-=F;I-=G;J=navigator.userAgent.toLowerCase();if(J.match(/msie 7/)!==null){K+=12}else{if(J.match(/msie/)!==null){K+=17}}}else{if(M){I-=parseInt(M.offsetHeight,10)}if(L){I-=parseInt(L.offsetHeight,10)}else{I-=G}}if(I<A){I=A}return{x:K,y:I}}function D(P){var I=this.href,J,O,L,N,M,K;if("MapSearch" in LMI&&LMI.Data.mapSearchResults!==null&&!LMI.Data.textBasedSearch){O=LMI.MapSearch.getMap();N=O.getLLPoint();M=O.getURPoint();L=O.getZoomLevel();if(O.vemap.GetMapStyle()===VEMapStyle.Birdseye){L+=16}I+="&bottomLeftLatitude="+N.Latitude.toFixed(6)+"&bottomLeftLongitude="+N.Longitude.toFixed(6)+"&topRightLatitude="+M.Latitude.toFixed(6)+"&topRightLongitude="+M.Longitude.toFixed(6)+"&mapLevel="+L+"&where="+LMI.Element.getOne("input#where").value;location.href=I;YAHOO.util.Event.stopEvent(P)}else{if(I.indexOf("bottomLeftLatitude")<0){J=B();I+="&mapWidth="+J.x+"&mapHeight="+J.y;K=LMI.Element.getOne("#where");if(I.indexOf("where")<0&&!K.className.match(/hintText/)){I+="&where="+K.value}location.href=I;YAHOO.util.Event.stopEvent(P)}}}if("LinkBehavior" in LMI){LMI.LinkBehavior.add("findOnMapLink",D)}return{getDimensions:B,findOnMapLinkHandler:D}})();function PrintPage(){if(window.print){window.print()}else{alert(LMI.Strings.getString("js.printerr"))}}LMI.LinkBehavior.add("print",PrintPage);function PostLink(A,B){if(A.altKey||A.ctrlKey){return true}LMI.Data.form.postLink(this,B);if(YAHOO.env.ua.webkit){this.href="#"}YAHOO.util.Event.stopEvent(A)}LMI.LinkBehavior.add("post",PostLink);function PostLinkDups(A){PostLink(A,true)}LMI.LinkBehavior.add("postdups",PostLinkDups);LMI.Init.addFunction(function(){var B,E=LMI.Data,A=E.requestHiddens;function C(F,G){if(G instanceof Array){for(var D=0;D<G.length;++D){E.form.setVar(F,G[D],true)}}else{E.form.setVar(F,G,true)}}E.form=new LMI.Form();for(B in A){if(A.hasOwnProperty(B)){C(B,A[B])}}A=LMI.Data.sessionHiddens;for(B in A){if(A.hasOwnProperty(B)){C(B,A[B])}}});LMI.SearchForm=(function(){var M=LMI.Strings.getString,R=LMI.MinEvents,D={arrowSrc:LMI.Data.Urls.ddArrow},Q,C={sale:["numBeds","numBaths","lotSizes","openHouse","defaultRefine"],rent:["numBeds","numBaths","lotSizes","defaultRefine"],multi:["numUnits","lotSizes","defaultRefine"],land:["lotSizes","bedPerc","landRefine"]};function S(W){var V=document.getElementById(W);return V&&V.id===W}function F(){var W=document.createElement("div"),V=document.createElement("strong");W.className="LMIMessages tip";V.appendChild(document.createTextNode(M("js.dropdown.tip")));W.appendChild(V);V=document.createElement("span");V.appendChild(document.createTextNode(M("js.dropdown.tip.text")));W.appendChild(V);return W}function J(V,W,X){return function(Y){var Z=Y||window.event;R.stopEvent(Z);(document.createElement("img")).src=X+";jsessionid="+LMI.Data.state.sessionId+"?noresponse=1";V.clearSection("recent")}}function N(V,X){var W=document.createElement("a");W.href="#";R.on(W,"click",J(V,W,X));W.appendChild(document.createTextNode(M("js.dropdown.clear")));return W}function U(Z){var W,Y,V,X=LMI.Data.recentSearches;if(S(Z)){if(LMI.Data.searchType==="PROPERTY"){Y=new LMI.DropDown(Z,D);Y.addModule(LMI.DropDown.Hint);Y.setHintText(M("js.what.hint"));V=N(Y,LMI.Data.Urls.removeSearches);Y.addSection("recent",M("js.titles.recent"),{hint:V});if(X){for(W in X){if(X.hasOwnProperty(W)&&X[W].searchTerms){Y.addItem(X[W].searchTerms,"recent")}}}}else{}}}function L(b){var Y,X,W,Z=LMI.Data,V=Z.recentLocations;if(S(b)){X=new LMI.DropDown(b,D);X.addSection("suggest",M("js.dropdown.suggestions"));X.addModule(LMI.DropDown.Hint);X.setHintText(M("js.where.hint"));X.addModule(LMI.DropDown.Suggest);W=N(X,Z.Urls.removeLocations);X.addSection("recent",M("js.titles.recentlocs"),{hint:W});if(V){for(Y in V){if(V.hasOwnProperty(Y)){X.addItem(V[Y].locationValue,"recent")}}}X.menu.appendChild(F())}}function I(X,W){var V;for(V=0;V<X.length;V++){if(X[V]===W){return true}}return false}function E(){var X=document.getElementById("refine"),V,W;if(X){V=LMI.Element.getAll("#refine .refineList li span span",X);LMI.Lang.forEach(V,function(Y){LMI.Element.destroy(Y)});W=LMI.Element.getOne("#openHouse label span");if(W){LMI.Element.destroy(W)}}}function A(Z){var b,Y,X=document.getElementById("searchOptions"),V,a=document.getElementById("refine"),W,c=document.getElementById("priceRange");if(Z.match("Rent")){Z="rent"}else{if(Z.match("Multi")){Z="multi"}else{if(Z.match("Land")){Z="land"}else{Z="sale"}}}if(Q!==Z){Y=C[Z];V=X.getElementsByTagName("div");for(W=0;W<V.length;W++){b=V[W];if(b.id&&b.id!=="priceRange"){if(I(Y,b.id)){if(b.className.match(/hidden/)!==null){b.className=b.className.replace(/hidden/,"")}}else{if(b.className.match(/hidden/)===null){b.className+=(b.className.length>0?" ":"")+"hidden"}}}}if(a){for(b=a.firstChild;b;b=b.nextSibling){if(b.id&&b.tagName==="DIV"){if(I(Y,b.id)){if(b.className.match(/hidden/)!==null){b.className=b.className.replace(/hidden/,"")}}else{if(b.className.match(/hidden/)===null){b.className+=(b.className.length>0?" ":"")+"hidden"}}}}}if(Z==="rent"){c.getElementsByTagName("label")[0].firstChild.nodeValue=M("js.search.monthly.rent.label")}else{if(Q==="rent"){c.getElementsByTagName("label")[0].firstChild.nodeValue=M("js.search.price.range.label")}}if(a){LMI.Refine.closeRefinementLists();E()}Q=Z}}function T(W){var V=W.target||W.srcElement;A(V.value)}function P(){var X=document.getElementById("propertyType"),W,V;if(X){W=X.getElementsByTagName("option");R.on(X,"change",T);for(V=0;V<W.length;V++){if(W[V].selected){Q=W[V].value===""?"sale":W[V].value;break}}}}function G(X){var W=LMI.MapSearchSize.getDimensions(),V=R.findTarget(X,"FORM");if(V.mapWidth){V.mapWidth.value=W.x;V.mapHeight.value=W.y}}function B(){var V=document.getElementById("searchForm");if(V){if(V.action.match(/mapsearch/)!==null){R.on(V,"submit",G)}}V=document.getElementById("openHouseForm");if(V){R.on(V,"submit",G)}}B();P();function H(){var V=document.getElementById("priceHint");V.className+=" hidden"}function K(X){var W=R.findTarget(X,"input"),V=document.getElementById("priceHint");if(W.id==="minPrice"){V.className=V.className.replace(/maxPriceHint/,"")}else{if(V.className.match(/maxPriceHint/)===null){V.className+=" maxPriceHint"}}V.className=V.className.replace(/hidden/,"");R.stopEvent(X)}function O(){var V=document.getElementById("minPrice"),W=document.getElementById("maxPrice");if(V){R.on(V,"focus",K);R.on(V,"blur",H)}if(W){R.on(W,"focus",K);R.on(W,"blur",H)}}O();return{createWhatDropDown:U,createWhereDropDown:L}})();LMI.MinEvents.addWindowLoadEvent(function(){LMI.SearchForm.createWhatDropDown("what");LMI.SearchForm.createWhereDropDown("where")});LMI.XHR=(function(){var getXHRObject,msXHRClass,msxhr=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];if(window.XMLHttpRequest){getXHRObject=function(){return new XMLHttpRequest()}}else{if(window.ActiveXObject&&navigator.userAgent.indexOf("Mac")===-1){getXHRObject=function(){var i,len,xhr;if(msXHRClass){return new ActiveXObject(msXHRClass)}else{for(i=0,len=msxhr.length;i<len;++i){try{xhr=new ActiveXObject(msxhr[i]);msXHRClass=msxhr[i];return xhr}catch(ex){}}}return null}}else{getXHRObject=function(){return null}}}function getStateChangeFunc(req){return function(){var reply;if(req.xhr.readyState===4){reply=req.xhr.responseText;req.callback(eval(reply))}}}function makeXHRRequest(url,type,callback){var req={xhr:getXHRObject(),callback:callback};if(req.xhr){req.xhr.onreadystatechange=getStateChangeFunc(req);req.xhr.open(type,url,true);req.xhr.send(null)}}return{makeXHRRequest:makeXHRRequest}})();LMI.Messages=(function(){var I={FIRST_CHILD:function(L,M){if(L.firstChild){L.insertBefore(M,L.firstChild)}else{L.appendChild(M)}}};var B,F="DSContents",C="firstChild";function K(L){var M=(L&&"insertionStrategy" in L)?L.insertionStrategy:C;switch(M){case"firstChild":return I.FIRST_CHILD;default:return M}}function D(M){var L=(M&&"insertionPoint" in M)?M.insertionPoint:F;if(typeof L=="string"){return document.getElementById(L)}else{return L}}function A(O,M){M=M||{};var N=K(M),L=D(M);if(!B){B=document.createElement("div");B.className="LMIMessages"}B.appendChild(O);if(M.type&&M.type=="error"){if(B.className.match(/error/)==null){B.className+=" error"}}else{if(B.className.match(/error/)!=null){B.className=B.className.replace(/error/,"")}}if(N&&L){N(L,B)}else{throw new Error("LMI.Messages: missing strategy or insertion point")}}function J(N,M){var L;if(typeof N==="string"){L=document.createTextNode(N);N=document.createElement("p");N.appendChild(L)}A(N,M)}function H(L){F=L}function G(L){C=L}function E(){if(B){B.parentNode.removeChild(B);B=null}}return{clear:E,addMessage:J,setInsertionStrategy:G,setInsertionPoint:H}})();LMI.PopupFormCollection=(function(){var B=[];function D(E){B.push(E)}function C(){for(o in B){if("popup" in B[o]&&B[o].popup!=null&&B[o].popup.className.match(/hidden/)==null){B[o].hidePopup()}}}function A(E){var F;for(F=0;F<B.length;F++){if(B[F].form.id==E+"Form"){return B[F]}}return null}return{registerForm:D,hidePopupForms:C,getPopupByName:A}})();LMI.PopupForm=(function(){var E=LMI.MinEvents;var J=null;function A(L,M){this.init(L,M)}A.prototype={init:function(P,R){var Q,N,L,M,O=this;this.form=document.getElementById(P+"Form");this.strategy={};if(this.form){this.shim=document.getElementById(P+"Shim");this.popup=document.getElementById(P+"Widget");LMI.PopupFormCollection.registerForm(this);if(R){if(typeof R=="object"){for(N=0;N<R.length;N++){L=document.getElementById(R[N]);if(L){E.on(L,"click",function(S){O.togglePopupHandler.call(O,S)})}}}else{L=document.getElementById(R);if(L){E.on(L,"click",function(S){O.togglePopupHandler.call(O,S)})}}}M=this.form.getElementsByTagName("input");for(N=0;N<M.length;N++){E.on(M[N],"keypress",function(T){var S=LMI.MinEvents.getKeyCode(T);if(S&&S==13){E.stopEvent(T);O.popupFormHandler.call(O,T)}})}E.on(this.form,"submit",function(S){E.stopEvent(S);O.popupFormHandler.call(O,S)});Q=document.getElementById(P+"Close");if(Q){E.on(Q,"click",function(S){O.togglePopupHandler.call(O,S)})}}J=B()},setStrategy:function(L){this.strategy=L},getStrategy:function(){return this.strategy},togglePopupHandler:function(L){this.togglePopupForm();E.stopEvent(L)},togglePopupForm:function(){var L=false;if(this.popup.className.match(/hidden/)==null){L=true}LMI.PopupFormCollection.hidePopupForms();LMI.Messages.clear();H(this.form);F(this.form);if(!L){if(this.strategy.showElem){this.strategy.showElem(this.popup)}else{K(this.popup);C(this.popup)}if(this.shim){K(this.shim)}}},hidePopup:function(){if(this.strategy.hideElem){this.strategy.hideElem(this.popup)}else{LMI.PopupForm.hideElem(this.popup)}if(this.shim){LMI.PopupForm.hideElem(this.shim)}},popupFormHandler:function(L){E.stopEvent(L);this.submitForm()},submitForm:function(){var L=LMI.Data.baseUrl;if(this.strategy.buildSubmitUrl){L=this.strategy.buildSubmitUrl.call(this,this.form)}H(this.form);LMI.XHR.makeXHRRequest(L,"post",this.getSubmitCallback())},getSubmitCallback:function(){var L=this;return function(M){if(M[0].success){L.handleSuccess.call(L,M[0])}else{L.handleError.call(L,M[0])}}},handleSuccess:function(L){var M;if(this.strategy.handleSuccess){this.strategy.handleSuccess.call(this,L)}else{if(L.infoMessages!=null){if(this.popup){M=document.getElementById("DSContents")}else{M=this.form.parentNode}for(o in L.infoMessages){LMI.Messages.addMessage(G(L.infoMessages[o]),{insertionPoint:M,insertionStrategy:J})}}}if(this.popup){this.hidePopup()}},handleError:function(M){var N,L,O,P;if(M.fieldErrors!=null||M.errors!=null){if(this.strategy.handleError){this.strategy.handleError.call(this,M)}else{if(M.fieldErrors!=null){for(o in M.fieldErrors){if(o){L=document.getElementById(o);if(L){L.className+=(L.className.length>0?" ":"")+"fieldError";L.parentNode.parentNode.appendChild(D(M.fieldErrors[o][0]))}}}}if(M.errors!=null){for(P=this.popup.firstChild;P;P=P.nextSibling){if("className" in P&&P.className.match(/contents/)!=null){O=P;break}}for(o in M.errors){if(o){LMI.Messages.addMessage(D(M.errors[o]),{insertionPoint:O})}}}}}}};function F(N){var L,M=0;if(N){L=N.getElementsByTagName("input");if(L.length>0){do{switch(L[M].type){case"checkbox":L[M].checked=false;break;case"hidden":break;default:L[M].value=""}M++}while(M<L.length)}L=N.getElementsByTagName("textarea");if(L.length>0){M=0;do{L[M].value="";M++}while(M<L.length)}}}function H(M){var N,L;if(M){N=M.getElementsByTagName("span");if(N.length>0){for(L=N.length-1;L>=0;L--){if(N[L].className.match(/formError/)!=null){N[L].parentNode.removeChild(N[L])}}}N=M.getElementsByTagName("input");if(N.length>0){for(L=N.length-1;L>=0;L--){if(N[L].className.match(/fieldError/)!=null){N[L].className=N[L].className.replace(/fieldError/,"")}}}}}function D(M){var L=G(M);span=document.createElement("span");span.className="formError";span.appendChild(document.createTextNode(L));return span}function G(N){var O=N.messageCode.name.toLowerCase(),M,L;while(O.match(/_/)!=null){O=O.replace(/_/,".")}M=LMI.Strings.getString("js."+O);for(L=0;L<N.messageValues.length;L++){M=M.replace("{"+L+"}",N.messageValues[L])}return M}function C(M){var L;if(M){L=M.getElementsByTagName("input");if(L&&L[0]){L[0].focus()}}}function K(L){L.className=L.className.replace(/hidden/,"")}function I(L){if(!L.className.match(/hidden/)){L.className+=(L.className.length>0?" ":"")+"hidden"}}function B(){if(document.getElementById("mapImage")){return function(N,P){var L,O,M=YAHOO.util.Dom;if(N.firstChild){N.insertBefore(P,N.firstChild)}else{N.appendChild(P)}L=LMI.Element.getAll(".control, .mapTilesLinks");O=P.offsetHeight+10;LMI.Lang.forEach(L,function(Q){if(Q.parentNode==document.body){M.setStyle(Q,"top",parseInt(M.getStyle(Q,"top"),10)+O+"px")}})}}else{return"firstChild"}}A.getErrorMessage=D;A.clearErrorMessages=H;A.getMessage=G;A.showElem=K;A.hideElem=I;A.focusForm=C;return A})();(function(){var B=YAHOO.util,F=B.Event,H=B.Dom,O=LMI.Element,J=3,L=1,P;function A(S,U){var W,V,R,T;S.style.left=0;S.style.top=0;W=O.getOffsets(U);V=O.getOffsets(S);R=W.x-V.x+(0.13*S.offsetWidth);T=(R<0?0:R);S.style.left=T+"px";S.style.top=(W.y-V.y-40)+"px"}function N(R){var S;if(LMI.Data.state.visitorVO.loggedInVisitor){S=O.getOne(".captcha",R);if(S){O.destroy(S)}O.getOne("input[name=fromAddress]",R).value=LMI.Data.state.visitorVO.loginId}else{S=O.getOne(".captcha img",R);if(S){O.setImageSrc(S,LMI.Urls.get("/email.captcha?t="+new Date().getTime()))}}}function K(R){var S=document.body.id==="mywww"?O.getOne("#emailLocs"):O.getOne(".contact .email a");N(R);R.style.visibility="hidden";LMI.PopupForm.showElem(R);A(R,S);R.style.visibility="visible"}function Q(R){N(R);LMI.PopupForm.showElem(R)}function M(R){LMI.PopupForm.hideElem(R)}function I(R){var T,S;if(L<J){T=O.create("div",null,{className:"textfield",children:[{tag:"div",className:"textInp",children:[{tag:"input",type:"text",id:"toAddress"+(L+1),name:"toAddress"}]}]});S=O.create("p",null,{children:[{tag:"a",href:"#",textValue:LMI.Strings.getString("js.email.remove.recipient"),events:{click:P}}]});L++;H.insertBefore(T,R);H.insertAfter(S,T);if(L===J){O.destroy(R)}}}function G(R){I(this);F.stopEvent(R)}LMI.LinkBehavior.add("addRecipient",G);function E(S){var R;O.destroy(H.getPreviousSibling(S));O.destroy(S);if(L===J){R=O.create("a",null,{href:"#",textValue:LMI.Strings.getString("js.email.add.recipients"),events:{click:G}});O.getOne(".toAddresses",this.popup).appendChild(R)}L--}P=function(R){E(this.parentNode);F.stopEvent(R)};LMI.LinkBehavior.add("removeRecipient",P);function C(T){var S,V,W,R,U;if(T.fieldErrors!==null||T.errors!==null){if(T.fieldErrors!==null){for(U in T.fieldErrors){if(U){if(U.match(/^toAddress/)!==null){R=U.match(/^toAddress(\d*)$/)[1];S=O.getAll(".emailMetaData input[name=toAddress]",this.popup)[R-1]}else{S=O.getOne("input[name="+U+"]",this.popup)}if(S){S.className+=(S.className.length>0?" ":"")+"fieldError";S.parentNode.parentNode.appendChild(LMI.PopupForm.getErrorMessage(T.fieldErrors[U][0]))}}}}if(T.errors!==null){for(W=this.popup.firstChild;W;W=W.nextSibling){if("className" in W&&W.className.match(/contents/)!==null){V=W;break}}for(U in T.errors){if(U){LMI.Messages.addMessage(LMI.PopupForm.getErrorMessage(T.errors[U]),{insertionPoint:V})}}}}}function D(U){var h=U.fromName.value,Y=U.fromAddress.value,R=U.copySelf.checked?1:0,Z=U.message.value,j=O.getAll("input[name=toAddress]",U),b="",d="",c=LMI.Data.pageHistory,W,e,k,a,T,X,S,V,g,i=U.id.match(/^(.*)EmailForm$/)[1];if(j){LMI.Lang.forEach(j,function(m,l){if(m.value){b+=(b.length>0?"&":"")+"toAddress"+(l+1)+"="+m.value}})}if(c&&c[0]){d=c[0].page;if(document.body.id!=="findOnMap"){if(c[0].queryString){d+="?"+c[0].queryString}}else{d+="?where="+O.getOne("input#where").value;for(g in LMI.Data.hiddens){if(!(g==="what"&&LMI.Data.hiddens[g]===null)){d+="&"+g+"="+encodeURIComponent(LMI.Data.hiddens[g])}}k=LMI.MapSearch.getMap();a=k.getLLPoint();T=k.getURPoint();X=k.getCenterPoint();S=k.getZoomLevel();if(k.vemap.GetMapStyle()===VEMapStyle.Birdseye){S+=16}d+="&bottomLeftLatitude="+a.Latitude.toFixed(6)+"&bottomLeftLongitude="+a.Longitude.toFixed(6)+"&topRightLatitude="+T.Latitude.toFixed(6)+"&topRightLongitude="+T.Longitude.toFixed(6)+"&mapLevel="+S}}if(i&&i==="agentBroker"){e="toBusiness"}else{switch(document.body.id){case"details":e="bizDetails";break;case"compare":e="compareResults";break;case"directions":e="directions";break;case"searchResults":case"findOnMap":case"gallery":e="searchResults";break;case"broker":e="realtorDetails";break;case"agent":e="agentDetails";break}}W=(document.body.id==="mywww"?LMI.Urls.get("/emailmylistings.ds"):LMI.Urls.get("/jsonemail.ds"))+"?"+b+"&fromName="+encodeURIComponent(h)+"&fromAddress="+Y+"&copySelf="+R+"&message="+encodeURIComponent(Z)+"&previousPath="+encodeURIComponent(d);if(e){W+="&emailTypeS="+e}if(e==="toBusiness"){W+="&emailBusiness=true"}if(!LMI.Data.state.visitorVO.loggedInVisitor){W+="&code="+U.code.value}if(document.body.id==="details"||document.body.id==="broker"||document.body.id==="agent"){W+="&emailListingId="+LMI.Data.listings[0].id}else{if(document.body.id==="mywww"){V=O.getAll("input[name=listingId]",U);if(V){LMI.Lang.forEach(V,function(l){W+="&listingId="+l.value})}}}return W}LMI.Init.addFunction(function(){var R=document.getElementById("pageEmailWidget"),S;if(R){S=new LMI.PopupForm("pageEmail","emailPopup");S.setStrategy({hideElem:M,showElem:document.body.id==="mywww"?K:Q,buildSubmitUrl:D,handleError:C})}R=document.getElementById("agentBrokerEmailWidget");if(R){S=new LMI.PopupForm("agentBrokerEmail");S.setStrategy({hideElem:M,showElem:K,buildSubmitUrl:D})}})})();LMI.MyList=(function(){var G=YAHOO.util,B=G.Dom,A=G.Event,H=LMI.Element,E=H.getOne;var C,F;var D={savePlaceCallback:function(I){},savePlaces:function(I){LMI.AjaxController.addToMyList(D.savePlaceCallback,I,null)},replaceLink:function(L){var K=L.parentNode,J=E("img",L),M=J?H.getImageSrc(J):"",I=H.create("a",null,{href:LMI.Urls.get("displaymywww.ds"),className:"inlist"});if(J){H.create("img",I,{tag:"img",src:M.replace(/addplace/,"inplaces"),alt:LMI.Strings.getString("js.inplacespc")})}else{H.create("text",I,{text:LMI.Strings.getString("js.inplacespc")})}K.replaceChild(I,L);B.addClass(K,"inlist")},positionPopup:function(I,M){var O,N,P,L,K,J;I.style.left="0";I.style.top="0";O=H.getOffsets(M);P=O.x+(Math.round(0.25*I.offsetWidth));L=(P<0?0:P);J=O.y;if(L+parseInt(B.getStyle(I,"width"),10)>B.getViewportWidth()-10){L=L-(L+parseInt(B.getStyle(I,"width"),10)-B.getViewportWidth()+20)}if(J+I.offsetHeight>B.getViewportHeight()-10){J=J-(J+I.offsetHeight-B.getViewportHeight()+20)}B.setStyle(I,"left",L+"px");B.setStyle(I,"top",J+"px")},showLoginForm:function(L,J,R){var P=LMI.PopupFormCollection.getPopupByName("login"),Q=LMI.PopupFormCollection.getPopupByName("register"),O,M,N,I,K;C=L;F=J;if(P){P.togglePopupForm();D.positionPopup(P.popup,L);if(P.shim){P.shim.style.left=B.getStyle(P.popup,"left");P.shim.style.top=B.getStyle(P.popup,"top")}O=P.getStrategy();M=O.handleSuccess;O.hideElem=function(S){if(S==P.popup){O.handleSuccess=M;P.setStrategy(O);S.style.left="";S.style.top=""}LMI.PopupForm.hideElem(S)};O.handleSuccess=function(S){M.call(this,S);D.savePlaces([J]);D.replaceLink(L);if(R){R.call()}};P.setStrategy(O)}if(Q){N=Q.getStrategy();I=N.handleSuccess;N.hideElem=function(S){if(S==Q.popup){N.handleSuccess=I;Q.setStrategy(N);C=null;F=null;S.style.left="";S.style.top=""}LMI.PopupForm.hideElem(S)};N.handleSuccess=function(S){I.call(this,S);D.savePlaces([J]);D.replaceLink(L);if(R){R.call()}};Q.setStrategy(N)}},savePlaceLinkHandler:function(J,L){var K=this.id.replace(/^addML_/,""),I=this;A.stopEvent(J);if(LMI.Data.state.visitorVO.loggedInVisitor){D.savePlaces([K]);D.replaceLink(I);if(L){L.call()}}else{D.showLoginForm(I,K,L)}}};LMI.LinkBehavior.add("savePlace",D.savePlaceLinkHandler);return D})();LMI.StretchyPages=(function(){var B=YAHOO.util,F=B.Dom,E=B.Event,I=LMI.Element,A=[],C,D,H,G={minWindowSize:863,onResize:new B.CustomEvent("resize"),init:function(J,K){A=J;if(K){if(K.pre){D=K.pre}if(K.post){H=K.post}if("bottomMargin" in K){C=K.bottomMargin}}if(typeof C==="undefined"){C=document.getElementById("foot").offsetHeight+15}G.resize();E.on(window,"resize",G.resize)},resize:function(){var J=LMI.Window.getHeight()-C;if(D){D()}LMI.Lang.forEach(A,function(M){var L,O,K,N;if(M){O=Math.ceil(F.getXY(M)[1]);K=parseInt(F.getStyle(M,"height"),10);N=isNaN(K)?0:M.offsetHeight-K;L=Math.max(G.minWindowSize,J)-(O+N);if(L>0){M.style.height=L+"px"}}});if(H){H()}G.onResize.fire();if(YAHOO.env.ua.ie){E.on(window,"beforeprint",function(){E.removeListener(window,"resize",G.resize);LMI.Lang.forEach(I.getAll(".control"),function(K){K.style.display="none"});I.getOne(".mapTilesLinks").style.display="none"});E.on(window,"afterprint",function(){E.on(window,"resize",G.resize);LMI.Lang.forEach(I.getAll(".control"),function(K){K.style.display="block"});I.getOne(".mapTilesLinks").style.display="block"})}}};return G})();LMI.Refine=(function(){var D=YAHOO.util,R=D.Dom,Q=D.Event,S=LMI.Element,H=S.getOne,K=S.getAll,M,B;function G(W){var T=parseFloat(H("#refine").offsetHeight,100),V,U;if(T!==W){V=T-W;U=K(".control, .mapTilesLinks");LMI.Lang.forEach(U,function(X){R.setStyle(X,"top",parseFloat(R.getStyle(X,"top"),100)+V+"px")})}}function O(W){var V=Q.getTarget(W),U=R.getAncestorByClassName(V,"refineList"),T;if(U===null){T=K("#refine .refineList");LMI.Lang.forEach(T,function(X){if(!R.hasClass(X,"hidden")){M(W,X)}})}}function N(Y){var U=K("input",Y),W=S.create("ul"),V,X=0,T=parseFloat(H("#refine").offsetHeight,100),Z=H("#"+Y.parentNode.id+">ul");LMI.Lang.forEach(U,function(a){if(a.checked){if(X<3){V=a.parentNode.firstChild.nextSibling.firstChild.nodeValue;S.create("li",W,{children:[{tag:"a",className:"removeRef_"+a.className,href:"#",events:{click:B},children:[{tag:"img",src:LMI.Urls.getImg("refine_close.gif"),alt:""}]},{tag:"text",text:V}]})}X++}});if(X>3){W.removeChild(W.lastChild);S.create("li",W,{children:[{tag:"a",href:"#",text:LMI.Strings.getString("js.search.refine.more"),events:{click:function(a){M(a,Y)}}}]})}if(X===0){if(Z){S.destroy(Z)}}else{if(Z){Y.parentNode.replaceChild(W,Z)}else{H("#"+Y.parentNode.id).appendChild(W)}}G(T)}function P(T){var U=YAHOO.env.ua.ie;R.addClass(T,"hidden");R.removeClass(T.parentNode,"active");if(U&&U<7){R.addClass(H(".refineShim",T.parentNode),"hidden")}N(T);Q.removeListener(document.body,"click",O)}function C(){var T=K("#refine .refineList");LMI.Lang.forEach(T,function(U){if(!R.hasClass(U,"hidden")){P(U)}})}M=function(U,T){var V=YAHOO.env.ua.ie;if(R.hasClass(T,"hidden")){C();R.removeClass(T,"hidden");R.addClass(T.parentNode,"active");if(V&&V<7){R.removeClass(H(".refineShim",T.parentNode),"hidden")}Q.on(document.body,"click",O)}else{P(T)}Q.stopEvent(U)};B=function(V){var X=this.className.replace(/removeRef_/,""),W=R.getAncestorByClassName(this,"refinement"),U=H(".refineList",W),T;T=H("input."+X,U);T.checked=false;N(U);Q.stopEvent(V)};LMI.LinkBehavior.add("removeRefinement",B);function I(T){var U=R.getAncestorByClassName(this,"refineList");M(T,U)}LMI.Init.addFunction(function(){var T=K("div.refineList .closeRefine");LMI.Lang.forEach(T,function(U){Q.on(U,"click",I)})});function F(T){var U;if(this.id&&this.id.match(/^more_/)){U=H(".refineList",R.getAncestorByClassName(this,"refinement"))}else{U=R.getPreviousSibling(this.parentNode)}M(T,U)}LMI.LinkBehavior.add("openRefinement",F);function E(V){var U=R.getAncestorByClassName(this,"refineList"),T=K("input[type=checkbox]",U);LMI.Lang.forEach(T,function(W){W.checked=false});M(V,U)}LMI.LinkBehavior.add("clearRefinement",E);function J(T){var U=H("#abRefinement"),V=H("input[name=agentId]")||H("input[name=brokerId]");if(V){S.destroy(V)}if(U){S.destroy(U)}Q.stopEvent(T)}LMI.LinkBehavior.add("clearABRefinement",J);function A(U){var a=new LMI.Form(),V,X,g,d,W,Y,Z,T,c,b,e;Y=K(".wwwCont .inputCont");LMI.Lang.forEach(Y,function(h){if(!R.hasClass(h,"hidden")){Z=K("input, select",h);LMI.Lang.forEach(Z,function(j){if(j.type!=="checkbox"||j.checked){if((j.name!=="what"&&j.name!=="where")||!R.hasClass(j,"hintText")){a.setVar(j.name,j.value)}else{a.setVar(j.name,"")}}})}});if(R.hasClass("defaultRefine","hidden")){W="landRefine"}else{W="defaultRefine"}V=K("#"+W+" .refinement");LMI.Lang.forEach(V,function(h){g="";X=K("input[type=checkbox]",h);LMI.Lang.forEach(X,function(j,k){if(j.checked){g+=j.value+","}});if(g.length>0){g=g.substring(0,g.length-1)}a.setVar(h.id,g)});Y=K(".searchForm input[type=hidden]");LMI.Lang.forEach(Y,function(h){a.setVar(h.name,h.value)});a.setAction(H("#searchForm").action);if("MapSearch" in LMI){T=LMI.MapSearch.getMap();if(LMI.Data.textBasedSearch||a.getVar("where")[0]!==LMI.Data.whereTerm||!LMI.Data.mapSearchResults){a.setVar("mapWidth",T.width);a.setVar("mapHeight",T.height);a.setVar("mapLevel",0)}else{c=T.getLLPoint();b=T.getURPoint();e=T.getZoomLevel()||0;a.setVar("bottomLeftLatitude",c.Latitude.toFixed(6));a.setVar("bottomLeftLongitude",c.Longitude.toFixed(6));a.setVar("topRightLatitude",b.Latitude.toFixed(6));a.setVar("topRightLongitude",b.Longitude.toFixed(6));a.setVar("mapLevel",e)}}else{if("whereTerm" in LMI.Data&&a.getVar("where")[0]!==LMI.Data.whereTerm){d=LMI.MapSearchSize.getDimensions();a.setVar("mapWidth",d.x);a.setVar("mapHeight",d.y);a.setVar("mapLevel",0);a.removeVar("bottomLeftLatitude");a.removeVar("bottomLeftLongitude");a.removeVar("topRightLatitude");a.removeVar("topRightLongitude");a.setAction("mapsearch.ds")}}a.setMethod("get");a.submit()}function L(T){Q.stopEvent(T);A(this)}LMI.Init.addFunction(function(){if("searchType" in LMI.Data&&LMI.Data.searchType==="PROPERTY"){Q.on("searchForm","submit",L)}},70);return{closeRefinementLists:C}})();