var x=0;
var left=0;
var right=0;
var menu="";
var fly="";

function hide_glow()
{
  if (document.getElementById)fly=document.getElementById("flyhigh").style;
  else if (document.all)fly=document.all["flyhigh"].style;
  else if (document.layers)fly=document.layers["flyhigh"];
  else null;
  if(fly){fly.visibility='hidden';fly.left="0px";}
}

function bewege_glow(Ereignis)
{
  if (document.getElementById) fly=document.getElementById("flyhigh").style;
  else if (document.all) fly=document.all["flyhigh"].style;
  else if (document.layers) fly=document.layers["flyhigh"];
  else null;
  
  if (!Ereignis) Ereignis = window.event;
  x = Ereignis.screenX;
  
  if(x < left + 35) x = left + 35;
  if(x > right - 68) x = right - 68;
  
  opLeft = left + 35;
  opRight = right - 68;
  
  opMiddle = ((opRight - opLeft) / 2);
  
  opVar = 1 - ((Math.abs(opMiddle - (x - opLeft)) / (opMiddle / 100)) / 100 );
  
  opVar = Math.round(opVar * 100) / 100;
  
  if(fly)
  {
  	fly.left = (x - left - 48) + "px"; 
  	fly.visibility = 'visible';
  	fly.opacity = opVar;
  	// fly.filter = "alpha(opacity = " + Math.round(opVar * 100) + ")";
  }
  
  if(Ereignis.screenX < left) hide_glow();
  if(Ereignis.screenX > right) hide_glow();
}

function set_glow(Ereignis, wert)
{
  if (document.getElementById) fly=document.getElementById("flyhigh").style;
  else if (document.all) fly=document.all["flyhigh"].style;
  else if (document.layers) fly=document.layers["flyhigh"];
  else null;
  
  if (!Ereignis) Ereignis = window.event;
  x = Ereignis.screenX;

  if(fly)
  {
  	fly.left = wert + "px"; 
  	fly.visibility = 'visible';
  	fly.opacity = 1;
  }
}

function config_variables()
{
	if (document.getElementById) menu=document.getElementById("menu");
	else if (document.all) menu=document.all["menu"];
	else if (document.layers) menu=document.layers["menu"];
	else null;
  
	if(menu){left = menu.offsetLeft; right = left + 991;}
}
