// headerImg.js - script to constantly display different random pictures in the header.

// list of images to include in the header:
var picList = new Array("h1.png","h2.png","h3.png","h4.png","h5.png","h6.png","h7.png","h8.png","h9.png","h10.png","h11.png","h12.png","h13.png");

var picLoc = "/headerImages/";		// location of the header images
var displayTime = 2000;						// amount of time to display each picture (in milliseconds)

var curPic = 0;								// picture that's currently being displayed (not to be modified)

// function showPic is called in the header.php file.			
function showPic(){
	
	if (!document.images)
		return;
	
	if (picList.length <= 1)
		return;
	
	var newPic = Math.floor(Math.random() * picList.length);
	
	while (newPic == curPic)
		newPic = Math.floor(Math.random() * picList.length);

	document.images.headerPic.src=(picLoc + picList[newPic]);
	curPic = newPic;
	
	setTimeout("showPic()", displayTime);
}


