// catch and disregard script errors
/*onerror=handleerror; 
function handleerror() {
  return true;
}*/

// define show/hide layer functions
function showDiv( divID ) {
  if( document.layers ) {
    thisDiv = eval( 'document.' + divID );
	thisDiv.visibility = "show";
  }
	else if( document.all ) {
	  thisDiv = eval( divID + '.style' );
	  thisDiv.visibility = "visible";
	}
	else if( document.getElementById ) {
	  thisDiv = document.getElementById( divID );
	  thisDiv.style.visibility = "visible";
	}
}

function hideDiv( divID ) {
  if( document.layers ) {
    thisDiv = eval( 'document.' + divID );
	thisDiv.visibility = "hide";
  }
  else if( document.all ) {
	  thisDiv = eval( divID + '.style' );
	  thisDiv.visibility = "hidden";
	}
	else if( document.getElementById ) {
	  thisDiv = document.getElementById( divID );
	  thisDiv.style.visibility = "hidden";
	} 
}


// This function requires the list of menu div names, cause we don't want to hide all div's in case some are used for things apart from the nav menu
var menuDivIDs = [ 'tech', 'specs', 'meet', 'memb', 'osta' ];

function menuHideAll() {
  for( i = 0; i < menuDivIDs.length; i++ ) {
		hideDiv( menuDivIDs[i] );
	}
}

// function to determine where an event is coming from/going to
function containsNN6 (container, containee) {
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
      containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

// netscape 4 onmouseout handler
if( document.layers ) {
  document.captureEvents(Event.MOUSEOUT);
  document.onMouseOut = handleMouseOut;
  function handleMouseOut( e ) {
    if( e.target.name=='tech' || e.target.name=='specs' || e.target.name=='meet' || e.target.name=='memb' || e.target.name=='osta')
	  hideDiv(e.target.name);
	else// pass the onmouseout event on
 	  routeEvent( e );
  }
}
