// routines menus
// Provided by MyFreeTemplates.com
<!--
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_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_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];}
}
 
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
 
MM_reloadPage(true);
 
 
// script pour cacher l'adresse mail
function WriteLink(aclass, nom, domaine, isimage, srcimg, altimg, textlink) {
  msg='<a class="'+aclass+'" href=\"ma'+'ilto:'+nom+'@'+domaine+'\">';
  if (isimage)
     msg+='<img align="bottom" title="' + altimg + '" src="' + srcimg + '"> ' + textlink;
  else
     msg+=textlink;
  msg+='</a>';
  document.write(msg);
}
 
// routine affichage date
function WriteDate(heure) {
 
var months=new Array(13);
months[1]="Janvier";
months[2]="Février";
months[3]="Mars";
months[4]="Avril";
months[5]="Mai";
months[6]="Juin";
months[7]="Juillet";
months[8]="Août";
months[9]="Septembre";
months[10]="Octobre";
months[11]="Novembre";
months[12]="Décembre";
var days=new Array(7);
days[1]="Dimanche";
days[2]="Lundi";
days[3]="Mardi";
days[4]="Mercredi";
days[5]="Jeudi";
days[6]="Vendredi";
days[7]="Samedi";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var lday=days[time.getDay() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)    // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
document.write(lday + " " + date + " ");
document.write(lmonth + " " + year);
}

// affichage temporaire d'un message sue les flags
function MsgLang(lang) {
	switch (lang) {
		case "en" : message = "I apologize, the translation is not ended yet.\nThe link will be activated as soon as possible.\n\nThank you for your understanding.\n\nGilbert"; break;
		case "de" : message = "Ich entschuldige mich, die Übersetzung ist noch nicht beendet.\n\nDie Linkverzeichnisse wird möglichst schnell aktiviert sein.\n\nDanke für Ihre Auffassungsgabe.\nGilbert"; break;
		case "sp" : message = "Perdóneme, pero la traducción todavía no es acabada.\n\nEl enlace será acelerado cuanto antes.\nGracias por su comprensión.\n\nGilbert"; break;
		default : message = "Je m'excuse, la traduction n'est pas encore terminée.\n\nLe lien sera activé dès que possible.\nMerci de votre compréhension.\n\nGilbert"; break;
	}
		alert (message);
}

// popup
function MyPopup(page,largeur,hauteur) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  //window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
  window.open(page,"","toolbar=no,menubar=no,status=no,location=no,scrollbars=yes,resizable=no,top="+top+",left="+left+",width="+largeur+",height="+hauteur);
}
// agrandissement images
var popupImage='';
    offsX=6;
    offsY=75;
    sz=0;
 
function afficheVignette(cheminVignette,cheminMaxi,info, w, h)
{
data='<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\',\''+info+'\',\''+w+'\',\''+h+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="Cliquez pour agrandir.'
if (info!="0") {data+=' ATTENTION : '+info+' !';}
  data+='"</A>';
 
document.write(data)
}
 
function tidy() {
if (popupImage.location && !popupImage.closed) {
   popupImage.close(); }
}
 
function afficheMaxi(chemin, sz, w, h)
{
i1 = new Image();
i1.src = chemin;
if ((sz==0) || (confirm('Attention, fichier de '+sz+' !!!\nEtes-vous sûr de vouloir l\'agrandir ?')))
{
// sb = 1 si nécessité de scrollbars
if ((w+offsX>screen.width)||(h+offsY>screen.height)) {sb=1} else {sb=0}
html = '<HTML><HEAD><TITLE>Vue agrandie</TITLE><link rel="stylesheet" href="format.css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(Math.min(screen.width,document.imageTest.width+'+offsX+'),Math.min(screen.height,document.imageTest.height+'+offsY+'));"><center><a href="javascript:window.close()" onmouseover="window.status=\'Fermer\';return true" onmouseout="window.status=\'\';return true">Fermer cette fenêtre</a></center></BODY></HTML>';
parms='toolbar=0,location=0,directories=0,menuBar=0,width=400,height=400,left=0,top=0,scrollbars='+sb+',resizable=1';
popupImage = window.open('','_blank',parms);
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close();
}
}

// date de modification
// cette fonction rajoute un  "0" si le nombre est < 10
function ajout0(nombre) { 
  if (nombre < 10) nombre = "0" + nombre; 
  return nombre; 
} 

// cette fonction rajoute un "19" ou un "20" devant l'année
function an(annnee) {
    annnee = annnee - 0;
    if (annnee < 83) return (2000 + annnee);
    if (annnee < 2000) return (1900 + annnee);
    return annnee;
}

// écriture de la chaîne d'affichage de la forme "Jour/Mois/Année"
function MAJ1() {
  var dateModif = new Date(document.lastModified);
  document.write(ajout0(dateModif.getDate()) + "/" 
  + ajout0(dateModif.getMonth()+1) + "/" + an(dateModif.getFullYear()));
}

// sélection du menu lors du passage de l'ancre seulement
function select_item(tag) {
	    parentNode = tag.parentNode
        if (parentNode) {
		if (parentNode.hasChildNodes())
			// So, first we check if the object is not empty, if the object has child nodes
			{
				 var children = parentNode.childNodes;
				 for (var i = 0; i < children.length; i++) 
				 {
				 	 //alert(children[i].id);
				 	 children[i].className="";
				 	 children[i].childNodes[0].className="s";
				 	 if (children[i]==tag) {
				 	 	 children[i].className="current";
				 	 	 children[i].childNodes[0].className="s_selected";
        			 }
                  }
     		}
    }
}
/*
// récupérer l'ancre dans l'URL lors de l'ouverture de la page
function getAnchor(){
 	 var myFile = document.location.toString();
  	 var myAnchor = null;
  	 if (myFile.match('#')) {
 	 	 myAnchor = myFile.split('#')[1];
  	 	 }
    if (myAnchor != null) {
   	   select_item(document.getElementById(myAnchor+'1'));
      //document.getElementById(myAnchor+'1').className="current";
      //document.getElementById(myAnchor+'2').className="s_selected";
   }
}
//-->
*/
