/* 
 * This file is use to init all the need class when page load. 
 */
 function get_cookies_array() {
    var cookies = { };
    if (document.cookie && document.cookie != '') {
        var split = document.cookie.split(';');
        for (var i = 0; i < split.length; i++) {
            var name_value = split[i].split("=");
            name_value[0] = name_value[0].replace(/^ /, '');
            cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]);
        }
    }
    return cookies;
}

jQuery(document).ready(function () {
	/* init the select drop down 	*/
    if ( jQuery(".SelectUI").length > 0 ) {
        jQuery(".SelectUI").addSelectUI({
            scrollbarWidth: 9
        });
    }
	/* init the carousel */
    if ( jQuery(".Carousel").length > 0 ) {
        jQuery(".Carousel").jcarousel({
            scroll: 1
        });
    }
	/* init the carousel */
    if ( jQuery(".Carousel02").length > 0 ) {
        jQuery(".Carousel02").jcarousel({
            scroll: 1,
			auto: 3,
			wrap: "last"
        });
    }
	/* init the carousel */
    if ( jQuery(".Carousel03").length > 0 ) {
        jQuery(".Carousel03").jcarousel({
            scroll: 1,
			vertical: true
        });
    }
	/* init the scroll pane */
    if ( jQuery(".MyBasketList").length > 0 ) {
        jQuery(".MyBasketList").jScrollPane({
            scrollbarWidth: 9,
            scrollbarMargin: 5
        });
    }
	if ( jQuery(".PanierPleinePopup").length > 0 ) {
        jQuery(".PanierPleinePopup").jScrollPane({
            scrollbarWidth: 9,
            scrollbarMargin: 5
        });
    }
	if ( jQuery(".ScrollArea").length > 0 ) {
        jQuery(".ScrollArea").jScrollPane({
            scrollbarWidth: 9,
            scrollbarMargin: 5
        });
    }
	
	if ( jQuery(".ShoppingList2").length > 0 ) {
		jQuery(".ShoppingList2").jScrollPane();
	}
	if ( jQuery(".PlaceList").length > 0 ) {
		jQuery(".PlaceList").jScrollPane();
	}
	
	if ( jQuery(".BoxScrollResult").length > 0 ) {
		jQuery(".BoxScrollResult").jScrollPane();
	}
	
	if ( jQuery(".BoxScrollListExt").length > 0 ) {
		jQuery(".BoxScrollListExt").jScrollPane();
	}
	
	if ( jQuery(".ScrollWrapper").length > 0 ) {
		jQuery(".ScrollWrapper").jScrollPane();
	}
	
	if ( jQuery(".BoxScrollChoice").length > 0 ) {
		jQuery(".BoxScrollChoice").jScrollPane();
	}
	
	if ( jQuery(".BoxScrollChoiceExt").length > 0 ) {
		jQuery(".BoxScrollChoiceExt").jScrollPane();
	}
	
	/* init the F6.UI.ViewTypeControl class */
	if ( jQuery(".LP4").length > 0) {
    	F6.UI.ViewTypeControl.init();
	}
	/* init the F6.UI.Navigation class*/
    if ( jQuery("#checkboxNavigation").length > 0 ) {
        new F6.UI.CheckboxNavigation(jQuery("#uncheckAll"), {
            checkboxList: jQuery("ul#checkboxNavigation > li > input[type='checkbox']")
        });
    }
	/* init the F6.UI.Accordion class*/
	if ( jQuery(".Accordion").length > 0 ) {
		F6.UI.Accordion.constructor(".Accordion");
    }
	if ( jQuery(".Accordion02").length > 0 ) {
		F6.UI.Accordion.constructor(".Accordion02");
    }
	if ( jQuery(".Accordion03").length > 0 ) {
		F6.UI.Accordion.constructor(".Accordion03");
    }
	/* init the F6.UI.ShopListControl class*/
	if ( jQuery(".Accordion").length > 0 ) {
		 F6.UI.ShopListControl.init({
			control: ".Accordion",
			displayList: ".ShoppingList2"
		});
    }
	/* init the F6.UI.ShowHideControl class*/
	if ( jQuery(".ListFood").length > 0 ) {
		F6.UI.ShowHideControl.init();
		jQuery(document).bind("mouseover", function() {
			jQuery(".ListFood .SubBox14").hide();														
		});
		jQuery(".ListFood > ul > li > a > img").each(function() {
			/*var imgWidth = jQuery(this).attr("width");
			var imgHeight = jQuery(this).attr("height");
			var mapcoords = 0+","+ Math.ceil(2*imgHeight/3) + ","+ imgWidth + "," + imgHeight;
			if (typeof jQuery(this).attr("usemap") != "undefined") {
			 	jQuery(jQuery(this).attr("usemap")).find("area").attr("coords", mapcoords);
			}*/
		});
	}
	if ( jQuery(".LP5 .SubBox14").length > 0 ) {
		F6.UI.ShowHideControl.init();
		jQuery(document).bind("mouseover", function() {
			jQuery(".LP5 .SubBox14").hide();	
			jQuery(this).find(".priceBox").css("border-top","1px solid #D9D9D9");
		});
	}
	if ( jQuery(".ProductList .SubBox14").length > 0 ) {
		F6.UI.ShowHideControl.init();
		jQuery(document).bind("mouseover", function() {
			jQuery(".ProductList .SubBox14").hide();		
			jQuery(this).find(".priceBox").css("border-top","1px solid #D9D9D9");
		});
	}
	
	if ( jQuery(".ListItemsLipstick .SubBox14").length > 0 ) {
		F6.UI.ShowHideControl.init();
		jQuery(document).bind("mouseover", function() {
			jQuery(".ListItemsLipstick .SubBox14").hide();	
			jQuery(this).find(".priceBox").css("border-top","1px solid #D9D9D9");
		});
	}
	
	
	/* hide all popup when page load */
	//if ( jQuery(".Popup01").length > 0 ) {
		//jQuery(".Popup01").hide();
	//}
	if ( jQuery(".InfoWrapper").length > 0 ) {
		jQuery(".InfoWrapper").each(function() {
			var elementHeight = parseInt(jQuery(this).outerHeight()/2);
	 		jQuery(this).css("padding-top", parseInt(jQuery(this).parent().outerHeight())/2 - elementHeight + "px");
		 });
	}
	if ( (/MSIE 6\.0/).test(navigator.userAgent) ) { 
		if ( jQuery("#maCreneau").length > 0 ) {
			jQuery("#maCreneau").find("img").each(function() {
				if (jQuery(	this).attr("src")=="img/icon-shipping.png") {
					jQuery(	this).attr("src","img/icon-shipping.gif");
				}
		   });
		}
	}
	jQuery(document).bind("click", function() {
		if (jQuery(".HighLightBox > .error").length > 0) {
					jQuery(".HighLightBox > .error").hide();
				}
				if (jQuery(".AddItemPanel .error").length > 0) {
					jQuery(".AddItemPanel .error").hide();
				}
	});
	
	jQuery(document).bind("mouseover",function() {
		jQuery("#maCase2 .PopupContent01").css("opacity",0.5);
		jQuery("#maCase2 .PopupContent02").css("opacity",0.5);
		jQuery("#maCase3 .PopupContent01").css("opacity",0.5);
		jQuery("#maCase3 .PopupContent02").css("opacity",0.5);
		jQuery("#authentification11 .PopupContent01").css("opacity",0.5);
		jQuery("#authentification11 .PopupContent02").css("opacity",0.5);
		jQuery("#authentification12 .PopupContent01").css("opacity",0.5);
		jQuery("#authentification12 .PopupContent02").css("opacity",0.5);
		jQuery("#authentification13 .PopupContent01").css("opacity",0.5);
		jQuery("#authentification13 .PopupContent02").css("opacity",0.5);
		jQuery("#authentification3  .PopupContent01").css("opacity",0.5);
		jQuery("#authentification4   .PopupContent01").css("opacity",0.5);
		jQuery("#authentification5  .PopupContent01").css("opacity",0.5);
	});
	
	if ( jQuery(".Overlay").length > 0 ) {
		if ( (/MSIE 6\.0/).test(navigator.userAgent) ) { 
			jQuery(".Overlay").each(function() {
				jQuery(this).css("height", jQuery(this).parent().outerHeight());
			});
		}
	}
	if ( jQuery(".SummaryRecipe").length > 0 ) {
		var maxHeight = 0;
		jQuery(this).find(".MoreDetail").each(function(index) {
			if (jQuery(this).outerHeight() > maxHeight) {
				maxHeight = jQuery(this).outerHeight();
			}
		});
		jQuery(this).find(".MoreDetail").each(function() {
			if (jQuery(this).outerHeight() < maxHeight) {
				var subValue = maxHeight - jQuery(this).outerHeight();
				jQuery(this).find(".TextStyleAlt12").css("padding-top",subValue);
			}
	   });
	}
	if ( jQuery(".ListItem").length > 0 ) {
		jQuery(".ListItem > li > a").each(function() {
			var self = this;
			jQuery(this).fancybox({
				'titleShow'		: false,
			  	'transitionIn'	: 'elastic',
			  	'transitionOut'	: 'elastic',
			  	'onComplete' : show= function() {
					//var check = false;
					//jQuery(".ZoomInfo").each(function() {
						//if (jQuery(this).hasClass("Active")) {
							//check = true;
						//}
					//});
					//if (check == false) {
						jQuery(jQuery(self).attr('rel')).addClass("Active").show();
					//}
					//jQuery("#fancybox-inner > shape").eq(0).css("display", "none");
					return;
				},
				'onClosed' : hide= function() {
					jQuery(jQuery(self).attr('rel')).removeClass("Active").hide();
					return;
				}
		  	});
		});
	}
	if ( jQuery(".SubContent06").length > 0 ) {
		jQuery(".SubContent06 > ul > li > a").bind("mouseover",function(evt) {
			evt.stopPropagation();
			jQuery(".HoverContent").slideUp("slow");
			jQuery(this).parent().find(".HoverContent").slideDown("slow");
		});
		jQuery(".HoverContent").bind("mouseover",function(evt) {
			evt.stopPropagation();
		});
		jQuery("body").bind("mouseover",function() {
			jQuery(".HoverContent").slideUp("slow");
		});
	}
	if ( jQuery(".GroupDetailList").length > 0 ) {
		jQuery(this).find(".GroupInfo").hide();
		jQuery(this).find(".Active").show();
	}
	if ( jQuery(".GroupDetailList02").length > 0 ) {
		jQuery(this).find(".GroupInfo").hide();
		jQuery(this).find(".Active").show();
	}
	if ( jQuery(".DetailHistory").length > 0 ) {
		jQuery(".DetailHistory").children().hide();
		jQuery(".DetailHistory").find(".Active").show();
	}
	if ( jQuery(".ListContent").length > 0 ) {
		jQuery(".ListContent").find("input[type=radio]").bind("click",function() {
			if (jQuery(this).attr("checked") == true) {
				jQuery(this).parent().parent().find(".Active").removeClass("Active");
				jQuery(this).parent().addClass("Active");
			}
	   });
	}
	if ( jQuery(".ListModule02").length > 0 ) {
		jQuery(".ListModule02 .ModuleTextStyle01").bind("click",function() {
			if (!(jQuery(this).parent().parent().hasClass("Module02Active"))) {
				jQuery(this).parent().parent().parent().find(".Module02Active").removeClass("Module02Active");
				jQuery(this).parent().parent().addClass("Module02Active");
			}
			else {
				jQuery(this).parent().parent().parent().find("li").addClass("Module02Active");
				jQuery(this).parent().parent().removeClass("Module02Active");
			}
	   });
	}
	if ( jQuery(".TotalBlock01").length > 0 ) {
		
	   jQuery(".TotalBlock01").bind("click", function() {
			if(jQuery(this).parent().hasClass("ActiveMC")) {
				jQuery(this).parent().removeClass("ActiveMC");
			} else {
				jQuery(this).parent().addClass("ActiveMC");
			}
		});
	}

	if ( jQuery(".LinkHoraises").length > 0 ) {
		
	   jQuery(".LinkHoraises").bind("click", function() {
			if(jQuery(this).parent().hasClass("ActiveHoraises")) {
				jQuery(this).parent().removeClass("ActiveHoraises");
			} else {
				jQuery(this).parent().addClass("ActiveHoraises");
			}
			jQuery(".BoxScrollChoice").jScrollPane();
		});
	}
	
	jQuery(".ProductInfo > #select01 > option").each(function() {
		if (jQuery(this).attr("selected")==true) {
			var text = jQuery(this).text();
			jQuery("#option"+text).show();
			jQuery("#price"+text).show();
		}
	});
	jQuery("#checkboxNavigation > li > input").bind("click",function() {
		if (jQuery(this).attr("checked")==false) {
			var group = jQuery(this).parent().attr("class");
			var groupdisable = group + "Disable";
			jQuery(".LP6").find("."+group).removeClass(group).addClass(groupdisable);
		}
		else {
			var group = jQuery(this).parent().attr("class");
			var groupdisable = group + "Disable";
			jQuery(".LP6").find("."+groupdisable).removeClass(groupdisable).addClass(group);
		}
	});

	if ( jQuery("#cartSum").length > 0 ) {
		if (jQuery("#cartSum").hasClass("SpecialPage")) {	
			var totalCourseArt = jQuery("#courseBlock").find(".tuProducts").find("li").length;
			var totalCourse = 0;
			var totalModeArt = jQuery("#modeBlock").find(".tuProducts").find("li").length;
			var totalMode = 0;
			
			jQuery("#courseBlock").find(".tuProducts").find("li").find(".priceBox").each(function() {
				var quantity = jQuery(this).parent().parent().parent().find(".Quantity").val();
				totalCourse += parseFloat(jQuery(this).html().replace(",",".").replace("€",""))*quantity;
			});
			jQuery("#modeBlock").find(".tuProducts").find("li").find(".priceBox").each(function() {
				var quantity = jQuery(this).parent().parent().parent().find(".Quantity").val();
				totalMode += parseFloat(jQuery(this).html().replace(",",".").replace("€",""))*quantity;
			});
			total = totalCourse + totalMode;
			jQuery("#cartSum").find(".TotalCourse > .Item > strong > span").html(totalCourseArt);
			jQuery("#cartSum").find(".TotalCourse > .Price > strong > span").html(totalCourse.toFixed(2).replace(".",","));
			jQuery("#cartSum").find(".TotalMode > .Item > strong > span").html(totalModeArt);
			jQuery("#cartSum").find(".TotalMode > .Price > strong > span").html(totalMode.toFixed(2).replace(".",","));
			jQuery("#total03").html(total.toFixed(2).replace(".",","));
			
			var option = jQuery("#cartSum").find(".OptionChoice > .Price").html();
			jQuery.cookie("lot2Sum", totalCourseArt + "?" + totalCourse.toFixed(2).replace(".",",") + "?" + totalModeArt+ "?" + totalMode.toFixed(2).replace(".",",") + "?" +  total.toFixed(2).replace(".",",") + "?" + option);
		}
		else {
			if (jQuery.cookie("lot2Sum") != null) {
				var split = jQuery.cookie("lot2Sum").split('?');
				jQuery("#cartSum").find(".TotalCourse > .Item > strong > span").html(split[0]);
				jQuery("#cartSum").find(".TotalCourse > .Price > strong > span").html(split[1]);
				jQuery("#cartSum").find(".TotalMode > .Item > strong > span").html(split[2]);
				jQuery("#cartSum").find(".TotalMode > .Price > strong > span").html(split[3]);
				var newTotal = parseFloat(split[1].replace(",","."))+ parseFloat(split[3].replace(",","."));
				jQuery("#total03").html(newTotal.toFixed(2).replace(".",","));
				jQuery("#cartSum").find(".OptionChoice > .Price").html(split[5]);
				
				if (split[0] == 0 || split[0]== 1) {
					jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html(jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("articles","article"));
				}
				else {
					jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html(jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("articles","article"));
					jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html(jQuery("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("article","articles"));
				}
				if (split[2] == 0 || split[2] == 1) {
					jQuery("#cartSum").find(".TotalMode > .Item > strong ").html(jQuery("#cartSum").find(".TotalMode > .Item > strong ").html().replace("articles","article"));
				}
				else {
					jQuery("#cartSum").find(".TotalMode > .Item > strong ").html(jQuery("#cartSum").find(".TotalMode > .Item > strong ").html().replace("articles","article"));
					jQuery("#cartSum").find(".TotalMode > .Item > strong ").html(jQuery("#cartSum").find(".TotalMode > .Item > strong ").html().replace("article","articles"));
				}
			}
		}
	}
	if ( jQuery("#livraisonBox").length > 0 ) {
		if (jQuery("#livraisonBox").hasClass("SpecialPage")) {	
			jQuery.cookie("livraisonValue",null)
		}
		else {
			if (jQuery.cookie("livraisonValue") != null) {

				jQuery("#optionPrice > li").show();
					
				var split01 = jQuery.cookie("livraisonValue").split('?');
				
				jQuery("#typeName").html(split01[0]);
				jQuery("#typePrice").html(split01[1]);
				
				var split02 = jQuery.cookie("lot2Sum").split('?');
				var newTotal = parseFloat(split02[1].replace(",","."))+ parseFloat(split02[3].replace(",",".")) + parseFloat(split01[1].replace(",","."));
				jQuery("#total03").html(newTotal.toFixed(2).replace(".",","));
				
			}
		}
	}
	if ( jQuery("#avantagesBox").length > 0 ) {
		if (jQuery("#avantagesBox").hasClass("SpecialPage")) {	
			jQuery.cookie("bonValue",null);
			jQuery.cookie("offerValue",null);
		}
		else {
			if (jQuery.cookie("bonValue") != null) {
				jQuery("#bonItem").show();
				jQuery("#bonValue").html(jQuery.cookie("bonValue"));
				
				var currentTotal = parseFloat(jQuery("#total03").html().replace(",","."));
				var newTotal = currentTotal - parseFloat(jQuery.cookie("bonValue").replace(",","."));
				jQuery("#total03").html(newTotal.toFixed(2).replace(".",","));
			}
			if (jQuery.cookie("offerValue") != null) {
				jQuery("#offerItem").show();
				jQuery("#offerValue").html(jQuery.cookie("offerValue"));
				
				var currentTotal = parseFloat(jQuery("#total03").html().replace(",","."));
				var newTotal = currentTotal - parseFloat(jQuery.cookie("offerValue").replace(",","."));
				jQuery("#total03").html(newTotal.toFixed(2).replace(".",","));
			}
		}
	}
	
	if ( jQuery("#module02").length > 0 ) {
		
		var cookies = get_cookies_array();
		for(var name in cookies) {
		  //document.write( name + " : " + cookies[name] + "<br />" );
		  if (/920/.test(name)) {
			var split = jQuery.cookie(name).split('?');
	
	//var i = 2001;
		//while (jQuery.cookie(i+"name")!=null) {
			var productName = split[0];
			var quantity = split[1];
			var price = parseFloat(split[2]).toFixed(2);
			var target = "#module02";
			var index = parseInt(name);
			jQuery(target).show();
			jQuery(target).parent().show();
			if (jQuery(target).find(".MyBasketList").eq(0).children().length == 0) {
				jQuery(target).find(".MyBasketList").eq(0).append("<li><p class='ProductName'>"+productName+"</p><div class='QuantityControl'><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='SubtractBtn01' onclick=\"F6.UI.QuantityControl.decrease('quantity"+index+"',0)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this, 'quantity"+index+"','"+target+"');\">-</button><input class='Quantity' readonly='readonly' type='text' value='"+quantity+"' id='quantity"+index+"' /><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='AddBtn01' onclick=\"F6.UI.QuantityControl.increase('quantity"+index+"',12)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this,'quantity"+index+"','"+target+"');\">+</button></div><div class='PriceBox'><button title='Supprimer' class='RemoveBtn' onclick=\"F6.UI.Basket.removeItem(this,'"+target+"')\">Supprimer</button><p class='Price'>"+price+" &euro;</p><div></li>");
			}
			else {
				jQuery(target).find(".MyBasketList").eq(0).children().eq(0).before("<li><p class='ProductName'>"+productName+"</p><div class='QuantityControl'><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='SubtractBtn01' onclick=\"F6.UI.QuantityControl.decrease('quantity"+index+"',0)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this, 'quantity"+index+"','"+target+"');\">-</button><input class='Quantity' readonly='readonly' type='text' value='"+quantity+"' id='quantity"+index+"' /><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='AddBtn01' onclick=\"F6.UI.QuantityControl.increase('quantity"+index+"',12)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this,'quantity"+index+"','"+target+"');\">+</button></div><div class='PriceBox'><button title='Supprimer' class='RemoveBtn' onclick=\"F6.UI.Basket.removeItem(this,'"+target+"')\">Supprimer</button><p class='Price'>"+price+" &euro;</p><div></li>");
			}
			var trueHeight = jQuery(target).find(".MyBasketList").eq(0).children().outerHeight(true)*jQuery(target).find(".MyBasketList").eq(0).children().length;
			if ( trueHeight <= 190) {
				jQuery(target).find(".MyBasketList").eq(0).css("height",trueHeight+"px");
			}
			else {
				jQuery(target).find(".MyBasketList").eq(0).jScrollPane({
					scrollbarWidth: 9,
					scrollbarMargin: 5
				});
			}
		}
		}

		if (jQuery.cookie("total")!=null) {
			var split = jQuery.cookie("total").split('?');
			jQuery("#total01 > span").html(split[0]);
			jQuery("#total02 > span").html(split[1]);
			jQuery("#total03 > span").html(split[2]);
		}
		if (jQuery.cookie("totalArt")!=null) {
			var split = jQuery.cookie("totalArt").split('?');
			jQuery("#totalArt01 > span").html(split[0]);
			jQuery("#totalArt02 > span").html(split[1]);
			jQuery("#totalArt03 > span").html(split[2]);
			
			if (split[0] == 1) {
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("articles","article"));
			}
			else {
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("articles","article"));
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("article","articles"));
			}
			if (split[1] == 1) {
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("articles","article"));
			}
			else {
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("articles","article"));
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("article","articles"));
			}
			if (split[2] == 0) {
				jQuery("#linktoMonpanier").hide();
				jQuery("#totalArt03").wrap("<span id=\"totalArt04\" class=\"ModuleLink01\"></span>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
			}
			else if (split[2] == 1) {
				jQuery("#linktoMonpanier").css("display","block");
				jQuery("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
			}
			else {
				jQuery("#linktoMonpanier").css("display","block");
				jQuery("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("article","articles"));
			}
		}
	}
	if ( jQuery("#module03").length > 0 ) {
		var cookies = get_cookies_array();
		for(var name in cookies) {
		  //document.write( name + " : " + cookies[name] + "<br />" );
		  if (/930/.test(name)) {

			var split = jQuery.cookie(name).split('?');

			var productName = split[0];
			var quantity = split[1];
			var price = parseFloat(split[2]).toFixed(2);
			var target = "#module03";
			var index = parseInt(name);
			jQuery(target).show();
			if (jQuery(target).find(".MyBasketList").eq(0).children().length == 0) {
				jQuery(target).find(".MyBasketList").eq(0).append("<li><p class='ProductName'>"+productName+"</p><div class='QuantityControl'><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='SubtractBtn01' onclick=\"F6.UI.QuantityControl.decrease('quantity"+index+"',0)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this, 'quantity"+index+"','"+target+"');\">-</button><input class='Quantity' readonly='readonly' type='text' value='"+quantity+"' id='quantity"+index+"' /><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='AddBtn01' onclick=\"F6.UI.QuantityControl.increase('quantity"+index+"',12)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this,'quantity"+index+"','"+target+"');\">+</button></div><div class='PriceBox'><button title='Supprimer' class='RemoveBtn' onclick=\"F6.UI.Basket.removeItem(this,'"+target+"')\">Supprimer</button><p class='Price'>"+price+" &euro;</p><div></li>");
			}
			else {
				jQuery(target).find(".MyBasketList").eq(0).children().eq(0).before("<li><p class='ProductName'>"+productName+"</p><div class='QuantityControl'><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='SubtractBtn01' onclick=\"F6.UI.QuantityControl.decrease('quantity"+index+"',0)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this, 'quantity"+index+"','"+target+"');\">-</button><input class='Quantity' readonly='readonly' type='text' value='"+quantity+"' id='quantity"+index+"' /><button title='Maintenez appuy&eacute; pour faire d&eacute;filer la quantit&eacute;' class='AddBtn01' onclick=\"F6.UI.QuantityControl.increase('quantity"+index+"',12)\" onmouseup=\"F6.UI.QuantityControl.clearTimer02(this,'quantity"+index+"','"+target+"');\">+</button></div><div class='PriceBox'><button title='Supprimer' class='RemoveBtn' onclick=\"F6.UI.Basket.removeItem(this,'"+target+"')\">Supprimer</button><p class='Price'>"+price+" &euro;</p><div></li>");
			}
			var trueHeight = jQuery(target).find(".MyBasketList").eq(0).children().outerHeight(true)*jQuery(target).find(".MyBasketList").eq(0).children().length;
			if ( trueHeight <= 190) {
				jQuery(target).find(".MyBasketList").eq(0).css("height",trueHeight+"px");
			}
			else {
				jQuery(target).find(".MyBasketList").eq(0).jScrollPane({
					scrollbarWidth: 9,
					scrollbarMargin: 5
				});
			}
			}
		}
		if (jQuery.cookie("total")!=null) {
			var split = jQuery.cookie("total").split('?');
			jQuery("#total01 > span").html(split[0]);
			jQuery("#total02 > span").html(split[1]);
			jQuery("#total03 > span").html(split[2]);
		}
		if (jQuery.cookie("totalArt")!=null) {
			var split = jQuery.cookie("totalArt").split('?');
			jQuery("#totalArt01 > span").html(split[0]);
			jQuery("#totalArt02 > span").html(split[1]);
			jQuery("#totalArt03 > span").html(split[2]);
			
			if (split[0] == 1) {
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("articles","article"));
			}
			else {
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("articles","article"));
				jQuery("#totalArt01").html(jQuery("#totalArt01").html().replace("article","articles"));
			}
			if (split[1] == 1) {
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("articles","article"));
			}
			else {
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("articles","article"));
				jQuery("#totalArt02").html(jQuery("#totalArt02").html().replace("article","articles"));
			}
			if (split[2] == 0) {
				jQuery("#linktoMonpanier").hide();
				jQuery("#totalArt03").wrap("<span id=\"totalArt04\" class=\"ModuleLink01\"></span>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
			}
			else if (split[2] == 1) {
				jQuery("#linktoMonpanier").css("display","block");
				jQuery("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
			}
			else {
				jQuery("#linktoMonpanier").css("display","block");
				jQuery("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				jQuery("#totalArt04").html(jQuery("#totalArt03").html());
				jQuery("#totalArt04").attr("id","totalArt03");
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("articles","article"));
				jQuery("#totalArt03").html(jQuery("#totalArt03").html().replace("article","articles"));
			}
		}
	
	}
	if ( jQuery(".OptionGroup").length > 0 ) {
		jQuery(".OptionGroup").hide();
	}

	if (jQuery("#module03 .MyBasketList > li").length > 0 ) {
		jQuery("#module03").addClass("DynamicCart");
	}
	if (jQuery("#module02 .MyBasketList > li").length > 0 ) {
		jQuery("#module02").addClass("DynamicCart");
	}	
	if (jQuery(".DynamicCart").length < 2 ) {
		jQuery(".SousTotal").hide();
	} else {
		jQuery(".SousTotal").show();
	}
	
});

