//All you have to do is to add files to this list below:
//First get your list of files in the order you want them:



function MakeArray(n){
	this.length=n
	return this
}
database=new MakeArray(30)
database[0]="RMNP-Flowers-YellowLadysSlipper.HTML"
database[1]="RMNP-Flowers-MtIris.HTML"
database[2]="RMNP-Flowers-Purple1.HTML"
database[3]="RMNP-Flowers-Yellow1.HTML"
database[4]="RMNP-Flowers-Yellow2.HTML"
database[5]="RMNP-Flowers-Yellow003.HTML"
database[6]="RMNP-Flowers-Yellow004.HTML"
database[7]="RMNP-Flowers-OxeyeDaisy001.HTML"
database[8]="RMNP-Flowers-Purple002.HTML"
database[9]="RMNP-Flowers-Yellow001.HTML"
database[10]="RMNP-Flowers-Blue001.HTML"
database[11]="RMNP-Flowers-Primrose001.HTML"
database[12]="RMNP-Flowers-TallLarkspur001.HTML"
database[13]="RMNP-Flowers-Red001.HTML"
database[14]="RMNP-Flowers-Red002.HTML"
database[15]="RMNP-Flowers-White001.HTML"
database[16]="RMNP-Flowers-Purple003.HTML"
database[17]="RMNP-Flowers-Yellow006.HTML"
database[18]="RMNP-Flowers-Yellow007.HTML"
database[19]="RMNP-Flowers-Red003.HTML"
database[20]="RMNP-Flowers-Pink001.HTML"
database[21]="RMNP-Flowers-White002.HTML"
database[22]="RMNP-Flowers-White003.HTML"
database[23]="RMNP-Flowers-White003.HTML"
database[24]="RMNP-Flowers-White004.HTML"
database[25]="RMNP-Flowers-IndianPaintBrush001.HTML"
database[26]="RMNP-Flowers-ColoradoBlueColumbine001.HTML"
database[27]="RMNP-Flowers-Yellow008.HTML"
database[28]="RMNP-Flowers-Yellow009.HTML"
database[29]="RMNP-Flowers-White005.HTML"




//The above is all you need to change!
//We want to automatically discover the number of files

NumberOfFiles=17;

//Next find out which page, this one is//
//We use the location.href property and extract the filename
//from this string using lastIndexOf:

StringA=location.href;
LengthA=StringA.length
A=StringA.lastIndexOf("/")+1;
ThisFilename=StringA.substring(A,LengthA);

//Now we find the current page nunmber (in the list)
//Remember that Arrays start at 0 and end at number of 
//elements less one. So the last element is:

n2=NumberOfFiles-1;

//Now we look through to list to find our file, and 
//therefore, its number in the list:

for (var i = 0; i <= n2; i++)
{
if (database[i]==ThisFilename)
{
ThisPageNumber=i;
}
}

//determine the numbers of the previous and the next pages//

function goBack(){
if (ThisPageNumber-1<0)

//We don't want to go into negative numbers or numbers
//bigger than the number of files! So if the file number less
//one is less than zero, there is nowhere left to go!

{
alert("You are at the beginning of the Flower Series")
}

//Otherwise we just take one of the current file number
//and get the number for the previous file:

else
{top.location=database[ThisPageNumber-1]}}


function goForward(){
if (ThisPageNumber+1>n2){
alert("You are at the end of the Flower Series")

//If the user is clicking on the last file, he or she
//cannot go forward. Otherwise, the next file is the current
//file number plus one:

}
else
{top.location=database[ThisPageNumber+1]}}

//and so that's our code. All we have to do is to change files
//in the Array database! Nice and lazy!


