	function calcul_salaire()
	{
		
		//alert($("#age").val()+"|"+$("#niveau").val());
		var smic = 1343.80;
		var coef = 1.27;
		
		if ( $("#age").val() == "" || $("#niveau").val() == "choisisez votre niveau"  ) 
		{
			
			alert('veuillez renseigner votre âge ou votre niveau scolaire');	
			
		}
		else
		{
			if ( $("#age").val() < 21  )
			{
				
				if ( $("#niveau").val() == 1 )
				{ 
						
						var result = ( smic * 55  ) / 100;
						$("#result").html(result +"€ brut <br/><span style='font-size:12px'>soit "+ Math.round(result/coef*100)/100 +"€ net</span> ");		
				}
				if ( $("#niveau").val() == 2 )
				{ 
						var result = ( smic * 65  ) / 100;
						$("#result").html(result +"€ brut <br/><span style='font-size:12px'>soit "+ Math.round(result/coef*100)/100 +"€ net</span> ");				
				}			
			}
			if ( $("#age").val() == 21 || $("#age").val() < 26  )
			{
				if ( $("#niveau").val() == 1 )
				{ 
						var result = ( smic * 70  ) / 100;
						$("#result").html(result +"€ brut <br/><span style='font-size:12px'>soit "+ Math.round(result/coef*100)/100 +"€ net</span> ");		
				}
				if ( $("#niveau").val() == 2 )
				{ 
						var result = ( smic * 80  ) / 100;
						$("#result").html(result +"€ brut <br/><span style='font-size:12px'>soit "+ Math.round(result/coef*100)/100 +"€ net</span> ");			
				}	
			}		
			if ( $("#age").val() >= 26 )
			{
						var result = ( smic * 55  ) / 100;
						$("#result").html(result +"€ brut <br/><span style='font-size:12px'>soit "+ Math.round(result/coef*100)/100 +"€ net</span> ");							
				
			}		
		}
	}
	
	
	
	
	
	
	
	
	
	function envoinumero()
	{

		if ( $("#onvousrappelleinput").val() != ""  )
		{
			var tel = $("#onvousrappelleinput").val();
			var verif = /^[0-9]{10}$/
			//alert(tel.length);
			if (  tel.length < 10 )
			{
				$("#telaccueil").html("Numero invalide");	
				$("#telaccueil").fadeIn("fast");		
				
			}
			else
			{
				
				if (verif.exec($("#onvousrappelleinput").val()) == null)
				{ 
					$("#telaccueil").html("Numero invalide");	
					$("#telaccueil").fadeIn("fast");
	
				}
				else
				{				
				
					
					if ( $("#activiteEcasport").val()*1 + $("#activiteInformatique").val()*1 + $("#activiteEcole").val()*1 +$("#activiteFormation").val()*1 == 4 )
					{
						alert('choisissez au moins une activité');	
					}
					else
					{
					
						$("#fond_contact_tel").fadeIn("slow",function(){$(".highslide").animate( {marginTop:"190px"},function(){
								$(".highslide").animate( {marginTop:"120px"});	
							})});	
						$.post("contact_ajax.php", { 
						   tel: $("#onvousrappelleinput").val(),
						   ecasport: $("#activiteEcasport").val(),
						   informatique: $("#activiteInformatique").val(),
						   ecole: $("#activiteEcole").val(),
						   formation: $("#activiteFormation").val(),
						   arapeler:1
						   },
							function(data){	
									
									$("#onvousrappelleinput").val("")
							 },"html" );
					}
				}
			}
		}
		else
		{

			$("#telaccueil").fadeIn("fast");	
			
		}
		
	}
	function closeform_tel()
	{
			$(".highslide").animate( {marginTop:"190px"}, function(){
				$(".highslide").animate( {marginTop:"-560px"}, function(){ $("#fond_contact_tel").fadeOut("fast")});																
			});
	}	

	var delay_montant = 250;
	var delay_descendant = 250;
	
	
	
	$(document).ready( function(){
	// --------------------------------------------------------------------------------- //	
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	
		
		$("#checkboxEcasport").live("mouseover",function(){ 
			if ( $("#activiteEcasport").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px 130px"});
			}
			else
			{
				$(this).css({backgroundPosition:"0px 65px"});	
			}
			
		  });
		$("#checkboxEcasport").live("mouseout",function(){ 
			if ( $("#activiteEcasport").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteEcasport").val() * - 130  +"px"});	
			}
			else
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteEcasport").val() * - 65  +"px"});		
			}
		
				
		});
		
		$("#checkboxAgilisInfo").live("mouseover",function(){ 
			if ( $("#activiteInformatique").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px 130px"});
			}
			else
			{
				$(this).css({backgroundPosition:"0px 65px"});	
			}
			
		  });
		$("#checkboxAgilisInfo").live("mouseout",function(){ 
			if ( $("#activiteInformatique").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteInformatique").val() * - 130  +"px"});	
			}
			else
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteInformatique").val() * - 65  +"px"});		
			}
		
				
		});		
		
		
		$("#checkboxEcole").live("mouseover",function(){ 
			if ( $("#activiteEcole").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px 130px"});
			}
			else
			{
				$(this).css({backgroundPosition:"0px 65px"});	
			}
			
		  });
		$("#checkboxEcole").live("mouseout",function(){ 
			if ( $("#activiteEcole").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteEcole").val() * - 130  +"px"});	
			}
			else
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteEcole").val() * - 65  +"px"});		
			}
		
				
		});
		
		
		$("#checkboxFormation").live("mouseover",function(){ 
			if ( $("#activiteFormation").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px 130px"});
			}
			else
			{
				$(this).css({backgroundPosition:"0px 65px"});	
			}
			
		  });
		$("#checkboxFormation").live("mouseout",function(){ 
			if ( $("#activiteEcasport").val() == 0 )
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteFormation").val() * - 130  +"px"});	
			}
			else
			{
				$(this).css({backgroundPosition:"0px "+ $("#activiteFormation").val() * - 65  +"px"});		
			}
		
				
		});				
	
				

            
            
           	
	
	
	
	
	
	
	
	$(".dossier_photo_miniature").hover(function(){$(this).css("opacity","0.7")},function(){$(this).css("opacity","1");})

	





			
	$("#contenu_ancien_site").css({opacity:"0.5"});
	$('.sponsorFlip').bind("click",function(){
		
		// $(this) point to the clicked .sponsorFlip element (caching it in elem for speed):
		
		var elem = $(this);
		
		// data('flipped') is a flag we set when we flip the element:
		
		if(elem.data('flipped'))
		{
			// If the element has already been flipped, use the revertFlip method
			// defined by the plug-in to revert to the default state automatically:
			
			elem.revertFlip();
			
			// Unsetting the flag:
			elem.data('flipped',false)
		}
		else
		{
			// Using the flip method defined by the plugin:
			
			elem.flip({
				direction:'lr',
				speed: 350,
				onBefore: function(){
					// Insert the contents of the .sponsorData div (hidden from view with display:none)
					// into the clicked .sponsorFlip div before the flipping animation starts:
					
					elem.html(elem.siblings('.sponsorData').html());
				}
			});
			
			// Setting the flag:
			elem.data('flipped',true);
		}
	});			
			
			

		

		
		
		
		if ( $("#image1").length == 1 && $("#image2").length == 1 &&  $("#image3").length == 1 &&  $("#image4").length == 1  )
		{
		   //alert('coucou');
		
			
			
			
			$("#bloc1").hover(
				function(){
					if ( $("#texte_fond_noir1").css("marginTop") == "-70px" )
					{
						$("#texte_fond_noir1").animate( {marginTop:"-270px",height:"250px"},delay_montant);
						$("#texte_fond_noir1 > p").fadeIn("fast");
						$("#bloc1 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 -84px"});
					}
				},				  
				function(){
	
						$("#texte_fond_noir1").animate( {marginTop:"-70px",height:"50px"},delay_descendant);
						$("#texte_fond_noir1  > p").fadeOut("fast");
						$("#bloc1 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 0px"});
				}
			);						
			$("#bloc2").hover(
				function(){
					if ( $("#texte_fond_noir2").css("marginTop") == "-70px" )
					{
						$("#texte_fond_noir2").animate( {marginTop:"-270px",height:"250px"},delay_montant);
						$("#texte_fond_noir2 > p").fadeIn("fast");
						$("#bloc2 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 -84px"});
					}
				},				  
				function(){$("#texte_fond_noir2").animate( {marginTop:"-70px",height:"50px"},delay_descendant);
				$("#texte_fond_noir2  > p").fadeOut("fast");
				$("#bloc2 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 0px"});
			});	
			$("#bloc3").hover(
				function(){
					if ( $("#texte_fond_noir3").css("marginTop") == "-70px" )
					{
						$("#texte_fond_noir3").animate( {marginTop:"-270px",height:"250px"},delay_montant);
						$("#texte_fond_noir3 > p").fadeIn("fast");
						$("#bloc3 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 -84px"});
					}
				},				  
				function(){$("#texte_fond_noir3").animate( {marginTop:"-70px",height:"50px"},delay_descendant);
				$("#texte_fond_noir3  > p").fadeOut("fast");
				$("#bloc3 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 0px"});
			});		
			$("#bloc4").hover(
				function(){
					if ( $("#texte_fond_noir4").css("marginTop") == "-70px" )
					{
						$("#texte_fond_noir4").animate( {marginTop:"-270px",height:"250px"},delay_montant);
						$("#texte_fond_noir4 > p").fadeIn("fast");
						$("#bloc4 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 -84px"});
					}
				},				  
				function(){$("#texte_fond_noir4").animate( {marginTop:"-70px",height:"50px"},delay_descendant);
				$("#texte_fond_noir4  > p").fadeOut("fast");
				$("#bloc4 > .bouton").css({background:"url(http://ressources.agilis.fr/images/bouton.jpg) no-repeat 0 0px"});
			});	
		}

		//------------------------------------------------------				

		$("#titre_actu").live("keypress", function(){$("#url_actu").val($("#titre_actu").val())}) ; 
		
		//------------------------------------------------------
		
		
		$("#inputnom").live("keypress",function(){$("#nameverif").fadeOut("slow");$("#acceptnom").fadeOut("slow");});
		$("#inputprenom").live("keypress",function(){$("#prenomverif").fadeOut("slow");$("#acceptprenom").fadeOut("slow");});
		$("#inputtel").live("keypress",function(){$("#telverif").fadeOut("slow");$("#accepttel").fadeOut("slow");});
		$("#inputmail").live("keypress",function(){$("#mailverif").fadeOut("slow");$("#acceptemail").fadeOut("slow");});
		$("#inputdemande").live("keypress",function(){$("#demandeverif").fadeOut("slow");$("#acceptdemande").fadeOut("slow");});
		$("#onvousrappelleinput").live("keypress",function(){$("#demandeverif").fadeOut("slow");$("#telaccueil").fadeOut("slow", function(){$("#telaccueil").html("Numero de téléphone ?");});	});
		
		// formulaire de ecole-superieure.agilis.fr
		$("#nom").live("keypress",function(){$("#nameverif").fadeOut("slow");$("#acceptnom").fadeOut("slow");});
		$("#prenom").live("keypress",function(){$("#prenomverif").fadeOut("slow");$("#acceptprenom").fadeOut("slow");});
		$("#tel").live("keypress",function(){$("#telverif").fadeOut("slow");$("#accepttel").fadeOut("slow");});
		$("#email").live("keypress",function(){$("#mailverif").fadeOut("slow");$("#acceptemail").fadeOut("slow");});
		$("#demande").live("keypress",function(){$("#demandeverif").fadeOut("slow");$("#acceptdemande").fadeOut("slow");});
		
		
		$("#menu_formation").animate({marginLeft:"0px"},2000);
		$("#action_menu").live("click", function(){
			if ( $("#menu_formation").css("marginLeft") == "0px" )
			{
				$("#menu_formation").animate({marginLeft:"-160px"},200);
				$("#action_menu").css({background:"url(http://ressources.agilis.fr/images/ouvre.png"});
			}
			else
			{
				$("#menu_formation").animate({marginLeft:"0px"},200);
				$("#action_menu").css({background:"url(http://ressources.agilis.fr/images/ferme.png"});	
			}
		});
	
		$("#gallery").coinslider();
		$("#gallery2").coinslider();
		$("#coin-slider").coinslider();
	
			
				
		zoombox.init();
				

		
				
			
	// --------------------------------------------------------------------------------- //	
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- //
	// --------------------------------------------------------------------------------- /
	});
	
	function openform()
	{
		$("#fond_contact").fadeIn("slow",function(){$(".highslide").animate( {marginTop:"190px"},function(){
				$(".highslide").animate( {marginTop:"120px"});	
			})});	
	}
	function closeform()
	{
			$(".highslide").animate( {marginTop:"190px"}, function(){
				$(".highslide").animate( {marginTop:"-560px"}, function(){ $("#fond_contact").fadeOut("fast")});																
			});
	}	
	function verif_form()
	{
		
		var count = 0;
		if ( $("#inputnom").val() == "" )
		{
			$("#nameverif").fadeIn("slow");
			$("#inputnom").css({border:"1px solid #55679A"});
			$("#acceptnom").fadeOut("slow");
		}else
		{
			$("#acceptnom").fadeIn("slow");
			//$("#inputnom").css({border:"1px solid #00ff00"});
			count++;	
		}
		
		if ( $("#inputprenom").val() == "" )
		{
			$("#prenomverif").fadeIn("slow");
			$("#inputprenom").css({border:"1px solid #55679A"});
			$("#acceptprenom").fadeOut("slow");
		}else
		{
			$("#acceptprenom").fadeIn("slow");
			count++;	
		}		
		
		if ( $("#inputtel").val() == "" )
		{
			$("#telverif").fadeIn("slow");
			$("#inputtel").css({border:"1px solid #55679A"});
			$("#accepttel").fadeOut("slow");
		}else
		{
			$("#accepttel").fadeIn("slow");
			count++;	
		}			

		if ( $("#inputmail").val() == "" )
		{
			$("#mailverif").fadeIn("slow");
			$("#inputmail").css({border:"1px solid #55679A"});
			$("#acceptemail").fadeOut("slow");
		}
		else
		{
			
			var verif = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}$/
			if (verif.exec($("#inputmail").val()) == null)
			{ 
				$("#mailverif").html("email incorrecte");	
				$("#mailverif").fadeIn("slow");

			}
			else
			{
				$("#acceptemail").fadeIn("slow");
				count++;
			}
		}	

		if ( $("#inputdemande").val() == "" )
		{
			$("#demandeverif").fadeIn("slow");
			$("#inputdemande").css({border:"1px solid #55679A"});
			$("#acceptdemande").fadeOut("slow");
		}else
		{
			$("#acceptdemande").fadeIn("slow");
			count++;	
		}	
		
		if (  count == 5 )
		{
			$("#img_contact").html("<img src=\"http://ressources.agilis.fr/images/ajax-loader.gif\" alt=\"message en cours d'envoi\" class=\"transparent\"  /><br/><br/>Message en cours d'envoi")
			$.post("contact_ajax.php", { 
				   nom: $("#inputnom").val(),
				   prenom:$("#inputprenom").val(),
				   telephone:$("#inputtel").val(),
				   email:$("#inputmail").val(),
				   demande:$("#inputdemande").val()
				   },
			function(data){	
					$("#img_contact").animate({paddingTop:"0px"},3000,function(){
						$("#formulaire").fadeOut("slow",function(){$("#formulaireOk").fadeIn("fast");$("#titre_popup_contact").html("Merci...");});														  
					});
					
					//$("#formulaire").html($("#formulaireOk").html());	
			 },"html" );
			return false	
		}
		else
		{
			return false;
		}
	}
	

	function verif_form_ecole_sup()
	{
		//alert('coucou');
		var count = 0;
		if ( $("#nom").val() == "" )
		{
			$("#nameverif").fadeIn("slow");
			$("#nom").css({border:"1px solid #55679A"});
			$("#acceptnom").fadeOut("slow");
		}else
		{
			$("#acceptnom").fadeIn("slow");
			//$("#inputnom").css({border:"1px solid #00ff00"});
			count++;	
		}
		
		if ( $("#prenom").val() == "" )
		{
			$("#prenomverif").fadeIn("slow");
			$("#prenom").css({border:"1px solid #55679A"});
			$("#acceptprenom").fadeOut("slow");
		}else
		{
			$("#acceptprenom").fadeIn("slow");
			count++;	
		}		
		
		if ( $("#tel").val() == "" )
		{
			$("#telverif").fadeIn("slow");
			$("#tel").css({border:"1px solid #55679A"});
			$("#accepttel").fadeOut("slow");
		}else
		{
			$("#accepttel").fadeIn("slow");
			count++;	
		}			

		if ( $("#email").val() == "" )
		{
			$("#mailverif").fadeIn("slow");
			$("#email").css({border:"1px solid #55679A"});
			$("#acceptemail").fadeOut("slow");
		}
		else
		{
						
			var verif = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}$/
			if (verif.exec($("#email").val()) == null)
			{ 
				$("#mailverif").html("email incorrecte");	
				$("#mailverif").fadeIn("slow");

			}
			else
			{
				$("#acceptemail").fadeIn("slow");
				count++;
			}
		}	

		if ( $("#demande").val() == "" )
		{
			$("#demandeverif").fadeIn("slow");
			$("#demande").css({border:"1px solid #55679A"});
			$("#acceptdemande").fadeOut("slow");
		}else
		{
			$("#acceptdemande").fadeIn("slow");
			count++;	
		}
		
		if (  count ==5 )
		{

			return true	
		}
		else
		{
			return false;
		}
	}
	
	
	
	function checkperso(id,id_form)
	{
		
		if ( $("#"+id_form).val() == 1  )
		{
			$("#"+id).css({backgroundPosition:"0px 0px"});
			$("#"+id_form).val("0");
			//alert("je suis 1");
		}
		else if ( $("#"+id_form).val() == 0  ) 
		{
			//alert("je suis 0");
			$("#"+id).css({backgroundPosition:"0px -65px"});
			$("#"+id_form).val("1");	
		}
		
			
		
		
		
	}

	function envoinewsltter()
	{

		if ( $("#emailAginews").val() != ""  )
		{
			var tel = $("#emailAginews").val();
			var verif = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}$/
			//alert(tel.length);

				
				if (verif.exec($("#emailAginews").val()) == null)
				{ 
					$("#newsletteraccueil").html("Email invalide");	
					$("#newsletteraccueil").fadeIn("fast");
	
				}
				else
				{				
						alert("Email enregistré pour la newsletter");
						$("#newsletteraccueil").fadeOut("fast");	
					
						$("#fond_contact_newsletter").fadeIn("slow",function(){$(".highslide").animate( {marginTop:"190px"},function(){
								$(".highslide").animate( {marginTop:"120px"});	
							})});	
						$.post("contact_ajax.php", { 
						   newsletter: 1,
						   email: $("#emailAginews").val()},
							function(data){	
									
									$("#emailAginews").val("Votre adresse Email")
							 },"html" );
							
						
				}
			
		}
		else
		{

			$("#telaccueil").fadeIn("fast");	
			
		}
		
	}	
	
	function closeform_newsletter()
	{
			$(".highslide").animate( {marginTop:"190px"}, function(){
				$(".highslide").animate( {marginTop:"-560px"}, function(){ $("#fond_contact_newsletter").fadeOut("fast")});																
			});
	}		
