var previous_banter_face = 1;
function ShowRandomBanterFace()
{
    //for (var i = 1; i < 6; i++)
    //{
        var tag = 'TypingFace' + previous_banter_face;
        var last_face = gbi(tag);
        last_face.style.visibility = "hidden";
    //}

    var new_rnd = RandomNumberExcept(6, previous_banter_face);

    while (new_rnd == 0) new_rnd = RandomNumberExcept(6, previous_banter_face);

    var new_tag = 'TypingFace' + new_rnd;
    var new_face = gbi(new_tag);

    new_face.style.visibility = "visible";

    //alert(new_tag);

    previous_banter_face = new_rnd;
}

var comment_published = 0;
function publish_atom_comment(parent_id, a_id, username, comment, type)
{
    var comment_ok = true;
    if (comment=="")
        comment_ok = false;

    if (comment_published == 0 && comment_ok)
    {
        gbi('CommentBox').disabled = true;
        user.postAtomComment(parent_id, a_id, username, comment, type);
        comment_published = 1;
    }    
}
//rate_comment($key, $manaPointsToAdd, $authorOfContentId, $commentVoteUpScore, $commentVoteDownScore, $receivedManaAuthorityPoints = 1)
function vote_on_comment(key, mana_points, atom_author_id, comment_voteup_score, comment_votedown_score, received_mana_points)
{
    user.voteOnAtomComment(key, mana_points, atom_author_id, comment_voteup_score, comment_votedown_score, received_mana_points);
}