window.addEvent('domready', function() {

  var actuBlock;
  if(actuBlock = $('actualites')) {
  
    var actu_height = actuBlock.getHeight().toInt();
    var myEffect = new Fx.Scroll(actuBlock, {duration: 500, transition: Fx.Transitions.Sine.easeOut});
    var actuList = $$('#actualites div.actualite');
    var actuLinks = $$('#actualites a.actu_suite');
    var actuMaxHeight = (actu_height.toInt()*(actuList.length.toInt()-1));

    actuList.each(function(div) {
      div.setStyle('height', actu_height);
    });
    
    actuLinks.each(function(link) {
      link.setStyles({ 'margin':(actu_height-130)+'px 0 0 5px'});
    });

    setInterval(function() {
       var t = (actuBlock.getScroll().y >= actuMaxHeight) ? 0 : actuBlock.getScroll().y + actu_height;
       myEffect.start(0, t);
    },4000);
  
  }
    var sponBlock;
  if(sponBlock = $('sponsors')) {
  
    var spon_height = sponBlock.getHeight().toInt();
    var myEffect2 = new Fx.Scroll(sponBlock, {duration: 500, transition: Fx.Transitions.Sine.easeOut});
    var sponList = $$('#sponsors div.sponsor');
    var sponLinks = $$('#sponsors a.spon_suite');
    var sponMaxHeight = (spon_height.toInt()*(sponList.length.toInt()-1));

    sponList.each(function(div) {
      div.setStyle('height', spon_height);
    });
    

    setInterval(function() {
       var t2 = (sponBlock.getScroll().y >= sponMaxHeight) ? 0 : sponBlock.getScroll().y + spon_height;
       myEffect2.start(0, t2);
    },4000);
  
  }
});