//JavaScript Document
//Written By Nathaniel Wiley
//This script creates a function that, when called on a webpage, randomly selects and posts an image to that page
//Be sure the path to your collection of images is correct in line 18 and that your images are all the same file type
//Obviously, images should be numbered starting at 1, if you have a prefix or sufix to the number, include it in the path on 18
//Once that is done, you will only need to change the number in line 11 to reflect how many images you have

function randomImage()
{
	//Number of image files
	var files = 63;
	//Generates Random Number
	var randomNumber = files * Math.random();
	//Makes Random Number an Integer
	randomNumber = Math.floor(randomNumber);
	//Turns the randomNumber into a usable image number
	var imageNumber = randomNumber + 1
	//Posts image to page 300 pixels wide
	document.open();
	document.write('<img src="images/random_images/ambu_' +imageNumber+ '.jpg" width="300" border="0" alt="Random Image Number ' +imageNumber+ '" />');
	document.close();
}
