window.onload = rolloverInit;

function rolloverInit() {
	for (var i=0; i<document.images.length; i++)
	{ if (document.images[i].parentNode.tagName == "A")
		{ setupRollover(document.images[i]);
		}
	}
}

function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "../GIF/" + thisImage.id + "-over.gif";
	/*--the above line navigates to the proper directory and appends the img id to assign a new file name for the rollover image--*/
	thisImage.onmouseover = rollOver;
}

function rollOver() {
	this.src = this.overImage.src;
}

function rollOut() {
	this.src = this.outImage.src;
}


/*--Banner Functionality--*/

var adImages = new Array("../GIF/Banner01.gif","../GIF/Banner02.gif","../GIF/Banner03.gif","../GIF/Banner04.gif","../GIF/Banner05.gif");
var thisAd = 0;

function rotate() {
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("adBanner").src = adImages[thisAd];

	setTimeout("rotate()", 2 * 1000);
}

/*--Call to Open Both Functions Together--*/

function start() {
  rolloverInit();
  rotate();
}
window.onload = start;