// swap image and caption

function swapPhoto(photoSRC,theCaption) {
	var displayedCaption = document.getElementById("caption");
	displayedCaption.firstChild.nodeValue = theCaption;

    document.images.imgPhoto.src = "images/" + photoSRC;
    scrollTo(0,0);
    }

function prevImage()
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == 0)
	{
		list.selectedIndex = list.options.length-1;
	}
	else
	{
		list.selectedIndex--;
	}
	swapPhoto();
}

function nextImage()
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == list.options.length-1)
	{
		list.selectedIndex = 0;
	}
	else
	{
		list.selectedIndex++;
	}
	changeImage();
}
