function verify(frm)
{

if (frm.name == 'registra')
{

ok = 0;

Ctrl = frm.emailregistra;
result = false;
space_tokens = Ctrl.value.split(" ");
if (space_tokens.length == 1) {
at_tokens = Ctrl.value.split("@");
if (at_tokens.length == 2) {
if (at_tokens[1].length != 0) {
   right_dot_tokens = at_tokens[1].split(".");
   if (right_dot_tokens.length >= 2) {
   if (right_dot_tokens[1].length != 0) {
   result=true;}}}}}

if (frm.nome.value == "")
    {
     errorString = "Il NOME è obbligatorio";
     alert(errorString);
     frm.nome.focus();
     ok = 1;
    }

else if (frm.giorno.value == "0" && frm.mese.value == "0" && frm.anno.value == "0")
    {
     errorString = "La DATA DI NASCITA è obbligatoria";
     alert(errorString);
     frm.giorno.focus();
     ok = 1;
    }

else if (frm.giorno.value == "0")
    {
     errorString = "La DATA DI NASCITA non è completa, inserisci il GIORNO DI NASCITA";
     alert(errorString);
     frm.giorno.focus();
     ok = 1;
    }

else if (frm.mese.value == "0")
    {
     errorString = "La DATA DI NASCITA non è completa, inserisci il MESE DI NASCITA";
     alert(errorString);
     frm.mese.focus();
     ok = 1;
    }

else if (frm.anno.value == "0")
    {
     errorString = "La DATA DI NASCITA non è completa, inserisci l'ANNO DI NASCITA";
     alert(errorString);
     frm.anno.focus();
     ok = 1;
    }

else if (frm.sesso[0].checked == false && frm.sesso[1].checked == false)
    {
     errorString = "L'indicazione del SESSO è obbligatoria";
     alert(errorString);
     ok = 1;
    }

else if (frm.cap.value == "")
    {
     errorString = "Il Codice Avviamento Postale (CAP) è obbligatorio";
     alert(errorString);
     frm.cap.focus();
     ok = 1;
    }

else if (frm.citta.value == "")
    {
     errorString = "La CITTA' è obbligatoria";
     alert(errorString);
     frm.citta.focus();
     ok = 1;
    }

else if (frm.provincia.value == "--")
    {
     errorString = "La PROVINCIA è obbligatoria";
     alert(errorString);
     frm.provincia.focus();
     ok = 1;
    }

else if (frm.cellulare_pre.value == "")
    {
     errorString = "Il numero di cellulare NON è completo";
     alert(errorString);
     frm.cellulare_pre.focus();
     ok = 1;
    }

else if (frm.cellulare_num.value == "")
    {
     errorString = "Il numero di cellulare NON è completo";
     alert(errorString);
     frm.cellulare_num.focus();
     ok = 1;
    }

else if (!result){
           errorString = "Inserisci un'indirizzo E-MAIL valido";
           alert(errorString);
           Ctrl.focus();
           ok = 1;
           }

else if (frm.regolamento.value == "NO")
    {
     errorString = "Per completare la registrazione è necessario accettare il REGOLAMENTO E L'INFORMATIVA A TUTELA DELLA PRIVACY";
     alert(errorString);
     frm.regolamento.focus();
     ok = 1;
    }

if (ok == 0)
   document.registra.submit();

}
}

function start(winflash, x, y, bar)
{
window.open(winflash,'','scrollbars='+bar+',screenX=150,screenY=50,left=150,top=50,resizable=0,menubar=0,toolbar=0,status=0,width='+x+',height='+y);
}

function openflash(winflash, x, y)
{
ind="immagini/"+winflash;
window.open(ind,'','scrollbars=0,screenX=150,screenY=50,left=150,top=50,resizable=0,menubar=0,toolbar=0,status=0,width='+x+',height='+y);
}
