$(document).ready(function() {

$('#mycarousel').jcarousel();

	$('#submit2').click(function() {

		var nome = $('#cont_nome').val();
		var email = $('#cont_email').val();
		var mensagem = $('#cont_msg').val();
		$.post('ajax.php',
			{nome: nome, email: email, mensagem: mensagem, contato: true },
			function(data, textStatus) {
			$('#cont_nome').val(''); 
			$('#cont_email').val(''); 		
			$('#cont_msg').val(''); 
			$('#resp_contato').html(data);
			});
		return false;
	});

	
	$('.news').click(function() {
		var nome = $('#inf_nome').val();
		var email = $('#inf_email').val();
		$.post('ajax.php',
			{nome: nome, email: email, newsletter: true },
			function(data, textStatus) {
				$('#inf_nome').val(''); 
				$('#inf_email').val(''); 		
				//$('#resp_news').html(data);
				alert(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;
	});
	
	$('#cont_nome, #cont_email, #cont_msg, #inf_nome, #inf_email').click(function() {
		$(this).val('');		
	});
	
	$('#cont_nome, #inf_nome').blur(function() {
		if($(this).val() == '')
			$(this).val('Nome:');		
	});
	
	$('#cont_email, #inf_email').blur(function() {
		if($(this).val() == '')
			$(this).val('E-mail:');		
	});
	
	$('#cont_msg').blur(function() {
		if($(this).val() == '')
			$(this).val('Mensagem...');		
	});
			
			
			
	$(".comentar a").click(function(){
		var id = $(this).attr('class');
		$(".coment_"+id).toggle(400);
		
		return false;
	});
});