$( document ).ready(function() {

    if($('.diapo').length > 0) {
        //setInterval(actuScrolling(actualActu, actualPosition), 3000 )
        setInterval(function(){
            var cssHide = {'display': 'none', 'visibility': 'hidden'};
            var currentActu = $(".actu:visible");
            var currentPosition = (currentActu).attr("data-position")
            var currentIndicator = $('.actu-indicators').find('li[data-position='+currentPosition+']')

            currentActu.css(cssHide);
            currentIndicator.removeClass('active')


            var newPosition = parseInt(currentPosition)+1;
            if(newPosition >= nbActu)
                var newPosition = 0;

            var newCurrentActu = $(".actu[data-position="+newPosition+"]")
            var newCurrentIndicator = $('.actu-indicators').find('li[data-position='+newPosition+']')

            $(newCurrentActu).removeAttr('style')
            $(newCurrentIndicator).addClass('active')

        }, 6000);
    }
});