﻿
Format=function()
{if(arguments.length==0)
return null;var str=arguments[0];for(var i=1;i<arguments.length;i++)
{var re=new RegExp('\\{'+(i-1)+'\\}','gm');str=str.replace(re,arguments[i]);}
return str;}
function KeyEvent(e,cbf){if(arguments.length==0||cbf.trim()=="")return;e=window.event||e;if(e.keyCode==13){eval(cbf);}}
var _c=_h=0;var num=0;$(function(){$('#play > a').click(function(){var i=$(this).attr('alt')-1;clearInterval(_h);_c=i;play();change(i);})
$("#pic img").hover(function(){clearInterval(_h);},function(){var i=$('#play > .pick').attr('alt')-1;_c=i;clearInterval(_h);play();});})
function play(){if(bHouse.n!=1){_h=setInterval("auto()",4000);}}
function change(i){$('#play > a').removeClass('pick').eq(i).addClass('pick').blur();$("#pic img").hide().eq(i).fadeIn('slow');}
function auto(){if(bHouse.n==1){_c=0;}else{_c=_c>bHouse.n-2?0:_c+1;}
change(_c);}
function getTradeHouseCJList(timetype,top,container,page){$('#tradehousecjtimetype >li').removeClass('select');$('#tradehousecjtimetype >li[timetype='+timetype+']').addClass('select');bHouse.getTradeHouseCJList(timetype,top,container,page);}
function getNewHouseCjListByTime(timetype,top,container,order){var housetype=1
var htype=$('#'+container+'htype')[0];if(htype){housetype=$('#'+container+'htype')[0].innerText;}
if(order=='none'){$('#newhousecjtimetype >li').removeClass('select');$('#newhousecjtimetype >li[timetype='+timetype+']').addClass('select');}else{$('#newhousecjtoptimetype >li').removeClass('select');$('#newhousecjtoptimetype >li[timetype='+timetype+']').addClass('select');}
getNewHouseCJList(timetype,housetype,top,container,order);}
function getNewHouseCJList(timetype,housetype,top,container,order){if(order=='none')order='';else order='excount'
if(housetype!=''&&order==''){$('#newhousecjtype >li').removeClass('select');$('#newhousecjtype >li[htype='+housetype+']').addClass('select');$('#newhousecjtimetype >li').removeClass('select');$('#newhousecjtimetype >li[timetype='+timetype+']').addClass('select');}else if(housetype!=''&&order=='excount'){$('#newhousecjtoptype >li').removeClass('select');$('#newhousecjtoptype >li[htype='+housetype+']').addClass('select');$('#newhousecjtoptimetype >li').removeClass('select');$('#newhousecjtoptimetype >li[timetype='+timetype+']').addClass('select');}else{$('#newhousecjtimetype >li').removeClass('select');$('#newhousecjtimetype >li[timetype='+timetype+']').addClass('select');}
if($('#'+container+'htype')[0])$('#'+container+'htype')[0].innerText=housetype;bHouse.getNewHouseCJList(timetype,housetype,top,container,order);}
var bHouse = { n: 0, k_defValue: "输入小区名称（楼盘名称）、地段、关键词", getTradeHouseCJList: function(timetype, top, container, page) { var url = "/com/ajaxPage/ajaxTradeHouseCJTop.aspx?page=" + page + "&timetype=" + timetype + "&top=" + top; var strCon = Methods.getAjaxStr(url); $P(container).innerHTML = strCon; }, getIndexExchange: function(region, timetype) { var url = "/com/ajaxPage/ajaxGetIndexExchange.aspx?timetype=" + timetype + "&region=" + region; var strCon = Methods.getAjaxStr(url); $P("dvExChangeInfo").innerHTML = strCon; }, getNewHouseCJList: function(timetype, housetype, top, container, order) { var url = "/com/ajaxPage/ajaxNewHouseCJTop.aspx?timetype=" + timetype + "&housetype=" + housetype + "&top=" + top + "&order=" + order; var strCon = Methods.getAjaxStr(url); $P(container).innerHTML = strCon; }, getTodayCJ: function() { var url = "/com/ajaxPage/ajaxTodayCJ.aspx"; $P("todaycj").innerHTML = "<img src='/content/images/loading.gif'/>正在加载...."; var strCon = Methods.getAjaxStr(url); $P("todaycj").innerHTML = strCon; }, getTodayCJHtml: function(sender, text) { $P("todaycj").innerHTML = text; var ScorllContract = new ScrollObj("txt_roll_list", "ScorllContract", 1, 3000, 1, "li"); ScorllContract.ShowContentUp() }, getCommentContent: function(page, id, type, issub, container) { var url = "/com/ajaxPage/ajaxComment.aspx?id=" + id + "&type=" + type + "&issub=" + issub + "&page=" + page; var strCon = Methods.getAjaxStr(url); var bs = "bHouse.getCommentContent(__0__," + id + ",'" + type + "','false','" + container + "')"; $P(container).innerHTML = bHouse.getContent(strCon, bs, page); }, submitComment: function(page, id, type, issub, container, jt, pt, hj, wy, content) {
    if (!objUser.isLogin()) { alert("请先登录再进行评价！"); return; }
    if (content == "") { alert("评论内容不能为空！"); return; }
    var url = "/com/ajaxPage/ajaxComment.aspx?id=" + id + "&type=" + type + "&issub=" + issub + "&jt=" + jt + "&pt=" + pt + "&hj=" + hj + "&wy=" + wy + "&page=" + page + "&content=" + escape(content); alert("添加评论成功！"); $P("ComContent").value = ""; var strCon = Methods.getAjaxStr(url); var bs = "bHouse.getCommentContent(__0__," + id + ",'" + type + "','false','" + container + "')"; $P(container).innerHTML = bHouse.getContent(strCon, bs, 1);
},
    //--------------------------------------------------------
    getMessageContent: function(page, id, type, issub, container) {
        var url = "/com/ajaxPage/ajaxMessage.aspx?id=" + id + "&type=" + type + "&issub=" + issub + "&page=" + page;
        var strCon = Methods.getAjaxStr(url);
        if (($P("TotalMsg") != null) && (strCon.match("\\d+") != null)) $P("TotalMsg").innerHTML = strCon.match("\\d+");
        var bs = "bHouse.getMessageContent(__0__," + id + ",'" + type + "','false','" + container + "')";
        $P(container).innerHTML = bHouse.getContent(strCon, bs, page);

    },
    submitMessage: function(id, type, issub, container, content, quoteid) {
        if (content == "") { alert("留言内容不能为空！"); return; }
        var url = "/com/ajaxPage/ajaxMessage.aspx?id=" + id + "&type=" + type + "&issub=" + issub + "&content=" + escape(content) + "&qid=" + quoteid;
        alert("添加评论成功！");
        $P("quoteText").innerText = "";
        $P("quoteText").value = "";
        $P("ComContent").value = "";
        var strCon = Methods.getAjaxStr(url); if ($P("TotalMsg") != null) $P("TotalMsg").innerHTML = strCon.match("\\d+");
        alert(strCon);
        var bs = "bHouse.getMessageContent(__0__," + id + ",'" + type + "','false','" + container + "')"; $P(container).innerHTML = bHouse.getContent(strCon, bs, 1);


    },
    //--------------------------------------------------------
    addScore: function(objectid, type, value) {
        $.ajax({ url: "/com/ajaxPage/ajaxaddscore.aspx", data: { objectid: objectid, type: type, value: value, ts: new Date().valueOf() }, datatype: "json", success: function(r) {
            if (r == "false") { alert("评分失败!"); } else if (r == "added") { alert("对不起，您已经对该属性评过分了!") } else {
                alert("评分成功!"); var arr = r.split("_"); $P("sAvgTraffic").innerHTML = arr[0]; $P("dvAvgTraffic").style.width = "" + arr[0] + "%"
                $P("sAvgEnvironment").innerHTML = arr[1]; $P("dvAvgEnvironment").style.width = "" + arr[1] + "%"
                $P("sAvgMatialcomp").innerHTML = arr[2]; $P("dvAvgMatialcomp").style.width = "" + arr[2] + "%"
                $P("sAvgFixing").innerHTML = arr[3]; $P("dvAvgFixing").style.width = "" + arr[3] + "%"
                $P("sAvgCompany").innerHTML = arr[4]; $P("dvAvgCompany").style.width = "" + arr[4] + "%"
                $P("sTotalUser").innerHTML = arr[5]; $P("sAvgTotal").innerHTML = arr[6];
            }
        }
        });
    }, getScoreInfo: function() { var url = "/com/ajaxPage/ajaxaddscore.aspx?objectid=" + objectid + "&type=" + type + "&value=" + value; $P("sAvgTraffic").innerHTML = ""; $P("sAvgEnvironment").innerHTML = ""; $P("sAvgMatialcomp").innerHTML = ""; $P("sAvgFixing").innerHTML = ""; $P("sAvgCompany").innerHTML = ""; alert("ok"); },
    getContent: function(content, _baseScript, page) {
        var ctx = new Array();
        var num = content.match("\\d+");
        //alert(content);
        ctx[ctx.length] = content.replace(content.match("#\\d+#"), "");
        var pageObj = new PagerObj(num, page, 5);
        //alert(num);
        pageObj.baseScript = _baseScript;
        ctx[ctx.length] = pageObj.BuildPager();
        return ctx.join('');
    },
    GotoMapSearch: function(key, value, page) {
        var regioncode, sellstauts, hk, area, price; var regioncode = ""; var sellstauts = ""; var hk = ""; var area = ""; var price = ""; if ($P("regioncode"))
            regioncode = $P("regioncode").value; if ($P("sellstauts"))
            sellstauts = $P("sellstauts").value; if ($P("hk"))
            hk = $P("hk").value; if ($P("area"))
            area = $P("area").value; if ($P("price"))
            price = $P("price").value; currUrl = "/com/ajaxPage/ajaxNewHouseList.aspx"; currUrl = Methods.editParam(currUrl, "regioncode", regioncode); currUrl = Methods.editParam(currUrl, "sellstauts", sellstauts); currUrl = Methods.editParam(currUrl, "hk", hk); currUrl = Methods.editParam(currUrl, "area", area); currUrl = Methods.editParam(currUrl, "price", price); if (page)
            currUrl = Methods.editParam(currUrl, "page", page); else
            currUrl = Methods.editParam(currUrl, "page", "1"); $.ajax({ url: currUrl, data: {}, datatype: "json", success: function(r) { $P("dvList").innerHTML = r; } });
    }, ClassInit: function() { bHouse.setOptionClass(); }, setOptionClass: function() {
        var OpArr = new Array(); var currUrl = window.location.href; OpArr = Methods.getAllParams(currUrl); if (OpArr != null) {
            for (j = 0; j < OpArr.length; j++) {
                if (OpArr[j] == "k") { if ($P("key")) { } }
                else if (OpArr[j] == "odb") { var orderValue = Methods.getURLParam(currUrl, "odb"); if (orderValue.trim() != '') { var ArrOrder = new Array(); ArrOrder = orderValue.split("-"); switch (orderValue.trim()) { case "oa-1": $P("odb_oa").className = "up"; Methods.selectByValue($P("pulldown"), 'oa-1'); break; case "oa-2": $P("odb_oa").className = "down"; Methods.selectByValue($P("pulldown"), 'oa-2'); break; case "op-1": $P("odb_op").className = "up"; Methods.selectByValue($P("pulldown"), 'op-1'); break; case "op-2": $P("odb_op").className = "down"; Methods.selectByValue($P("pulldown"), 'op-2'); break; case "osp-1": $P("odb_osp").className = "up"; Methods.selectByValue($P("pulldown"), 'osp-1'); break; case "osp-2": $P("odb_osp").className = "down"; Methods.selectByValue($P("pulldown"), 'osp-2'); break; case "ot-1": $P("odb_ot").className = "up"; Methods.selectByValue($P("pulldown"), 'ot-1'); break; case "ot-2": $P("odb_ot").className = "down"; Methods.selectByValue($P("pulldown"), 'ot-2'); break; case "to-1": Methods.selectByValue($P("pulldown"), 'to-1'); break; case "to-2": Methods.selectByValue($P("pulldown"), 'to-2'); break; case "ad-1": Methods.selectByValue($P("pulldown"), 'ad-1'); break; case "ad-2": Methods.selectByValue($P("pulldown"), 'ad-2'); break; case "pa-1": $P("odb_pa").className = "junjia junjia_act"; Methods.selectByValue($P("pulldown"), 'pa-1'); break; case "pa-2": $P("odb_pa").className = "junjia junjia_act"; Methods.selectByValue($P("pulldown"), 'pa-2'); break; case "st-1": $P("odb_st").className = "keshou keshou_act"; Methods.selectByValue($P("pulldown"), 'st-1'); break; case "st-2": $P("odb_st").className = "keshou keshou_act"; Methods.selectByValue($P("pulldown"), 'st-2'); break; } } }
                else if (OpArr[j] == "peer") { _pagesite = Methods.getURLParam(currUrl, OpArr[j]); switch (_pagesite) { case "80": $P("peer20").className = "pages_num"; $P("peer40").className = "pages_num"; $P("peer80").className = "pages_num pages_num_act"; break; case "40": $P("peer20").className = "pages_num"; $P("peer40").className = "pages_num pages_num_act"; $P("peer80").className = "pages_num"; break; case "20": $P("peer20").className = "pages_num pages_num_act"; $P("peer40").className = "pages_num"; $P("peer80").className = "pages_num"; break; } }
                else if (OpArr[j] == "ht" || OpArr[j] == "page" || OpArr[j] == 'id' || OpArr[j] == "fn" || OpArr[j] == "random" || OpArr[j] == "bn" || OpArr[j] == "cn") { continue; }
                else if (OpArr[j] == "time") {
                    index = Methods.getURLParam(currUrl, OpArr[j]); for (i = 0; i < 3; i++) { if ($P("lp" + i)) $P("lp" + i).className = ""; }
                    if (index == "now") { $P("lp1").className = "mpick"; }
                    else if (index == "new") { $P("lp2").className = "mpick"; }
                    else if (index == "month") { $P("lp3").className = "mpick"; }
                    else { $P("lp0").className = "mpick"; }
                }
                else if (OpArr[j] == "zoneid") { index = Methods.getURLParam(currUrl, OpArr[j]); if (index && index != "" && index != "0") { $P("zn" + index).className = "left_key_act"; $P("zn0").className = "" } else { $P("zn0").className = "left_key_act" } }
                else if (OpArr[j] == "price") { index = Methods.getURLParam(currUrl, OpArr[j]); if (index && index != "" && index != "0") { if ($P("price" + index)) { $P("price" + index).className = "left_key_act"; } $P("price0").className = "" } else { $P("price0").className = "left_key_act" } }
                else if (OpArr[j] == "hk") {
                    index = Methods.getURLParam(currUrl, OpArr[j]); if (index && index != "" && index != "0") { $P("hk" + index).className = "left_key_act"; $P("hk0").className = "" } else { $P("hk0").className = "left_key_act" }
                    Methods.selectByValue($P("hk"), index);
                }
                else if (OpArr[j] == "a") { index = Methods.getURLParam(currUrl, OpArr[j]); if (index && index != "" && index != "0") { $P("a" + index).className = "left_key_act"; $P("a0").className = "" } else { $P("a0").className = "left_key_act" } }
                else if (OpArr[j] == "letter") { index = Methods.getURLParam(currUrl, OpArr[j]); if (index && index != "" && index != "0") { $P("lt" + index).className = "code_dd  code_dd_act"; $P("lt0").className = "" } else { $P("a0").className = "" } }
                else if (OpArr[j] == "regioncode") { index = Methods.getURLParam(currUrl, OpArr[j]); Methods.selectByValue($P("rglist"), index); Methods.selectByValue($P("rg"), index); }
                else if (OpArr[j] == "t") { index = Methods.getURLParam(currUrl, OpArr[j]); Methods.selectByValue($P("st"), index); }
                else { }
            }
        }
    }, GotoSearch: function(key, value) {
        var Url = window.location.href; var zoneid = Methods.getURLParam(Url, "zoneid"); var hk = Methods.getURLParam(Url, "hk"); var a = Methods.getURLParam(Url, "a"); var price = Methods.getURLParam(Url, "price"); var lt = Methods.getURLParam(Url, "letter"); var _odb = Methods.getURLParam(Url, "odb"); var k = Methods.getURLParam(Url, "k"); var regioncode = Methods.getURLParam(Url, "regioncode"); currUrl = "/newhouse/list.aspx"; currUrl = Methods.editParam(currUrl, "zoneid", zoneid); currUrl = Methods.editParam(currUrl, "hk", hk); currUrl = Methods.editParam(currUrl, "a", a); currUrl = Methods.editParam(currUrl, "price", price); currUrl = Methods.editParam(currUrl, "letter", lt); if (regioncode)
            currUrl = Methods.editParam(currUrl, "regioncode", regioncode); currUrl = Methods.editParam(currUrl, "page", "1"); currUrl = Methods.editParam(currUrl, "odb", _odb); currUrl = Methods.editParam(currUrl, "k", k); if (key != "odb")
        { currUrl = Methods.editParam(currUrl, key, value); window.open(currUrl, "_self"); }
        else {
            if (value == "--请选择--") return; var orderValue = Methods.getURLParam(currUrl, key); if (orderValue.trim() == '')
            { window.open(Methods.editParam(currUrl, key, value + "-1"), "_self"); }
            else {
                var ArrOrder = new Array(); ArrOrder = orderValue.split("-"); if (value.indexOf('-') <= 0) {
                    if (ArrOrder[0] != value)
                    { window.open(Methods.editParam(currUrl, key, value + "-1"), "_self"); }
                    else
                    { window.open(Methods.editParam(currUrl, key, ArrOrder[0] + "-" + (parseInt(ArrOrder[1]) + 1 >= 3 ? 1 : parseInt(ArrOrder[1]) + 1)), "_self"); }
                } else { window.open(Methods.editParam(currUrl, key, value), "_self"); }
            }
        }
    }, onSelectSearchBar: function(barId) { var strHead = "ctl00_head2_"; $P(strHead + "l_newhouse").className = ""; $P(strHead + "l_trade").className = ""; $P(strHead + "l_lease").className = ""; $P(strHead + "l_news").className = ""; var o = $P(strHead + barId); hidSearch.value = barId; if (o != null) { o.className = "select"; } }, initSearchBar: function() {
        var url = window.location.href; var k = Methods.getURLParam(url, "k"); if (k != "") { $("#key").css({ color: "#555" }).val(k); }
        if ($("#key")) { $("#key").focus(function() { if ($("#key").val() == bHouse.k_defValue) { $("#key").css({ color: "#555" }).val(''); } }); $("#key").blur(function() { if ($("#key").val() == '') { $("#key").css({ color: "#999" }).val(bHouse.k_defValue); } }) }
    }, onSearchBar: function() {
        var k = $("#key").val(); var urllink = window.location.href.toLowerCase(); var currUrl; if (k == bHouse.k_defValue) k = ""; if (hidSearch.value == '' || hidSearch.value == 'l_newhouse') { currUrl = "/loupan/list.aspx?k=" + encodeURIComponent(k); } else if (hidSearch.value == 'l_trade') { currUrl = "/trade/default.aspx?k=" + encodeURIComponent(k); }
        else if (hidSearch.value == 'l_lease') { currUrl = "/lease/default.aspx?k=" + encodeURIComponent(k); }
        else if (hidSearch.value == 'l_news') { currUrl = "/news/list.aspx?type=search&parentId=121&itemid=0&title=" + encodeURIComponent(k); }
        window.open(currUrl, "_self");
    }, initReqSearch: function() {
        $("#inpUser").focus(function() { if ($("#inpUser").val() == "发布人或发布电话") { $("#inpUser").css({ color: "#555" }).val(''); } }); $("#inpUser").blur(function() { if ($("#inpUser").val() == '') { $("#inpUser").css({ color: "#999" }).val("发布人或发布电话"); } })
        var urllink = window.location.href.toLowerCase(); var order = Methods.getURLParam(urllink, "order"); if (order == "time-1") { $P("timeorder").className = "up"; } else if (order == "time-2") { $P("timeorder").className = "down"; }
    }, onSubmitReq: function() {
        var _k = $("#inpUser").val(); var urllink = window.location.href.toLowerCase(); if (_k == "发布人或发布电话") k = ""; var currUrl; if (urllink.indexOf("/trade/") > -1) { currUrl = "/trade/reqlist.aspx?key=" + encodeURIComponent(_k); } else if (urllink.indexOf("/lease/") > -1) { currUrl = "/lease/reqlist.aspx?key=" + encodeURIComponent(_k); }
        window.open(currUrl, "_self");
    }, onSearchByTime: function(key, value) {
        var urllink = window.location.href.toLowerCase(); var hk = Methods.getURLParam(urllink, "order"); var key = Methods.getURLParam(urllink, "key"); if (hk == '' || hk == 'time-1') { hk = 'time-2'; } else if (hk == "time-2") { hk = 'time-1'; $P("timeorder").className = "up"; }
        var currUrl; if (urllink.indexOf("/trade/") > -1) { currUrl = "/trade/reqlist.aspx"; } else if (urllink.indexOf("/lease/") > -1) { currUrl = "/lease/reqlist.aspx"; }
        currUrl = Methods.editParam(currUrl, "key", encodeURIComponent(key)); currUrl = Methods.editParam(currUrl, "order", hk); window.open(currUrl, "_self");
    }, initNewHouseSearch: function() { $("#newkey").focus(function() { if ($("#newkey").val() == "请输入楼盘名") { $("#newkey").css({ color: "#555" }).val(''); } }); $("#newkey").blur(function() { if ($("#newkey").val() == '') { $("#newkey").css({ color: "#999" }).val("请输入楼盘名"); } }) }, onNewHouseSearch: function() {
        var currUrl = "/newhouse/list.aspx"; var price = ""; if ($P("starprice") && $P("endprice")) {
            if ($P("starprice").value != "" && $P("starprice").value != "")
                price = $P("starprice").value + '-' + $P("endprice").value;
        } else {
            if ($P("price"))
                price = $P("price").value;
        }
        var hk = ""; if ($P("hk"))
            hk = $P("hk").value; var rg = ""; if ($P("rg"))
            rg = $P("rg").value; var st = ""; if ($P("st"))
            st = $P("st").value; var k = $P("newkey").value; if (k == "请输入楼盘名") k = ''; currUrl = Methods.editParam(currUrl, "price", price); currUrl = Methods.editParam(currUrl, "hk", hk); currUrl = Methods.editParam(currUrl, "k", k); currUrl = Methods.editParam(currUrl, "regioncode", rg); currUrl = Methods.editParam(currUrl, "page", "1"); currUrl = Methods.editParam(currUrl, "odb", ""); currUrl = Methods.editParam(currUrl, "t", st); window.open(currUrl, "_self");
    }, onMainNewHouseSearch: function() {
        var currUrl = "/newhouse/list.aspx"; var price = ""; if ($P("mainprice"))
            price = $P("mainprice").value; var hk = ""; if ($P("mainhk"))
            hk = $P("mainhk").value; var rg = ""; if ($P("mainrg"))
            rg = $P("mainrg").value; var k = $P("mainkey").value; if (k == "请输入楼盘名") k = ''; currUrl = Methods.editParam(currUrl, "price", price); currUrl = Methods.editParam(currUrl, "hk", hk); currUrl = Methods.editParam(currUrl, "k", k); currUrl = Methods.editParam(currUrl, "regioncode", rg); currUrl = Methods.editParam(currUrl, "page", "1"); currUrl = Methods.editParam(currUrl, "odb", ""); currUrl = Methods.editParam(currUrl, "t", ""); window.open(currUrl, "_self");
    }, onTradeSearch: function() { var currUrl = "/trade/default.aspx"; var k = $P("newkey").value; alert(k); if (k == "输入楼盘名、地址") k = ''; currUrl = Methods.editParam(currUrl, "k", k); window.open(currUrl, "_self"); }, showItem: function(itemIndex, subIndex, item) {
        if (itemIndex < 11) {
            for (var i = 0; i < 10; i++) { var obj1 = $P("item_" + (itemIndex - 1).toString() + i.toString()); var obj2 = $P("item_" + (itemIndex).toString() + i.toString()); if (obj1 && obj1.style.display == "block") { obj1.style.display = "none"; if (obj2) obj2.style.display = "block"; } }
            if ($P("item_" + (itemIndex).toString() + item.toString())) { $P("item_" + (itemIndex).toString() + item.toString()).style.display = "none"; }
            if ($P("item_" + (itemIndex - 1).toString() + item.toString()))
            { $P("item_" + (itemIndex - 1).toString() + item.toString()).style.display = "block"; }
        }
        else {
            for (var j = 0; j < 10; j++) {
                if ($P("item_" + (itemIndex - 1).toString() + subIndex.toString() + j.toString()).style.display == "block")
                { $P("item_" + (itemIndex - 1).toString() + subIndex.toString() + j.toString()).style.display = "none"; $P("item_" + (itemIndex).toString() + subIndex.toString() + j.toString()).style.display = "block"; }
            }
            $P("item_" + (itemIndex).toString() + subIndex.toString() + item.toString()).style.display = "none"; $P("item_" + (itemIndex - 1).toString() + subIndex.toString() + item.toString()).style.display = "block";
        }
    }, showHistoryCJ: function(projectid, houseid) { var u = '/Loupan/saledetail.aspx?pid=' + projectid + '&hid=' + houseid; Methods.openTopNewWin(u, 'open', 820, 600, true); }, getNewHouseSall: function(hid) { var url = "/com/ajaxPage/ajaxNewHouseSall.aspx?hid=" + hid; Methods.getAjaxStrAsync(url, bHouse.getSallContent); $P("div_sall").innerHTML = "<img src='/content/images/loading.gif'/>正在加载销售明细...."; }, getSallContent: function(sender, text) { $P("div_sall").innerHTML = text; }, ShowAllSale: function(pid) { if ($P("show_sale_" + pid).style.display == "none") { $P("show_sale_" + pid).style.display = ""; $P("sp_name_" + pid).innerHTML = "<b>&nbsp;&nbsp;简洁显示</b>"; } else { $P("show_sale_" + pid).style.display = "none"; $P("sp_name_" + pid).innerHTML = "<b>&nbsp;&nbsp;全部显示</b>"; } }, showRoom: function(rn, state, sg, rs, cf, nf, bs, ra, rr, rb) { var u = '/Loupan/room.aspx?rn=' + encodeURIComponent(rn) + '&state=' + state + '&sg=' + sg + '&rs=' + encodeURIComponent(rs) + '&cf=' + cf + '&nf=' + encodeURIComponent(nf) + '&bs=' + encodeURIComponent(bs) + '&ra=' + ra + '&rr=' + rr + '&rb=' + rb; Methods.openTopNewWin(u, 'new', 540, 180, true); }
}
function ScrollObj(obj,objName,msgScrollDelay,msgScreenDelay,lines,cTagName){this.target=document.getElementById(obj);this.objStr=objName;this.cTagName=cTagName;this.target.style.overflow="hidden";this.msgMinIndex=0;if(obj=="divReq")
this.msgCnt=this.target.getElementsByTagName(this.cTagName).length-8;else
this.msgCnt=this.target.getElementsByTagName(this.cTagName).length;this.lines=lines;this.msgMaxIndex=Math.floor(this.msgCnt/this.lines)-1;this.msgIndex=this.msgMinIndex-1;var odl=this.target.getElementsByTagName(this.cTagName)[0];var oStyle=null;if(odl){if(window.getComputedStyle){oStyle=window.getComputedStyle(odl,"");}
else{oStyle=odl.currentStyle;}
this.msgItemHeight=odl.offsetHeight+(isNaN(parseInt(oStyle.marginTop))?0:parseInt(oStyle.marginTop))+(isNaN(parseInt(oStyle.marginBottom))?0:parseInt(oStyle.marginBottom));}
else{this.msgItemHeight=0;}
this.msgScrollDelay=msgScrollDelay;this.msgScreenDelay=msgScreenDelay;var inst=this;inst.CloneMsgData();this.target.onmouseover=function(){inst.Suspended();};this.target.onmouseout=function(){inst.Resume();};this.timer=null;}
ScrollObj.prototype.CloneMsgData=function(){if(this.msgCnt*this.msgItemHeight<parseInt(this.target.style.height))return;var msgData=this.target.getElementsByTagName(this.cTagName);for(i=0;i<this.msgCnt;i++){this.target.appendChild(msgData[i].cloneNode(true));}}
ScrollObj.prototype.ShowContentUp=function(){if(this.msgIndex>this.msgMaxIndex){this.msgIndex=0;this.target.scrollTop=0;}
if(this.target.scrollTop<(this.msgIndex+1)*this.msgItemHeight*this.lines){this.target.scrollTop++;this.timer=setTimeout(this.objStr+".ShowContentUp();",this.msgScrollDelay);}
else{this.msgIndex++;this.timer=setTimeout(this.objStr+".ShowContentUp();",this.msgScreenDelay);}}
ScrollObj.prototype.Suspended=function(){clearTimeout(this.timer);}
ScrollObj.prototype.Resume=function(){this.ShowContentUp();}
function preImageLoad(name){try{var strBtn="";var strInit="";var imgNum=eval("imgNum_"+name);var palyImgs=eval("palyImgs_"+name);for(i=0;i<imgNum;i++)
{if(i==0)strBtn+="<a alt='"+(i+1)+"' class='pick' href='javascript:void(0);'>"+(i+1)+"</a>";else{strBtn+="<a alt='"+(i+1)+"' href='javascript:void(0);'>"+(i+1)+"</a>";}}
$P("play").innerHTML=strBtn;windowInitScrip.push("bHouse.n="+imgNum+";play();");}
catch(e){return;}}
var oCookie={setCookie:function(sName,sValue,oExpires,sPath,sDomain,bSecure){var sCookie=sName+"="+encodeURIComponent(sValue);if(oExpires){sCookie+="; expires="+oExpires.toUTCString();}
if(sPath){sCookie+="; path="+sPath;}
if(sDomain){sCookie+="; domain="+sDomain;}
if(bSecure){sCookie+="; secure";}
document.cookie=sCookie;},getCookie:function(sName){var sRE="(?:; )?"+sName+"=([^;]*);?";var oRE=new RegExp(sRE);if(oRE.test(document.cookie)){return decodeURIComponent(RegExp["$1"]);}else{return"";}},getCookieByName:function(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)
{var j=i+alen;if(document.cookie.substring(i,j)==arg)
return oCookie.getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;},getCookieVal:function(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1){endstr=document.cookie.length;}
return unescape(document.cookie.substring(offset,endstr));},deleteCookie:function(sName,sPath,sDomain){var sCookie=sName+"=; expires="+(new Date(0)).toGMTString();if(sPath){sCookie+="; path="+sPath;}
if(sDomain){sCookie+="; domain="+sDomain;}
document.cookie=sCookie;}};var oHouseCookie={count:6,GetCookieName:function(houseType)
{var cookieName=null;switch(houseType)
{case 3:cookieName="fbh_newHouse";break;case 4:cookieName="fbh_newbuilding";break;case 5:cookieName="fbh_building";break;}
return cookieName;},SetRecentVisitedHouse:function(houseInfo,houseType)
{if(houseInfo.trim()!=""&&houseType>0&&houseType<6)
{var cookieHouseList=null;var cookieName=oHouseCookie.GetCookieName(houseType);cookieHouseList=oHouseCookie.GetRecentVisitedHouseList(houseType,true);if(cookieHouseList.trim()=="")
{cookieHouseList=houseInfo;}
else
{if(cookieHouseList.indexOf(houseInfo)>=0)
{if(cookieHouseList.indexOf(houseInfo+"_0_")!=-1)
{cookieHouseList=cookieHouseList.replace(houseInfo+"_0_","");}
else if(cookieHouseList.indexOf("_0_"+houseInfo)!=-1)
{cookieHouseList=cookieHouseList.replace("_0_"+houseInfo,"");}
else
{cookieHouseList=cookieHouseList.replace(houseInfo,"");}}
var ArrHouse=cookieHouseList.split("_0_");if(ArrHouse.length>=oHouseCookie.count)
{cookieHouseList=ArrHouse.slice(0,oHouseCookie.count-1).join("_0_");}
if(cookieHouseList.trim()==""){cookieHouseList=houseInfo;}
else{cookieHouseList=houseInfo+"_0_"+cookieHouseList;}}
var oDate=new Date();oDate.setDate(oDate.getDate()+7);oCookie.setCookie(cookieName,cookieHouseList,oDate,"/",document.domain);}},GetRecentVisitedHouseList:function(houseType,isSp)
{if(houseType>5||houseType<1)return null;var cookieName=oHouseCookie.GetCookieName(houseType);if(isSp)
{return oCookie.getCookie(cookieName);}
else
{return oCookie.getCookie(cookieName).replace(/_0_/g,"");}}}
function GotoCompare(){ cs=$('input:checkbox:checked','#dvList');if(cs.length==0){alert("请选择需要比较的楼盘");return;}
if(cs.length>4){alert("对不起,只支持4个以下的楼盘对比");return;}
var ids=slzIDs(cs);if($.browser.msie){$('#newwindow')[0].href="/compare/info.aspx?bids="+ids;$('#newwindow')[0].target="_blank";$('#newwindow')[0].click();}else{window.location.href="/compare/info.aspx?bids="+ids;}
return false;}
function slzIDs(el,sign){var res='',type=',';if(sign)type=',';el.each(function(){res+=this.value+type;});return res;}
var HouseMap={initialize:function(obj,tid){var opts={z:14,scroll:true,mapControl:2,dragging:false,doubleZoom:true,ruler:true,scale:true,mapTypeControl:true,overview:true}
fm=new FbwMap(document.getElementById(obj),opts);fm.showPanel({id:tid});},initializeIndex:function(obj,bids,sec){var opts={z:17,scroll:true,mapControl:2,dragging:true,doubleZoom:true,ruler:true,scale:true,mapTypeControl:true,overview:true}
fm=new FbwMap(document.getElementById(obj),opts);setInterval(function(){var n=parseInt(bids.length*Math.random());fm.showBuildingPanel({id:bids[n]});},sec);}}