if( typeof( gestionFilleuls ) != 'undefined' ){
	var extended = gestionFilleuls;
}else if( typeof( modifTailles ) != 'undefined' ){
	var extended = modifTailles;
}else if( typeof( gestionCoupons ) != 'undefined' ){
	var extended = gestionCoupons;
}else if( typeof( _LooksController ) != 'undefined' ){
	var extended = _LooksController;
}else if( typeof( gestionTailles ) != 'undefined' ){
	var extended = gestionTailles;
}else if( typeof( _DetailController ) != 'undefined' )
	var extended = _DetailController;
else
	var extended = _AjaxElements;

var launcher = Class.create( extended , {

	initialize:function($super){
		this.shopid = null;
		this.shopcode = null;
		this.shoptype = null;
		this.clientid = null;
		this.urlimg = null;
		this.universe = null;
		this.params = typeof params != 'undefined' ? params : [];
		this.param = {};

		this.onTheLoad();
		$super();
		var regHref = new RegExp( '(\/[a-z-]+\/)' , 'i' );
		if( regHref.test( document.location.pathname ) )
			this.universe = regHref.exec( document.location.pathname )[0].trim('/');

		var quinze = (15 * 24 * 60 * 60 * 1000);
		Event.observe( window, "beforeunload", this.writeCookie.bind( this , this.universe , quinze ) );
		Event.observe( window, "load", this.writeCookie.bind( this , this.universe , -1 ) );

	},

	setParams:function( tabParam ){
		 var x = tabParam.toString();
	     var mesParam = x.split(";");
	     for( var i = 0 ; i < mesParam.length ; i++ ){
			var x = mesParam[i].toString();
			var monParam = x.split(":");
			this.param[monParam[0]] = monParam[1];
		}
	},

	_ajaxRedirect:function(){
		if( this.json.comeAgainLater == 'false'){
			this.neededForCommonInformations();
		}else
			location.replace('/maintenance.php');
	},

	onTheLoad:function(){

		var expression = /(v4|v3|localhost|dev|preprod|newhome|.+-Rayon|FSRayon)/;

		if(expression.test( window.location ) ){
			this.neededForCommonInformations();
		}else{
			var jsonElements = {
		 			'url':'/ajaxRedirectFile.php',
		 			'myClass' : this,
		 			'myMethod':'_ajaxRedirect()'
		 		};

				ajaxReq = new _AjaxElements( jsonElements );
				ajaxReq.getAjaxInformations();
		}


		if( isSet( $('partners') ) ){
			var cookie = getCookie( 'Origine' );
			if( cookie == 47 || cookie == 81 )
				$('partners').style.display = 'block';
		}

		if ( $('submit2') ) {
			$('submit2').focus();
		}
		/*
	    if ( $('submit_ogone2') != null ) {
			$('submit_ogone2').focus();
	    }
	    if ( $('submit_ogone3') != null ) {
	        $('submit_ogone3').focus();
	    }*/

	    if (window.ActiveXObject) {
	        sfHover();
	        sfHover2();
	    }

	    var int = /(Origine)(\.|=)(\d+|\w+)/;
		var url = int.exec( document.location.pathname );

		if ( RegExp.$1 == 'Origine') {
			var expires = new Date();
			var oneMonth = expires.getTime() + (31 * 24 * 60 * 60 * 1000);
			expires.setTime( oneMonth );
			document.cookie = "Origine="+RegExp.$3+";path=/;expires=" + expires.toGMTString();
		}

	    var site = /(v3|v4|brandalley.fr)/;
		if ( site.test( window.location ) ) {
			var exctest = /(test.brandalley.fr)/;
			if( !exctest.test( window.location ) ) {
				var exc = /(Id.954|Id-954|Id.875|Id-875)/;
				if( !exc.test( window.location.pathname ) ) {
					var vp = /(FSIndex|FSMarque|FSRayon)/;
					if( vp.test( window.location.pathname ) ) {
						if ( !getCookie( 'AccessPrivateSale' ) ) {
                            site = /(v4|new.brandalley.fr)/;
                            if ( site.test( window.location ) )
                                firstVP_V4( null );
                            else
                                firstVP( null );
                        }
                    }
				}
				if( document.location.pathname == '/ventes-privees/' ){
					if ( !getCookie( 'AccessPrivateSale' ) && isSet( $('newsletter') ) ){
						$('newsletter').style.display = 'block';
					}
				}
			}
		}

		return true;
	},

	onTheGoFunctions:function(){

		if( typeof( idRayonPourFiche ) != 'undefined' ){
			this.neededForGetTaillesFiche( idRayonPourFiche , Pt );
		}

		if( typeof( tableauId ) != 'undefined' ){
			this.neededForGetTailles( tableauId , productTypeForAjax );
		}

		if ( isSet( $('allVF') ) ){
			var allVF = new forVF();
			allVF.neeededForAllVF( '/AffichageAjax=getAllVF' , 'getAllVF()' , 'allVF' , this.shopcode );
		}

		if ( isSet( $('shape') ) ){
			var allVF = new forVF();
			allVF.neeededForAllVF( '/AffichageAjax=getAllVF' , 'getAllVF()' , 'shape' , this.shopcode , this.param);
		}

		if( this.shopid == 43 && isSet( $('jumpToAnotherSale') ) ){
			var allVF = new forVF();
			allVF.neeededForAllVF( '/AffichageAjax=currentFlashSales' , 'getCurrentFlashSales()' , null );
		}

		if( typeof(listLooks) != 'undefined' ){
			this.neededForLooks();
		}

		if( isSet( $('ongletMarques') ) ){

			var preferedMarques = document.getElementsByClassName('preferedMarques');
			var regid = new RegExp( '(prefered)(\\d+)' );
			var idBrand = null;

			for( var i = 0 ; i < preferedMarques.length ; i++ ){
				idBrand = regid.exec( preferedMarques[i].id );
				preferedMarques[i].observe( 'mouseover' , function(){ this.style.background = '#e4cdb9'; } );
				preferedMarques[i].observe( 'mouseout' , function(){ this.style.background = 'none'; } );
				preferedMarques[i].observe( 'click' , this.addToPreferedMarques.bindAsEventListener( this ) );
			}

			if( this.clientid != null ){
				var jsonElements = {
			 			'url':'/Ajax~getBrandAimees',
			 			'myClass':this,
			 			'myMethod':'popupMarquesPref()',
			 			'parametres' : 'clientid='+this.clientid
			 		};

				ajaxReq = new _AjaxElements( jsonElements );
				ajaxReq.getAjaxInformations();
			}
		}
		/*if( isSet( $('couponpopup') ) ){
			this.getTab();
		}*/
	},

	popupMarquesPref:function(){

		this.nbrPreferedBrands = ( !isSet( this.json.nbrBrand ) || this.json.nbrBrand == 0 ) ? 0 : this.json.nbrBrand;

		if( this.nbrPreferedBrands > 0 ){
			var mainCadre = this.checkForMainCadre();
			for( var a = 0 ; a < this.json.idBrand.length ; a++ ){
				mainCadre.insert( this.json.labelBrand[a] );
				$('prefered'+this.json.idBrand[a]).hide();
			}


		}
	},

	checkForMainCadre:function(){
		if( isSet( $('mesMarquesPreferees') ) )
			return $('mesMarquesPreferees');
		else{
			var elemntsFrame = {
					'htmlelmt' : 'div',
					'txtContent' : '<h1>Mes marques pr&eacute;f&eacute;r&eacute;es</h1>',
					'attributes' : { 'id' : 'mesMarquesPreferees' }
			   	};
			return $('page_container').createFrame( elemntsFrame, 'before' );
		}
	},

	addToPreferedMarques:function( e ){
		var elmt = e.element();
		var regId = new RegExp( '(\\d+)' , 'i' );
		var idM = regId.exec( elmt.id )[0];
		var mainCadre = this.checkForMainCadre();

		if( isNull( this.clientid ) ){
			document.location = '/MonCompte/idBrandPref-'+idM;
		}else{
			var nomMarque = $('span'+elmt.parentNode.parentNode.id).getElementsByTagName('a')[0].firstChild.data;
			var url = '/Ajax~JaimeBrand/';
	        var pars = 'idBrand='+idM+'&clientId='+this.clientid;
	        var myAjax = new Ajax.Request(
	        url,
	    		{
	    			method: 'post',
	    			parameters: pars,
	    			onComplete: function(transport){
	        			elmt.update( 'J&acute;aime cette marque' );
	        			elmt.stopObserving();
	        			mainCadre.insert( nomMarque );
	        		}
	    		});
		}
	},

	neededForCommonInformations:function(){

		var send = {};
		if( typeof( checkIfConnectedId ) != 'undefined' && checkIfConnectedId != 'check' ){
			send.id = checkIfConnectedId;
			//var send = 'id='+checkIfConnectedId;
		}else if( typeof( checkIfConnected2Id ) != 'undefined'  ){
			send.pageId = 1;
			//var send = 'pageId=1';
		}

	    if( typeof( zeFsId ) != 'undefined' && zeFsId != '' ){
	    	send.fsid = zeFsId;
	    }

        if( typeof( tracking_brand_id ) != 'undefined' && tracking_brand_id != '' ){
            send.tracking_brand_id = tracking_brand_id;
        }

        if( typeof( tracking_page_type ) != 'undefined' && tracking_page_type != '' ){
            send.tracking_page_type = tracking_page_type;
        }

		var jsonElements = {
 			'url':'/Ajax=_getClientStatusConnexion/',
 			'myClass' : this,
 			'myMethod':'commonInformations()',
 			'parametres' : send
 		};

		ajaxReq = new _AjaxElements( jsonElements );
		ajaxReq.getAjaxInformations();

	},

	writeCookie:function( universe , delay ){
		var expires = new Date();
		var quinze = expires.getTime() + delay;
		expires.setTime(quinze);
		//alert( expires.toGMTString() );
		document.cookie = "universe="+universe+";path=/;expires=" + expires.toGMTString();
	},

	commonInformations:function(){
		var pere = this.json;
		var deconnexion = $('deconnexion');
		var deconnexionParigo = $('deconnexionParigo');
		this.shopid = pere.shopid;
		this.shoptype = pere.shoptype;
		this.shopcode = pere.shopcode;
		this.setParams( this.params );
		this.urlimg = pere.urlimg;
		this.clientid = isSet( pere.clientid ) ? pere.clientid : null;
		this.encartHeader = pere.encartHeader;
		this.encartPopup = pere.encartPopup;
		this.encartListing = pere.encartListing;
		this.onTheGoFunctions();

		if( this.shopcode == 'v4' && isSet( pere.redirectUniverse ) ){
			document.location = '/'+pere.redirectUniverse;
		}

		if ( this.shopid == 42 && isSet( $('logononvip') ) ){
			if( $('logononvip').src != this.urlimg+'annasandvip_logo.gif'){
				var origine = getCookie('Origine');
		        var x = pere.mesorignesVIP.toString();
		        var mesoriginesvip = x.split(";");
		        var ok = 0;

		        if( pere.vip == 1 ){
		            $('logononvip').src = this.urlimg+'annasandvip_logo.gif';
		        }else if( pere.vip == 0 && !origine){
		             $('logononvip').src = this.urlimg+'annasand_logo2.gif';
		             if( isSet( $('carteVip') ) )
		            	 $('carteVip').style.visibility = 'visible';
		        }else {
		            for (var i=0; i < mesoriginesvip.length ; i++){
		            	if( mesoriginesvip[i] == origine ){
		            		$('logononvip').src = this.urlimg+'annasandvip_logo.gif';
		            		ok = 1;
		            		break;
		            	}
		            }
		            if( ok == 0 ){
		            	$('logononvip').src = this.urlimg+'annasand_logo2.gif';
		            	if( isSet( $('carteVip') ) )
		            		$('carteVip').style.visibility = 'visible';
		            }
		        }
			}
		}

		if( this.shopid == 43 && isSet( $('customer_first_name') ) ){
			fname = pere.fname;
			$('customer_first_name').update( fname );
		}

		if( this.shopid == 43 && isSet( $('customHeader') ) && this.encartHeader != '' ){
			$('customHeader').update(this.encartHeader );
		}

        if( this.shopid == 3 && isSet( $('leblog') ) && this.encartListing != '' ){
            if($('leblog').parentNode.parentNode.className == "shop") {
                $('leblog').parentNode.replace(this.encartListing);
            } else if($('leblog').parentNode.parentNode.parentNode.className == "shop") {
                $('leblog').parentNode.parentNode.replace(this.encartListing);
            }
        }
        if( this.shopid == 3 && isSet( $('tetiere') ) && this.encartHeader != '' ){
            $('tetiere').replace(this.encartHeader );
            $('leblog').style.visibility='hidden';
        }

		if( this.shopid == 43 && isSet( $('customHeader2') ) && this.encartHeader != '' ){
			$('customHeader2').update(this.encartHeader );
		}

		if( (this.shopid == 43 || this.shopid == 3) && isSet( $('encartPopup') ) && this.encartPopup != '' ){
			$('encartPopup').update(this.encartPopup );
		}

		if( this.shopid == 43 && isSet( $('encartListing') ) && this.encartListing != '' ){
			$('encartListing').update(this.encartListing);
		}
		if( pere.redirect != 'ok' && ( typeof( checkIfConnectedId ) != 'undefined' || typeof( checkIfConnected2Id ) != 'undefined' ) ){
			$('page-content').style.visibility='hidden';
			location.replace( pere.redirect );
		}else if( pere.lien != 'n' ){
			if (isSet( deconnexion ) ) {
				var elemntsFrame = {
						'htmlelmt' : 'img',
						'attributes' : { 'src' : this.urlimg+pere.imageDeconnect }
					   };
				var imageLien = deconnexion.createFrame( elemntsFrame );
				deconnexion.writeAttribute( { 'href' : pere.lien[0] , 'style' : 'display:inline;' } );

				if( isSet( $('yourIn') ) ){
					$('yourIn').update( pere.fname+' you\'re in!<br /><a class="notYou" href="/MonCompte~Deconnexion">Not you?</a>' );
					$('decon').style.height = '30px';
					imageLien.observe( 'mouseover' , function(){ imageLien.style.top = '-30px'; } );
					imageLien.observe( 'mouseout' , function(){ imageLien.style.top = '0px'; } );
				}

			}else if( isSet( deconnexionParigo ) ) {
				deconnexionParigo.style.visibility='visible';
			}
		}
		if( pere.dateAnnaSand != 'n' ){
			var dateAnnaSand = $('zedates');

			if( isSet( dateAnnaSand ) ){
				if( pere.vip == 1 )
					dateAnnaSand.firstChild.style.display = 'block';
				else {
					dateAnnaSand.removeChild( dateAnnaSand.firstChild );
					dateAnnaSand.firstChild.style.display = 'block';
				}
			}
		}

		if( pere.deleteVF >= 0 ){
			var showimg = $('main'+pere.deleteVF);
			if( isSet( showimg ) ){
				showimg.style.display = 'block';
			}else {
				var parent = $('salesSkin');
				if( isSet( parent ) )
					parent.update( '<img class="later" src="http://media2.brandalley.com/shops/42/encarts/annasand_accueil.gif" />' );
			}
		}

		if( pere.afficheButton != 'ok' ){
			var ids = new Array();
			if( pere.afficheButton != 'n' ){
				ids = pere.afficheButton.toString().split('_');
			}
			var count2 = document.getElementsByClassName('vpGoTo');
			for( var n = 0 ; n < count2.length ; n++ ){
				if( pere.afficheButton == 'n' || ids.indexOf( count2[n].firstChild.id ) >= 0 ){
					count2[n].removeChild( count2[n].firstChild );
				}
			}
			var count1 = document.getElementsByClassName('saleVIP2');

			for ( var i =0 ; i < count1.length ; i++ ) {
				if ( pere.afficheButton == 'n' || ids.indexOf( count1[i].id ) >= 0 ){
					var src = count1[i].getElementsByTagName('img')[0].src;
					var papaNoeud = count1[i].parentNode;
					var elemntsFrame = {
							'htmlelmt' : 'img',
							'attributes' : { 'src' : src }
						   };
					papaNoeud.createFrame( elemntsFrame );
					count1[i].removeChild(count1[i].firstChild);
				}
			}
		}

		if( this.shopid != 43 ){
			if( pere.caddyElements[0].numitemsincaddie > 0 ){
				caddyElements = pere.caddyElements[0];
				var ppProducts = new popupProducts( caddyElements , this.shopid, this.shopcode );
			}else{
				$('item_count').update( '('+pere.caddyElements[0].numitemsincaddie+')' );
				if( this.shopid == 42 ){

					$('boutonPanier').observe( 'mouseover' , function(){
																			//$('boutonPanier').firstChild.style.backgroundPosition = 'top left';
																			$('item_count').style.backgroundColor = 'white';
																			$('item_count').style.color = '#000';
																			$('item_count').style.borderTop = '#000 solid 1px';
																			$('item_count').style.borderRight = '#000 solid 1px';
																		} );
					$('boutonPanier').observe( 'mouseout' , function(){
																		$('item_count').style.backgroundColor = 'transparent';
																		$('item_count').style.color = '#fff';
																		$('item_count').style.border='none';
																	} );

				}
			}
		}else
			$('item_count').update( '('+pere.numitemsincaddie+')' );

		if( this.shopid == 3 && pere.caddyElements[0].numitemsincaddie == 0 )
			this.getOptOut();

		if( isSet( $('takeAndDestroy') ) ){
			cutAndPaste( $('takeAndDestroy') );
		}

		if( this.shopid == 3 && this.shopcode == 'v4' ){
			/*var ppAide = new popupAide();*/

            for( var i = 0; i < pere.LookBooks[0].LookBook.length; i++ ){
                if( isSet( $('slookbook' + pere.LookBooks[0].LookBook[i].Universe ) ) ) {
                    var conseil = parseInt( pere.LookBooks[0].LookBook[i].Conseil );
                    var look = parseInt( pere.LookBooks[0].LookBook[i].Look );
                    var silhouette = parseInt( pere.LookBooks[0].LookBook[i].Silhouette );
                    var total = conseil + look + silhouette;
                    if( total == 1 ){
                    	if (conseil > 0) var href = $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'conseil').href;
                        if (look > 0) var href = $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'look').href;
                        if (silhouette > 0) var href = $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'silhouette').href;
                        $('lookbook').style.cursor = 'pointer';
                        $('lookbook').observe('click' , function(){ document.location = href; } );
                    }else if( total > 0 ){
                        $('slookbook'+pere.LookBooks[0].LookBook[i].Universe).show();
                        if (conseil > 0) $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'conseil').show();
                        if (look > 0) $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'look').show();
                        if (silhouette > 0) $('slookbook' + pere.LookBooks[0].LookBook[i].Universe + 'silhouette').show();
                    }else
                    	$('lookbook').hide();
                    break;
                }
            }
        }

	},

	getOptOut:function(){

		var value;
		if( value = getCookie( 'optNews' ) ){
			var exp = value.split("_");
			if ( exp[0] == 'optout') {
				if( this.json.today >= exp[1] ){

					$('opacDiv').style.display = 'block';
					var expires = new Date();
					var time = expires.getTime() + (100 * 24 * 60 * 60 * 1000);
					expires.setTime( time );

					document.cookie = "optNews=optout_"+this.json.todayQuinze+"_"+exp[2]+";path=/;expires=" + expires.toGMTString();

					var elemntsFrame = {
							'htmlelmt' : 'div',
							'attributes' : { 'id' : 'optout' }
						   };
					var content = $('page-content').createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'div',
							'attributes' : { 'class' : 'leftOp' }
						   };
					content.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'div',
							'attributes' : { 'class' : 'rightOp' }
						   };
					var right = content.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : 'Vos emails sur-mesure... <span class="fermerOpt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fermer&nbsp;<img src="/pix/arrows/sup_article.png"></span>',
							'attributes' : { 'class' : 'titleMes' }
						   };
					var fermer = right.createFrame( elemntsFrame );
					fermer.observe( 'click' , function(){ $('optout').remove();$('opacDiv').hide(); } );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<img src="/pix/fleche.gif"> Recevez les lettres d\'informations, offres et avantages en fonction de vos <b>centres d\'int&eacute;r&ecirc;ts.</b> <span class="cocher"><br>(cocher pour recevoir la newsletter)</span>',
							'attributes' : { 'class' : 'first' }
						   };
					right.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : 'Merci de cocher un ou plusieurs choix pour valider votre selection.',
							'attributes' : { 'id' : 'pError' }
						   };
					right.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'fieldset',
							'attributes' : { 'class' : 'fieldset' }
						   };
					var fields = right.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'div',
							'attributes' : { 'class' : 'choiseOne' }
						   };
					var choiseOne = fields.createFrame( elemntsFrame );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<label>Femme</label><input id="femmeOptin" type="checkBox" name="alerte_1">',
							'attributes' : { 'class' : 'femEnf' }
						   };
					choiseOne.createFrame( elemntsFrame );

					$('femmeOptin').observe( 'click' , this.checkOrNot.bind( this , 0 ) );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<label>Enfant</label><input id="enfantOptin" type="checkBox" name="alerte_3">',
							'attributes' : { 'class' : 'femEnf' }
						   };
					choiseOne.createFrame( elemntsFrame );
					$('enfantOptin').observe( 'click' , this.checkOrNot.bind( this , 0 ) );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<label>Homme</label><input id="hommeOptin" type="checkBox" name="alerte_2">',
							'attributes' : { 'class' : 'femEnf' }
						   };
					choiseOne.createFrame( elemntsFrame );
					$('hommeOptin').observe( 'click' , this.checkOrNot.bind( this , 0 ) );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<label>D&eacute;coration</label><input id="decoOptin" type="checkBox" name="alerte_4">',
							'attributes' : { 'class' : 'femEnf' }
						   };
					choiseOne.createFrame( elemntsFrame );
					$('decoOptin').observe( 'click' , this.checkOrNot.bind( this , 0 ) );

					var txtContent = '<img src="/pix/fleche.gif"> Ou Choisissez votre <b>fr&eacute;quence</b> d&acute;envoi en recevant uniquement la meilleure offre de la semaine.';
					txtContent += '<p class="onlyWeek"><input id="bowOpt" type="checkBox" name="alerte_5"> Oui, je souhaite recevoir uniquement un email par semaine.';
					txtContent += 'Et b&eacute;n&eacute;ficiez des avantages qui vous seront r&eacute;serv&eacute;s personnellement.</p>';

					var elemntsFrame = {
							'htmlelmt' : 'div',
							'txtContent' : txtContent,
							'attributes' : { 'class' : 'second' }
						   };
					right.createFrame( elemntsFrame );

					$('bowOpt').observe( 'click' , this.checkOrNot.bind( this , 1 ) );

					var elemntsFrame = {
							'htmlelmt' : 'p',
							'txtContent' : '<img src="/pix/btValiderOpt.jpg">',
							'attributes' : { 'class' : 'bSubmit' }
						   };
					var bSubmit = right.createFrame( elemntsFrame );
					bSubmit.observe( 'click' , this.checkOpt.bind( this , exp[2] ) );

				}
			}
		}
	},

	checkOrNot:function( which ) {
		if( which == 1 ){
			for( var i = 1 ; i < 5 ; i++ ) {
				alerte = document.getElementsByName('alerte_'+i);
				alerte[0].checked = false;
			}

			$('pError').hide();
		}else if( which == 0 ){
			$('bowOpt').checked = false;
			$('pError').hide();
		}
	},

	checkOpt:function( idClient ) {

		if( !$('femmeOptin').checked && !$('enfantOptin').checked && !$('hommeOptin').checked && !$('decoOptin').checked && !$('bowOpt').checked )
			$('pError').show();
		else{
			if( $('bowOpt').checked ){
				var bow = 'on';
				var f = 'off';
				var e = 'off';
				var h = 'off';
				var d = 'off';
			}else{
				var bow = 'off';
				var f = 'off';
				var e = 'off';
				var h = 'off';
				var d = 'off';

				if( $('femmeOptin').checked )
					f = 'on';
				if ( $('enfantOptin').checked )
					e = 'on';
				if ( $('hommeOptin').checked )
					h = 'on';
				if ( $('decoOptin').checked )
					d = 'on';
			}

			url = '/MonCompte~GetBackDes/';
			pars = 'idClient=' +idClient+ '&femme=' +f+ '&enfant=' +e+ '&homme=' +h+ '&deco=' +d+ '&bow=' +bow+ '&ajaxReq=1';

			var jsonElements = {
		 			'url':url,
		 			'myClass' : this,
		 			'myMethod':'MesgSuccess()',
		 			'parametres' : pars
		 		};

				ajaxReq = new _AjaxElements( jsonElements );
				ajaxReq.getAjaxInformations();
		}
	},

	MesgSuccess:function() {

		var parent = $('optout');

		var elemntsFrame = {
				'htmlelmt' : 'div',
				'txtContent' : '<span class="fermerOptBis">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fermer&nbsp;<img src="/pix/arrows/sup_article.png"></span>',
				'attributes' : { 'class' : 'pSuccess' }
			   };
		var fermer = $('optout').updateFrame( elemntsFrame );
		fermer.observe( 'click' , function(){ $('optout').remove();$('opacDiv').hide(); } );

		$('optout').insert( '<p><img src="/pix/felicitation.jpg"></p>' );

		setTimeout( function(){ $('optout').remove();$('opacDiv').hide(); },'5000');
	}

});
