// JavaScript Document

//var clickNum = 1;
//var myArray = new Array();
//myArray[0] = "index_17.gif";
//myArray[1] = "about_banner01.jpg";
//myArray[2] = "about_banner2.jpg";
//myArray[3] = "about_banner3.jpg";
//myArray[4] = "about_banner4.jpg";
//myArray[5] = "about_banner5.jpg";
//myArray[6] = "photo1.jpg";
//myArray[7] = "xianxia_banner.jpg";
//myArray[8] = "photo2.jpg";
//
//
//var arrayLen = myArray.length;
//
//function next(){
//	      clickNum += 1;
//		  if (clickNum >= arrayLen){ clickNum = arrayLen}
//		    document.getElementById("imgsrcoll").src = "images/" + myArray[clickNum - 1];
//	}
//	
//function last(){
//	      clickNum -= 1;
//		  if (clickNum <= 1){ clickNum = 1}
//		  document.getElementById("imgsrcoll").src = "images/" + myArray[clickNum - 1];
//	}	

   var bannerPic=new Array();
   
   bannerPic[0] = "index_17.jpg";
   bannerPic[1] = "about_banner01.jpg";
   bannerPic[2] = "about_banner2.jpg";
   bannerPic[3] = "about_banner3.jpg";
   bannerPic[4] = "about_banner4.jpg";
   bannerPic[5] = "about_banner5.jpg";
   bannerPic[6] = "photo1.jpg";
   bannerPic[7] = "xianxia_banner.jpg";
   bannerPic[8] = "photo2.jpg";
   
   var PicNum=bannerPic.length;
   
   var preloPicedimages=new Array();
   for (i=1;i<bannerPic.length;i++){
      preloPicedimages[i]=new Image();
      preloPicedimages[i].src=bannerPic[i];
   }

function setTransition(){
	 ChangeClassStatus(PicNum);
   if (document.all){
	  
      bannerPicrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
      bannerPicrotator.filters.revealTrans.apply();
   }
}

function playTransition(){
   if (document.all)
      bannerPicrotator.filters.revealTrans.play()
}

function nextPic(){
   if(PicNum<bannerPic.length-1)PicNum++ ;
      else PicNum=0;
	  
   setTransition();
   document.images.bannerPicrotator.src="images/" + bannerPic[PicNum];
   playTransition();
   theTimer=setTimeout("nextPic()", 5000);
}

function jump2url(){
   jumpUrl=bannerPiclink[PicNum];
   jumpTarget='_blank';
   if (jumpUrl != ''){
      if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
      else location.href=jumpUrl;
   }
}
function jump2UrlByID(id,obj)
{
	   
		PicNum=id; 
	   clearTimeout(theTimer);
	   setTransition();
	   document.images.bannerPicrotator.src="images/" + bannerPic[PicNum];
	   playTransition();
	   theTimer=setTimeout("nextPic()", 5000);
}
function ChangeClassStatus(id)
{
    var ul=	document.getElementById("BannerUL");
	if(ul)
	{
		var liArr=ul.getElementsByTagName("li");
		if(liArr.length>0)
		{
			for(var i=0;i<liArr.length;i++)
			{
				if(i==id)liArr[i].className="numOver";
				else liArr[i].className="numOut";
			}
		}
	}
	/*
	var parent= obj.parentNode;
	for(var i=0;i< parent.childNodes.length;i++)
	{
		parent.childNodes[i].className="numOut";	
		if(parent.childNodes[i]==obj)obj.className="numOver";
	}
	*/
}
//
function next(){
	if (PicNum+1>=bannerPic.length)
	{
	  	PicNum = -1;
	}
	jump2UrlByID(PicNum+1);
}
function last(){
	if (PicNum-1<0)
	{
	  	PicNum = bannerPic.length;
	}
	jump2UrlByID(PicNum-1);
}
	
/***********************************/

$(document).ready(function(){
	  $("#tab1").click(function(){
		     $(this)[0].src = "images/news_tab_bg1.gif";
			 $(this).css("margin-top","0px");
			 $("#tab2").css("margin-top","5px");
			 document.getElementById("tab2").src = "images/hangye_tab_bg2.gif";
			 $("#newstab1").css("display","block");
			 $("#newstab2").css("display","none");
		  })
	  $("#tab2").click(function(){
		     $(this)[0].src = "images/hangye_tab_bg1.gif";
			 $(this).css("margin-top","0px")
			 $("#tab1").css("margin-top","5px")
			 document.getElementById("tab1").src = "images/news_tab_bg2.gif";
			 $("#newstab2").css("display","block");
			 $("#newstab1").css("display","none");
		  })	  
/*	
	      $("#tab1").click(function(){
			        $("#newstab1").css("display","block");
					$("#newstab2").css("display","none");
					$("#tab1").css("color","#000");$("#tab1").css("font-size","14px");
					$("#tab2").css("color","#8a8a8a");$("#tab2").css("font-size","12px");
					$("#tab1").css("background","url('images/index_21.gif') no-repeat left bottom");
					$("#tab2").css("background","url('images/index_24.gif') no-repeat left bottom");
				    $("#tab1").css("width","82px");$("#tab1").css("height","25px");$("#tab1").css("margin-top","0px")
					$("#tab2").css("width","70px");$("#tab2").css("height","20px");$("#tab2").css("margin-top","5px")
			  })
		  $("#tab2").click(function(){
			        $("#newstab2").css("display","block");
					$("#newstab1").css("display","none");
					$("#tab1").css("color","#8a8a8a");$("#tab1").css("font-size","12px");
					$("#tab2").css("color","#000");$("#tab2").css("font-size","14px");
					$("#tab1").css("background","url('images/index_24.gif') no-repeat left bottom");
					$("#tab2").css("background","url('images/index_21.gif') no-repeat left bottom");
					$("#tab1").css("width","70px");$("#tab1").css("height","20px");$("#tab1").css("margin-top","5px")
					$("#tab2").css("width","82px");$("#tab2").css("height","25px");$("#tab2").css("margin-top","0px")
					
					以前写的文字tab切换代码
					
			  })*/
		//tab菜单切换
//				$("#doorfrist").mouseout(function(){
//			    $(this).css("background","url('images/index_57.gif') no-repeat center right");
//				$(this).css("font","12px 300 #8a8a8a");
//			})
//		$("#aboutlist h5").each(function(i){
//			$(this).mouseover(function(){
//				curr = i;
//				$(".hongfudoor").eq(i).fadeIn("slow").siblings(".hongfudoor").hide();
//				$(this).siblings("#aboutlist h5").removeClass("doorsel").end().addClass("doorsel");
//				return false;
//			});
//		});	
		//*****

		//宏福入口	  	  
	})

/******************************/

function mover(num){
	     for (i=1; i<6; i++)
		 {
			document.getElementById("doorfrist" + i).className = "doornot";
			//document.getElementById("door" + i).className = "undis";
			document.getElementById("door" + i).style.display = "none";
			document.getElementById("doorfrist5").style.borderBottom = "1px #cacaca solid";
		 }
		 document.getElementById("doorfrist" + num).className = "doornetone";
		 //document.getElementById("door" + num).className = "dis";
		 document.getElementById("door" + num).style.display = "block";
		 if (num == 5)
		 {
			 document.getElementById("doorfrist" + num).style.borderBottom = "none";
		 }
	}
