//check browser type
var NN4 = document.layers? true : false; //Netscape Navigator 4.x.
var IE4 = document.all? true : false; // IE version 4 and above.
var W3C = document.getElementById? true : false; // Modern W3C browser

// function to hide layer
function hideLayer(LayerName) {
  if (W3C) {
    // it's a modern browser
    document.getElementById(LayerName).style.visibility = "hidden";
  }
  else if (IE4) {
    // IE 4 and above
    document.all[LayerName].style.visibility = "hidden";
  }
  else {
    // NN 4.x
    document.layers[LayerName].visibility = "hidden";
  }
}

// function to show layer
function showLayer(LayerName) {
  hideLayer(LayerName);
  if (W3C) {
    // it's a modern browser
    document.getElementById(LayerName).style.visibility = "visible";
  }
  else if (IE4) {
    // IE 4 and above
    document.all[LayerName].style.visibility = "visible";
  }
  else {
    // NN 4.x
    document.layers[LayerName].visibility = "show";
  }
}
