	function ShowGallery(gallery_name, log){

			if (log == undefined) log = true;

			if (document.getElementById('flashcontent')){
			
				var flashvars = {};
				flashvars.galleryURL = "xml/gallery_"+gallery_name+".xml";
	
				var params = {};			
				params.allowfullscreen = false;
				params.allowscriptaccess = "always";
	
				params.bgcolor = "FFFFFF";
				params.wmode = "transparent";
				swfobject.embedSWF("include/simpleviewer/simpleviewer.swf", "flashcontent", "800", "700", "9.0.124", false, flashvars, params);
		  }else	{
		  	window.location = 'index.php?home=1&p=gallery&gal='+gallery_name;
		  }
		  
		  if (log){
		  	//enregistrer dans les stats
		  	statsGallery('DISPLAY', gallery_name);
		  	
		  }
	}

	function ShowActuFlash(){

			if (document.getElementById('flashcontent')){
			
				var flashvars = {};
				flashvars.galleryURL = "xml/actuflash.xml";
	
				var params = {};			
				params.allowfullscreen = false;
				params.allowscriptaccess = "always";
	
				params.bgcolor = "FFFFFF";
				params.wmode = "transparent";
				swfobject.embedSWF("include/simpleviewer/simpleviewer.swf", "flashcontent", "800", "700", "9.0.124", false, flashvars, params);
		  }else	{
		  	window.location = 'index.php?home=1&p=gallery&gal=actuflash';
		  }

	}


	function Popup(page,nom,option) {
		window.open(page,nom,option);
	}


	function contact(){
	
	 	var lienurl = "contact.php";
		Popup(lienurl, 'wcontact', 'resizable=no, location=no, width=600, height=500, menubar=no, status=no, scrollbars=yes');
	
	}
	function cgv(){
	
	 	var lienurl = "cgv.php";
		Popup(lienurl, 'wcontact', 'resizable=no, location=no, width=700, height=600, menubar=no, status=no, scrollbars=yes');
	
	}
	function credits(){
	
	 	var lienurl = "credits.php";
		Popup(lienurl, 'wcredits', 'resizable=no, location=no, width=600, height=800, menubar=no, status=no, scrollbars=yes');
	
	}
	
	function cacher(objetid){
		document.getElementById(objetid).style.display = 'none';
	}
	
	
	function statsGallery(stattype, galleryname){
	
		var xhr=null;
		
		try
		{
			xhr = new XMLHttpRequest(); 
		} catch(e)
		{ 
		try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } 
			catch (e2)
			{ 
				try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } 
				catch (e) {}
			}
		}
		/* ENVOI AJAX POUR STATS : ENREGISTRER LE NOM DE LA GALERIE AFFICHEE */

		//création de la variable contenant les valeurs à passer à la page PHP
		var data = "gal=" + galleryname;
		data+= "&typelog=" + stattype;
		
		//fonction permettant d'afficher le résultat renvoyé par la deuxième page PHP
		xhr.onreadystatechange = function(){
			if (xhr.readyState == 4) {		//ligne obligatoire
				if (xhr.status == 200) {	//ligne obligatoire
				
					//récupération du block dans lequel afficher le résultat de la deuxième page PHP
					//en utilisant xhr.responseText (qui récupère le contenu des echo PHP)*
					//BH PAS d'affichage
					//document.getElementById('tel').value = xhr.responseText;
					if (trim(xhr.responseText) != '') alert("erreur dans la fonction wlog");;
				}else{
					alert("erreur dans la fonction stats");
				}
			}
		};	//ne pas oublier le point-virgule en fin
		
		//ouverture du fichier donné (deuxième page PHP) selon la méthode du formulaire
			//true définit le mode asynchrone de la demande
		xhr.open("POST", "wlog.php", true);
		
		//ligne obligatoire lors d'une ouverture de fichier en méthode POST
		xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		//ligne obligatoire dont la variable doit obligatoirement être définie en méthode POST (cf ligne 32)
			//xhr.send(null) pour une méthode GET
		xhr.send(data);
	}
	
	function trim (myString){ 
		return myString.replace(/^\s+/g,'').replace(/\s+$/g,'') 
	} 
