// JavaScript Document
// JavaScript Document
// BannerPic

   var bannerPic=new Array();
   var bannerPiclink=new Array();
   var bannerPicalt=new Array();
   var PicNum=5;
   
   bannerPic[0]="images/Pic1.jpg";
   bannerPiclink[0]="http://www.niutuku.com/jiqiao/css/";
   bannerPicalt[0]='牛图库CSS技巧';
   
   bannerPic[1]="images/Pic2.jpg";
   bannerPiclink[1]="http://www.niutuku.com/JS/";
   bannerPicalt[1]='牛图库JS代码';    

   bannerPic[2]="images/Pic3.jpg";
   bannerPiclink[2]="http://www.niutuku.com/JS/";
   bannerPicalt[2]='牛图库导航菜单';

   bannerPic[3]="images/Pic4.jpg";
   bannerPiclink[3]="http://www.niutuku.com/jiqiao/";
   bannerPicalt[3]='牛图库建站技巧';

   
   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=bannerPic[PicNum];
   playTransition();
   theTimer=setTimeout("nextPic()", 9000);
}

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=bannerPic[PicNum];
	   playTransition();
	   theTimer=setTimeout("nextPic()", 9000);
}
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 displayStatusMsg() { 
   status=bannerPiclink[PicNum];
   document.returnValue = true; 
   document.getElementById('bannerPicrotator').alt=bannerPicalt[PicNum];
   document.getElementById('BannerAhref').title=bannerPicalt[PicNum];
}

//