arrImagePath = new Array();
arrImageCaption = new Array();
intPhotoIndex = 0;

function DisplayPhoto(photoIndex) {
	document.getElementById("PhotoFrame").src = arrImagePath[photoIndex];
	document.getElementById("PhotoFrame").alt = arrImageCaption[photoIndex];
	document.getElementById("PhotoCaption").innerText = arrImageCaption[photoIndex];
	if (intPhotoIndex == 0) {
		document.getElementById("lnkPrevious").disabled = true;
		document.getElementById("lnkPrevious").onclick = function() {return false};
	} else {
		document.getElementById("lnkPrevious").disabled = false;
		document.getElementById("lnkPrevious").onclick = function() {return true};
	}
	if (intPhotoIndex == arrImagePath.length - 1) {
		document.getElementById("lnkNext").disabled = true;
		document.getElementById("lnkNext").onclick = function() {return false};
	} else {
		document.getElementById("lnkNext").disabled = false;
		document.getElementById("lnkNext").onclick = function() {return true};
	}
	document.getElementById("currentPhoto").innerText = (photoIndex + 1).toString();
	document.getElementById("totalPhoto").innerText = arrImagePath.length.toString();
}

function SwapPhoto(num) {
	intPhotoIndex += num;
	DisplayPhoto(intPhotoIndex);
}