

// rotating banner with no links updated 10/12/04 by Richard Wise and Joe Dawley
// original rotating banner with corresponging links by matthew billings

// 1. drop script in head or script file
// 2. fill out config variables 
// 3. add onLoad="changeBanner();" to <body> 
// 4  make sure  img tag has name="banner" and id="bannerImg"
// 5. general form of use. <a href="#"><img src="./img1.gif" name="banner" border="0" id="bannerImg"></a> 



//Config variables
var numImages = 4; //number of images to rotate out.
var imageArray = new Array("images/home_quote_1.gif",  "images/home_quote_2.gif",  "images/home_quote_3.gif",  "images/home_quote_4.gif"); //the src values for the images
var imgElement = "bannerImg";
var visibleForSeconds = 5; //how many seconds to you want before the banner swaps out;


// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 
// Don't edit below // Don't edit below  // Don't edit below  // Don't edit below 


//for random number choosing
function rand(numImages) {
		return Math.ceil((Math.random()* numImages));       
};

//vaiables that shouldn't be edited
var iteratorNum = ( rand(numImages) - 1); //-1 to take into account that array starts at 0
var count = 1; //don't touch. It's an initializer 

	
//the function that does all the work
function changeBanner(){
	
	//IE4/5
	if( document.all )
	{
		//new image swapping code
		document.all[imgElement].src = imageArray[iteratorNum];
	}
	else
	//IE6/NS6 thisis the w3c standard to access
	{
		//new image swapping code
		document.getElementById(imgElement).src = imageArray[iteratorNum];
	}
		
	//fancypants math stuff
	iteratorNum +=1;
	iteratorNum %= numImages;
	
	//sleeps and then changes banner
	setTimeout('changeBanner()', visibleForSeconds * 1000)

}


