function animate(objid, anitime, anistyle, aniquit)
{
   var obj = document.getElementById(objid);
   if( obj != null )
   {
      if(!document.body.filters)
      {
         obj.style.visibility = "visible";
         if(!aniquit)
         {
            show("next");
         }
         else
         {
            proceed();
         }
      }
      else
      {
         if(anistyle == "auto_style")
         {
            var tstyle = parseInt((Math.random()*23)+1)
            obj.filters[0].transition = tstyle;
            /*
            alert("Die Animation nutzt zufälligen Effekt!\n"+
                  "Aktueller Effekt: #"+tstyle+
                  "\n\nF5 um weitere Effekte zu sehen...");
            */
         }
         else
         {
            obj.filters[0].transition = anistyle;
         }
         if(anitime == "auto_time")
         {
            obj.filters[0].duration = parseInt(obj.innerText.length*0.02);
         }
         else
         {
            obj.filters[0].duration = parseInt(anitime / 1000);
         }
         obj.filters[0].Apply();
         obj.style.visibility = "visible";
         obj.filters[0].Play();

         if(!aniquit)
         {
            window.setTimeout("show('next');", obj.filters[0].duration * 1000);
         }
         else
         {
            window.setTimeout("proceed();", obj.filters[0].duration * 1000);
         }
      }
   }
}

function show(objid)
{
   var obj = document.getElementById(objid);
   if( obj != null )
   {
      obj.style.visibility = "visible";
   }
}

function proceed()
{
   document.location.href = "../?proceed=1";
}