// Jquery Document for additional code
jQuery(document).ready(function(){
	//on active les carroussels
	//slide de pub...le bandeau des partenaires: les boutiques officielles
    jQuery('#marques_partenaires').bxSlider({
		autoHover: true,
		auto: true,
		margin: 0,
		autoControls: false,
        displaySlideQty: 8,
        moveSlideQty: 1,
		ticker: true,
        tickerSpeed: 3500
    });
	//slide de pub...le bandeau des partenaires: les autres marques
	jQuery('#autres_marques_partenaires').bxSlider({
		autoDirection : 'prev',
		autoHover: true,
		auto: true,
		margin: 0,
		autoControls: false,
        displaySlideQty: 8,
        moveSlideQty: 1,
		ticker: true,
        tickerSpeed: 4500
    });
	if ((jQuery(window).width() > 1600))
	{
		//image de background en grand format
	//1ere image background de côté pour couvrir le fond gauche
	jQuery.supersized({
					//Background image
					vertical_center: 0,
					fit_always: 0,
					fit_landscape: 0,
					fit_portrait: 1,
					slides	:  [ { image : 'img/fond-bandeaux-lateral-2.jpg'}]					
				});
	//2eme image background de côté pour couvrir le fond droit
	jQuery.supersizednext({
					//Background image
					vertical_center: 0,
					fit_always: 0,
					fit_landscape: 0,
					fit_portrait: 1,
					slides	:  [ { image : 'img/fond-page-exemple2.jpg'}]					
				});
	//
   }else{
	   if ((jQuery(window).width() > 1400)){
		       //on modifie le background de la page
			   jQuery('body').addClass("body-medium");
			   //
		}
	   //
	  }
	  
//on lance le carrousel moyen...specialement pour INTERNET EXPLORER
// Internet Explorer est un sadique. 
//alert('it is the amazing internet explorer!');
// assign the slider to a variable
  var slider = jQuery('#slidesContainer').bxSlider({
		speed: 4000,
		autoHover: true,
		auto: true,
		margin: 0,
		displaySlideQty: 2,
        moveSlideQty: 1,
		ticker: true,
        tickerSpeed: 5000,
        controls: false
  });

  // assign a click event to the external thumbnails
  jQuery('.thumbs a').click(function(){
   var thumbIndex = jQuery('.thumbs a').index(this);
    // call the "goToSlide" public function
    slider.goToSlide(thumbIndex);
 
    // remove all active classes
    jQuery('.thumbs a').removeClass('pager-active');
    // assisgn "pager-active" to clicked thumb
    jQuery(this).addClass('pager-active');
    // very important! you must kill the links default behavior
    return false;
  });

  // assign "pager-active" class to the first thumb
  jQuery('.thumbs a:first').addClass('pager-active');
/////////////////////////////////////
//
//
});
