function rateArt(art_id, sign){

    $.post("/arts/rate_change/",{'art_id': art_id, 'sign': sign}, function(text){
        if (text != 'rated'){
            $('#quote'+art_id).text(text);
            $('#rate_up'+art_id).remove();
            $('#rate_down'+art_id).remove();
            var response_val = parseInt(text);
            var css_value = $('#quote'+art_id).css("color");
            if (response_val > 0){
                $('#quote'+art_id).css("color","#116530");
            }
            if (response_val == 0){
                $('#quote'+art_id).css("color","#6E0000");
            }
            $('#quote'+art_id).parent().addClass('rated');
        }
    });
    return false;
}

function bayanArt(art_id){

    $.post("/arts/bayan/",{'art_id': art_id}, function(){
        $('#bayan'+art_id).replaceWith('<a href="#" class="bayan bayaned" onclick="return false"></a>');
    });

return false;
}

function rate(quote_id, sign){

    $.post("/quotes/rate_change/",{'quote_id': quote_id, 'sign': sign}, function(text){
        if (text != 'rated'){
            $('#quote'+quote_id).text(text);
            $('#rate_up'+quote_id).remove();
            $('#rate_down'+quote_id).remove();
            var response_val = parseInt(text);
            var css_value = $('#quote'+quote_id).css("color");
            if (response_val > 0){
                $('#quote'+quote_id).css("color","#116530");
            }
            if (response_val == 0){
                $('#quote'+quote_id).css("color","#6E0000");
            }
            $('#quote'+quote_id).parent().addClass('rated');
        }
    });
    return false;
}

function bayan(quote_id){

    $.post("/quotes/bayan/",{'quote_id': quote_id}, function(){
        $('#bayan'+quote_id).replaceWith('<a href="#" class="bayan bayaned" onclick="return false"></a>');
    });

return false;
}

function send_to_redactor(quote_id){

    $.post("/quotes/send_to_redactor/",{'quote_id': quote_id}, function(){
        $('#to_redactor_quote_'+quote_id).replaceWith('<span>Отправлено редактору</span>');
        $('#into_topka_quote_'+quote_id).remove();

    });

return false;
}

function send_into_topka(quote_id){

    $.post("/quotes/send_into_topka/",{'quote_id': quote_id}, function(){
         $('#to_redactor_quote_'+quote_id).replaceWith('<span>Оставлено в топке</span>');
        $('#into_topka_quote_'+quote_id).remove();
    });

return false;
}

