function expandModerationReason(target) {
    $('.moder_reason').removeClass('active');
    $(target).closest('.moder_reason').addClass('active');
    var expand;
    if($(target).closest('.js-moder-reason').hasClass('expanded'))
        expand = false;
    else expand = true;
    $('.js-moder-reason').removeClass('expanded');
    if(expand)
        $(target).closest('.js-moder-reason').addClass('expanded');
    else $(target).closest('.js-moder-reason').removeClass('expanded');
    $('.moder_reason .arrow').removeClass('rotate180');
    $('.moder_reason .expand').removeClass('hidden');
    $('.moder_reason .collapse').addClass('hidden');
    if(expand) {
        $(target).find('a.expand').addClass('hidden');
        $(target).find('a.collapse').removeClass('hidden');
        $(target).find('.arrow').addClass('rotate180');
    }
    else {
        $(target).find('a.expand').removeClass('hidden');
        $(target).find('a.collapse').addClass('hidden');
        $(target).find('.arrow').removeClass('rotate180');
    }

    var moderReasonContent = $(target).closest('.js-moder-reason')[0];
    var posBottomY = $(moderReasonContent).offset().top + $(moderReasonContent)[0].clientHeight;
    var footerPosTopY = $('.footer').offset().top;
    var offset = posBottomY - footerPosTopY;
    if(offset > 0)
        $('.footer').css('margin-top', offset+'px');
    else $('.footer').css('margin-top', '');
}
$(document).ready(function() {
    var moderReasons = $('.moder_reason');
    for(var i = 0; i < moderReasons.length; i++) {
        var content = $(moderReasons[i]).find('.moder_reason_content');
        var height = $(moderReasons[i])[0].clientHeight;
        if(content[0].clientHeight + 50 > height) {
            $(moderReasons[i]).find('.moder_reason_bottom').removeClass('hidden');
        }
    }
});