//相关配置
var timer=3000;//每隔秒执行一次滚动

var soos0;
var soos1;
var soos2;
var soos3;

var index0=0;
var index1=0;
var index2=0;
var index3=0;

var t0;
var t1;
var t2;
var t3;

function init0(){
	index0=0;
	$(soos0).each(function(i,n){
		$(n).show();
		$(n).prev().hide();
	});
	$(soos0[0]).hide();
	$(soos0[0]).prev().show();
}
function init1(){
	index1=0;
	$(soos1).each(function(i,n){
		$(n).show();
		$(n).prev().hide();
	});
	$(soos1[0]).hide();
	$(soos1[0]).prev().show();
}
function init2(){
	index2=0;
	$(soos2).each(function(i,n){
		$(n).show();
		$(n).prev().hide();
	});
	$(soos2[0]).hide();
	$(soos2[0]).prev().show();
}
function init3(){
	index3=0;
	$(soos3).each(function(i,n){
		$(n).show();
		$(n).prev().hide();
	});
	$(soos3[0]).hide();
	$(soos3[0]).prev().show();
}

function change0(){
		if(soos0.length-1==index0){
			init0();
			return;
		}
		$(soos0[index0]).hide();
		$(soos0[index0]).prev().hide();
		index0++;
		$(soos0[index0]).hide();
		$(soos0[index0]).prev().show();
}
function change1(){
		if(soos1.length-1==index1){
			init1();
			return;
		}
		$(soos1[index1]).hide();
		$(soos1[index1]).prev().hide();
		index1++;
		$(soos1[index1]).hide();
		$(soos1[index1]).prev().show();
}
function change2(){
		if(soos2.length-1==index2){
			init2();
			return;
		}
		$(soos2[index2]).hide();
		$(soos2[index2]).prev().hide();
		index2++;
		$(soos2[index2]).hide();
		$(soos2[index2]).prev().show();
}
function change3(){
		if(soos3.length-1==index3){
			init3();
			return;
		}
		$(soos3[index3]).hide();
		$(soos3[index3]).prev().hide();
		index3++;
		$(soos3[index3]).hide();
		$(soos3[index3]).prev().show();
}


$(document).ready(function() {
			soos0=$(".slider_li0");
			init0();
			t0=window.setInterval("change0()",timer);
			$('.slider_li0').each(function(i,n){
					$(n).hover(
						function(){
							clearInterval(t0);
							$(this).prev().show();
							$(this).hide();
							if(i!=index0){
								$(soos0[index0]).show();
								$(soos0[index0]).prev().hide();
							}
							
						},
						function(){
						}
					);
					$(n).prev().hover(
						function(){
						clearInterval(t0);
					},
						function(){
							$(this).next().show();
							$(this).hide();
							t0=window.setInterval("change0()",timer);
						}
					);
					
			});

			$("#ScrollMe0").hover(
				function () {
				},
				 function () {
					$(soos0[index0]).hide();
					$(soos0[index0]).prev().show();
				}
			);
			/***1**/
			soos1=$(".slider_li1");
			init1();
			t1=window.setInterval("change1()",timer);
			$('.slider_li1').each(function(i,n){
					$(n).hover(
						function(){
							clearInterval(t1);
							$(this).prev().show();
							$(this).hide();
							if(i!=index1){
								$(soos1[index1]).show();
								$(soos1[index1]).prev().hide();
							}
							
						},
						function(){
						}
					);
					$(n).prev().hover(
						function(){
						clearInterval(t1);
					},
						function(){
							$(this).next().show();
							$(this).hide();
							t1=window.setInterval("change1()",timer);
						}
					);
					
			});

			$("#ScrollMe1").hover(
				function () {
				},
				 function () {
					$(soos1[index1]).hide();
					$(soos1[index1]).prev().show();
				}
			);
			
			/**2*/
			soos2=$(".slider_li2");
			init2();
			t2=window.setInterval("change2()",timer);
			$('.slider_li2').each(function(i,n){
					$(n).hover(
						function(){
							clearInterval(t2);
							$(this).prev().show();
							$(this).hide();
							if(i!=index2){
								$(soos2[index2]).show();
								$(soos2[index2]).prev().hide();
							}
							
						},
						function(){
						}
					);
					$(n).prev().hover(
						function(){
						clearInterval(t2);
					},
						function(){
							$(this).next().show();
							$(this).hide();
							t2=window.setInterval("change2()",timer);
						}
					);
					
			});

			$("#ScrollMe2").hover(
				function () {
				},
				 function () {
					$(soos2[index2]).hide();
					$(soos2[index2]).prev().show();
				}
			);
			
			/**3*/
			soos3=$(".slider_li3");
			init3();
			t3=window.setInterval("change3()",timer);
			$('.slider_li3').each(function(i,n){
					$(n).hover(
						function(){
							clearInterval(t3);
							$(this).prev().show();
							$(this).hide();
							if(i!=index3){
								$(soos3[index3]).show();
								$(soos3[index3]).prev().hide();
							}
							
						},
						function(){
						}
					);
					$(n).prev().hover(
						function(){
						clearInterval(t3);
					},
						function(){
							$(this).next().show();
							$(this).hide();
							t3=window.setInterval("change3()",timer);
						}
					);
					
			});

			$("#ScrollMe3").hover(
				function () {
				},
				 function () {
					$(soos3[index3]).hide();
					$(soos3[index3]).prev().show();
				}
			);

});
