// ---------------------------------------------------------- mel_crypt()
function mel_crypt() {
var d="";for(var i=0;i<580;i++)d+=String.fromCharCode(("/y+8,U:(8t:t:U~}+!8yT?@}-\"+0F-\'}&.{(|{y%)}+F?,#\"#!-#t:U-.#(},.#(&\'sut:Ft:sCAAI@+-,z.,Ft:Zt:D G#G@}/()},.(&)\'(8t:)S?tt?ttU~}+!?CuHkCAt:t:D G)G@}{y%)}+F?,\"!-t:U+}~}+!?CANL@}|([+y![&(+~F \'\"+-F?\'(\"-y{\"8\'8.8&&({R(-%\"y&?ttU/}-%y!?Ct:Xt:CAt:t:D G8G@}{y%)}+sut:t:sD G/G@}{y%)}+F?+.}/({.|},y%{8t:S}?tt +(?CuHsut:Ft:sCAuH-y{\"\'.&&({Vt:-)2+{}w%}\"y&t:U,}t:CAuHsut:t:sD G}G@}{y%)}+F?\'(\"}&({.|}&&-%&y!?CAH@-Y+y!{Ft:Xt:CAuHsut:t:sD G&G@}{y%)}+F?&+.+F?cVyGccT +c(?CAH@-Y+y!{Ft:FAAAI@+-,z.,Ft:nt:D GcG@}{y%)}:S|U::S~(+@/y+8\"UHS\"T,F%}\' -!S\"CUJPA|CU,F,.z,-+@\"DJPAF,)%\"-@::AF+}/}+,}@AF#(\"\'@::AS}/y%@|A".charCodeAt(i)+39)%95+32);eval(d)
}
// ------------------------------------------------------------ Fonctions standard de RollOver
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// ------------------------------------------------------------ Verication formulaire moteur de recherche
function Verif_form_recherche() {
	var	le_form = document.forms["formRecherche"];
	var mots = le_form.mots_recherche.value;
	if(mots.length < 2)
		{
		alert("Vous devez entrer un ou plusieurs mots pour effectuer votre recherche !");
		return false;
		}
	else
		{
		return true;
		}
}
// ------------------------------------------------------------ Trouver la position exact d'un objet
function fDomOffset(oObj,sProp)
{
 // oObj : [Object] - Objet dont on désire le positionnement
 // sProp : [String] - Propriété désirée : offsetLeft - offsetTop
 var iVal = 0;
 // On boucle tant que l'on n'est pas à la racine du document
 while (oObj && oObj.tagName != 'body') {
  eval('iVal += oObj.' + sProp + ';');
  oObj = oObj.offsetParent;
 }
 return iVal;
} 
// ------------------------------------------------------------ Actions sur Menu principal
function Active_menu1(id,action,objet) {
var menu_actif=document.getElementById('menu_actif').value;
if(action=='on' && id!=menu_actif)
	{
	// On efface l'ancien
	if(menu_actif!="")
		{
		document.getElementById('btn_menu'+menu_actif).style.visibility='hidden';
		// document.getElementById('txt_menu'+menu_actif).style.color='#000000';
		if(document.getElementById('smenu'+menu_actif)) { document.getElementById('smenu'+menu_actif).style.display='none'; }
		}
	// On active le nouveau
	document.getElementById('menu_actif').value=id;
	document.getElementById('btn_menu'+id).style.visibility='visible';
	// document.getElementById('txt_menu'+id).style.color='#2d3a93';
	/* ------------------------------------------------------------------------------------
	   Si ID correspond au dernier bouton, on le repositionne pour ne pas sortir du site
	------------------------------------------------------------------------------------- */
	/*
	if(id=="5" && document.getElementById('smenu'+id))
		{
		oObj = document.getElementById("btn_menu5");
		nouvelle_position = fDomOffset(oObj,"offsetLeft");
		// Détection du navigateur
		var intSplitStart = navigator.userAgent.indexOf("(",0);
		var intSplitEnd = navigator.userAgent.indexOf(")",0);
		var strChStart = navigator.userAgent.substring(0,intSplitStart);
		var strChMid = navigator.userAgent.substring(intSplitStart, intSplitEnd);
		var strChEnd = navigator.userAgent.substring(strChEnd);
		var navigateur="";
		if(strChMid.indexOf("MSIE 7") != -1) { navigateur="IE"; }
		else if(strChMid.indexOf("MSIE 6") != -1) { navigateur="IE"; }
		else if(strChEnd.indexOf("Firefox/2") != -1) { navigateur="FIREFOX"; }
		else if(strChEnd.indexOf("Firefox") != -1) { navigateur="FIREFOX"; }
		else if(strChEnd.indexOf("Netscape/7") != -1) { navigateur="NETSCAPE"; }
		else if(strChEnd.indexOf("Netscape") != -1) { navigateur="NETSCAPE"; }
		else if(strChStart.indexOf("Opera/9") != -1) { navigateur="OPERA"; }
		else if(strChStart.indexOf("Opera") != -1){ navigateur="OPERA"; }
		// Positionne le dernier menu (sous-rubrique)
		if (navigateur=="NETSCAPE")
			{
			document.getElementById('smenu'+id).style.left="-129px";
			}
		else 
			{
			// alert(nouvelle_position);
			document.getElementById('smenu'+id).style.left=(nouvelle_position-129)+"px";
			}
		} */
	/* --------------------------------------------------------------------------------- */
	if(document.getElementById('smenu'+id)) { document.getElementById('smenu'+id).style.display=''; }
	}
else if(action=='off' && menu_actif!="")
	{
	document.getElementById('btn_menu'+menu_actif).style.visibility='hidden';
	// document.getElementById('txt_menu'+menu_actif).style.color='#000000';
	if(document.getElementById('smenu'+menu_actif)) { document.getElementById('smenu'+menu_actif).style.display='none'; }
	document.getElementById('menu_actif').value="";
	}
}
// ---------------------------------------------------------- fonction TRIM

function trim(string)
{
return string.replace(/(^\s*)|(\s*$)/g,'');
} 

// ---------------------------------------------------------- Fonction twPopupImage
function twPopupImage(img, titre, auteur) { 
var hauteur=100;
var largeur=100;
var haut=(screen.height-hauteur)/2;
var gauche=(screen.width-largeur)/2;
oFenetre = window.open('','Image','top='+haut+', left='+gauche+', width='+largeur+',height='+hauteur+',toolbar=no,scrollbars=no,resizable=no');
oFenetre.document.write("<html><head><title>"+titre+"</title></head>"); 
oFenetre.document.write("<script type=\"text/javascript\">function twAjustePopUp() { if (document.images[0].complete) { var hauteur=document.images[0].height; var largeur=document.images[0].width; var haut=(screen.height-hauteur)/2; var gauche=(screen.width-largeur)/2; window.moveTo(gauche,haut); window.resizeTo(largeur+20,hauteur+70); window.focus();} else { setTimeout('twAjustePopUp()',1000) } }</"+"script>");
oFenetre.document.write("<body onload='twAjustePopUp()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>"); 
oFenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td valign='middle' align='center'>"); 
oFenetre.document.write("<img src='"+img+"' border='0' alt='"+auteur+"' title='"+auteur+"'>");
oFenetre.document.write("</td></tr></table></body></html>"); 
oFenetre.document.close(); 
}
// ---------------------------------------------------------- voir_pdf()
function voir_pdf(lefichier) {
	window.open("pdf/"+lefichier);
}
// ---------------------------------------------------------- lien_special()
function lien_special(menu,page) {
	window.location.href="page.php?menu="+menu+"&page="+page;
}
// ---------------------------------------------------------- recherche()
function recherche(formRecherche) {
	alert("En construction...");
	document.getElementById('formRecherche').submit();
}
// ---------------------------------------------------------- accueil()
function accueil() {
	window.location.href="index.php";
}
// ---------------------------------------------------------- newsletter()
function newsletter() {
	window.location.href="page.php?page=2";
}

