/* Random Image Generators */

var largePhotoCount, smallPhotoCount, testimonialCount, currentImageNum;

// All randomized photos are located in /images/photos/
// All randomized testimonials are located in /images/testimonials/
// The homepage small photos use the same images, but no image will be shown twice on the page
// Call these functions by passing the 'relative' or 'absolute' path of the images folder (i.e. "" or "../../" or just "/")

// largePhotoCount is for the larger photos (filenames are largeX.jpg)
// smallPhotoCount is for the small photos (filenames are smallX.jpg)
// testimonialCount is for the homepage testimonials (filenames are testimonialX.gif)

// Set the following variables to the number of random files that exist for each image

largePhotoCount = 10;
smallPhotoCount = 10;
testimonialCount = 1;

var currentImageNumLarge = new Array();

function ShowLargePhoto(path) {
	var randomNum;
    
    do {
    	randomNum = Math.floor(Math.random() * largePhotoCount) + 1;    
    } while (currentImageNumLarge[randomNum]) 
    

    currentImageNumLarge[randomNum] = 1;
	document.write('<img src="' + path + '/inner0' + randomNum + '.jpg" alt="" width="183" height="197">');
}

function ShowSmallPhoto(path) {
	var randomNum;

	// Do not repeat image twice
	do {
		randomNum = Math.floor(Math.random() * smallPhotoCount) + 1;
	} while (randomNum == currentImageNum)

	document.write('<img src="' + path + '/inner_sm0' + randomNum + '.jpg" alt="" width="93" height="94">');
	currentImageNum = randomNum;
}

function ShowTestimonial(path) {
	var randomNum;
	randomNum = Math.floor(Math.random() * testimonialCount) + 1;

	document.write('<img src="' + path + '/testimonial' + randomNum + '.gif" alt="Testimonial" width="183" height="180">');
}

