// JavaScript Document

// Verifica se os campos est&#1075;o OK 

function valida()
{
 var texto, msgaux, erro, atPos; 
 msgaux = 'Volte ao campo descrito abaixo e complete a informação:' 
 erro=false;


// campo nome DA PESSOA
 texto = document.facas.nome.value; 
 if (texto.length < 3)  
 { 
     msgaux+='\n- Campo NOME não está Completo';      
     erro=true;
 } 

// campo EMAIL
texto = document.facas.email.value;
    if (texto.length < 5) { 
        msgaux+='\n- Campo EMAIL não está Completo';         
        erro=true;
    } 
	else {
		atPos= document.facas.email.value.indexOf('@');
        if (atPos < 1 || atPos == (document.facas.email.value.length - 1)) {
			msgaux+='\n- Campo EMAIL não está Completo';         
	        erro=true;
		}
	}

  if (erro) alert(msgaux);
return !(erro);
}