$(document).ready(function() {

   $('#menu_principal>li>a').mouseenter(
		function () {
	        //show its submenu
	        $(this).siblings('ul').slideDown(100);
   });	
   $('#menu_principal>li').mouseleave(
		function () {
			$(this).children('ul').slideUp(100);
   });
   
    jQuery.validator.addMethod("phone", function(phone_number, element) {
		phone_number = phone_number.replace(/\s+/g, ""); 
		return this.optional(element) || phone_number.length > 9 &&
		phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
	}, "Please specify a valid phone number");

   
   $('#soumission').validate({
	errorElement: "p",
	errorLabelContainer: "#zoneerreur"
   });
});
