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_novo_utilizador(theForm)
{

	if (theForm.name.value == "")
	{
	alert("Por favor escreva os seus dados para o campo \"Nome\".");
	theForm.name.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);
}

