function postcontact() {
		
		//hide the form
		$('#containercontact').hide();
		
		//show the loading bar
		$('.loader').append($('.bar')); 
		$('.bar').css({display:'block'});
		
		//send the ajax request  
		$.get('/wp-content/themes/kilone/mail.php',{name:$('#name').val(), email:$('#email').val(), comment:$('#message').val()},
	
		//return the data
		function(data){
			//hide the graphic
			$('.bar').hide(); 
			$('.loader').append(data);  
		});	
	
		//stay on the page					
		return false;	

};

$(function() {

	$("#contactForm").validate({
		 messages: {
		 name: "<span style=\"color:#A10000\">indiquez votre nom</span>",
		 email: {required: "<span style=\"color:#A10000\">email obligatoire</span>",email: "<span style=\"color:#A10000\">votre adresse email doit &ecirc;tre au bon format</span>"},
		 message: "<span style=\"color:#A10000\">il faut un message!</span>",
	   },				   
	   submitHandler: function(form) {
		postcontact();
	   }
	})

});
