// JavaScript Document

		var ycoor = 0;
		var drag = false;
		var timerDragSlider = null;
		var t_image_taille = [];
		var coompteruSliderImageGalerie =  0;
		var marge = 0;
		var sens = "ouvert";
		var timer = null;
		var lettreOver = null;
		var randPrec = null;
		var controlMoveChangeColor = true;
		var delaiChangeColor = 500;
		var galerieOuvert = false;
		var compteurImagesLoade = 0;
		var compteurImagesisLoade = 0;
		var contenuLoaded = "";
		var controlAjax = true;
		
		var controlCentrage = false;
		
		
		function checkboxImage(ID_section){
		
			if($("#image_"+ID_section).css('display') == "block"){
				$('#section_'+ID_section).attr('checked',false);
				$("#image_"+ID_section).css('display',"none");
				$("#image_"+ID_section+"_nb").css('display',"block");
			} else{
				
				$("#image_"+ID_section).css('display',"block");
				$("#image_"+ID_section+"_nb").css('display',"none");
				$('#section_'+ID_section).attr('checked',true);
				
			}
		}
		
		function checkboxImageRoll(ID_section,valeur){
		
			/*if(valeur == "aller"){
				if($("#image_"+ID_section).css('display') == "block"){
					
					$("#image_"+ID_section).css('display',"none");
					$("#image_"+ID_section+"_nb").css('display',"block");
				} else{
					
					$("#image_"+ID_section).css('display',"block");
					$("#image_"+ID_section+"_nb").css('display',"none");
					
				}
			} else{
				if($('#section_'+ID_section).attr('checked') == "checked"){
					
					$("#image_"+ID_section).css('display',"none");
					$("#image_"+ID_section+"_nb").css('display',"block");
				} else{
					
					$("#image_"+ID_section).css('display',"block");
					$("#image_"+ID_section+"_nb").css('display',"none");
					
				}
				
			}*/
		}
		
		
		function changeFavicon(image) {
			var link = document.createElement('link');
			link.type = 'image/x-icon';
			link.rel = 'shortcut icon';
			link.href = image;
			document.getElementsByTagName('head')[0].appendChild(link);
		};

		
		function cache_actu_tri(id){
			var t_actu = id.split("{#!#}");
			var id_no_present = "";
			var t_box_id_sauv = [];
			$('.box').each(function() {
				var control = false;
				var actu_no_presente = false;
				var t_id = $(this).attr("id").split("_");
				
				for(var i=0 ; i < t_actu.length ; i++){
					
						if(t_actu[i] != ""){
							if(t_id[1] == t_actu[i]){
								control = true;
								break;
							}
						}
				}
				
				if(!control){
					//$(this).css("display","block");
					$(this).fadeOut();
				}else{
					//$(this).css("display","none");
					$(this).fadeIn();
				}
				
				t_box_id_sauv.push(t_id[1]);
				
			});
			
			id_no_present = "?var=var";
			
			for(var i=0 ; i < t_actu.length ; i++){
				control = false;
				for(var y=0 ; y < t_box_id_sauv.length ; y++){
					
					if(t_actu[i] != ""){
						//console.log("I am %s and I have:",t_box_id_sauv[y]+" == "+t_actu[i]);
						
						if(t_box_id_sauv[y] == t_actu[i]){
							control = true;
							
						}
					}
					
					
				}
				
				if(!control){
					if(t_actu[i] != ""){
						id_no_present += "&ID_actu[]="+t_actu[i];
					}
				}
			}
			
			
			$.ajax({
				   type: "POST",
				   url: "tools/getActuWithContener.php",
				   data: id_no_present,
				   success: function(msg){
					   //cache_actu_tri(msg);
					  // $("#recepTemp").html(msg);
					  // $("#recepTemp > .box").css("visibility","visible");
					   //alert($("#recepTemp").html());
					   
					    $("#contenerPrincipal").append( msg);
					   
				   }
				 });
			
			
			if(controlCentrage){
				window.setTimeout("gridDiv.doLayout(true,true)", 500);
			}else{
				window.setTimeout("gridDiv.doLayout(false,true)", 500);
			}
			
			controlCentrage = false;
		}
		
		
		
		function check_all_input(element){
			$("#page").val(1);
			$('.box').css("display","none");
			var t_dimension = returnSize() ;
			var valX = ($('body').innerWidth()-240) / 2;
			var valY = (t_dimension[1]-240)/2;
			$('.box').css("top",valX);
			$('.box').css("left",valY);
			
			$("#loaderPng").fadeIn();
			var tab = t_section__sous_section[element.attr("id")];
			var valeurCheck = ! element.attr("checked");
			controlAjax = false;
			for(var i = 0 ; i < tab.length ; i++){
				if($("#section_sous_"+tab[i]).attr("checked") != element.attr("checked")){
					$("#section_sous_"+tab[i]+"_div_contener_checkbox").trigger("click");
				}
			}
			controlCentrage = true;
			get_nbr_actu();
			window.setTimeout("controlAjax = true;gestion_tri(null)",1000);
		
		}
		
		
		
		function get_nbr_actu(){
			var strData ="";
				for(var i=0; i < t_section_id.length ; i++){
					
					if($("#section_"+t_section_id[i]).attr("checked") == true){
						strData += "ID_section[]="+t_section_id[i];
						if(i != t_section_id.length-1){
							strData += "&";
						}
					}
				}
				
			$.ajax({
				   type: "POST",
				   url: "tools/getNbrActu.php",
				   data: strData,
				   success: function(msg){
					   $("#maxActu").val(msg);
				   }
				 });
			
		}
		
		
		
		
		function gestion_tri(element){
			
			
			
			
			if(controlAjax){
				$("#loaderPng").fadeIn();
				var strData ="";
				for(var i=0; i < t_section_id.length ; i++){
					
					if($("#section_"+t_section_id[i]).attr("checked") == true){
						strData += "ID_section[]="+t_section_id[i];
						if(i != t_section_id.length-1){
							strData += "&";
						}
					}
				}
				
				strData += "&page="+$("#page").val()+"&nombreParPage="+$("#nombreParPage").val();
				
      			
	  			get_nbr_actu();
				$.ajax({
				   type: "POST",
				   url: "tools/getActu.php",
				   data: strData,
				   success: function(msg){
					   cache_actu_tri(msg);
				   }
				 });
			}
			//alert(element.attr("id"));
			if(element != null){
				
				var tab = t_section__sous_section["section_"+t_sous_section_section[element.attr("id")]];
				var compteur = 0;
				
				for(var i = 0; i < tab.length; i++){
					if($("#section_sous_"+tab[i]).attr("checked")){
						compteur++;
					}
					
				}
				
				if(compteur == 0){
					$("#section_"+t_sous_section_section[element.attr("id")]+"_div_contener_checkbox").css("backgroundImage","url(images/checkbox_nok.png)");
					$("#section_"+t_sous_section_section[element.attr("id")]).attr("checked",false);
				}
				if(controlAjax){
					if(compteur > 0){
						$("#section_"+t_sous_section_section[element.attr("id")]+"_div_contener_checkbox").css("backgroundImage","url(images/checkbox_ok.png)");
						$("#section_"+t_sous_section_section[element.attr("id")]).attr("checked",true);
					}
				}
			}
		}

		
		
		
		function returnSize() {
		  var myWidth = 0, myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		  }
		  var result = new Array(myWidth,myHeight);
		  return result;
		}
		
		function prec_galerie(){
			
			
			if(coompteruSliderImageGalerie < 0){
				coompteruSliderImageGalerie = 0;
			}else{
				coompteruSliderImageGalerie--;	
			}
			
			var compt = 0;
			for(var i = 0; i < coompteruSliderImageGalerie ; i ++){
				compt += t_image_taille[i];	
			}
			$("#contenuGalerie").animate({
				scrollLeft: compt
			  }, 500, function() {
				  
			});
			
			
		}
		
		function pourcentageGalerie(pourcentage){
			
			$("#pourcentageGalLoad").html(pourcentage+"%");
			if(pourcentage ==  100){
				$("#pourcentageGalLoad").fadeOut(1000,function(){	
					$("#pourcentageGalLoad").html("X");		
					$("#pourcentageGalLoad").fadeIn();
				});
			}
		}
		
		
		function next_galerie(){
			
			
			if(coompteruSliderImageGalerie >= t_image_taille.length){
				coompteruSliderImageGalerie = t_image_taille.length-1;
			}else{
				coompteruSliderImageGalerie++;
			}
			
			var compt = 0;
			for(var i = 0; i < coompteruSliderImageGalerie ; i ++){
				compt += t_image_taille[i];	
			}
			$("#contenuGalerie").animate({
				scrollLeft: compt
			
			  }, 500, function() {
				  
			});
			
		}
		
		
		function load_galerie(galerie){
			
			var t_loader = [];
			t_image_taille = [];
			compteurImagesLoade = 0;
			compteurImagesisLoade = 0;
			
			var str_all_image = new Array();
			for(var i = 0 ; i < t_galerie[galerie].length ; i++)
			{
				str_all_image += t_galerie[galerie][i];
				if(i != (t_galerie[galerie].length-1)){
					str_all_image += "{#!#}";	
				}
				/*compteurImagesLoade++;
				
				t_loader[i] = new ImageLoader(t_galerie[galerie][i]);
				contenuLoaded = "<table class='table'><tbody class='tbody'><tr class='tr'>";
				 t_loader[i].loadEvent = function(url, image){
					 compteurImagesisLoade++;
					 if(compteurImagesisLoade == compteurImagesLoade){
						 contenuLoaded +="</tbody></tr></table>";
						 $("#contenuGalerie").html(contenuLoaded);
						 
						 
						 $(".imageGalerirMiddle").each(function(){
								t_image_taille.push(this.width);
						  
						  })	
						 
						 $(".next").css("display","block");
						 $(".prec").css("display","block");
						 if($("#contenuGalerie").width() < $("#table").width()){
							$(".next").css("display","none");
							$(".prec").css("display","none");
						 }
													 
					 }
					 contenuLoaded +="<td><img src ='"+url+"' class='imageGalerirMiddle'/></td>";
				   	
				 }
				 t_loader[i].load();*/	
				
			}
			//alert(str_all_image);
			window.setTimeout("appelFlashFonction('"+str_all_image+"')",3000);

		}
		
		function appelFlashFonction(str){
			//alert(str);
			if(document.getElementById("maGalerieFlash")){
				if(typeof(document.getElementById("maGalerieFlash").cMonTabInGalerieFlash)=='undefined') {
					window.setTimeout('document.getElementById("maGalerieFlash").cMonTabInGalerieFlash("'+str+'");',1000);
				}
				else {
					document.getElementById("maGalerieFlash").cMonTabInGalerieFlash(str);
				
				}
			}	
		}
		function open_galerie(){
			var t_dimension = returnSize() ;
			$("#fondGalerie").css("top",(parseInt(t_dimension[1])/2)-($("#fondGalerie").height()/2));
			$(".ongletGalerie").css("top",(parseInt(t_dimension[1])/2)-($("#fondGalerie").height()/2)-($(".ongletGalerie").height()));
			$("#fondGalerie").fadeIn();
			$(".ongletGalerie").fadeIn();
			
			
			place_galerie();
			galerieOuvert = true;
		}
		
		function ferme_galerie(){
			$("#fondGalerie").fadeOut();
			$(".ongletGalerie").fadeOut();
			
			galerieOuvert = false;
		}
		
		function place_galerie(){
			var top =0;
			var t_taille = returnSize();
			top = (t_taille[1]/2 - $("#fondGalerie").height()/2);
			
			
			//$("#fondGalerie").css("top",top+"px");
		}
		
		
		function getRandom(min, max)
		{		
			var randomNum = Math.random() * (max-min); 
		
		// Round to the closest integer and return it
			return(Math.round(randomNum) + min); 
		}
		
    	function cliqueInfo(obj,evt){
			
			 var imageBlock = $(obj).parent().children(".interieurBox").children(".image");
			
				//alert($(element).parent().children(".plusInfo").attr("src"));
				
					if(imageBlock.html() != null){
						
						var element = $(obj).parent().children(".interieurBox").children(".contenerInfo");
						
						if(element.css('display') == 'none'){
							
							element.slideDown("fast",function(){
															  
							$(obj).parent().children(".plusInfo").attr("src", "images/moinsInfo.png");
							
							gridDiv.doLayout(true,false);
							
						 });
						}else{
							element.slideUp("fast",function(){
							
							
							$(obj).parent().children(".plusInfo").attr("src", "images/plusInfo.png");
							
							gridDiv.doLayout(true,false);
							
						 });
						}
					}
				
				evt.stopPropagation(); 
		 }
		 
		 
		function changeColorB(type){
			
			
				 var posY;
				 
			if(type == "rand"){
				var rand = getRandom(1,6);
				
				if(randPrec != null){
					while(rand == randPrec){
						rand = getRandom(1,6);
					}
					
				}
				
				randPrec = rand ;
				if(rand == 1){
					posY = -80;//bleu
				}else if(rand == 2){
					posY = -160;//jaune
				}else if(rand == 3){
					posY = -240;//orange
				}else if(rand == 4){
					posY = -320;//rouge
				}else if(rand == 5){
					posY = -400;//vert
				}
			

				
			 }else{
				
				if(type == "noir"){
					posY = 0;//bleu
				}else if(type == "096ffb"){
					posY = -80;//bleu
				}else if(type == "ffea00"){
					posY = -160;//jaune
				}else if(type == "f39316"){
					posY = -240;//orange
				}else if(type == "fb0936"){
					posY = -320;//rouge
				}else if(type == "43de25"){
					posY = -400;//vert
				}
				
			 }
			 $(".contenerLettres").css('backgroundPosition','0px '+posY+'px');
		}
		 
		function changePositionLettre(){
			var position = $(lettreOver).css('backgroundPosition');
			var height = $(lettreOver).css('height');
			var t_height = height.split("p");
			var t_position = position.split(' ');
			var s_pos = t_position[0];
			var rand = getRandom(1,6);
			
			var diffH = 0;
			var posY;
			if(rand == 1){
				posY = -82;
			}else if(rand == 2){
				posY = -164;
			}else if(rand == 3){
				posY = -244;
				diffH = -1;
			}else if(rand == 4){
				posY = -325;
			}else if(rand == 5){
				posY = -405;
			}
			//Math.rand
			$(lettreOver).css('backgroundPosition',t_position[0]+' '+posY+'px');
			//$(this).css('height',t_height[0]+diffH+'px');	
		}
		
		function autoriseMouveColor(){
			controlMoveChangeColor = true;
		}
		
		
		function sousTitreBaptisteGauthier(texte){
			
			$(".sousTitreBaptisteGauthier").html(texte);
		}
		
		function eclaireArticle(color){
			$('.box').each(function() {
				if($(this).attr("rel") == color){
					overBox(this);
				}
			});
		}
		
		function eteintArticle(color){
			$('.box').each(function() {
					outBox(this);
			});
		}
		
		
		function overBox(element){
					$(element).css('borderColor', '#'+$(element).attr('rel'));
						changeColorB($(element).attr('rel'));
						
						$(element).children(".interieurBox").children(".image").children(".image1bloc").css("z-index",3);
						$(element).children(".interieurBox").children(".image").children(".image2bloc").css("z-index",4);
						$(element).children(".image_coin_gris").css("visibility","hidden");
						
						$(element).children(".interieurBox").children(".contenerInfo").children(".titre").css("color",'#'+$(this).attr('rel'));
						
						
						
						$(element).children(".interieurBox").children(".imageMiniContener").children(".imageMini").children(".imageMini1").css("display","none");
						$(element).children(".interieurBox").children(".imageMiniContener").children(".imageMini").children(".imageMini2").css("display","block");
						
						sousTitreBaptisteGauthier($(element).attr('alt'));
						
						changeFavicon("http://www.baptiste-gauthier.fr/dev/images/b_"+$(element).attr('rel')+".ico");
				}
				
				function outBox(element){
					$(element).css('borderColor', '#666666');				
						$(element).children(".interieurBox").children(".image").children(".image1bloc").css("z-index",4);
						$(element).children(".interieurBox").children(".image").children(".image2bloc").css("z-index",3);
						$(element).children(".image_coin_gris").css("visibility","visible");
						
						$(element).children(".interieurBox").children(".contenerInfo").children(".titre").css("color",'#FFFFFF');
						
						$(element).children(".interieurBox").children(".imageMiniContener").children(".imageMini").children(".imageMini1").css("display","block");
						$(element).children(".interieurBox").children(".imageMiniContener").children(".imageMini").children(".imageMini2").css("display","none");
						//changeColorB("noir");
						//changeFavicon("http://www.baptiste-gauthier.fr/dev/images/favicon.ico");
				}
				
				
			var gridDiv = {
				COLNUMBER : 2, // Minimum column number.
				COLMARGIN : 10, // Margin (in pixel) between columns/boxes.
				COLWIDTH : 240, // Fixed width of all columns.
				doLayout : function(anim,first) {
					var self = this;
					var pointer = 0;
					var arr = [];
					var t_dimension = returnSize() ;
					var hauteurMax = 0;
					var columns = Math.max(this.COLNUMBER, parseInt(t_dimension[0] / (this.COLWIDTH + this.COLMARGIN)));
					$("#loaderPng").fadeOut();
					$('.box').css('position', 'absolute').css('width', this.COLWIDTH  + 'px');
					var compteur = 0;
					var compteurBox = 0;
					
								$('.box').each(function() {
									
									
									
										if($(this).css("display") != "none"){		
										/*compteurBox++;
												if(first){				
												
													//$(this).css('position', 'absolute').css('left', '0px');
													//$(this).css('position', 'absolute').css('top', 'Opx');
								
													var valX = ($('body').innerWidth()-240) / 2;
													var valY = (t_dimension[1]-240)/2;
													
													
													$(this).css('left', valX);
													$(this).css('top', valY);
													
													//$(this).css('top',0);
													
													
													
												}
												
												var tempLeft = (pointer * (self.COLWIDTH + self.COLMARGIN));
						
												var tempTop = 0;
												
												if (arr[pointer]) { tempTop = arr[pointer];	}
												
												
												
												if(anim){
													$(this).animate({
														left: tempLeft,
														top: tempTop
													  }, 500, function() {
														// Animation complete.
													  });
												}else{
													$(this).css('top', tempTop + 'px');
													$(this).css('left', tempLeft + 'px');
												}
												arr[pointer] = tempTop + $(this).outerHeight() + self.COLMARGIN;
												
												hauteurMax = Math.max(arr[pointer], hauteurMax);
												
												pointer++;
												if (pointer === columns) { pointer = 0; }*/
												
												
												compteur++;
				var tempTop;
				var tempLeft;
			
				if (compteur <= columns) { 
					
					tempTop = 0;
					arr[pointer] = $(this).height()+self.COLMARGIN;
					tempLeft = (pointer * (self.COLWIDTH + self.COLMARGIN));
					pointer++;
					
				}else{
					
					tempTop = arr[0] ;
					indice = 0;
					for(var i = 1 ; i  < arr.length ; i++){
						if(tempTop > arr[i]){
							tempTop = arr[i];
							indice = i;
						}
					}
					tempLeft = (indice * (self.COLWIDTH + self.COLMARGIN));
					arr[indice] += $(this).height()+self.COLMARGIN;
				
				}
				
				$(this).css('top', tempTop + 'px');
				$(this).css('left', tempLeft + 'px');
				 
				
				if (pointer === columns) { pointer = 0; }
													
										}
									});
									
									var m = 15;
									if(sens == "ouvert"){
										m = 105;
									}
									
									var difference = $('body').innerWidth() - (columns*(self.COLWIDTH + self.COLMARGIN)); 
									$("#contenerPrincipal").css("top",m+Math.ceil(difference/2)+"px");
									$("#contenerPrincipal").css("left",Math.ceil(difference/2)+"px");
									
									marge = Math.ceil(difference/2);
									//$("#btnPlublicationPlusAncienne").css("top",hauteurMax+150);
									
									//alert(compteurBox+" == "+$("#maxActu").val())
									if(compteurBox == $("#maxActu").val()){
										//$("#btnPlublicationPlusAncienne").css("display", "none");
									}else{
										//$("#btnPlublicationPlusAncienne").css("display", "block");
									}
									
				}
			};
			
			
			
			
			
			
			
			
			
			
			
			
			
			$(window).ready(function() {
				gridDiv.doLayout(true,true);
				
				
				
				var flashvars = {};
			
				var  params = {
						  wmode: "transparent"
						 };
					
				var attributes = {
					  id: "maGalerieFlash",
					  name: "maGalerieFlash"
					 };
		
				swfobject.embedSWF("swf/slider.swf", "contenerFlashGalerie", "100%", "400", "9.0.0","/js/swfobject/expressInstall.swf", flashvars, params, attributes);
				
				
				
				
				var options = {
				   	img_check: "images/checkbox_ok.png",
				   	img_no_check: "images/checkbox_nok.png",
					width : 24,
					height: 24,
					onchange: check_all_input,
					check : true
				};
				
				$(".tri_block").checkbox(options);
				
				
				var options = {
				   	img_check: "images/checkbox_ok_mini.png",
				   	img_no_check: "images/checkbox_nok_mini.png",
					width : 12,
					height: 12,
					onchange : gestion_tri,
					check : true
				};
				
				$(".tri_sous_block").checkbox(options);
				
				
				
				
				
				
				
				
				
				
				
				
				
				//listener
				$('.box').click(function(e){
										 
					if (!e) var e = window.event;
					
					var targ;
					if (!e) var e = window.event;
					if (e.target) targ = e.target;
					else if (e.srcElement) targ = e.srcElement;
					if (targ.nodeType == 3) // defeat Safari bug
						targ = targ.parentNode;

	

					if(targ.height < 90 || typeof(targ.height) == "undefined"){
						var type = "";
						if(typeof($(this).attr("lang")) != "undefined"){
							
							type = $(this).attr("lang").split("_");
						}
						
						if(type.length != 2){
							if(typeof($(this).children(".nyroModal").attr("href") != "undefined" && $(this).children(".nyroModal").attr("href") != "undefine" && $(this).children(".nyroModal").attr("href") != "")){
								$(this).children(".nyroModal").trigger('click');
							}
						}else{
							//galerie mode
							open_galerie();
							load_galerie(type[1]);
							
							
						}
					}
					
				});
				
				
				$('.plusInfo').click(function(evt){cliqueInfo(this,evt); });
				$('.image_coin').click(function(evt){cliqueInfo(this,evt); });
				$('.image_coin_gris').click(function(evt){cliqueInfo(this,evt); });
				$('.close').click(function(evt){ferme_galerie(); });
				 
				 
				$('.next').click(function(evt){next_galerie(); });
				$('.prec').click(function(evt){prec_galerie(); });
				
				
				
				
				$('.box').mouseover(function(){							 
						overBox(this);
						
				});
				
				$('.box').mouseout(function(){	
						outBox(this);
				});
				
				
				$('#contenuGalerieDessus').mousedown(function(evt){		
					slideDragIn(this,evt);	
				});
				
				$('#contenuGalerieDessus').mouseup(function(evt){	
						slideDragOut(this,evt);	
				});
				
				$('#contenuGalerieDessus').mousemove(function(evt){	
						slideDragMove(this,evt);	
				});
				
				
				
				$("#btnPlublicationPlusAncienne").click(function(){
					$("#page").val(parseInt($("#page").val())+1);
					gestion_tri(null);
				});
				
				/*$('.lettre').mouseover(function(){							 
						lettreOver = this;
						changePositionLettre();
						//alert('entre');
						
				});*/
				
				
				/* TODO erreur IE 
				$('.contenerLettres').mouseover(function(){	//changeColorB("rand");});
				$('.contenerLettres').mousemove(function(){	
						if(controlMoveChangeColor){
							 changeColorB("rand");
							 controlMoveChangeColor = false;
							 window.setTimeout("autoriseMouveColor()",delaiChangeColor);
						}
														
				});*/
				
				
				
				
				/*
				
				$('.fleche').click(function(){
					if($(this).parent().css('height') == "19px"){
						
						sens = "ouvert";
						
						$(this).parent().animate({
							height: "80px"
						  }, 500, function() {
							$(this).children(".fleche").css('backgroundImage',"url(images/up.png)");
						});
						
					
						$(this).parent().parent().children("#contenerPrincipal").animate({
							top: (80+marge)+"px"
						  }, 500, function() {
							$(this).children(".fleche").css('backgroundImage',"url(images/up.png)");
						});
						
						
						return false;
					}
						
						sens = "fermer";
					
						$(this).parent().animate({
							height: "19px"
						  }, 500, function() {
							$(this).children(".fleche").css('backgroundImage',"url(images/down.png)");
						});
						
					
						$(this).parent().parent().children("#contenerPrincipal").animate({
							top: (marge+10)+"px"
						  }, 500, function() {
							$(this).children(".fleche").css('backgroundImage',"url(images/up.png)");
						});
						
						
					
				});
				*/
				
				
			}).resize(function() {
				gridDiv.doLayout(false,false);
				if(galerieOuvert){
					place_galerie();
				}
				
			});
			
			
			
/*			
			
			var mc : MovieClip = evt.target as MovieClip;
	var other : MovieClip;
	var dist : Number;
	var dx : Number;
	var dy : Number;
	var angle:Number;
	
	// photo par dessus les autres
	album.setChildIndex(mc, album.numChildren-1);
	// scale plus gros
	mc.scaleX = mc.scaleY = 1.5;
	
	// écartement radial des autres photos
	for (var i=0; i<album.numChildren-1; i++){
		other = album.getChildAt(i) as MovieClip;
		if (other != mc){
			dx = other.xi - mc.xi;
			dy = other.yi - mc.yi;
			dist = Math.sqrt(dx*dx + dy*dy) + 30;
			
			angle = Math.atan2(dy, dx);
			other.x = mc.xi + dist * Math.cos(angle);
			other.y = mc.yi + dist * Math.sin(angle);
		}
	}
*/
