var nsx; 
var nsy; 

var ns4 = (document.layers)? true:false;
var ie4 = (document.all)? true:false;

document.onmousemove = mouseMove;
if (ns4) { document.captureEvents(Event.MOUSEMOVE);}

function mouseMove(e){
   if (ns4) {
      nsx = e.pageX;
      nsy = e.pageY;
   } 
}

//RELOAD NO NETSCAPE.
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//CRIAÇÃO DE DIV's.
function createLayer(name, visible, content, zorder, evento, top, left, width, height) {

  var layer;

  if (document.layers) {
     document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' visibility=' + (visible ? '"show"' : '"hide"') + ' z-index=' + zorder + ' ' + evento + '>');
     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:' + 0 + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + ' z-index=' + 2 + '" ' + evento + '>');
     document.writeln(content);
     document.writeln('</div>');
  }
}

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);
}

// Funções que Mostram e Escondem os div's definidos
function mostra_div(div) {

      if (ns4) {
        document.layers[div].visibility = "show";
    }
      else if (ie4) {
        document.all[div].style.visibility = "visible";
    }
}

function esconde_div(div) {

      if (ns4) {
        document.layers[div].visibility = "hide";
    }
      else if (ie4) {
        document.all[div].style.visibility = "hidden";
    }
}

function abrirAnima() {

 remoto = open('/exemplo/pagina.html','apresenta','width=457,height=175,maximized=no,resizable=no,scrollbars=no,status=no,menubar=no,toolbar=no,location=no,directories=no,copyhistory=no,top=150,left=168');

 if (remoto.opener == null)
    remoto.opener = window;
    remoto.opener.name = "site";
    return remoto;

}
