var imgclip;
var cliptxt;
var textevu = 'rien';
var photonum = 1;
var maxphoto = 5;

var nommois = new Array();
nommois[0] = "janvier"; nommois[1] = "février";
nommois[2] = "mars"; nommois[3] = "avril";
nommois[4] = "mai"; nommois[5] = "juin";
nommois[6] = "juillet"; nommois[7] = "août";
nommois[8] = "septembre"; nommois[9] = "octobre";
nommois[10] = "novembre"; nommois[11] = "décembre";

function changePhoto(numph) {
   var lasource = 'url(imagesbig/photo' + numph + '.jpg)';
   imgclip = document.getElementById("photohome");
   imgclip.style.background = lasource;

   cliptxt = "texteclip" + numph;
   document.getElementById(cliptxt).style.display = "block";
   textevu = cliptxt;}

function boucleimg() {
   photonum += 1;
   if (photonum > maxphoto) photonum = 1;
   if (textevu != 'rien') document.getElementById(textevu).style.display = "none";
   changePhoto(photonum);
   delai = setTimeout("boucleimg()", 6000);
}

function initbcle() {
   photonum = Math.floor(maxphoto*Math.random());
   boucleimg();
}

// Affichage du mois et de l'année
function lemois() {
   var cejour = new Date();
   var yoyo = cejour.getYear();
   if (yoyo < 1000) yoyo = yoyo + 1900;
   document.write(nommois[cejour.getMonth()]," ",yoyo);
}

// Gestion des pages des sous rubriques ::::::::::
function pagechoix() {
   var lien = 'fiche01';
   adr = window.location.href;
   var exp1=new RegExp("[&?]+","g");
   var exp2=new RegExp("[=]+","g");
   var tabNom=adr.split(exp1);
   if (tabNom.length > 1) {
      var tabParam=new Array();
      for (var i=1;i<tabNom.length;i++) {
         var tabTemp=tabNom[i].split(exp2);
         tabParam[tabTemp[0]]=tabTemp[1];
      }
   lien=tabParam['page'];
   }
   lien = lien + '.html';
   pagechange(lien);
}

function pagechange(url) {
   var req = null;
   if(window.XMLHttpRequest) req = new XMLHttpRequest();
   else
   if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP");
 
   // On ouvre la requete vers la page désirée
   req.open("GET", url, true);
   req.onreadystatechange = function(){
      if ( req.readyState == 4 ) {
         // On affiche dans la DIV spécifiée le contenu retourné par le fichier
         document.getElementById('contenu').innerHTML = req.responseText;
      }
   }
   req.send(null);
}

function instructions (src) {
   var ch = "consignes/" + src + ".html";   size = ",width=500, height=600";   fenetre = open(ch,'',"scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no,location=no,directories=no"+size)}

// Accès à la galerie de photos
function diaporama(num) {
   src="galerie.html?dianum=" + num;   fenetre = open(src,"","scrollbars=no,resizable=yes,toolbar=no,status=no,menubar=no,location=no,directories=no,width=600,height=650");}

