// ======================================================================
// 		THE USER SHOULD CHANGE THIS PART TO CUSTOMIZE THE SCRIPT
// ======================================================================

// gSlideshowInterval - determines how often the slide show is
// refreshed (time given in seconds).

gSlideshowInterval = 3;

// gNumberOfImages - the total number of images available for display.
// This is used both to set up the image array and to manage the actual
// slideshow.

gNumberOfImages = 25;

// gImages - An array that holds the URLs identifying the images to be
// shown in the slide show.

gImages = new Array(gNumberOfImages);

// Fill in the array with the URLs of the images that you want to use.

gImages[0] = 'images/logo/bankwest.gif'
gImages[1] = 'images/logo/bhpb.gif'
gImages[2] = 'images/logo/colesgroup.gif'
gImages[3] = 'images/logo/conocophillips.gif'
gImages[4] = 'images/logo/deloitte.gif'
gImages[5] = 'images/logo/dhw.gif'
gImages[6] = 'images/logo/downeredi.gif'
gImages[7] = 'images/logo/gilbertandtobin.jpg'
gImages[8] = 'images/logo/goodmanfielder.gif'
gImages[9] = 'images/logo/hbosa.gif'
gImages[10] = 'images/logo/hotcopper.gif'
gImages[11] = 'images/logo/inpex.gif'
gImages[12] = 'images/logo/ca.gif'
gImages[13] = 'images/logo/murphy.gif'
gImages[14] = 'images/logo/nab.gif'
gImages[15] = 'images/logo/orica.gif'
gImages[16] = 'images/logo/riotinto.gif'
gImages[17] = 'images/logo/skm.gif'
gImages[18] = 'images/logo/suncorp.gif'
gImages[19] = 'images/logo/tattersalls.gif'
gImages[20] = 'images/logo/unisys.gif'
gImages[21] = 'images/logo/westpac.gif'
gImages[22] = 'images/logo/woodside.gif'
gImages[23] = 'images/logo/yrbrands.gif'
gImages[24] = 'images/logo/zurich.gif'


// ======================================================================
// 							DON'T CHANGE THIS PART
// ======================================================================

// canManipulateImages - check if the browser we're using can do
// clever stuff with document images.

function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

// loadSlide
//
// Load a given image into place by substituting its URL for the URL 
// currently loaded by the <IMG> object called 'slide'. 

function loadSlide(imageURL) {
	if (gImageCapableBrowser) {
		document.slide.src = imageURL;
		return false;
	}
	else {
		return true;
	}
}

// nextSlide
//
// Update the counter that shows which slide is being displayed, and
// load it into place. The modulo (%) is there to ensure that we roll
// over when we reach the end of the slideshow.

function nextSlide() {
	while(true) {
		gNextImage = pickRandom(gNumberOfImages);
		if (gNextImage != gCurrentImage)
			break;
	}
	gCurrentImage = gNextImage;
	loadSlide(gImages[gCurrentImage]);
}

// pickRandom
//
// Return a random number in a given range (it returns a number
// between 0 and (range - 1). If 'Math.random' isn't implemented in
// this version of JavaScript, return a value faked up from the
// current time.

function pickRandom(range) {
	if (Math.random)
		return Math.round(Math.random() * (range-1));
	else {
		var now = new Date();
		return (now.getTime() / 1000) % range;
	}
}

// gImageCapableBrowser - is this browser hip to images? Set up
// a global variable so that we don't have to keep calling a function
// (useful if the function becomes costly to compute).

gImageCapableBrowser = canManipulateImages();

// gCurrentImage - a variable used to keep track of the image
// currently being displayed to the user.

gCurrentImage = 0;

// Set up the timer. This will call the 'nextSlide()' function repeatedly at 
// the specified interval (and will continue to do so until the page is unloaded).

setInterval("nextSlide()",gSlideshowInterval * 1000);

// -->
 
