
///////////////
function hideFrame(id)
{
if (document.getElementById(id)) {
          var ele = document.getElementById(id)
          document.body.removeChild(ele);
          
    }
if (document.getElementById('backdiv')) {
          var backdiv = document.getElementById('backdiv');
          document.body.removeChild(backdiv);
    }
}

//////////////////////////////////////////////////////////
function getMouseXY(e) // works on IE6,FF,Moz,Opera7
{ 
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)
//alert(e.type);
  if (e)
  { 
    if (e.pageX || e.pageY)
    { // this doesn't work on IE6!! (works on FF,Moz,Opera7)
      mousex = e.pageX;
      mousey = e.pageY;
      algor = '[e.pageX]';
      if (e.clientX || e.clientY) algor += ' [e.clientX] '
    }
    else if (e.clientX || e.clientY)
    { // works on IE6,FF,Moz,Opera7
      mousex = e.clientX + document.body.scrollLeft;
      mousey = e.clientY + document.body.scrollTop;
      algor = '[e.clientX]';
      if (e.pageX || e.pageY) algor += ' [e.pageX] '
    }  
  }
return new Array(mousex+10,mousey+20);
}
//////////////////////////////////////////////////////////////////////
function getStaticPosition(w,h)
{
var a = getWindowCenter();
var nw = a[0]-w/2;
var nh = a[1]-h/2;
return new Array(nw,nh);                
}
function getWindowCenter()
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
return new Array(myWidth/2,myHeight/2);
}
////////////////////////////////////////////////////////////////
function registerMouseEvent(component,div,event)
{
if (document.all?true:false) registerIEEvent(component,div);
     else registerMozEvent(component,div,event);
// If NS -- that is, !IE -- then set up for mouse capture
//if (!IE) component.addEventListener("mousemove",moziMove,false);//captureEvents(Event.MOUSEMOVE);

}
function registerIEEvent(component,div)
{
component.onmousemove = moveFrame;
function moveFrame()
{

var position = getMouseXY();//event);
div.style.top = ""+position[1]+"px";
div.style.left = ""+position[0]+"px"; 
}
}//registerIEEvent

function registerMozEvent(component,div,event)
{
component.addEventListener("mouseover",moveFrame,true);
function moveFrame()
{

var position = getMouseXY(MouseEvent);
var elem = document.getElementById("bau");
elem.innerHTML = ""+position[1]+" "+position[0]+"";
}
}