var xcoord;
var ycoord;

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showHideLayers() { //v6.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_showHideLayers() { //v Pontus
    var ofst,e,i,p,v,obj,args = MM_showHideLayers.arguments;
    for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) {
        v=args[i+2];
        if (obj.style) {
            obj=obj.style;
            v=(v=='show')?'visible':(v=='hide')?'hidden':v;
        }
        obj.visibility=v;
    }
    ofst = 10;
    if (navigator.appName.indexOf("Explorer")>0) {
        if (!e) e = window.event;
        if (typeof e.pageY == 'number') {
            mouseY = e.pageY + ofst;
            mouseX = e.pageX + ofst;
        } else {
            mouseY = e.clientY + ofst+document.body.scrollTop;
            mouseX = e.clientX + ofst+document.body.scrollLeft;
        }

        obj.top = mouseY;
        obj.left = mouseX;
    } else {
        obj.top = ycoord+ofst+"px";
        obj.left = xcoord+ofst+"px";
    }

}

if( window.captureEvents ) {
    //myReference was obtained as in the section on DHTML
    //non IE
    if( Event.MOUSEMOVE ) {
        //NS 4, NS 6, Mozilla 0.9.x
        window.captureEvents( Event.MOUSEMOVE );
    }
}
window.onmousemove = alertCoord;

function alertCoord(e) {
  if( !e ) {
    if( window.event ) {
      //DOM
      e = window.event;
    } else {
      alert("TOTAL FAILURE, WE HAVE NO WAY OF REFERENCING THE EVENT");
      return;
    }
  }
  if( typeof( e.pageX ) == 'number' ) {
    //NS 4, NS 6+, Mozilla 0.9+
    xcoord = e.pageX;
    ycoord = e.pageY;

  } else {
    if( typeof( e.clientX ) == 'number' ) {
      //IE, Opera, NS 6+, Mozilla 0.9+
      //except that NS 6+ and Mozilla 0.9+ did pageX ...
       xcoord = e.clientX;
       ycoord = e.clientY;
      if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
        ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
        window.navigator.vendor == 'KDE' ) ) {
        if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
          //IE 4, 5 & 6 (in non-standards compliant mode)
          xcoord += document.body.scrollLeft;
          ycoord += document.body.scrollTop;
        } else if( document.documentElement &&
          ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
          //IE 6 (in standards compliant mode)
          xcoord += document.documentElement.scrollLeft;
          ycoord += document.documentElement.scrollTop;
        }
      }
    } else {
      //alert("TOTAL FAILURE, WE HAVE NO WAY OF OBTAINING THE MOUSE COORDINATES");
      return;
    }
  }
//  window.alert('Mouse coordinates are ('+xcoord+','+ycoord+')');
}