function addToBasket(id)
{	
	$("#buy_block_" + id).hide();
	$("#buy_info_block_wait_" + id).show();
	
	/*new Ajax.Request(	

		'/basket/&ajax=1&product_id='+id, 
		{
			method: 'get',	
			evalJSON: true,
			onComplete:function(e)
			{
				var ret = e.responseJSON;
				var product_id = ret['product_id'];
				
				
				document.getElementById('basket_block').style.display = 'block';
				document.getElementById('basket_block').innerHTML = ret['content'];
				
				
				$("#buy_info_block_wait_" + product_id).hide();
				$("#buy_info_block_" + product_id).show();
				$("#buy_info_block_" + product_id).highlightFade({color:'#77B772', speed: 500, end:'#AFE5AB'});	
				
				$("#basket_block").css({backgroundColor: '#77B772'});
				$("#basket_block").highlightFade({color:'#77B772', speed: 500, end:'#CBF7C8'});	
				
			}
		}
    );*/
	
	$.ajax({
   		type: "get",
   		url: "/basket/",
   		dataType: "json",
   		data: 'ajax=1&product_id='+id,
   		success: function(ret) {
   			var product_id = ret['product_id'];
				
				
				document.getElementById('basket_block').style.display = 'block';
				document.getElementById('basket_block').innerHTML = ret['content'];
				
				
				$("#buy_info_block_wait_" + product_id).hide();
				$("#buy_info_block_" + product_id).show();
				$("#buy_info_block_" + product_id).highlightFade({color:'#153B63', speed: 500, end:'#7AB1D2'});	
				
				$("#basket_block").css({backgroundColor: '#153B63'});
				$("#basket_block").highlightFade({color:'#153B63', speed: 500, end:'#CDE1EC'});	
				
   		}   		
	});
    
}

function successAddedToCompare(ret) {	
	$("#compare_info_block_wait_" + ret['id']).hide();
	$("#compare_block_" + ret['id']).hide();
	$("#compare_info_block_" + ret['id']).show();
	$("#compare_info_block_" + ret['id']).highlightFade({color:'#153B63', speed: 500, end:'#7AB1D2'});	
}

function addToCompare(id) {
	
	$("#compare_block_" + id).hide();
	$("#compare_info_block_wait_" + id).show();
	
	$.ajax({
   		type: "POST",
   		url: "/compare/",
   		dataType: "json",
   		data: "action=add_to_compare&id="+id,
   		success: function(ret) {
   			successAddedToCompare(ret);
   		}   		
	});
}