jQuery.noConflict();
jQuery(document).ready(function() {

	jQuery(".product_vote_yes").live("click",function()
	{
		jQuery.getJSON("/ajax_api.php?action=productVote&type="+jQuery(this).parent().attr("class")+"&vote=yes&id="+jQuery(this).attr("id") ,
		function(data)
		{
			if(data != "")
			{
				if(data.komunikat)
				{
					jQuery(".productVoteInfo").empty().append(data.komunikat);
				}
				
				if(data.plus)
				{
					jQuery(".YesVotesCount").empty().append(data.plus);
				}
				if(data.retcode=2){
					jQuery(".product_vote_yes").removeClass("product_vote_yes").addClass("vote_yes_sleep");
				}
			}		
		}
		);		
	});
	
	jQuery(".product_vote_no").live("click",function()
	{
		jQuery.getJSON("/ajax_api.php?action=productVote&type="+jQuery(this).parent().attr("class")+"&vote=no&id="+jQuery(this).attr("id") ,
		function(data)
		{
			if(data != "")
			{
				if(data.komunikat)
					jQuery(".productVoteInfo").empty().append(data.komunikat);
				if(data.minus)
				{
					jQuery(".NoVotesCount").empty().append(data.minus);
				}
				if(data.retcode=2)
					jQuery(".product_vote_no").removeClass("product_vote_no").addClass("vote_no_sleep");
			}		
		}
		);
	});
	
}
);