﻿
        $(function() {
        $("#btn_s span").hover(
                function() {     
                    $(this).css({ cursor: "hand", background: "#fff", height: "26px" });
                    $(this).siblings().css({ background: "#f0f0f0", height: "25px" });
                    $("#neirong_s div").eq($("#btn_s span").index($(this))).css("visibility", "visible");
                    $("#neirong_s div").eq($("#btn_s span").index($(this))).siblings().css("visibility", "hidden");
                },
                function() { });
        });
        $(function() {
            $("#img_s").append($("#img_s").html());
            scroll();
        });
        var timerID;
        function scroll() {
            if ($("#scroll_s").scrollLeft() >= 1297) {$("#scroll_s").scrollLeft(0); }
            $("#scroll_s").scrollLeft($("#scroll_s").scrollLeft() + 1);
            timerID = setTimeout("scroll()", 10);
        }
        $(function() {
            $(".img_container").hover(function() { clearTimeout(timerID); }, function() { scroll(); });
        });
        $(function() {
            $(".play_img").fadeOut(10);
            $(".img_detail").fadeOut(10);
            $(".ctr_s img").animate({ opacity: "0.5" }, 100);
            $(".ctr_s img").hover(function() { $(this).css({ cursor: "hand"});});
            $(".ctr_s img").click(function() {
                clearTimeout(timerID2);
                $(this).animate({ top: "0", opacity: "1" }, 1000);
                $(this).prevAll().animate({ top: "30", opacity: "0.5" }, 1000);
                $(this).nextAll().animate({ top: "30", opacity: "0.5" }, 1000);
                index = $(".ctr_s img").index($(this));

                change();
                index = (index + 1) % 4;
                timerID2 = setTimeout("play()", 3000);
            });
            play();
        });
        var timerID2;
        var index = 0;
        function change() {
            $(".play_img").fadeOut("slow");
            $(".play_img").eq(index).fadeIn("slow");

            $(".img_detail").fadeOut("slow");
            $(".img_detail").eq(index).fadeIn("slow");
        }
        var flag = 0;
        function play() {
            $(".ctr_s img").eq(index).click();
        }

        $(function() {
            $("#choice span").hover(function() {
            $(this).css("cursor", "hand");
            $(".choice_s").css("z-index", "0");
            $(".choice_s").eq($("#choice span").index($(this))).css("z-index", "1");});

            $(".choice_2s span").hover(function() {
            $(this).css("cursor", "hand");
            $(".div_link").css("z-index", "0");
            $(".div_link").eq($(".choice_2s span").index($(this))).css("z-index", "1");
        });
        });
