var APF={log:function(A){}};APF.Namespace={register:function(D){var C=D.split(".");var A=window;for(var B=0;B<C.length;B++){if(typeof A[C[B]]=="undefined"){A[C[B]]=new Object()}A=A[C[B]]}}};APF.Utils={getWindowSize:function(){var B=0,A=0;if(typeof (window.innerWidth)=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return{width:B,height:A}},getScroll:function(){var B=0,A=0;if(typeof (window.pageYOffset)=="number"){A=window.pageYOffset;B=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollTop;B=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}}}return{left:B,top:A}},setCookie:function(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")},getCookie:function(A){var F=document.cookie.split(";");var B="";var D="";var E="";var C=false;for(i=0;i<F.length;i++){B=F[i].split("=");D=B[0].replace(/^\s+|\s+$/g,"");if(D==A){C=true;if(B.length>1){E=unescape(B[1].replace(/^\s+|\s+$/g,""))}return E;break}B=null;D=""}if(!C){return null}},deleteCookie:function(A,C,B){if(this.getCookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}};String.prototype.substringPro=function(C,D){var E="";D=D||"...";if(this.getLen()<=C){return this}for(var B=0,A=0;A<C-D.length;){if(this.charCodeAt(B)>=0&&this.charCodeAt(B)<256){E+=this.charAt(B);A++}else{if((A+=3)<=C){E+=this.charAt(B)}}B++}E+=D;return E};String.prototype.getRootDomain=function(){var A=/^([^:]*:\/\/)?([^\/\.]+\.([^\/]+))/.exec(this);return A&&A[3]!==undefined?A[3]+"":""};String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.getLen=function(){var A=0;for(var B=0;B<this.length;++B){if(this.charCodeAt(B)>127){A+=3}else{A++}}return A};String.prototype.chkLen=function(B,A){var C=this.getLen(this);if(C>A||C<B){return false}else{return true}};String.prototype.chkType=function(A){switch(A){case"int":return(/^[0-9]?[0-9]*$/).test(this);case"url":return(/^https?:\/\/([a-z0-9-]+\.)+[a-z0-9]{2,4}.*$/).test(this);case"email":return(/^[a-z0-9_+.-]+\@([a-z0-9-]+\.)+[a-z0-9]{2,4}$/i).test(this);case"idcard":return(/^[0-9]{15}$|^[0-9]{17}[a-zA-Z0-9]/).test(this);case"area":return(/^\d+(\.\d*)?$/).test(this);case"money":return(/^\d+(\.\d*)?$/).test(this)}return false};window.openNew=function(C,A){var B=document.createElement("form");form.action=C;form.target=A;form.submit()};APF.Namespace.register("anjuke.global.header");anjuke.global.header.CitySelector=Class.create({initialize:function(D,C,A){this.selector=$(D);this.panelId=C;this.hideTimeout=A;var B=$(C);this.iframe=B.select("iframe").first();this.iframe.setStyle({width:B.getWidth()+"px",height:B.getHeight()+"px"});this.selector.observe("mouseover",function(){window.clearTimeout(this.timeoutHandle);$(this.panelId).show()}.bind(this));this.selector.observe("mouseout",function(){window.clearTimeout(this.timeoutHandle);this.timeoutHandle=window.setTimeout("$('"+this.panelId+"').hide()",this.hideTimeout)}.bind(this));var E=this.selector.select("a").first();if(E!=undefined){E.observe("click",function(F){F.preventDefault()})}}});APF.Namespace.register("anjuke.global.header");anjuke.global.header.CornerLinks=Class.create({initialize:function(A){this.element=$(A)},test:function(B,A){$(B).hide();A.className="myanjuke"},bindEvents:function(C,B,A){this.selector=$(C);this.panelId=B;this.panel=$(B);this.hideTimeout=A;this.selector.observe("mouseover",function(D){window.clearTimeout(this.timeoutHandle);this.panel.style.display="block";this.selector.addClassName("myanjuke_hover")}.bind(this));this.panel.observe("mouseover",function(){window.clearTimeout(this.timeoutHandle);this.selector.addClassName("myanjuke_hover")}.bind(this));this.panel.observe("mouseout",function(){window.clearTimeout(this.timeoutHandle);this.timeoutHandle=window.setTimeout("$('"+this.panelId+"').hide();$('"+C+"').removeClassName('myanjuke_hover');",this.hideTimeout)}.bind(this));this.selector.observe("mouseout",function(){window.clearTimeout(this.timeoutHandle);this.timeoutHandle=window.setTimeout("$('"+this.panelId+"').hide();$('"+C+"').removeClassName('myanjuke_hover');",this.hideTimeout)}.bind(this))}});APF.Namespace.register("anjuke.global.search");anjuke.global.search.Autocompleter=Class.create(Ajax.Autocompleter,{initialize:function($super,C,D,B,A){$super(C,D,B,A);this.index=-1;this._fixChineseInputMethodProblem()},_fixChineseInputMethodProblem:function(){var A=window.setInterval(function(){if(this.oldElementValue==this.element.value){return }this.oldElementValue=this.element.value;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),0)}.bind(this),this.options.frequency*1000)},selectEntry:function($super){this.oldElementValue=this.element.value;if(this.observer){clearTimeout(this.observer)}$super()},updateChoices:function($super,C){if(!this.changed&&this.hasFocus){this.update.innerHTML=C;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var A=0;A<this.entryCount;A++){var B=this.getEntry(A);B.autocompleteIndex=A;this.addObservers(B)}}else{this.entryCount=0}this.stopIndicator();this.index=-1;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},onKeyPress:function(A){if(this.observer){clearTimeout(this.observer);this.observer=null}if(this.active){switch(A.keyCode){case Event.KEY_RETURN:if(this.index<0){return }this.selectEntry();Event.stop(A);case Event.KEY_TAB:case Event.KEY_ESC:this.hide();this.active=false;Event.stop(A);return ;case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(A);return ;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(A);return }}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return }}this.changed=true;this.hasFocus=true},show:function($super){$super();this.update.setStyle({width:this.update.getWidth()-2+"px"})},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(false)},getUpdatedChoices:function($super){this.startIndicator();var B=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,B):B;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}var A=new Ajax.Request(this.url,this.options);this.requestingURL=A.url},onComplete:function(A){if(this.requestingURL==A.request.url){this.requestingURL=null;this.updateChoices(A.responseText)}}});anjuke.global.search.SearchSuggestion=Class.create({initialize:function(C,B,A){this.options=A||{};this.element=$(C);this.update=this.options.update?$(this.options.update):this._createUpdateElement();this.url=B;this.useSuggestion=false;this.autocompleter=new anjuke.global.search.Autocompleter(this.element,this.update,this.url,{method:"GET",frequency:0.2,minChars:1,afterUpdateElement:function(D,F){D.value=F.firstDescendant().innerHTML;var E=this._findParentForm(D);if(E){E.submit()}}.bind(this),callback:function(D,E){if(!this.options.onParameters){return E}var F=this.options.onParameters(E);if(F&&"function"==typeof (F.toQueryString)){return F.toQueryString()}else{return F}}.bind(this)})},_findParentForm:function(A){var B=A;while(B){if(B.tagName=="FORM"){break}B=B.parentNode}return B},_createUpdateElement:function(){var A=$(document.createElement("div"));this.options.className=this.options.className||"SearchSuggestion";A.addClassName(this.options.className);var B=this._getInternetExplorerVersion();if(B>0&&B<=7){Element.insert(this.element.getOffsetParent(),{after:A})}else{Element.insert(document.body,{top:A})}return A},_getInternetExplorerVersion:function(){var C=-1;if(navigator.appName=="Microsoft Internet Explorer"){var A=navigator.userAgent;var B=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(B.exec(A)!=null){C=parseFloat(RegExp.$1)}}return C}});APF.Namespace.register("anjuke.global.header");anjuke.global.header.OptionList=Class.create({initialize:function(G,D,F,E){this.trigger=$(G);this.panel=$(D);var B=$(D);var C=$(E);var A=$(F);this.trigger.observe("click",function(){if(this.panel.style.display=="none"){this.panel.style.display="block"}else{this.panel.style.display="none"}}.bind(this));A.observe("mouseover",function(){A.addClassName("current_option_hover")});A.observe("mouseout",function(){if(B.visible()){return }A.removeClassName("current_option_hover")});A.observe("blur",function(H){var I=H.explicitOriginalTarget==undefined?document.activeElement:H.explicitOriginalTarget;if(Element.descendantOf(I,this.panel)){A.focus();return }A.removeClassName("current_option_hover");B.hide()}.bind(this));this.panel.getElementsBySelector("span").each(function(H){H.observe("click",function(){A.value=H.innerHTML;C.value=H.getAttribute("v");if(C.value=="5"){$("apf_id_8_keyword").value="请输入房源特征,地点或楼盘名..."}else{if(C.value=="3"){$("apf_id_8_keyword").value="请输入小区名或路名..."}else{$("apf_id_8_keyword").value="请输入房源特征,地点或小区名..."}}if(C.value=="3"){$("sbtn").className="btn2"}else{$("sbtn").className="btn"}A.removeClassName("current_option_hover");B.hide();Element.fire(document,"SearchBar:OptionList",C.value);B.getElementsBySelector("span").each(function(I){I.setAttribute("s","none");I.setAttribute("class","item");I.setAttribute("className","item")});H.setAttribute("s","selected");H.setAttribute("class","selected");H.setAttribute("className","selected")});H.observe("mouseover",function(){if(H.getAttribute("s")!="selected"){H.setAttribute("class","mousehover");H.setAttribute("className","mousehover")}});H.observe("mouseout",function(){if(H.getAttribute("s")!="selected"){H.setAttribute("class","item");H.setAttribute("className","item")}})})},descendantOfPanel:function(A){if(A==null){return false}if(A==this.panel){return true}return this.descendantOfPanel(A.parentNode)}});var Global_Container_Dialog=Class.create({overlayElement:undefined,initialize:function(B,C){B=$(B);this.dialogElement=B;if(typeof C!="undefined"){new Draggable(B,{handle:$(C)})}var A=this;Event.observe(window,"resize",function(){if(!Global_Container_Dialog.overlayElement){return }Global_Container_Dialog.overlayElement.remove();Global_Container_Dialog.overlayElement=undefined;A.create_overaly()});Element.insert(document.body,B.remove())},center:function(){var E=this.dialogElement.getOffsetParent().cumulativeOffset();var B=this.getWindowSize();var A=this.getScroll();var D=A.left-E.left+(B.width-this.dialogElement.getWidth())*0.5;var C=A.top-E.top+(B.height-this.dialogElement.getHeight())*0.33;this.dialogElement.style.left=D+"px";this.dialogElement.style.top=C+"px"},show:function(B,A){if(this.dialogElement.visible()){return false}if(B){this.create_overaly()}if(!A){this.center()}else{this.dialogElement.style.left=A.left+"px";this.dialogElement.style.top=A.top+"px"}this.dialogElement.show();return true},hide:function(){if(!this.dialogElement.visible()){return false}if(Global_Container_Dialog.overlayElement){Global_Container_Dialog.overlayElement.remove();Global_Container_Dialog.overlayElement=undefined}this.dialogElement.hide();return true},create_overaly:function(){Global_Container_Dialog.overlayElement=$(document.createElement("div"));Global_Container_Dialog.overlayElement.addClassName("modal_overlay");Global_Container_Dialog.overlayElement.setOpacity(0.5);Global_Container_Dialog.overlayElement.style.width=document.documentElement.scrollWidth+"px";Global_Container_Dialog.overlayElement.style.height=document.documentElement.scrollHeight+"px";document.body.appendChild(Global_Container_Dialog.overlayElement)},getWindowSize:function(){var B=0,A=0;if(typeof (window.innerWidth)=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return{width:B,height:A}},getScroll:function(){var B=0,A=0;if(typeof (window.pageYOffset)=="number"){A=window.pageYOffset;B=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollTop;B=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}}}return{left:B,top:A}}});var My_Popup_Login=Class.create(Global_Container_Dialog,{initialize:function($super,B,C){$super(B,C);var A=this;B=$(B);B.select(".close").each(function(D){D.observe("click",function(){A.hide()})});Event.observe(window,"scroll",function(D){if(B.visible()){A.center()}});Event.observe(window,"resize",function(D){if(B.visible()){A.center()}})}});APF.Namespace.register("anjuke.community.ConcernedCommunity");anjuke.community.ConcernedCommunity=Class.create({initialize:function(B,A,C){this._lnkObj=$(B);this._intCommID=A;this._bolIfLogin=C},getFunc:function(C,B,A){return function(){var D=[];if(null!=A){A=A instanceof Array?A:[A];for(var E=0;E<A.length;++E){D.push(A[E])}}D.push(arguments[0]);B.apply(C,D)}},clickFunc:function(){Event.observe(this._lnkObj,"click",this.getFunc(this,this.getIfConcerned,this._intCommID))},closeConcerned:function(){if($("toolbar_content_pad")){$("toolbar_content_pad").style.position="relative";$("grade_stars").style.position="relative"}this._divConcerned.style.display="none";if(!this._bolIfLogin){window.location.reload()}},getIfConcerned:function(A){var B="/v2/community/concerned/W0QQcommidZ"+A+"QQactZajaxchk";new Ajax.Request(B,{method:"get",onSuccess:this.getFunc(this,this.showConcerned)})},showConcerned:function(A){var B=A.responseText;if(0==B){window.location.href="/v2/aw/v2/community/concerned/W0QQcommidZ"+this._intCommID+"QQactZadd"}else{if(!this._divConcerned){this._divConcerned=document.createElement("div");this._divConcerned.className="concerneddiv";_tblInner=document.createElement("table");_tblInner.className="concernedtbl";_trInner_1=_tblInner.insertRow(0);_trInner_2=_tblInner.insertRow(1);_trInner_3=_tblInner.insertRow(2);_trInner_4=_tblInner.insertRow(3);_tdInner_1_1=_trInner_1.insertCell(0);_tdInner_1_2=_trInner_1.insertCell(1);_tdInner_2_1=_trInner_2.insertCell(0);_tdInner_2_2=_trInner_2.insertCell(1);_tdInner_3_1=_trInner_3.insertCell(0);_tdInner_3_2=_trInner_3.insertCell(1);_tdInner_4_1=_trInner_4.insertCell(0);_tdInner_4_2=_trInner_4.insertCell(1);_tdInner_2_1.className="col2_1";_imgOK=document.createElement("img");_imgOK.src="http://pages.anjukestatic.com/img/icon/icon_ok_43x40.gif";_tdInner_2_1.appendChild(_imgOK);_tdInner_2_2.className="col2_2";_spnConcern=document.createTextNode("你已关注过啦！");_tdInner_2_2.appendChild(_spnConcern);_tdInner_3_1.className="col3_1";_lnkMyConcern=document.createElement("a");_lnkMyConcern.href="/v2/community/concerned/";_spnMyConcern_1=document.createElement("span");_spnMyConcern_2=document.createElement("span");_spnMyConcern_2.innerHTML="查看我关注的小区";_spnMyConcern_1.className="col3_2_1";_spnMyConcern_2.className="col3_2_2";_spnMyConcern_1.appendChild(_spnMyConcern_2);_lnkMyConcern.appendChild(_spnMyConcern_1);_tdInner_3_2.appendChild(_lnkMyConcern);this._divConcerned.appendChild(_tblInner);this._lnkObj.parentNode.appendChild(this._divConcerned);this._divConcerned.style.position="absolute"}if($("toolbar_content_pad")){$("toolbar_content_pad").style.position="static";$("grade_stars").style.position="static"}this._divConcerned.style.display="block";setTimeout(this.getFunc(this,this.closeConcerned),3000)}},getIfConcerned2:function(){this.getIfConcerned(this._intCommID)}});APF.Namespace.register("anjuke.community.CommunityGrade");anjuke.community.CommunityGrade=Class.create({initialize:function(A,B,C){this.contentDiv=$(A);this.commid=B;this.ipaddress=C},checkSelector:function(B){var A={method:"get",parameters:{getlist:1,r:Math.random()},onSuccess:this.showSelector};new Ajax.Request("/v2/aw/v2/ajax/community/grade/"+B,A)},showSelector:function(A){community_grade.contentDiv.style.display="block";community_grade.show_blocked_select();community_grade.contentDiv.innerHTML=A.responseText;if($("grade_sub")==null){community_grade.disapear()}Event.observe($("grade_sub"),"click",function(B){community_grade.makeGrade(community_grade.commid)});Event.observe($("grade_close"),"click",function(B){community_grade.close()})},makeGrade:function(C){var A=$$('input:checked[type="radio"][name="score"]').pluck("value");if(A==""){alert("请选择一个分数。");return false}var B={method:"get",parameters:{score:A,ip:community_grade.ipaddress,r:Math.random()},onSuccess:function(D){community_grade.contentDiv.style.display="block";community_grade.show_blocked_select();community_grade.contentDiv.innerHTML=D.responseText;community_grade.updateData(community_grade.commid);community_grade.disapear()}};new Ajax.Request("/v2/aw/v2/ajax/community/grade/"+C,B)},disapear:function(){setTimeout("community_grade.show_blocked_select();community_grade.contentDiv.style.display = 'none';",1500)},close:function(){community_grade.show_blocked_select();community_grade.contentDiv.style.display="none"},show_blocked_select:function(){element=$("slt_sortby");if(element!=null){if(element.style.visibility=="hidden"){element.style.visibility="visible"}else{element.style.visibility="hidden"}}},updateData:function(commid){$("star_loading").style.display="block";var options={method:"get",parameters:{getupdate:1,r:Math.random()},onSuccess:function(transport){data=(eval(transport.responseText));$("star_loading").style.display="none";$("grade_current_div").innerHTML=data[0];$("grade_current_div").style.width=(data[0]/10*75)+"px";$("grade_number_div").innerHTML=data[0]+"分";$("grade_persons_div").innerHTML=data[1]}};new Ajax.Request("/v2/aw/v2/ajax/community/grade/"+commid,options)}});