/***************************************************************/
/*
/*
/*
/*
/***************************************************************/

$(document).ready(function(){ //Définir la fonction de clic
 	$('.MenuHorizontal ul').css('display','none');
	$('.MenuHorizontal li').hover(
		function(){
			$(this).find('ul').stop(1,1).animate({'height':184},300);
		}, function(){
			$(this).find('ul').stop(1,1).animate({'height':0},200);
		}
	);
	
	//Changer le comportement hover au survol
   $('.clic').hover(function() { //mouse in
		$(this).css({
			'cursor':'pointer'
		});
		if(!jQuery.support.opacity) {
			/*$(this).stop();
			$(this).stop().animate(
				{ 
					
			}, 200);*/
			
			$(this).css({
					'overflow':'visible'
									});
			
			$(this).fadeTo(200,0.6);
		}
		else {
			$(this).stop().animate(
				{ 
				
				'opacity':0.6
			}, 200);
		}

   }, function() { //mouse out
   		if(!jQuery.support.opacity) {
			/*$(this).stop();
			$(this).stop().animate(
	  			{ 
				
				}, 200);*/
			$(this).fadeTo(200,1);
		}
		else {
			$(this).stop().animate(
				{ 
				
				'opacity':1
			}, 200);
		}
   });
   
 });


function calculer_imc() {
	var taille = document.getElementById('taille_imc').value;
	var poids = document.getElementById('poids_imc').value;
	if(isNaN(taille) || isNaN(poids)) {
		document.getElementById('resultat_imc').innerHTML='<span class="valueError">Les valeurs saisies ne sont pas correctes !</span>';
	} else {
		var resultat =Math.round((poids/(taille*taille))*100)/100;
		if (resultat<18){
			document.getElementById('resultat_imc').innerHTML='<span class="tropMaigre">'+resultat+' : Vous êtes trop maigre.</span>';
			}
		if (resultat>=18 && resultat<25){
			document.getElementById('resultat_imc').innerHTML='<span class="normal">'+resultat+' : Votre poids est normal.</span>';
			}
		if (resultat>=25 && resultat<30){
			document.getElementById('resultat_imc').innerHTML='<span class="legerSurpoids">'+resultat+' : Vous avez un léger surpoids. N\'hésitez pas à me contacter.</span>';
			}
		if (resultat>=30){
			document.getElementById('resultat_imc').innerHTML='<span class="obese">'+resultat+' : Vous êtes en obésité. N\'hésitez pas à me contacter.</span>';
			}
		}
}


