// max number of pages
var npgMax = 9;

var npgButtons = "";
var npgPageArray =  new Array (
	"null",
	"index",
	"howitworks",
	"character",
	"combat",
	"costume",
	"playing",
	"otherlarp",
	"glossary",
	"end");

var npgPageNames = new Array (
	"null",	
	"Overview",
	"How It Works",
	"Designing a Character",
	"Combat",
	"Getting a Costume",
	"Playing the Game",	
	"If You've Played With Another Group",
	"Glossary",
	"The Final Step");

var npgCurrNum = 0;
// convert npgCurrName into npgCurrNum.
for (ct = 1; ct <= npgMax; ct = ct + 1) {
	if (npgPageArray[ct] == npgCurrName) 
	{
		npgCurrNum = ct; 
		break;
	} 
}


//
// define clickable list of pages
//
var npgNavList = "<ul class='flushleft'>"
for (ct = 1; ct <= npgMax; ct++) {
	if (ct == Math.round(npgMax / 2)+1) {
		npgNavList += "</ul><ul class='flushleft'>";
	}
	npgNavList += "<li><a href='" + npgPageArray[ct] + ".shtml'>" + npgPageNames[ct] + "</a></li>";
}
npgNavList += "</ul>";
document.getElementById("npgnavlist").innerHTML = npgNavList;

//
// define section with Prev and Next buttons
//
if (npgCurrNum >= 1 || npgCurrNum <= npgMax) {

	if (npgCurrNum > 1) {
		npgButtons += "<a href='" + npgPageArray[npgCurrNum - 1] + ".shtml'>Prev</a>";			
	}

	if (npgCurrNum < npgMax) {
		npgButtons += "<a href='" + npgPageArray[npgCurrNum + 1] + ".shtml'>Next</a>";			
	}

	if (npgCurrNum == npgMax) {
		npgButtons += "<a href='/rules/intro/gettingstarted.shtml'>Get Started!</a>";			
	}

}

