// JavaScript Document

window.onload = initAll;
var newWindow;
var currImg = 0;

function initAll() { 
	document.getElementById("slideimage").src = imageSrc + "0.jpg";
	document.getElementById("slidetext").innerHTML = captionText[0];
	document.getElementById("prev").onclick = newSlide;
	document.getElementById("next").onclick = newSlide;
	document.getElementById("slideimage").onload = captionDisplay;
	/*document.getElementById("return").onclick= function () {document.referrer}   // goes back to the page it came from  - only works from a link (a href), not when the new page was loaded from an onclick handler*/
	document.getElementById("return").onclick= function () {history.back()}   //just like the back button from the browser
		
    for (var i=0; i<document.links.length; i++ ) { 
		document.links[i].onfocus = removeDottedLine;
	} 
	var inputs = document.forms[0].getElementsByTagName("input");	
	for (var i=0; i<inputs.length; i++ ) { 
		if (inputs[i].type=="button")
		{inputs[i].onfocus = removeDottedLine} 
	} 
	
}


function newSlide () { 
	if  (this.id=="prev") {
		currImg-- ;
	}
	var imgCt = captionText.length;

	if  (this.id=="next") {
		currImg++ ;
	}
	
	if (currImg < 0) {
		currImg = imgCt-1;
	}
	if (currImg == imgCt) {
		currImg = 0;
	}
	document.getElementById("slideimage").src = imageSrc + currImg + ".jpg";
}

function captionDisplay () {
		document.getElementById("slidetext").innerHTML = captionText[currImg]
}

function removeDottedLine() {
	if(this.blur)this.blur()
	}


<!-- 

 -->
