	function voteMsg(msgId, type) {

		$("#plus"+msgId).hide();
		$("#minus"+msgId).hide();
		$("#points"+msgId).show();
		
		$.ajax({
			   type: "POST",
			   url: pathToRoot+"app/ajax/vote_msg.php",
			   dataType: "json",
			   data: { msg: msgId, type: type },
			   success: function(json){		
				   
				   if (json.errno == 1) {
						
					   $("#points"+msgId).hide();
					   $("#plus"+msgId).show();
					   $("#minus"+msgId).show();
						
				   } else if (json.errno == 2) $("#points"+msgId).html("Punktów: <em>" + json.points + "</em>");
				   
			   },		   
			   beforeSend: function() {
				   $("#msg-vote-loader"+msgId).show();
			   },
			   complete: function() {
				   $("#msg-vote-loader"+msgId).hide();
			   }
		 });
	}
	
	function voteReply(msgId, type) {

		$("#rplus"+msgId).hide();
		$("#rminus"+msgId).hide();
		$("#rpoints"+msgId).show();
		
		$.ajax({
			   type: "POST",
			   url: pathToRoot+"app/ajax/vote_reply.php",
			   dataType: "json",
			   data: { msg: msgId, type: type },
			   success: function(json){		
				   
				   if (json.errno == 1) {
						
					   $("#rpoints"+msgId).hide();
					   $("#rplus"+msgId).show();
					   $("#rminus"+msgId).show();
						
				   } else if (json.errno == 2) $("#rpoints"+msgId).html("Punktów: <em>" + json.points + "</em>");
				   
			   },		   
			   beforeSend: function() {
				   $("#reply-vote-loader"+msgId).show();
			   },
			   complete: function() {
				   $("#reply-vote-loader"+msgId).hide();
			   }
		 });
	}	
