currentPage = null;

function getCurrentPage()
{
	theURL = document.URL;
	startindex = theURL.indexOf("?");
	startindex2 = theURL.lastIndexOf("/");
	if(startindex == -1)
	{
		currentPage = theURL.substring(startindex2+1,theURL.length);
	}
	else
	{
		currentPage = theURL.substring(startindex2+1,startindex);
	}
}

function parseURL()
{
	getCurrentPage();
	theURL = document.URL;
	startindex = theURL.indexOf("?");
	stopindex = theURL.indexOf("=");
	if (startindex == -1 || stopindex == -1)
	{
		stopLoop = true;
	}
	else
	{
		stopLoop = false;
	}
	while (!stopLoop)
	{
		theVar = theURL.substring(startindex+1,stopindex);
		startindex = stopindex;
		stopindex = theURL.indexOf("+",startindex+1);
		if(stopindex == -1)
		{
			stopindex = theURL.length;
			stopLoop = true;
		}
		theValue = theURL.substring(startindex+1,stopindex);
		variables[theVar] = theValue;
		startindex = stopindex;
		stopindex = theURL.indexOf("=",startindex+1);
	}
}

variables = new Array();
parseURL();

numPages = 0;

function dynamicPage(title, textColor, bgcolor, caption, imageName,
imageTitle, nextPageNum)
{
	this.pageType = "Dynamic";
	this.title = title;
	this.textColor = textColor;
	this.bgcolor = bgcolor;
	this.caption = caption;
	this.imageName = imageName;
	this.imageTitle = imageTitle;
	this.nextPageNum = nextPageNum;
	return(this);
}

function staticPage(link)
{
	this.pageType = "Static";
	this.link = link;
	return(this);
}

function makeDynamicPage(title, textColor, bgcolor, caption, imageName,
imageTitle, nextPageNum)
{
	pages[++numPages] = new dynamicPage(title, textColor, bgcolor,
caption, imageName, imageTitle, nextPageNum);
	return(numPages - 1);
}

function makeStaticPage(link)
{
	pages[++numPages] = new staticPage(link);
	return(numPages - 1);
}

pages = new Array();

if(variables["page"] == null)
{
	variables["page"] = 1;
}
