// JavaScript Document

var largeDir = "../images/Galleries/P15/Large/";
var nativeDir = "images/Galleries/P15/Native/";
var numberOfPhotos = 3;
var currentPhoto = 2;

function nextPhoto()
{
	if (currentPhoto < numberOfPhotos - 1)
	{
		currentPhoto ++;
		scrollPhotos();
	}
	else
	{
		currentPhoto = 0;
		scrollPhotos();
	}
	return false;
}

function previousPhoto()
{
	if (currentPhoto > 0)
	{
		currentPhoto --;
		scrollPhotos();
	}
	else
	{
		currentPhoto = numberOfPhotos - 1;
		scrollPhotos();
	}
	return false;
}

function scrollPhotos()
{
	if (currentPhoto > numberOfPhotos - 1)
	{
		
	}
	else if (currentPhoto < 0)
	{
		
	}
	else
	{
		document["focusImage"].src = largeDir + (currentPhoto + 1) + ".jpg";
		document.getElementById('photoID').firstChild.data = (currentPhoto + 1) + " of " +  numberOfPhotos;
	}
	for (var i = 0 ; i < numberOfPhotos ; i++)
	{
		var label = "t" + String(i + 1);
		if (currentPhoto == i)
		{
			document[label].border = 2;
		}
		else
		{
			document[label].border = 0;
		}
	}	
}

function gotoMainImage()
{
	gotoImage(currentPhoto + 1);
}

function gotoImage(number)
{
	window.location.href = "../" + nativeDir + number + ".jpg";
	window.location.reload;
}

