database=new Array(26)


database[1]="index.html"
database[2]="page2.html"
database[3]="page3.html"
database[4]="page4.html"
database[5]="page5.html"
database[6]="page6.html"
database[7]="page7.html"
database[8]="page8.html"
database[9]="page9.html"
database[10]="page10.html"
database[11]="page11.html"
database[12]="page12.html"
database[13]="page13.html"
database[14]="page14.html"
database[15]="page15.html"
database[16]="page16.html"
database[17]="page17.html"
database[18]="page18.html"
database[19]="page19.html"
database[20]="page20.html"
database[21]="page21.html"
database[22]="page22.html"
database[23]="page23.html"
database[24]="page24.html"
database[25]="page25.html"
database[26]="page26.html"
database[27]="page27.html"
database[28]="page28.html"
database[29]="page29.html"
database[30]="page30.html"
database[31]="page31.html"
database[32]="page32.html"
database[33]="page33.html"
database[34]="page34.html"

//----------------------start------------------------------
NumberOfFiles=database.length;
StringA=location.href;
B=StringA.lastIndexOf("#");
if (B>0)
{
StringB=StringA.substring(0,B);
}
else
{StringB=StringA;}

LengthA=StringB.length;
A=StringB.lastIndexOf("/") +1;
ThisFilename=StringB.substring(A,LengthA);

//--------------------------------------------------------

/*Find the page nunmber*/
n=NumberOfFiles-1;
foundit=false;
for (var i = 0; i <= n; i++)
{
if (database[i]==ThisFilename)
{
ThisPageNumber=i;
foundit=true;
break;
}
if (foundit==false) {
ThisPageNumber=0;
}
}
//--------------------------------------------------------
//determine the numbers of the previous and the next pages//

function goBack(){
if ((ThisPageNumber-1)<1)
{

}
else
{top.location.href=database[ThisPageNumber-1]
}
}

function goForward()
{
if ((ThisPageNumber+1)>n)
{
top.location.href = "index.html"
}
else
{
top.location.href=database[ThisPageNumber+1]
}
}
//---------------------------------------------






//Start of function NextPreviousWriter
//This function writes the previous and next pages
function NextPreviousWriter()
{
if(database[ThisPageNumber-1])
{
document.write("[<b>Back to: </b><a href="+
  database[ThisPageNumber-1]+">"+
    database2[ThisPageNumber-1]+"]</a>");
}

if(database[ThisPageNumber+1])
{
document.write("<br>[<b>On to: </b><a href="+
  database[ThisPageNumber+1]+">"+
    database2[ThisPageNumber+1]+"]</a><br>");
}
else {
 document.write("<br><b>End of series so far. More to come ... "+
    "</b><br>");
}
}
//end of NextPreviousWriter



