/**
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * Configuration LIGHTBOX
 */
var options_lightbox= {
	imageLoading:'image/lightbox-ico-loading.gif',
	imageBtnPrev:'image/lightbox-btn-prev.gif',
	imageBtnNext:'image/lightbox-btn-next.gif',
	imageBtnClose:'image/lightbox-btn-close.gif',
	imageBlank:'image/lightbox-blank.gif',
	fixedNavigation:true
};

jQuery(document).ready(function(){
	
	$('.galerie-lightbox a').lightBox(options_lightbox);
	$('.galerie-variante a').lightBox(options_lightbox);
	$('div[id^=gallery_lightbox] a').lightBox(options_lightbox);
	
	initdisponibilites('boite_produit1');
	//initdisponibilites('boite_produit3');
	
	initcarousels();
	if($('.fa_header_composante').length>0){
		init_compo();
		$('.contenu_compo').first().show("slow");
	}
	
});

var initcarousels = function(){
	
	var _carousels = $('.carousel-page');
	
	if(_carousels.length > 0){
		
		_carousels.each(function(){
			$(this).carousel({
				theight: "65",
				twidth: "65",
				orientation: $(this).attr('orientation'),
				resize:false,
				limit: $(this).attr('limit'),
				complete: function(){
					//fiche article
					if($("#div_article_conseille").length > 0){
						masqueongletfa("#div_article_conseille");
					}
					
					$(this).css("visibility","visible");
				}
			});
		});
	}
};

var initdisponibilites = function(classBoite){
	
	var _boites1 = $('.'+classBoite);
	if(_boites1.length > 0){		
		_boites1.each(function(){
			
			$(this).mouseenter(function(){
				
				$(this).find('.affichage-dispo').show();
				
			});
			
			$(this).mouseleave(function(){
				
				$(this).find('.affichage-dispo').hide();
				
			});
			
		});
		
	}
	
};

var init_compo = function(){
	 
	$('.contenu_compo').hide();
	$('.fa_header_composante').click(function(){
			//alert('salut');
			$('.contenu_compo').slideUp("slow");
	    	$(this).next().show("slow");
    	}
    );     
     
};
