/********************************************************************
* These functions allow dynamic HTML effects to be added to any     *
* web page and will work on Netscape Communicator 4.0+, MS Internet *
* Explorer 4.0+ and Netscape 6 (Mozilla) browsers.                  *
********************************************************************/
var layerList = new Array();

function createLayer(name, left, top, width, height, visible, content)
{
  var z = layerList.length;
  var layer;

  layerList[z] = name;

  if (document.layers) {
    document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height +  ' visibility=' + (visible ? '"show"' : '"hide"') + ' z-index=' + z + '>');
    document.writeln(content);
    document.writeln('</layer>');
    layer = getLayer(name);
    layer.width = width;
    layer.height = height;
  } else if (document.all || document.getElementById) {
    document.writeln('<div id="' + name + '" style="position:absolute; overflow:none; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + ' z-index=' + z + '">');
    document.writeln(content);
    document.writeln('</div>');
  }
}

function hideLayer(name)
{
  var layer = getLayer(name);

  if (document.layers) {
    layer.visibility = "hide";
  } else if (document.all) {
    layer.visibility = "hidden";
  } else if (document.getElementById) {
  	layer.style.visibility = "hidden";
  }
}

function showLayer(name)
{
  var layer = getLayer(name);

  if (document.layers) {
    layer.visibility = "show";
  } else if (document.all) {
    layer.visibility = "visible";
  } else if (document.getElementById) {
    layer.style.visibility = "visible";
  }
}

function getLayer(name)
{
  // Returns a handle to the named layer.

  if (document.layers) {
    return(document.layers[name]);
  } else if (document.all) {
    layer = eval('document.all.' + name + '.style');
    return(layer);
  } else if (document.getElementById) {
    return(document.getElementById(name));
  } else {
    return(null);
  }
}
