jQuery(document).ready(function() {
	$(".iAsk").hover(function() {$(this).children("dl").show(); $(this).children("a").addClass("hover");}, function() {$(this).children("dl").hide(); $(this).children("a").removeClass("hover");});	
	$("#js_proLibT").hover(function() {$("#js_proLib").show(); $(this).children("a").addClass("hover"); },function() {$("#js_proLib").hide(); $(this).children("a").removeClass("hover");});	
    $(".u_name").hover(function() { $(this).children("div").show(); $(".u_name strong").addClass("hover"); }, function() { $(this).children("div").hide(); $(".u_name strong").removeClass("hover"); });
    $(".com_pupop").hover(function() { $(this).children("div").show(); $(this).children("strong").addClass("hover"); }, function() { $(this).children("div").hide(); $(this).children("strong").removeClass("hover"); });
    $("#txtQuestionTitle").hover(function() { $("#tips_a").show(); $("#tips_b").hide(); $("#tips_c").hide(); }, function() { $("#tips_a").hide(); });
    $("#txtQuestionDesc").hover(function() { $("#tips_d").show(); }, function() { $("#tips_d").hide(); });
    $(".l_mk_l li").hover(function() { $(this).children("ul").show(); $(this).children("iframe").show(); $(this).children(".l_mk_l >li span").addClass("hover"); }, function() { $(this).children("ul").hide(); $(this).children("iframe").hide(); $(this).children(".l_mk_l >li span").removeClass("hover"); });
    $(".l_mk_l li ul li").hover(function() { $(this).addClass("li_cur"); }, function() { $(this).removeClass("li_cur"); });
    $(".a_mk_l li").hover(function() { $(this).children("ul").show(); $(this).children("iframe").show(); $(this).children(".a_mk_l >li span").addClass("hover"); }, function() { $(this).children("ul").hide(); $(this).children("iframe").hide(); $(this).children(".a_mk_l >li span").removeClass("hover"); });
    $(".a_mk_l li ul li").hover(function() { $(this).addClass("li_cur"); }, function() { $(this).removeClass("li_cur"); });
    $("label#no_name").hover(function() { $("span#no_name_tips").show(); }, function() { $("span#no_name_tips").hide(); });
    $(".mainWrap .top span").click(function() { $("#fancybox-wrap").hide(); $("#fancybox-overlay").hide(); });
    $("p.p_key span").click(function() { $(".p_pupop").show, $(".p_pupop_bg").show });
    $("p.p_pupop_tt em").click(function() { $(".p_pupop").hide, $(".p_pupop_bg").hide, $(".p_key span").hide, $(".p_key kbd").show });
	$(".nores_list li").hover(function() { $(this).addClass("cur"); $(this).children("em").show(); }, function() { $(this).removeClass("cur"); $(this).children("em").hide(); });
	$(".nores_list li em a").click(function() { $("div.a_pupop").show(); $(".p_pupop_bg").show(); });
	$("a.a_pupop_close").click(function() { $("div.a_pupop").hide(); $(".p_pupop_bg").hide(); });
	$(".i_main_list li").hover(function() { $(this).css("background","#eaf5de");},function() {$(this).css("background","#fff");});
    //焦点图 begin
    $(function() {
        var index = 0;
        $(".i_f_tt li").mouseover(function() {
            index = $(".i_f_tt li").index(this);
            showImg(index);
        });
        //滑入 停止动画，滑出开始动画.
        $('.i_f_pic li').hover(function() {
            if (MyTime) {
                clearInterval(MyTime);
            }
        }, function() {
            MyTime = setInterval(function() {
                showImg(index);
                index++;
                if (index == 5) { index = 0; }
            }, 4000);
        });
        //自动开始
        var MyTime = setInterval(function() {
            showImg(index);
            index++;
            if (index == 5) { index = 0; }
        }, 4000);
    });

    function showImg(i) {
        $(".i_f_pic li")
			.eq(i).stop(true, true).fadeIn(600)
			.siblings("li").hide()
			.eq(i + 1).stop(true, true).fadeOut(600);
        //$(contentDom).stop(true,true).animate({ top:i*(-255)}, "slow");
        $(".i_f_tt li")
			.eq(i).addClass("cur")
			.siblings("li").removeClass("cur");
    };
    $("div#com_itab_1 li").hover(function() {
        $("div#com_itab_1 li").each(function() {
            $(this).children("div").show(); $(this).children("p").hide();
            $(this).children("div").hide(); $(this).children("p").show();
        });
        $(this).children("div").show(); $(this).children("p").hide();
    },
		function() { });
    $("div#com_itab_2 li").hover(function() {
        $("div#com_itab_2 li").each(function() {
            $(this).children("div").show(); $(this).children("p").hide();
            $(this).children("div").hide(); $(this).children("p").show();
        });
        $(this).children("div").show(); $(this).children("p").hide();
    },
		function() { });
    $("div#com_itab_3 li").hover(function() {
        $("div#com_itab_3 li").each(function() {
            $(this).children("div").show(); $(this).children("p").hide();
            $(this).children("div").hide(); $(this).children("p").show();
        });
        $(this).children("div").show(); $(this).children("p").hide();
    },
		function() { });
});
/*  选项卡 */
function comTab(name, cursel, n) {
    for (i = 1; i <= n; i++) {
        var menu = document.getElementById(name + i);
        var con = document.getElementById("com_" + name + "_" + i);
        if (menu != null) {
            menu.className = i == cursel ? "cur" : "";
        }
        if (con != null) {
            con.style.display = i == cursel ? "block" : "none";
        }
    }
}

function operatemore(obj, add) {
    var button = document.getElementById(obj);
    if (button != null) {
        button.href = "/period/" + add + ".html";
    }
}
/* 搜索 */
function comTabSearch(name, cursel, n) {
    for (i = 1; i <= n; i++) {
        var menu = document.getElementById(name + i);
        menu.className = i == cursel ? "cur" : "";
    }
    var periodInfo = document.getElementById("selSearchAge");
    if (cursel == 1) {
        periodInfo.value = "";
    }
    else if (cursel == 2) {
        periodInfo.value = "-2";
    }
    else if (cursel == 3) {
        periodInfo.value = "-1";
    }
    else if (cursel == 4) {
        periodInfo.value = "0";
    }
    else if (cursel == 5) {
        periodInfo.value = "1";
    }
    else if (cursel == 6) {
        periodInfo.value = "3";
    }
}

//最终页页尾返回顶部
function goTopEx() {
    var obj = document.getElementById("back_top");
    function getScrollTop() {
        return document.documentElement.scrollTop;
    }
    function setScrollTop(value) {
        document.documentElement.scrollTop = value;
    }
    window.onscroll = function() { getScrollTop() > 0 ? obj.style.display = "" : obj.style.display = "none"; }
    obj.onclick = function() {
        var goTop = setInterval(scrollMove, 10);
        function scrollMove() {
            setScrollTop(getScrollTop() / 5);
            if (getScrollTop() < 1) clearInterval(goTop);
        }
    }
}

//png透明
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) {
        for (var j = 0; j < document.images.length; j++) {
            var img = document.images[j]
            var imgName = img.src.toUpperCase()
            if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                img.outerHTML = strNewHTML
                j = j - 1
            }
        }
    }
}
//window.attachEvent("onload", correctPNG);
/*  左侧导航打开关闭 */

function showmenu() {
    var leftMenu = document.getElementById("leftMenu");
    var leftBtn = document.getElementById("leftBtn");
    leftMenu.style.display = "block";
    leftBtn.style.display = "none";
}
function hiddenmenu() {
    var leftMenu = document.getElementById("leftMenu");
    var leftBtn = document.getElementById("leftBtn");
    leftMenu.style.display = "none";
    leftBtn.style.display = "block";
}
