var jumpto ="http://applebitefarms.com/index.html"
var working;
var start;
var stop;
var msg;
var noteitint;
var CCtimer;
var working = location.href;
var n;
var ipint;

activeNav         = new Array();
activeNav[0]      = "base";
activeNav[1]      = "homepage";
activeNav[2]      = "photosS";
activeNav[3]      = "slideshows1";
for (n=4;n<=20;n++)
    {
    activeNav[n] = "";
    }
                                                               //monthlookup[0] == "Jan"
function checkframing(indparam)       //indparam is obsolete but most pages make it XindexR.html
{
//location.href = location.href.replace(/applebite.com/,"applebitefarms.com");

//if ((parent.parent.stat) || (parent.stat)) //does not need reframing
//   {
//   noteitint=setInterval("delayednoteit();",100);            //if get here before stat loads
//   }
//else
//   {
   start=working.indexOf("/",7) + 1;              //skips over ISP name, points to subdirectory and/or file name
   stop=working.length;
   location.href=jumpto + "?referrer=" + document.referrer + "?url=XindexR.htm?url=" + working.substring(start,stop);
//   }

changecolor(); 
buildmenu(); 
status = ""; 
ipint = setInterval("checkipload();",200);
}

function checkipload()
{
if (parent.parent.parent.echoiploaded != "yes") {return;}
clearInterval(ipint);
//if (parent.parent.echoip.ipform.IP.value == "63.249.88.143")
//   {
     resetDivisions();
//   }
}

function resetDivisions()
{
return;
var skip = false;
var numbertemp = 0;
thiswidth = screen.availWidth;
dontAdjust = new Array("base","homepage","stallions","services","photos","library","photosS","featured","racesales","sales","slideshows","slideshows1","ctbaarticle","ownerbreeder","ctbamag","featvideos","departed")
adj = thiswidth - 1024;
if (adj == 0) {adj = 1;}
theDivs = new Array();
theDivs= document.getElementsByTagName("div");
for (i=0;i<theDivs.length;i++)
     {
     for (j=0;j<dontAdjust.length;j++) 
         {
         if (theDivs[i].id == dontAdjust[j])
            {
            skip = true;
            }
         }
     if (!skip)
        {
        //alert(theDivs[i].id + " | " + theDivs[i].style.left + " | " + theDivs[i].style.width);
        if (thiswidth > 1024)
            {
            theDivs[i].style.left = ((theDivs[i].style.left.replace('px',"") * 1) + (thiswidth - 1024)/2)  + "px";
            //theDivs[i].style.width = Math.round(theDivs[i].style.width.replace('px',"") * adj) + "px";
            //alert(theDivs[i].id + " | " + theDivs[i].style.left + " | " + theDivs[i].style.width);
            }
        }
     else
        {skip = false;
        }
     }
}

   
function checkframingnavinf(url)                                   //unframed nav or inf file
{
if((!parent.text))      
   {
   if (working.indexOf("editSite.pl") == -1)
      {parent.location.href=jumpto + "?url=" + url; }
   }
changecolor();
}

function delayednoteit()
{
if (parent.parent.statloaded == "yes") 
  {
  clearInterval(noteitint);
  parent.parent.stat.noteit(location.href);
  }
}

function changecolor()
{
document.body.style.backgroundColor=parent.parent.color;
}

function changecolorIframe()
{
document.body.style.backgroundColor=parent.parent.parent.color;
}

function buildindfile(nav,inf,text)                    //used by indfiles only
{
if (!parent.stat)
   {
   start = working.indexOf("/",7) + 1;           //looks like http://www.mindspring.com/indstal.htm
   location.href=jumpto + "?url=" + working.substring(start,location.href.length);
   }
else
   {                                    
   msg = "<HTML><HEAD><TITLE>Applebite Farms</TITLE></head>";
   msg += "<FRAMESET COLS=\"170,*\" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>\n";   
   msg += "<FRAMESET ROWS=\"355,*\" FRAMEBORDER=0 FRAMESPACING=0 BORDER=0>\n";   
   msg += "<FRAME SRC=\"";
   msg += nav;
   msg += "\"  name=\"navig\" MARGINHEIGHT=0 MARGINWIDTH=0>\n";  
   msg += "<FRAME SRC=\"";
   msg += inf;
   msg += "\"  name=\"info\"  MARGINHEIGHT=0 MARGINWIDTH=0>\n";  
   msg += "</FRAMESET> <FRAME SRC=\"";
   msg += text;
   msg += "\" name=\"text\"  MARGINHEIGHT=0 MARGINWIDTH=0>\n";
   msg += "</FRAMESET></HTML>";
   document.write(msg);
   document.close();
   }

} 

function switchNav(level,whichNav)

{
if (whichNav.length == 0) return;
if (whichNav == "activeNav") {whichNav = activeNav[level];}
if (navigator.appName.indexOf("Microsoft")>=0)
   {
   eval(activeNav[level]).style.visibility="hidden";
   eval(whichNav).style.visibility="visible";
   }
else
   {
   document.getElementById(activeNav[level]).style.visibility="hidden";
   document.getElementById(whichNav).style.visibility="visible";
   }
activeNav[level]=whichNav;
}

function hideNav(level,whichNav)

{
if (whichNav.length == 0) return;
if (whichNav == "activeNav") {whichNav = activeNav[level];}
if (navigator.appName.indexOf("Microsoft")>=0)
   {
   eval(whichNav).style.visibility="hidden";
   }
else
   {
   document.getElementById(whichNav).style.visibility="hidden";
   }
//activeNav[level]=whichNav;
} 

function showNav(level,whichNav)

{
if (whichNav.length == 0) return;
if (whichNav == "activeNav") {whichNav = activeNav[level];}
if (navigator.appName.indexOf("Microsoft")>=0)
   {
   eval(whichNav).style.visibility="visible";
   }
else
   {
   document.getElementById(whichNav).style.visibility="visible";
   }
activeNav[level]=whichNav;
}  

  

function sleep(gap)

{var then,now; 
then=new Date().getTime();
now=then;
while((now-then)<gap)
     {now=new Date().getTime();
     }
}


var i,j,k,l;
var numSteps      = 17;
var whichsequence = 0;
           //sequence number  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                 
sequence0         = new Array(0,0,3,4,5,6,6,1,2,3, 2, 3, 1, 2, 2, 2, 4);  //These are the column numbers the items fit into
sequence1         = new Array(0,0,2,3,1,4,2,5,2,4,2,4);  

if (navigator.appName.indexOf("Microsoft")>=0)
   {
   var menuBlockAdj   = 0;
   var borderstyle    = "outset";
   var menuheight     = 20;
   var menuwidth     = 120;

   }
else
   {
   var menuBlockAdj   = 2;
   var borderstyle    = "outset";
   var menuheight     = 20; 
   var menuwidth      = 118;
   }


var leftOp;
var jindex;
var holdpointer  = "";
var NavText      = "";
                       //The contents section  1 through 5 are first level, 6 through 10 are second level,
                       //                      11 is third level full screen,  12 is second level full screen
var entries0   = 7;
var divID0     = "base";      
var pointers0  = new Array("homepage",    "featured",    "racesales",          "bstock",          "services",   "photos",       "library");
var indexes0   = new Array("Xfront",      "featured",    "Racing/racingnews",  "racestal",        "services",   "photos",       "library");
var titles0    = new Array("Front Page",  "Featured",    "Racing & Sales",     "Breeding stock",  "Services",   "Photography",  "Media Library");

var entries1   = 7;
var divID1     = "homepage";
var pointers1  = new Array("","","","ctbaarticle","","","");
var indexes1   = new Array("contact",     "home",              "searchtheweb",    "backgrou",     "panorama",   "employment",   "exit");
var titles1    = new Array("Contact us", "Our Management",     "Search Engine",   "About Us",     "Panoramas",  "Employment",   "Visit and contacts");

var entries2   = 7;
var divID2     = "bstock";
var pointers2  = new Array("","","","","","","departed");
var indexes2   = new Array("racestal",         "maresweb",    "gothamcity",    "jetwest",   "spineless",          "westerfa",      "departed");
var titles2    = new Array("Stallion summary", "Mares",       "Gotham City",   "Jet West",  "Spinelessjellyfish", "Western Fame",  "Departed");

var entries3   = 5;
var divID3     = "services";
var pointers3  = new Array("","","", "","");
var indexes3   = new Array("services", "stallser",    "layups",   "layups.htm#fees", "training");
var titles3    = new Array("Services", "Stallions",   "Layups",   "Fee Schedule",    "Training");


var entries4   = 4;
var divID4     = "photos";
var pointers4  = new Array("","","","photosS");
var indexes4   = new Array("indnewbabies",     "agallery",      "ownerviewer",    "photos");
var titles4    = new Array("Baby Pictures",    "Aerial Photos", "Owner's Photos", "Stallion's Babies");

var entries5   = 6;
var divID5     = "library";
var pointers5  = new Array("","","", "","","");       
var indexes5   = new Array("abfnews",                "technews1",       "Materials/materials",       "webpocket",         "library.htm#stallion",  "library.htm#available");
var titles5    = new Array("Applebite News",         "Technical News",  "Materials by mail",         "WebPocket Guide",   "Pedigree Pages",        "WebStallion Video");

                                 // second level

var entries6   = 5;
var divID6     = "photosS";
var pointers6  = new Array("","","","");
var indexes6   = new Array("asviewer",        "chulloviewer",    "gcviewer",    "JWbabies",  "wfviewer");
var titles6    = new Array("America's Storm", "Chullo",          "Gotham City", "Jet West",   "Western Fame");

var entries7   = 8;
var divID7     = "featured";
var pointers7  = new Array("featvideos",     "slideshows",       "ctbamag",         "ownerbreeder","","","","");
var indexes7   = new Array("featuredvideos", "slideshowsintro",  "CTBA",            "ownerbreeder",      "colors",      "uploadwrap",     "uploadwrap.htm#selectgallery",       parent.parent.featured + "/thumbnail1");
var titles7    = new Array("Featured Videos","Slide Shows",      "CTBA Magazine",   "Owner Breeder",     "Colors used",  "Art Galleries", "Change Gallery",                     parent.parent.featured);

var entries8   = 3;
var divID8     = "racesales";
var pointers8  = new Array("","","sales");
var indexes8   = new Array("Racing/monitor",   "Racing/racingnews",   "barretts2005");
var titles8    = new Array("Racing Monitor",   "Racing News",         "Sales");

var entries9   = 5;
var divID9     = "sales";
var pointers9  = new Array("","","","","");
var indexes9   = new Array("barrettsOct2006Yearlings",     "yearlings2005",     "barretts2005",     "SalesYearlings2004/barretts2004",  "Barretts-Oct03-photos/viewer");
var titles9    = new Array("Barretts 2006",                "Barretts 2005 Mix", "Barretts 2005",    "Barretts 2004",                    "Barretts 2003");

var entries10  = 5;
var divID10    = "slideshows";
var pointers10 = new Array("","","slideshows1","","");
var indexes10  = new Array("gallery",   "maidens",          "slideshows",    "SalesYearlings2004/barretts-web-4a",  "Keeneland/KeenelandA"  );
var titles10   = new Array("Farm Tour", "Maiden Winners",   "New Babies",    "Barretts",                            "Keeneland"             );

var entries11  = 1;
var divID11    = "slideshows1";
var pointers11 = new Array("");
var indexes11  = new Array("newbabies54-web");
var titles11   = new Array("Babies Apr");

var entries12  = 1;
var divID12    = "ctbaarticle";
var pointers12 = new Array("");
var indexes12  = new Array("CTBAarticle/launcher.htm?url=CTBAarticle-page1");
var titles12   = new Array("CTBA Articles");

var entries13  = 2;
var divID13    = "ownerbreeder";
var pointers13 = new Array("","");
var indexes13  = new Array("CTBAarticle/launcher.htm?url=owner-breeder-chullo", "CTBAarticle/launcher.htm?url=owner-breeder-westernfame");
var titles13   = new Array("Chullo",                                            "Western Fame");

var entries14  = 2;
var divID14    = "ctbamag";
var pointers14 = new Array("","");
var indexes14  = new Array("CTBAmagazine.htm?url=/CTBAmagazine/Jetinwith_Kennedy_p1", "CTBAmagazine.htm?url=/CTBAmagazine/Eurociser");
var titles14   = new Array("Broodmare of year",                                       "Eurociser   ");

var entries15  = 2;
var divID15    = "featvideos";
var pointers15 = new Array("","");
var indexes15  = new Array("VideoClips","rmvideo.htm?title=Jetinwith+Kennedy+CTBA+Broodmare+of+the+year&url=JetinwithKennedy&theater=&goto=CTBAmagazine.htm?url=/CTBAmagazine/Jetinwith_Kennedy_p1.htm&gotitle=See+CTBA+article&width=640&height=480");
var titles15   = new Array("Winners","Broodmare of year");

var entries16  = 7;
var divID16    = "departed";
var pointers16 = new Array("","","","","","","");
var indexes16  = new Array("astorm",           "chullo","compel",          "dcat",           "gentlemen",   "rainbow",        "undercaution");
var titles16   = new Array("America's Storm",  "Chullo","Compelling Sound","Distinctive Cat","Gentlemen",   "Rainbow Blues",  "Under Caution");

                                           //The positions section

var DIVhead0   = "\"<DIV ID=\" + makeSingleVar('divID',i)  + \" style='position:absolute;z-index:1;top:\" + makeSingleVar('divtop',i) + \"px;left:\" + makeSingleVar('divleft',i) + \"px;width:\" + makeSingleVar('divwidth',i) + \"px;height:\" + makeSingleVar('divheight',i) + \"px;'  onMouseOut=\\\"hideNav(1,'activeNav'); hideNav(2,'activeNav');\\\"  ><table cellspacing=0 cellpadding=0><tr>\"";
var DIVtail0   = "\"</tr></table></DIV>\"";
var line0      = "\"<td bgcolor=#888888 width=\" + menuwidth + \"><a style='border-width:1px;border-style:\" + borderstyle + \";display:block;z-index:0;width:\" + menuwidth + \"px;height:\" + menuheight + \"' href='\" + makeDoubleVar('indexes',i,j) + \"'  onMouseOver=switchNav(1,'\" + makeDoubleVar('pointers',i,j) + \"');  target=text>\" + makeDoubleVar('titles',i,j) + \"</a></td>\"";
var divheight0 = menuheight + menuBlockAdj;
var divtop0    = 0;
var divleft0   = menuwidth * makeDoubleVar('sequence',whichsequence,0);
var divwidth0  = entries0 * menuwidth;

var DIVhead1   = "\"<DIV ID=\" + makeSingleVar('divID',i)  + \" style='position:absolute;visibility:hidden;top:\" + makeSingleVar('divtop',i) + \"px;left:\" + makeSingleVar('divleft',i) + \"px;width:\" + makeSingleVar('divwidth',i) + \"px;height:\" + makeSingleVar('divheight',i) + \"px;' onMouseOver = switchNav(1,'\" + makeSingleVar('divID',i) + \"');  onMouseOut = \\\"hideNav(1,'\" + makeSingleVar('divID',i)  +  \"'); hideNav(2,'activeNav');\\\" > \" ";
var DIVtail1   = "\"</DIV>\""; 
var line1      = "\"<table cellspacing=0 cellpadding=0><tr><td bgcolor=#888888 width=\" + menuwidth + \"><a style='border-width:1px;border-style:\" + borderstyle + \";display:block;width:\" + menuwidth + \"px;height:\" + menuheight + \"' href='\" + makeDoubleVar('indexes',i,j) + \"' onMouseOver=showNav(2,'\" + makeDoubleVar('pointers',i,j) + \"');  target=text>\" + makeDoubleVar('titles',i,j) + \"</a></td></tr></table>\" ";
var divheight1 = entries1 * menuheight;
var divtop1    = menuheight + menuBlockAdj;
var divleft1   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,1);
var divwidth1  = (menuwidth + menuBlockAdj) ;

var DIVhead2   = DIVhead1;
var DIVtail2   = DIVtail1; 
var line2      = line1;
var divheight2 = entries2 * menuheight;
var divtop2    = menuheight  + menuBlockAdj;
var divleft2   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,2);
var divwidth2  = (menuwidth + menuBlockAdj) ;

var DIVhead3   = DIVhead1;
var DIVtail3   = DIVtail1;
var line3      = line1;	
var divheight3 = entries3 * menuheight;
var divtop3    = menuheight  + menuBlockAdj;
var divleft3   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,3);
var divwidth3  = (menuwidth + menuBlockAdj) ;

var DIVhead4   = DIVhead1;
var DIVtail4   = DIVtail1;
var line4      = line1;	
var divheight4 = entries4 * menuheight;
var divtop4    = menuheight  + menuBlockAdj;
var divleft4   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,4);
var divwidth4  = (menuwidth + menuBlockAdj) ;

var DIVhead5   = DIVhead1;
var DIVtail5   = DIVtail1;
var line5      = line1;	
var divheight5 = entries5 * menuheight;
var divtop5    = menuheight  + menuBlockAdj;
var divleft5   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,5);
var divwidth5  = (menuwidth + menuBlockAdj) ;

var DIVhead6   = "\"<DIV ID=\" + makeSingleVar('divID',i)  + \" style='position:absolute;z-index:1;visibility:hidden;top:\" + makeSingleVar('divtop',i) + \"px;left:\" + makeSingleVar('divleft',i) + \"px;width:\" + makeSingleVar('divwidth',i) + \"px;height:\" + makeSingleVar('divheight',i) + \"px;'>\" ";
var DIVtail6   = DIVtail1;
var line6      = "\"<table cellspacing=0 cellpadding=0><tr><td bgcolor=#888888 width=\" + menuwidth + \"><a style='border-width:1px;border-style:\" + borderstyle + \";display:block;z-index:0;width:\" + menuwidth + \"px;height:\" + menuheight + \"' href='\" + makeDoubleVar('indexes',i,j) + \"'  onMouseOver=\\\"showNav(1,'activeNav'); showNav(2,'activeNav'); onMouseOver=showNav(3,'\" + makeDoubleVar('pointers',i,j) + \"'); \\\"  onMouseOut=\\\"hideNav(1,'activeNav'); hideNav(2,'activeNav'); hideNav(3,'activeNav');\\\" target=text>\" + makeDoubleVar('titles',i,j) + \"</a></td></tr></table>\" ";	
var divheight6 = entries6 * menuheight;
var divtop6    = (menuheight + menuBlockAdj) * 4;
var divleft6   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,6);
var divwidth6  = (menuwidth + menuBlockAdj) ;

var DIVhead7   = DIVhead1;
var DIVtail7   = DIVtail1;
var line7      = line1;	
var divheight7 = entries7 * menuheight;
var divtop7    = menuheight  + menuBlockAdj;
var divleft7   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,7);
var divwidth7  = (menuwidth + menuBlockAdj) ;

var DIVhead8   = DIVhead1;
var DIVtail8   = DIVtail1;
var line8      = line1;	
var divheight8 = entries8 * menuheight;
var divtop8    = menuheight  + menuBlockAdj;
var divleft8   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,8);
var divwidth8  = (menuwidth + menuBlockAdj) ;

var DIVhead9   = DIVhead6;
var DIVtail9   = DIVtail1;
var line9      = line6;	
var divheight9 = entries9 * menuheight;
var divtop9    = (menuheight + menuBlockAdj)* 3;
var divleft9   = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,9);
var divwidth9  = (menuwidth + menuBlockAdj) ;

var DIVhead10  = DIVhead6;
var DIVtail10  = DIVtail1;
var line10     = line6;	
var divheight10= entries10 * menuheight;
var divtop10   = (menuheight + menuBlockAdj) *2 ;
var divleft10  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,10);
var divwidth10 = (menuwidth + menuBlockAdj) ;

var DIVhead11  = "\"<DIV ID=\" + makeSingleVar('divID',i)  + \" style='position:absolute;z-index:1;visibility:hidden;top:\" + makeSingleVar('divtop',i) + \"px;left:\" + makeSingleVar('divleft',i) + \"px;width:\" + makeSingleVar('divwidth',i) + \"px;height:\" + makeSingleVar('divheight',i) + \"px;'>\" ";
var DIVtail11  = DIVtail1;
var line11     = "\"<table cellspacing=0 cellpadding=0><tr><td bgcolor=#888888 width=\" + menuwidth + \"><a style='border-width:1px;border-style:\" + borderstyle + \";display:block;z-index:0;width:\" + menuwidth + \"px;height:\" + menuheight + \"' href='\" + makeDoubleVar('indexes',i,j) + \"'  onMouseOver=\\\"showNav(1,'activeNav'); showNav(2,'activeNav'); showNav(3,'activeNav');\\\"  onMouseOut=\\\"hideNav(1,'activeNav'); hideNav(2,'activeNav'); hideNav(3,'activeNav');\\\">\" + makeDoubleVar('titles',i,j) + \"</a></td></tr></table>\" ";	
var divheight11= entries11 * menuheight;
var divtop11   = (menuheight + menuBlockAdj) * 4;
var divleft11  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,11);
var divwidth11 = (menuwidth + menuBlockAdj) ;

var DIVhead12  = DIVhead6;
var DIVtail12  = DIVtail1;
var line12     = "\"<table cellspacing=0 cellpadding=0><tr><td bgcolor=#888888 width=\" + menuwidth + \"><a style='border-width:1px;border-style:\" + borderstyle + \";display:block;z-index:0;width:\" + menuwidth + \"px;height:\" + menuheight + \"' href='\" + makeDoubleVar('indexes',i,j) + \"'  onMouseOver=\\\"showNav(1,'activeNav'); showNav(2,'activeNav'); onMouseOver=showNav(3,'\" + makeDoubleVar('pointers',i,j) + \"'); \\\"  onMouseOut=\\\"hideNav(1,'activeNav'); hideNav(2,'activeNav'); hideNav(3,'activeNav');\\\" target=invisible>\" + makeDoubleVar('titles',i,j) + \"</a></td></tr></table>\" ";	
var divheight12= entries12 * menuheight;
var divtop12   = (menuheight + menuBlockAdj) *4;
var divleft12  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,12);
var divwidth12 = (menuwidth + menuBlockAdj) ;

var DIVhead13  = DIVhead6;
var DIVtail13  = DIVtail1;
var line13     = line12;
var divheight13= entries13 * menuheight;
var divtop13   = (menuheight + menuBlockAdj) *4;
var divleft13  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,13);
var divwidth13 = (menuwidth + menuBlockAdj) ;

var DIVhead14  = DIVhead6;
var DIVtail14  = DIVtail1;
var line14     = line6;
var divheight14= entries14 * menuheight;
var divtop14   = (menuheight + menuBlockAdj) *3;
var divleft14  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,14);
var divwidth14 = (menuwidth + menuBlockAdj) ;

var DIVhead15  = DIVhead6;
var DIVtail15  = DIVtail1;
var line15     = line6;
var divheight15= entries15 * menuheight;
var divtop15   = (menuheight + menuBlockAdj) *1;
var divleft15  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,15);
var divwidth15 = (menuwidth + menuBlockAdj) ;

var DIVhead16  = DIVhead6;
var DIVtail16  = DIVtail1;
var line16     = line6;
var divheight16= entries16 * menuheight;
var divtop16   = (menuheight + menuBlockAdj) *7;
var divleft16  = (menuwidth + menuBlockAdj) * makeDoubleVar('sequence',whichsequence,16);
var divwidth16 = (menuwidth + menuBlockAdj) ;




function buildmenu()
{

for(i=0;i<numSteps;i++)
    {
     NavText = NavText + eval(makeSingleVar('DIVhead',i));
     jindex = makeSingleVar('entries',i);
     for(j=0;j<jindex;j++)
        {
        leftOp = makeSingleVar('line',i);
        //alert("step" + i + "line" + j + " = " + eval(leftOp)); 
        NavText = NavText + eval(leftOp);
        }
     NavText = NavText + eval(makeSingleVar('DIVtail',i));
     }
document.getElementById('navBar').innerHTML = "<span><P>"  + NavText  + "</span>";
}

function makeSingleVar(name,row)

{
var temp = eval(name + row);
//if (name == 'entries') {alert(name + " | " + row + " | " + temp);}
return temp;
}

function makeDoubleVar(name,row,index)

{
var temp = eval(name + row)[index];
//if (name == 'pointers') {alert(name + " | " + row + " | " + index + " | " + temp);}

if(name.indexOf("indexes") != -1)
  {if (temp.indexOf("#") == -1)
       {temp = temp + ".htm";
       }
  temp = "/" + temp ; //accomodates Rahul.net addressing convention
  }
return temp;
}

var oldypos=0;
var newypos=0;
var origincr=5;
var incr=5;
var actualypos=0;
var active;
var intmoveit;
var linkPos = 0;
var scrollPos = 0;


function scrollit(loca)
{
newypos = loca;

if ((newypos - actualypos) < 0)
   {
   incr = -origincr;
   }
else
   {
   incr= origincr;
   }
if (Math.abs(newypos - actualypos) > Math.abs(incr) )
   {
   intmoveit=setInterval("moveit();",50);
   }
}


function moveit()

{
parent.text.scrollTo(0,actualypos);  
if ( Math.abs(newypos - actualypos) <= Math.abs(incr) )
   {
   clearInterval(intmoveit);
   //alert(newypos + " | " + actualypos + " | " + incr);
   actualypos=newypos;
   }
else
  {actualypos += incr + Math.floor( (newypos - actualypos)/10);
  }
}

function clearit()

{
clearInterval(intmoveit);
}


function startup()

{
movelinks();
sleep(250);
actualypos = scrollPos;
setInterval("movelinks();",50);
}

function movelinks()
{
if (navigator.appName.indexOf("Microsoft")>=0)
   {
   scrollPos= document.body.scrollTop;
   }
else
   {
   scrollPos = window.pageYOffset;
   }
linksNewTop = scrollPos + linkPos;
if (navigator.appName.indexOf("Microsoft")>=0)
   {
   pagelinks.style.top=scrollPos + linkPos;
   }
else
   {
   document.getElementById('pagelinks').style.top=scrollPos + linkPos;
   }
//document.getElementById('report').innerHTML = "<span>scrollPos: " + scrollPos + "</span>";
}

var agt = navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win)
   {
   pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") 
   + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") 
   + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") 
   + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win)
   {
   nse = ""; 
   for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
   pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") 
   + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") 
   + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") 
   + detectNS("application/pdf","Acrobat Reader");
   }

function detectIE(ClassID,name)  
{
result = false; 
document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return '';
}

function detectNS(ClassID,name)
{
n = ""; 
if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
}

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//SAMPLE USAGE- detect "Flash"
//if (pluginlist.indexOf("Flash")!=-1)
//document.write("You have flash installed")

