$(function () {
    if ($("div.word").html()) {
        $("div.word").css({ opacity: 0.85 });
        auto();
        hookThumb();
        hookBtn();
    }
});
var count = 1;
function nextBtnClick() {
    defaultBtnBg();
    if (count >= 3) {
        count = 3
    } else {
        count += 1
    }
    judge(count, "/images/cms/design/common/icon_scrollnav_hover.gif")
}
function prevBtnClick() {
    defaultBtnBg();
    if (count <= 1) {
        count = 1
    } else {
        count -= 1
    }
    judge(count, "/images/cms/design/common/icon_scrollnav_hover.gif")
}
function defaultBtnBg() {
    $(".scrollnav img").attr("src", "/images/cms/design/common/icon_scrollnav.gif")
}
function judge(B, A) {
    switch (B) {
        case 1:
            $(".firstSlide").attr("src", A);
            break;
        case 2:
            $(".secondSlide").attr("src", A);
            break;
        case 3:
            $(".thirdSlide").attr("src", A);
            break;
    }
};


//tabs
(function (A) { var B = { event: "mouseover", selectedClass: "ui-tscure", hideClass: "ui-tabs-hide" }; A.fn.tabs = function (E) { var E = A.extend(B, E), C = null, D = []; var C = A("a:first-child", this); C.each(function () { var F = this.hash && this.hash.substr(1); D.push(F) }); if (D.length == 0) { return false } C.unbind(E.event).bind(E.event, function () { C.hasClass(E.selectedClass) && C.removeClass(E.selectedClass); A(this).addClass(E.selectedClass); var F = this.hash && this.hash.substr(1); for (var G = 0; G < D.length; G++) { if (D[G] == F) { A("#" + D[G]).removeClass(E.hideClass) } else { A("#" + D[G]).addClass(E.hideClass) } } }).click(function () { this.blur(); return false }) } })(jQuery);


//slide
var timer = null; var offset = 5000; var index = -1; function slideImage(A) { var B = "image_" + target[A]; $("#" + B).animate({ opacity: 1 }, 800, function () { $(this).find(".word").animate({ height: "show" }, "slow") }).show().siblings(":visible").find(".word").animate({ height: "hide" }, "fast", function () { $(this).parent().animate({ opacity: 0 }, 800).hide() }) } function hookThumb() { $("#thumbs li a").bind("click", function () { if (timer) { clearTimeout(timer) } var A = this.id; index = getIndex(A.substr(6)); rechange(index); slideImage(index); timer = window.setTimeout(auto, offset); this.blur(); return false }) } function hookBtn() { $("#thumbs li img").filter("#play_prev,#play_next").bind("click", function () { if (timer) { clearTimeout(timer) } var A = this.id; if (A == "play_prev") { index--; if (index < -1) { index = 6 } } else { index++; if (index > 6) { index = -1 } } rechange(index); slideImage(index); timer = window.setTimeout(auto, offset) }) } function getIndex(A) { for (var B = 0; B < target.length; B++) { if (target[B] == A) { return B } } } function rechange(A) { var B = "thumb_" + target[A]; $("#thumbs li a.current").removeClass("current"); $("#" + B).addClass("current") } function auto() { index++; if (index > 6) { index = -1 } rechange(index); slideImage(index); timer = window.setTimeout(auto, offset) };
