
/* Scripts - Ambiance Maître Peintre
------------------------------------------------*/

$(window).load(function() {
	
	// -- Orbit Slider
	$('#slider_accueil').orbit({
	     animation: 'horizontal-push',                  // fade, horizontal-slide, vertical-slide, horizontal-push
	     animationSpeed: 600,                // how fast animtions are
	     timer: true, 			 // true or false to have the timer
	     advanceSpeed: 4000, 		 // if timer is enabled, time between transitions 
	     pauseOnHover: false, 		 // if you hover pauses the slider
	     startClockOnMouseOut: false, 	 // if clock should start on MouseOut
	     startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
	     directionalNav: false, 		 // manual advancing directional navs
	     captions: true, 			 // do you want captions?
	     captionAnimation: 'fade', 		 // fade, slideOpen, none
	     captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
	     bullets: true,			 // true or false to activate the bullet navigation
	     bulletThumbs: false,		 // thumbnails for the bullets
	     bulletThumbLocation: '',		 // location from this file where thumbs will be
	     afterSlideChange: function(){} 	 // empty function 
	});

	// -- Blend (fade links)
	$("ul#menu li a").blend(300);
	$('ul#menu li ul li a img').css({ opacity: 0.5 });
	$('ul#menu li ul li a').hover(
		function() {
			$('img', this).stop().fadeTo("fast", 0.9);
		},
		function() {
			$('img', this).stop().fadeTo("fast", 0.5);
		}
	);
	
	// -- Superfish Menu
	$("ul#menu").superfish({
		animation:   {opacity:'show',height:'show'},
		autoArrows:    false	
	});
	
	// -- Modale soumission
	$('a.button_soumissions').fancybox({
		'centerOnScroll':	true,
		'type'        	:	'iframe',
      	'scrolling'   	: 	'no',
		'width'			:	769,
		'height'		:	665,
		'padding'		:	0,
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	0, 
		'speedOut'		:	0, 
		'titleShow'		:	false,
		'overlayColor'	:	'#000',
		'overlayOpacity':	0.6
	});
	
	
	// -- Hover liste projets
	$("#projets li img").css('opacity', 0.5);
	$("#projets li").hover(
  		function() {
			var lien = $('a' , this).attr('href');
    		$('img', this).stop().fadeTo(300, 0.95);
			$(this).append('<a href="'+lien+'" class="loupe"></a>');
			
			// -- Modale projets
			$('ul#projets li a').fancybox({
				'centerOnScroll':	true,
		      	'scrolling'   	: 	'no',
				'width'			:	960,
				'height'		:	335,
				'padding'		:	0,
				'transitionIn'	:	'fade',
				'transitionOut'	:	'fade',
				'speedIn'		:	300, 
				'speedOut'		:	300, 
				'titleShow'		:	false,
				'overlayColor'	:	'#000',
				'overlayOpacity':	0.6
			});
			
			$('a.loupe', this).hide().stop().fadeTo(300, 0.95);
  		},
  		function() {
    		$('img', this).stop().fadeTo(300, 0.5);
			$('a.loupe', this).remove();
  		}
	);
	
	
	
});
