
/*
jQuery(function(){
	jQuery('#number li').mouseover(function(){
		jQuery("#"+this.id).addClass("selected").siblings().removeClass("selected");
		jQuery('.slider1 li img').fadeIn(4000).attr("src","images/"+(this.id)+".jpg");
	});
});
*/
	
/*首页广告效果*/
jQuery(function(){
     var len  = jQuery(".num > li").length;
	 var index = 0;
	 var adTimer;
	 jQuery(".num li").mouseover(function(){
		index  =   jQuery(".num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	
	 //滑入 停止动画，滑出开始动画.
	 jQuery('.ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 5000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index){
        var adHeight = jQuery(".content_right .ad").height();
		jQuery(".slider").stop(true,false).animate({bottom : -adHeight*index},1000);
		jQuery(".num li").removeClass("on")
			.eq(index).addClass("on");
}
	

/*
功能：Jquery无缝滚动插件zhw.scroll-1.0.js
作者：leo
注意：暂只支持div下ul li的滚动
交流：xandchd_kane@163.com
*/
/*
jQuery.extend({
    Scroll: function(settings) {
        //初始化参数
        var config = jQuery.extend({
            stepWidth: 100,         // 滚动步长
            waitTime: 4000,         // 间歇时间
            animateTime: 500,       // 滚动效果时间,理论上应该比间歇时间短
            inner: "",              // 滚动对象
            left: "",               // 左点击对象
            right: ""               // 右点击对象
        }, settings);
        var flag = setInterval(AutoScroll, parseInt(config.waitTime));
        //左滚
        //jQuery(config.left).click(function() { AutoScroll(); });
        //右滚
        //jQuery(config.right).click(function() { RightScroll(); });
        //悬停
        //jQuery("" + config.left + "," + config.right + "," + config.inner + "").hover(function() { clearInterval(flag) }, function() {
        //    flag = setInterval(AutoScroll, parseInt(config.waitTime));
        //});
        jQuery("" + config.inner + "").hover(function() { clearInterval(flag) }, function() {
            flag = setInterval(AutoScroll, parseInt(config.waitTime));
        });
        function AutoScroll() {
            var marginLeft = jQuery(config.inner).css("margin-left");
            jQuery(config.inner).stop().animate({ "margin-left": parseInt(marginLeft) - config.stepWidth }, config.animateTime, function() {
                var n = jQuery(config.inner).children("ul").children("li").toArray(); //转换为对象数组
                var k = jQuery.grep(n, function(i, j) { return j > 0; }); //筛选
                var temp = jQuery.grep(n, function(i, j) { return j > 0; }, true); //筛选
                jQuery(config.inner).children("ul").html(""); //清空
                jQuery(k).each(function(i, j) {
                    jQuery(config.inner).children("ul").append(j); //重新拼装内容
                });
                jQuery(config.inner).children("ul").append(temp); //拼装被筛选出去的对象
                jQuery(config.inner).css("margin-left", 0); //初始化marginleft
            });
        }
        function RightScroll() {
            //向右需要先拼装再移动
            var marginLeft = jQuery(config.inner).css("margin-left");
            var n = jQuery(config.inner).children("ul").children("li").toArray(); //转换为对象数组
            var k = jQuery.grep(n, function(i, j) { return j < n.length - 1; }); //筛选
            var temp = jQuery.grep(n, function(i, j) { return j > n.length - 1; }, true); //筛选
            jQuery(config.inner).children("ul").html("").append(temp); //拼装被筛选出去的对象
            jQuery(k).each(function(i, j) {
                jQuery(config.inner).children("ul").append(j); //重新拼装内容
            });
            jQuery(config.inner).css("margin-left", -config.stepWidth);
            //
            jQuery(config.inner).stop().animate({ "margin-left": parseInt(marginLeft) }, config.animateTime);
        }
    }
});
*/

/*
//简洁，但要改步进宽度
function AutoScroll(){
	var _scroll = jQuery("#slide112>ul");
	//ul往左边移动300px
	_scroll.animate({marginLeft:"-170px"},1000,function(){
		//把第一个li丢最后面去
		_scroll.css({marginLeft:0}).find("li:first").appendTo(_scroll);
	});
}
jQuery(function(){
	//两秒后调用
	var _scrolling=setInterval("AutoScroll()",2000);
	jQuery("#slide112>ul").hover(function(){
		//鼠标移动DIV上停止
		clearInterval(_scrolling);
	},function(){
		//离开继续调用
		_scrolling=setInterval("AutoScroll()",2000);
	});
});
*/


