// JavaScript Document
$(function(){
	var nowc=-1;//初始当前位置；
	var outflg=0; //切换状态初始数值；
	var out; //切换状态延迟函数初始；
	var zong=$(".projectPicshow>li:first>span>b").size();
	projectchange();
	//切换函数
	function projectchange(){
	if(nowc<3){
	nowc=nowc+1;
	var aa=zong-nowc-1;
		$(".projectPicshow>li:first>span>b:eq("+aa+")").addClass("on");
		$(".projectPicshow>li:first>span>b").not($(".projectPicshow>li:first>span>b:eq("+aa+")")).removeClass("on");
		var spic=$(".teamImg a:eq("+nowc+")");
		spic.fadeIn();
		$(".teamImg a").not(spic).hide();
		var stext=$(".teamRightCon:eq("+nowc+")");
		stext.fadeIn();
		$(".teamRightCon").not(stext).hide();
		}else{
		nowc=-1;
		nowc=nowc+1;
		var aa=zong-nowc-1;
		$(".projectPicshow>li:first>span>b:eq("+aa+")").addClass("on");
		$(".projectPicshow>li:first>span>b").not($(".projectPicshow>li:first>span>b:eq("+aa+")")).removeClass("on");
		var spic=$(".teamImg a:eq("+nowc+")");
		spic.fadeIn();
		$(".teamImg a").not(spic).hide();
		var stext=$(".teamRightCon:eq("+nowc+")");
		stext.fadeIn();
		$(".teamRightCon").not(stext).hide();
		}
		t=setTimeout(projectchange,8000);
}
//
	$(".projectPicshow").hover(function(){
		movestop();if(outflg=="1"){clearTimeout(out);}
		},function(){
		out=setTimeout(projectchange,2000);
		outflg=1;
		})
//擦除
function movestop(){
	clearTimeout(t);
};
//点击
		$(".projectPicshow>li:first>span>b").each(function(i){
		$(this).click(function(){
		$(this).addClass("on");
		$(".projectPicshow>li:first>span>b").not($(this)).removeClass("on");
		nowc=zong-i;
		nowc=nowc-1;
		var spicclick=$(".teamImg a:eq("+nowc+")");
		spicclick.fadeIn();
		$(".teamImg a").not(spicclick).hide();
		var stextclick=$(".teamRightCon:eq("+nowc+")");
		stextclick.fadeIn();
		$(".teamRightCon").not(stextclick).hide();
		});
		});
	});