Object.extend(String.prototype,{camelize:function(){var D=this.split("-");if(D.length==1){return D[0]}var B=this.indexOf("-")==0?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var C=1,A=D.length;C<A;C++){var E=D[C];B+=E.charAt(0).toUpperCase()+E.substring(1)}return B}});if(!window.Event){var Event=new Object()}Object.extend(Event,{observe:function(C,B,A){C=$(C);if(C.addEventListener){C.addEventListener(B,A,false);return true}else{if(C.attachEvent){return C.attachEvent("on"+B,A)}else{return false}}},event:function(A){return A=A||window.event},element:function(A){A=this.event(A);return A.target||A.srcElement},stop:function(A){A=this.event(A);if(A.preventDefault){A.preventDefault();A.stopPropagation()}else{A.returnValue=false;A.cancelBubble=true}},stopObserving:function(D,C,B,A){D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.detachEvent)){C="keydown"}if(D.removeEventListener){D.removeEventListener(C,B,A)}else{if(D.detachEvent){D.detachEvent("on"+C,B)}}},findElement:function(B,A){return findElement(Event.element(B),A.toUpperCase())}});var $A=function(C){if(!C){return[]}if(C.toArray){return C.toArray()}else{var B=[];for(var A=0;A<C.length;A++){B.push(C[A])}return B}};Function.prototype.bind=function(){var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}};if(!window.Element){var Element=new Object()}Element.extend=function(C){if(!C){return }if(_nativeExtensions){return C}if(!C._extended&&C.tagName&&C!=window){var B=Element.Methods,A=Element.extend.cache;for(var E in B){var D=B[E];if(typeof D=="function"){C[E]=A.findOrStore(D)}}}C._extended=true;return C};Element.extend.cache={findOrStore:function(A){return this[A]=this[A]||function(){return A.apply(null,[this].concat($A(arguments)))}}};Element.Methods={addClassName:function(B,A){B=$(B);B.className=B.className.split(" ").concat(A).join(" ")},hasClassName:function(B,A){return(B.className.indexOf(A)!=-1)},removeClassName:function(C,B){C=$(C);var D=C.className.split(" ");var E=[];for(var A=0;A<D.length;A++){if(D[A]!=B){E[E.length]=D[A]}}C.className=E.join(" ")},childOf:function(B,A){B=$(B),A=$(A);while(B=B.parentNode){if(B==A){return true}}},getStyle:function(B,C){B=$(B);var D=B.style[C.camelize()];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=A?A.getPropertyValue(C):null}else{if(B.currentStyle){D=B.currentStyle[C.camelize()]}}}if(window.opera&&["left","top","right","bottom"].include(C)){if(Element.getStyle(B,"position")=="static"){D="auto"}}return D=="auto"?null:D},setStyle:function(B,C){for(var A in C){$(B).style[A]=C[A]}},show:function(A){A.style.display=""},hide:function(A){A.style.display="none"},visible:function(A){return $(A).style.display!="none"},getDimensions:function(B){B=$(B);if(Element.getStyle(B,"display")!="none"){return{width:B.offsetWidth,height:B.offsetHeight}}var A=B.style;var E=A.visibility;var C=A.position;A.visibility="hidden";A.position="absolute";A.display="";var F=B.clientWidth;var D=B.clientHeight;A.display="none";A.position=C;A.visibility=E;return{width:F,height:D}}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){var HTMLElement={};HTMLElement.prototype=document.createElement("div").__proto__}Element.addMethods=function(B){Object.extend(Element.Methods,B||{});if(typeof HTMLElement!="undefined"){var B=Element.Methods,A=Element.extend.cache;for(var D in B){var C=B[D];if(typeof C=="function"){HTMLElement.prototype[D]=A.findOrStore(C)}}_nativeExtensions=true}};Element.addMethods();function $(){var C=[],B;for(var A=0;A<arguments.length;A++){B=arguments[A];if(typeof B=="string"){B=document.getElementById(B)}C.push(Element.extend(B))}return C.length<2?C[0]:C}if(!window.Class){window.Class={create:function(){return function(){this.initialize.apply(this,arguments)}}}}function dtPop(B){B=$(B)||Event.element(B);if(window.makeCalE){makeCalE(B)}else{if(!B.id){B.id="mnpCalendar"}MNP.Util.attachCss("/css/common/datepicker.css");var C=MNP.Modules;var A=[C.Calendar];if(!window.MnpEffect){A[A.length]=C.MnpEffect}LazyLoad.load(A,function(){dtPop(B.id)})}}MNP.insertCal=function(A){A=$(A);if(A){var B=$E("img",{parentNode:A,attributes:{src:"/images/common/i.gif",width:"20",height:"20",className:"calendarIcon"}});Event.observe(B,"click",function(){dtPop(B)})}};function linkOrd(B,E){var A=$(B);if(A){var C=$T("a",A);for(var D=0;D<C.length;D++){linkId(C[D],E,D)}}}function linkId(A,E,D){var B="&lid="+E;if(D){B="&lpos="+D+B}var C=$(A);if(C){C.name=B}}MNP.Track={link:function(B,A,C){if(window.s){var D=B;if(A){D+=A}s.events="";s.tl(true,"o",D)}},view:function(A,B){},linkElementByEvent:function(B){var A=Event.findElement(B,"a");this.trackByElement(A)},pageLink:function(B,A){var C=B;if(A){C+=("_"+A)}if(MNP.pn){C=MNP.pn+"_"+C}this.link(C)},trackByElement:function(A){if(A){var C=A.getAttribute("aid");var B=A.getAttribute("apos")||"";if(C){MNP.Track.link(C,B)}}}};function addLoadEvent(B,A){if(Event.onDOMReady){Event.onDOMReady(B,A)}else{Event.observe(window,"load",B)}}function addTimeout(A){window.setTimeout(A,1000)}function rnd(){var A=new Date().getTime();A=(A*9301+49297)%233280;return Math.round((A/(233280))*10000)}MNP.Form={setFocus:function(){for(var A=0;A<arguments.length;A++){var B=$(arguments[A]);if(B&&B.type!="hidden"&&!B.disabled){try{B.focus()}catch(C){}}}}};var LazyLoad=function(){var B=null;var A=[];return{load:function(H,I,G,E){var F={urls:H,callback:I,obj:G,scope:E};if(B){A.push(F);return }B=F;H=H.constructor===Array?H:[H];var C;for(var D=0;D<H.length;D+=1){if(H[D].indexOf(".css")!=-1){C=MNP.Util.attachCss(H[D])}else{C=MNP.Util.attachScript(H[D])}}if(!C){return }if(MNP.Browser.IE){C.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){LazyLoad.requestComplete()}}}else{if(MNP.Browser.Saf){C=$E("script",{text:"setTimeout(LazyLoad.requestComplete.bind(LazyLoad),100);"})}else{C=$E("script",{text:"LazyLoad.requestComplete();"})}}},loadOnce:function(K,L,I,M,D){var E=[],F=$T("script");K=K.constructor===Array?K:[K];for(var J=0;J<K.length;J+=1){var H=false,C=MNP.Util._isLocal(K[J]);for(var G=0;G<F.length;G+=1){if(F[G].src.indexOf(C)!=-1){H=true;break}}if(!H){E.push(C)}}if(E.length>0){this.load(E,L,I,M)}else{if(D){if(I){if(M){L.call(I)}else{L.call(window,I)}}else{L.call()}}}},requestComplete:function(){if(B.callback){if(B.obj){if(B.scope){B.callback.call(B.obj)}else{B.callback.call(window,B.obj)}}else{B.callback.call()}}B=null;if(A.length>0){var C=A.shift();this.load(C.urls,C.callback,C.obj,C.scope)}}}}();function ulChop(B,A){B=$(B);if(B){var G=$T("li",B);var F,C=B.parentNode;for(var E=0,D=G.length;E<D;E++){if((E%A)===0){F=$E("ul");C.insertBefore(F,B)}F.appendChild(G[0])}C.removeChild(B)}}if(window.Event){Event.observe(window,"load",function(){window.setTimeout(function(){if(MNP.Browser.map&&!MNP.pl){var A=document.createElement("iframe");A.style.display="none";A.src="/preloader.jsp";document.body.appendChild(A)}},2000)})}MNP.Messages=function(){function A(I,D){var C=$(I);if(C&&D){var H=D.errors;if(H){for(var F=0;F<H.length;F++){var G=H[F],J=$("erritem_"+G.name),B=$("err_"+G.name);if(B){J.style.display="none"}else{var E=J.parentNode;E.style.display="";Element.removeClassName(E,"jshide")}}}}}return{initErrors:A}}();var SimpleAjax=function(){function B(){var E;for(var D=0;D<arguments.length;D++){var C=arguments[D];try{E=C();break}catch(F){}}return E}function A(){return B(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})}return{getTransport:A,enabled:function(){return !!A()}()}}();SimpleAjax.Request=function(A,C){var E=SimpleAjax.getTransport();E.open("GET",A);try{E.onreadystatechange=B}catch(D){}E.send(null);function B(){if(E.readyState>=4){try{if(E&&E.status==200&&C.onSuccess){return C.onSuccess(E)}else{if(C.onFailure){return C.onFailure(E)}}}catch(F){return }}if(E.readyState==5){E.onreadystatechange=function(){}}}return{transport:E}};MNP.Form.Watcher=function(D){var B=[],C;function A(){var I=$(D),K=I.elements,H=K.length;for(var G=0;G<H;G++){var F=K[G],L=F.nodeName.toLowerCase(),J;if(L=="input"){if(F.type&&F.type!="hidden"){J=new MNP.Form.Input(F)}}if(L=="textarea"){J=new MNP.Form.Input(F)}if(J){B[B.length]=J}}}function E(){for(var G=0,F=B.length;G<F;G++){B[G].focus()}}A();return{blur:E}};MNP.Form.Base=function(){return{blur:function(){var A=this.el;if(A.alt&&(A.value.strip()===""||A.value===A.alt)){A.value=A.alt;A.style.color="#aaa"}},focus:function(){var A=this.el;if(A.alt&&A.value===A.alt){A.value="";A.style.color="#000"}}}};MNP.Form.Input=Class.create();MNP.Form.Input.prototype=Object.extend(new MNP.Form.Base(),{initialize:function(B,A){B=$(B);this.el=B;var C=B.getAttribute("alt");if(!C){C=B.getAttribute("title")}if(C){B.alt=C;this.blur();Event.observe(B,"focus",this.focus.bind(this));Event.observe(B,"blur",this.blur.bind(this))}}});MNP.SearchForm=function(){var E,C,D,H,J=this,K,I="submit",F="Searching ...";function G(M){var L=$(M||"q");if(L){D=L;C=L.form;H=new MNP.Form.Input(L);E=A();Event.observe(C,I,B)}}function B(M){if(E){var L=E.className.match(/mnp-search/)?F:"";if(L){E.oldInnerHTML=E.innerHTML;E.innerHTML="<span><span>"+L+"</span></span>";E.blur()}}if(SimpleAjax.enabled){Event.stop(M);H.focus();setTimeout(function(){validateSearch(C);H.blur()}.bind(this),100)}}function A(){var Q=this.form,P=$T("button",Q),M=P.length,L;for(var O=0;O<M;O++){var N=P[O];if(N.type&&N.type===I){L=N}}return L}return{init:G}}();function validateSearch(E){var F=E.q,C=E.btnS,D=$("qError"),B=escape(F.value),A="/validate/searchterm?term=";if(F.alt&&F.value===F.alt){B=""}A+=B;new SimpleAjax.Request(A,{method:"get",onSuccess:function(H){var G=getEval("("+H.responseText+")");if(G&&G.status.code==0){E.submit()}else{if(C&&C.oldInnerHTML){C.innerHTML=C.oldInnerHTML}if(G){if(D){var I=G.status.message;if(I){D.innerHTML=I;D.style.display="block"}else{D.style.display="none"}}}}}.bind(this)})}MNP.Form.PhoneMask=function(D){function C(I){if(I.createTextRange){var H=document.selection.createRange().duplicate();H.moveEnd("character",I.value.length);if(H.text===""){return I.value.length}return I.value.lastIndexOf(H.text)}else{return I.selectionStart}}function F(I){if(I.createTextRange){var H=document.selection.createRange().duplicate();H.moveStart("character",-I.value.length);return H.text.length}else{return I.selectionEnd}}function E(I,J){if(I.createTextRange){var H=I.createTextRange();H.move("character",J);H.select()}else{if(I.selectionStart){I.focus();I.setSelectionRange(J,J)}}}function B(J,I){var H="";if(I<10){if(I===0){H+="("}H+=J;if(I==2){H+=") "}if(I==5){H+="-"}}return H}function A(P,K){var J=Event.element(P),S=J.value,I=S.length,H=C(J),L=F(J),Q=P.keyCode||P.which,T=0,R="",O;if(I===0||(J.alt&&(S==J.alt))){return }if(Q<47){return }if(!Q>47&&!Q<58){return }for(var M=0;M<I;M++){var N=S.charAt(M);if(N.search(/[0-9]/)!=-1){R+=B(N,T);T++}}J.value=R;if(K){E(J,H+(R.length-I))}}function G(H){A(H,1)}Event.observe(D,"keyup",G);Event.observe(D,"blur",A)};MNP.AutoCompleter=function(){var B=[];function A(D){var E=$(D),C="autocomplete";E.form.setAttribute(C,"off");E.setAttribute(C,"off")}return{show:function(D,C){B[D].processResults(C)},add:function(C,D){if(!B){B=[]}A(C);if(!MNP.AutoComplete){LazyLoad.load("/js/build/common/AutoComplete.js",function(){MNP.AutoCompleter.add(C,D)})}else{B[C]=new MNP.AutoComplete(C,D)}}}}();MNP.AutoComplete=function(l,T){var Y,H,R,V=200,k=setTimeout,C=clearTimeout,a=window.Event,P=Element,g,A,G=[],M,L={},j,Z="acframe",U="n",d="query",b="",f="autocomplete",S=f+"load";var Q={host:"/svc/search/suggest.svc",url:"?q=",link:"/search?q=",charNum:3};function E(){Q=Object.extend(Q,T||{});Q.url=Q.host+Q.url;l=$(l);a.observe(l,"keydown",O);a.observe(l,"blur",W);a.observe(l,"click",W);MNP.Page.addLinkClickByRel(f,F)}function O(m){var n=m.which||m.keyCode;if(n<48&&n>8&&n!=32){if(n==40){e(1)}else{if(n==38){e(-1)}}}else{if(H){C(H)}H=k(J,V)}}function e(m){if(A){g+=m;if(g>A-1){g=A-1}if(g<0){g=0}D(g)}}function D(o,t){var n=$T("li",Y);for(var p=0,m=n.length;p<m;p++){var r=n[p],q=b;if(p==o){q="hover";if(!t){l.value=M[U][p]}}r.className=q}}function J(){var m=l.value;if(m.length<Q.charNum){W()}else{N();M=L[m];if(M){K(M[U])}else{G[m]=$E("script",{attributes:{src:Q.url+escape(m)+"&js="+l.id},par:$T("head")[0]})}}}function h(n){M=n;if(M){var o=M[d],p=M[U],m=G[o];L[o]=M;if(l.value===o){K(p)}if(m){m.parentNode.removeChild(m)}}}function K(p){if(!Y){Y=X()}I();if(R){C(R)}if(p.length){Y.innerHTML=b;var m=Position.cumulativeOffset(l),o=$E("ul",{anonymous:true});P.setStyle(Y,{top:B(m[1]+l.offsetHeight),left:B(m[0]),width:B(l.offsetWidth),display:"block"});A=p.length;g=-1;for(var n=0;n<A;n++){i(p[n],n,o)}Y.appendChild(o);if(window.setHideFrame){setHideFrame(Y,Z)}}else{c()}}function B(m){return[m,"px"].join(b)}function X(){var m=$E("div",{className:f});a.observe(m,"mousedown",function(n){j=1});a.observe(m,"mouseover",function(o){var n=a.element(o);if(n.nodeName.toLowerCase()=="a"){D(n.tabIndex,1)}});return m}function F(o,n,m){Event.stop(o);j=0;c();l.value=n.title;l.form.submit()}function i(o,n,m){$E("a",{attributes:{tabIndex:n,rel:f,href:Q.link+o,title:o},text:o,parentNode:$E("li",{par:m})})}function N(){if(l.value.length>=Q.charNum){P.addClassName(l,S)}}function I(){P.removeClassName(l,S)}function W(m){if(R){C(R)}R=k(c,(typeof m=="object"?500:m))}function c(){if(R){C(R)}if(Y&&!j){Y.style.display="none";Y.innerHTML=b}I();A=0;if(window.setHideFrame){setHideFrame(Y,Z,"none")}if(j){j=0;l.focus();K(M[U])}}E();return{processResults:h}};if(!window.Position){var Position={cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return[C,A]}}}MNP.FB=function(){var I="FB_HiddenContainer",K="/js/build/landing_ajax.js",O="/facebook/xd_receiver.htm",X="/facebook/connect",P="/facebook/registernewuser",E="/ajax/facebook/posttowallcallback",H="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php",R="Sorry.  Cound not load Facebook Connect",W=0,Z=30,G,Y=500,C,M;function L(b){W++;if(!window.FB){if(!$(I)){B()}LazyLoad.load(H,function(){U(b)})}else{if(!M){N();U(b)}else{if(!window.FB.Connect){if(W>Z){return alert(R)}U(b)}else{W=0;b()}}}}function U(b){G=window.setTimeout(function(){L(b)},Y)}function N(){M=1;FB.init(MNP.fbKey,O)}function B(){var b=$E("div",{id:I});Element.setStyle(b,{position:"absolute",left:"-10000px",top:"-10000px",width:"0px",height:"0px"});window.document.body.insertBefore(b,window.document.body.firstChild)}function J(b){L(function(){FB.Connect.requireSession(b)})}function S(){if(C){window.clearTimeout(C)}V(Q)}function Q(){MNP.Ajax.Load.initialize(X,{screen:{cancel:true,opacity:0.3},directUrl:true,closeF:function(){MNP.Ajax.Load.initialize(P,{directUrl:true})}})}function V(b){if(!MNP.Ajax){LazyLoad.load(K,b)}else{b()}}function T(){L(function(){FB.Connect.logout(function(){SimpleAjax.Request(uncache(window.location.href))})})}function A(){if(window.restorePage){restorePage(1)}if(window.Mbox){C=window.setTimeout(Mbox.cancel,1000)}return J(S)}function F(c,b){var g=Form.serialize(b).split("&"),e={};for(var f=0;f<g.length;f++){var k=g[f],h=k.split("="),j=h[0],d=unescape(h[1]);if(d.indexOf("[")!=-1){d=getEval(d)}e[j]=d}D(c,e)}function D(c,d,b){if(window.Mbox){if(Mbox.isActive()){C=window.setTimeout(Mbox.cancel,1000)}}L(function(){FB.Connect.showFeedDialog(c,d,null,null,null,FB.RequireConnect.promptConnect,function(){a(d)},b)})}function a(b){MNP.Ajax.Request(E,{method:"post",postBody:"comment="+b.comment+"&propertyKey="+b.propertyKey,onSuccess:function(d){var c=$E("div");Element.update(c,MNP.Ajax.getAjaxContent(d))}})}return{connect:A,logout:T,postToWall:F,postToWallDirect:D,api:1}}();MNP.Link=function(){function F(T,N,U){Event.stop(T);var W="scrollbars,resizable,directories,menubar,location,toolbar,status,mnp-noautoresize",V,M=Object.extend({width:null,height:null,size:0.8,name:"mnpw",center:true,features:null,focus:true},U||{});N=J(T,N);A(N);var L=[],O,S,X="";if(window.getWinWidth){S=getWinWidth()*M.size;O=getWinHeight()*M.size}else{M.size=0}function P(Y){if(X.length>1){X+=","}X+=Y+"=1"}if(Element.classNames){Element.classNames(N).each(function(Y){if(W.indexOf(Y)!=-1){P(Y);if(Y==="mnp-noautoresize"){M.size=0}}})}if(M.size!==0){if(!X){var R=W.split(",");for(var Q=0;Q<R.length;Q++){P(R[Q])}}X+=","+X+",height="+O+",width="+S}if(!X){V=window.open(N.href)}else{V=window.open(N.href,M.name,X)}if(M.focus){V.focus()}else{V.blur()}return V}function B(M,L){K(J(M,L),"Inquiry",/inquiry\/(\w+).*/,displayUrl)}function I(M,L){K(J(M,L),"Property",/apartment\/(\w+).*/,displayDetailedListing)}function G(N,L){var M=J(N,L);if(M.rel&&M.rel=="saved"){document.location=M.href}K(M,"Save",/(propertyKey=|\/save\/)(\w+).*/,saveFav)}function H(P,N,L,M){if(MNP.Ajax){var O=J(P,N);A(O);MNP.Ajax.Load.initialize(O.href,M)}else{return false}}function C(N,M,L){return H(N,M,L,{directUrl:true})}function D(L){MNP.Help.popX(L)}function K(M,Q,O,L){var P=M.href,N=null;if(!M.name){M.name=Q}if(O){N=P.match(O);if(N){N=N[N.length-1]}}A(M);L(P,{el:M,pk:N})}function J(N,L){if(N){Event.stop(N)}var M=$(L);if(M&&M.href){return M}else{return Event.findElement(N,"a")}}function A(M){if(M.name.indexOf("lid=")!=-1){return }var L=M.getAttribute("apos");var N=M.getAttribute("aid")||M.lid||M.name;if(N){MNP.Track.link(N,L,M)}}var E={external:F.bind(this),property:I.bind(this),save:G.bind(this),ajax:H.bind(this),"ajax-direct":C.bind(this)};MNP.Page.addLinkClick(function(P,N,L){var M=E[L];if(M){var O=M(P,N,L);if(O===false){return false}else{Event.stop(P)}}});return{external:F,property:I,save:G,help:D,ajax:H}}();