function verificaEmail(email) {
    var s = new String(email);
    // { } ( ) < > [ ] | \ /
    if ((s.indexOf("{")>=0) || (s.indexOf("}")>=0) || (s.indexOf("(")>=0) || (s.indexOf(")")>=0) || (s.indexOf("<")>=0) || (s.indexOf(">")>=0) || (s.indexOf("[")>=0) || (s.indexOf("]")>=0) || (s.indexOf("|")>=0) || (s.indexOf("\"")>=0) || (s.indexOf("/")>=0) )
            return false;
    if (vogalAcentuada(email))
            return false;
    // & * $ % ? ! ^ ~ ` ' "
    if ((s.indexOf("&")>=0) || (s.indexOf("*")>=0) || (s.indexOf("$")>=0) || (s.indexOf("%")>=0) || (s.indexOf("?")>=0) || (s.indexOf("!")>=0) || (s.indexOf("^")>=0) || (s.indexOf("~")>=0) || (s.indexOf("`")>=0) || (s.indexOf("'")>=0) )
            return false;
    // , ; : = #
    if ((s.indexOf(",")>=0) || (s.indexOf(";")>=0) || (s.indexOf(":")>=0) || (s.indexOf("=")>=0) || (s.indexOf("#")>=0) )
            return false;
    // procura se existe apenas um @
    if ( (s.indexOf("@") < 0) || (s.indexOf("@") != s.lastIndexOf("@")) )
            return false;
    // verifica se tem pelo menos um ponto após o @
    if (s.lastIndexOf(".") < s.indexOf("@"))
            return false;
    return true;
}

function vogalAcentuada(s) {
     ls = s.toLowerCase();
     if ((ls.indexOf("á")>=0) || (ls.indexOf("à")>=0) || (ls.indexOf("ã")>=0) || (ls.indexOf("â")>=0) || (ls.indexOf("é")>=0) || (ls.indexOf("í")>=0) || (ls.indexOf("ó")>=0) || (ls.indexOf("õ")>=0) || (ls.indexOf("ô")>=0) || (ls.indexOf("ú")>=0) || (ls.indexOf("ü")>=0))
     return true;
}

function valida()
{ 
		vnome=document.frm.Nome.value
		if (vnome=="")
	{
		window.alert("O nome não foi Preeenchido")
		document.frm.Nome.focus()
		return false
	}
		email=document.frm.mail.value
		if (email=="")
 	 {
  		alert("O campo E-mail não foi preenchido")
		document.frm.mail.focus()
   		return false
 	 }
  		email=document.frm.mail.value
  		if(!verificaEmail(email))
  	{
		alert("Formato de \"Email\" inválido")
		document.frm.mail.focus()
		return false;
 	 }    

		vtel=document.frm.Telefone.value
		if (vtel=="")
	{
		window.alert("O Telefone não foi Preenchido")
		document.frm.Telefone.focus()
		return false
	}
	
}
