//Javascript Document For funswitcher by trance

$(document).ready(function(){
//酵腑
var j=1;
var MyTime=false;
var fot=200;//絞芞秏囮奀潔
var fin=300;//陔芞傘珋奀潔
var amt=300;//褒梓祩賑雄奀潔
var speed=3000;//赻雄畦溫潔路
var maxpic=5;//遙芞跺杅
	$("#ppt").find("li").each(function(i){
		$("#ppt").find("li").eq(i).mouseover(function(){											  
			var cur=$("#mpc").find("div:visible").prevAll().length;
			if(i!==cur){
				j=i;					
				$("#mpc").find("div:visible").fadeOut(fot,function(){
				$("#mpc").find("div").eq(i).fadeIn(fin);});
				$("#tri").animate({"left":i*40+"px"},amt,current(this,"li"));
				$("#ppt").find("dl:visible").slideUp(fot,function(){
				$("#ppt").find("dl").eq(i).slideDown(fin);});				
			}			
		})	
	})
//梓暮絞	
function current(ele,tag){
	$(ele).addClass("cur").siblings(tag).removeClass("cur");
	}	
//赻雄畦溫 祥剒猁腔趕褫眕刉壺涴珨僇	
$('#imgnav').hover(function(){
			  if(MyTime){
				 clearInterval(MyTime);
			  }
	 },function(){
			  MyTime = setInterval(function(){
			    $("#ppt").find("li").eq(j).mouseover();
				j++;
				if(j==maxpic){j=0;}
			  } , speed);
	 });
	 //赻雄羲宎 
	 var MyTime = setInterval(function(){
		$("#ppt").find("li").eq(j).mouseover();
		j++;
		if(j==maxpic){j=0;}
	 } , speed);

})