(function(a){a.fn.extend({switchFocus:function(){var d=a(this);var b=d.attr("placeholder");var c=d.attr("value");d.focus(function(){if(d.attr("value")===b||d.attr("value")===c){this.value=""}}).blur(function(){if(d.attr("value")===""){this.value=b}});return d},chkAll:function(d){var c=a(d),b=a(this)[0];if(c.length==0){return}a(this).click(function(){c.each(function(e){this.checked=b.checked})})},chkReverse:function(d){var c=a(d),b=a(this)[0];if(c.length==0){return}a(this).click(function(){if(b.checked){c.each(function(e){this.checked=!this.checked})}})},star:function(){a(this).click(function(){var d=a(this).attr("title");var b=a(this).parent().attr("class");var c=a(this).parent().attr("id");if(house_grade(c)){a(this).parent().parent().removeClass().addClass("rating "+b+"star");a(this).blur();a(this).parent().parent().next("b").html(d)}return false})},popup:function(c){c=a.extend({target:null,close:null,position:"b",offsetX:0,offsetY:0,isAnim:false,anim:"show",speed:400},c);var b=a(this);a(this).click(function(){if(c.target==null){return}var e=a(c.target),i=b.offset(),f=b.outerWidth(),g=b.outerHeight(),d=y=0;switch(c.position){case"l":d=i.left-e.outerWidth()-c.offsetX;y=i.top-c.offsetY;break;case"r":d=i.left+f+c.offsetX;y=i.top-c.offsetY;break;case"t":d=i.left-c.offsetX;y=i.top-e.outerHeight()-c.offsetY;break;case"b":default:d=i.left+c.offsetX;y=i.top+g+c.offsetY}if(e.is(":hidden")){e.css({position:"absolute","z-index":9999,left:d,top:y});c.isAnim&&e[c.anim](c.speed);(!c.isAnim)&&e.show()}else{e.hide()}});a(c.close)&&a(c.close).click(function(){a(c.target).hide()})},tabs:function(k){k=a.extend({event:"click",timeout:0,auto:0,callback:null},k);var j=a(this),b=j.children("div.tab-box").children("div"),e=j.children(".tab-menu"),h=e.find("li"),d;var g=function(l){l.siblings("li").removeClass("current").end().addClass("current");b.siblings("div").addClass("hide").end().eq(l.index()).removeClass("hide")},f=function(l,m){m?setTimeout(function(){g(l);if(k.callback){k.callback(j)}},m):(function(){g(l);if(k.callback){k.callback(j)}})()},c=function(){if(!k.auto){return}d=setInterval(i,k.auto)},i=function(){var q=e.find("li.current"),p=h.eq(0),l=h.length,m=q.index()+1,o=m===l?p:q.next("li"),n=m===l?0:m;q.removeClass("current");o.addClass("current");b.siblings("div").addClass("hide").end().eq(n).removeClass("hide")};h.bind(k.event,function(){f(a(this),k.timeout)});if(k.auto){c();j.hover(function(){clearInterval(d);d=undefined},function(){c()})}return this},strlen:function(d){var c=d.length;for(var b=0;b<d.length;b++){if(d.charCodeAt(b)>127){c++}}return c}});a.fn.lazyload=function(b){var c={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(b){a.extend(c,b)}var d=this;if("scroll"==c.event){a(c.container).bind("scroll",function(g){var e=0;d.each(function(){if(a.abovethetop(this,c)||a.leftofbegin(this,c)){}else{if(!a.belowthefold(this,c)&&!a.rightoffold(this,c)){a(this).trigger("appear")}else{if(e++>c.failurelimit){return false}}}});var f=a.grep(d,function(h){return !h.loaded});d=a(f)})}this.each(function(){var e=this;if(undefined==a(e).attr("original")){a(e).attr("original",a(e).attr("src"))}if("scroll"!=c.event||undefined==a(e).attr("src")||c.placeholder==a(e).attr("src")||(a.abovethetop(e,c)||a.leftofbegin(e,c)||a.belowthefold(e,c)||a.rightoffold(e,c))){if(c.placeholder){a(e).attr("src",c.placeholder)}else{a(e).removeAttr("src")}e.loaded=false}else{e.loaded=true}a(e).one("appear",function(){if(!this.loaded){a("<img />").bind("load",function(){a(e).hide().attr("src",a(e).attr("original"))[c.effect](c.effectspeed);e.loaded=true}).attr("src",a(e).attr("original"))}});if("scroll"!=c.event){a(e).bind(c.event,function(f){if(!e.loaded){a(e).trigger("appear")}})}});a(c.container).trigger(c.event);return this};a.belowthefold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).height()+a(window).scrollTop()}else{var b=a(d.container).offset().top+a(d.container).height()}return b<=a(c).offset().top-d.threshold};a.rightoffold=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).width()+a(window).scrollLeft()}else{var b=a(d.container).offset().left+a(d.container).width()}return b<=a(c).offset().left-d.threshold};a.abovethetop=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollTop()}else{var b=a(d.container).offset().top}return b>=a(c).offset().top+d.threshold+a(c).height()};a.leftofbegin=function(c,d){if(d.container===undefined||d.container===window){var b=a(window).scrollLeft()}else{var b=a(d.container).offset().left}return b>=a(c).offset().left+d.threshold+a(c).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});a.fn.lightBox=function(p){p=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,fixedNavigation:false,imageLoading:"/themes/default_l/images/lightbox-ico-loading.gif",imageBtnPrev:"/themes/default_l/images/lightbox-btn-prev.gif",imageBtnNext:"/themes/default_l/images/lightbox-btn-next.gif",imageBtnClose:"/themes/default_l/images/lightbox-btn-close.gif",imageBlank:"/themes/default_l/images/lightbox-blank.gif",containerBorderSize:10,containerResizeSpeed:400,txtImage:"Image",txtOf:"of",keyToClose:"c",keyToPrev:"p",keyToNext:"n",imageArray:[],activeImage:0},p);var i=this;function r(){o(this,i);return false}function o(v,u){a("embed, object, select").css({visibility:"hidden"});c();p.imageArray.length=0;p.activeImage=0;if(u.length==1){p.imageArray.push(new Array(v.getAttribute("href"),v.getAttribute("title")))}else{for(var t=0;t<u.length;t++){p.imageArray.push(new Array(u[t].getAttribute("href"),u[t].getAttribute("title")))}}while(p.imageArray[p.activeImage][0]!=v.getAttribute("href")){p.activeImage++}l()}function c(){a("body").append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+p.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+p.imageBtnClose+'"></a></div></div></div></div>');var t=f();a("#jquery-overlay").css({backgroundColor:p.overlayBgColor,opacity:p.overlayOpacity,width:t[0],height:t[1]}).fadeIn();var u=h();a("#jquery-lightbox").css({top:u[1]+(t[3]/10),left:u[0]}).show();a("#jquery-overlay,#jquery-lightbox").click(function(){b()});a("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){b();return false});a(window).resize(function(){var v=f();a("#jquery-overlay").css({width:v[0],height:v[1]});var w=h();a("#jquery-lightbox").css({top:w[1]+(v[3]/10),left:w[0]})})}function l(){a("#lightbox-loading").show();if(p.fixedNavigation){a("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}else{a("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}var t=new Image();t.onload=function(){a("#lightbox-image").attr("src",p.imageArray[p.activeImage][0]);j(t.width,t.height);t.onload=function(){}};t.src=p.imageArray[p.activeImage][0]}function j(w,A){var t=a("#lightbox-container-image-box").width();var z=a("#lightbox-container-image-box").height();var x=(w+(p.containerBorderSize*2));var v=(A+(p.containerBorderSize*2));var u=t-x;var B=z-v;a("#lightbox-container-image-box").animate({width:x,height:v},p.containerResizeSpeed,function(){g()});if((u==0)&&(B==0)){if(a.browser.msie){n(250)}else{n(100)}}a("#lightbox-container-image-data-box").css({width:w});a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({height:A+(p.containerBorderSize*2)})}function g(){a("#lightbox-loading").hide();a("#lightbox-image").fadeIn(function(){k();s()});q()}function k(){a("#lightbox-container-image-data-box").slideDown("fast");a("#lightbox-image-details-caption").hide();if(p.imageArray[p.activeImage][1]){a("#lightbox-image-details-caption").html(p.imageArray[p.activeImage][1]).show()}if(p.imageArray.length>1){a("#lightbox-image-details-currentNumber").html(p.txtImage+" "+(p.activeImage+1)+" "+p.txtOf+" "+p.imageArray.length).show()}}function s(){a("#lightbox-nav").show();a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({background:"transparent url("+p.imageBlank+") no-repeat"});if(p.activeImage!=0){if(p.fixedNavigation){a("#lightbox-nav-btnPrev").css({background:"url("+p.imageBtnPrev+") left 15% no-repeat"}).unbind().bind("click",function(){p.activeImage=p.activeImage-1;l();return false})}else{a("#lightbox-nav-btnPrev").unbind().hover(function(){a(this).css({background:"url("+p.imageBtnPrev+") left 15% no-repeat"})},function(){a(this).css({background:"transparent url("+p.imageBlank+") no-repeat"})}).show().bind("click",function(){p.activeImage=p.activeImage-1;l();return false})}}if(p.activeImage!=(p.imageArray.length-1)){if(p.fixedNavigation){a("#lightbox-nav-btnNext").css({background:"url("+p.imageBtnNext+") right 15% no-repeat"}).unbind().bind("click",function(){p.activeImage=p.activeImage+1;l();return false})}else{a("#lightbox-nav-btnNext").unbind().hover(function(){a(this).css({background:"url("+p.imageBtnNext+") right 15% no-repeat"})},function(){a(this).css({background:"transparent url("+p.imageBlank+") no-repeat"})}).show().bind("click",function(){p.activeImage=p.activeImage+1;l();return false})}}m()}function m(){a(document).keydown(function(t){d(t)})}function e(){a(document).unbind()}function d(t){if(t==null){keycode=event.keyCode;escapeKey=27}else{keycode=t.keyCode;escapeKey=t.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key==p.keyToClose)||(key=="x")||(keycode==escapeKey)){b()}if((key==p.keyToPrev)||(keycode==37)){if(p.activeImage!=0){p.activeImage=p.activeImage-1;l();e()}}if((key==p.keyToNext)||(keycode==39)){if(p.activeImage!=(p.imageArray.length-1)){p.activeImage=p.activeImage+1;l();e()}}}function q(){if((p.imageArray.length-1)>p.activeImage){objNext=new Image();objNext.src=p.imageArray[p.activeImage+1][0]}if(p.activeImage>0){objPrev=new Image();objPrev.src=p.imageArray[p.activeImage-1][0]}}function b(){a("#jquery-lightbox").remove();a("#jquery-overlay").fadeOut(function(){a("#jquery-overlay").remove()});a("embed, object, select").css({visibility:"visible"})}function f(){var v,t;if(window.innerHeight&&window.scrollMaxY){v=window.innerWidth+window.scrollMaxX;t=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){v=document.body.scrollWidth;t=document.body.scrollHeight}else{v=document.body.offsetWidth;t=document.body.offsetHeight}}var u,w;if(self.innerHeight){if(document.documentElement.clientWidth){u=document.documentElement.clientWidth}else{u=self.innerWidth}w=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){u=document.documentElement.clientWidth;w=document.documentElement.clientHeight}else{if(document.body){u=document.body.clientWidth;w=document.body.clientHeight}}}if(t<w){pageHeight=w}else{pageHeight=t}if(v<u){pageWidth=v}else{pageWidth=u}arrayPageSize=new Array(pageWidth,pageHeight,u,w);return arrayPageSize}function h(){var u,t;if(self.pageYOffset){t=self.pageYOffset;u=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;u=document.documentElement.scrollLeft}else{if(document.body){t=document.body.scrollTop;u=document.body.scrollLeft}}}arrayPageScroll=new Array(u,t);return arrayPageScroll}function n(v){var u=new Date();t=null;do{var t=new Date()}while(t-u<v)}return this.unbind("click").click(r)}})(jQuery);var fangddFun={setHomePage:function(f){var b=document.URL.split("/");var c="http://"+b[2]+"/";try{f.style.behavior="url(#default#homepage)";f.setHomePage(c)}catch(d){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(d){alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'")}var a=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);a.setCharPref("browser.startup.homepage",c)}}},addFavorite:function(){var a=document.URL.split("/");var c="http://"+a[2]+"/";var b=document.title;try{window.external.AddFavorite(c,b)}catch(d){window.sidebar.addPanel(b,c,"")}},copyURL:function(){var b=top.location.href;var d=document.title;if(window.clipboardData){var a=d+"\n"+b;var c=window.clipboardData.setData("Text",a);if(c){alert("复制成功！按Ctrl+V ,粘贴到QQ或微博上发给你的好友们吧！")}}else{prompt("按Ctrl+C复制当前网址",b+" "+d)}}};jQuery.fn.floatdiv=function(b){var c=$("body"),e=c.width(),a=c.height(),d=-1,f=null;return this.each(function(){f=b;var i=f.top;if(typeof(i)!="undefined"&&typeof(i)==="string"){i=i.replace("px","")}if(!$.browser.msie||$.browser.version>6){$(this).css(f).css({position:"fixed",zIndex:"80"})}else{var h=$(this).get(0).style,j="(document.documentElement || document.body)",g=document.getElementsByTagName("html")[0];h.setExpression("top","eval("+j+".scrollTop + "+i+') + "px"');$(this).css("position","absolute").css("left",f.left).css("right",f.right);if(document.body.currentStyle.backgroundAttachment!=="fixed"){g.style.backgroundImage="url(about:blank)";g.style.backgroundAttachment="fixed"}}})};var fddAjax=function(a){if(!a||!a.url){return false}a.type=a.type||"post";a.dataType=a.dataType||"json";a.url=site_url+"/ajax.php?url="+encodeURIComponent(encodeURIComponent(a.url));$.ajax(a)};function autoText(c,d){var c,d,a,b,e;c=typeof c=="string"?document.getElementById(c):c;d=Object(d);a=d.max||Number.MAX_VALUE;c.onfocus=c.onblur=c.onkeyup=function(){var f=this.value;if(f.length>a){this.value=f.slice(0,a)}if(d.change instanceof Function){d.change.call(this,a-f.length)}};if(d.auto){c.style.overflow="hidden";c.setAttribute("rows",2);b=c.offsetHeight;if(!!window.ActiveXObject){c.onpropertychange=function(f){this.style.height=Math.max(b,this.scrollHeight)+"px"}}else{c.oninput=function(){this.style.height=0;this.style.height=Math.max(b,this.scrollHeight-4)+"px"}}}};
