$().ready(function(){
        $(".arrow-up").click(function(){
            //alert($(this).parent().parent().attr("title"));
            var comment_id= $(this).parent().attr("id");
            vote($(this).text(), $(this).next(), comment_id);
           return false;
        });
        $(".arrow-down").click(function(){
            var comment_id= $(this).parent().attr("id"); 
            vote($(this).text(), $(this).prev(), comment_id);
            return false;
         });
    });


function vote(str, object, id){
    if (str == '+'){
        $.get("vote.php?id="+id+"&value=1", function(data) {
            $(object).html(data);
          });

    }
    if(str == '-'){
        $.get("vote.php?id="+id+"&value=-1", function(data) {
            $(object).html(data);
          });
    }
}
