$(document).ready(function(){
						   
$('#btCadastrar').click(function() {
				
		var nome,email;
		nomeC = $('input#nomeNews').val();
		emailC = $('input#emailNews').val();
				
		if(nomeC == "Nome" || nomeC == ""){
			alert("Preencha o campo nome corretamente");
			nome.focus;
			return false;
		}else if(emailC == "E-mail" || emailC == ""){
			alert("Preencha o campo e-mail corretamente");
			return false;
		}
								  
		
		$.post("inicial/newsletter", { nome: nomeC , email : emailC },
		   function(data){
			   if(data == 1)
			   $('#respostaCadastro').html("Email Cadastrado com sucesso.").addClass('verde');
			   else if(data == 2)
			   $('#respostaCadastro').html("Este e-mail já está cadastrado.").addClass('amarelo');
			   else
			   $('#respostaCadastro').html("Desculpe, ocorreu um erro.").addClass('vermelho');
		   });
		
		/* Efeitos */
		$('#respostaCadastro').fadeIn('slow').delay(1300).fadeOut('slow');
		$('input#nomeNews').val("");
		$('input#emailNews').val("");
		/* Efeitos */
		
		return false;
	});	
	return false;					   
});	
