//<![CDATA[
$(function(){
	(function(){
		var curr = 0;
		$(".trigger").each(function(i){
			$(this).mouseover(function(){
				curr = i;
				$(".hongfuabout").eq(i).fadeIn("slow").siblings(".hongfuabout").hide();
				$(this).siblings(".trigger").removeClass("imgSelected").end().addClass("imgSelected");
				return false;
			});
		});	
		var timer = setInterval(function(){
			todo = (curr + 1) % 5;
			$(".trigger").eq(todo).mouseover();
		},5000);
		
		
		
		/*---------------*/
		var showedPic;
		var maxImg = $(".img306").length;
		
		$("#banner_right").bind("click",function(){
			 $(".img306").each(function(i){
			     if ($(this).css("display") == 'inline') {
					showedPic = i;
					$(this).eq(i).hide();
				 }
			 });
			 if (Number(showedPic + 1) == maxImg) {
				 $(".img306").eq(showedPic).hide();
				 $(".img306").eq(0).fadeIn(800);
			 } else {
				 $(".img306").eq(showedPic+1).fadeIn(800);
			     $(".img306").eq(showedPic).hide();
			 }
	    });
		
		$("#banner_left").bind("click",function(){
			 $(".img306").each(function(i){
			     if ($(this).css("display") == 'inline') {
					showedPic = i;
					$(this).eq(i).hide();
				 }
			 });
			 if (Number(showedPic - 1) == -1) {
				 $(".img306").eq(showedPic).hide();
				 $(".img306").eq(maxImg-1).fadeIn(800);
			 } else {
				 $(".img306").eq(showedPic-1).fadeIn(800);
			     $(".img306").eq(showedPic).hide();
			 }
	    });
		
		
		var mybanner = setInterval(function(){
			 $(".img306").each(function(i){
			     if ($(this).css("display") == 'inline') {
					showedPic = i;
					$(this).eq(i).hide();
				 }
			 });
			 if (Number(showedPic + 1) == maxImg) {
				 $(".img306").eq(showedPic).hide();
				 $(".img306").eq(0).fadeIn(800);
			 } else {
				 $(".img306").eq(showedPic+1).fadeIn(800);
			     $(".img306").eq(showedPic).hide();
			 }
		},5000);
		/*var clickNum = 1;
		$(".mybtn").each(function(i){
			$(this).click(function(){
				curr1 = i;
				$(".img306").eq(i).fadeIn("slow").siblings(".img306").hide();
				//$(this).siblings(".trigger").removeClass("imgSelected").end().addClass("imgSelected");
				clickNum += 1;
				return false;
			});
		});	
		var timer = setInterval(function(){
			todo = (curr1 + 1) % 9;
			$(".mybtn").eq(clickNum).click();
		},5000);*/
		
	})();
});
//]]>


