// JavaScript Document

var fileNameArr = new Array("","index.cfm","intro_a.cfm","intro_b.cfm","intro_c.cfm","intro_d.cfm","intro_e.cfm");

var thePath, thePathForward, thePathBack;

function findIndex() {
	var theFile = document.URL
	thePath = theFile.substring(0,theFile.lastIndexOf('/')+1);
	theFile = theFile.substring(theFile.lastIndexOf('/')+1);
	for (i=0; i < fileNameArr.length; ++i) {
		if (fileNameArr[i] == theFile) {
			return i;
		}
	}
	return "noMatch";
}

function goPage(theDirection) {
	var theIndex = findIndex();
	if (theIndex == "noMatch") {
		alert("No matching item in array. Check filename.");
	} else {
		if (theDirection == "forward") {
			theIndex = parseInt(theIndex) + 1	
		} else {	//go backwards
			theIndex = parseInt(theIndex) - 1			
		}
	}
	thePath = fileNameArr[theIndex];
	setTimeout("window.location = thePath;", 100);  
}

