copyNotice =  'jsFORM WebDivision [1999-2006]'
function form_swm_validator(theForm) //ver 04.2002 swm
{
	if (theForm.nome.value == "")  {    alert("Scriva il suo Nome\n\n" + copyNotice);    theForm.nome.focus();    return (false);  }
	if (theForm.cognome.value == "")  {    alert("Scriva il suo Cognome\n\n" + copyNotice);    theForm.cognome.focus();    return (false);  }
	if (theForm.telefono.value == "") {    alert("Inserire un valore per il campo \"Telefono\".");    theForm.telefono.focus();    return (false);  }
	if (theForm.email.value == "")  {    alert("Inserire un indirizzo E-mail.\n\n" + copyNotice);    theForm.email.focus();    return (false);  }

	if (theForm.richiesta.value == "")  {    alert("Scriva la sua richiesta.\n\n" + copyNotice);  theForm.richiesta.focus();    return (false);  }
	if (theForm.richiesta.value.length < 15)  {    alert("La richiesta dovrebbe essere almeno di qualche parola.\n\n" + copyNotice);    theForm.richiesta.focus();    return (false);  }

  i = theForm.email.value.indexOf("@");
  j = theForm.email.value.indexOf(".",i);
  k = theForm.email.value.indexOf(",");
  gt = theForm.email.value.indexOf(">");
  lt = theForm.email.value.indexOf("<");
  kk = theForm.email.value.indexOf(" ");
  ii = theForm.email.value.lastIndexOf("@");
  jj = theForm.email.value.lastIndexOf(".")+1;
  len = theForm.email.value.length;
  if ((i>0) && (j>(i+1)) && (k==-1) && (gt==-1) && (lt==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3) && (i==ii))
    return true;
  else {
    alert("Attenzione '" + theForm.email.value + "' non è un indirizzo email corretto.\n\n" + copyNotice);
    theForm.email.focus();
    return false;
  }

return (true);
}

