var bannerCount=0;
var bannerArray = new Array();

function BannerCollection(){

    var x = 1;

    while( $('ec_'+x) ){
        
       bannerArray[x-1] = $('ec_'+x)

       x++;
                  
    }
    
}

function ChangeRotateValue( rValue ){
    if( $('rotate') ){
        $('rotate').value = rValue
    }
}

function bannerRotate(){
    
  last = bannerArray[ bannerCount-1 ];
  
  if( last ){
      last.style.display = "none";
  }        
    
  if(bannerCount > bannerArray.length-1){bannerCount=0;}

  next = bannerArray[bannerCount];
  
  if( next ){
      next.style.display = "block";
  }
    
  if( $('rotate') ){
    setTimeout("bannerRotate()", $('rotate').value );
    bannerCount++; 
  }
   
}


