/* 01.02.2006 by Kenan Bahcivan                                                                                                 */
/* Funktionsaufruf für die Tooltipps der Formularhilfen                                                                         */
/* show_hide_box(an,msg)                                    									            */
/* an = Das zum Tooltipp gehörende HTML Element. In unserem Fall ist dieser Parameter mit this zu belegen                       */
/* Beispiel:                                                                                                                    */
/* onClick="return show_hide_box(this,'Hier steht der text oder variable mit text übergeben')"                                  */
/* Die Funktion muss außerdem bei den Events OnMouseOver und OnMouseOut ausgeführt werden.                                      */
/* Bei dem Event MousOut reicht folgender aufruf:                                    						     */
/* onMouseOut="return show_hide_box(this)"                                                                                      */




<!---Style-->
var borderStyle='1px solid';
var borderColor='#999999';
var backgroundColor='#ffeee5';
var textcolor='#000000';
var padding='5px';
var font='bold .7em Verdana';
var x=0;
var y=10;
<!--ende Style->

var boxdiv=null;
var Breite = 0;
var Hoehe = 0;



function move_box(an, box) {
  var cleft = x;
  var ctop = y;
  var obj = an;
  while (obj.offsetParent) {
    <!--cleft += obj.offsetLeft;-->
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  
  
berechneFenstergroesse();
  
 if(Breite==0 || Breite==null){
 Breite=1;
 }
 
 if(cleft == 0){
 cleft=1;
 }
 
 if(cleft > 100){
 cleft=99;
 }
 
  if(cleft < -100){
 cleft=-99;
 }

  
  box.style.left =  ((Breite/2) + ((Breite/100)*(cleft/2))) + 'px';
  ctop += an.offsetHeight + 8;
   
  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }

  box.style.top = ctop + 'px';
}


function show_hide_box(an,text) {
   
   var href = an.href ;
   var boxdiv_sh = document.getElementById(href);

  if (boxdiv_sh != null) {
    if (boxdiv_sh.style.display=='none') {
      move_box(an, boxdiv_sh);
      boxdiv_sh.style.display='block';
    } else
      boxdiv_sh.style.display='none';
    return false;
  }
  boxdiv_sh = document.createElement('div');
  boxdiv_sh.setAttribute('id', href);
  boxdiv_sh.style.display = 'block';
  boxdiv_sh.style.position = 'absolute';
  
 
 if(text.length>20){
  boxdiv_sh.style.width = '200' + 'px';
}
  
  boxdiv_sh.style.border = borderStyle;
  boxdiv_sh.style.backgroundColor = backgroundColor;
  boxdiv_sh.style.padding = padding;
  boxdiv_sh.style.font = font;
  boxdiv_sh.style.color = textcolor;
  boxdiv_sh.style.borderColor = borderColor;	
  boxdiv_sh.style.zIndex='300';
  boxdiv_sh.style.height  = 'auto';
  
  var textnode = document.createTextNode(text);
  boxdiv_sh.appendChild(textnode);
  document.body.appendChild(boxdiv_sh);

  move_box(an, boxdiv_sh);

  return false;
  
}


function berechneFenstergroesse()
{
  
   if (window.innerWidth || window.innerHeight)//opera Netscape 6 Netscape 4x Mozilla 
		{ 
			Breite = window.innerWidth; 
			Hoehe = window.innerHeight; 
		} 

		if (document.body.clientWidth || document.body.clientHeight)//IE Mozilla 
		{ 
			Breite = document.body.clientWidth; 
			Hoehe = document.body.clientHeight; 
		} 
   
}


