var layerList = new Array();

function creaCapa(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;
  }

  if (document.all) {
    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 amagaCapa(name) {
	layer.visibility = "hidden";
}

function mostraCapa(name) {

  var layer = getLayer(name);
  amagaCapa(name);
  if (document.layers) {
    layer.visibility = "show";

  }
  if (document.all){
    layer.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
    return(null);
}