// JavaScript Document
$(document).ready(function(){ 

$("a.nav1_liens").click(function() {
	$("#anim_flash").hide();
	$("#contact").fadeOut("fast");
	$("#contact").show("slow");
	$.get($(this).attr("href"),
		function (c) {
			$("#contact").html(c).fadeIn("slow");	
			$(".haut").bind("click",function(){ $("#contact").fadeOut("slow");})
				$("#btn_en").bind("click",function(){ 
					
					var err = 0;
					var mess="Neccessary fields :\n";
					if ($("#nom").val()=="") { err=1 ; mess = mess +" - Your name\n";} 
					if ($("#telephone").val()=="") { err=1; mess = mess +" - Your phone\n";} 
					if ($("#email").val()=="") { err=1; mess = mess +" - Your email\n";} 
					if ($("#demande").val()=="") { err=1; mess = mess +" - Your message\n";} 
					//
					if (err==0) {
						
					$.post("http://www.hostellerie-fontanges.com/fr/ajax_envoie.php",
						   { nom : $("#nom").val(), prenom : $("#prenom").val(),telephone : $("#telephone").val(),email : $("#email").val(), demande : $("#demande").val(), secu : $("#secu").val()},
						   function(data) { alert(data); $("#contact").fadeOut("slow")					   
						    
						   				  });
					//
					}
					else {
						alert(mess);
					}
				;})	
		});		
	   return false;												
	});







});
