// Função para checar e-mail
function isEmail(str)
{
  // browser suporta expressoes regulares em javascript?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function checkForm3 ( theForm3 )
{
  
  if ( theForm3.nome.value == "" )  {
    alert('Favor digitar seu nome.');
    theForm3.nome.focus();
    return false;
  }
  if ( theForm3.empresa.value == "" )  {
    alert('Favor digitar seu nome da sua Institução.');
    theForm3.empresa.focus();
    return false;
  }
  if ( theForm3.cidade.value == "" )  {
    alert('Favor digitar seu nome da sua Cidade.');
    theForm3.cidade.focus();
    return false;
  }
  if ( theForm3.cep.value == "" )  {
    alert('Favor digitar seu nome da sua Institução.');
    theForm3.cep.focus();
    return false;
  }
  
  if ( theForm3.mail3.value == "" ) 
 {
    alert('Favor digitar seu e-mail.');
    theForm3.mail3.focus();
    return false;
  } 
  else 
  {
    if (isEmail(theForm3.mail3.value)==false ) {
        alert('Digite seu e-mail corretamente.');
        theForm3.mail3.focus();
        return false;
    }
  }  
 
}
