// JavaScript Document

	var photoCount = 5; <!-- This is the total number of photos. Change this number accordingly. -->

	photocaption = new Array;
	// The captions below may be altered to match the corresonding images.
	// You may add or remove captions, but don't change the format.
	
// begin photos
	photocaption[1] = "Dragonfly"
	photocaption[2] = "Cows Grazing"
	photocaption[3] = "Trial Gardens"
	photocaption[4] = "Mountains"
	photocaption[5] = "Crop research"
	/////////////////////////////////////

// This code provides random sampling without replacement for the total number of photos available.
// It uses a function called Shuffle to do this, with the returns from this function called ranpick.
var sequence = new Array(photoCount);
for ( var i=0 ; i < photoCount ; i++ )
{
sequence[i] = i+1;
}
ranpick=Shuffle(sequence);

function Shuffle(ary)
{
for ( var i=ary.length-1 ; i >= 0 ; i-- )
{
var v = parseInt(Math.random()*(i+1));
var tmp = ary[v];
ary[v] = ary[i];
ary[i] = tmp; 
}
return ary; 
}

// Thise commands assign photos from the Shuffle sequence.
    var randomPick1 = ranpick[1];
    var randomPick2 = ranpick[2];
    var randomPick3 = ranpick[3];
   

	var tPath = "images/";
    
	var tPhoto1 = tPath + "homepage_image" + randomPick1 + ".jpg";
	var tPhoto2 = tPath + "homepage_image" + randomPick2 + ".jpg";
	var tPhoto3 = tPath + "homepage_image" + randomPick3 + ".jpg";
	//var tCaption = tPath + "caption_" + randomPick + ".gif";
	
	
	function getAltText(whichNum) {
		return(photocaption[whichNum]);
	}

// Thanks to Craig Spooner for letting me alter his code.