function enviar() {
	str_erro = "";
	str_aviso = "";
	
	if (document.atendimento.nome.value == "") {
		str_aviso = str_aviso + "O campo nome não foi preenchido.\n";
	}
    if (document.atendimento.email.value == "") {
       str_erro = str_erro + "Preencha o endereço de e-mail para que possamos retorná-lo. \n";
    }
    else {
       if (document.atendimento.email.value.indexOf("@") == -1 ||
           document.atendimento.email.value.indexOf(".") == -1 ||
		   document.atendimento.email.value.indexOf(" ") != -1 || 
	       document.atendimento.email.value.length < 6) 
	   {
	      str_erro = str_erro + "O endereço de e-mail deve ser válido. Senão não teremos como retorná-lo.\n";
	   }
    }
	
	if (document.atendimento.telefone.value == "") {
		str_aviso = str_aviso + "O campo telefone não foi preenchido.\n";
	}

	if (document.atendimento.assunto.value == "") {
		str_aviso = str_aviso + "O campo assunto não foi preenchido.\n";
	}

	if (document.atendimento.msg.value == "") {
		str_erro = str_erro + "Preencha a mensagem.\n";
	}

	if (str_erro != "")	{
		alert(str_erro);		
	}else{
		if(str_aviso != "") {
		testa = confirm(str_aviso + "Quer continuar?");
			if(testa == true) {
			document.atendimento.action = "../../inc/enviar.php";
			document.atendimento.submit();
		   }
		}else {
			document.atendimento.action = "../../inc/enviar.php";
			document.atendimento.submit();
			}
	}
}
