function BlogDeletePopap(title_text, description_text, action, post_id)
{
	KitaConfirm({
		title: title_text,
		description: description_text,
		bYesText: 'Удалить',
		bNoText: 'Отмена',
		feedback: function(res){
			if (res) deletePost(action, post_id);
		}
	});
}

function deletePost(action, id)
{
	var data = {
	"DeletePost[id]": id
	};
	$.post(action, data);
	$("#post_"+id).remove();
}

function deletePostMod(action, id)
{
	if (confirm('Удалить пост!'))
	{
		var data = {
		"DeletePost[id]": id
		};
		$.post(action, data);
		$("#post-"+id).remove();
	}
}

function PublishPost(action, id, publish)
{
    var data = {
        'id': id,
        'publish': publish
    };

    $.post(action, data, function(){
        $('#post-'+id).remove();
    });
}
