/*alert("bonjour");*/

/* ================================================================ 
Réalisé et adapté par SCH GUILLEMOT
14/10/2009
	renommage complet des div menu afin de rendre cohérent la recherche de code.
=================================================================== */
jQuery().ready(function(){

/* ================================================================ */
/*GESTION DE L'ASCENSEUR DES DOCUMENTS JOINTS*/
/* ================================================================ */
	/*ON CACHE LES LISTES DE DOCS + PHOTOS*/
	$(".docAscenseur").hide();
	
	/*LORS D'UN CLICK ON DEROULE ET ON REROULE*/
	$(".doc h2").click(function(){
	
		$(".doc h2").css({'color' : '#666666'});
		
		if($(this).next(".docAscenseur").is(":hidden")){
			
			$(".docAscenseur").slideUp(500);
			$(".doc h2").css({'backgroundColor' : '#e9e7e7'});
			
			$(this).next(".docAscenseur").slideDown(500);
			$(this).css({'backgroundColor' : '#d9d7d7'});
			$(this).css({'color' : '#000'});
		}
		else{
		
			$(this).next(".docAscenseur:visible").slideUp(500);
			$(this).css({'backgroundColor' : '#e9e7e7'});
			$(this).css({'color' : '#666666'});
			/*$(this).css({'background-position' : '0px 0px'});*/
		}
	});
	
	/*GESTION DES EFFETS AU SURVOL DES ORGANISMES*/
    $(".doc h2").mouseover(function () {
		$(this).css({'color' : '#000'});
		$(this).css({'backgroundColor' : '#d9d7d7'});
	 });

    $(".doc h2").mouseout(function () {
		if($(this).next(".docAscenseur").is(":hidden")){
			$(this).css({'color' : '#666666'});
			$(this).css({'backgroundColor' : '#e9e7e7'});
		}
	});	
/* ================================================================ */
/*GESTION DE L'ASCENSEUR DU MENU DES ORGANISMES*/
/* ================================================================ */
	/*$(".menuOrganisme .ascenseurBoxOrg").hide();*/
	$(".menuOrganisme .ascenseurBoxOrg").hide();
	$(".menuOrganisme h2").click(function(){
	
		$(".menuOrganisme h2").css({'color' : '#808080'});
		
		if($(this).next(".ascenseurBoxOrg").is(":hidden")){
			$(".menuOrganisme .ascenseurBoxOrg").slideUp(500);
			$(this).next(".ascenseurBoxOrg").slideDown(500);
			
			$(".menuOrganisme h2").css({'background-position' : '0px 0px'});			
			$(this).css({'background-position' : '0px -75px'});
			
			$(this).css({'color' : '#000'});
		}
		else{
			
			$(this).next(".ascenseurBoxOrg:visible").slideUp(500);
			$(this).css({'background-position' : '0px 0px'});
			$(this).css({'color' : '#808080'});
			/*$(this).css({'background-position' : '0px 0px'});*/
		}
	});
	
	/*GESTION DES EFFETS AU SURVOL DES ORGANISMES*/
    $(".menuOrganisme h2").mouseover(function () {
		$(this).css({'color' : '#000'});
	 });

    $(".menuOrganisme h2").mouseout(function () {
		if($(this).next(".ascenseurBoxOrg").is(":hidden")){
			$(this).css({'color' : '#808080'});
		}
	});
/* ================================================================ */
/*GESTION DE L'ASCENSEUR DU MENU LIENS*/
/* ================================================================ */	
	$(".menuLien .ascenseurBox").hide();
	$(".menuLien h2").click(function(){
	
		$(".menuLien h2").css({'color' : '#c0c0c0'});
		$(".menuLien h2").css({'background-position' : '0px -34px'});
		
		if($(this).next(".ascenseurBox").is(":hidden")){
			$(".menuLien .ascenseurBox").slideUp(500);
			$(this).next(".ascenseurBox").slideDown(500);/*on ouvre celui que je clique*/
			$(this).css({'background-position' : '0px -64px'});
			$(this).css({'color' : '#FFF'});
		}
		else{
			$(this).next(".ascenseurBox:visible").slideUp(500);
		}
	});
	
	/*GESTION DES EFFETS AU SURVOL DES ORGANISMES*/
    $(".menuLien h2").mouseover(function () {
		$(this).css({'background-position' : '0px -64px'});
		$(this).css({'color' : '#FFF'});
	 });

    $(".menuLien h2").mouseout(function () {
		if($(this).next(".ascenseurBox").is(":hidden")){
			$(this).css({'color' : '#c0c0c0'});
			$(this).css({'background-position' : '0px -34px'});
		}
	});
/* ================================================================ */
/*FIN DE JQUERY*/	
});






