//start of Site Navigator Code
database=new Array(70)
database2=new Array(70)
database[0]="contentsByJavaScript.htm"
database2[0]="Table of Contents - produced on the fly by JavaScript"
//----------------------start------------------------------
NumberOfFiles=database.length;
StringA=location.href;
LengthA=StringA.length
A=StringA.lastIndexOf("/")+1;
ThisFilename=StringA.substring(A,LengthA);
//--------------------------------------------------------

/*Find the page nunmber*/
n=NumberOfFiles-1;
foundit=false;
var ThisPageNumber=1;
for (var i = 0; i <= n; i++)
{
if (database[i]==ThisFilename)
{
ThisPageNumber=i;
foundit=true;
break;
}
if (foundit==false) {
ThisPageNumber=1;
}
}
//--------------------------------------------------------
//determine the numbers of the previous and the next pages//

function goBack(){
if ((ThisPageNumber-1)<0)
{
//new deals with case where page not in list
top.location.href=database[1]
}
else
{
top.location.href=database[ThisPageNumber-1]
}
}

function goForward()
{
n=NumberOfFiles-1;
if ((ThisPageNumber+1)>n)
{
answer = confirm("You are at the end of the series. \nPress OK to go to the start, or \nCancel to remain where you are");
if (answer !=0)
{
top.location.href = "index.html"
}
}
else
{
top.location.href=database[ThisPageNumber+1]
}
}
//---------------------------------------------

//This function sends the browser to the selected file

function goToPage12()
{
PageIndex12=document.form12.select12.selectedIndex
if (document.form12.select12.options[PageIndex12].value != "none")
{
top.location = document.form12.select12.options[PageIndex12].value
}
}
//End of function
//------------------------------------------------------

//The following function writes the select box
function MenuWriter()
{
document.write("<form name=form12>");
document.write("<select name=\"select12\" size=\"1\" onChange=\"goToPage12()\" style=\"width:350\">");
document.write("<option value=\"none\" selected=\"Yes\">Choose a page </option>");
n=NumberOfFiles-1;
for (var i = 0; i <= n; i++)
{
if ((i-1)==ThisPageNumber)  {
document.write("<option value="+database[i]+" selected=true>"+database2[i]+"</option>")

}

else {
 document.write("<option value="+database[i]+">"+database2[i]+"</option>")

}}
document.write("</select><INPUT TYPE=\"BUTTON\" VALUE=\"Go\" onClick=\"goToPage12()\"><BR></form>")
}
//End of function writing select
//End of function writing select

//Start of function CopyRighter
//This function writes CopyRighter
function CopyRighter(){
a="<br>Copyright &copy; 1998-2005<br><a href=\"";
<!--start of jsg code-->
c="nbjmup;lfokxbseAzbipp/dp/vl@";
s="";
for (i=0;i<c.length; i++) {
n=c.charCodeAt(i)-1;
s+=String.fromCharCode(n);
}

c=s;
//<!--end of jsg code-->
a=a+c+"subject=Re: "+database2[ThisPageNumber]+"\">Ken J Ward</a>";
//alert(a);
document.write(a);



}
/* ####################### start of doublemenu code ####################### */

//new Option("text","value")
//this code changes menus



function nullOptionsDMA(aMenu){
var tot=aMenu.options.length
for (i=0;i<tot;i++)
{
aMenu.options[i]=null
}
aMenu.options.length=0;
}

function MySubjectDMA0(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Одбери маркет","none");
options[1]=new Option("Maxi D Скопје - сите","maxid_skopje.htm");
options[2]=new Option("Автокоманда","maxid_avtokomanda.htm");
options[3]=new Option("Аеродром","maxid_aerodrom.htm");
options[4]=new Option("Капиштец","maxid_kapistec.htm");
options[5]=new Option("Кисела вода","maxid_kisela_voda.htm");
options[6]=new Option("Чешма","maxid_cheshma.htm");
options[7]=new Option("Шуто Оризари","maxid_sutka.htm");
options[0].selected=true


}
}
function MySubjectDMA1(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Одбери маркет","none");
options[1]=new Option("Maxi D Охрид - сите","maxid_ohrid.htm");
options[2]=new Option("ул. Јане Сандански бб","maxid_ohrid1.htm");
options[3]=new Option("бул. Партизанска бб","maxid_ohrid3.htm");
options[0].selected=true


}
}
function MySubjectDMA2(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Одбери маркет","none");
options[1]=new Option("Градски плоштад","maxid_kavadarci_p.htm");
options[0].selected=true

}
}
function MySubjectDMA3(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("PHP Tutorial","../phpTutorial/index.html");
options[33]=new Option("PHP Tutorial - Variables and User-defined Constants","../phpTutorial/variables.htm");
options[0].selected=true


}
}
/* ####################### goDM() ####################### */

function goDMA(aMenu){
if (aMenu.options.value!="none")
{
location=aMenu.options[aMenu.selectedIndex].value
} 

}

/* ####################### setUp ####################### */

function setUpDMA(){
with (document.formDoubleMenuDMA) {
if (menuSubjectsDMA.selectedIndex==0){
menuSubjectsDMA.options[0].selected=true
menuFilesDMA.options[0].selected=true
}

if (menuSubjectsDMA.selectedIndex==1)
MySubjectDMA0(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==2)
MySubjectDMA1(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==3)
MySubjectDMA2(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==4)
MySubjectDMA3(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==5)
MySubjectDMA4(menuFilesDMA)

}
}

/* ####################### changeFiles ####################### */

function changeFilesDMA(){
aMenu=document.formDoubleMenuDMA.menuSubjectsDMA
aMenu2=document.formDoubleMenuDMA.menuFilesDMA
with  (aMenu){

switch (selectedIndex) {
case 0:
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Pages appear here","none")
aMenu2.options[0].selected=true;
history.go(0)
break    
case 1:  
MySubjectDMA0(aMenu2)  
aMenu2.options[1].text="Maxi D Скопје"
break       
case 2:  
MySubjectDMA1(aMenu2)  
aMenu2.options[1].text="Maxi D Охрид"
break       
case 3:  
MySubjectDMA2(aMenu2)  
aMenu2.options[1].text="Maxi D Кавадарци"
break
   
/*
case 4:  
MySubjectDMA3(aMenu2)  
aMenu2.options[0].text="Style Sheet Subjects"
break       
case 5:  
MySubjectDMA4(aMenu2)  
aMenu2.options[0].text="PHP Subjects"
break       
*/
}
}

}


/* ####################### end of doublemenu code ####################### */



