
function sendPostFeedback(post_id,bad)
{var params=new Object;bad=bad||0;params.action='SendPostFeedback';if(bad)
$('#postFeedbackButton_'+post_id).hide();else
$('#postFeedbacBadkButton_'+post_id).hide();params.post_id=post_id;params.bad=bad;$.post(script_url, params, showPostFeedbackAmount,'json');}
function showPostFeedbackAmount(response)
{if (response.post_id)
{var text_positive='('+response.feedback_amount_positive+')';var text_negative='('+response.feedback_amount_negative+')';response.bad=response.bad||false;if(response.bad){var title=response.feedback_amount_negative+' уже '+getCountName(response.feedback_amount_negative,'отметил, что не понравился','отметили, что не понравился','отметили, что не понравился');$('#postFeedbackAmountNegative_'+response.post_id).html(text_negative).show().attr('title', title);$('#postFeedbackNegative_'+response.post_id).show();$('#postFeedbacBadkButton_'+response.post_id).hide();$('#postFeedbackPositive_'+response.post_id).show();$('#postFeedbackButton_'+response.post_id).hide();}else{var title=response.feedback_amount+' уже '+getCountName(response.feedback_amount,'поблагодарил','поблагодарили','поблагодарили');$('#postFeedbackAmountPositive_'+response.post_id).html(text_positive).show().attr('title', title);$('#postFeedbackPositive_'+response.post_id).show();$('#postFeedbackButton_'+response.post_id).hide();$('#postFeedbackNegative_'+response.post_id).show();$('#postFeedbacBadkButton_'+response.post_id).hide()}
$('#negative_smile_'+response.post_id).show();$('#feedback_nbsp_'+response.post_id).show();}}