//

// code to show/hide rollover layers on OGCR level 2/3 pages

//

// variable currentsection must be set in main HTML file

// navborder layers must be set up to default positions in main file

//

//





// detect Netscape 4

var NS4 = (navigator.appName == "Netscape") && document.layers;

// another way

// NS4 = (navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4);



// variable records which main nav item is currently active

var navactive = "";



// timer for delayed hide

var timerid = null;



function navrollover(which, show) {

  if (show == false) {

    timerid = setTimeout("navrolloverhide()", 150); // last arg is delay in milliseconds

  }

  else {

    if (timerid != null) {  // clear timer if it's active

      clearTimeout (timerid);

      timerid = null;

    }

    var x = 181;

    if (which == "edinit")

      x = 181;

    else if (which == "comact")

      x = 285;

    else if (which == "ecimp")

      x = 389;

    else if (which == "evcamp")

      x = 493;

    else if (which == "govrel")

      x = 597;

    position_and_show("navborder1",x);

    position_and_show("navborder2",x+2);

    position_and_show("navborder3",x+2);

    position_and_show("navborder4",x+107);

    navactive = which;

  }

}



// hide currently displayed rollovers

function navrolloverhide() {

  navactive = "";

  if (currentsection == undefined || currentsection == "") {

    MM_showHideLayers('navborder1','','hide');

    MM_showHideLayers('navborder2','','hide');

    MM_showHideLayers('navborder3','','hide');

    MM_showHideLayers('navborder4','','hide');

  }

  else {

    var x = 181;

    if (currentsection == "edinit")

      x = 181;

    else if (currentsection == "comact")

      x = 285;

    else if (currentsection == "ecimp")

      x = 389;

    else if (currentsection == "evcamp")

      x = 493;

    else if (currentsection == "govrel")

      x = 597;

    position_and_show("navborder1",x);

    position_and_show("navborder2",x+2);

    position_and_show("navborder3",x+2);

    position_and_show("navborder4",x+107);

  }

}



// position (x only) and show a layer

//  used to move the green borders around

function position_and_show(menulayer, x) {

  var obj;

  if ((obj=MM_findObj(menulayer))!=null) {

    if (obj.style) { obj=obj.style; }

    var left = "" + x;

    if (!NS4)

      left = left + "px";

    obj.left = left;

    MM_showHideLayers(menulayer,'','show');

  }

}

