//<![CDATA[
// Main Section Title Graphic
if(dir != null){
  document.write('<a href="/'+dir+'/"><img src="/images/leftnav_'+dir+'.gif" width="137" height="33" alt="" border="0" /></a><br />')
} else {
  document.write('<img src="/images/spacer.gif" width="137" height="33" alt="" border="0" class="orange" /><br />')
}


// find Active Section for left nav
  // SET PAGENAME (/DIR/FILENAME.HTML) & DIR IF AVAILABLE
    theURL = window.location.pathname;
    theSearch = window.location.search;
    // Has SUB Dir
    if(theURL.indexOf('/',1) != theURL.lastIndexOf('/')){
      //var dirPath = theURL.substring(theURL.indexOf('/',1)+1,theURL.lastIndexOf('/'))
      if(theURL.indexOf('.')!=-1){var pageName = theURL + theSearch //theURL.substring(theURL.lastIndexOf('/')+1,theURL.indexOf('.'))
      } else {var pageName = theURL + "index.html" + theSearch}}
    // DOES NOT Have SUB Dir
    else {//var dirPath = null;
    var pageName = theURL + theSearch} //theURL.substring(theURL.lastIndexOf('/')+1,theURL.indexOf('.'))


var activeSection = 0; var activeSubSection = 0; var file = pageName;
// Function to loop thru array and find filenames
function theLoop(which){
  for(fN=0;fN<eval("snav"+currentNav+".length");fN++){
  val = eval("snav"+currentNav+"[fN+2]")
    if(val == 0){ // Skip this one, as it's a "title"
      fN = fN + 3;
    } else if(file == val){
      activeSection = eval("snav"+currentNav+"[fN]")
      break;
    } else if(which == 1) {
    // If after the first time through, we run the loop again and see if there is a higher level folder,
    // ie: /dir/dir/file.html where file.html doesn't exist in Arrays
      if(file == val.substring(0,val.indexOf('.'))){
        activeSection = eval("snav"+currentNav+"[fN]")
        break;
      } else {
        if(eval("snav"+currentNav+"[fN+3]") == 1){fN = fN + 4}
        else {fN = fN + 3;}
      }
    } else {
      if(eval("snav"+currentNav+"[fN+3]") == 1){ // has subsub nav
      // find Active Sub Section
        for(fsN=0;fsN<eval("snav"+currentNav+"[fN+4]").length;fsN++){
        subval = eval("snav"+currentNav+"[fN+4][fsN+2]");
          if(file == subval){
            activeSection = eval("snav"+currentNav+"[fN]")
            activeSubSection = eval("snav"+currentNav+"[fN+4][fsN]")
            break;
          } else {
            fsN = fsN + +2;
          }
        }
        fN = fN + 4;
      } else { // has NO subsub nav
        fN = fN + 3;
      }
    }
  }
}
theLoop(0);
if(activeSection == 0){
  splitString = file.split('/')
  if((splitString.length -2) == 2){
    file = pageName.substring(0,pageName.lastIndexOf('/')+1) + "index"
  } else if((splitString.length -2) == 3){
    file = pageName.substring(0,pageName.lastIndexOf('/'))
    file = file.substring(0,file.lastIndexOf('/')+1) + "index"
  }
  theLoop(1)
}



if(currentNav != null){

document.write('<table width="137" cellspacing="0" cellpadding="0" border="0">')

// *** Added for Tools-Resource Protection section 8-25-05
		if(dir=="tools"){
			// Find Resource Protection section in nav.js
			for(k=0;k<eval("snav"+currentNav+".length");k++){
				if(eval("snav"+currentNav+"[k]") == "Resource Protection"){
					RPro = eval("snav"+currentNav+"[k-1]");
					break;
				}
			}
		}
		if(dir=="tools" && activeSection >= RPro && activeSection < (RPro+6)){
			for(x=0;x<eval("snav"+currentNav+".length");x++){
				if(eval("snav"+currentNav+"[x]") == RPro+1){break;}
			}
		} else { x = 0; }
// *************************************************

  for(x;x<eval("snav"+currentNav+".length");x++){

// *** Added for Tools-Resource Protection section 8-25-05
	if(dir == "tools" && (activeSection >= RPro && activeSection < (RPro+6))){
		if(eval("snav"+currentNav+"[x+3]") == 0 || eval("snav"+currentNav+"[x+3]") == 1){
			if(eval("snav"+currentNav+"[x]") > (RPro+5)) {break;}
		}
	}
// *************************************************

  // Section Title
    if(eval("snav"+currentNav+"[x+2]") == 0){
      document.write('<tr><td colspan="2" valign="middle" align="right" class="leftnavTitle">'+ eval("snav"+currentNav+"[x+1]") +'</td></tr>')
    }
  // Section Active
    else if(activeSection == eval("snav"+currentNav+"[x]") && activeSubSection == 0){
      document.write('<tr><td colspan="2" valign="middle" align="right" class="leftnavActive" onclick="window.location.href=\''+ eval("snav"+currentNav+"[x+2]")+'\'"><a href="'+ eval("snav"+currentNav+"[x+2]") +'">'+ eval("snav"+currentNav+"[x+1]") +'</a></td></tr>')
    }
  // Section Active with SubSection
    else if(activeSection == eval("snav"+currentNav+"[x]")){
      document.write('<tr><td colspan="2" valign="middle" align="right" class="leftnavOn" onclick="window.location.href=\''+ eval("snav"+currentNav+"[x+2]") +'\'"><a href="'+ eval("snav"+currentNav+"[x+2]") +'">'+ eval("snav"+currentNav+"[x+1]") +'</a></td></tr>')
    }
  // Section NOT active
    else {
      thisLink = eval("snav"+currentNav+"[x+2]")
      if(thisLink.indexOf("?")!=-1 && thisLink.indexOf("newwin")!=-1){ // Open in new window
        thisLink = thisLink.substring(0,thisLink.indexOf("?"))
        document.write('<tr><td colspan="2" valign="middle" align="right" onmouseover="this.className=\'leftnavOv\'" onmouseout="this.className=\'leftnav\'" class="leftnav" onclick="window.open(\''+ thisLink +'\',\'_blank\')"><a href="javascript:void(0);">'+ eval("snav"+currentNav+"[x+1]") +'</a></td></tr>')
      } else { // Open in Same Window
        document.write('<tr><td colspan="2" valign="middle" align="right" onmouseover="this.className=\'leftnavOv\'" onmouseout="this.className=\'leftnav\'" class="leftnav" onclick="window.location.href=\''+ eval("snav"+currentNav+"[x+2]") +'\'"><a href="'+ eval("snav"+currentNav+"[x+2]") +'">'+ eval("snav"+currentNav+"[x+1]") +'</a></td></tr>')
      }
    }

  // Dividing Lines
    if(activeSection - 1 == eval("snav"+currentNav+"[x]")){ // TOP Line above Active Section
      document.write('<tr><td colspan="2" class="leftnavOnBorderSolid"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')
    } else if(activeSection == eval("snav"+currentNav+"[x]") && eval("snav"+currentNav+"[x+3]") == 0){ // BOTTOM line below Active Section
      document.write('<tr><td colspan="2" class="leftnavOnBorderSolid"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')
    } else if(activeSection == eval("snav"+currentNav+"[x]") && eval("snav"+currentNav+"[x+3]") == 1){ // BOTTOM line below Active Section /w Sub
      document.write('<tr><td colspan="2" class="leftnavOnBorder"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')
    } else { // Normal Grey Line
      document.write('<tr><td colspan="2" class="leftnavBorder"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')
    }

    if(eval("snav"+currentNav+"[x+3]") == 0){// Section has no sub nav
      x = x + 3
    }

  // Section is active AND has sub nav
    else if(activeSection == eval("snav"+currentNav+"[x]")){
      for(s=0;s<eval("snav"+currentNav+"[x+4].length");s++){
        if(activeSubSection == eval("snav"+currentNav+"[x+4][s]")) {
          document.write('<tr><td valign="middle" align="right" class="leftsubnavActive" onclick="window.location.href=\''+ eval("snav"+currentNav+"[x+4][s+2]") +'\'"><a href="'+ eval("snav"+currentNav+"[x+4][s+2]") +'">'+ eval("snav"+currentNav+"[x+4][s+1]") +'</a></td><td class="leftsubnavArrowOn"><img src="/images/leftnav_bullet.gif" width="3" height="5" alt="" border="0" /></td></tr>')
        } else {
          sLink = eval("snav"+currentNav+"[x+4][s+2]")
          if(sLink.indexOf("?")!=-1 && sLink.indexOf("newwin")!=-1){ // Open in new window
            sLink = sLink.substring(0,sLink.indexOf("?"))
            document.write('<tr><td valign="middle" align="right" class="leftsubnav" onclick="window.open(\''+ sLink +'\',\'_blank\')"><a href="javascript:void(0);">'+ eval("snav"+currentNav+"[x+4][s+1]") +'</a></td><td class="leftsubnavArrowOff"><img src="/images/leftnav_bullet.gif" width="3" height="5" alt="" border="0" /></td></tr>')
          } else { // Open in Same Window
            document.write('<tr><td valign="middle" align="right" class="leftsubnav" onclick="window.location.href=\''+ sLink +'\'"><a href="'+ sLink +'">'+ eval("snav"+currentNav+"[x+4][s+1]") +'</a></td><td class="leftsubnavArrowOff"><img src="/images/leftnav_bullet.gif" width="3" height="5" alt="" border="0" /></td></tr>')
          }
        }
        s = s + 2;
      }



      document.write('<tr><td colspan="2" class="leftnavOnBorder"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')
      document.write('<tr><td colspan="2" class="leftnavOnBottom"><img src="/images/spacer.gif" width="1" height="1" alt="" border="0" /></td></tr>')

      x = x + 4
    } else {x = x + 4}
  }
document.write('</table>')
document.write('<img src="/images/leftnav_bottom.gif" width="137" height="11" alt="" border="0" />')
}


//]]>

