	$(document).ready(function(){
////////////////NAV001///////////////////	   
		navEvent();





////////////////CSS///////////////////

		$("#actu_jour dt a:first").addClass("bold"); 
		$("#savoir_plus dt a:first").addClass("underline"); 
		$("#produits_complementaires dt a:first").addClass("bold"); 
		
		$("#actu_jour dt#rss a").addClass("bold"); 		
		
			
		$("#actu_jour dt a.alt").click(function () {
		$("#actu_jour dt a.alt:visible").removeClass("bold");
		$(this).addClass("bold");		
		return false;
	});
		$("#savoir_plus dt a.alt").click(function () {
		$("#savoir_plus dt a.alt:visible").removeClass("underline");
		$(this).addClass("underline");		
		return false;
	});
		$("#produits_complementaires dt a.alt").click(function () {
		$("#produits_complementaires dt a.alt:visible").removeClass("bold");
		$(this).addClass("bold");		
		return false;
	});
	
	    $("#actu_jour dd:first").show();
		$("#actu_jour dt a.alt").click( function(){
		$("#actu_jour dd:visible").fadeOut("normal");	
		$(this).parent().next().fadeIn("slow");
		return false;
		});
	    $("#savoir_plus dd:first").show();
		$("#savoir_plus dt a").click( function(){
		$("#savoir_plus dd:visible").fadeOut("normal");	
		$(this).parent().next().fadeIn("slow");
		return false;
		});

		
	    $("#produits_complementaires dd:first").show();
		$("#produits_complementaires dt a").click( function(){
		$("#produits_complementaires dd:visible").fadeOut("normal");	
		$(this).parent().next().fadeIn("slow");
		return false;
		});
		
		/////////////#zoom_sur dl, #news dl///////////////
	$('#zoom_sur, #news').each(function(){
	if ($(this).length != 0) {
	$('> dl > dt' ,this) .not('.illustr').addClass('zoomNewsDt_Height').next().addClass('zoomNewsDd_Height');
	$('.zoomNewsDt_Height')	.vjustify();
	$('.zoomNewsDd_Height')	.vjustify();	
	}
	});

	/////////////ABOONES, CLIENTS ET FAQ///////////////	
	$('#identification.identified').hide();
	
	/**OLD 20091204-1213
	$('#clients') .not('.identified').addClass('min-height2').end()
        .find('p:last', '.identified').hide().end()
        .find('p:last').prepend('<a class="hideBox" style="display:none" href="#"title="Fermer la fenêtre" >Fermer</a>').end()
        .find('a.min-height-b').html('<span class="showBox">En savoir plus</span><span style="display:none">Entrer</span>');
	   **/
    /////////////FAQ UNIQUEMENT///////////////
    /**OLD
    $('#question').not('.identified').addClass('min-height2').end()
    	.find('p:last', '.identified').hide().end()
    	.find('p:last').prepend('<a class="hideBox" style="display:none" href="#"title="Fermer la fenêtre" >Fermer</a>').end()
    	.find('a.min-height-b').html('<span class="showBox">En savoir plus</span><span style="display:none">Entrer</span>');
     */
    
    $.sessionStart();
    	var faqQuestion = $.session("faqQuestion");
    	var abonneQuestion = $.session("abonneQuestion");
    	var clientQuestion = $.session("clientQuestion");
    	//alert("abonneQuestion : " +abonneQuestion);
    $.sessionStop();
    
    //GESTION BLOC ClIENT
    if(clientQuestion == "hide"){
    	hideBox('#clients div p a.hideBox');
    }else{
    	showBox('#clients div a span.showBox');
    }
    $('#hideBoxClient').click( function(){
    	$.sessionStart();
    	$.session("clientQuestion", "hide");
     	$.sessionStop();
 	   	return false;
 	});
    $('#showBoxClient').click( function(){
    	$.sessionStart();
    	$.session("clientQuestion", "show");
     	$.sessionStop();
 	   	return false;
 	});
    
    //GESTION BLOC FAQ
    if(faqQuestion == "hide"){
    	hideBox('#question div p a.hideBox');
    }else{
    	showBox('#question div a span.showBox');	
    }
    $('#hideBoxFaq').click( function(){
    	$.sessionStart();
    	$.session("faqQuestion", "hide");
     	$.sessionStop();
 	   	return false;
 	});
    $('#showBoxFaq').click( function(){
    	$.sessionStart();
    	$.session("faqQuestion", "show");
     	$.sessionStop();
 	   	return false;
 	});
    //GESTION BLOC ABONNE 
    if(abonneQuestion == "hide"){
    	hideBox('#abonnes div p a.hideBox');
    }else{
    	showBox('#abonnes div a span.showBox');
    }
    $('#hideBoxAbonne').click( function(){
    	$.sessionStart();
    	$.session("abonneQuestion", "hide");
     	$.sessionStop();
 	   	return false;
 	});
    $('#showBoxAbonne').click( function(){
    	$.sessionStart();
    	$.session("abonneQuestion", "show");
     	$.sessionStop();
 	   	return false;
 	});
    
    /////////////ABONNES UNIQUEMENT///////////////
  /**
    OLD
    $('#abonnes') .not('.identified').addClass('min-height2').end()
	    .find('p:last', '.identified').hide().end()
	    .find('p:last').prepend('<a class="hideBox" style="display:none" href="#"title="Fermer la fenêtre" >Fermer</a>').end()
	    //.find('a.min-height-b').html('<span class="showBox">En savoir plus</span><span style="display:none">&nbsp;</span>');
   */
	    
   // $('#abonnes').find('p:last').prepend('<a class="hideBox" href="#"title="Fermer la fen�tre" >Fermer</a>').end()
	    
$('span.showBox').click( function(){
	   $(this).parent().siblings('p').slideDown("normal").find('a.hideBox').fadeIn('slow').end()
	   .parents('.min-height2') .removeClass('min-height2').end()
	   .siblings('a.min-height-b').children('.showBox').hide('fast').siblings().fadeIn('slow');
	   	return false;
		});
		     
$('a.hideBox ').click(function(){
        $(this).hide().parents('.min-height').addClass('min-height2').end()
        .parent().slideUp("fast").siblings('.min-height-b')
        .children('span.showBox').fadeIn('fast')
        .siblings('span').fadeOut('fast');
        return false;
		});
		
		
 $('.identified .showBox').hide().siblings().show();
 $('a.min-height-b_identified').click(function(){
		  
		  $(this).parents('.identified').removeClass('identified').end()
		  .fadeOut('normal').siblings('p:first').fadeOut('normal').end()
		  .siblings('a.min-height-b').find('.showBox')
		  .fadeIn('slow')
		  
		  .parents('.min-height').addClass('min-height2').end()
		     $(this).siblings('p:first').css('color','red').remove().end() 

		  });
	 
 //////////////PRINT-DIALOG///////////////
 	$("#print-dialog ul li a").hover(function() {
	   
	$(this).find("span:last").fadeIn("fast");
	}, function() {
	$(this).find("span:last").fadeOut("fast");
	});
////////////////PYJAMA////////////////////
		
		$('div.p:even').addClass('pair');
		$('table#basket_table-001 tbody tr:even').addClass('pair');
		$('#content002 #panier dl:even').addClass('pair');
		
////////////////scroll///////////////////
		$('.back_top').click( function(){
			$('#top').ScrollTo(800)
				return false;
		});
		
/////////////////////ETAPE3//////////////////////


    	$("#facturation_livraison #livraison").each(
	    	function(){
	    		$(this).hide();
	    	
	    	}
	    );
        $('#facturation_livraison input[type="checkbox"]').click(function() {
                var answer = $(this).parent().next();  
                var frangin =  $(this).siblings();   
                  
                  if (answer.is(':visible')) {
	                    answer.slideUp(' fast', function(){ 
	                    	answer.css(' marginBottom', 0);
	                    	//OLDfrangin.html("Si l'adresse de NBO livraison et différente de l'adresse de facturation, décochez cette case…");
	                    	frangin.html("Si l'adresse de livraison est différente de l'adresse de facturation, cochez cette case…");
	                    });  
                    
                   }else{
	                    frangin.fadeIn(' slow', function(){ 
		                    answer.slideDown(' normal', function(){ 
		                    	answer.css({marginBottom :'28px'});
		                    	//OLDfrangin.html("Si l'adresse de NBO livraison est la même que l'adresse de facturation, cochez cette case…");
		                    	frangin.html("Si l'adresse de livraison est la même que l'adresse de facturation, décochez cette case…");;
		                    	frangin.parent().animate({ height:'25px',opacity:1}, 'slow');
		                    });	  
	                    });  
	                   
	                    answer.animate({marginTop:'-28px'}, 'slow');    
	                    frangin.parent().animate({opacity:0, height:0}, 'slow');   
	                    $('#topLiv').ScrollTo(800)    
                   } 
        });
        $('#facturation_livraison input[type="checkbox"][checked]').each(function() {
            var answer = $(this).parent().next();  
            var frangin =  $(this).siblings();   
              
              if (answer.is(':visible')) {
                    answer.slideUp(' fast', function(){ 
                    	answer.css(' marginBottom', 0);
                      	//OLDfrangin.html("Si l'adresse de NBO livraison et différente de l'adresse de facturation, décochez cette case…");
                    	frangin.html("Si l'adresse de livraison est différente de l'adresse de facturation, cochez cette case…");
	              
                    });  
                
               }else{
                    frangin.fadeIn(' slow', function(){ 
	                    answer.slideDown(' normal', function(){ 
	                    	answer.css({marginBottom :'28px'});
	                    	//OLDfrangin.html("Si l'adresse de NBO livraison est la même que l'adresse de facturation, cochez cette case…");
	                    	frangin.html("Si l'adresse de livraison est la même que l'adresse de facturation, décochez cette case…");
	                    	frangin.parent().animate({ height:'25px',opacity:1}, 'slow');
	                    });	  
                    });  
                   
                    answer.animate({marginTop:'-28px'}, 'slow');    
                    frangin.parent().animate({opacity:0, height:0}, 'slow');   
                    $('#topLiv').ScrollTo(800)
               } 
        });
        
    //////////formulaire////////////////
    
    	$(function() {
			var f = ['#facturation', '#livraison'];
			
			$("#echange").click( function() {
				$( f[0] + ' :input' ).each( function() {

					var jArrivee = $(f[1] + ' :input[@name="'+ this.name.replace(/^d_/, 'a_') +'"]' );
					var sArriveeVal= jArrivee.attr( 'value' );
					var sType = this.type, sTagName = this.tagName.toLowerCase();
				
					if( sType == 'text' || sType == 'password' || sTagName == 'textarea' || sTagName == 'select' )
					{
						jArrivee.val( this.value || '' );
					//	this.value = sArriveeVal || '';
					}
				});

			});
		});
    
 
////////RECHERCHE_RÉSULTATS/////////
$('#recherche_content>dl.fiche_produits_recherche:last').css({
    border:'none',
    paddingBottom:0,
    marginBottom:'17px'  
    });
    
     $('#recherche_content002 #fiches_produits_nav li:first').css('background','none'  );
    
        
$('#recherche_bis input#recherche_bis_button , #recherche_result input#recherche_result_button')  .hover(function() {
                $(this).css({backgroundColor:'#637384', backgroundPosition:' left -16px', border: '1px solid #94a6b9' })   ;
        }, function() {
                 $(this).css({backgroundColor:'#94a6b9', backgroundPosition:' left top', border: '1px solid #637384' })   ;

        });


/////////AFFINER_RECHERCHE///////////
$('#affiner_recherche dl ').each(function(){    
    $(this).find('li:last').css('paddingBottom','4px') ;
    });
/////////NAV_RECHERCHE//////////
$("#affiner_recherche dl:first dt").css({background: '#c2d6ea url(../img/recherche/affine_recherche_over.png) no-repeat 169px 6px' 
       });
$("#affiner_recherche dl:not(:first)").find('dd').hide();
		

$("#affiner_recherche dl dt").click( function(){
    var slideDd= $(this).next('dd');
    
        if (slideDd.is(':visible')){
        slideDd.slideUp("normal")
        .siblings('dd').slideUp("normal");
        $(this) .css('background', '#c2d6ea url(../img/recherche/affine_recherche.png) no-repeat 171px 5px' );
        
        return false;
        }else{
        
        $("#affiner_recherche dl dd:visible").slideUp("normal")
        .prev('dt') .css('background', '#c2d6ea url(../img/recherche/affine_recherche.png) no-repeat 171px 5px' );
        $(this).next().slideDown("fast")
        .siblings('dd').slideDown("fast");
        $(this).css({background: '#c2d6ea url(../img/recherche/affine_recherche_over.png) no-repeat 169px 6px' 
       })
        return false;
        }
});
	   $('#recherche_content .fiche_produits_recherche  a, #recherche_content .fiche_produits_recherche li').hover(function(){
	   
	   $(this).parents('dl.fiche_produits_recherche') .addClass('ficheHover')
	   },function(){
	       $(this).parents('dl.fiche_produits_recherche').removeClass('ficheHover')
	       })	       
	$('#recherche_content002 #fiches_produits_nav li ').not(':first').prepend('.');

    ///////////////////FAQ/////////////////


$('#questions_content div:even').addClass('box_faq1').next().addClass('box_faq2').end()
    .wrap('<div class="ligneFaq"></div>')
    .parent().attr('id', function (arr) {
       return "ligne_faq-" + arr;
    })
   .each(function(){
    $(this).append($(this).next());
        })
        .find('div>ul')  .after('<div class="qcPlus1"></div><div class="qcPlus2"></div>').end()
        .parents('#content001c')   .find('.back_top-div') .css('clear','both');

//var ligne_faq = $('#questions_content div[@id*=ligne_faq-]');
var ligne_faq = $("#questions_content div[id*='ligne_faq-']"); 
if (ligne_faq){ 
      ligne_faq.each(function(){   
        $('div[@class*=box_faq]' , this)       .vjustify(); 
        }); 
    };

//////////////PAGE PRODUITS///////////
$('#infos #produit_definition dd.zoom a:first').show();

var zoomSpan= $('#infos #produit_definition dd.zoom a span');
zoomSpan.hide();
  zoomSpan.parent().hover( function () {
        zoomSpan.fadeIn('fast');
        $(this).addClass('zoomHover');
         }, function () {
       zoomSpan.fadeOut('normal');
        $(this).removeClass('zoomHover');
      });
      
      
 $('#tarifs_et_plus #essai_gratuit').append('<div class="tarifs_plus1"></div><div class="tarifs_plus2"></div><div class="tarifs_plus3"></div>');
 
//////////////////////FORMULAIRE DIV///////////////

$('#efl_formulaire_div fieldset.fieldset_type .efl-formulaireDiv-selectsMultiples select').not(':first').css('marginLeft','0')//.css('background','red')


/**
////////////////PLAN DU SITE////////////////
 * 
$('#content000[class="homePage"] #footer')
	.before('<div id="navPlanSite"></div>')
	.parent().find('#navPlanSite')	.load("navPlan001.html #navPlan001 ",   
		 function() {
		   	liNavPlan=$('>ul >li',this);
		   	liNavPlan.vjustify()
		   	$(this).height(liNavPlan.height());
   	   	 }
	)
 */

//////////////////////FIN///////////////
		
	});

function hideBox(element){
	 $(element).hide().parents('.min-height').addClass('min-height2').end()
     .parent().slideUp("fast").siblings('.min-height-b')
     .children('span.showBox').fadeIn('fast')
     .siblings('span').fadeOut('fast');
}
function showBox(element){
	 $(element).parent().siblings('p').slideDown("normal").find('a.hideBox').fadeIn('slow').end()
	   .parents('.min-height2') .removeClass('min-height2').end()
	   .siblings('a.min-height-b').children('.showBox').hide('fast').siblings().fadeIn('slow');
}

function navEvent()
{
	$(".nav li.rub001:has(ul)")
	.hover
	(
		function()
		{
			$(this).attr("id","selectMenu");
	        $(".nav ul:visible").css("display", "none");
			$(this).children("ul:hidden").show();
			
		},
		function()
		{
			$(this).removeAttr("id");
			$(this).oneTime(700,"hide",
				function()
				{
					if($(this).attr("id")!="selectMenu")
					{
						$(this).children("ul:visible").hide();
					}
				}
			)
		}
	);

	$(".nav li li:has(a.rub002)")
	.hover
	(
		function()
		{
			$(this).attr("id","selectSubMenu");
            $(".nav ul ul:visible").css("display", "none");
			$(this).children("ul:hidden").show(1);
		},
		function()
		{
			$(this).removeAttr("id");
			$(this).children("ul").hide();
			//$(".nav ul ul:visible").css("display", "none");
		}
	)
}

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times, belay) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times, belay);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.extend({
	timer: {
		guid: 1,
		global: {},
		regex: /^([0-9]+)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseInt(result[1], 10);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times, belay) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
				return;

			if (times && times.constructor != Number) {
				belay = !!times;
				times = 0;
			}
			
			times = times || 0;
			belay = belay || false;
			
			if (!element.$timers) 
				element.$timers = {};
			
			if (!element.$timers[label])
				element.$timers[label] = {};
			
			fn.$timerID = fn.$timerID || this.guid++;
			
			var handler = function() {
				if (belay && this.inProgress) 
					return;
				this.inProgress = true;
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
				this.inProgress = false;
			};
			
			handler.$timerID = fn.$timerID;
			
			if (!element.$timers[label][fn.$timerID]) 
				element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);
			
			if ( !this.global[label] )
				this.global[label] = [];
			this.global[label].push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = element.$timers, ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.$timerID ) {
							window.clearInterval(timers[label][fn.$timerID]);
							delete timers[label][fn.$timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					element.$timers = null;
			}
		}
	}
});

if (jQuery.browser.msie)
	jQuery(window).one("unload", function() {
		var global = jQuery.timer.global;
		for ( var label in global ) {
			var els = global[label], i = els.length;
			while ( --i )
				jQuery.timer.remove(els[i], label);
		}
	});

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3.G=6(e){7 l=0;7 t=0;7 w=3.c(3.H(e,\'1b\'));7 h=3.c(3.H(e,\'1h\'));7 a=e.I;7 b=e.J;1g(e.K){l+=e.L+(e.8?3.c(e.8.M):0);t+=e.N+(e.8?3.c(e.8.O):0);e=e.K}l+=e.L+(e.8?3.c(e.8.M):0);t+=e.N+(e.8?3.c(e.8.O):0);f{x:l,y:t,w:w,h:h,1d:a,1c:b}};3.1a=6(e){g(e){w=e.u;h=e.A}j{w=(d.P)?d.P:(1.4&&1.4.u)?1.4.u:1.9.I;h=(d.F)?d.F:(1.4&&1.4.A)?1.4.A:1.9.J}f{w:w,h:h}};3.Q=6(e){g(e){t=e.i;l=e.B;w=e.D;h=e.E}j{g(1.4&&1.4.i){t=1.4.i;l=1.4.B;w=1.4.D;h=1.4.E}j g(1.9){t=1.9.i;l=1.9.B;w=1.9.D;h=1.9.E}}f{t:t,l:l,w:w,h:h}};3.c=6(v){v=18(v);f 16(v)?0:v};3.15.m=6(s){o=3.17(s);f r.19(6(){q 3.R.m(r,o)})};3.R.m=6(e,o){7 z=r;z.o=o;z.e=e;z.p=3.G(e);z.s=3.Q();z.S=6(){1f(z.C);z.C=11};z.t=(q T).U();z.V=6(){7 t=(q T).U();7 p=(t-z.t)/z.o.W;g(t>=z.o.W+z.t){z.S();1e(6(){z.n(z.p.y,z.p.x)},13)}j{X=((-k.Y(p*k.Z)/2)+0.5)*(z.p.y-z.s.t)+z.s.t;10=((-k.Y(p*k.Z)/2)+0.5)*(z.p.x-z.s.l)+z.s.l;z.n(X,10)}};z.n=6(t,l){d.14(l,t)};z.C=12(6(){z.V()},13)};',62,80,'|document||jQuery|documentElement||function|var|currentStyle|body|||intval|window||return|if||scrollTop|else|Math||ScrollTo|scroll|||new|this|||clientWidth||||||clientHeight|scrollLeft|timer|scrollWidth|scrollHeight|innerHeight|getPos|css|offsetWidth|offsetHeight|offsetParent|offsetLeft|borderLeftWidth|offsetTop|borderTopWidth|innerWidth|getScroll|fx|clear|Date|getTime|step|duration|st|cos|PI|sl|null|setInterval||scrollTo|fn|isNaN|speed|parseInt|each|getClient|width|hb|wb|setTimeout|clearInterval|while|height'.split('|'),0,{}))
