// JavaScript Document
jQuery(function(jq){
	var index = 0;
	jq('<div id="flow"></div>').appendTo("#promenu");

	//滑动导航改变内容	
	jq("#promenucc li").hover(function(){
		if(MyTime){
			clearInterval(MyTime);
		}
		index  =  jq("#promenucc li").index(this);
		MyTime = setTimeout(function(){
		ShowjQueryFlash(index);
		jq('#promenumc').stop();
		} , 400);

	}, function(){
		clearInterval(MyTime);
		MyTime = setInterval(function(){
		ShowjQueryFlash(index);
		index++;
		if(index==4){index=0;}
		} , 3000);
	});
	//滑入 停止动画，滑出开始动画.
	 jq('#promenumc').hover(function(){
			  if(MyTime){
				 clearInterval(MyTime);
			  }
	 },function(){
				MyTime = setInterval(function(){
				ShowjQueryFlash(index);
				index++;
				if(index==4){index=0;}
			  } , 3000);
	 });
	//自动播放
	var MyTime = setInterval(function(){
		ShowjQueryFlash(index);
		index++;
		if(index==4){index=0;}
	} , 3000);
});
function ShowjQueryFlash(i) {
jq("#promenumc div").eq(i).animate({opacity: 1},1000).css({"z-index": "1"}).siblings().animate({opacity: 0},1000).css({"z-index": "0"});
jq("#flow").animate({ left: i*122+5 +"px"}, 300 ); //滑块滑动
jq("#promenucc li").eq(i).addClass("current").siblings().removeClass("current");
}
