$(document).ready(function() {

	$('#sbt_enviar').click(function() {

		var nome = $('#inpt_nome').val();
		var email = $('#inpt_email').val();
		var mensagem = $('#inpt_msg').val();
		$.post('ajax.php',
			{nome: nome, email: email, mensagem: mensagem, contato: true },
			function(data, textStatus) {
			$('#inpt_nome').val(''); 
			$('#inpt_email').val(''); 		
			$('#inpt_msg').val(''); 
			$('#resp_contato').html(data);
			});
		return false;
	});

	
	$('#btn_coment').click(function() {
		var nome = $('#nome').val();
		var email = $('#email').val();
		var mensagem = $('#texto').val();
		var id = $('#id').val();
		$.post('ajax.php',
				{ post:id, nome: nome, email: email, mensagem: mensagem, comentario: true },
				function(data, textStatus) {
					$('#resp_coment').html(data);
					$('#nome').val('');
					$('#email').val('');
					$('#texto').val('');
					location.href = "post.php?id="+id+"#comentarios";
				});
		return false;
	});
	
	$('#inpt_busca, #inpt_msg, #inpt_nome, #inpt_email').click(function() {
		$(this).val('');		
	});
	
	$('#inpt_nome').blur(function() {
		if($(this).val() == '')
			$(this).val('Nome:');		
	});
	
	$('#inpt_busca').blur(function() {
		if($(this).val() == '')
			$(this).val('Buscar conteúdo no blog...');		
	});
	
	$('#inpt_email').blur(function() {
		if($(this).val() == '')
			$(this).val('E-mail:');		
	});
	
	$('#inpt_msg').blur(function() {
		if($(this).val() == '')
			$(this).val('Mensagem...');		
	});
});
