// V1.0 du 06/09/04 par jfc

// variables globales d'environnement
var MAC = (navigator.userAgent.indexOf('Mac') >= 0);
var IE = NS4 = NS5 = false;
if (document.all) 
	{IE = true;}
else if (document.layers)
	{NS4 = true;}
else
	{NS5 = true;}

// langue primaire (français ou anglais) pour les messages d'erreur
var FR = EN = false;
if (window.location.pathname.indexOf('/fr/') >= 0)
	{FR = true;}
else if (window.location.pathname.indexOf('/en/') >= 0)
	{EN = true;}
else if (window.location.pathname.indexOf('/nl/') >= 0)
	{EN = true;}
else if (window.location.pathname.indexOf('/it/') >= 0)
	{EN = true;}
else if (window.location.pathname.indexOf('/es/') >= 0)
	{EN = true;}
else if (window.location.pathname.indexOf('/de/') >= 0)
	{EN = true;}
else
	{FR = true;}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function imprimer()
	{
	if (MAC)
		{
		if (FR) alert("Cette fonction n'est pas disponible sur MacIntosh,\nutilisez la fonction impression de votre navigateur");
		else alert("Sorry, not possible on MacIntosh,\nplease use the print button of your browser");
		}
	else {self.print();}
	}

function ferme()
	{
	window.close();
	}
	
function retour_site(url_cible)
	{
	window.opener.document.location = url_cible;
	window.opener.focus();
	window.close();
	}

function TailleAuto()
	// pour ajuster la taille d'une fenetre en gardant la fonction site
	// rajouter ?w=XXX&h=XXX
	// ex : javascript:site('my_pop.htm?w=700&h=300','pop_640')
	// a rajouter dans la balise body de la pop up ONLOAD="javascript:TailleAuto();"
	{
	origine = window.location.search;
	infos_recues = origine.substring(1, origine.length);
		
	tab = infos_recues.split("&");
	width = tab[0];
	height = tab[1];
	
	tab = width.split("=");
	width = tab[1];
	
	tab = height.split("=");
	height = tab[1];
	
	self.resizeTo(width, height)
	//fenetre.focus();
	}

function afficheVignette(cheminVignette,cheminMaxi)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez pour agrandir"></A>');
	}
	
/*function afficheMaxi(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	if (FR) {message = "cliquez pour fermer la fenêtre";} else {message = "click to close the window";}
	html = '<HTML><HEAD><TITLE></TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>';
	html = html + '<CENTER><A HREF="Javascript:OnClick=window.close()">';
	html = html + '<IMG SRC="' + chemin + '" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)" ALT="' + message + '">';
	html = html + '</A></CENTER></div></body></HTML>';

	popupImage = window.open('','fen','left=10,top=10,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
	popupImage.document.open();
	popupImage.focus();
	popupImage.document.write(html);
	popupImage.document.close()
	};*/

// resultatVerif : variable globale résultat des vérifications (true/false)
var resultatVerif = false;

// Fonction de test des adresses email
function verif_email(mel)
	{
	resultatVerif = false;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(mel)) {resultatVerif = true;}
	return resultatVerif;
	}


function visibilite(thingId)
{
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	if (targetElement.style.display == "none")
	{
		targetElement.style.display = "" ;
	} else {
		targetElement.style.display = "none" ;
	}
}

//-->
