<!--

/*
	*	File:					random.js
	*	Description:	Randomly select an image to display on the web page
	*	Last updated:	March 6, 2006				
	*	Author:				H. Korotnicki - Department of Education and the Arts
*/

//	FUNCTION:			randomImage
//	DESCRIPTION:	Takes a given image object and changes the source image within a range of random images
//								Maximum number of images is 99 and images must be labelled from 01.jpg - XX.jpg (where XX is imgCount)
// 	ARGUMENTS:		imgCount - total number of random images 
//								imgSource - the source directory path of the random images
//								image - the image object to put the random image
//	RETURNS:			nothing
function randomImage(imgCount, imgSource, image)
{
	if (document.images)	{	
		var randomNum = Math.floor((Math.random( )* imgCount)) + 1;	// genetate a random number from 1 to imgCount
		if(randomNum < 10)
			imgSource += '0' + randomNum + '.jpg';	//  convert one digit number to two digits   
		else
			imgSource += randomNum + '.jpg';
		image.src = imgSource;
	}
}
	
// -->
	


