var isIE = (document.all) ? 1 : 0;
var isDOM = (document.getElementById) ? 1 : 0;
var photoNavigation = "<div align=\"center\">Photos: <a href=\"javascript:previousPhoto();\">&lt; Previous</a> | <a href=\"javascript:nextPhoto();\">Next &gt;</a></div>";
var photoCount;
var photoList;
var photoIndex = 0;

function displayPhoto(index) {

	var photoHTML = '<img src="' + photoList[index] + '"  alt="Photo #' + (index+1)  +'"  border="0" class="thumbimage">';
	
	if (isIE) {		
		document.all["photo"].innerHTML = photoHTML;
		return;
	}
	else if (isDOM) {		
		document.getElementById("photo").innerHTML = photoHTML;
		return;
	}
}

function nextPhoto() {

	photoIndex++;	

	if (photoIndex >= photoCount) {
		photoIndex = 0;
	};
	
	if (isIE || isDOM) {
		displayPhoto(photoIndex);
	}
}
function previousPhoto() {

	photoIndex--;

	if (photoIndex < 0 ) {
		photoIndex = photoCount - 1;
	}
	
	if (isIE || isDOM) {
		displayPhoto(photoIndex);
	}
}

