var zo=0, zi=0;         	//Ampeln
var Tid, Sid, last;
var Zwidth=50, Zheight=50;	//Minimalwer und Startwert
var zoom=0, last;

function div_move(Ereignis)
{
 if(Sid != 0)
  {
   if (!Ereignis) Ereignis = window.event; 

   if (document.all)
    {
     document.getElementById(Sid).style.left = Ereignis.x+document.body.scrollLeft+10+ "px";
     document.getElementById(Sid).style.top = Ereignis.y+document.body.scrollTop+ "px";	  
    }
	 
   else if (document.getElementById)
    {
     document.getElementById(Sid).style.left = Ereignis.pageX+10 + "px";
     document.getElementById(Sid).style.top = Ereignis.pageY+ "px";
    }
   if(document.getElementById(Sid).style.visibility=="hidden") document.getElementById(Sid).style.visibility="visible";
  }	 
}


function make_tip(inhalt, id)
{
 document.write("<div id='"+id+"' name='"+id+"' style='visibility: hidden; position: absolute; left: 0px; top: 0px; z-index: 400;'>");
 document.write(inhalt);
 document.write("</div>");
}
		  

function set_tip(status, id, oben, links, zoom)  
{
 twidth=document.getElementById(id).offsetWidth;
 if(status == "on")				//Tip Sichtbar machen.
  {
   if(document.getElementById(last) && last != id) 	//Reset
    {
     document.getElementById(last).style.visibility="hidden";
     Zwidth=50;
     Zheight=50;
    }
    
   Sid=id;

   if( zoom == 1 )				//Von klein nach gross Zoomen.
    {
     zo=1;
     zi=0;
     zoom_out();
    }
      
   if ((links != 0) && (oben != 0))		//Feste Position ist gegeben.
    {
     Sid=0;
     document.getElementById(id).style.visibility = "visible";
     document.getElementById(id).style.left = links + "px";
     document.getElementById(id).style.top = oben + "px";	  
    }
   else if((links == 0) && (oben == 0))		//Keine Position gegeben, Position nach Maus.
    {
     document.onmousemove=div_move;		//Hinterher!!
    }
   last=id;
  } 
  
 if(status == "off")				//Tip Unsichtbar machen.
  {
   Sid=id;
   if(document.getElementById)
    {
     if(zoom == 1)
      {
       zi=1;
       zo=0;
       zoom_in();
      }
     else
      {
       document.getElementById(id).style.top="-200";
       document.getElementById(id).style.left="-200";
       document.getElementById(id).style.visibility="hidden";
       Sid=0;
      }
    } 
  }
}


function zoom_out()
{
 if(!zi && Sid!=0)
 {
  document.getElementById(Sid).style.width = Zwidth+"px";
  document.getElementById(Sid).style.height = Zheight+"px";
	 
  document.getElementById("bild_"+Sid).style.width = Zwidth+"px";
    
  Zwidth=Zwidth+6;
  Zheight=Zheight+6;
  
  if(Zwidth < 250) Tid=setTimeout("zoom_out();",10);
  else
   {
    zo=0;
   }
 }
}
				    
				    
function zoom_in()
{
 if(!zo && Sid!=0)
  {
   document.getElementById(Sid).style.width = Zwidth+"px";
   document.getElementById(Sid).style.height = Zheight+"px";
			     
   document.getElementById("bild_"+Sid).style.width = Zwidth+"px";
				
   Zwidth=Zwidth-10;
   Zheight=Zheight-10;
   if(Zwidth > 50) Tid=setTimeout("zoom_in();",10);
   else
    {
     document.getElementById(Sid).style.visibility="hidden";
     zi=0;
     Sid=0;
    }
  }
}

function tip_dead(ti)
{
 //document.getElementById("bild_"+ti).style.visibility="hidden";
}
			
						    
