// JavaScript Document
window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Oiled shoreline at Point Isabel Regional Shoreline, Richmond, California.",
	"Oiled shoreline at Point Isabel Regional Shoreline, Richmond, California.",
	"Oiled shoreline at Eastshore State Park, Berkeley, California.",
	"Oiled shoreline at Eastshore State Park, Berkeley, California.",
	"Oiled shoreline at Point Isabel Regional Shoreline, Richmond, California.",
	"Volunteers Suzanna Beck of the Farallones Marine Sanctuary Association and Arlene Davis prepare a carrier for an oiled bird by writing the longitude and latitude, time found, shoreline name, bird type, and oil condition on it.",
	"Volunteer Suzanna Beck of the Farallones Marine Sanctuary Association boxes an oiled marbled godwit at the old Brick Yard on Eastshore State Park.",
	"Martha Wing and Brooks Island caretaker load the boat for the trip back to shore.",
	"Coast Guard HAZMAT team and EPA technical advisor join East Bay Regional Park District employees to Brooks Island.",
	"East Bay Regional Park District Volunteers Trail Patrol get briefed on their duties for the day at EBRPD Incident Command staging area.",
	"East Bay Regional Park District Volunteers Cliff 'Bird Rangler' Rocha and Robert Spencer cross the breech on Brooks Island spit.",
	"Robert Spencer, East Bay Regional Park District and Oiled Wildlife Care Network, oily bird recovery volunteer talks to volunteer bird spotter.",
	"Robert Spencer, wipes his brow. This oily bird recovery volunteer carries bagged and labled dead birds back to the rescue staging area.",
	"Volunteers Suzanna Beck of the Farallones Marine Sanctuary Association and Arlene Davis comb the shoreline to capture oiled birds and recover the dead.",
	"Front line Volunteer Coordinator, Kirsten Gilardi, at the Oiled Wildlife Care Network hospital trailer sends volunteer oiled bird capturers to East Bay shoreline locations.",
	"East Bay Regional Park District Incident Command post signs in Park District volunteers.", 
	"Oiled shoreline at Eastshore State Park, Berkeley, California.",
	"HASMAT trained crew on Albany Beach begins removing the washed-up heavy bunker oil (a.k.a. IFO 380).",
	"HASMAT trained crew on Albany Beach begins removing the washed-up heavy bunker oil (a.k.a. IFO 380).",
	"HASMAT trained crew on Albany Beach begins removing the washed-up heavy bunker oil (a.k.a. IFO 380).",
	"East Bay Regional Park District Incident Command staging area at Eastshore State Park", 
	"Before the East Bay Regional Park District Employees could be wildlife rescue volunteers, they first had to take a four-hour HASWOPER course. The California Department of Fish and Game conducted the course teaching employees the toxic and health risks associated with the Bay oil spill as well as how to protect themselves and how to recognize and avoid danger.",
	"Department of Fish and Game educator demonstrates to the HASWOPER class how to put on and then take off contaminated garments.",
	"Department of Fish and Game educator demonstrates to the HASWOPER class how to put on and then take off contaminated garments.", 
	"East Bay Regional Park District Volunteers Trail Patrol get briefed on their duties for the day at EBRPD Incident Command staging area.",
	"Loading the boat for Brooks Island.",
	"A rescued oiled bird.",
	"'Area Closed' sign at Point Isabel Regional Shoreline, Richmond, California."
)

function initAll() {
	document.getElementById("imgText").innerHTML = captionText[0];
	document.getElementById("slideshow").src = "/files/feat_112007oil_spill0.jpg";
	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 = "/files/feat_112007oil_spill" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
}
