$(document).ready(function() {
  					
  					$.supersized({
				
					//Functionality
					slideshow               :   1,		//Slideshow on/off
					autoplay				:	0,		//Slideshow starts playing automatically
					start_slide             :   1,		//Start slide (0 is random)
					random					: 	0,		//Randomize slide order (Ignores start slide)
					slide_interval          :   3000,	//Length between transitions
					transition              :   1, 		//0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
					transition_speed		:	500,	//Speed of transition
					new_window				:	1,		//Image links open in new window/tab
					pause_hover             :   0,		//Pause slideshow on hover
					keyboard_nav            :   1,		//Keyboard navigation on/off
					performance				:	1,		//0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
					image_protect			:	1,		//Disables image dragging and right click with Javascript
					image_path				:	'imgs/', //Default image path

					//Size & Position
					min_width		        :   0,		//Min width allowed (in pixels)
					min_height		        :   0,		//Min height allowed (in pixels)
					vertical_center         :   1,		//Vertically center background
					horizontal_center       :   1,		//Horizontally center background
					fit_portrait         	:   1,		//Portrait images will not exceed browser height
					fit_landscape			:   0,		//Landscape images will not exceed browser width
					
					//Components
					navigation              :   0,		//Slideshow controls on/off
					thumbnail_navigation    :   0,		//Thumbnail navigation
					slide_counter           :   0,		//Display slide numbers
					slide_captions          :   0,		//Slide caption (Pull from "title" in slides array)
					slides 					:  	[		//Slideshow Images
														{image : 'imgs/backgrounds/bg_ciel.jpg' , title : '', url : ''}
														  
												]							
				});
				
		// Placement du content-hom en fonction de la hauteur du navigateur :
		  
		  if ($(window).height() < 770)
            {
                $('#content-home').addClass('fix');
                $('#footer-home').addClass('fix');
                $('#col-left-home').css('height','740px');
                $('#col-right-home').css('height','740px');
                $('body').css('overflow-y','visible');
                
            }else{
                $('body').css('overflow-y','hidden');
                $('#content-home').removeClass('fix');
                $('#footer-home').removeClass('fix');
                $('#col-left-home').css('height','100%');
                $('#col-right-home').css('height','100%');
            }	
        
        ///**********
 
 		 $.fn.faireBlocInt = function(){
 			
 			var displayed = false;
 			 			
           $(this).bind('mouseenter', function(e) {onZoneOverInt(this);});
           $(this).bind('mouseleave', function(e) {onZoneOutInt(this);});

        };
 		
 			
 		$.fn.faireBloc = function(){
 			
 			var displayed = false;
 			
 		   $(this).parent().find('#list-zone').css('display','none');
 			
           $(this).bind('mouseenter', function(e) {onZoneOver(this);});
           $(this).bind('mouseleave', function(e) {onZoneOut(this);});
			
			
        };
        
 		function onZoneOver(elt){
 						
 			var content = $(elt).parent();
			$(elt).stop(true, true).animate({
		    	width: '342px',
			    height: '146px',
			    left: '-8px',
			    top: '-8px'
		    	 }, 100 , function(){
		    	 	
		    	 	$(elt).find('.extend-zone').stop(true, true).animate({top:'-60px'},10);
		  	 		$(elt).find('#list-zone').css('display','block').bind('mouseleave', function(e) {onZoneOut(elt);});
		  	 	
			});
			   	
			
 		}
 		
 		function onZoneOut(elt){
 			$(elt).find('#list-zone').css('display','none').unbind('mouseleave');
 			$(elt).animate({ 
			    	width: '334px',
				    height: '138px',
				    left: '0px',
				    top: '0px'
			    	}, 100 , function() {
			    		$(elt).find('.extend-zone').stop(true, true).animate({top:'0px'},10);
			    		$(elt).unbind('mouseenter');
           				$(elt).unbind('mouseleave');
			    		$(elt).faireBloc();
			    		
			    	});
 		}
 		
 		function onZoneOverInt(elt){

 			$(elt).css('background-image', 'url(../imgs/bg_bloc_int_on.png)');
			$(elt).stop(true, true).animate({
		    	width: '199px',
			    height: '73px',
			    left: '-6px',
			    top: '-6px'
		    	 }, 100 , function(){
		    	 	
		    	 	/*$(elt).unbind('mouseenter');*/
		  	 		/*$(elt).unbind('mouseleave');*/
		  	 				  	 		
		  	 		var lelien= $(elt).find('.bloc-icon2-int h2 a').attr("href");
		  	 		$(elt).find('.zone').click(function() {
  						document.location.href = lelien ;
					});
		  	 	
			});
			   	
			
 		}
 		
 		function onZoneOutInt(elt){

 			$(elt).css('background-image', 'url(../imgs/bg_bloc_int.png)');
 			/*$(elt).unbind('mouseleave');*/
 			$(elt).stop(true, true).animate({ 
			    	width: '193px',
				    height: '67px',
				    left: '0px',
				    top: '0px'
			    	}, 100 , function() {
			    		$(elt).unbind('mouseenter');
           				$(elt).unbind('mouseleave');
			    		$(elt).faireBlocInt();	
			    		
			    	});
 		}
 		
 		$("ul#ticker01").liScroll();
 		
 		$('#button1').faireBloc();	
 		$('#button2').faireBloc();
 		$('#button3').faireBloc();
 		$('#button4').faireBloc();
 		$('#button5').faireBloc();
 		$('#button6').faireBloc();
 		
 		$('#button1-int').faireBlocInt();
 		$('#button2-int').faireBlocInt();
 		$('#button3-int').faireBlocInt();
 		$('#button4-int').faireBlocInt();
 		$('#button5-int').faireBlocInt();
 		$('#button6-int').faireBlocInt();
 		
        
        //positionnement fixe du contenu en dessous du header pour les petites définitions d'écran.
        
        $(window).resize(function() {
            

        
            if ($(this).height() < 770)
            {
                $('#content-home').addClass('fix');
                $('#footer-home').addClass('fix');
                $('#col-left-home').css('height','740px');
                $('#col-right-home').css('height','740px');
                $('body').css('overflow-y','visible');
                
            }else{
                $('body').css('overflow-y','hidden');
                $('#content-home').removeClass('fix');
                $('#footer-home').removeClass('fix');
                $('#col-left-home').css('height','100%');
                $('#col-right-home').css('height','100%');
            }
            
        });

});

 		/*var defile;// l'element a deplacer 
		var psinit = 580; // position horizontale de depart 
		var pscrnt = psinit;       
		function texteDefile() { 
		   if (!defile) defile = document.getElementById('defile'); 
		   if (defile) { 
		      if(pscrnt < ( - defile.offsetWidth) ){ 
		         pscrnt = psinit; 
		                } else { 
		         pscrnt+= -1; // pixel par deplacement 
		      } 
		      defile.style.left = pscrnt+"px"; 
		   } 
		} 
		
		setInterval("texteDefile()",20); // delai de deplacement */
