// JavaScript Document
window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Driving downtown in our rental car, a Hundai SUV, we took lots of photos.  (1 OF 15)",
	"The streets into downtown are narrow, crowded. Clogged with cars and trucks. No one seems to care about stop signs, or traffic lights. Everybody for themselves!  (2 OF 15)",
	"Street vendors are everywhere.  They sell anything and everything. Police are everywhere, too! Many shops have a guard at the door or inside.  (3 OF 15)",
	"This business was built under a large tin roof which covers most of the main downtown street market. NO EXPENSE WAS SPARED HERE!  (4 OF 15)",
	"We crossed over the river into downtown finally. Traffic was stop and go, with the emphasis on STOP.  (5 OF 15)",
	"More street vendors at this cathedral. There are several beautiful churches in Tegucigalpa. Most of the natives are Catholic.  (6 OF 15)",
	"Up-scale shop, with the ever present guard.  (7 OF 15)",
	"More street vendors. Sara and Kristel took pictures of everything! We took over 1000 photos!  (8 OF 15)",
	"That is a cab in frount of us.  They are all white with yellow numbers.  The driver owns his cab, and you pay what you agree on BEFORE you get in.  Dad got very good at driving here, bluff them out, then hit the horn - move 6 feet and start over again!  (9 OF 15)",
	"More street vendors at The cathedral of St. Michael Archangel (1782). We heard that the next day, the police showed up and cleared the park of vendors in front of the church. It is a typical Spanish setup, Square and church in the center of town.  (10 OF 15)",
	"This statue of Francisco Morazán sets in the square.  The church is where we first met our daughters 16 years ago.  We had to go back.  (11 OF 15)",
	"The girls were excited to see this church.  Their lives changed drastically the last time they visited it.  (12 OF 15)",
	"Sara and Kristel check out the church.  That seems to be real gold.  It is really beautiful!  Special to all of us.  (13 OF 15)",
	"A side alter in the church.  (14 OF 15)",
	"Sara and Kristel in the church.  (15 OF 15  LAST PHOTO, CLICK ON HOME BELOW)"
)

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 = "images/square" + currImg + ".jpg"
	document.getElementById("imgText").innerHTML = captionText[currImg]
}

