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

    $('top10_pause').setStyle('opacity',0);    
    $('blc_top10').setStyle('visibility', 'visible'); 
    
    if(top10NbResults<=nbShowTop)
    {
        $('top10_previous').setStyle('display', 'none');
        $('top10_next').setStyle('display', 'none');
        return;
    }
    else
    {
        $('blc_top10').setStyle('width', (nbShowTop*112)+40);       
        $('top10_content').setStyle('width', top10NbResults*112*3);
    }
   
	var carousel=new iCarousel("top10_content", {		
        idPause: "top10_pause",
		item: {
			klass: "top10_item",
			size: 112
		},
		animation: {
            type: 'scroll',
            transition: Fx.Transitions.Cubic.easeInOut,
			duration: 1000,
			amount: nbShowTop,
            rotate: {
                type: "auto",
                interval: 6000,
                onMouseOver: "stop"
            }
		}
	});
    
    $('top10_previous').addEvent('mouseenter',function(){
        if(carousel.options.animation.rotate.type=="auto"){carousel._pause();}
    });
    
    $('top10_previous').addEvent('mouseleave',function(){
        if(carousel.options.animation.rotate.type=="auto"){carousel._play();}       
    });   
    
    $('top10_previous').addEvent('click',function(){
        carousel._previous();
    });   
    
    $('top10_next').addEvent('mouseenter',function(){
        if(carousel.options.animation.rotate.type=="auto"){carousel._pause();}
    });
    
    $('top10_next').addEvent('mouseleave',function(){
        if(carousel.options.animation.rotate.type=="auto"){carousel._play();}       
    });
    
    $('top10_next').addEvent('click',function(){
        carousel._next();
    }); 
});
