// by james alley of the manalagi group, www.manalagi.com

var currentItem = "";
var prevItem = "";
var nextItem = "";

function determineCurrentPage() {
	var myString = document.location.toString();
	// find "faq_" and ".html" and scrape the string in between them. Hmmmm. Let's see:
	var startString = myString.indexOf ("faq_") + 4;
	var endString = myString.indexOf (".html");
	currentItem = myString.substring(startString,endString);
	// alert(myString);
	// we now have the number of the item, as long as its filename was "faq_1234.html" or similar.
	}

determineCurrentPage();

function goPrev() {
	if (currentItem != 1) {
		currentItem--;
		prevItem += 'faq_' + currentItem + '.html';
		self.location = prevItem;
		}
	else alert("This is the first item in the series; you cannot go back further.");
	}

function goNext() {
		if (currentItem != totalItems) {
			currentItem++;
			nextItem += 'faq_' + currentItem + '.html';
			self.location = nextItem;
			}
		else alert("This is the last item in this series; you cannot advance further.");
		}

function doNothing()  {}

