function showImage(iMove) {
	var sImage;
	var oImage;
	var oDiv;
	var bNetscape4;
	var bIE4;
	var bNetscape6;
	
	
	if (iMove == -999) { // Previous
		iImage = iImage - 1;
	} else if (iMove == 999) { // Next
		iImage = iImage + 1;
	} else {
		if (iMove != 0) {
			iImage = iMove;
		}
	}

	if (iImage < 1) {
		iImage = aCaptions.length;
	}
	if (iImage > aCaptions.length) {
		iImage = 1;
	}			

	bNetscape4   = (document.layers) ? true:false;                 // netscape 4
	bIE4   = (document.all) ? true:false;                    // ie4+
	bNetscape6 = ((document.getElementById)&&(!bIE4))?true:false;   // ns6 etc.

	if (bNetscape4) {
		oDiv = eval(document.divCaption);
	}
	
	if (bNetscape6) {
		oDiv = document.getElementById('divCaption');
		oDiv.style.top = "2px";
		oDiv.style.left = "2px";
	}

	if (bIE4) {
		oDiv = document.all.divCaption;
	}
	oDiv.innerHTML = aCaptions[iImage - 1];
	
	//document.all.imgPhoto.src = "images/pg" + sImage;	
	oImage = document.images["imgPhoto"];
	oImage.src = "images/" + aSource[iImage - 1];
}

function loadNavigation() {
	var sNavigation;
	var oNavigation;
	var i;
	var bNetscape4;
	var bIE4;
	var bNetscape6;
	var oDiv;
	
	sNavigation = "<TABLE width='100%'>";
	sNavigation += "<TR>";
	
	for (i=0; i<aCaptions.length; i++) {
		sNavigation += "<TD valign='top' width='10%'>";
		sNavigation += "<A href='#' onclick='javascript:showImage(" + (i + 1) + ");' onmouseover='javascript:showImage(" + (i + 1) + ");' class='Button'>" +  (i + 1) + "&nbsp;&nbsp;</A>";
		//sNavigation += '<A href="#" onclick="javascript:showImage(' + (i + 1) + ');" class="Button" onmouseover="javascript:showTip(this,event,"Hello");" onmouseout="javscript:hideTip();">' +  (i + 1) + '&nbsp;&nbsp;</A>';
		sNavigation += "</TD>";
	}

	sNavigation += "</TR>";
	sNavigation += "</TABLE>";
	
	
	bNetscape4   = (document.layers) ? true:false;                 // netscape 4
	bIE4   = (document.all) ? true:false;                    // ie4+
	bNetscape6 = ((document.getElementById)&&(!bIE4))?true:false;   // ns6 etc.

	if (bNetscape4) {
		oDiv = eval(document.divNavigation);
	}
	
	if (bNetscape6) {
		oDiv = document.getElementById('divNavigation');
		oDiv.style.top = "2px";
		oDiv.style.left = "2px";
	}
	
	if (bIE4) {
		oDiv = document.all.divNavigation;
	}
	//alert("Img Nav: " + sNavigation);
	oDiv.innerHTML = sNavigation;
}


function showGamesImage(iMove) {
	var sImage;
	var oImage;
	var oDiv;
	var bNetscape4;
	var bIE4;
	var bNetscape6;
	
	
	if (iMove == -999) { // Previous
		iImage = iImage - 1;
	} else if (iMove == 999) { // Next
		iImage = iImage + 1;
	} else {
		if (iMove != 0) {
			iImage = iMove;
		}
	}

	if (iImage < 1) {
		iImage = aCaptions.length;
	}
	if (iImage > aCaptions.length) {
		iImage = 1;
	}			

	/*
	bNetscape4   = (document.layers) ? true:false;                 // netscape 4
	bIE4   = (document.all) ? true:false;                    // ie4+
	bNetscape6 = ((document.getElementById)&&(!bIE4))?true:false;   // ns6 etc.

	if (bNetscape4) {
		oDiv = eval(document.divCaption);
	}
	
	if (bNetscape6) {
		oDiv = document.getElementById('divCaption');
		oDiv.style.top = "2px";
		oDiv.style.left = "2px";
	}

	if (bIE4) {
		oDiv = document.all.divCaption;
	}
	oDiv.innerHTML = aCaptions[iImage - 1];
	*/
	//document.all.imgPhoto.src = "images/pg" + sImage;	
	oImage = document.images["imgPhoto"];
	oImage.src = "images/" + aSource[iImage - 1];
	
	document.all.divGames1.style.display = "none";
	document.all.divGames2.style.display = "none";
	document.all.divGames3.style.display = "none";
	document.all.divGames4.style.display = "none";
	switch (iImage) {
		case 1: {
			document.all.divGames1.style.display = "";
			break;
		}
		case 2: {
			document.all.divGames2.style.display = "";
			break;
		}
		case 3: {
			document.all.divGames3.style.display = "";
			break;
		}
		case 4: {
			document.all.divGames4.style.display = "";
			break;
		}
	}
}

function loadGamesNavigation() {
	var sNavigation;
	var oNavigation;
	var i;
	var bNetscape4;
	var bIE4;
	var bNetscape6;
	var oDiv;
	
	sNavigation = "<TABLE width='100%'>";
	sNavigation += "<TR>";
	
	for (i=0; i<aCaptions.length; i++) {
		sNavigation += "<TD valign='top' width='10%'>";
		sNavigation += "<A href='#' onmouseover='javascript:showGamesImage(" + (i + 1) + ");' class='Button'>" +  (i + 1) + "&nbsp;&nbsp;</A>";
		//sNavigation += '<A href="#" onclick="javascript:showImage(' + (i + 1) + ');" class="Button" onmouseover="javascript:showTip(this,event,"Hello");" onmouseout="javscript:hideTip();">' +  (i + 1) + '&nbsp;&nbsp;</A>';
		sNavigation += "</TD>";
	}

	sNavigation += "</TR>";
	sNavigation += "</TABLE>";
	
	
	bNetscape4   = (document.layers) ? true:false;                 // netscape 4
	bIE4   = (document.all) ? true:false;                    // ie4+
	bNetscape6 = ((document.getElementById)&&(!bIE4))?true:false;   // ns6 etc.

	if (bNetscape4) {
		oDiv = eval(document.divNavigation);
	}
	
	if (bNetscape6) {
		oDiv = document.getElementById('divNavigation');
		oDiv.style.top = "2px";
		oDiv.style.left = "2px";
	}
	
	if (bIE4) {
		oDiv = document.all.divNavigation;
	}
	//alert("Img Nav: " + sNavigation);
	oDiv.innerHTML = sNavigation;
}
