//Lists----------------------------------------------------------------------------

//this is a list of all the total images
//to add more type the name and location of the image.
//use the large image in this list. the smaller version will be called in the script
//do not include the .jpg extension here.
//make sure image name and file path are surrounded by quotation marks and each image is separated by a comma 
var allPicturesList = ["scenic_vistas/0001", "scenic_vistas/0002", "scenic_vistas/0003", "scenic_vistas/0004", "scenic_vistas/0005", "scenic_vistas/0006", "scenic_vistas/0007", "business_images/0008", "event_special/0009", "business_images/0010", "street_scenes/0011", "business_images/0012", "business_images/0013", "churches/0014", "business_images/0015", "business_images/0016", "business_images/0017","street_scenes/0018", "street_scenes/0019", "business_images/0020", "business_images/0021", "business_images/0022", "business_images/0023", "golf_course/0024", "golf_course/0025", "golf_course/0026", "street_scenes/0027", "event_special/0028", "business_images/0029", "business_images/0030", "street_scenes/0031", "business_images/0032", "churches/0033", "churches/0034", "churches/0035", "churches/0036", "churches/0037", "churches/0038", "churches/0039", "churches/0040", "churches/0041", "school_municipal/0042", "event_special/0043", "event_special/0044", "event_special/0045", "street_scenes/0046", "street_scenes/0047", "street_scenes/0048", "school_municipal/0049", "school_municipal/0050", "school_municipal/0052", "school_municipal/0053", "school_municipal/0056", "railroads/0057", "railroads/0058", "the_mines/0060", "the_mines/0061", "the_mines/0062", "the_mines/0063", "the_mines/0064", "the_mines/0065", "the_mines/0066", "the_mines/0067", "the_mines/0068", "the_mines/0069", "the_mines/0070", "the_mines/0071", "the_mines/0072", "the_mines/0073", "the_mines/0074", "the_mines/0075", "the_mines/0076", "the_mines/0077", "the_mines/0078", "the_mines/0079", "the_mines/0080", "railroads/0082", "street_scenes/0083", "railroads/0084", "street_scenes/0085", "the_mines/0086", "the_mines/0087", "the_mines/0088", "the_mines/0089", "the_mines/0090", "the_mines/0091", "street_scenes/0092", "business_images/0093", "railroads/0094", "railroads/0095"]

//This is a list of all the layers of content.
//the layers are turned on an off as needed to match the appropriate image
//you will need ad here as well to add images
var allPicturesDescriptionList = ["image0001", "image0002", "image0003", "image0004", "image0005", "image0006", "image0007", "image0008", "image0009", "image0010", "image0011", "image0012", "image0013", "image0014", "image0015", "image0016", "image0017", "image0018", "image0019", "image0020", "image0021", "image0022", "image0023", "image0024", "image0025", "image0026", "image0027", "image0028", "image0029", "image0030", "image0031", "image0032", "image0033", "image0034", "image0035", "image0036", "image0037", "image0038", "image0039", "image0040", "image0041", "image0042", "image0043", "image0044", "image0045", "image0046", "image0047", "image0048", "image0049", "image0050", "image0052", "image0053", "image0056", "image0057", "image0058", "image0060", "image0061", "image0062", "image0063", "image0064", "image0065", "image0066", "image0067", "image0068", "image0069", "image0070", "image0071", "image0072", "image0073", "image0074", "image0075", "image0076", "image0077", "image0078", "image0079", "image0080", "image0082", "image0083", "image0084", "image0085", "image0086", "image0087", "image0088", "image0089", "image0090", "image0091", "image0092", "image0093", "image0094", "image0095"]



//Variables------------------------***DO NOT EDIT ANY OF THESE***-----------------------------------------------

//this is a variable to store the current image number from the the list
//***********************
//***DO NOT EDIT THIS!***
//***********************
var currentImage = 0

//this is a varible used to create a new window for the large images
//***********************
//***DO NOT EDIT THIS!***
//***********************
var theBigPicture


//Functions------------------------***DO NOT EDIT ANY OF THESE***-----------------------------------------------


//this function cycles ahead one picture on click
//***********************
//***DO NOT EDIT THIS!***
//***********************
function nextImage() {
	currentImage = currentImage + 1
	if (currentImage > allPicturesList.length - 1) {
		currentImage = 0
	}
	document.theImage.src = allPicturesList[currentImage] + "small.jpg"
	document.getElementById(allPicturesDescriptionList[currentImage]).style.visibility = "visible"
	updatePage()
}

//this function cycles backward one picture on click
//***********************
//***DO NOT EDIT THIS!***
//***********************
function prevImage() {
	currentImage = currentImage - 1
	if (currentImage < 0) {
		currentImage = allPicturesList.length - 1
	}
	document.theImage.src = allPicturesList[currentImage] + "small.jpg"
	document.getElementById(allPicturesDescriptionList[currentImage]).style.visibility = "visible"
	updatePage()
}

//this fuction creates a new window and put a large veiw of the current image in to it.
//***********************
//***DO NOT EDIT THIS!***
//***********************
function largeView() {
	document.getElementById("theImage").blur()
	theBigPicture = window.open(allPicturesList[currentImage] + ".jpg", allPicturesList[currentImage], "scrollbars");
	theBigPicture.focus( );
}

//function allows the user to choose which picture they want to view next from a list of thumbs at the bottom of the page
//to add more pictures here and the following line to the history.html page:
// <a href="#" title="picture [number]" onclick="changeImage(*)"<img src.../> </a>
//where the * is the number of the image in the list
//***********************
//***DO NOT EDIT THIS!***
//***********************
function changeImage(a) {
	currentImage = a - 1
	document.theImage.src = allPicturesList[currentImage] + "small.jpg"
	updatePage()
}

//this function puts the correct text layer on the page.
//and highlights the current image in the nav.
//***********************
//***DO NOT EDIT THIS!***
//***********************
function updatePage() {
	document.getElementById(allPicturesDescriptionList[currentImage]).blur()
	document.getElementById(allPicturesDescriptionList[currentImage]).style.visibility = "visible"
	document.getElementById(allPicturesDescriptionList[currentImage] + "thumb").style.borderColor = "#0C7706"
	for (i = currentImage + 1; i <= allPicturesDescriptionList.length - 1; i = i + 1) {
		document.getElementById(allPicturesDescriptionList[i]).style.visibility = "hidden";
		document.getElementById(allPicturesDescriptionList[i] + "thumb").style.borderColor = "#ffffff";
	}
		for (i = currentImage - 1; i <= allPicturesDescriptionList.length - 1; i = i - 1) {
		document.getElementById(allPicturesDescriptionList[i]).style.visibility = "hidden";
		document.getElementById(allPicturesDescriptionList[i] + "thumb").style.borderColor = "#ffffff";
	}
}