$(document).ready( function() {

	$('#email,#search').focus(function() {
		 this.value = "";
		   
	   });
	
	$('#subscribeBtn').click(function() {

	 	var email = $("#email").val();
	 	$.log("E-mail : " + email);
		$.ajax({
			method: "post", url:blogUrl + "/include/join.php", data:"email="+email,
			complete: function(){  },
			success: function(html){ 
				$("#email").val("Obrigado!");
	 		},
			error: function(html, textStatus, errorThrown){ //
				$("#feedback").val("Could not perform operation. Possible reason: " + textStatus + " or " + errorThrown); //show the html inside .content div
				$("#feedback").css("visibility", "visible");
				
	 		}

		}); //close $.ajax(
		
	 });

    // Allow for form submiting on Enter key
	$("#email").keyup(function(event){
    	  if(event.keyCode == 13){
    	    $("#subscribeBtn").click();
    	  }
	});
			
});
