$(function() {
	var errormsg = $('.error-explanation');
	errormsg.hide();
  	$(".bt-send").click(function() {
	  	// validate and process form
	  	// first hide any error messages
	  	var name = $("#name").val();
	  	if (name == "") {
	  		$(errormsg).show().html("<strong class='erro_nome'>Nome não informado.</strong>");
	  		alert('Nome não informado!');
	      	$("#name").focus();
		  	return false;
		}
	
		var email = $("#email").val();
		if (email == "") {
			$(errormsg).show().html("<strong class='erro_email'>E-mail não informado.</strong>");
	      	$("#email").focus();
	  		alert('E-mail não informado!');
	  		return false;
	    }
		var dataString = 'name='+ name + '&email=' + email;
		
		
		$.ajax({
	  		type: "POST",
	      	url: "process.php",
	      	data: dataString,
	      	success: function() {
	      	    $('#news-form').submit(function(){
	      	        alert('wow yeah');
	      	    })
                $("#ft").append('<div id="form-feedback"><h3>Mensagem eviada com sucesso!</h3></div>');
                $("#form-feedback").fancybox({});
	      	    alert("Mensagem enviada com sucesso!");
				$('#name').val('');
				$('#email').val('');
	      	}
	 	});
	 	
	    return false;
	});
});