var cat_en_cours = 0;

function sous_pages(cat){
	if(document.getElementById(cat).style.display=='none'){
		$("#"+cat).slideDown(400);
		if(cat_en_cours!=0 && cat_en_cours!=cat){
			$("#"+cat_en_cours).slideUp(400);
		}
		cat_en_cours=cat;
	}else{
		$("#"+cat).slideUp(400);
	}
}

function charge_page(cat){
	if(document.getElementById(cat).style.display=='none'){
		document.getElementById(cat).style.display='';
		cat_en_cours=cat;
	}	
}

var current_news=0;
var effet_en_cours = false;
function go_to_news(num){
	if(effet_en_cours == false){
		effet_en_cours = true;
		
		document.getElementById('actu_vignette_'+current_news).style.display = 'none';
		document.getElementById('actu_vignette_'+num).style.display = '';
		document.getElementById('actu_lien_'+current_news).style.display = 'none';
		document.getElementById('actu_lien_'+num).style.display = '';
		new_margin_left=parseInt(num*420);
		$('#all_img_une').animate({marginLeft: -new_margin_left+'px'}, 500);
		
		
		$("#actu_txt_" + current_news).fadeOut("slow",function(){
			current_news=num;
			$("#actu_txt_" + current_news).fadeIn("slow");
			effet_en_cours = false;
		});
	}
}


var photo_en_cours=0;

function photo_prec(){
	if(photo_en_cours>0){
		photo_en_cours--;
		new_margin_left=parseInt(photo_en_cours*419);
		$('#photos_accueil').animate({marginLeft: -new_margin_left+'px'}, 500);
	}
}
function photo_suiv(photo_max){
	if(photo_en_cours<photo_max-1){
		photo_en_cours++;
		new_margin_left=parseInt(photo_en_cours*419);
		$('#photos_accueil').animate({marginLeft: -new_margin_left+'px'}, 500);
	}
}


