    var IE = document.all?true:false
    var MouseXPos = 0;
    var MouseYPos = 0;
    var ScrOfX = 0;
    var ScrOfY = 0;
    
    function setPanelPosition(id, xoffset, yoffset) {
          document.getElementById(id).style.left = (MouseXPos - xoffset) + "px";
          document.getElementById(id).style.top = (MouseYPos - yoffset) + "px";
      return true
    }

    function centerPanelPosition(id, width, height) {
        var theWidth = 0;
        var theHeight = 0;
        
        if (IE)
        {
           theWidth = document.documentElement.clientWidth;
           theHeight = document.documentElement.clientHeight;
        }
        else
        {
           theWidth = document.body.clientWidth;
           theHeight = document.body.clientHeight;
        }

        document.getElementById(id).style.left = ( ((theWidth - width)/2) + ScrOfX )  + "px";
        
        if( height < theHeight && height != '0' )
        {
            document.getElementById(id).style.top = ( ((theHeight-height)*0.3) + ScrOfY ) + "px";
        }
        else
        {
            document.getElementById(id).style.top = ( 20 + ScrOfY ) + "px";
        }
        return true
    }

    // If NS -- that is, !IE -- then set up for mouse capture
    if (!IE) document.captureEvents(Event.MOUSEMOVE)
    // if (!IE) document.onmousemove = getCoords

    // Set-up to use getMouseXY function onMouseMove
    document.onmousemove = getCoords;

    function getCoords(e)
    {
      if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        ScrOfY = window.pageYOffset;
        ScrOfX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        ScrOfY = document.body.scrollTop;
        ScrOfX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        ScrOfY = document.documentElement.scrollTop;
        ScrOfX = document.documentElement.scrollLeft;
      }

      if (IE) { // grab the x-y pos.s if browser is IE
       MouseXPos = event.clientX + ScrOfX
       MouseYPos = event.clientY + ScrOfY
      } else {  // grab the x-y pos.s if browser is NS
        MouseXPos = e.pageX
        MouseYPos = e.pageY
      }  
      // catch possible negative values in NS4
      if (MouseXPos < 0){MouseXPos = 0}
      if (MouseYPos < 0){MouseYPos = 0}
      return true;
    }
