	/* Fading sur la nav */
	$(document).ready(function() {
	$('#header li a.niv1').dwFadingLinks({
			color: '#FFF',
			duration: 1000
		});
	$('#header li li a').dwFadingLinks({
			color: '#cce0f2',
			duration: 1000
		});
	 });
	
	
/* Menu déroulant des fiches projets (http://www.noupe.com/tutorial/drop-down-menu-jquery-css.html) */
$(document).ready(function(){

	//$("ul.submenuprojets").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
	$("ul#menuprojets>li>a").addClass("menuprojetscateg"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
	$('ul#menuprojets a.menuprojetscateg').attr('href', '#');



	//$("ul#menuprojets li span").click(function() { //When trigger is clicked...
	$("ul#menuprojets a.menuprojetscateg").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.submenuprojets").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(
			function() {
			},
			function(){
				$(this).parent().find("ul.submenuprojets").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
			}
		);

		//Following events are applied to the trigger (Hover events for the trigger)
		}).parent().hover(function() {
			$(this).addClass("subhovermenuprojets"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhovermenuprojets"); //On hover out, remove class "subhover"
	});

});


/* Galerie photos */
$(document).ready(function (){
		$("#pikame").PikaChoose({autoPlay:false, showCaption:false, transition:[0]});
	
		$("#pikame").jcarousel({scroll:4,					
			initCallback: function(carousel) 
			{
				$(carousel.list).find('img').click(function() {
					//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
					carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
				});
			}
		});
	
	});

/* Boite des détails de projet qui se ferme */
$(document).ready(function() {
	$('a#closedetailprojet').toggle(function(){
		$('div#caption').animate({width: 'toggle'}, 400, function() {});
		$('div#caption div').css({'opacity':0});
		$(this).css({'top':'450px','left':'0','height':'110px','width':'22px','background-position':'-28px 0'});
	}, function(){
		$('div#caption').animate({width: 'toggle'}, 400, function() {
			$('div#caption div').css({'opacity':1});
			$('a#closedetailprojet').css({'top':'465px','left':'360px','height':'9px','width':'9px','background-position':'0 0'});
		});
		
	});
});

/* Sur la liste des réalisations, boite avec le nom du projet qui apparaît au survol */
$(document).ready(function() {
	$("div#liste-vignettes a").hover(function() {
		$(this).find("span.titre").slideDown(100).show();
		
		$(this).hover(
			function() {
			},
			function(){
				$(this).find("span.titre").slideUp(100); //When the mouse hovers out of the subnav, move it back up
			}
		);
		
	
	});
});


/* Toogle de la Google maps */
$(document).ready(function() {
	$('div#titremap').toggle(function(){
		$('div#mapaccess').animate({'width': '830px', 'height': '800px'}, 400, function() {
			$('div#titremap').animate({'background-position':'235px 8px', 'width': '710px'}, 400, function() {});																		
		});
		$('#contenu2').animate({'height': '1150px'}, 400, function() {});	
	}, function(){
		$('div#mapaccess').animate({'width': '360px', 'height' : '250px'}, 400, function() {
			$('div#titremap').animate({'background-position':'235px -276px', 'width': '240px'}, 400, function() {});	
		});
		$('#contenu2').animate({'height': '620px'}, 400, function() {});	
		
	});
});

/* Zoom dans le labo */
$(document).ready(function(){	
    $('a.lightbox-gambino').lightBox({
		txtOf: 'sur'
	});
});
