//前台公告脚本文件
$(function () {
    $(".jumpPageSize").change(function () {//页面显示条数跳转事件
        document.location.href = $(this).val();
    });
    $(".Tab .Ttit ul li a").click(function () {//搜索框选项卡事件
        $(this).parent().parent().find("li").removeClass("on");
        $(this).parent().addClass("on");
        $(".Tab .Tcontent div").attr("style", "display:none;");
        $($(".Tab .Tcontent div").get($(this).parent().index())).attr("style", "display:block;");
    });
    $("#menu ul li").mouseover(function () {//菜单鼠标指上去改变背景
        $(this).addClass("on");
        $("#menuInfo li").css("display", "none");
        $($("#menuInfo li").get($(this).index())).css("display", "block");
    });
    $("#menu ul li").mouseout(function () {//菜单鼠标移开恢复背景
        if (!$(this).is($(".ice"))) {
            $(this).removeClass("on");
        }
    });
    function HTMLEncode(input) {
        var converter = document.createElement("DIV");
        converter.innerText = input;
        var output = converter.innerHTML;
        converter = null;
        return output;
    }
    $($("#menuInfo li").get($("#menu ul .on").index())).css("display", "block");//二级菜单显示脚本
    var NowUrl = location.href.split('/');
    $($("#top .Ttit ul li").get(0)).addClass("on");
    $($("#top .Tcontent>div").get(0)).css("display", "block");
    var result = location.search.match(new RegExp("[\?\&]skey=([^\&]+)", "i"));

    var SearchKey = "";
    if (result != null && result.length >= 1) {
        SearchKey = HTMLEncode(result[1]);
    }
    $($("#top .sinpt").get(0)).val(SearchKey);
    if (NowUrl.length >= 4) {
        if (NowUrl[3].toLowerCase() == "article") {
            $("#top .Ttit ul li").removeClass("on");
            $("#top .sinpt").val("");
            $("#top .Tcontent>div").css("display", "none");
            $($("#top .Ttit ul li").get(1)).addClass("on");
            $($("#top .sinpt").get(1)).val(SearchKey);
            $($("#top .Tcontent>div").get(1)).css("display", "block");
        }
    }

});
$(window).scroll(function () {
    if ($(window).scrollTop() >= 111) {
        $("#TopMenu").addClass("navfixed");
    }
    else {
        $("#TopMenu").removeClass("navfixed");
    }
});