(function() {
  $.commentBan = function(id) {
    $.commentModeration(id, 'ban');
  }
  $.commentUnban = function(id) {
    $.commentModeration(id, 'unban');
  }
  $.commentDelete = function(id) {
    var _confirm = confirm('Уверены?');
    if (_confirm == true) {
      var url = comment_moderation_url['delete'] + '/id/' + id;
      document.location.href = url;
    }
  }
  $.commentModeration = function(id, action) {
    $.get(
      comment_moderation_url[action],
      {id: id},
      function(html) {
        $('#comment_moderation_'+id).html(html);
      }
    );
  }
})(jQuery);
