//error anzeige

//window.onerror=oe;
function oe(msg,url,line) {
   alert("Fehler in "+url+" Zeile "+line+":\n"+msg);
   return true;
}

//Browser erkennung
/* User Agent (Browserkennung) auf einen bestimmten Browsertyp prüfen */
function isAgent(name)
{
   var agent = navigator.userAgent.toLowerCase();
   if (agent.indexOf(name.toLowerCase())>-1) {
      return true;
   }
   return false;
}

//fader objekt ------------------------------------------------------
function fade(amount, oldValue, fadeobj)
{
   obj=document.getElementById(fadeobj.eid);
   if (obj==null)
   {
      alert("obj is null, eid="+fadeobj.eid);
      return;
   }

   newValue = oldValue + amount;

   if (newValue<0)
      newValue=0;

   if (newValue>1)
      newValue=1;

   obj.style.opacity=newValue;
   obj.style.filter="alpha(opacity = " + 100*newValue + ")";

   if (newValue>0 && newValue<1)
      fadeobj.busy=setTimeout(fade, fadeobj.delay, amount, newValue, fadeobj);
}//>

function fadein()
{
   if (this.disabled)
      return;
   var fadestatus=0;
   var amount=this.delay/this.time;
   if (this.busy!=false)
   {
      clearTimeout(this.busy);
      this.busy=false;
      fadestatus=parseFloat(document.getElementById(this.eid).style.opacity);
   }
   fade(amount, fadestatus, this);
}

function fadeout()
{
   if (this.disabled)
      return;
   var fadestatus=1;
   var amount=-this.delay/this.time;
   if (this.busy!=false)
   {
      clearTimeout(this.busy);
      this.busy=false;
      fadestatus=parseFloat(document.getElementById(this.eid).style.opacity);
   }
   fade(amount, fadestatus, this);
}


function fader(eid)
{
   this.disabled=false;
   this.time=500.0;
   this.delay=50;
   this.busy=false;
   this.eid=eid;
   
   if (isAgent('MSIE'))
      this.disabled=true;

   this.fadein=fadein;
   this.fadeout=fadeout;
}
//ende fader objekt -------------------------------------------


