$(document).ready(
	function() {
		if($('body').hasClass('stanhome')){
			var step0 = "/img/stanhome/bgd-home.jpg";
			var step1 = "/img/stanhome/bgd-home.jpg";
			var step2 = "/img/stanhome/bgd-home-step2.jpg";
			var step3 = "/img/stanhome/bgd-home-step3.jpg";
			var step4 = "/img/stanhome/bgd-home-step4.jpg";
		} else {
			var step0 = "/img/kiotis/bgd-home.jpg";
			var step1 = "/img/kiotis/bgd-home-step1.jpg";
			var step2 = "/img/kiotis/bgd-home-step2.jpg";
			var step3 = "/img/kiotis/bgd-home-step3.jpg";
			var step4 = "/img/kiotis/bgd-home-step4.jpg";
		}
		
		$('#menuBrand ul li').hover(function(){
			$(this).addClass("on");
 		},function(){
			$(this).removeClass("on");
		});
		$('#menuBrand ul li').click(function(){
			$('#menuBrand ul li').removeClass("selected");
			$('.introBrand').hide();
			$(this).addClass("selected");
			
			var introName = $(this).attr("id");
			$('#intro'+introName).show();
			if(introName=='step1'){
				$('body').css({ backgroundImage: "url('"+step1+"')" });
			} else if (introName=='step2'){
				$('body').css({ backgroundImage: "url('"+step2+"')" });
			} else if (introName=='step3'){
				$('body').css({ backgroundImage: "url('"+step3+"')" });
			} else if (introName=='step4'){
				$('body').css({ backgroundImage: "url('"+step4+"')" });
			}
			return false;
		});
		$('#menuBrand a img.logo').click(function(){
			$('body').css({ backgroundImage: "url('"+step0+"')" });
			$('#menuBrand ul li').removeClass("selected");
			$('.introBrand').hide();
			$('#introBrand').show();
		});
		
		$('#carousel .slide div:last-child').css('margin-right',0);
});
box.dom(document).ready(function() {
  box.ui('carousel').create({
    element: '#carousel',
    horizontal: true,
	paginate: true,
    display: 2, // nombre d'items affichs
    duration: 800// temps des transitions (donc animation)
  });
  
  $('.pagination ul li a').each(function(i){
		$(this).addClass('step'+i);
	});
  
 });