addOnloadEvent(initAll);


var currImg = 0; 
//This is a array of words specifically for the captions of the slideshow
		//Each Pictures Caption is seperated by commas <,> and Quotations <"><">
		//THe amount of lines MUST equal the Amount of Pictures or they will not line up
var captionText = new Array(
	"Campers love to go tubing, waterskiing,and wakeboarding.",
	"Family Campers enjoys camp as well!",
	"The Bmx Track avaliable junior, tween, and teen camps",
	"The Iceburg Activity located on the lake.","Jeremy is going to give a camper a ride on the jetski",
	"Campers have the opportunity to gain skills by riding  all over camp on horses.",
	"Campers and Staff always enjoy a hard fought battle of darebase after supper.",
	"Shooting arrows at our targets is a activity for our campers.",
	"Many enjoy going to nature and holding the snakes, lizards, and bunnies.",
	"Kids make their own ceramics to take home with them.",
	"Campers also can choose to make or build their own crafts.",
	"We offer Canoeing and Kayaking as activities to do on the lake.",
	"Come and go mountain biking on the trails around camp.");

function initAll() {
	document.getElementById("imgText").innerHTML = captionText[0]; //Captures the text area
	document.getElementById("prevLink").onclick = processPrevious;//Captures when the Previous Button is Pressed
	document.getElementById("nextLink").onclick = processNext;   //Captures when the Next Button is pressed
}

function processPrevious() {
	newSlide(-1);
}

function processNext() {
	newSlide(1);
}

function newSlide(direction) {
	var imgCt = captionText.length; // imgCt is equal to the amount of data put into the Captions

	currImg = currImg + direction; 	//this is for the counter so that we know where the slide is
	if (currImg < 0) {
		currImg = imgCt-1;
	}
	if (currImg == imgCt) { //if the slide is at then end of the slideshow
		currImg = 0;
	}
	document.getElementById("slideshow").src = "../images/activity slideshow/slideImg" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
}

						
	