jQuery(function() {
				
	jQuery.localScroll.defaults.axis = 'x';
	
	jQuery.localScroll();
	
	jQuery('a[href^=http]:not(.in)').attr({'target':'_blank'});
	
	jQuery("a[rel^=gallery]").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack',
		'titlePosition' : 'inside',
		'titleFormat'   : 'title'
	});
	
	// SCRIPT POUR LA PAGINATION DE NOUVELLES
	
	jQuery('#prevpage').click(function(){
		if (jQuery('.news-listing:first').is(':visible')) {
			jQuery('.news-listing:visible').hide();
			jQuery('.news-listing:last').show();				
		} else {
			jQuery('.news-listing:visible').hide().prev().show();			
		}
		return false;						
	});
					
	jQuery('#nextpage').click(function(){
		if (jQuery('.news-listing:last').is(':visible')) {
			jQuery('.news-listing:visible').hide();
			jQuery('.news-listing:first').show();				
		} else {
			jQuery('.news-listing:visible').hide().next().show();			
		}		
		return false;			
	});
	
	// SCRIPT POUR LA PAGINATION DE MÉDIAS	
	
	jQuery('#prevpage-media').click(function(){
		if (jQuery('.images-listing:first').is(':visible')) {
			jQuery('.images-listing:visible').hide();
			jQuery('.images-listing:last').show();				
		}else {
			jQuery('.images-listing:visible').hide().prev().show();			
		}
		return false;						
	});
					
	jQuery('#nextpage-media').click(function(){
		if (jQuery('.images-listing:last').is(':visible')) {
			jQuery('.images-listing:visible').hide();
			jQuery('.images-listing:first').show();				
		}else {
			jQuery('.images-listing:visible').hide().next().show();			
		}
		return false;			
	});	
	
	// SCRIPT POUR LA PAGINATION DE CALENDRIER
	
	jQuery('#prevpage-calendrier').click(function(){
		if (jQuery('.calendrier-listing:first').is(':visible')) {
			jQuery('.calendrier-listing:visible').hide();
			jQuery('.calendrier-listing:last').show();				
		} else {
			jQuery('.calendrier-listing:visible').hide().prev().show();			
		}
		return false;						
	});
					
	jQuery('#nextpage-calendrier').click(function(){
		if (jQuery('.calendrier-listing:last').is(':visible')) {
			jQuery('.calendrier-listing:visible').hide();
			jQuery('.calendrier-listing:first').show();				
		} else {
			jQuery('.calendrier-listing:visible').hide().next().show();			
		}		
		return false;			
	});
	
	// SCRIPT POUR LA NAVIGATION DES VIDÉOS
	jQuery('#prevpage-video').click(function(){
		if (jQuery('.video-listing:first').is(':visible')) {
			jQuery('.video-listing:visible').addClass("hidden");
			jQuery('.video-listing:last').removeClass("hidden");				
		} else {
			jQuery('.video-listing:visible').addClass("hidden").prev().removeClass("hidden");			
		}
		return false;						
	});
					
	jQuery('#nextpage-video').click(function(){
		if (jQuery('.video-listing:last').is(':visible')) {
			jQuery('.video-listing:visible').addClass("hidden");
			jQuery('.video-listing:first').removeClass("hidden");				
		} else {
			jQuery('.video-listing:visible').addClass("hidden").next().removeClass("hidden");			
		}		
		return false;			
	});
	
	// POUR LA BANNIÈRE
	$('.fade').innerfade({ 
		animationtype: 'fade', 
		speed: 'normal', 
		timeout: 5000, 
		type: 'sequence',
		containerheight: 'auto',
		runningclass: 'innerfade',
		children: null
	});
	
});
