    $(document).ready(function () {
        $("#nav ul li").hover(function () {
            $(this).addClass("hover");
            $(this).children(".showMenu").css("display", "block")
        }, function () {
            $(this).removeClass("hover");
            $(this).children(".showMenu").css("display", "none")
        })
    })



    //关键函数：通过控制i ，来显示不通的幻灯片
    function showImg(i) {
        $("#img a")
		.eq(i).stop(true, true).fadeIn(800)
		.siblings("a").fadeOut(800);
        $("#btn span")
		.eq(i).addClass("hov")
		.siblings().removeClass("hov");
    }

    $(document).ready(function () {
        $("#img a").eq(0).show();
        $("#btn span").eq(0).addClass('hov');
        $("#showtext").empty().append($("#img a").eq(0).attr('title'));

        var index = 0;
        $("#btn span").mouseover(function () {
            index = $("#btn span").index(this);
            showImg(index);
        });
        var lenght = $("#img a").length;
        var time = 3000;

        //滑入 停止动画，滑出开始动画.
        $('#frame').hover(
	 	function () {
	 	    if (MyTime) {
	 	        clearInterval(MyTime);
	 	    }
	 	}, function () {
	 	    MyTime = setInterval(function () {
	 	        showImg(index)
	 	        index++;
	 	        if (index == lenght) { index = 0; }
	 	    }, time);
	 	});
        //自动开始
        var MyTime = setInterval(function () {
            showImg(index)
            index++;
            if (index == lenght) { index = 0; }
        }, time);
    })




    function z_showImg(i) {
        $("#z_img a")
		.eq(i).stop(true, true).fadeIn(800)
		.siblings("a").fadeOut(800);

        $("#z_btn span")
		.eq(i).addClass("z_hov")
		.siblings().removeClass("z_hov");
    }

    $(document).ready(function () {
        $("#z_img a").eq(0).show();
        $("#z_btn span").eq(0).addClass('z_hov');

        var z_index = 0;
        $("#z_btn span").mouseover(function () {
            z_index = $("#z_btn span").index(this);
            z_showImg(z_index);
        });
        var z_lenght = $("#z_img a").length;
        var z_time = 3000;

        //滑入 停止动画，滑出开始动画.
        $('#z_frame').hover(
	 	function () {
	 	    if (z_MyTime) {
	 	        clearInterval(z_MyTime);
	 	    }
	 	}, function () {
	 	    z_MyTime = setInterval(function () {
	 	        z_showImg(z_index)
	 	        z_index++;
	 	        if (z_index == z_lenght) { z_index = 0; }
	 	    }, z_time);
	 	});
        //自动开始
        var z_MyTime = setInterval(function () {
            z_showImg(z_index)
            z_index++;
            if (z_index == z_lenght) { z_index = 0; }
        }, z_time);
    })


