/*  
This menu object is a default Dreamweaver script.  It was modified for extensibility
based upon recommendations by an article at adoble.com.
I also added a rollover script for the hovered images
Mark Merrick, 2006.10
*/
<!--
var time = 3000;      //not used
var numofitems = 8;   //the total number of menus
var menuYmin = 65;    //when the cursor leaves Ymin or Ymax the menus all disappear
var menuYmax = 260;   
var openMenu = false; //if no menus are open then don't close them. Also used to trick the page into leaving the People menu open on load for the home page


//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

//menu methods, closes all menus but the one you want open
function ehandler(event,theobj,myimg){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
    var origimg =eval("gimage"+i);
    simpleswap(origimg);
  }
  theobj.thediv.style.visibility="visible";
  simpleswap(myimg,'oversrc');  //swaps out the hovered image to a rollover
  openMenu = true;
}

//closes all the menus
function closesubnav(event){
  if ((openMenu)&&((event.clientY <menuYmin)||(event.clientY > menuYmax))){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
      shutdiv.style.visibility='hidden';
      var origimg =eval("gimage"+i);
      simpleswap(origimg);      
    }
  }
}

//swaps out images to a rollover provided they contain an origsrc and an oversrc custom attribute
function simpleswap(el,which){
        el.src=el.getAttribute(which||"origsrc");
}


// -->