// JavaScript Document
window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Completing a successful seismic operation in the Long Beach/Signal Hill oil field was possible thanks to community awareness, improved cableless technology, environmental sensitivities and a willingness for crews and the city to find common ground. No pun intended. ", 	
	"Completing a successful seismic operation in the Long Beach/Signal Hill oil field was possible thanks to community awareness, improved cableless technology, environmental sensitivities and a willingness for crews and the city to find common ground. No pun intended. ", 	
	"Completing a successful seismic operation in the Long Beach/Signal Hill oil field was possible thanks to community awareness, improved cableless technology, environmental sensitivities and a willingness for crews and the city to find common ground. No pun intended. ", 	
	"Completing a successful seismic operation in the Long Beach/Signal Hill oil field was possible thanks to community awareness, improved cableless technology, environmental sensitivities and a willingness for crews and the city to find common ground. No pun intended. ", 
	"What, no elephants? Getting the equipment in place for the Signal Hill operation required crews to get a parade permit for the vibrators to vibrate down the streets of Long Beach.  ") // These are enclosed in double quotes and separated with commas

function initAll() {
	document.getElementById("imgText").innerHTML = captionText[0];
	document.getElementById("prevLink").onclick = processPrevious;
	document.getElementById("nextLink").onclick = processNext;
}

function processPrevious() {
	newSlide(-1);
}

function processNext() {
	newSlide(1);
}

function newSlide(direction) {
	var imgCt = captionText.length;

	currImg = currImg + direction;
	if (currImg < 0) {
		currImg = imgCt-1;
	}
	if (currImg == imgCt) {
		currImg = 0;
	}
	document.getElementById("slideshow").src = "longbeach_seismic_" + (currImg + 1) + ".jpg"; // add name of file source here
	document.getElementById("imgText").innerHTML = captionText[currImg];
}

