var duration = 6; //in seconds

var displayList = Array();
var maxList;
var current = 0;
onLoadInitRotate = 1;

function initRotate() {
  
  var divList = document.getElementsByTagName("div");
  
  for (var i=0;i<divList.length;i++) {
    
    if((divList[i].className == "rechts") || (divList[i].className == "rechts_invisible")) {
      displayList.push(divList[i]);
    }
    
  }
  
  maxList = displayList.length-1;
  
  if(maxList > 0) {
    setInterval("rotate()",duration*1000);
  }
  
}
  
function rotate() {
  
  displayList[current++].className = "rechts_invisible";
  
  if (current > maxList) {
    current = 0; 
  }   
  
  displayList[current].className = "rechts";
  
}

