// JavaScript Document

function is_email(email)
    {
      er = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2}/;
      
      if(er.exec(email))
        {
          return true;
        } else {
          return false;
        }
    }
	
function validaInscricao(){
	
	if(document.getElementById('pessoa_nome').value == "")
	{ 
		document.getElementById('pessoa_nome').style.borderColor = "red";
		alert('O campo nome \u00e9 de preenchimento obrigat\u00f3rio.');
		document.getElementById('pessoa_nome').focus();
		
		return false;
	}else if(document.getElementById('empresa_nome').value == ""){
		document.getElementById('empresa_nome').style.borderColor = "red";
		alert('O campo Empresa \u00e9 de preenchimento obrigat\u00f3rio.');
		document.getElementById('empresa_nome').focus();
		
		return false;
	}
	
	var mail = document.getElementById('pessoa_email').value;
		
		if(!is_email(mail))
		{	
			document.getElementById('pessoa_email').style.borderColor = "red";
			alert('O campo email \u00e9 de preenchimento obrigat\u00f3rio. \n ex: seu-email@provedor.com.br');
			document.getElementById('pessoa_email').focus();
			
			return false;
		}
	
  return true; //SE PASSAR POR TUDO ENVIA
  
 }
