$(document).ready(function(){
													 
  // DROPDOWN MENU	
	function slideDown() {
		$(this).children('ul').slideDown(200, 'easeOutQuint');
	};
	function slideUp() {
		$(this).children('ul').slideUp(200, 'easeInQuint');
	};
	var hoverIntentConfig = {    
			 over: slideDown,  
			 out: slideUp,
			 timeout: 200,
			 interval: 50
	};	
	$('#menuh-container ul.drop_menu li').hoverIntent(hoverIntentConfig);
	
});

/////////////// CONTROLLO FORM

function controllo_form(theForm){
	if (theForm.nome.value == "") {
    	alert("Per favore inserire il vostro nome.\nGrazie.");
    	theForm.nome.focus();
    	return (false);
	}
	if (theForm.cognome.value == "") {
    	alert("Per favore inserire il cognome.\nGrazie.");
    	theForm.cognome.focus();
    	return (false);
	}
	if (theForm.telefono.value == "") {
		alert("Per favore inserire il proprio numero di telefono, grazie.");
		theForm.telefono.focus();
		return (false);
	}
	if (theForm.from.value == "") {
		alert("Per favore inserire il proprio indirizzo E-Mail, grazie.");
		theForm.from.focus();
		return (false);
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.from.value))) {
		alert("Indirizzo E-Mail non valido, si prega di verificarlo");
		theForm.from.focus();
		return (false);
	}
	if (!theForm.privacy.checked) {
    	alert("Per favore acconsentire al trattamento dei dati personali, grazie.");
      theForm.privacy.focus();
      return (false);
	}
}

