//Fonctions Pour la mise en page


var IE6 = false, IE7 = false,
 FIREFOX2  = false, FIREFOX  = false,
  NETSCAPE7 = false, NETSCAPE = false, 
   OPERA9 = false, OPERA = false, 
    AUTRE = false;
		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChStart = strChUserAgent.substring(0,intSplitStart);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		var strChEnd = strChUserAgent.substring(strChEnd);
		
		
		if(strChMid.indexOf("MSIE 7") != -1) {
			IE7 = true;
		}
			
			
			
			

jQuery.getDocHeight = function(){
				  return Math.max(
// 				      jQuery(document).height(),
				      jQuery(window).height(),
				      /* For opera: */
				      document.documentElement.clientHeight
				  );
			};


			jQuery.getDocWidth = function(){
				  return Math.max(
				      //jQuery(document).width(),
				      jQuery(window).width(),
				      /* For opera: */
				      document.documentElement.clientWidth
				  );
			};




	      function resize_fond() {

			  var client_height = jQuery.getDocHeight(); //alert(client_height);

				var client_width = jQuery.getDocWidth(); //alert(client_height);

					  //calcul margin menu
					  var margin_menu = (client_height/2)-48;
						  jQuery('.menu').css({'margin-top':margin_menu+'px','height':'145px'});


					  //calcul height contenu_principal

					  var height_principal = (client_height/2)-(48+40);    //48=2e moitié menu 40=hauteur footer  30=margin entre contenu et footer
						  jQuery('.contenu_principal').css({'min-height':'0px'});



							position_footer();
	      }



	    function position_footer() {

					//calcul margin footer
										var client_height = jQuery.getDocHeight(); //alert(client_height);

										var client_width = jQuery.getDocWidth(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);

											var margin_t_m = jQuery('.menu').css('margin-top');
											var margin_l_m = (client_width-1024)/2;

											var top_footer = (parseInt(haut_cont)+30)-parseInt(margin_t_m);

// 											if(IE7 == true) {
// 												jQuery('.footer').css({'margin-left':margin_l_m+'px','margin-top':top_footer+'px','position':'relative'});
// 											}
// 											
// 											else {
												jQuery('.footer').css({'left':margin_l_m+'px','margin-top':top_footer+'px','position':'fixed'});
											//}
											

			}  
	      
	      
	      
	      
	      function remonter_logo() {
			  jQuery('.cont_logo').animate({
				  'margin-top':'-100px'
					}, 500, function() {
					  // Animation complete.
					  
					  jQuery('#le_logo').attr('src','_images/logo_sdf1.jpg');
					  
				});
				
	      }
	      
	      function redescendre_logo() {
			  jQuery('.cont_logo').animate({
				  'margin-top':'0px'
					}, 800, function() {
					  // Animation complete.
					  jQuery('.contenu_icone_menu').fadeIn('slow', function() {
						// Animation complete.
					  });

					  
				});
				
	      }
	      
	      
	      function remonter_menu() {

					var client_height = jQuery.getDocHeight();

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_footer = parseInt(haut_cont);

											var top_footer = haut_footer+30;

					//jQuery('.footer').fadeOut('fast', function() {});


					jQuery('.menu').animate({
				  						'height':'96px',
												'margin-top':'0px'
									}, 1000, function() {
					  				// Animation complete.
					  
					  				remonter_logo();
					  				redescendre_logo();
							
										jQuery('.menu').attr('id','menu_haut');
									});
									
									
									
					  
					  //calcul height contenu_principal

					  var height_principal = (client_height)-(96+40+30);    //90 = (96=menu)-(50=margin)    40=hauteur footer  30=margin entre contenu et footer
						  jQuery('.contenu_principal').animate({
							  'min-height':height_principal+'px'
								}, 1200, function() {
					  			// Animation complete.
							});
		  }
		  
		  
		  


function center_image(e) {
// 	var margin_picto = (52-h)/2;
// 	e.css({'margin-top':margin_picto+'px'});

var height_picto = e.height();
var width_picto = e.width();


		if(height_picto>=width_picto) {
			e.css({'max-width':'52px','max-height':''});
		} else {
			e.css({'max-height':'52px','max-width':''});

			var marge = -((e.width() - 52)/2);
			e.css({'margin-left':marge+'px'});
		}
}
		  
		  
		  function charger_food(page) {
		  
					jQuery.ajax({
					  type:'GET',
					  url:'_requetes/food.php?page='+page,
					  success:function(msg){
							
							jQuery('#menu_food').hover(function() {		
								jQuery(this).css({'color':'white'});		  
							},function() {
								jQuery(this).css({'color':'white'});
							});
							
							
							
					  
					  		jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.			

										position_footer();
					  
						  				jQuery('.contenu_principal').html(msg);

											jQuery('.contenu_principal').css({'min-height':'0px'});


//on calcule la hauteur du contenu
						  
						  				var client_height = jQuery.getDocHeight(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_food = parseInt(haut_cont);




											var width_ecran = jQuery.getDocWidth();//alert(width_ecran);

											var width_food = 1024 + ((width_ecran-1024)/2); //alert(width_food);
						  
						  				jQuery('.contenu_food').css({'height':haut_food+'px','width':width_food+'px'});


														if(width_food>=1230) {
																var width_gauche=1024;
														}

														else {
																var width_gauche=width_food-196; //166+20(marge droite)+10(ecart 2 blocs)
														}


											jQuery('.contenu_food_gauche').css({'width':width_gauche+'px'});
						  
										  //alert(haut_food);
						  				var margin_pictos_infos = haut_food-328;
						  
						  				jQuery('.food_pictos_infos').css({'margin-top':margin_pictos_infos+'px'});
						  
						  				//jQuery('.contenu_food_gauche #image_food').css({'max-height':haut_food+'px','min-height':haut_food+'px'});

													
											jQuery('.contenu_food_gauche #image_food').css({'max-height':haut_food+'px','max-width':width_gauche+'px'});





											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.
											});
						  
									});




					  }

					});	    
	    
		  }
		  
		  
		  
		  function affiche_image_food(imge,titre,sous_titre,p_id) {
		  
			//jQuery('.contenu_food_gauche').html("<center><img src='_images/food/"+imge+"' id='image_food' alt='' title='' style='max-width:680px;' /></center>");

			jQuery('.contenu_food_gauche #image_food').fadeOut('slow', function() {
				// Animation complete.

							if((titre.length!='')&&(sous_titre.length!='')&&(titre.length!=0)&&(sous_titre.length!=0)&&(titre.length!=null)&&(sous_titre.length!=null)) {
							jQuery('.contenu_food_infos').css({'border-bottom':'1px solid #3C3D37'});
							} else {
								jQuery('.contenu_food_infos').css({'border-bottom':'none'});
							}
				jQuery('.contenu_food_gauche #image_food').attr('src','_images/food/'+imge);
				jQuery(' .food_infos_titre').html(titre);
				jQuery('.food_infos_sous_titre').html(sous_titre);


						var hauteur_image = parseInt(jQuery('.contenu_food_gauche #image_food').height());

						var client_height = parseInt(jQuery.getDocHeight());

						var haut_cont = (client_height)-(96+40+30);
												  
						var haut_food = parseInt(haut_cont);

						var margin_image = haut_food - hauteur_image;
						
						
								if(margin_image>200) {margin_image=0;}

						jQuery('.contenu_food_gauche #image_food').css({'margin-top':margin_image+'px'});


						var onclick_img = jQuery('#'+p_id).attr('onclick');//alert(onclick_img);
															
						document.getElementById('image_food').onclick = onclick_img;

				jQuery('.contenu_food_gauche #image_food').fadeIn('slow', function() {
									// Animation complete.	
									
				});
			});
			
		  }
		  
		  
		  




		  
		  
		  function charger_still_life(page) {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/still_life.php?page='+page,
					  success:function(msg){
							
										jQuery('#menu_still_life').hover(function() {		
											jQuery(this).css({'color':'white'});		  
										},function() {
											jQuery(this).css({'color':'white'});
										});
					  
					  		//jQuery('.footer').fadeOut('slow', function() {});

								jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.			

					  
						  				jQuery('.contenu_principal').html(msg);

											jQuery('.contenu_principal').css({'min-height':'0px'});


//on calcule la hauteur du contenu
						  
						  				var client_height = jQuery.getDocHeight(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_still_life = parseInt(haut_cont);


											var width_ecran = jQuery.getDocWidth();//alert(width_ecran);

											var width_still_life = 1024 + ((width_ecran-1024)/2); //alert(width_food);
						  
						  				jQuery('.contenu_still_life').css({'height':haut_still_life+'px','width':width_still_life+'px'});


														if(width_still_life>=1230) {
																var width_gauche=1024;
														}

														else {
																var width_gauche=width_still_life-196; //166+20(marge droite)+10(ecart 2 blocs)
														}

											jQuery('.contenu_still_life_gauche').css({'width':width_gauche+'px'});


						  
						  
						  				var margin_pictos_infos = haut_still_life-328;
						  
						  				jQuery('.still_life_pictos_infos').css({'margin-top':margin_pictos_infos+'px'});
						  
						  				//jQuery('.contenu_still_life_gauche #image_still_life').css({'max-height':haut_still_life+'px','min-height':haut_still_life+'px'});
											jQuery('.contenu_still_life_gauche #image_still_life').css({'max-height':haut_still_life+'px','max-width':width_gauche+'px'});


													position_footer();
									
											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.	
													//jQuery('.footer').fadeIn('slow', function() {});
											});
						  
									});




					 	 }

				});
						
		 }



			function affiche_image_still_life(imge,titre,sous_titre,p_id) {
		  
			//jQuery('.contenu_still_life_gauche').html("<center><img src='_images/still_life/"+imge+"' id='image_still_life' alt='' title='' style='max-width:680px;' /></center>");

			jQuery('.contenu_still_life_gauche #image_still_life').fadeOut('slow', function() {
				// Animation complete.

							if((titre.length!='')&&(sous_titre.length!='')&&(titre.length!=0)&&(sous_titre.length!=0)&&(titre.length!=null)&&(sous_titre.length!=null)) {
								jQuery('.contenu_still_life_infos').css({'border-bottom':'1px solid #3C3D37'});
							} else {
								jQuery('.contenu_still_life_infos').css({'border-bottom':'none'});
							}

				jQuery('.contenu_still_life_gauche #image_still_life').attr('src','_images/still_life/'+imge);
				jQuery(' .still_life_infos_titre').html(titre);
				jQuery('.still_life_infos_sous_titre').html(sous_titre);


						var hauteur_image = jQuery('.contenu_still_life_gauche #image_still_life').height();//alert(hauteur_image);

						var client_height = jQuery.getDocHeight(); //alert(client_height);

						var haut_cont = (client_height)-(96+40+30);
												  
						var haut_still_life = parseInt(haut_cont);

						var margin_image = haut_still_life - hauteur_image;
						
						
								if(margin_image>200) {margin_image=0;}

						jQuery('.contenu_still_life_gauche #image_still_life').css({'margin-top':margin_image+'px'});



						var onclick_img = jQuery('#'+p_id).attr('onclick');//alert(onclick_img);
															
						document.getElementById('image_still_life').onclick = onclick_img;

				jQuery('.contenu_still_life_gauche #image_still_life').fadeIn('slow', function() {
									// Animation complete.					  	
				});
			});
			
		  }








		  
		  function charger_reportage(page) {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/reportage.php?page='+page,
					  success:function(msg){
					  
											jQuery('#menu_reportage').hover(function() {		
												jQuery(this).css({'color':'white'});		  
											},function() {
												jQuery(this).css({'color':'white'});
											});
							
							//jQuery('.footer').fadeOut('slow', function() {});

									jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.			
					  
						  				jQuery('.contenu_principal').html(msg);

											jQuery('.contenu_principal').css({'min-height':'0px'});
						  
//on calcule la hauteur du contenu
						  
						  				var client_height = jQuery.getDocHeight(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_reportage = parseInt(haut_cont);



											var width_ecran = jQuery.getDocWidth();//alert(width_ecran);

											var width_reportage = 1024 + ((width_ecran-1024)/2); //alert(width_food);
						  
						  				jQuery('.contenu_reportage').css({'height':haut_reportage+'px','width':width_reportage+'px'});


														if(width_reportage>=1230) {
																var width_gauche=1024;
														}

														else {
																var width_gauche=width_reportage-196; //166+20(marge droite)+10(ecart 2 blocs)
														}

											jQuery('.contenu_reportage_gauche').css({'width':width_gauche+'px'});


						  
						  
						  				var margin_pictos_infos = haut_reportage-328;
						  
						  				jQuery('.reportage_pictos_infos').css({'margin-top':margin_pictos_infos+'px'});
						  
						  				//jQuery('.contenu_reportage_gauche #image_reportage').css({'max-height':haut_reportage+'px','min-height':haut_reportage+'px'});
											jQuery('.contenu_reportage_gauche #image_reportage').css({'max-height':haut_reportage+'px','max-width':width_gauche+'px'});



//calcul des margin pour le footer
												position_footer();


											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.					
													//jQuery('.footer').fadeIn('slow', function() {});
											});
						  
									});




					  }

					});	    
	    
		  }
		  
		  
		  
		  function affiche_image_reportage(imge,titre,sous_titre,p_id) {
		  
			//jQuery('.contenu_reportage_gauche').html("<center><img src='_images/reportage/"+imge+"' id='image_reportage' alt='' title='' style='max-width:680px;' /></center>");

			jQuery('.contenu_reportage_gauche #image_reportage').fadeOut('slow', function() {
				// Animation complete.

							if((titre.length!='')&&(sous_titre.length!='')&&(titre.length!=0)&&(sous_titre.length!=0)&&(titre.length!=null)&&(sous_titre.length!=null)) {
								jQuery('.contenu_reportage_infos').css({'border-bottom':'1px solid #3C3D37'});
							} else {
								jQuery('.contenu_reportage_infos').css({'border-bottom':'none'});
							}

				jQuery('.contenu_reportage_gauche #image_reportage').attr('src','_images/reportage/'+imge);
				jQuery(' .reportage_infos_titre').html(titre);
				jQuery('.reportage_infos_sous_titre').html(sous_titre);



						var hauteur_image = jQuery('.contenu_reportage_gauche #image_reportage').height();

						var client_height = jQuery.getDocHeight(); //alert(client_height);

						var haut_cont = (client_height)-(96+40+30);
												  
						var haut_reportage = parseInt(haut_cont);

						var margin_image = haut_reportage - hauteur_image;
						
									if(margin_image>200) {margin_image=0;}

jQuery('.contenu_reportage_gauche #image_reportage').css({'margin-top':margin_image+'px'});




						var onclick_img = jQuery('#'+p_id).attr('onclick');//alert(onclick_img);
															
						document.getElementById('image_reportage').onclick = onclick_img;

				jQuery('.contenu_reportage_gauche #image_reportage').fadeIn('slow', function() {
									// Animation complete.					  	
				});
			});
			
		  }









		  
		  function charger_packshot(page) {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/packshot.php?page='+page,
					  success:function(msg){
					  
										jQuery('#menu_packshot').hover(function() {		
											jQuery(this).css({'color':'white'});		  
										},function() {
											jQuery(this).css({'color':'white'});
										});

									jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.			
					  
						  				jQuery('.contenu_principal').html(msg);

											jQuery('.contenu_principal').css({'min-height':'0px'});

						  
//on calcule la hauteur du contenu
						  
						  				var client_height = jQuery.getDocHeight(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_packshot = parseInt(haut_cont);



											var width_ecran = jQuery.getDocWidth();//alert(width_ecran);

											var width_packshot = 1024 + ((width_ecran-1024)/2); //alert(width_food);
						  
						  				jQuery('.contenu_packshot').css({'height':haut_packshot+'px','width':width_packshot+'px'});


														if(width_packshot>=1230) {
																var width_gauche=1024;
														}

														else {
																var width_gauche=width_packshot-196; //166+20(marge droite)+10(ecart 2 blocs)
														}

											jQuery('.contenu_packshot_gauche').css({'width':width_gauche+'px'});



						  
						  
						  				var margin_pictos_infos = haut_packshot-328;
						  
						  				jQuery('.packshot_pictos_infos').css({'margin-top':margin_pictos_infos+'px'});
						  
						  				//jQuery('.contenu_packshot_gauche #image_packshot').css({'max-height':haut_packshot+'px','min-height':haut_packshot+'px'});
											jQuery('.contenu_packshot_gauche #image_packshot').css({'max-height':haut_packshot+'px','max-width':width_gauche+'px'});



//calcul des margin pour le footer

													position_footer();		  	



											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.			
													//jQuery('.footer').fadeIn('slow', function() {});
											});
						  
									});




					  }

					});	    
	    
		  }
		  
		  
		  
		  function affiche_image_packshot(imge,titre,sous_titre,p_id) {
		  
			//jQuery('.contenu_packshot_gauche').html("<center><img src='_images/packshot/"+imge+"' id='image_packshot' alt='' title='' style='max-width:680px;' /></center>");

			jQuery('.contenu_packshot_gauche #image_packshot').fadeOut('slow', function() {
				// Animation complete.

							if((titre.length!='')&&(sous_titre.length!='')&&(titre.length!=0)&&(sous_titre.length!=0)&&(titre.length!=null)&&(sous_titre.length!=null)) {
								jQuery('.contenu_packshot_infos').css({'border-bottom':'1px solid #3C3D37'});
							} else {
								jQuery('.contenu_packshot_infos').css({'border-bottom':'none'});
							}

				jQuery('.contenu_packshot_gauche #image_packshot').attr('src','_images/packshot/'+imge);
				jQuery(' .packshot_infos_titre').html(titre);
				jQuery('.packshot_infos_sous_titre').html(sous_titre);


						var hauteur_image = jQuery('.contenu_packshot_gauche #image_packshot').height();

						var client_height = jQuery.getDocHeight(); //alert(client_height);

						var haut_cont = (client_height)-(96+40+30);
												  
						var haut_packshot = parseInt(haut_cont);

						var margin_image = haut_packshot - hauteur_image;
						
						
						
									if(margin_image>200) {margin_image=0;}

jQuery('.contenu_packshot_gauche #image_packshot').css({'margin-top':margin_image+'px'});



						var onclick_img = jQuery('#'+p_id).attr('onclick');//alert(onclick_img);
															
						document.getElementById('image_packshot').onclick = onclick_img;

				jQuery('.contenu_packshot_gauche #image_packshot').fadeIn('slow', function() {
									// Animation complete.					  	
				});
			});
			
		  }
		  





		  
		  function charger_others_videos() {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/others_videos.php',
					  success:function(msg){
							
										jQuery('#menu_others').hover(function() {		
											jQuery(this).css({'color':'white'});		  
										},function() {
											jQuery(this).css({'color':'white'});
										});
					  
					  		//jQuery('.footer').fadeOut('slow', function() {});

								jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.			
					  
						  				jQuery('.contenu_principal').html(msg);

											jQuery('.contenu_principal').css({'min-height':'0px'});




//on calcule la hauteur du contenu
						  
						  				var client_height = jQuery.getDocHeight(); //alert(client_height);

											var haut_cont = (client_height)-(96+40+30);
						  
						  				var haut_others = parseInt(haut_cont);

						  
						  				jQuery('.contenu_others').css({'height':haut_others+'px'});



						  
						  
						  				var margin_pictos_infos = haut_others-320; //alert(margin_pictos_infos);
						  
						  				jQuery('.others_pictos_infos').css({'margin-top':'110px'});
						  
						  				jQuery('.contenu_others_gauche #image_others').css({'max-height':haut_others+'px','max-width':'680px'});

									
											check_hauteur_player();

											//calcul des margin pour le footer
													position_footer();





											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.	

														//jQuery('.footer').fadeIn('slow', function() {});

														/*jQuery('#scroll_bas_liste').hover(function() {	
																alert();moveLayer(-1);	  
						  							},function() {								
																clearTimeout(Timer);
						  							});*/  

														jQuery('#scroll_bas_liste').click(function() {	
																var haut_liste = jQuery('#liste_others_pictos').height();
																var haut_actu = parseInt(jQuery('#liste_others_pictos').css('top'));
																var haut_after = haut_actu-270; if(haut_after<-(haut_liste-320)) {haut_after=-(haut_liste-320);} //alert(haut_after);

																	if(haut_liste>331) {
																			jQuery('#liste_others_pictos').animate({
																			  'top':haut_after+'px'
																			}, 500, function() {
																			  // Animation complete.
																		  
																			});
																	}
														});


														jQuery('#scroll_haut_liste').click(function() {	
																var haut_liste = jQuery('#liste_others_pictos').height();
																var haut_actu = parseInt(jQuery('#liste_others_pictos').css('top'));
																var haut_after = haut_actu+270; if(haut_after>0) {haut_after=0;}

																				if(haut_liste>331) {
																					jQuery('#liste_others_pictos').animate({
																				  'top':haut_after+'px'
																					}, 500, function() {
																					  // Animation complete.
																					  
																				});
																			}
						  							});				  	
											});
						  
									});
						}

				});
		}


			function charger_others_3D() {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/others_3D.php',
					  success:function(msg){
							
							
										jQuery('#menu_others').hover(function() {		
											jQuery(this).css({'color':'white'});		  
										},function() {
											jQuery(this).css({'color':'white'});
										});
					  
					  		//jQuery('.footer').fadeOut('slow', function() {});


								jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.	
					  
						  				jQuery('.contenu_principal').html(msg);
						  
						  				jQuery('.contenu_principal').css({'min-height':'530px'});

											var haut_cont = jQuery('.contenu_principal').css('min-height');
						  
						  				var haut_others = parseInt(haut_cont)-30;



						  
						  				jQuery('.contenu_others').css({'height':haut_others+'px'});




// 											var margin_pictos_infos = haut_others-320; //alert(margin_pictos_infos);
// 
// 
// 						  
// 						  				jQuery('.others_pictos_infos').css({'margin-top':margin_pictos_infos+'px'});

											check_hauteur_3D();


						  
						  				jQuery('.contenu_others_gauche #image_others').css({'max-height':haut_others+'px','max-width':'680px'});



											//calcul des margin pour le footer
  	



									
											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.	


													var hauteur_co = jQuery(document).height();

													var marge = hauteur_co-(96+40); //96=hauteur menu et 40=hauteur footer

													jQuery('.footer').css({'position':'relative','margin-top':marge+'px'});





														jQuery('#scroll_bas_liste').click(function() {	
																var haut_liste = jQuery('#liste_others_pictos').height();
																var haut_actu = parseInt(jQuery('#liste_others_pictos').css('top'));
																var haut_after = haut_actu-270; if(haut_after<-(haut_liste-320)) {haut_after=-(haut_liste-320);} //alert(haut_after);

																		if(haut_liste>331) {
																					jQuery('#liste_others_pictos').animate({
																					  'top':haut_after+'px'
																						}, 500, function() {
																						  // Animation complete.
																						  
																					});
																		}
														});


														jQuery('#scroll_haut_liste').click(function() {	
																var haut_liste = jQuery('#liste_others_pictos').height();
																var haut_actu = parseInt(jQuery('#liste_others_pictos').css('top'));
																var haut_after = haut_actu+270; if(haut_after>0) {haut_after=0;}

																	if(haut_liste>331) {
																		jQuery('#liste_others_pictos').animate({
																	  'top':haut_after+'px'
																		}, 500, function() {
																		  // Animation complete.
																		  
																		});
																	}
						  							});			  	
											});
						  
									});

					  }

					});	
	}




function check_hauteur_player() {

	var hauteur_cont = jQuery('.contenu_others').css('height');
	var margin_player = (parseInt(hauteur_cont)-385)/2;

	jQuery('#le_player').css({'margin-top':margin_player+'px'});
	jQuery('.others_pictos_infos').css({'margin-top':margin_player+'px'});
}


function check_hauteur_3D() {

	var hauteur_cont = jQuery('.contenu_others').css('height');
	var margin_player = (parseInt(hauteur_cont)-465)/2;


	//jQuery('.others_pictos_infos').css({'margin-top':margin_player+'px'});
	jQuery('.others_pictos_infos').css({'margin-top':'8px'});
}




			function afficher_others_videos(url_video) {

				//var contenu_vid = '<div id="le_player" style="position:relative;float:right;"><object type="application/x-shockwave-flash" data="http://flv-player.net/medias/player_flv_multi.swf" width="640" height="468">                 <param name="movie" value="http://flv-player.net/medias/player_flv_multi.swf" />                      <param name="allowFullScreen" value="true" />                      <param name="FlashVars" value="flv=http%3A//dev4.3xo.fr/studio_des_fleurs/_videos/'+url_video+'&amp;width=640&amp;height=468&amp;autoplay=1&amp;margin=0&amp;bgcolor=2a2a2a&amp;bgcolor1=2a2a2a&amp;bgcolor2=2a2a2a&amp;showvolume=1&amp;showprevious=1&amp;shownext=1&amp;showopen=0&amp;showplayer=always&amp;playercolor=2a2a2a&amp;loadingcolor=868686&amp;buttoncolor=5c5d60&amp;buttonovercolor=b9bbbc&amp;slidercolor1=d0d1d3&amp;slidercolor2=d0d1d3&amp;sliderovercolor=a2a3a6&amp;titlecolor=5c5d60&amp;showtitlebackground=never" />                  </object></div>';

				var contenu_vid = '<div id="le_player" style="position:relative;float:right;"><object type="application/x-shockwave-flash" data="http://flv-player.net/medias/player_flv_multi.swf" width="576" height="384">    <param name="movie" value="http://flv-player.net/medias/player_flv_multi.swf" />    <param name="allowFullScreen" value="true" />    <param name="FlashVars" value="flv=http%3A//dev4.3xo.fr/studio_des_fleurs/_videos/'+url_video+'&amp;width=576&amp;height=384&amp;autoplay=1&amp;autonext=0&amp;margin=0&amp;bgcolor=2a2a2a&amp;bgcolor1=2a2a2a&amp;bgcolor2=2a2a2a&amp;showvolume=1&amp;showprevious=1&amp;shownext=1&amp;showopen=0&amp;showplayer=always&amp;playercolor=2a2a2a&amp;loadingcolor=868686&amp;buttoncolor=5c5d60&amp;buttonovercolor=b9bbbc&amp;slidercolor1=d0d1d3&amp;slidercolor2=d0d1d3&amp;sliderovercolor=a2a3a6&amp;titlecolor=5c5d60&amp;showtitlebackground=never" /></object></div>';


				jQuery('.contenu_others_gauche').html(contenu_vid);
				
				check_hauteur_player();
			}


			function afficher_others_3D(url_video) {

				var contenu_vid = '<center><iframe src ="_3D/'+url_video+'/index.html" width="680px" height="465px" style="border:none;margin:0;"></iframe></center>';

				jQuery('.contenu_others_gauche').html(contenu_vid);
			}








		  
		  function charger_about_us() {
		  
				  jQuery.ajax({
					  type:'GET',
					  url:'_requetes/about_us.php',
					  success:function(msg){
							
							
											jQuery('#menu_about_us').hover(function() {		
												jQuery(this).css({'color':'white'});		  
											},function() {
												jQuery(this).css({'color':'white'});
											});
					  
					  		jQuery('.contenu_principal').fadeOut('slow', function() {
										// Animation complete.					  	
					  
						  				jQuery('.contenu_principal').html(msg);
						  
						  				var haut_cont = jQuery('.contenu_principal').css('min-height');
						  
						  				var haut_about_us = parseInt(haut_cont)-30;
											
											
											
																
											
											var client_height = jQuery.getDocHeight(); //alert(client_height);
											
											var haut_cont = (client_height)-(96+40+30);
											
											var haut_about_us = parseInt(haut_cont);
											
											
											
											
											jQuery('.contenu_about_us').css({'min-height':haut_about_us+'px'});
											
											var haut_about_us_centre_effectif = parseInt(jQuery('.contenu_about_us_centre').css('height'));
											
											
											if(haut_about_us>haut_about_us_centre_effectif) {
												
												var marge_centre_about_us = (haut_about_us-haut_about_us_centre_effectif)/2;
												
												jQuery('.contenu_about_us_centre').css({'margin-top':marge_centre_about_us+'px'});
												
											}
												
												
												


									

											jQuery('.contenu_principal').fadeIn('slow', function() {
													// Animation complete.	
													

													var hauteur_co = jQuery(document).height();

													var marge = hauteur_co-(96+40); //96=hauteur menu et 40=hauteur footer
													
													

													var client_width = jQuery.getDocWidth(); //alert(client_height);

													var margin_l_m = (client_width-1024)/2;

													jQuery('.footer').css({'position':'relative','left':'0px','margin-top':marge+'px'});

											});
						  
									});




					  }

					});	    

		  }









var Timer;
var Pas = 4;

function moveLayer(Sens) {

//alert('ici');

	Objet=document.getElementById('liste_others_pictos');
    if(parseInt(Objet.style.top) + (Pas*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens)<-(Objet.offsetHeight-document.getElementById('contenu_liste_others_pictos').offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens)) + "px";
	}
	

	Timer = setTimeout("moveLayer(" + Sens + ");", 100);
}














jQuery(document).ready(function(){


  resize_fond();
	
	
	jQuery(function() {
		var zIndexNumber = 1000;
				jQuery('div').each(function() {
					jQuery(this).css('zIndex', zIndexNumber);
					zIndexNumber -= 10;
				});
	});



  
  jQuery('#menu_food').click(function() {
  
  
	jQuery('.un_menu').css({'color':'gray'});
  
		if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_food(1);",2000);
		} else {
		  charger_food(1);
		}
		
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
						  jQuery('#menu_food').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'white'});
						  });
		
		  
	
  });


  
  jQuery('#menu_still_life').click(function() {
  
  
	jQuery('.un_menu').css({'color':'gray'});
	
		if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_still_life(1);",2000);
		} else {
		  charger_still_life(1);
		}
		
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
						  jQuery('#menu_still_life').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'white'});
						  });
		
  });


  
  jQuery('#menu_reportage').click(function() {
  
  
	  jQuery('.un_menu').css({'color':'gray'});
	
		if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_reportage(1);",2000);
		} else {		
		  charger_reportage(1);
		}
		
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
						  jQuery('#menu_reportage').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'white'});
						  });
		  
  });


  
  jQuery('#menu_packshot').click(function() {
	
	jQuery('.un_menu').css({'color':'gray'});
	
	
	  if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_packshot(1);",2000);
		} else {	
		  charger_packshot(1);
		}
		
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
						  jQuery('#menu_packshot').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'white'});
						  });
		  
  });
  



jQuery('#others_videos').click(function() {
	
	jQuery('.un_menu').css({'color':'gray'});
	
	  if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_others_videos();",2000);
		} else {		
		  charger_others_videos();
		}
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
});


jQuery('#others_3d').click(function() {
	
	jQuery('.un_menu').css({'color':'gray'});
	
	  if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_others_3D();",2000);
		} else {		
		  charger_others_3D();
		}
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
});
  


  
  jQuery('#menu_about_us').click(function() {
	
	  jQuery('.un_menu').css({'color':'gray'});
	  
	  
	  if(jQuery('.menu').attr('id')=='menu_bas') {
		  remonter_menu();
		  setTimeout("charger_about_us();",2000);
		} else {		
		  charger_about_us();
		}		
		
		
		
						  jQuery('.un_menu').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'gray'});
						  });
						  
						  
						  jQuery('#menu_about_us').hover(function() {		
								jQuery(this).css({'color':'white'});		  
						  },function() {
								jQuery(this).css({'color':'white'});
						  });
  });
  
  
  
  
  



 							jQuery('#menu_others').hover(function() {		
									jQuery(this).css({'color':'white'});	

										jQuery('#sous_menu_others').css({'display':'block'});
	  
						  },function() {
								jQuery(this).css({'color':'white'});

// 										jQuery('#sous_menu_others').slideUp('slow', function() {
// 									    	// Animation complete.
//   									});

											jQuery('#sous_menu_others').css({'display':'none'});
						  });

  


var the_hash = location.hash;
switch(the_hash) {
	case '#food':
		jQuery('#menu_food').click();
		break;
	case '#still_life':
		jQuery('#menu_still_life').click();
		break;
	case '#reportage':
		jQuery('#menu_reportage').click();
		break;
	case '#packshot':
		jQuery('#menu_packshot').click();
		break;
	case '#videos':
		jQuery('#others_videos').click();
		break;
	case '#3D':
		jQuery('#others_3d').click();
		break;
	case '#about_us':
		jQuery('#menu_about_us').click();
		break;
	default:
		jQuery('#food').click();
		break;
}


jQuery('a[rel*=facebox]').facebox();
  
});
