
var x = 0;
var y = 0;
var layhoehe;
var active = false;
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all) ? true : false;
var ie5p = false;
if (ie4 && navigator.userAgent.indexOf('MSIE 5') > 0 || navigator.userAgent.indexOf('MSIE 5.5') > 0 || navigator.userAgent.indexOf('MSIE 6.0') > 0) ie5p = true;
var ns6 = (document.getElementById) ? true : false;

{
if(ie4 || ns6)
{
 document.onmousemove = mouseMover;
}
if(ns4)
{
 document.onmousemove = mouseMover;
 document.captureEvents(Event.MOUSEMOVE);
}
}

function  tooltip(html_text)
{
if(ns4)
 {
  document.text_ns.document.open();
  document.text_ns.document.write( html_text );
  document.text_ns.document.close();
  document.text_ns.left = x - 150;
  document.text_ns.top = y + 10;
  document.text_ns.visibility = "show";
  layhoehe = parseInt(window.document.layers.text_ns.document.height);
  active = true;
 }
 if(ns6)
 {
  document.getElementById("text_ie").innerHTML = html_text;
  document.getElementById("text_ie").style.visibility = "visible";
  document.getElementById("text_ie").style.left = x - 150;
  document.getElementById("text_ie").style.top = y + 10;
  layhoehe = parseInt(document.getElementById("tabi").offsetHeight);
  active = true;
 }
 if(ie4)
 {
  document.all["text_ie"].innerHTML = html_text;
  document.all["text_ie"].style.visibility = "visible";
  document.all["text_ie"].style.left = x - 150;
  document.all["text_ie"].style.top = y + 10;
  layhoehe = parseInt(document.all["text_ie"].document.all.tabi.offsetHeight);
  active = true;
 }
}

function txton(text1, text2, width, textpos)
{
 if(text1 != "" && text2 != "" && (ns4 || ie4 || ns6))
 {
  tooltip("<table  id='tabi' border='0' cellspacing='0' cellpadding='0' width='" + width +"'><tr><td><img src='/inhalt/bilder/top2.png' height='50' width='100%' alt='' border='0'></td></tr><tr><td><table class='tiptable'  width='100%' background='/inhalt/bilder/in2.png' cellspacing='2' cellpadding='2' border='0'><tr><td align='center'><strong>&nbsp;" + text1 + "&nbsp;</strong><hr></td></tr><tr><td " + textpos +"'>" + text2 + "</td></tr></table></td></tr><tr><td><img src='/inhalt/bilder/foot2.png' height='20' width='100%' alt='' border='0'></td></tr></table>" );
 }
else if(text1 != "" || text2 != "" && (ns4 || ie4 || ns6))
 {
 if(text1 != "" && (ns4 || ie4 || ns6))
tooltip( "<table id='tabi' border='0' cellspacing='0' cellpadding='0' width='" + width +"'><tr><td><table class='tiptable' border='0' cellspacing='1' cellpadding='0' width='100%'><tr><td class='tiphead' align='center'>" + text1 + "</td></tr></table></td></tr></table>" );
if(text2 != "" && (ns4 || ie4 || ns6))
tooltip( "<table id='tabi' border='0' cellspacing='0' cellpadding='0' width='" + width +"'><tr><td><table class='tiptable' border='0' cellspacing='1' cellpadding='6' width='100%'><tr><td class='tpidata' align='" + textpos +"'>" + text2 + "</td></tr></table></td></tr></table>" );
 }
}
 
function txtoff()
{
 if(ns4) document.text_ns.visibility = "hide";
 if(ie4) document.all["text_ie"].style.visibility = "hidden";
 if(ns6) document.getElementById("text_ie").style.visibility = "hidden";
 active = false;
}

/********************************************************/
function mouseMover(e)
{
if(ie5p)
 {
  x = event.x + document.body.scrollLeft;
  y = event.y + document.body.scrollTop;
 }
 else
 if(ie4)
 {
  x = event.x;
  y = event.y;
 }
 else if(ns4 || ns6)
 {
  x = e.pageX;
  y = e.pageY;
 }
 if(active)
 {
 if(ns4)
  {
   if(y + 20 + (layhoehe) > window.innerHeight + window.pageYOffset)
{
document.text_ns.top = (window.innerHeight + window.pageYOffset) - layhoehe;
document.text_ns.left = x + 14;
}
else
{
document.text_ns.left = x - 150;
document.text_ns.top = y + 10;
}
  }
 if(ns6)
  {
  if(y + 20  + (layhoehe)> window.innerHeight + window.pageYOffset)
{
document.getElementById("text_ie").style.top = (window.innerHeight + window.pageYOffset) - layhoehe;
document.getElementById("text_ie").style.left = x + 14;
}
  else
  {
   document.getElementById("text_ie").style.left = x - 150;
    document.getElementById("text_ie").style.top = y + 10;
  }
  }
 if(ie4)
  {
   if(y + 20 + (layhoehe) > document.body.clientHeight + document.body.scrollTop)
   {
document.all["text_ie"].style.top = (document.body.clientHeight + document.body.scrollTop) - layhoehe;
document.all["text_ie"].style.left = x + 14;
   }
  else
{
 document.all["text_ie"].style.left = x - 150;
        document.all["text_ie"].style.top = y + 10;
}
  }
 }
}



