
var currPhoto;
var numPhotos;

function initializeGallery(i)
{
	numPhotos = i;
	currPhoto = 1;
}

function goLeftPhoto()
{
	if(currPhoto == 1) 
		currPhoto = numPhotos;
	else
		currPhoto = currPhoto - 1;
		
	for (var i=1; i<=numPhotos; i++)
		document.getElementById("photo" + i).style.display = "none";
	
	document.getElementById("photo" + currPhoto).style.display = "block";
	
	document.getElementById("photoindex").innerHTML = currPhoto + " of " + numPhotos;
}

function goRightPhoto()
{
	if(currPhoto == numPhotos) 
		currPhoto = 1;
	else
		currPhoto = currPhoto + 1;
		
	for (var i=1; i<=numPhotos; i++)
		document.getElementById("photo" + i).style.display = "none";
	
	document.getElementById("photo" + currPhoto).style.display = "block";
	
	document.getElementById("photoindex").innerHTML = currPhoto + " of " + numPhotos;
}

