
function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}


function FormValidator_pesquisa(theForm)
{
	if (theForm.pesquisa.value == "")
	{
	alert("Por favor insira a expressão a pesquisar.");
	theForm.pesquisa.focus();
	return (false);
	}
return (true);
}


function FormValidator(theForm)
{
	if (theForm.nome.value == "")
	{
	alert("Por favor escreva os seus dados para o campo \"Nome\".");
	theForm.nome.focus();
	return (false);
	}

	if (theForm.email.value == "")
	{
	alert("Por favor escreva os seus dados para o campo \"Email\".");
	theForm.email.focus();
	return (false);
	}
	
	if (theForm.email.value.length >0)
	{
	if (!isEmailAddr(theForm.email.value))
	{
	alert("Por favor escreva um endereço de email completo no formato oseunome@oseudominio.com");
	theForm.email.focus();
	return (false);
	}
	}
	
return (true);
}


