function imageSwap(Name, on_Src)
{
      var image_on = new Image();
      image_on.src = on_Src;
      document.images[Name].src = image_on.src;
}

function updateCaption(NewCaption)
{
      document.getElementById('ImageCaption').innerHTML = NewCaption;
}

var CurrentPhotoIndex = 0;
var PhotoURLs;
var PhotoCaptions;
var PhotoCount;

function ShowPhoto(iPhotoID)
{
	CurrentPhotoIndex = iPhotoID;
	var image_on = new Image();
	 image_on.src = PhotoURLs[CurrentPhotoIndex];
      document.images['BigImage'].src = image_on.src;
	 updateCaption(PhotoCaptions[CurrentPhotoIndex]);
	 if (CurrentPhotoIndex == PhotoCount - 1)
		hide('PhotoArrowRight');
	else
		show('PhotoArrowRight');
		
	if (CurrentPhotoIndex == 0)
		hide('PhotoArrowLeft');
	else
		show('PhotoArrowLeft');
}

function PhotoNext()
{
	ShowPhoto(CurrentPhotoIndex+1);
}

function PhotoPrev()
{
	ShowPhoto(CurrentPhotoIndex-1);
}
