var currentPhotoBandeauIndex = 0;

$(document).ready(function(){
	
	if($("#bandeau img").size()>1){	setInterval("changerBandeau()",5000); }
	
});

function changerBandeau()
{
	var nextPhotoBandeauIndex = currentPhotoBandeauIndex+1;
	
	if(nextPhotoBandeauIndex == $("#bandeau img").size()){ nextPhotoBandeauIndex = 0; }
	
	$("#bandeau img").each(function(index){ if(index==nextPhotoBandeauIndex){ $(this).fadeIn(2500); } });
	$("#bandeau img").each(function(index){ if(index==currentPhotoBandeauIndex){ $(this).fadeOut(2500); } });
	
	currentPhotoBandeauIndex = nextPhotoBandeauIndex;
}


var nbActu = 1;
var current_actu = 1;

function changerActu(id){
	if(id!=current_actu){
		$('.puce').removeClass('on');
		$('#actu_home_'+current_actu).css({zIndex:5, position:"absolute", top:35, backgroundColor:"white"}).fadeOut(500);
		current_actu = id;
		$('#puce_'+current_actu).addClass('on');
		$('#actu_home_'+current_actu).css({zIndex:4, position:"absolute", top:35}).show();
	}
}

function nextActu(){
	var next_actu = current_actu + 1;
	if(next_actu>nbActu){
		next_actu = 1;
	}
	changerActu(next_actu);
}
