function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

if (navigator.appName == "Netscape") {
  document.captureEvents(Event.MOUSEMOVE);
}

var DimX , DimY;
var LastLayer = '';

document.onmousemove = ControllaLayer;

function ControllaLayer(e) {
  if (LastLayer=='') return true;

  var x , y
  if (navigator.appName == "Microsoft Internet Explorer"){
    x = event.clientX + document.body.scrollLeft;
    y = event.clientY + document.body.scrollTop;
  }
  else {
    x = e.pageX;
    y = e.pageY;
  }
  
  var MinX , MaxX , MinY , MaxY
  if (navigator.appName == "Microsoft Internet Explorer"){
    MinY=LastLayer.style.pixelTop;
    MaxY=LastLayer.style.pixelTop+LastLayer.style.pixelHeight;
    MinX=LastLayer.style.pixelLeft;
    MaxX=LastLayer.style.pixelLeft+LastLayer.style.pixelWidth;
4  }
  else {
    MinY=LastLayer.top;
    MaxY=LastLayer.top+LastLayer.height;
    MinX=LastLayer.left;
    MaxX=LastLayer.left+LastLayer.width;
  }
  
  MaxX = MinX + DimX;
  MaxY = MinY + DimY;

  if (x<MinX || x>MaxX || y<MinY-25 || y>MaxY) 
   MauShowLayer (LastLayer.id,'hide');

  return true;  
}

function MauShowLayer(l,action,dx,dy) { 
  var i,p,v,obj;
  if (LastLayer!='') {
     v='hide';
     obj=LastLayer;
     if (obj.style) { 
     obj=obj.style; 
     v=(v=='show')?'visible':(v='hide')?'hidden':v; }
     obj.visibility=v;
  } 
  if ((obj=MM_findObj(l))!=null) { v=action;
    if (v=='show') { LastLayer = obj; DimX=dx; DimY=dy; }
    if (obj.style) { 
    obj=obj.style; 
    v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v;
  }
}