﻿
$(function() {
    //window.onerror = killErrors;
    GetUserCookie(); //cookie处理
    //Cate More获取
    $("#bntTopMoreCate1").click(function(e) {
        $("#divTopMoreCate1").css({ "top": (e.pageY - 120) + "px", "left": (e.pageX - 152) + "px" }).fadeIn("slow");
        return false;
    });
    $("#bntTopMoreCate1Close").click(function() {
        $("#divTopMoreCate1").hide();
        return false;
    });
    $('#ulTopList>li').mouseover(function() {
        $(this).addClass('liDaohang')
                 .siblings().removeClass('liDaohang').end()
                 .children('a').addClass('aDaohang').removeClass('aDaohangNo').end()
                 .siblings().children('a').addClass('aDaohangNo').removeClass('aDaohang').end();
        var vGet = jQuery.trim($(this).text());
        if (vGet == '展会') {
            $('#divTopChildExpo').show().siblings().hide();
        }
        else if (vGet == '资讯') {
            $('#divTopChildNews').show().siblings().hide();
        }
        else if (vGet == '人才') {
            $('#divTopChildJob').show().siblings().hide();
        }
        else if (vGet == '招商') {
            $('#divTopChildAgent').show().siblings().hide();
        }
        else {
            $('#divTopChildIndex').show().siblings().hide();
        }
    });
    $('#ulTopSearch>li').mouseover(function() {
        $(this).addClass('cliTopSearch')
                 .siblings().removeClass('cliTopSearch').end();
    });
    $("#inputKeyword").focus(function() {
        if ($(this).val() == this.defaultValue) {
            $(this).val("");
        }
    });
    $("#inputKeyword").blur(function() {
        if ($(this).val() == "") {
            $(this).val(this.defaultValue);
        }
    });
    $("#lbntSetHome").click(function() {
        this.style.behavior = 'url(#default#homepage)';
        this.setHomePage('http://www.hnepb.cn');
    });
    $("#lbntAddFavorite").click(function() {
        window.external.addFavorite('http://www.hnepb.cn', '中国环境保护网')
    });
    $("#lbntLoginOut").click(function() {
        if ($.jCookie("User") != false) {
            $.post("/member/loginout.aspx", {
        }, function(data, textStatus) {
            $("#divMemInfo").html("欢迎来到原料城，请<font color='#0000FF'> <a href='http://www.hnepb.cn/member/login.aspx'>登录</a> </font>或 <font color='#0000FF'><a href='http://www.hnepb.cn/member/reg.aspx'>免费注册</a></font>");
        });

    }

});
$("#bntTqAdTop").click(function() {
    var sTmpUrl = "http://wpa.qq.com/msgrd?V=1&Site=中国环境保护网&Uin=4074111&Menu=yes";
    window.open(sTmpUrl);
    return false;
});
//escape,encodeURI,encodeURIComponent，相应3个解码函数：unescape,decodeURI,decodeURIComponent
$("#bntSearch").click(function() {
    if ($("#inputKeyword").val() == '') {
        return;
    }
    var iType = 0;
    var sType = jQuery.trim($('#ulTopSearch >li.cliTopSearch').eq(0).text());
    if (sType == '供应') {
        iType = 1;
    }
    else if (sType == '求购') {
        iType = 2;
    }
    else if (sType == '公司') {
        iType = 7;
    }
    else if (sType == '招商') {
        iType = 4;
    }
    else if (sType == '资讯') {
        iType = 8;
    }
    var sSearchkey = $("#inputKeyword").val();
    sSearchkey = sSearchkey.replace(/['"-_":""("")"]/g, "");
    sSearchkey = encodeURIComponent(sSearchkey).toLowerCase();
    var sUrl = "http://so.hnepb.cn/0-" + iType + "-" + sSearchkey + ".html";
    window.location.href = sUrl;
});
$("#inputKeyword").keydown(function(e) {
    //keyCode==13 为回车
    if (e.keyCode == 13) {
        $("#bntSearch").click();
    }
});




//图片快速提示
//$('img[title]').mouseover(function(e) {
//    var vTooltip = "<div id='tooltip'>" + $(this).attr("title") + "</div>";
//    this.mytitle = this.title;
//    this.title = ""
//    $("body").append(vTooltip);
//    $("#tooltip").hide();
//    $("#tooltip").css({ "top": (e.pageY + 20) + "px", "left": (e.pageX + 10) + "px", "position": "absolute", "border": "1px solid", "background": "#ffffff", "padding": "3px" }).fadeIn("slow");
//})
//.mouseout(function() {
//    this.title = this.mytitle;
//    $("#tooltip").remove();
//})
//.mousemove(function(e) {
//    $("#tooltip").css({ "top": (e.pageY + 20) + "px", "left": (e.pageX + 10) + "px", "position": "absolute", "border": "1px solid", "background": "#ffffff", "padding": "3px" });
//});

});
function killErrors() {
    return true;
}



function GetUserCookie() {
    var vCookieUser = $.jCookie("User");

    if (vCookieUser != false) {
        vUserName = GetCookieSubValue(vCookieUser, "sUserName");
        $("#divMemInfo").html("欢迎来到原料城，<font color='#0000FF'><a href='http://www.hnepb.cn/member/'>" + vUserName + "</a></font> ");
        $("#divMemInfo").append("<font color='#0000FF'><a href='#' id='lbntLoginOut'>退出</a></font>");

    };
};
function GetCookieSubValue(sCookieName, sKeyName) {
    // get the single cookies
    var _aCookies = sCookieName.split('&');
    var _iLenght = _aCookies.length;
    // parse cookies
    while (_iLenght--) {
        var _aCurrrent = _aCookies[_iLenght].split("=");
        // find the requested one
        if (jQuery.trim(_aCurrrent[0]) === sKeyName) { return decodeURI(_aCurrrent[1]); }
    }
};
function OpenListDialog(iID, iUserID, sUserName) {
    $.post("/Message/GetUserMessageTool.aspx", {
        iUserID: iUserID
    }, function(data, textStatus) {
        $("#tbMessageTool").html(data);
    });
    $('#divMsn').dialog('open');
    $('#inputID').val(iID);
    $('#inputUserID').val(iUserID);
    $('#lbCorpName').html(sUserName);
    $("#ui-dialog-title-dialog").html("提交留言-" + sUserName);
};

//其他文件调用的ready
function AgentListReady() {
    //初始选择Begin
    $("#ulTopList>li:contains('招商')").mouseover();
    $("#ulTopSearch>li:contains('招商')").mouseover();

    //初始选择End

    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    $('#bntShowMessage').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        $('#divMsn').dialog('close');
        $('#dialog').dialog('open');
        return false;
    });
    $('#bntMessageCheck').click(function() {
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        $.post("/Message/MessageAdd.aspx", {
            iColumCateID: 4,
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            sContactuser: encodeURIComponent($("#tbContactUser").val()),
            sMessage: encodeURIComponent($("#tbMessage").val()),
            sAddr: encodeURIComponent($("#tbContactAddr").val()),
            sPhone: encodeURIComponent($("#tbContactPhone").val()),
            sEmail: encodeURIComponent($("#tbContactEmail").val()),
            sCheck: $("#ipnutMessageCheck").val()
        }, function(data, textStatus) {
            $("#lbMessageShow").html(data);
            $('#aimgMessageCheck').click();
        });
    });
    $("#liAreaMore").click(function() {
        if ($("#liAreaMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liAreaMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liAreaMore").html("+ 全部展开");
        }
    });
    $("#liCateMore").click(function() {
        if ($("#liCateMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liCateMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liCateMore").html("+ 全部展开");
        }
    });
};
function AgentDetailReady() {
    //初始选择Begin
    $("#ulTopList>li:contains('招商')").mouseover();
    $("#ulTopSearch>li:contains('招商')").mouseover();
    //初始选择End
    // Dialog Link
    //    $('#dialog_link').click(function() {
    //        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
    //        $("#imgMessageCheck").attr("src", sCheckUrl);
    //        $('#dialog').dialog('open');
    //        return false;
    //    });
    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    //提交留言
    $(".AgentLiuyan_Right>ul>li>span").click(function() {
        $("#tbMessageNote").text($(this).text());
    });
    $('#bntMessageCheck').click(function() {
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        var iCooperateCate = $('#tbMessageCate option:selected').val();
        if (iCooperateCate == 0) {
            $('#tbMessageShow').text("请选择代理类别");
            return false;
        }
        var iReDay = $('.AgentLiuyan_Left :radio:checked').val();
        if ($.trim($('#tbMessageNote').val()) == '可单击右侧快速留言！' || $.trim($('#tbMessageNote').val()) == '') {
            $('#tbMessageShow').text("请填写留言内容");
            return false;
        }
        if ($.trim($('#tbMessageContactName').val()) == '') {
            $('#tbMessageShow').text("请填写联系人");
            return false;
        }
        if ($.trim($('#tbMessageAddr').val()) == '') {
            $('#tbMessageShow').text("请填写地址");
            return false;
        }
        if ($.trim($('#tbPhone').val()) == '') {
            $('#tbMessageShow').text("请填写电话");
            return false;
        }
        if ($.trim($('#tbMessageCheck').val()) == '') {
            $('#tbMessageShow').text("请填写验证码");
            return false;
        }

        $.post("/Message/AgentMessageAdd.aspx", {
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            iCooperateCate: iCooperateCate,
            iReDay: iReDay,
            sName: encodeURIComponent($("#tbMessageName").val()),
            sNote: encodeURIComponent($("#tbMessageNote").val()),
            sContactCorpName: encodeURIComponent($("#tbMessageCorpName").val()),
            sContactName: encodeURIComponent($("#tbMessageContactName").val()),
            sContactAddr: encodeURIComponent($("#tbMessageAddr").val()),
            sContactPhone: encodeURIComponent($("#tbPhone").val()),
            sContactFax: encodeURIComponent($("#tbFax").val()),
            sContactEmail: encodeURIComponent($("#tbMessageEmail").val()),
            sQQ: $("#tbQQ").val(),
            sCheck: $("#tbMessageCheck").val()
        }, function(data, textStatus) {
            $("#tbMessageShow").html(data);
            $('#imgMessageCheck').click();
        });
    });
};

function SupllyListReady() {
    $("#ulTopList>li:contains('供应')").mouseover();
    $("#ulTopSearch>li:contains('供应')").mouseover();
    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    $('#bntShowMessage').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        $('#divMsn').dialog('close');
        $('#dialog').dialog('open');
        return false;
    });
    $('#bntMessageCheck').click(function() {
        //初始选择Begin
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        //初始选择End
        $.post("/Message/MessageAdd.aspx", {
            iColumCateID: 1,
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            sContactuser: encodeURIComponent($("#tbContactUser").val()),
            sMessage: encodeURIComponent($("#tbMessage").val()),
            sAddr: encodeURIComponent($("#tbContactAddr").val()),
            sPhone: encodeURIComponent($("#tbContactPhone").val()),
            sEmail: encodeURIComponent($("#tbContactEmail").val()),
            sCheck: $("#ipnutMessageCheck").val()
        }, function(data, textStatus) {
            $("#lbMessageShow").html(data);
            $('#aimgMessageCheck').click();
        });
    });
    $("#liAreaMore").click(function() {
        if ($("#liAreaMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liAreaMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liAreaMore").html("+ 全部展开");
        }
    });
    $("#liCateMore").click(function() {
        if ($("#liCateMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liCateMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liCateMore").html("+ 全部展开");
        }
    });
};
function BuyListReady() {
    $("#ulTopList>li:contains('求购')").mouseover();
    $("#ulTopSearch>li:contains('求购')").mouseover();
    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    $('#bntShowMessage').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        $('#divMsn').dialog('close');
        $('#dialog').dialog('open');
        return false;
    });
    $('#bntMessageCheck').click(function() {
        //初始选择Begin
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        //初始选择End
        $.post("/Message/MessageAdd.aspx", {
            iColumCateID: 2,
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            sContactuser: encodeURIComponent($("#tbContactUser").val()),
            sMessage: encodeURIComponent($("#tbMessage").val()),
            sAddr: encodeURIComponent($("#tbContactAddr").val()),
            sPhone: encodeURIComponent($("#tbContactPhone").val()),
            sEmail: encodeURIComponent($("#tbContactEmail").val()),
            sCheck: $("#ipnutMessageCheck").val()
        }, function(data, textStatus) {
            $("#lbMessageShow").html(data);
            $('#aimgMessageCheck').click();
        });
    });
    $("#liAreaMore").click(function() {
        if ($("#liAreaMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liAreaMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liAreaMore").html("+ 全部展开");
        }
    });
    $("#liCateMore").click(function() {
        if ($("#liCateMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liCateMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liCateMore").html("+ 全部展开");
        }
    });
};

function GoodsListReady() {
    $("#ulTopList>li:contains('产品')").mouseover();
    $("#ulTopSearch>li:contains('供应')").mouseover();
    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    $('#bntShowMessage').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        $('#divMsn').dialog('close');
        $('#dialog').dialog('open');
        return false;
    });
    $('#bntMessageCheck').click(function() {
        //初始选择Begin
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        //初始选择End
        $.post("/Message/MessageAdd.aspx", {
            iColumCateID: 3,
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            sContactuser: encodeURIComponent($("#tbContactUser").val()),
            sMessage: encodeURIComponent($("#tbMessage").val()),
            sAddr: encodeURIComponent($("#tbContactAddr").val()),
            sPhone: encodeURIComponent($("#tbContactPhone").val()),
            sEmail: encodeURIComponent($("#tbContactEmail").val()),
            sCheck: $("#ipnutMessageCheck").val()
        }, function(data, textStatus) {
            $("#lbMessageShow").html(data);
            $('#aimgMessageCheck').click();
        });
    });
    $("#liAreaMore").click(function() {
        if ($("#liAreaMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liAreaMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liAreaMore").html("+ 全部展开");
        }
    });
    $("#liCateMore").click(function() {
        if ($("#liCateMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liCateMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liCateMore").html("+ 全部展开");
        }
    });
};

function UserListReady() {
    $("#ulTopList>li:contains('黄页')").mouseover();
    $("#ulTopSearch>li:contains('公司')").mouseover();
    $('#aimgMessageCheck').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        return false;
    });
    $('#bntShowMessage').click(function() {
        var sCheckUrl = "/Check/CheckImg.aspx?Random=" + Math.random();
        $("#imgMessageCheck").attr("src", sCheckUrl);
        $('#divMsn').dialog('close');
        $('#dialog').dialog('open');
        return false;
    });
    $('#bntMessageCheck').click(function() {
        //初始选择Begin
        var vUserID = '0';
        var vCookieUser = $.jCookie("User");
        if (vCookieUser != false) {
            vUserID = GetCookieSubValue(vCookieUser, "iID");
        }
        //初始选择End
        $.post("/Message/MessageAdd.aspx", {
            iColumCateID: 7,
            iID: $("#inputID").val(),
            iSendUserID: vUserID,
            sContactuser: encodeURIComponent($("#tbContactUser").val()),
            sMessage: encodeURIComponent($("#tbMessage").val()),
            sAddr: encodeURIComponent($("#tbContactAddr").val()),
            sPhone: encodeURIComponent($("#tbContactPhone").val()),
            sEmail: encodeURIComponent($("#tbContactEmail").val()),
            sCheck: $("#ipnutMessageCheck").val()
        }, function(data, textStatus) {
            $("#lbMessageShow").html(data);
            $('#aimgMessageCheck').click();
        });
    });
    $("#liAreaMore").click(function() {
        if ($("#liAreaMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liAreaMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liAreaMore").html("+ 全部展开");
        }
    });
    $("#liCateMore").click(function() {
        if ($("#liCateMore").html() == "+ 全部展开") {
            $(this).siblings().removeClass('DisplayNone');
            $("#liCateMore").html("- 精简显示");
        }
        else {
            $(this).nextAll().addClass('DisplayNone');
            $("#liCateMore").html("+ 全部展开");
        }
    });
};
function IndexReady() {
    //SetTopAd();
    $("#liHotAgentTab").mousemove(function() {
        $(this).removeClass("normal").addClass("active")
                .siblings().removeClass("active").addClass("normal");
        $("#divHotAgent").show().siblings().hide();
    });
    $("#liNormalAgentTab").mousemove(function() {
        $(this).removeClass("normal").addClass("active")
                .siblings().removeClass("active").addClass("normal");
        $("#divRecommendAgent").show().siblings().hide();
    });
    $("#liProxyTab").mousemove(function() {
        $(this).removeClass("normal").addClass("active")
                .siblings().removeClass("active").addClass("normal");
        $("#divProxy").show().siblings().hide();
    });
    $("#liResellerTab").mousemove(function() {
        $(this).removeClass("normal").addClass("active")
                .siblings().removeClass("active").addClass("normal");
        $("#divReseller").show().siblings().hide();
    });
    $('.caOragen').mouseover(function() {
        $(this).css("background", "#fef9d1")
                .css("border-color", "#FF7300");
    });
    $('.caOragen').mouseout(function() {
        $(this).css("background", "#ffffff")
               .css("border-color", "#ffffff");
    });
    //a字符串控制到17个字
    $('#divHotAgent>ul>li>a').each(function() {
        var vTmp = $.trim($(this).text());
        vTmp = vTmp.substring(0, 15);
        $(this).text(vTmp);
    });
    //a字符串控制到17个字
    $('#divNewsNew a').each(function() {
        var vTmp = $.trim($(this).text());
        vTmp = vTmp.substring(0, 16);
        $(this).text(vTmp);
    });
    $(".linkCate").mouseover(function() {
        $(this).addClass("curr_li")
                .siblings().removeClass("curr_li");
        var iSelectCate = $(this).attr("rel");
        $("#my-link-content>p").eq(iSelectCate).show()
                .siblings().hide();
    });
    $("#bntTqAd").click(function() {
        var sTmpUrl = "http://wpa.qq.com/msgrd?V=1&Site=中国环境保护网&Uin=4074111&Menu=yes";
        window.open(sTmpUrl);
        return false;
    });

    $("#bntQQNews").click(function() {
        var sTmpUrl = "http://wpa.qq.com/msgrd?V=1&Site=中国环境保护网&Uin=4074111&Menu=yes";
        window.open(sTmpUrl);
        return false;
    });
    $("#bntQQExpo").click(function() {
        var sTmpUrl = "http://wpa.qq.com/msgrd?V=1&Site=中国环境保护网&Uin=4074111&Menu=yes";
        window.open(sTmpUrl);
        return false;
    });
    $(".leibie a").mouseover(function(e) {
        var vHref = $(this).attr("href");
        IndexShowBwCate1(1,vHref,e);
    });
    $(".leibie2 a").mouseover(function(e) {
        var vHref = $(this).attr("href");
        IndexShowBwCate2(1,vHref, e);
    });
    $("#divNewsPoll").html(GetPollPicDiv());
    ChangePollPicPro();
}
function IndexShowBwCate2(iColum,vHref,e) {
    var iHrefPos1 = vHref.lastIndexOf("-");
    var iHrefPos2 = vHref.indexOf(".html");
    if (iHrefPos1 == -1 || iHrefPos2 == -1) {
        return;
    }
    var iCate2 = vHref.substring(iHrefPos1 + 1, iHrefPos2);
    iCate2 = iColum + "-0-" + iCate2 + "-0";
    if (vBW[iCate2] == null) {
        $("#divBWshow").fadeOut();
        return;
    }
    IndexShowBwBase(iCate2, e);
}
function IndexShowBwCate1(iColum, vHref, e) {
    var iHrefPos1 = vHref.lastIndexOf("/");
    var iHrefPos2 = vHref.indexOf(".html");
    if (iHrefPos1 == -1 || iHrefPos2 == -1) {
        return;
    }
    var iCate1 = vHref.substring(iHrefPos1 + 1, iHrefPos2);
    iCate1 = iColum+"-" + iCate1 + "-0-0";
    if (vBW[iCate1] == null) {
        $("#divBWshow").fadeOut();
        return;
    }
    IndexShowBwBase(iCate1, e);
}
function IndexShowBwBase(iCateID, e) {
    var vUrlLst = vBW[iCateID].split(',');
    var vUrl = "";
    for (i = 0; i < vUrlLst.length - 1; i++) {
        var vUrlCell = vUrlLst[i].split('|');
        vUrl = vUrl + "<li><a href=" + vUrlCell[1] + ">" + vUrlCell[0] + "</a></li>";
    }
    if (vUrlLst.length > 1) {

        $("#divBWshow>ul").html(vUrl);
        $("#divBWshow").css({ "top": (e.pageY) + "px", "left": (e.pageX) + "px" }).fadeIn("slow");
    }
    else {
        $("#divBWshow").fadeOut();
    }
}
function SetTopAd() {
    $(".top").before("<a href='http://www.hnepb.cn/about/biaowang.html'><div id='divTopAd' style='width:960px;height:0px;background-image:url(/images/bwad.jpg); background-repeat:no-repeat;margin:0 auto;' id='bntTopAd'></div></a>");
    AddTopAdHeigh();
    setTimeout("DelTopAdHeigh()", 15000);
}
function AddTopAdHeigh() {
    if (m_TopAdHeight > 300)  //高度 
    {
        return;
    }
    m_TopAdHeight = m_TopAdHeight + 5;;
    document.getElementById("divTopAd").style.height = m_TopAdHeight + "px";
    setTimeout("AddTopAdHeigh()", 30);
}
function DelTopAdHeigh() {
    if (m_TopAdHeight < 5) {
        $("#divTopAd").hide();
        return;
    }
    m_TopAdHeight = m_TopAdHeight - 5;
    document.getElementById("divTopAd").style.height = m_TopAdHeight + "px";
    setTimeout("DelTopAdHeigh()", 30);
}
function GetPollPicDiv() {
    var divPollPic = '<style>';
    divPollPic += ('.axx{padding:0px 7px 3px;*padding:1px 7px;border-left:#cccccc 1px solid;}');
    divPollPic += ('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
    divPollPic += ('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
    divPollPic += ('.bxx{padding:0px 7px 3px;*padding:1px 7px;border-left:#cccccc 1px solid;}');
    divPollPic += ('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
    divPollPic += ('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
    divPollPic += ('</style>');
    divPollPic += ('<div style="width:' + m_iPollPicWidth + 'px;height:' + m_iPollPicHeights + 'px;overflow:hidden;text-overflow:clip;">');
    divPollPic += ('<div><a id="imgPollUrl"><img id="imgPollPic" style="border:0px;filter:progid:dximagetransform.microsoft.wipe(gradientsize=1.0,wipestyle=4, motion=forward)" width=' + m_iPollPicWidth + ' height=' + m_iPollPicHeights + ' /></a></div>');
    divPollPic += ('<div style="filter:alpha(style=1,opacity=10,finishOpacity=80);-moz-opacity:0.8; opacity:0.8;background: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding:0px;margin:0px;border:0px;">');
    for (var i = 1; i < m_iPollPicCount + 1; i++) { divPollPic += ('<a href="javascript:ChangePollPic(' + i + ');" id="xxjdjj' + i + '" class="axx" target="_self">' + i + '</a>'); }
    divPollPic += ('</div></div>');
    return divPollPic;
}
function ChangePollPicPro() {
    if (m_iPollPicCount == 0) {
        return;
    }
    if (m_bNoFirstPic == 0) { m_bNoFirstPic = 1; }
    else if (document.all)
    { document.getElementById("imgPollPic").filters[0].Apply(); document.getElementById("imgPollPic").filters[0].Play(duration = 2); }
    eval('document.getElementById("imgPollPic").src=img' + m_iCurPic);
    eval('document.getElementById("imgPollPic").alt=alt' + m_iCurPic);
    eval('document.getElementById("imgPollUrl").href=url' + m_iCurPic);
    eval('$("#divNewsPollNameShow").html(alt' + m_iCurPic + '.substring(0, 20))');
    
    for (var i = 1; i <= m_iPollPicCount; i++) { document.getElementById("xxjdjj" + i).className = 'axx'; }
    document.getElementById("xxjdjj" + m_iCurPic).className = 'bxx';
    m_iCurPic++; if (m_iCurPic > m_iPollPicCount) { m_iCurPic = 1; }
    m_timerPollPic = setTimeout('ChangePollPicPro()', 4000);
}
function ChangePollPic(iCurPic) { m_iCurPic = iCurPic; window.clearInterval(m_timerPollPic); ChangePollPicPro(); }
function ZhishuReady() {
    $("#bntIndexSearch").click(function() {
        if ($("#tbIndexKey").val() == "") {
            return;
        }
        var sUrl = "http://zhishu.hnepb.cn/zhishu/search.aspx?iCityID=" + $("#ddlstIndexCity").val() + "&sKey=" + encodeURIComponent($("#tbIndexKey").val());
        window.location.href = sUrl;
    });
};
