//------------------------------------------------------------------------------
// startseite Blendeffekt
//------------------------------------------------------------------------------
var speed = 5000;
var aktionid = 1;
var percentIn  = 0;
var percentOut  = 100;
var divIn;
var divOut;

function startAktionAnimation()
{
  aktionInterval = window.setInterval("startBlending()", speed);
}

function startBlending()
{
  count = getAktionArticleCount();
  
  divOut = document.getElementById('startAktionAnimation_' + aktionid);
  
  aktionid++;
  if(aktionid==count) { aktionid=1; }

  divIn = document.getElementById('startAktionAnimation_' + aktionid);
  divIn.style.display = 'block';

  percentIn  = 0;
  percentOut  = 100;

  fade();
}

function fade()
{
  if(percentOut>0) { percentOut = percentOut - 5; }
  else { divOut.style.display = 'none'; }
  
  if (window.navigator.userAgent.indexOf("MSIE ") > -1 && parseFloat(navigator.appVersion) >= 4) 
  { divOut.style.display = 'none'; }
  
  divOut.style.opacity = percentOut/100;
  
  // IE lässt text verschwimmen ? warum weiß ich ned also kein Blend effeckt!
  //divOut.style.filter = "Alpha(opacity="+percentOut+")";
  
  
  if(percentIn<100) { percentIn = percentIn + 5; }
  
  divIn.style.opacity = percentIn/100;
  
  // IE lässt text verschwimmen ? warum weiß ich ned also kein Blend effeckt!
  //divIn.style.filter = "Alpha(opacity="+percentIn+")";
  
  if(percentIn<100 && percentOut>0)
    window.setTimeout("fade()", 100); 
}

function getAktionArticleCount()
{
  count = 1;
  while(div = document.getElementById('startAktionAnimation_' + count)) {
    count++;    
  }
  
  return count;
}
//------------------------------------------------------------------------------