<!--
//Functions to display a gallery of images

//Initializes the gallery with the supplied object array
function inititializeGallery(galDiv, captDiv, objArray, showCapt){	
	//Store references to objects that are used throughout the slide show.
	objectArray = objArray;
	galleryDiv = galDiv;
	captionDiv = captDiv;
	showCaptions = showCapt;
	
	//Preload images
	if (document.images){
		for(var i=0; i<objectArray.length; ++i){
			if(objectArray[i].imageURL != ""){
				pic1= new Image(objectArray[i].width, objectArray[i].height); 
				pic1.src=objectArray[i].imageURL; 
			}
		}
	}
}


//Loads up the specified slide
function loadSlide(slideNumber){
	if(slideNumber < 0 || slideNumber > objectArray.length){
		alert("Slide number error: " + slideNumber);
		return;
	}
	
	//Add HTML or image to page
	if(objectArray[slideNumber].imageURL != "")
		galleryDiv.innerHTML = "<img src='" + objectArray[slideNumber].imageURL + "' alt='" + objectArray[slideNumber].caption + "' />";
	else
		galleryDiv.innerHTML = objectArray[slideNumber].html;
	if(showCaptions)
		captionDiv.innerHTML = "<p>" + objectArray[slideNumber].caption + "</p>";
	else
		captionDiv.innerHTML = "";
	
	//Highlight thumb image and de-highlight the rest
	for(var i=0; i<objectArray.length; ++i){
		if(i==slideNumber)
			document.getElementById("thumbImg"+i).style.borderColor="#338800";
		else
			document.getElementById("thumbImg"+i).style.borderColor="#000000";
	}
}

-->

