var photos = new Array();
var subtitle = new Array();
var which = 0;

function backward()
{
	which = (which-1) % photos.length;
	if (which <= 0) { which = photos.length-1 }
	document.getElementById("image").src = photos[which];
}

function forward()
{
	which = (which+1) % photos.length;
	document.getElementById("image").src = photos[which];
}

function backwardsubtitle()
{
	which = (which-1) % photos.length;
	if (which <= 0) { which = photos.length-1 }
	document.getElementById("image").src = photos[which];
	document.getElementById("subtitle").value = subtitles[which];
}

function forwardsubtitle()
{
	which = (which+1) % photos.length;
	document.getElementById("image").src = photos[which];
	document.getElementById("subtitle").value = subtitles[which];
}

function empty()
{
	document.getElementById("image").src = photos[0];
	document.getElementById("subtitle").value = subtitles[0];
}
