// JavaScript Document
function checkEmail(toCheck) {
			if (/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test(toCheck)) return true; else return false;
		}
		
function salvamail(){
	var error=0;
	var mail=$('#email').val();	
	if (!checkEmail(mail)) {
		$('#msg').html("Indirizzo e-mail non valido"); 		
		error=1;
	}		
if(error==0){
  	$("#msg").html("Operazione in corso...");
		$.ajax({		 
		   type: "POST",
		   url: "include/m_action.php",
		   data: "action=insertm&nome=&mail="+mail,
		   success: function(msg){
			   $("#msg").html(msg);			   
		   } });	
	}

}

