// JavaScript Document

// Browser Sniffing to send to correct page and/or stylesheet
// This is pretty ugly right now and will need to be cleaned up

b = navigator.userAgent;

// If you made it this far you get main index
// Now we have to give you the right style sheet for your particular
// browser
// Function to change styles and hide and show layers

// these are global variables used to remember what topic link on the 
// left was previosly highlighted, these are used later so when we mouse
// over a cell we don't have to change styles on all 16 of the cells, only
// the previous one which was white

pal = 'NONE';  // previous active link
pac = 'NONE';  // previous active cell



// function to change the background color of the table cells on the
// left and the text color when you mouseover
// this function is only called on mouseover so it needs to change the
// previous cell to plain background and change the cell just moused
// over to white

function ChangeStyles(pc,pl,x,tl,a,b) {

if (document.getElementById) {

   // if these variable are NONE it is the first time anything has
   // has been moused over in the page so we know these is no prevous
   // cell to unhighlight

   if (pc == "NONE" && pl == "NONE") {
   //       alert("executing if" + pc + " " + pl);
          var currentLink = document.getElementById(tl);
          var currentCell = document.getElementById(x);
          currentCell.style.background =  a; // highlight cell
          currentLink.style.color = b; // change text color

   } else {
//          alert("executing else" + pc + " " + pl);

// now we have to change styles of previously highlighted cell
// then change style of cell moused over
          
          var previousCell = document.getElementById(pc);
          var previousLink = document.getElementById(pl);
          previousCell.style.background = 'transparent';
          previousLink.style.color = "#FFFFFF";

          var currentLink = document.getElementById(tl);
          var currentCell = document.getElementById(x);
          currentCell.style.background =  a;
          currentLink.style.color = b;

   }
   // set gloabl variables to be current cell and link
   pac = x;
   pal = tl;


}

}



// Standard Dreamweaver Hide and Show Layers functions

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
