﻿jQuery(function(){
	 var index=1;
	 MyTime =setInterval(function(){
		showImg(index);
		index++;
		if(index==4){index=0;}
	 } , 5000);
		jQuery(".fadthumb b").click(function(){
		index=parseInt(jQuery(".fadthumb b").index(jQuery(this)));
		showImg(index);
		index++;
		if(index==4)index=0;
		});
		jQuery(".fousAd").mouseover(function(){
			if(MyTime){clearInterval(MyTime);}
		});
		jQuery(".fousAd").mouseout(function(){
			MyTime =setInterval(function(){
			showImg(index);
			index++;
			if(index==4){index=0;}
	 }, 5000);
		});

	 function showImg(i){
	 	jQuery(".fadthumb").css("backgroundPosition","0 "+(i+1)*(-109)+"px");
		jQuery(".fadimg a").hide();
		jQuery(".fadimg a").eq(i).show();
		jQuery(".fadinfo div").hide();
		jQuery(".fadinfo div").eq(i).fadeIn(500);
	}
	});


