/* When clicking a thumbnail image, we want to change description and photo */
function changePhoto(ContentLocation, Title, imageNumber) {

	changeNavButtons(imageNumber);
	changeDescription(imageNumber);
	loadPhoto(ContentLocation, Title, imageNumber);

}

/* Function to load a photo into the photo pane, adjusting it's size if required */
function loadPhoto(ContentLocation, Title, imageNumber){

	/* Build the URL of the image */
	var imageUrl = ContentLocation + Title + '/' + Title + imageNumber + '.jpg';

	/* Adjusting for small screen resolutions */
	var heightAdjustment;
	if(screen.height<864){
		var height = 0.7*screen.height;
		heightAdjustment = 'height=\"' + height + 'px\"';
	}
	
	/* If no descriptions of photos exist, display a blank description */
	var desc = "";
	if (typeof(description[parseInt(imageNumber, 10)]) != "undefined" ) {
		desc = description[parseInt(imageNumber, 10)];
	}

	/* Display description and image in the "photoContent" div */
	document.getElementById('photoContent').innerHTML= "<img src=\"" + imageUrl + "\"" + heightAdjustment + " />";
}

/* Load the first photo */
loadPhoto(ContentLocation, Title, '01');