function toggleLayer(whichLayer,button)
{
  if (document.getElementById)
  {
    // this is the way the standards work
    var style2 = document.getElementById(whichLayer).style;
    var button = document.getElementById(button);
    if (style2.display)
    {
      style2.display = "";
      button.src = "/images/minus.png"
    }
    else
    {
      style2.display = "none";
      button.src = "/images/plus.png"
    }
  }
  else if (document.all)
  {
    // this is the way old msie versions work
    var style2 = document.all[whichLayer].style;
    var button = document.all[button];
    if (style2.display)
    {
      style2.display = "";
      button.src = "/images/minus.png"
    }
    else
    {
      style2.display = "none";
      button.src = "/images/plus.png"
    }
  }
  else if (document.layers)
  {
    // this is the way nn4 works
    var style2 = document.layers[whichLayer].style;
    var button = document.layers[button];
    if (style2.display)
    {
      style2.display = "";
      button.src = "/images/minus.png"
    }
    else
    {
      style2.display = "none";
      button.src = "/images/plus.png"
    }
  }
}

function tl_openAnchorRollout()
{
  // Get the anchor we are attempting to show
  var anchor = unescape(self.document.location.hash.substr(1))

  // There is no anchor... nothing to do.
  if (!anchor) return true;
  
  // Loop all A tags until we find one with that name
  var allLinks = document.getElementsByTagName('a');
  var destinationLink = null;
  for (var i=0;i<allLinks.length;i++) {
    var lnk = allLinks[i];
    if (lnk.name && (lnk.name == anchor)) {
      destinationLink = lnk;
      break;
    }
  }

  // If we didn't find a destination, give up and let the browser do
  // its thing
  if (!destinationLink) return true;
  
  var rollout_ids = []

  if (destinationLink.id)
  {
    rollout_ids = destinationLink.id.split('|')
  }

  for (var i=0; i<rollout_ids.length; i++)
  {
    if ($(rollout_ids[i]) != null)
    {
      if ($(rollout_ids[i]).style.display)
      {
        $(rollout_ids[i]).style.display = "";
        $('expand_'+rollout_ids[i]+'_button').src = "/images/minus.png";
      }
    }
  }

  // Tell the browser to try again to go the the anchor now that it's visible.
  self.document.location.hash = '#' + anchor;

  return true;
}

Event.observe(window,'load',tl_openAnchorRollout);
