$(function(){
	//projects
	$("header nav li:first-child a").toggle(function(){
		$(this).addClass("active");
		$(".projects").slideDown();
	}, function(){
		$(this).removeClass("active");
		$(".projects").slideUp();
	});
	
	
	
	
	//gallery effect
	$(".gallery li").hover(function(){
		$(this).fadeTo(200, 0.5);	//find("span").stop(false, true).fadeIn("fast");
	}, function(){
		$(this).fadeTo(200, 1);		//find("span").stop(false, true).fadeOut("fast");
	})
	
	//MenuMaisonRollOver effect
	$(".menuMaison li").hover(function(){
		$(this).find("span.over").stop(false, true).fadeIn("fast");
	}, function(){
		$(this).find("span.over").stop(false, true).fadeOut("fast");
	})
	
	
	
	//RollOVer
	$("#maison").toggle(function()
	{
		$("#content").fadeTo(300, 0.15);
		$(".menuMaison").slideDown(250);
		
	}	
	, function()
	{
		$("#content").fadeTo(500, 1);
		$(".menuMaison").slideUp(250);
	})
	
	
	
	//menu
	$(".menu > li > a.submenu").toggle(function(){
		$(this).addClass("active");
		$(this).parent().find("ul").slideDown();
	}, function(){
		$(this).removeClass("active");
		$(this).parent().find("ul").slideUp();
	})
	
	//SliderVertical
	$(document).ready(function(){	
    var sudoSlider = $("#slider1").sudoSlider({ 
       ajax: [
	   				'ibanez.html', 
					'pickamole.html',
					'habana.html',
					'califono.html',
					'elissalde.html', 
					'skrela.html',
					'rive.html',
					'servat.html'					
			  ],	
		
		loadingText:'Chargement des maisons...',		
		nextHtml:'<a href="#" class="nextBtn"></a>',
		prevHtml:'<a href="#" class="prevBtn"></a>',
		speed:'300',
		clickableAni:false,
		ease:'swing',
		vertical:true,
		numeric: true,
		prevNext:false,
		preloadAjax:true,
        ajaxLoadFunction: function(t){
            //var url = $(this).children().attr('src');	
			var url = new Array(
									'ibanez.jpg', 
									'pickamole.jpg',
									'habana.jpg',
									'califono.jpg',
									'elissalde.jpg', 
									'skrela.jpg',
									'rive.jpg',
									'servat.jpg'		
							    );
								
			var title = new Array(
									'Ibanez', 
									'Pickamole',
									'Habana',
									'Califono',
									'Elissalde', 
									'Skrela',
									'Rive',
									'Servat'
							    );
			$('.controls li a span').eq(t-1).html('<img src="maisons_contemp/thumb/' + url[t-1] + '" width="100px" height="75px" title="' +title[t-1]+ '"/>');
		}
		
        
    	})
		});
		

		
		//JCarousel		
		jQuery(document).ready(function() {
			jQuery('ol.controls').addClass("jcarousel-skin-tango").jcarousel();
		});
	
});
