var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

function getMyHTML(status, objID) {
if(!xmlhttp){alert("It appears your browser does not support the JavaScript features on this website.");return false;}
thetable = document.getElementsByTagName('table')[0];
	if(status=="next"){
		switch(thetable.id){
			case "photos1": serverPage =  "photos2.inc"
			break;
			case "photos2": serverPage = "photos3.inc"
			break;
			case "photos3": serverPage="photos4.inc"
			break;
			case "photos4": serverPage="photos1.inc"
			break;
			default: return false;
		}
	}
	else{
		switch(thetable.id){
			case "photos1": serverPage =  "photos4.inc"
			break;
			case "photos2": serverPage = "photos1.inc"
			break;
			case "photos3": serverPage="photos2.inc"
			break;
			case "photos4": serverPage="photos3.inc"
			break;
			default: return false;
			}
		}

var serverPage = "photos/" + serverPage


var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
if (serverPage=="photos/photos1.inc"){updatestatus();}
}
}
xmlhttp.send(null);

}

window.onload = function() {
	if (document.getElementById){
	theinc=document.getElementById("inc");
	var previmg = document.createElement("img");
	previmg.setAttribute("id","prev");
	previmg.setAttribute("alt","Previous set of photos.");
	previmg.setAttribute("src","images/previous1.gif");
	theinc.parentNode.insertBefore(previmg, theinc);
	var nextimg = document.createElement("img");
	nextimg.setAttribute("id","next");
	nextimg.setAttribute("src","images/next1.gif");
	nextimg.setAttribute("alt","Next set of photos.");
	theinc.parentNode.appendChild(nextimg);
	nextimg.onclick = function(){getMyHTML('next','inc');return false;}
	previmg.onclick = function(){getMyHTML('prev','inc');return false;}
	
	updatestatus();
	
	}
}


function updatestatus(){	
	thestat=document.getElementById("status1");
	var statimg = document.createElement("img");
	statimg.setAttribute("alt","Picture set 1 of 4.");
	statimg.setAttribute("src","images/bullet1.gif");
	thestat.appendChild(statimg);
	}