function vote(url, cid, pid, action) {
    $.ajax({
      type: "POST",
      url: url,
      data: "action="+action+"&cid="+cid+"&pid="+pid,
      dataType: "html",
      success: function(msg){
        var nsum = parseInt($('#nsumpoint_'+msg).html());
        var psum = parseInt($('#psumpoint_'+msg).html());
        var sum = parseInt($('#sumpoint_'+msg).html());
        
        if (action == 'up') {
            $('#psumpoint_'+msg).html(psum+1);
            $('#sumpoint_'+msg).html(sum+1);    
        } else if(action == 'down') {
            $('#nsumpoint_'+msg).html(nsum-1);
            $('#sumpoint_'+msg).html(sum-1);
        }
        
        $('#voteup_'+msg).remove();
        $('#votedown_'+msg).remove(); 
      }

    });
}












