var IE = document.all?true:false
if (!IE)
{
   document.captureEvents(Event.MOUSEMOVE);
}
// Set-up to use getMouseXY function onMouseMove

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

function both(e)
{
  getMouseXY(e);
  movef();
}

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
var IE = document.all?true:false;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}

  return true;
}

var mousein=0;

function loadf(text,url)
{
   document.getElementById("onmouseover").style.visibility='hidden';

   var mouseover = document.getElementById("onmouseover");

   mousein = 1;


	var tempX='0px';
	var tempY='0px';

   newString = new String (url);

	heavyImage = new Image();

	heavyImage.src = url;

	//width='290' height='400'
	//<br><span style='color:gray;font-size:11px'>(click to enlarge picture)<\/span>
	//background='bilder/loading.gif'
	
   mouseover.innerHTML = "<table class=mousebox id='tooltiptable' ><tr><td align='center'><b>" + text + "<\/b><br><img src='" + url + "' vspace='4' hspace='4' id='tooltippicture' onload='javascript:showf();'><\/td><\/tr><\/table>";

   document.onmousemove = both;

}

function showf()
{
  movef();
  if (mousein)
     document.getElementById("onmouseover").style.visibility='visible';

}


function movef()
{

   var mouseover = document.getElementById("onmouseover");

   var mouseW = mouseover.offsetWidth;
   var mouseH = mouseover.offsetHeight;

   var x,y;
   if (self.pageYOffset) // all except Explorer
   {
    x = self.pageXOffset;
    y = self.pageYOffset;
   }
   else if (document.documentElement && document.documentElement.scrollTop)
    // Explorer 6 Strict
   {
    x = document.documentElement.scrollLeft;
    y = document.documentElement.scrollTop;
   }
   else if (document.body) // all other Explorers
   {
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    }

    var xw,yw;
    if (self.innerHeight) // all except Explorer
    {
        xw = self.innerWidth;
        yw = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
        // Explorer 6 Strict Mode
    {
        xw = document.documentElement.clientWidth;
        yw = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
        xw = document.body.clientWidth;
        yw = document.body.clientHeight;
    }

    xw -= 36;
    yw -= 25;


    if (self.innerHeight) // all except Explorer
    {

   }else if (document.documentElement && document.documentElement.clientHeight)
       // Explorer 6 Strict Mode
   {
       tempX += document.documentElement.scrollLeft;
       tempY += document.documentElement.scrollTop;
   }
   else if (document.body) // other Explorers
   {
      tempX +=  document.body.scrollLeft;
      tempY += document.body.scrollTop;
   }

   var yrel = tempY - y;
   var xrel = tempX - x;

   var abstand = 20;

   if (xw - xrel < mouseW) // box links vom mauszeiger
   {
      mouseover.style.left=tempX-mouseW-abstand +'px';
   }else // box rechts vom mauszeiger
   {
      mouseover.style.left=tempX+abstand +'px';
   }

   if (yw - yrel < mouseH) // box oberhalb mauszeiger
   {
      mouseover.style.top=tempY-mouseH-abstand+'px';
   }else// box unterhalb mauszeiger
   {
      mouseover.style.top=tempY+abstand +'px';
   }


}

function outf()
{
   mousein = 0;
   document.onmousemove="";
   document.getElementById("onmouseover").style.visibility='hidden';
}