$(document).ready(function(){
	
	$('#comment_submit').live('click',function(event){
		event.preventDefault();
		$('#comment_form').submit()
	});
	
	// contact form 
	$('#comment_form').live('submit',function(event){
		event.preventDefault();
		$.ajax({
			url:"/blog/post_comment/",
			type:"post",
			cache:false,
			data:{
				'url_slug':$('#comment_submit').attr("data-url_slug"),
				'year':$('#comment_submit').attr("data-year"),
				'month':$('#comment_submit').attr("data-month"),
				'id':$('#comment_submit').attr("data-id"),
				'comment.name':$('#comment_name').val(),
				'comment.email':$('#comment_email').val(),
				'comment.twitter':$('#comment_twitter').val(),
				'comment.website':$('#comment_website').val(),
				'comment.body':$('#comment_body').val()
			},
			beforeSend:function(){
				$('#ajax_comment').show()
			},
			success:function(html){
				$("#comments_c").html(html);
				if($('#last_comment').length){jump_anchor("#last_comment")}
			},
			complete:function(){
				$('#ajax_comment').hide();
			}
		});
	})
	
});