/*************************************************************************
  This code does the layering for the content and higlights the default 
  link.
*************************************************************************/


var cur_lyr;       // holds id of currently visible layer

function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function clearLayer() {
   cur_lyr = false;
}

 

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

 

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

 

function getElemRefs(id) {
   var el = (document.getElementById)
               ? document.getElementById(id)
               : (document.all)
                     ? document.all[id]
                     : (document.layers)
                           ? getLyrRef(id,document)
                           : null;

   if (el) el.css = (el.style)? el.style: el;
   return el;
}

 

// get reference to nested layer for ns4

function getLyrRef(lyr,doc) {
   if (document.layers) {
   
      var theLyr;
      for (var i=0; i<doc.layers.length; i++) {
         theLyr = doc.layers[i];
         if (theLyr.name == lyr) return theLyr;
         else if (theLyr.document.layers.length > 0) 
         if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
         return theLyr;
      }
      return null;
   }
}

 

