function validaEmail(email) {
 var BadChars = "*|,\":<>[]{}`\'';()&$#% ";
 var GoodChars = "@."; 
 var posarroba = email.indexOf ("@",0);
 
 if (email.length < 6) { // o email é menor que 6 caracteres
  return (false);
 }
 
 for (var i = 0; i < email.length; i++) {
  if (BadChars.indexOf(email.charAt(i)) != -1) { // Contém caracteres inválidos, badchars
   return (false);
  }
 }
 
 for (var i = 0; i < GoodChars.length; i++) {
  if (email.indexOf(GoodChars.charAt(i)) == -1)  // não tem goodchars
   return (false);
  
  if (email.indexOf(GoodChars.charAt(i), 0) == 0)  // começou com goodchars (. ou @)
   return (false);
  
  if (email.lastIndexOf(GoodChars.charAt(i)) > email.length-3) //existe menos de 2 caracteres depois do ultimo goodchar
   return (false);
  
 }
 
 if (email.lastIndexOf("@") > email.lastIndexOf("."))  //Não tem ponto depois do arroba
  return (false);
 
 if (email.indexOf ("@.", 0) != -1 || email.indexOf (".@", 0) != -1)  // . e @ colados
  return (false);
 
 if (email.indexOf ("@", posarroba+1) != -1)  // Contém mais de um " @ " 
  return (false);
	
	return true;

}