var galleryName
var totalImgs
var currentImg
var targetImg

function setVariables(theFilm) {

	galleryName = theFilm
	totalImgs = eval(galleryName + 'PhotosTotal');
	currentImg = 1;
}

function imgNext() {
	targetImg = currentImg + 1;
	if (targetImg > totalImgs) return
	else {
		document.getElementById('mainImage').src = 'images/' + galleryName + '_photo' + targetImg + '.jpg';
		currentImg = targetImg;
	}
}


function imgBack() {
	targetImg = currentImg - 1;
	if (targetImg < 1) return
	else {
		document.getElementById('mainImage').src = 'images/' + galleryName + '_photo' + targetImg + '.jpg';
		currentImg = targetImg;
	}

}
