// JavaScript Document
//广告图滑动js
//$(function() {
//    var numb = $(".num li").size();
//    var xx = 0;
//    $(".num li").mouseover(function(aa) {
//        aa = $(this).index();
//        xx = aa;
//        $(this).addClass("hover").siblings().removeClass("hover");
//        $(".imgs li").eq(aa).addClass("cur").siblings().removeClass("cur");
//    });

//    function setTab() {
//        $(".num li").eq(xx).addClass("hover").siblings().removeClass("hover");
//        $(".imgs li").eq(xx).addClass("cur").siblings().removeClass("cur");
//        xx += 1;
//        if (xx > 5) xx = 0;
//    }
//    setInterval(setTab, 2000);
//});

$(function() {
    var tt;
    var numb = $(".num li").size();
    var xx = 0;
    function setTab() {
        $(".num li").eq(xx).addClass("hover").siblings().removeClass("hover");
        $(".imgs li").eq(xx).addClass("cur").siblings().removeClass("cur");
        xx += 1;
        if (xx > 5) xx = 0;
    }
    tt = setInterval(setTab, 3000);
    $(".num li").mouseover(function(aa) {
        aa = $(this).index();
        xx = aa;
        $(this).addClass("hover").siblings().removeClass("hover");
        $(".imgs li").eq(aa).addClass("cur").siblings().removeClass("cur");
        clearTimeout(tt);
    });
});
	

$(function() {
    $(".Na").parent().mouseover(function() {
        $(this).find(".Na").show();
        $(this).css("background", "url(../images/nav_bg_hover.jpg) no-repeat")
        $(this).css("display", "block")
    }
												   ).mouseout(function() {
												       $(this).find(".Na").hide()
												       $(this).find(".Na li").removeClass("bg")
												       $(this).css("background", "url(../images/nav_bg.jpg) no-repeat")
												   }
													)
    $(".Na li").mouseover(function() {
        $(this).addClass("bg")
        $(this).siblings().removeClass("bg")
    }
														   )
    //其他没有二级栏目的导航
    $(".nav0").mouseover(function() {
        $(this).css("background", "url(../images/nav_bg_hover.jpg) no-repeat")
    }
													).mouseout(function() {
													    $(this).css("background", "url(../images/nav_bg.jpg) no-repeat")
													}
															   )
}
				   )


//三快区域选择项的JS
$(function() {
    $(".html_C").bind("mouseover", function() {
        $(this).removeAttr("style");
    });
    $(".html_left").bind("mouseout", function() {
        $(this).removeAttr("style");
        $(".html_C").removeAttr("style");
    });
    $(".html_left").bind("mouseover", function() {
        $(this).css("background", "url(../images/left2.png) no-repeat");
        $(".html_C").css("background", "url(../images/center2.png) no-repeat");
        // $(this).removeAttr("style");
    });
    $(".html_right").bind("mouseout", function() {
        $(this).removeAttr("style");
        $(".html_C").removeAttr("style");
    });
    $(".html_right").bind("mouseover", function() {
        $(this).css("background", "url(../images/left2.png) no-repeat");
        $(".html_C").css("background", "url(../images/center2.png) no-repeat");
    });
});


//应用领域上下滚动
window.onload = function() {
    dMarquee('scroll');
}

function dMarquee(id) {
    var speed = 30; //速度
    var stop = 10; //停止时间 

    var ul = document.getElementById(id);
    var rows = ul.getElementsByTagName('li').length;
    var height = ul.getElementsByTagName('li')[0].offsetHeight;
    ul.innerHTML += ul.innerHTML;
    ul.innerHTML += ul.innerHTML;
    ul.innerHTML += ul.innerHTML;
    ul.innerHTML += ul.innerHTML;
    var timeID = false;
    var play = function() {
        ul.scrollTop++;
        if (ul.scrollTop == rows * height) {
            ul.scrollTop = 0;
        }
        if (ul.scrollTop % height == 0) {
            timeID = setTimeout(play, stop);
        } else {
            timeID = setTimeout(play, speed);
        }
    }

    timeID = setTimeout(play, stop);

    ul.onmouseover = function() { clearTimeout(timeID); }
    ul.onmouseout = play;
}
   
	 
	 
	 
