﻿$(function() {
    $("#tabtitle_lian li").mouseover(function() {
        var j = $(this).index();
        if (j != 0 && j <= 7) {
            $(this).addClass("tabTitle").siblings().removeClass("tabTitle");
            $("#tabbg_lian div:even").css("display", "none");
            $("#tabbg_lian div:even").eq(j - 1).css("display", "block");
        }
    })
    $("#tabtitle_lian1 li").mouseover(function() {
        var j = $(this).index();
        if (j != 0 && j <= 7) {
            $(this).addClass("tabTitle").siblings().removeClass("tabTitle");
            $("#tabbg_lian1 div:even").css("display", "none");
            $("#tabbg_lian1 div:even").eq(j - 1).css("display", "block");
        }
    })
    $("#xiangmuku_liansmt li").mouseover(function() {
        var j = $(this).index();
        if (j != 0) {
            $(this).addClass("tabTitle").siblings().removeClass("tabTitle");
            $("#paixiamian div").css("display", "none");
            $("#paixiamian div").eq(0).css("display", "block");
            $("#paixiamian div").eq(j).css("display", "block");
            //$("#xiangmuku_liansmt div:even").css("display", "none");
            //$("#xiangmuku_liansmt div:even").eq(j - 1).css("display", "block");
        }
    });
})
// 自动滚动 
function boxmove(d1, e, obj) {
    var speed = 30;
    var demo = document.getElementById(d1);
    demo.innerHTML = demo.innerHTML;
    function boxRight() {
        if (demo.scrollLeft <= 0) {
            demo.scrollLeft += demo.offsetWidth;
        }
        else {
            demo.scrollLeft--;
        }
    }
    if (e == 2) {
        var MoveRight = setInterval(boxRight, speed);
        demo.onmouseover = function() { clearInterval(MoveRight) }
        demo.onmouseout = function() { MoveRight = setInterval(boxRight, speed) }
    }
    if (e == "right") {
        MoveRight = setInterval(boxRight, speed)
        obj.onmouseout = function() { clearInterval(MoveRight); }
    }
}
$(function() {
    boxmove("lunzhuan_lian", 2);
})


