window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Handling (the environment) with care: Orange heli-bags holding multiple Firefly units and Vectorseis sensors line the Wamsutter horizon. <em>Photos courtesy of ION</em>",
	"Heli-bag and some locals: the Wamsutter is a heavily developed active field\, and Wyoming is a kind of environmental hotbed\, which adds up to a made-to-order locale to test an acquisition system sans cables. The tests\, incidentally\, were a success.",
	"A deployed Firefly unit and Vectorseis sensor: the Wamsutter is a heavily developed active field\, and Wyoming is a kind of environmental hotbed\, which adds up to a made-to-order locale to test an acquisition system sans cables. The tests\, incidentally\, were a success.",
	"",
	"",
	"",
	"",
	"",
	"",
	"")

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 = "wamsutter" + (currImg + 1) + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
}
