// JavaScript Document


$(document).ready(function() {

		  $("a.delcart").click(function(){
			   var theID = this.rel ;					 
			   var theDivID = "#datarow" + theID ;	
			   $(theDivID).fadeOut('slow');
			   $.post("ajax/cart.asp", { formaction: "delcart", idcart: theID }, function(msg){ $(".cartcounter").text(msg) ; $.cookie('cartItems', msg, { expires: 365 }); } );
			   return false
			})
			
			$(".cartcounter").text($.cookie('cartItems')) ;

 });


function add2cart(x){
					 
	   var iddetail = encodeURI(x)
		   
			$.ajax({
				type: "POST",
				url: 'ajax/cart.asp',
				cache: false,
				data: "iddetail=" + iddetail ,
				success: function(msg){
					$(".messageadded").html("Ajout&eacute; avec succ&egrave;s <strong><a href='./Panier_P3938.html'>" + msg + " item(s) au panier</a></strong>")
				  $(".messageadded").show("slow") ;
				  $.cookie('cartItems', msg, { expires: 365 });
				  
				  $(".cartcounter").text(msg) ;
				 
				}
			});	
								   
  } ;

