//-***********************************************
// Script für Mouseover Tooltip
// 1.) Eventabfrage  
// 2.) Fensterhöre ermitteln 
// 3.) Positionierung(je nach Browser)
//-***********************************************

var xFromMouse = 10;
var yFromMouse = 10;
tip = null;

function Fensterhoehe () {
   if (window.innerHeight) 
      { return window.innerHeight;} 
   else if (document.body && document.body.offsetHeight) 
      {return document.documentElement.clientHeight;} 
   else 
      { return 0;}
}
         
          
function showTip(id) {
   tip = document.getElementById(id);
   tip.style.display = "block";
}

function hideTip() {
   tip.style.display = "none";
}

function moveTip(e) {
   x = (document.all) ? window.event.x + document.body.scrollLeft : e.clientX;
   y = (document.all) ? window.event.y + document.body.scrollTop : e.clientY;

   //Weite = Fensterweite();
   Hoehe = Fensterhoehe();

   if (tip != null) {
      
      // # Set X Pos
      tip.style.left = (x + xFromMouse) + "px";
      
      // # Set Y Pos ()
      //Internet Explorer muss ich noch was tolles Finden
      if (navigator.appName=="Microsoft Internet Explorer"){
         
         //Internet Explorer 6 == true
         if (/msie|MSIE 6/.test(navigator.userAgent))
            {/*Update your Browser*/}
         //Internet Explorer 7
         else {
            if ( (Hoehe - y) > 340)
               { tip.style.top  = (y + yFromMouse) + "px";}
            else { 
               if ( (Hoehe - y) < 100){ tip.style.top  = (Hoehe-280) + "px";}
               else{ tip.style.top  = (Hoehe-340) + "px";}
            }
         }
      }

      //firefox & co 
      else{
         if ( (Hoehe - y) > 320)
            { tip.style.top  = (y + yFromMouse) + "px";}
         else { 
            if ( (Hoehe - y) < 100)
               { tip.style.top  = (Hoehe-280) + "px";}
            else
               { tip.style.top  = (Hoehe-320) + "px";}
         }
      }	//end IE oder Firefox
   }	//End Tip != NULL 
}		//Ende MoveTip

document.onmousemove = moveTip;
