function toggleImg()
  {
    newsrc = imgpath + this.dept + ((this.state)?"_over" : "") + ".gif";
    this.navimg.src = newsrc
    this.state= !this.state
  }



if (document.getElementById)
  {
    var navdiv = document.getElementById("mainnav");
    var navlinks = navdiv.getElementsByTagName("A");
    for (lx = 0; lx < navlinks.length; lx ++)
      {
        if (navlinks[lx].id != thislink)
          {
            navlinks[lx].dept = navlinks[lx].id.split("_")[1];
            navlinks[lx].navimg = document.getElementById(navlinks[lx].dept)
            navlinks[lx].state = true;
            navlinks[lx].onmouseover = toggleImg;
            navlinks[lx].onmouseout = toggleImg;          
          }      
      }
  }

var daughter = false     
var daughter2 = false//used for the close window function
 
function popwindow(theURL,thewidth,theheight){
   leftpos=0
    if (screen) {
    leftpos = screen.width-(thewidth+20)}
     newWindow = window.open(theURL,"demo","width=" + thewidth + ",height=" + theheight + ",scrollbars=yes,resizable=yes,left="+leftpos);
    newWindow.focus(); 
    daughter = true;
    }
 function popnoscroll(theURL,thewidth,theheight){
   leftpos=0
    if (screen) {
    leftpos = screen.width-(thewidth+20)}
     newWindow2 = window.open(theURL,"demo2","width=" + thewidth + ",height=" + theheight + ",scrollbars=no,resizable=yes,left="+leftpos);
    newWindow2.focus(); 
    daughter2 = true;
    }  

//----------------------------------------------------------------------------
//togglelayer shows or hides an object based on the display property (not visibility)
//it will detect the kind element it is and therefore the cross-browser method of hiding or showing the object.
//----------------------------------------------------------------------------
function togglelayer(divid,override)
{
   var myobj = document.getElementById(divid);
   if(!myobj) { window.status="[fn togglelayer] Problem! Could find element with ID '"+divid+"' to toggle."; return; }
   var mytagname = myobj.tagName
   //get the proper display style value, depending on element and browser
   //use self.innerHeight, which IE doesn't support, to determine block or table style
   switch (mytagname)
   {
      case 'DIV': { var  showstyle = "block"; break; }
      case 'SPAN': { var  showstyle = "inline"; break; }
      case 'I': { var  showstyle = "inline"; break; }
      case 'P': { var  showstyle = "block"; break; }
      case 'TABLE': { var  showstyle = self.innerHeight ? "table" : "block"; break; }
      case 'TR': { var  showstyle = self.innerHeight ? "table-row" : "block"; break; }
      case 'TD': { var  showstyle = self.innerHeight ? "table-cell" : "block"; break; }
      default: { var  showstyle = "block"; break; }
   }
   if(override == 1) { myobj.style.display = showstyle; return;}
   if(override == 0) { myobj.style.display = "none"; return;}
   if ((myobj.style.display == showstyle)||(myobj.style.display=="")||(myobj.style.display==null)) { myobj.style.display = "none"; }
   else { myobj.style.display = showstyle; }
}