//--------------------------------------------------
//  NAV
//--------------------------------------------------

    tab_1_off = new Image();
    tab_1_off.src = "../CompanyEndsleigh/tab_1_off.gif";
    tab_1_on = new Image();
    tab_1_on.src = "../CompanyEndsleigh/tab_1_on.gif";
    
    tab_2_off = new Image();
    tab_2_off.src = "../CompanyEndsleigh/tab_2_off.gif";
    tab_2_on = new Image();
    tab_2_on.src = "../CompanyEndsleigh/tab_2_on.gif";
    
    tab_3_off = new Image();
    tab_3_off.src = "../CompanyEndsleigh/tab_3_off.gif";
    tab_3_on = new Image();
    tab_3_on.src = "../CompanyEndsleigh/tab_3_on.gif";
    
    tab_4_off = new Image();
    tab_4_off.src = "../CompanyEndsleigh/tab_4_off.gif";
    tab_4_on = new Image();
    tab_4_on.src = "../CompanyEndsleigh/tab_4_on.gif";
    
    tab_5_off = new Image();
    tab_5_off.src = "../CompanyEndsleigh/tab_5_off.gif";
    tab_5_on = new Image();
    tab_5_on.src = "../CompanyEndsleigh/tab_5_on.gif";
    
    tab_6_off = new Image();
    tab_6_off.src = "../CompanyEndsleigh/tab_6_off.gif";
    tab_6_on = new Image();
    tab_6_on.src = "../CompanyEndsleigh/tab_6_on.gif";
    
    
function startup(whichNav) {
    //This is required to reset the nav when the back buttong has been pressed
    //Without this two div and two rollovers will be present
    for (d=1; d<7; d++){
      document.getElementById('subNav_'+d).style.visibility = 'hidden';
      imageObject = eval("tab_" + d + "_off");
      document.images["tab_" + d].src = imageObject.src;
    }
    //The display the correct rollover and div for the page.
    showMenuDiv(whichNav,1); //show a div on page load (and init with a fresh value of 1)
}

function showMenuDiv(id,fresh) {
  if (fresh==1) {
    DIVMenuprevId = 1;
  }
  if (typeof(DIVMenuprevId) != "undefined") {
    if (DIVMenuprevId != id && DIVMenuprevId){
      document.getElementById('subNav_'+DIVMenuprevId).style.visibility = 'hidden';
    }
    document.getElementById('subNav_'+id).style.visibility = 'visible';
    //lowlight the previous tab if it exists
    if (DIVMenuprevId != id && DIVMenuprevId){
      imageObjectOff = eval("tab_" + DIVMenuprevId + "_off");
      document.images["tab_" + DIVMenuprevId].src = imageObjectOff.src;
    }
    //highlight the new tab
    imageObject = eval("tab_" + id + "_on");
    document.images["tab_" + id].src = imageObject.src;
    DIVMenuprevId = id
  }

}



//--------------------------------------------------
//  END NAV
//--------------------------------------------------





