// The code on this page relies on naming the set of files to be displayed
// in a particular way.  The variable myName concatenated with the variable 
// starter plus ".htm" must be the first file in the set.  Likewise, the last 
// file in the set must be called myName+ender+".htm".

// The control structures in the function nameMe() check to see whether the first 
// file in the set is named correctly or whether it is in fact a default file 
// called "index.htm"

var myName = "future"
var starter = 11;
var ender = 30;
var whoIam;
var prev;
var aft;

function nameMe()
	{
	whoIam = document.location.toString()
		//converts the location to a string
	lastOne = whoIam.substring(whoIam.length, whoIam.length-1)
		//extracts the last charcter of the location string
	checker = lastOne.indexOf('/')
		//checks to see whether last character is '/'
	if (checker == -1)
		// if the last character is not '/'
		// do the code between the curly braces
		{
		namer=whoIam.substring(whoIam.length-6, whoIam.length-4) 
			// extracts the last two characters before the .htm on the file name
		if (namer=="ex") pageNumb = starter;
			// checks whether the file name is "index.htm"; 
			// if the condition is met, assigns the starter 
			// value to the variable pageNumb
		else pageNumb=Number(namer)
			// if the condition is not met,
			// converts the extracted characters from string to number
		}
	else pageNumb = starter;
		// if the last character is '/',
		// assign the value in the variable starter
		// to the variable pageNumb
	}

function before()
// This function uses the output of the function nameMe()
// to determine the correct URL for the link to the previous
// slide in the set.
	{
	if (pageNumb == starter)
		{prev = myName + ender + ".htm"}
	else 
		{pageNumb = pageNumb - 1;
		prev = myName + pageNumb + ".htm"
		}
	location = prev		
	}	
	
function after()
// This function uses the output of the function nameMe()
// to determine the correct URL for the link to the next 
// slide in the set.
	{
	if (pageNumb == ender)
		{aft = myName + starter + ".htm"}
	else 
		{pageNumb = pageNumb + 1;
		aft = myName + pageNumb + ".htm"}
	location = aft;
	}
