var curr_scroll=0;
$(function(){
     var len2  = $("#imgScroll_dot li").length;
	 var index2 = 0;
	 $("#imgScroll_dot li").click(function(){
		index2  =   $("#imgScroll_dot li").index(this);
		showImg2(index2);
	});	
	$("#imgScroll_font a").click(function(){
		index2  =   $("#imgScroll_font a").index(this);
		showImg2(index2);
	});
	 //滑入 停止动画，滑出开始动画.
	 $('#imgScroll_list,#imgScroll_tit').mouseover(function(){
			  if(MyTime2){
				 clearInterval(MyTime2);
			  }
	 }).mouseout(function(){
			  MyTime2 = setInterval(function(){
			    showImg2(index2)
				index2++;
				if(index2==len2){index2=0;}
			  } , 10000);
	 });
	 //自动开始
	 var MyTime2 = setInterval(function(){
		showImg2(index2)
		index2++;
		if(index2==len2){index2=0;}
	 } , 6000);
})
// Demo2 : 关键函数：通过控制left ，来显示不通的幻灯片
function showImg2(i){
	curr_scroll=i;
	var len  = $("#imgScroll_dot li").length;
	if (i>=len)
	{
		i=0;
	}

	$("#imgScroll_list ol").animate({marginLeft : -674*i},1200);
	$("#imgScroll_dot li").removeClass().eq(i).addClass("curr");
	$("#imgScroll_font a").removeClass().eq(i).addClass("curr");
}
function imgScroll_to(i){
	var len=curr_scroll+i;
	showImg2(len);
}