<!-- Hide this script from old browsers -->

var AddDelay = 4000; // Delay in msecs
var AddRandom = 0; // Maximum random time to add to the delay time
var linear = false;  // Go through the adds in order
var randomstart = true; // Start at a random point in rotation?  - Only matters if linear is true
var AddNumber = -1;  // If randomstart is false, will start at this number +1 in the rotation

//More images can be added following the same format.
//The script will automatically adapt for more images.

function NewAdd()
{
   NewAddNum = AddNumber;
   var x = 0;
   if (!linear)
	   while (NewAddNum==AddNumber && x < 100)
	   {
	      NewAddNum = Math.round(Math.random()*(imageArray.length-1));
	      x++;
	   }
	else if (randomstart && (NewAddNum == -1))
		NewAddNum = Math.round(Math.random()*(imageArray.length-1));
	else
		NewAddNum = (++AddNumber)%imageArray.length;
   AddNumber = NewAddNum;
}

function AddImgSrc()
{
   return imageArray[AddNumber];
}
function SetAdd()
{
   NewAdd();
   document.addImg.src = AddImgSrc().src;
   setTimeout("SetAdd()",Math.round(Math.random()*AddRandom)+AddDelay);
}
// -- End Hiding Here -->