$(document).ready(function(){

	//Défilement des news
	posStart = 0;
    compteur = 0;
    $('#liste_news').find('li').each(function() {
        $(this).css('top', posStart+'px');
        posStart +=  $(this).height();
        compteur++;
    });
    
    if(compteur > 1)
    {
        startDefil();
	}
    
    $("a#video").fancybox({
    'hideOnContentClick':false,
	'frameWidth' : 320,
	'frameHeight' : 260,
    'padding'		: 0,
    'autoScale'		: false,
	'transitionIn'	: 'none',
	'transitionOut'	: 'none',
    'overlayOpacity' : 0.6,
    'overlayColor' : '#353535'       

}); 
});


function startDefil()
{
    $('#liste_news').find('li').each(function() {
    	var position = $(this).position();
    	var topDest = position.top - $(this).height();
    	
    	$(this).animate({ 
            top: topDest +'px'
            }, 2000);
    });
    
    window.setTimeout(function() {
        var position = $('ul#liste_news>li:last').position();
        var hauteur = $('ul#liste_news>li:last').height();
        var dest = position.top + hauteur;
        
        $('#liste_news>li:first').clone().insertAfter('#liste_news>li:last').css('top', dest+'px');
        $('#liste_news>li:first').remove();
        startDefil()
        
    },9000);	
}






