﻿/* F6 global namespace
 *
 */
    F6 = {}
/* End. F6 global namespace */

$j=jQuery.noConflict();
/* F6.UI
 * All user inteface under this class name
 */
    F6.UI = {}
    /* F6.UI.focusInputBox
     * clear and save the default text in an input box
     * Params: [DOM Element] DOMInput
     */
        F6.UI.focusInputBox = function (DOMInput, defaultValue) {
            if ( defaultValue == undefined || DOMInput.value == defaultValue ) {
				DOMInput.value = "";
				$j(DOMInput).css("color","#000");
				$j(DOMInput).css("font-style","normal");
				$j(DOMInput).css("font-weight","normal");
            }
        }
	/* F6.UI.focusInputBox03
     * clear and save the default text in an input box, add class ActiveFocus to the element & change font-style
     * Params: [DOM Element] DOMInput
     */
		F6.UI.focusInputBox03 = function (DOMInput, defaultValue, parentClass) {
			$j(parentClass).addClass("ActiveFocus");
            if ( defaultValue == undefined || DOMInput.value == defaultValue ) {
                DOMInput.value = "";
				$j(DOMInput).css("color","#000");
				$j(DOMInput).css("font-style","normal");
				$j(DOMInput).css("font-weight","normal");
            }
        }
	/* F6.UI.focusInputBox04
     * add class ActiveFocus to the element
     * Params: [DOM Element] DOMInput
     */
		F6.UI.focusInputBox04 = function (parentClass) {
			$j(parentClass).addClass("ActiveFocus");
        }
				
    /* F6.UI.blurInputBox
     * Reverse to default text if input is empty
     * Params: [DOM Element] DOMInput
     */
        F6.UI.blurInputBox = function (DOMInput, defaultValue) {
            if ( DOMInput.value == "" ) {
                DOMInput.value = defaultValue;
				$j(DOMInput).css("color","#666");
				$j(DOMInput).css("font-style","italic");
            }
        }
	/* F6.UI.blurInputBox
     *  Reverse to default text if input is empty & change font-style ( for Recherchez textbox only)
     * Params: [DOM Element] DOMInput
     */
        F6.UI.blurInputBox2 = function (DOMInput, defaultValue) {
            if ( DOMInput.value == "" ) {
                DOMInput.value = defaultValue;
				$j(DOMInput).css("color","#000");
				$j(DOMInput).css("font-style","normal");
				$j(DOMInput).css("font-weight","bolder");
            }
        }
	/* F6.UI.blurInputBox
     *  Reverse to default text if input is empty, change font-style and remove class ActiveFocus
     * Params: [DOM Element] DOMInput
     */
	F6.UI.blurInputBox03 = function (DOMInput, defaultValue, parentClass) {
			$j(parentClass).removeClass("ActiveFocus");
            if ( DOMInput.value == "" ) {
                DOMInput.value = defaultValue;
				$j(DOMInput).css("color","#666");
				$j(DOMInput).css("font-style","italic");
            }
        }
	/* F6.UI.blurInputBox
     *  Reverse to default text if input is empty, change font-style and remove class ActiveFocus
     * Params: [DOM Element] DOMInput
     */
	F6.UI.blurInputBox04 = function (DOMInput, defaultValue, parentClass) {
			$j(parentClass).removeClass("ActiveFocus");
            if ( DOMInput.value == "" ) {
                DOMInput.value = defaultValue;
				$j(DOMInput).css("color","#999");
				$j(DOMInput).css("font-style","italic");
            }
        }
	F6.UI.blurInputBox05 = function (DOMInput, defaultValue) {
			if ( DOMInput.value == "" ) {
                DOMInput.value = defaultValue;
            }
        }

    /* F6.UI.addAsterikMask
     * Change type of input text box to 'password'
     * Params: [DOM Element] DOMInput
     */
        F6.UI.addAsterikMask = function (DOMInput, defaultValue, passwordId) {
            $j(DOMInput).parent().find("#"+passwordId).show();
			$j(DOMInput).parent().find("#"+passwordId).focus();
			$j(DOMInput).hide();
        }
		
	/* F6.UI.blurPasswordBox
     * Change type of input  'password' to text box 
     * Params: [DOM Element] DOMInput
     */
		F6.UI.blurPasswordBox = function (DOMInput, placeholderId) {
            if ( DOMInput.value == "" ) {
				$j(DOMInput).hide();
				$j(DOMInput).parent().find("#"+ placeholderId).show();
            }
        }
	/* F6.UI.addAsterikMask03
     * Change type of input text box to 'password' and add class ActiveFocus
     * Params: [DOM Element] DOMInput
     */
        F6.UI.addAsterikMask03 = function (DOMInput, defaultValue, passwordId, parentClass) {
			$j(parentClass).addClass("ActiveFocus");
            $j(DOMInput).parent().find("#"+passwordId).show();
			$j(DOMInput).parent().find("#"+passwordId).focus();
			$j(DOMInput).hide();
        }
		
	/* F6.UI.blurPasswordBox03
     * Change type of input  'password' to text box  and remove class ActiveFocus
     * Params: [DOM Element] DOMInput
     */
		F6.UI.blurPasswordBox03 = function (DOMInput, placeholderId, parentClass) {
			$j(parentClass).removeClass("ActiveFocus");
            if ( DOMInput.value == "" ) {
				$j(DOMInput).hide();
				$j(DOMInput).parent().find("#"+ placeholderId).show();
            }
        }
		
	 /* F6.UI.Accordion class
	 * This class is used to accordion control in CourseExpress_Step1 & fitcheproduit. For CourseExpress page, let's define following class on the element F6.UI.Accordion.showhide(this). For fitcheproduit page, let's define following class on the element F6.UI.Accordion.showhide2(this).
	 */
		F6.UI.Accordion = {};
			F6.UI.Accordion.delay = null;
			F6.UI.Accordion.timer = null;
		
			/* methods */
				/* init state for Accordion */
				 F6.UI.Accordion.constructor  = function(o) {
					accordionPanel = $j(o).find("h4");
					$j(o).find("h4").nextAll().hide();
					$j(o).find("h4.Active").nextAll().show();
				 }
				/* show hide for Accordion in CourseExpress_Step1 page */
				F6.UI.Accordion.showhide = function (controlElement) {
					if (!($j(controlElement).hasClass("Active"))) {
						$j(controlElement).parent().parent().children().find("h4.Active").removeClass("Active").nextAll().hide();
						$j(controlElement).addClass("Active");
						$j(controlElement).nextAll().show();
						return false;
					}
					else {
						$j(controlElement).removeClass("Active").nextAll().hide();
					}
				}
				/* show hide for Accordion in fitcheproduct pages */
				F6.UI.Accordion.showhide2 = function (controlElement) {
					if (!($j(controlElement).hasClass("Active"))) {
						$j(controlElement).addClass("Active");
						$j(controlElement).nextAll().show("fast");
					}
					else {
						$j(controlElement).removeClass("Active");
						$j(controlElement).nextAll().hide("fast");
					}
					return false;
				}
			/* End. methods */
	
	/* F6.UI.AddControl class
	 * Use to add more item for the side nave list (CourseExpress_Step2 page)
	 In order to use it, let's define following class on the the ok button F6.UI.AddControl.add(this);
	 */
		F6.UI.AddControl = {};
				F6.UI.AddControl.add = function (o, event) {
					var e = event ? event : window.event;
					try {
						e.stopPropagation();
					}
					catch (exp) {
						e.cancelBubble = true;
					}
					var val = $j(o).parent().find(".InputText").attr("value");
					var check = true;
					if (val != "Nom de produit, marque, ..." && val !="") {
						if (val.length <=2) {
							$j(".AddItemPanel .error02").show();
						}
						else {
							$j(".SuggestData").each(function() {
								if ($j(this).find("del").html()==null) {
									if ($j(this).html()==val) {
										check = false;
									}
								}
								else {
									if ($j(this).find("del").html()==val) {
										check = false;
									}
								}
							});
							if (check == true) {
								if ($j(".ShoppingList").children().html()!=null) {
									$j(".ShoppingList").children().eq(0).before("<li><a href=\"#\" title=\""+val+"\" class=\"SuggestData\">" + val + "</a><a href=\"#\" class=\"DeleteBtn\" title=\"Supprimer\" onclick=\"$j(this).parent().remove()\">Supprimer</a></li>");
								}
								else {
									$j(".ShoppingList").append("<li><a href=\"#\" title=\""+val+"\" class=\"SuggestData\">" + val + "</a><a href=\"#\" class=\"DeleteBtn\" title=\"Supprimer\" onclick=\"$j(this).parent().remove()\">Supprimer</a></li>");
								}
							}
						}
						$j(o).parent().find(".InputText").attr("value","Nom de produit, marque, ...");
							$j(o).parent().find(".InputText").css("color","#666");
							$j(o).parent().find(".InputText").css("font-style","italic");
					}
					else {
						if ($j(".AddItemPanel .error01").length > 0) {
							$j(".AddItemPanel .error01").show();
						}
					}
					return false;
				}
				
	/* F6.UI.CheckboxNavigation class
	 * Use to add the uncheck all checkbox function. 
	 * In order to use it, let's define F6.UI.CheckboxNavigation($j("buttonId") {
            checkboxList: $j("checkboxListId")
        });
	 	with buttonId is the button which you check on it to uncheck all checkbox in the checkboxListId
	 */
		F6.UI.CheckboxNavigation = function (jEl, options) { //jEl = jquery element
			var self = this; //self reference
		
			/* private members */
				var o = jEl;
				var checkboxList = options.checkboxList;
				var checkedBox;
			/* End. private members */
		
			/* methods */
				this.uncheckall = function (objs) {
					objs.each(function () {
						var obj = $j(this);
		
						obj.removeAttr("checked");
					});
				}
				
				this.checkall = function (objs) {
					objs.each(function () {
						var obj = $j(this);
		
						obj.attr("checked", "checked");
					});
				}
				
				this.uncheck = function (obj) {
					obj.removeAttr("checked");
				}
		
				this.check = function (obj) {
					obj.attr("checked", "checked");
				}
		
				this.callback = function (obj) {
					if ( obj.attr("checked") == "checked" || obj.attr("checked") == true ) {
						checkedBox++;
						this.uncheck(o);
					}
					else {
						checkedBox--;
					}
		
					if ( checkedBox == 0 ) {
						this.check(o);
					}
				}
		
			/* End. methods */
		
			/* constructor */
				function constructor (config) {
					o.bind("click", function () {
						if ( o.attr("checked") == "checked" || o.attr("checked") == true ) {
							self.uncheckall(checkboxList);
						}
					});
		
					checkboxList.each(function () {
						var el = $j(this);
						
						if ( el.attr("checked") == "checked" || el.attr("checked") == true ) {
							checkedBox++;
						}
		
						el.bind("click", function () {
							self.callback(el);
						});
					});
				}
		
				constructor(options);
			/* End. constructor */
		}				
		
	/* F6.UI.DataGridControl class
	 * Use in maCreneau popup to implement the click on radio function.
	 * in order to use it, let's define F6.UI.DataGridControl.setState(this) function to all radio elements
	 */
		F6.UI.DataGridControl = {};
		
			/* methods */
				F6.UI.DataGridControl.setState = function (input) {
					if ($j(input).attr("checked")==true) {
						$j("#maCreneau").find("td.Active").removeClass("Active");
						$j("#maCreneau").find("th.Active").removeClass("Active");
						$j(input).parent().addClass("Active");
						$j(input).parent().parent().find("th").addClass("Active");
						$j("#maCreneau thead>tr").children().eq($j(input).parent().prevAll().length).addClass("Active");
					}
				}
				F6.UI.DataGridControl.setMouseOverState = function (input) {
					$j(input).css("background","#EDBCD9");
					$j(input).parent().find("th").css("background","#EDBCD9");
					$j("#maCreneau thead>tr").children().eq($j(input).prevAll().length).css("background","#EDBCD9");
				}
				F6.UI.DataGridControl.removeMouseOverState = function (input) {
					$j(input).css("background","none");
					$j(input).parent().find("th").css("background","none");
					$j("#maCreneau thead>tr").children().eq($j(input).prevAll().length).css("background","none");
				}
			/* End. methods */	

	/* F6.UI.ShowHideControl class
	 * Use to control the slide effect
	 * in order to use it, for n-1_alimentation page, let's define F6.UI.ShowHideControl.show(this, event) in the mouseover element and F6.UI.ShowHideControl.stopEvent(event) in the show box. 
	 * for product list, let's define F6.UI.ShowHideControl.show(this, event) in the mouseover element and F6.UI.ShowHideControl.stopEvent(event) in the show box. 
	 * for caroussel, let's define F6.UI.ShowHideControl.show3(this, event) in the mouseover element and F6.UI.ShowHideControl.stopEvent(event) in the show box. 
	 */
		F6.UI.ShowHideControl = {};
				F6.UI.ShowHideControl.init = function () {
					$j(".SubBox14").each(function() {
						$j(this).addClass("Disable");											  
					});
				}
				/* show with slide effect for n-1_alimentation page */
				F6.UI.ShowHideControl.show = function (input, event) {
					$j(".ListFood map").each(function() {		
						if  ($j(this).attr("id") != $j(input).parent().attr("id")) {
							$j(this).parent().parent().find(".SubBox14").addClass("Disable");
							$j(this).parent().parent().find(".SubBox13").removeClass("NoneBorder");
						}
					});
					$j(input).parent().parent().find(".SubBox14").removeClass("Disable").slideDown("normal");
					if($j(input).parent().parent().find(".SubBox13").hasClass("Alter07")){
						$j(input).parent().parent().find(".SubBox13").addClass("NoneBorder");
					}
					
					
					F6.UI.ShowHideControl.stopEvent(event);
				}
				/* show with slide effect for product list */
				F6.UI.ShowHideControl.show2 = function (input, event) {
					$j(".LP5 > ul > li").each(function() {		
						if  ($j(this).attr("id") != $j(input).parent().attr("id")) {
							$j(this).find(".SubBox14").addClass("Disable");
						}
					});
					$j(input).parent().find(".SubBox14").removeClass("Disable").slideDown("normal");	
					$j(input).parent().find(".priceBox").css("border-top","1px solid #FFF");
					F6.UI.ShowHideControl.stopEvent(event);
				}
				/* show with slide effect for caroussel */
				F6.UI.ShowHideControl.show3 = function (input, event) {
					$j(".ProductList > li").each(function() {		
						if  ($j(this).attr("id") != $j(input).parent().attr("id")) {
							$j(this).find(".SubBox14").addClass("Disable");
							$j(this).find(".priceBox").css("border-top","1px solid #D9D9D9");
						}
					});
					$j(input).parent().find(".SubBox14").removeClass("Disable").slideDown("normal");	
					$j(input).parent().find(".priceBox").css("border-top","1px solid #FFF");
					F6.UI.ShowHideControl.stopEvent(event);
				}
				/* show with slide effect for Lot4_Transverse_Banc-dessai */
				F6.UI.ShowHideControl.show4 = function (input, event) {
					$j(".ListItemsLipstick .Product").each(function() {		
						if  ($j(this).attr("id") != $j(input).parent().attr("id")) {
							$j(this).find(".SubBox14").addClass("Disable");
						}
					});
					$j(input).parent().find(".SubBox14").removeClass("Disable").slideDown("normal");	
					$j(input).parent().find(".priceBox").css("border-top","1px solid #FFF");
					F6.UI.ShowHideControl.stopEvent(event);
				}
				/* show with slide effect for simple project */
				F6.UI.ShowHideControl.show5 = function (input, event) {
					$j(".ListFood .Btn02").each(function() {		
						if($j(this).attr("id") != $j(input).attr("id")) {
							$j(this).parent().parent().find(".SubBox15").addClass("DisableAlt");
							$j(this).parent().parent().find(".PromoExtra").addClass("DisableAlt");
							$j(this).parent().parent().find(".BtnClose").addClass("DisableAlt");
							
						}
					});
					$j(input).parent().parent().find(".SubBox13").removeClass("NoneBorder");
					$j(input).parent().parent().find(".SubBox15").removeClass("DisableAlt").slideDown("normal");
					$j(input).parent().parent().find(".PromoExtra").removeClass("DisableAlt");
					$j(input).parent().parent().find(".SubCombobox").addClass("Rpadding6");
					$j(input).parent().parent().find(".PromoExtra").children().eq(0).addClass("Rpadding15");
					$j(input).parent().parent().find(".BtnClose").removeClass("DisableAlt");
					$j(input).parent().parent().find(".SubBox08").addClass("SubBox08Expand");
					$j(input).parent().parent().find(".SubBox14").addClass("TemporaryDisable");
					$j(input).parent().parent().find(".SubBox13").addClass("BorderGrey");
					
					F6.UI.ShowHideControl.stopEvent(event);
				}
				F6.UI.ShowHideControl.hide5 = function (input, event) {
					$j(input).parent().find(".SubBox15").hide();
					if(!$j(input).parent().find(".PromoExtra").eq(0).hasClass("AlwaysShow")) {
						$j(input).parent().find(".PromoExtra").addClass("DisableAlt");
					}
					$j(input).parent().find(".SubCombobox").removeClass("Rpadding6");
					$j(input).parent().find(".PromoExtra").children().eq(0).removeClass("Rpadding15");
					$j(input).addClass("DisableAlt");
					$j(input).parent().find(".SubBox14").removeClass("TemporaryDisable");
					$j(input).parent().find(".SubBox08").removeClass("SubBox08Expand");
					$j(input).parent().removeClass("BorderGrey")
					F6.UI.ShowHideControl.stopEvent(event);
				}
				
				/* show with slide effect for Lot4_Transverse_Banc-dessai */
				F6.UI.ShowHideControl.showhide = function (showElement, hideElement) {
					$j(hideElement).hide();
					$j(showElement).show();
				}
				F6.UI.ShowHideControl.showhide02 = function (input, showElement) {
					if ($j(input).attr("checked")==true) {
						$j(showElement).show();
					}
					else {
						$j(showElement).hide();
						$j("#button01").hide();
						F6.UI.ShowHideControl.showhide('#textareaForm', '#textareaInfo');
						$j("#button02").show();
					}
				}
				F6.UI.ShowHideControl.showhide03 = function (input) {
					if ($j(input).hasClass("BgToogleActive")) {
						$j(input).removeClass("BgToogleActive").addClass("BgToogle");
						$j(input).next().slideUp();
					}
					else {
						$j(input).removeClass("BgToogle").addClass("BgToogleActive");
						$j(input).next().slideDown();
					}
				}
				F6.UI.ShowHideControl.showhide04 = function (input) {
					if ($j(input).hasClass("BgToogle02Active")) {
						$j(input).removeClass("BgToogle02Active").addClass("BgToogle02");
						$j(input).next().slideUp();
					}
					else {
						$j(input).removeClass("BgToogle02").addClass("BgToogle02Active");
						$j(input).next().slideDown();
					}
				}
				F6.UI.ShowHideControl.changeInfo = function (typeName, typePrice) {
					typeName = " Livraison "+typeName;
					$j("#optionPrice > li").show();
					$j("#typeName").html(typeName);
					$j("#typePrice").html(typePrice);
					
					jQuery.cookie("livraisonValue",typeName + "?" + typePrice);
					if (jQuery.cookie("lot2Sum")!=null) {
						
						var split = jQuery.cookie("lot2Sum").split('?');
						var newTotal = parseFloat(split[1].replace(",","."))+ parseFloat(split[3].replace(",","."))+ parseFloat(typePrice);
						jQuery.cookie("lot2Sum", split[0]+"?"+split[1]+"?"+split[2]+"?"+split[3]+"?"+newTotal.toFixed(2).replace(".",",")+"?"+ split[5]);
						$j("#total03").html(newTotal.toFixed(2).replace(".",","));
					}
				}
				F6.UI.ShowHideControl.stopEvent = function (event) {
					var e = event ? event : window.event;
					try {
						e.stopPropagation();
					}
					catch (exp) {
						e.cancelBubble = true;
					}
				}
				F6.UI.ShowHideControl.goTo = function (url) {
					window.location = url;
				}
	/* F6.UI.ColorBoxControl class
	 * Use to choose color
	 */
		F6.UI.ColorBoxControl = {};
				F6.UI.ColorBoxControl.init = function () {
					//Something
				}
				/* show with slide effect for n-1_alimentation page */
				F6.UI.ColorBoxControl.selectColor = function (input, event) {
					$j(input).parent().find("a").each(function() {		
						$j(this).removeClass("CurrentColor");
					});
					$j(input).addClass("CurrentColor");	
					if($j(".InfoOfColor").length > 0) {
						var infoColor = $j(input).attr("rel");
						$j(input).parent().parent().find(".InfoOfColor").html(infoColor);
					}
					F6.UI.ColorBoxControl.stopEvent(event);
				}		
				F6.UI.ColorBoxControl.stopEvent = function (event) {
					var e = event ? event : window.event;
					try {
						e.stopPropagation();
					}
					catch (exp) {
						e.cancelBubble = true;
					}
				}			
	/* F6.UI.ViewTypeControl class
	 * Use to control type of view (mosaic or list)
	 * in order to use, let's defined F6.UI.ViewTypeControl.showhide(this) to 2 button, mosaic view and list view
	 */
		F6.UI.ViewTypeControl = {};
		
			/* methods */
				F6.UI.ViewTypeControl.init = function (input) {
					$j(".LP4").each(function () {
						var el = $j(this);
						if ( el.hasClass("Active") ) {
							el.show();
						}
						else {
							el.hide();
						}
					});
					$j(".LP5").each(function () {
						var el = $j(this);
						if ( el.hasClass("Active") ) {
							el.show();
						}
						else {
							el.hide();
						}
					});
					$j(".LP6").each(function () {
						var el = $j(this);
						if ( el.hasClass("Active") ) {
							el.show();
						}
						else {
							el.hide();
						}
					});
				}
				F6.UI.ViewTypeControl.showhide = function (input) {
					if (!$j(input).hasClass("Active")) {
						$j(input).addClass("Active");
						if ($j(input).hasClass("Btn01")) {
							$j(".Btn02").removeClass("Active");
							$j(".LP4").show();
							$j(".LP5").hide();
							$j(".LP6").hide();
						}
						else if ($j(input).hasClass("Btn02")) {
							$j(".Btn01").removeClass("Active");
							$j(".LP5").show();
							$j(".LP6").show();
							$j(".LP4").hide();
						}
					}
				}
			/* End. methods */		
	/* F6.UI.PaymentControl class
	 * Use in Tunnel_MonPaiement.php to implement the click on radio function.
	 * in order to use it, let's define F6.UI.PaymentControl.setState(input, rel) function to all radio elements with input is the clicked checkbox and rel is the id of the relative box.
	 */
		F6.UI.PaymentControl = {};
		
			/* methods */
				F6.UI.PaymentControl.setState = function (input, rel) {
					if ($j(input).attr("checked")==true) {
						
						$j(".PaymentType > li.Active").removeClass("Active");
						$j(input).parent().parent().parent().addClass("Active");
						$j(".CardInfo").removeClass("Active");
						$j("#"+rel).addClass("Active");
						$j("#"+rel).find("input[type='text']").attr("value","");
						$j("#"+rel).find("input[type='checkbox']").removeAttr("checked");
						$j("#"+rel).find("select > option").eq(0).attr("selected","selected");
						$j("#"+rel).find("#dateValue").attr("value","JJ");
						$j("#"+rel).find("#monthValue").attr("value","MM");
						$j("#"+rel).find("#yearValue").attr("value","YYYY");
						$j("#"+rel).find(".TextBox02").css("font-style","italic");
						$j("#"+rel).find(".TextBox02").css("color","#666");
					}
				}
			/* End. methods */	
	/* F6.UI.CheckBoxControl class
	 * Use in Tunnel_MesAvantages page to implement the click on checkbox function.
	 * in order to use it, let's define F6.UI.CheckBoxControl.setState(this) function to all radio elements
	 */
		F6.UI.CheckBoxControl = {};
		
			/* methods */
				F6.UI.CheckBoxControl.setState = function (input) {
					if ($j(input).attr("checked")==true) {
						$j(input).parent().addClass("CouponActive");
					}
					else {
						$j(input).parent().removeClass("CouponActive");
					}
				}
			/* End. methods */	
			
	/* F6.UI.CheckBoxOptionControl class
	 * Use in Tunnel_Monpanier page to implement the click on radio function.
	 * in order to use it, let's define F6.UI.CheckBoxOptionControl.setState(this) function to all radio elements
	 */
		F6.UI.CheckBoxOptionControl = {};
		
			/* methods */
				F6.UI.CheckBoxOptionControl.setState = function (input) {
					if ($j(input).attr("checked")==true) {
						$j(input).parent().parent().find(".OptionActive").removeClass("OptionActive");										
						$j(input).parent().addClass("OptionActive");
					}
				}
				F6.UI.CheckBoxOptionControl.setState02 = function (input) {
					if ($j(input).attr("checked")==true) {
						$j(input).parent().parent().find(".OptionActive").removeClass("OptionActive");										
						$j(input).parent().addClass("OptionActive");
						$j("#cartSum").find(".OptionChoice > .Price").html($j(input).parent().text());
						if (jQuery.cookie("lot2Sum")!=null) {
							var split = jQuery.cookie("lot2Sum").split('?');
							jQuery.cookie("lot2Sum", split[0]+"?"+split[1]+"?"+split[2]+"?"+split[3]+"?"+split[4]+"?"+ $j(input).parent().text());
						}
					}
				}
			/* End. methods */		
			
	/* F6.UI.CheckBoxOptionExtraControl class
	 * Use in L3_Mon-compte1 page.
	 * in order to use it, let's define F6.UI.CheckBoxOptionExtraControl.setState(this) function to all radio elements to enable it click behavior
	 * let's define F6.UI.CheckBoxOptionExtraControl.add(this) to enable add more Digicode 
	 * let's define F6.UI.CheckBoxOptionExtraControl.setState2(input, target, bool) 
	 */
		F6.UI.CheckBoxOptionExtraControl = {};
		
			/* methods */
				F6.UI.CheckBoxOptionExtraControl.setState = function (input) {
					if ($j(input).attr("checked")==true) {
						$j(input).parent().parent().find(".OptionExtraActive").removeClass("OptionExtraActive");										
						$j(input).parent().addClass("OptionExtraActive");
					}
				}
				F6.UI.CheckBoxOptionExtraControl.add = function () {
					F6.UI.AddNewControl.addTelephone(this); 
					return false;
				}
				F6.UI.CheckBoxOptionExtraControl.add = function () {
					F6.UI.AddNewControl.addAdress(this); 
					return false;
				}
				F6.UI.CheckBoxOptionExtraControl.setState2 = function (input, target, bool) {
					if ($j(input).attr("checked")==true) {
						$j(input).parent().parent().find(".OptionExtraActive").removeClass("OptionExtraActive");										
						$j(input).parent().addClass("OptionExtraActive");
						if (bool == true) {
							if ($j(target).find(".Overlay").length > 0) {
								$j(target).find(".Overlay").css("opacity", "0.7");
								$j(target).find(".Overlay").css("z-index", "10");
							}
							else {
								$j(target).addClass("Disable");
							}
							$j(target).find("input").attr("disabled","disabled");
						}
						else {
							if ($j(target).find(".Overlay").length > 0) {
								$j(target).find(".Overlay").css("opacity", "0");
								$j(target).find(".Overlay").css("z-index", "-1");
								
							}
							else {
								$j(target).removeClass("Disable");
							}
							$j(target).find("input").removeAttr("disabled","disabled");
							
							
						}
					}
				}
			/* End. methods */		
			
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.PopupStateControl = {};
		
			/* methods */
				F6.UI.PopupStateControl.setState = function (input, event) {
					var e = event ? event : window.event;
					try {
						e.stopPropagation();
					}
					catch (exp) {
						e.cancelBubble = true;
					}
					$j(".PopupContent01").css("opacity",0.5);
					$j(".PopupContent02").css("opacity",0.5);
					$j(input).css("opacity",1);
				}
			/* End. methods */	
			
	/* F6.UI.AddNewControl class
	 * Use in L3_Parrainage & L3_Mon-compte1 page to add more control
	 * in order to use it, for L3_Parrainage page, let's define F6.UI.AddNewControl.addEmail(this) function to the input & for L3_Mon-compte1 page, let's define F6.UI.AddNewControl.addDigicode(this) function to the input
	 */
		F6.UI.AddNewControl = {};
		
			/* methods */
				F6.UI.AddNewControl.addEmail = function (input) {
					if ($j(input).children().length > 0 && $j(input).children().length < 10) {
						var emailID = $j(input).children().length + 1;
						$j(input).append("<li><label for=\"email"+emailID+ "\">Email ami " + emailID + ":</label><input type=\"text\" name=\"email"+emailID+"\" id=\"email"+emailID+"\" /><p class=\"error\">Veuilllez saisir votre adresse email</p></li>");
					}
				}
				F6.UI.AddNewControl.addDigicode = function (input) {
					if ($j(input).parent().parent().parent().find(".DigicodeBlock").length > 0 && $j(input).parent().parent().parent().find(".DigicodeBlock").length < 5) {
						var digicodeID = $j(input).parent().parent().parent().find(".DigicodeBlock").length + 1;
						$j(input).parent().parent().parent().append("<div class=\"DigicodeBlock\"><p class=\"Label\"><label for=\"digicode"+digicodeID+"\">Digicode "+digicodeID+" :</label></p><div class=\"WrapperControl WrapperControlExtra\"><input type=\"text\" id=\"digicode"+digicodeID+"\" name=\"digicode"+digicodeID+"\" class=\"InputStyle\" /></div></div>");
						if ($j(input).parent().parent().parent().find(".DigicodeBlock").length == 5) {
							$j(input).remove();
						}
					}
				}
				
				F6.UI.AddNewControl.addTelephone = function (input) {
					if ($j(input).parent().parent().find(".TelephoneBlock").length > 0 && $j(input).parent().parent().find(".TelephoneBlock").length < 3) {
						var telephoneID = $j(input).parent().parent().find(".TelephoneBlock").length + 1;
						$j(input).parent().parent().append("<div class=\"TelephoneBlock\"><p class=\"Label\"><label for=\"telephone"+telephoneID+"\">T&eacute;l&eacute;phone "+telephoneID+" :</label></p><div class=\"WrapperControl\"><input type=\"text\" id=\"telephone"+telephoneID+"\" name=\"telephone"+telephoneID+"\" class=\"InputStyle\" /></div></div>");
						if ($j(input).parent().parent().find(".TelephoneBlock").length == 3) {
							$j(input).remove();
						}
					}
				}
				
				F6.UI.AddNewControl.addAdress = function (input) {
					
					if ($j(input).parent().parent().parent().find(".AdressBlock").length > 0 && $j(input).parent().parent().parent().find(".AdressBlock").length < 2) {
						var adressID = $j(input).parent().parent().parent().find(".AdressBlock").length + 1;
						$j(input).parent().parent().parent().append("<div class=\"AdressBlock\"><p class=\"Label\"><label>&nbsp;</label></p><div class=\"WrapperControl\"><input type=\"text\" id=\"adress"+adressID+"\" name=\"adress"+adressID+"\" class=\"InputStyle\" /></div></div>");
						if ($j(input).parent().parent().parent().find(".AdressBlock").length == 2) {
							$j(input).remove();
						}
					}
				}
				F6.UI.AddNewControl.addAddress = function (input) {
					if ($j(input).parent().find(".AddressBlock").length > 0 && $j(input).parent().find(".AddressBlock").length < 2) {
						var addressID = $j(input).parent().find(".AddressBlock").length + 1;
						$j(input).parent().append("<div class=\"AddressBlock\"> <label class=\"InfoTitExt\">Adresse :</label><input class=\"TextboxInput\" type=\"text\" id=\"address"+addressID+"\" name=\"address"+addressID+"\" /></div>");
						if ($j(input).parent().find(".AddressBlock").length == 2) {
							$j(input).remove();
						}
					}
				}
				
				F6.UI.AddNewControl.addDateBlock = function (input) {
					
					if ($j(input).parent().parent().find(".DateBlock").length > 0 && $j(input).parent().parent().parent().find(".DateBlock").length < 3) {
						var blockID = $j(input).parent().parent().find(".DateBlock").length + 1;
						$j(input).parent().parent().append("<div class=\"DateBlock\"><p class=\"Label\"><label>Date de naissance Enfant "+blockID+"</label></p><div class=\"WrapperControl\"><input type=\"text\" id=\"dateblock1"+blockID+"\" name=\"dateblock1"+blockID+"\" class=\"InputStyle ExtraStyle\" value=\"JJ\" maxlength=\"2\" onblur=\"F6.UI.blurInputBox(this, 'JJ');\" onfocus=\"F6.UI.focusInputBox(this, 'JJ');\" onkeypress=\"return F6.UI.NumberControl.control(this, event, '#dateblock2"+blockID+ "' )\" /><span>/</span><input type=\"text\" id=\"dateblock2"+blockID+"\" name=\"dateblock2"+blockID+"\" class=\"InputStyle ExtraStyle\" value=\"MM\" maxlength=\"2\" onblur=\"F6.UI.blurInputBox(this, 'MM');\" onfocus=\"F6.UI.focusInputBox(this, 'MM');\" onkeypress=\"return F6.UI.NumberControl.control(this, event, '#dateblock3"+blockID+ "' )\" /><span>/</span><input type=\"text\" id=\"dateblock3"+blockID+"\" name=\"dateblock3"+blockID+"\" class=\"InputStyle ExtraStyle\" value=\"YYYY\" maxlength=\"4\" onblur=\"F6.UI.blurInputBox(this, 'YYYY');\" onfocus=\"F6.UI.focusInputBox(this, 'YYYY');\" onkeypress=\"return F6.UI.NumberControl.control(this, event)\" /></div></div>");
						if ($j(input).parent().parent().find(".DateBlock").length == 3) {
							$j(input).remove();
						}
					}
				}
			/* End. methods */
			
	/* F6.UI.NumberControl class
	 * Use in Tunnel_MonPaiement page to implement the number input control ( only number can enter in the textbox & auto move focus to the next textbox 
	 * in order to use it, let's define F6.UI.NumberControl.control(oTextbox, oEvent, oTarget) function to the onkeypress event, with oTextbox is the current textbox, oTarget is the next element to focus on.
	 */
		F6.UI.NumberControl= {};
		
			/* methods */
				F6.UI.NumberControl.control = function (oTextbox, oEvent, oTarget) {
					var key;
					if ( (/MSIE/).test(navigator.userAgent) ) { 
						if (typeof oEvent.keyCode == 'number') {
							key = oEvent.keyCode;
						}
					}
					else {
						if (typeof oEvent.charCode == 'number') {
							key = oEvent.charCode;
						}
						if (key == 0) {
							if (typeof oEvent.keyCode == 'number') {
								key = oEvent.keyCode;
							}
						}
					}
					switch (key) {
						case 38: //up arrow  
						case 40: //down arrow
						case 37: //left arrow
						case 39: //right arrow
						case 33: //page up  
						case 34: //page down  
						case 36: //home  
						case 35: //end                  
						case 13: //enter 
						case 9: //tab  
						case 27: //esc  
						case 16: //shift  
						case 17: //ctrl  
						case 18: //alt  
						case 20: //caps lock
						case 8: //backspace  
						case 46: //delete
						   return true;
						   break;
						default:
							if (key > 47 && key < 58) {
								var iLen = oTextbox.value.length;
								var length =$j(oTextbox).attr("maxlength");
								if ( (/MSIE/).test(navigator.userAgent) ) { 
									if ( iLen == length - 1 ) {
										if (oTarget !=null ) {
											setTimeout(function() {$j(oTarget).focus();},100);
										}
									}
								}
								else {
									if ( iLen == length-1 ) {
										if (oTarget !=null ) {
											setTimeout(function() {$j(oTarget).focus();},50);
										}
									}
								}
								return true;
						   		break;
							}
							else {
								return false;
								break;
							}
					}
				}
			/* End. methods */
			
	/* F6.UI.CheckboxControl class
	 * Use in L3_DetailCommande & L3_DetailListe page to implement the click all checkbox function.
	 * in order to use it, let's define F6.UI.CheckboxControl.checkAll(input, target) function to the check all checkbox with input is the current checkbox and target is the list of checkbox to check.
	 * In addition, let's define F6.UI.CheckboxControl.check(input, target) function to all checkbox in list to ensure that when manual check all the checkbox list, the check all button will be checked.
	 */
		F6.UI.CheckboxControl= {};	
			/* methods */
				F6.UI.CheckboxControl.checkboxActive = 0;
				F6.UI.CheckboxControl.checkboxNum = $j(".PositionCheck").find("input[type='checkbox']").length;
				F6.UI.CheckboxControl.checkAll = function (input, target) {
					F6.UI.CheckboxControl.checkboxNum = $j(".PositionCheck").find("input[type='checkbox']").length;
					if ($j(input).attr("checked")==true) {
						$j(target).find("input[type='checkbox']").attr("checked","checked");
						$j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").attr("checked","checked");
						F6.UI.CheckboxControl.checkboxActive = F6.UI.CheckboxControl.checkboxNum;
					}
					else {
						$j(target).find("input[type='checkbox']").removeAttr("checked");
						$j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").removeAttr("checked");
						F6.UI.CheckboxControl.checkboxActive = 0;
					}
				}
				
				F6.UI.CheckboxControl.check = function (input, target) {
					F6.UI.CheckboxControl.checkboxNum = $j(".PositionCheck").find("input[type='checkbox']").length;
					F6.UI.CheckboxControl.checkboxActive = 0;
					if ($j(input).attr("checked")==true) {
						 
						$j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").each(function() {
							if ($j(this).attr("checked")==true) {
								F6.UI.CheckboxControl.checkboxActive++;
							}
						});
						var checkboxNum = $j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").length;
						if (F6.UI.CheckboxControl.checkboxActive == F6.UI.CheckboxControl.checkboxNum) {
							$j(target).find("input[type='checkbox']").attr("checked","checked");
						}
					}
					else {
						F6.UI.CheckboxControl.checkboxActive--;
						$j(target).find("input[type='checkbox']").removeAttr("checked");
					}
				}
				
				F6.UI.CheckboxControl.uncheckAll = function (input, target) {
					F6.UI.CheckboxControl.checkboxNum = $j("#checkboxNavigation").find("input[type='checkbox']").length;
					if ($j(input).attr("checked")==false) {
						$j(target).find("input[type='checkbox']").each(function() {
							$j(this).attr("checked","checked");
							var group = $j(this).parent().attr("class");
							var groupdisable = group + "Disable";
							$j(".LP6").find("."+groupdisable).removeClass(groupdisable).addClass(group);
						});
						//$j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").attr("checked","checked");
						//F6.UI.CheckboxControl.checkboxActive = F6.UI.CheckboxControl.checkboxNum;
					}
					else {
						$j(target).find("input[type='checkbox']").each(function() {
							$j(this).removeAttr("checked");
							var group = $j(this).parent().attr("class");
							var groupdisable = group + "Disable";
							$j(".LP6").find("."+group).removeClass(group).addClass(groupdisable);
						});
						//$j("."+$j(input).parent().attr("class")).find("input[type='checkbox']").removeAttr("checked");
						//F6.UI.CheckboxControl.checkboxActive = 0;
					}
				}
				
			/* End. methods */
			
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TextareaControl = {};
		
			/* methods */
				F6.UI.TextareaControl.setMaxLength = function (input, maxNum) {
					if (input.value.length > maxNum-1) { 
						input.value = input.value.substr(0,maxNum-1);
					}
				}
			/* End. methods */	
			
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide= {};
		
			/* methods */
				F6.UI.TabShowHide.setState= function (input, target) {
					if($j(input).hasClass("Active")) {
						
					} 
					else {
						$j(input).parent().parent().find("a").removeClass("Active");
						$j(input).addClass("Active");
						 if ( $j(".PartInfo").length > 0 ) {
							$j(".PartInfo").removeClass("Active");
						 }
						 else if ( $j(".InfoServices").length > 0 ) {
							$j(".InfoServices").removeClass("Active");
						 } 
						$j(target).addClass("Active");
					}
				}
			/* End. methods */	
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide2= {};
		
			/* methods */
				F6.UI.TabShowHide2.setState= function (input) {
					if($j(input).parent().hasClass("Active")) {
						$j(input).parent().removeClass("Active");
					} 
					else {
						$j(input).parent().parent().find("li").removeClass("Active");
						$j(input).parent().addClass("Active");
					}
				}
			/* End. methods */	
			
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide3= {};
		
			/* methods */
				F6.UI.TabShowHide3.setState= function (input, target) {
					if($j(input).hasClass("Active")) {
						
					} 
					else {
						$j(input).parent().parent().parent().parent().find("a.Active").removeClass("Active");
						$j(input).addClass("Active");
						 if ( $j(".ColumAlt02").length > 0 ) {
							$j(".ColumAlt02").removeClass("Active");
						 }
						$j(target).addClass("Active");
					}
				}
			/* End. methods */
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide4= {};
		
			/* methods */
				F6.UI.TabShowHide4.setState= function (input) {
					if($j(input).hasClass("Active")) {
					} 
					else {
						$j(input).parent().parent().find(".Active").removeClass("Active");
						$j(input).addClass("Active");
						$j(".GroupDetailList").find(".Active").removeClass("Active").hide();
						$j($j(input).attr("rel")).addClass("Active").show();
						
					}
					return false;
				}		
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide5= {};
		
			/* methods */
				F6.UI.TabShowHide5.setState= function (input) {
					if($j(input).hasClass("Active")) {
					} 
					else {
						$j(input).parent().parent().find(".Active").removeClass("Active");
						$j(input).addClass("Active");
						$j(".GroupDetailList02").find(".Active").removeClass("Active").hide();
						$j($j(input).attr("rel")).addClass("Active").show();
						
					}
					return false;
				}	
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.TabShowHide6= {};
		
			/* methods */
				F6.UI.TabShowHide6.setState= function (input, target) {
					if($j(input).hasClass("Active")) {
					} 
					else {
						$j(input).parent().parent().find(".Active").removeClass("Active");
						$j(input).addClass("Active");
						$j(target).find(".Active").removeClass("Active").hide();
						$j($j(input).attr("rel")).addClass("Active").show();
					}
					return false;
				}							
	/* F6.UI.PopupStateControl class
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.Zoom= {};
		
			/* methods */
				F6.UI.Zoom.zoomIn= function (input, target) {
					if ($j("#fancybox-inner > img").length == 0) {
						var index = $j(input).parent().parent().find("li").length - $j(input).parent().nextAll().length-1;
						var activeObj = $j(target).find("li").eq(index);
						activeObj.css("display","none");
						activeObj.css("left","50%");
						activeObj.fadeIn(1000);
					}
				}
			/* End. methods */
		/* F6.UI.PopupStateControl class
		
		
	 * Use in maCase1, maCase2, maCase3 page to implement the state when hover on it
	 * in order to use it, let's define F6.UI.PopupStateControl.setState(input, event) function in onmouseover event of PopupContent01 & PopupContent02
	 */
		F6.UI.Inscription= {};
		
			/* methods */
				F6.UI.Inscription.enable = function (target) {
					if ($j(target).hasClass("Disable")) {
						$j(target).removeClass("Disable");
						$j(target).find(".Overlay").css("opacity","0").css("z-index","-1");
						$j(target).find("input:disabled").removeAttr("disabled");
						$j(target).find("select:disabled").removeAttr("disabled");
						$j(target).find("textarea:disabled").removeAttr("disabled");
					}
					return false;
				}
				F6.UI.Inscription.ConditionEnable = function (source, target) {
					if ($j(target).hasClass("Disable")) {
						if ($j(source).parent().parent().find(".OptionExtraActive").length > 0) {
							$j(source).parent().parent().find(".error").hide();
							F6.UI.Inscription.enable(target);
						}
						else {
							$j(source).parent().parent().find(".error").show();
						}
					}
					return false;
				}
				F6.UI.Inscription.ConditionEnable02 = function (source, target) {
					if ($j(target).hasClass("Disable")) {
						if ($j(source).parent().parent().find("input[type=checkbox]").attr("checked") == true) {
							$j(source).parent().parent().find(".error").hide();
							F6.UI.Inscription.enable(target);
						}
						else {
							$j(source).parent().parent().find(".error").show();
						}
					}
					return false;
				}
				F6.UI.Inscription.ConditionEnable03 = function (source, target) {
					if ($j(source).val()=="Célibataire") {
						$j(target).addClass("Disable");
						$j(target).find("input").attr("disabled","disabled");
					}
					else {
						$j(target).find("input").removeAttr("disabled");
						$j(target).removeClass("Disable");
					}
					return false;
				}
			/* End. methods */
	F6.UI.Basket= {};
		
		F6.UI.Basket.removeItem02 = function(input) {
			if ($j(input).parent().hasClass("First")) {
				$j(input).parent().next().addClass("First");
			}
			$j(input).parent().remove();
			
			var totalCourseArt = 0;
			var totalCourse = 0;
			var totalModeArt = 0;
			var totalMode = 0;
			
			$j("#courseBlock").find(".tuProducts").find("li").find(".priceBox").each(function() {
				var quantity = $j(this).parent().parent().parent().find(".Quantity").val();
				totalCourse += parseFloat($j(this).html().replace(",",".").replace("€",""))*quantity;
				totalCourseArt += parseInt(quantity);
			});
			$j("#modeBlock").find(".tuProducts").find("li").find(".priceBox").each(function() {
				var quantity = $j(this).parent().parent().parent().find(".Quantity").val();
				totalMode += parseFloat($j(this).html().replace(",",".").replace("€",""))*quantity;
				totalModeArt += parseInt(quantity);
			});
			total = totalCourse + totalMode;
			$j("#cartSum").find(".TotalCourse > .Item > strong > span").html(totalCourseArt);
			$j("#cartSum").find(".TotalCourse > .Price > strong > span").html(totalCourse.toFixed(2).replace(".",","));
			$j("#cartSum").find(".TotalMode > .Item > strong > span").html(totalModeArt);
			$j("#cartSum").find(".TotalMode > .Price > strong > span").html(totalMode.toFixed(2).replace(".",","));
			$j("#total03").html(total.toFixed(2).replace(".",","));
			
			if (jQuery.cookie("lot2Sum")!=null) {
				var split = jQuery.cookie("lot2Sum").split('?');
				jQuery.cookie("lot2Sum", totalCourseArt+"?"+totalCourse.toFixed(2).replace(".",",")+"?"+totalModeArt+"?"+totalMode.toFixed(2).replace(".",",")+"?"+total.toFixed(2).replace(".",",")+"?"+ split[5]);
			}
			
			if (totalCourseArt == 0 || totalCourseArt == 1) {
				$j("#cartSum").find(".TotalCourse > .Item > strong ").html($j("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("articles","article"));
			}
			else {
				$j("#cartSum").find(".TotalCourse > .Item > strong ").html($j("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("articles","article"));
				$j("#cartSum").find(".TotalCourse > .Item > strong ").html($j("#cartSum").find(".TotalCourse > .Item > strong ").html().replace("article","articles"));
			}
			if (totalModeArt == 0 || totalModeArt == 1) {
				$j("#cartSum").find(".TotalMode > .Item > strong ").html($j("#cartSum").find(".TotalMode > .Item > strong ").html().replace("articles","article"));
			}
			else {
				$j("#cartSum").find(".TotalMode > .Item > strong ").html($j("#cartSum").find(".TotalMode > .Item > strong ").html().replace("articles","article"));
				$j("#cartSum").find(".TotalMode > .Item > strong ").html($j("#cartSum").find(".TotalMode > .Item > strong ").html().replace("article","articles"));
			}
		}
		
		F6.UI.Basket.removeItem = function(input,target) {
			
			var itemParent = $j(input).parent().parent();
			var price = parseFloat(itemParent.find(".Price").html().replace(",",".").replace("€",""));
			var quantity = parseInt(itemParent.find(".Quantity").val());
			
			var quantityNum = itemParent.find(".Quantity").attr("id").replace("quantity","");
			
			var prevTotal = parseFloat($j(target).find(".SousTotal").eq(0).find("span").html().replace(",",".").replace("€",""));
			var currentTotal = prevTotal - parseFloat(price.toFixed(2))*quantity;
					
			$j(target).find(".SousTotal").eq(0).find("span").html(parseFloat(currentTotal).toFixed(2));
			var total = parseFloat(parseFloat($j("#total01 > span").html().replace(",",".")).toFixed(2)) + parseFloat(parseFloat($j("#total02 > span").html().replace(",",".")).toFixed(2));
			$j("#total03 > span").html(parseFloat(total).toFixed(2));
			

			$j(target).find("span.ModuleLink01 > span").html(parseInt($j(target).find("span.ModuleLink01 > span").html())- quantity);
			$j("#totalArt03 > span").html(parseInt($j("#totalArt03 > span").html())- quantity);
			itemParent.remove();
			
			var trueHeight = $j(target).find(".MyBasketList").eq(0).children().outerHeight(true)*$j(target).find(".MyBasketList").eq(0).children().length;
			
			if ( trueHeight < 190) {
				$j(target).find(".MyBasketList").eq(0).css("height",trueHeight+"px");
			}
			else if ( trueHeight == 190) {
				$j(target).find(".MyBasketList").eq(0).css("height",trueHeight+"px");
				var basketList = $j(target).find(".MyBasketList").eq(0);
				$j(target).find(".UpdateData").eq(0).append(basketList);
				basketList.css("position","relative");
				basketList.css("width","100%");
				basketList.css("padding","0");
				basketList.css("top","0");
				$j(target).find(".jScrollPaneContainer").eq(0).remove();
			}
			else {
				$j(target).find(".MyBasketList").eq(0).jScrollPane({
					scrollbarWidth: 9,
					scrollbarMargin: 5
				});
			}
			
			jQuery.cookie(quantityNum, null);
			
			jQuery.cookie("total",parseFloat($j("#total01 > span").html().replace(",",".")).toFixed(2)+"?"+$j("#total02 > span").html()+"?"+$j("#total03 > span").html());
			jQuery.cookie("totalArt",$j("#totalArt01 > span").html()+"?"+$j("#totalArt02 > span").html()+"?"+$j("#totalArt03 > span").html());
			
			if ($j("#totalArt03 > span").html() == 0) {
				$j("#linktoMonpanier").hide();
				$j("#totalArt03").wrap("<span id=\"totalArt04\" class=\"ModuleLink01\"></span>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
			}
			else if ($j("#totalArt03 > span").html() == 1) {
				$j("#linktoMonpanier").css("display","block");
				$j("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
			}
			else {
				$j("#linktoMonpanier").css("display","block");
				$j("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
				$j("#totalArt03").html($j("#totalArt03").html().replace("article","articles"));
			}
			if ($j("#totalArt01 > span").html() == 0) {
				$j("#module02").hide();
				$j("#module02").removeClass("DynamicCart");
			}
			else if ($j("#totalArt01 > span").html() == 1) {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
			}
			else {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
				$j("#totalArt01").html($j("#totalArt01").html().replace("article","articles"));
			}
			if ($j("#totalArt02 > span").html() == 0) {
				$j("#module03").hide();
				$j("#module03").removeClass("DynamicCart");
			}
			else if ($j("#totalArt02 > span").html() == 1) {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
			}
			else {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
				$j("#totalArt02").html($j("#totalArt02").html().replace("article","articles"));
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}
			
		}
		F6.UI.Basket.add = function (target, price, productName, quantity) {
			$j(target).show();
			if (target == "#module02") {
				$j(target).parent().show();
			}
			
			var prevNumber = parseInt($j(target).find(".TotalDetail").eq(0).find(".ModuleLink01 > span").html().replace(",",".").replace("€",""));
			var currentArtTotal = prevNumber + quantity;
			var prevTotal = parseFloat($j(target).find(".SousTotal").eq(0).find("span").html().replace(",",".").replace("€",""));
			var currentTotal = parseFloat(prevTotal.toFixed(2)) + parseFloat(price.toFixed(2))*quantity;			
			currentTotal = currentTotal.toFixed(2);
			currentTotal=currentTotal.replace(".",",");
			$j(target).find(".SousTotal").eq(0).find("span").html(currentTotal);
			
			var index = 0;

			if (target == "#module02") {
				index = 92000;
			}
			else if (target == "#module03") {
				index = 93000;
			}
			else {
				index = 1000;
			}
			var maxindex = 0;
			var cookies = get_cookies_array();
			if (/920/.test(index)) {
				maxindex = 92000;
				for(var name in cookies) {
					if (/920/.test(name)) {
						if (parseInt(name)>maxindex) {
							maxindex = parseInt(name);
						}
					}
				}
			}
			else if (/930/.test(index)) {
				maxindex = 93000;
				for(var name in cookies) {
					if (/930/.test(name)) {
						if (parseInt(name)>maxindex) {
							maxindex = parseInt(name);
						}
					}
				}
			}
			maxindex++;
			var eq = -1;
			$j(target).find(".MyBasketList > li").each(function(id) {
				if ($j(this).find(".ProductName").html() == productName) {
					eq = id;	
				}
			});
			if (eq == -1) {
				index = maxindex;
				if ($j(target).find(".MyBasketList").eq(0).children().html()!=null) {
					$j(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.toFixed(2)+" &euro;</p><div></li>");
				}
				else {
					$j(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.toFixed(2)+" &euro;</p><div></li>");
				}
				$j(target).find(".TotalDetail").eq(0).find(".ModuleLink01 > span").html(currentArtTotal);
				var trueHeight = $j(target).find(".MyBasketList").eq(0).children().outerHeight(true)*$j(target).find(".MyBasketList").eq(0).children().length;
				//alert(trueHeight);
				if ( trueHeight <= 190) {
					$j(target).find(".MyBasketList").eq(0).css("height",trueHeight+"px");
				}
				else {
					$j(target).find(".MyBasketList").eq(0).jScrollPane({
						scrollbarWidth: 9,
						scrollbarMargin: 5
					});
				}
				jQuery.cookie(index, productName+"?"+quantity+"?"+price);
			}
			else {
				$j(target).find(".TotalDetail").eq(0).find(".ModuleLink01 > span").html(currentArtTotal);
				var val = parseInt($j(target).find(".MyBasketList > li").eq(eq).find("input").attr("value"));
				val += quantity;
				$j(target).find(".MyBasketList > li").eq(eq).find("input").attr("value",val);
				
				var updateindex = $j(target).find(".MyBasketList > li").eq(eq).find("input").attr("id").replace("quantity","");

				if (jQuery.cookie(updateindex)!=null) {
					var split = jQuery.cookie(updateindex).split('?');
					jQuery.cookie(updateindex, split[0]+"?"+val+"?"+split[2]);
				}
			}
			
			var total = parseFloat(parseFloat($j("#total01 > span").html().replace(",",".")).toFixed(2)) + parseFloat(parseFloat($j("#total02 > span").html().replace(",",".")).toFixed(2));
			$j("#total03 > span").html(parseFloat(total).toFixed(2));
			var totalArt = parseInt($j("#totalArt01 > span").html()) + parseInt($j("#totalArt02 > span").html());
			$j("#totalArt03 > span").html(totalArt);
			
			jQuery.cookie("total",parseFloat($j("#total01 > span").html().replace(",",".")).toFixed(2)+"?"+$j("#total02 > span").html()+"?"+$j("#total03 > span").html());
			jQuery.cookie("totalArt",$j("#totalArt01 > span").html()+"?"+$j("#totalArt02 > span").html()+"?"+$j("#totalArt03 > span").html());
		
			if (parseInt($j("#totalArt01 > span").html())==1) {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
			}
			else {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
				$j("#totalArt01").html($j("#totalArt01").html().replace("article","articles"));
			}
			if (parseInt($j("#totalArt02 > span").html())==1) {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
			}
			else {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
				$j("#totalArt02").html($j("#totalArt02").html().replace("article","articles"));
			}
			if (totalArt == 0) {
				$j("#linktoMonpanier").hide();
				$j("#totalArt03").wrap("<span id=\"totalArt04\" class=\"ModuleLink01\"></span>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
			}
			else if (totalArt == 1) {
				$j("#linktoMonpanier").css("display","block");
				$j("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
			}
			else {
				$j("#linktoMonpanier").css("display","block");
				$j("#totalArt03").wrap("<a href=\"#\" id=\"totalArt04\" class=\"ModuleLink01\"></a>");
				$j("#totalArt04").html($j("#totalArt03").html());
				$j("#totalArt04").attr("id","totalArt03");
				$j("#totalArt03").html($j("#totalArt03").html().replace("articles","article"));
				$j("#totalArt03").html($j("#totalArt03").html().replace("article","articles"));
			}
			if ($j("#totalArt01 > span").html() == 0 || $j("#totalArt01 > span").html() == 1) {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
			}
			else {
				$j("#totalArt01").html($j("#totalArt01").html().replace("articles","article"));
				$j("#totalArt01").html($j("#totalArt01").html().replace("article","articles"));
			}
			if ($j("#totalArt02 > span").html() == 0 || $j("#totalArt02 > span").html() == 1) {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
			}
			else {
				$j("#totalArt02").html($j("#totalArt02").html().replace("articles","article"));
				$j("#totalArt02").html($j("#totalArt02").html().replace("article","articles"));
			}

			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			}

		}
	/* methods */
		F6.UI.Basket.addItem = function (input, target) {
			
			var price = parseFloat($j(input).parent().parent().find(".Price").html().replace(",",".").replace("€",""));
			var productName = $j(input).parent().parent().find(".ProductName").eq(0).html();
			
			F6.UI.Basket.add(target, price, productName, 1);
			
			
		}
	/* End. methods */	
	
	/* methods */
		F6.UI.Basket.addItem02 = function (input, target) {
			
			var price = parseFloat($j(input).parent().parent().parent().find(".priceBox").html().replace(",",".").replace("€",""));
			var quantity = parseInt($j(input).parent().parent().find(".Quantity").val());
			var productName = $j(input).parent().parent().parent().find(".ProductName").eq(0).html();
			
			F6.UI.Basket.add(target, price, productName, quantity);
			if (target=="#module03" || target=="#module02")
			{
				$j(target).addClass("ActiveMC");
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}

		}
	/* End. methods */	
	
	/* methods */
		F6.UI.Basket.addItem03 = function (input, target) {
			var price;
			$j(input).parent().parent().find(".ListPrice > li").each(function() {
																						 
				if ($j(this).css("display") != "none") {
					price = parseFloat(parseFloat($j(this).find("p").html().replace(",",".").replace("€","")).toFixed(2));
				}
			});
			var quantity = parseInt($j(input).parent().parent().find(".Quantity").val());
			var productName = $j(".ProductWrapper .ProductName").html();
			F6.UI.Basket.add(target, price, productName, quantity);
			if (target=="#module03" || target=="#module02")
			{
				$j(target).addClass("ActiveMC");
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}
		}
	/* End. methods */	
	/* methods */
		F6.UI.Basket.addItem04 = function (target, price) {
			if ($j("#offerCode").val() == "FACEBOOK") {
				$j("#noteMsg").show();
				if ($j(target).css("display")=="none") {
					$j(target).show();
					//cookie
					$j(target).find(".Price > span").html(price);
					jQuery.cookie("offerValue",price);
					
					var currentTotal = parseFloat($j("#total03").html().replace(",","."));
					var newTotal = currentTotal - parseFloat(jQuery.cookie("offerValue").replace(",","."));
					$j("#total03").html(newTotal.toFixed(2).replace(".",","));
				}
			}
		}
	/* End. methods */	
	/* methods */
		F6.UI.Basket.addItem05 = function (input, target, price) {
			if ($j(input).attr("checked")==true) {
				$j(target).show();
				//cookie
				$j(target).find(".Price > span").html(price);
				jQuery.cookie("bonValue",price);
				
				var currentTotal = parseFloat($j("#total03").html().replace(",","."));
				var newTotal = currentTotal - parseFloat(jQuery.cookie("bonValue").replace(",","."));
				$j("#total03").html(newTotal.toFixed(2).replace(".",","));
			}
			else {
				$j(target).hide();
				//cookie
				var currentTotal = parseFloat($j("#total03").html().replace(",","."));
				var newTotal = currentTotal + parseFloat(jQuery.cookie("bonValue").replace(",","."));
				$j("#total03").html(newTotal.toFixed(2).replace(".",","));
				
				jQuery.cookie("bonValue",null);
				
			}
			
		}
	/* End. methods */	
	/* methods */
		F6.UI.Basket.addItem06 = function (input, target) {
			
			var price = parseFloat($j(input).parent().parent().parent().find(".priceBox").html().replace(",",".").replace("€",""));
			var quantity = parseInt($j(input).parent().parent().find(".Quantity").val());
			var productName = $j(input).parent().parent().parent().parent().parent().parent().parent().find(".ProductName").eq(0).text();
			
			F6.UI.Basket.add(target, price, productName, quantity);

			if (target=="#module03" || target=="#module02")
			{
				$j(target).addClass("ActiveMC");
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}
		}
	/* End. methods */

	/* methods */
		F6.UI.Basket.addItem07 = function (input, target) {
			
			var price = parseFloat($j(input).parent().parent().parent().find(".priceBox").html().replace(",",".").replace("€",""));
			var quantity = parseInt($j(input).parent().parent().find(".Quantity").val());
			var productName = $j(".ProductWrapper .ProductName").eq(0).html();
			
			F6.UI.Basket.add(target, price, productName, quantity);
			if (target=="#module03" || target=="#module02")
			{
				$j(target).addClass("ActiveMC");
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}

		}

  /* End. methods */

	/* methods */
		F6.UI.Basket.addItem08 = function (input, target) {
			var price;
			$j(input).parent().parent().find(".ListPrice > li").each(function() {
																						 
				if ($j(this).css("display") != "none") {
					price = parseFloat(parseFloat($j(this).find("p").html().replace(",",".").replace("€","")).toFixed(2));
				}
			});
			var quantity = parseInt($j(input).parent().parent().find(".Quantity").val());
			var productName = $j(".BrandInfo .BrandName").html();
			F6.UI.Basket.add(target, price, productName, quantity);
			if (target=="#module03" || target=="#module02")
			{
				$j(target).addClass("ActiveMC");
			}

			if ($j("#module03 .MyBasketList > li").length > 0 ) {
				$j("#module03").addClass("DynamicCart");
			}
			if ($j("#module02 .MyBasketList > li").length > 0 ) {
				$j("#module02").addClass("DynamicCart");
			}	
			if ($j(".DynamicCart").length < 2 ) {
				$j(".SousTotal").hide();
			} else {
				$j(".SousTotal").show();
			}
		}
	/* End. methods */	
/* End. F6.UI */

/* show box */
		F6.UI.addSubAlt = function (item) {
			if(item=="infoSubAlt"){
				$j("#infoSubAlt").show()};		
}

F6.UI.showHideTable= function(mainID,subID) {
	if($j("#"+subID).css("display")=="block"){
		$j("#"+subID).hide();
		$j("#"+mainID).className= "";
		$j("#"+mainID).children().eq(0).removeClass("StyleShowHide");
	}
	else{
		$j("#"+subID).show();
		$j("#"+mainID).children().eq(0).addClass("StyleShowHide");
	}
}



