u = window.location;
function dammiurl()
{
  document.Mandaamico.urlpagina.value=u;
  document.Mandaamico.submit();
  return true
 }
var good;
function checkEmailAddress(field) 
	{
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (goodEmail)
		{
   		good = true
		} 
	else 
		{
   		alert('Inserisci un indirizzo valido.')
   		field.focus()
   		field.select()
   		good = false
   		}
	}
function VerificaDati() {
	f = document.Segnalaam;
	var numero = /[^\d]+/;
	if (f.destinatario.value == "") 
		{
		alert ("L'email del Destinatario è un dato obbligatorio");
		return false;
		}
	else
		{
		good = false
		checkEmailAddress(f.destinatario)
		if (good == false)
			{
			return false;
			}
		}
	if (f.nomemitt.value == "") {
		alert ("Il nome del mittente è un dato obbligatorio");
		return false;
	}
	if (f.mittente.value == "") 
		{
		alert ("L'email del Mittente è un dato obbligatorio");
		return false;
    	}
	else
		{
		good = false
		checkEmailAddress(f.mittente)
		if (good == false)
			{
			return false;
			}
		}
	return true;
}

