$(function() {
	
	$('#addcmt').click(function() {
		
		$.ajax({
			type: 'POST',
			url: '/ajax/blogs/newcmt.php',
			data: 'content='+$('#cmtcon').val()+'&news='+$('#cmtid').val(),
			
			success: function(msg) {
			
				$('#cmtcon').val('');
				$('#charsleft').html('');
				
				$('#cmts').html(msg);
				
			}
			
		});
		
	});
	
});

function removecmt(id) {
	
	$.ajax({
		
		type: 'POST',
		url: '/ajax/blogs/removecmt.php',
		data: 'id='+id,
		
		success: function(msg) {
			
			if (msg != 'fail') {
				
				$('#cmt'+id).fadeOut();
				
			}
			
		}
		
	});
	
}