$(document).ready(function(){
	$(".list-add-cart").live("click", function(){
		id = $(this).attr("id");
		qte = $("#q"+id).val();
		$("html, body").animate({scrollTop:0},"slow")
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/add/'+id+'/'+qte+'/'+Math.random(), 
			success: function(retour){
				$("#sidebar-cart").html(retour);	
			}
		});
	});
	$(".list-delete-cart").live("click", function(){
		id = $(this).attr("id");
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/delete/'+id+'/'+Math.random(), 
			success: function(retour){
				$("#sidebar-cart").html(retour);	
			}
		});
	});
	$(".delete-cart").live("click", function(){
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/deleteall/'+Math.random(), 
			success: function(retour){
				$("#sidebar-cart").html(retour);	
			}
		});
	});
	
	/*panier*/
	$(".list-delete-panier").live("click", function(){
		id = $(this).attr("id");
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/delete_panier/'+id+'/'+Math.random(), 
			success: function(retour){
				$("#list-panier").html(retour);	
			}
		});
	});
	
	$(".list-quantiteup").live("click", function(){
		id = $(this).attr("id");
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/quantiteup/'+id+'/'+Math.random(), 
			success: function(retour){
				$("#list-panier").html(retour);
			}
		});
	});
	
	$(".list-quantitedown").live("click", function(){
		id = $(this).attr("id");
		$.ajax({
			type: 'GET', 			
			url: '/catalogue_panier/quantitedown/'+id+'/'+Math.random(), 
			success: function(retour){
				$("#list-panier").html(retour);
			}
		});
	});
	
	$("#livraison_relais").live("click", function(){
		 $(".relais").show();								 
	});
	$("#livraison_").live("click", function(){
		 $(".relais").hide();								 
	});
});
