window.onload=function(){dynMenu("menu",1000)}

//active la feuille de style dynamique
document.getElementsByTagName("link")[0].href="styledyn.css"

dynMenu = function(idMenu,delai) {planq=0;
mu=document.getElementById(idMenu);
dls = mu.getElementsByTagName("dl");
dds = mu.getElementsByTagName("dd");
txd=document.getElementById("text");
txdlnk = txd.getElementsByTagName("a");
if(dds){
  for(var i=0;i<dls.length;i++) {
    dls[i].onmouseover=dls[i].onfocus=function(){
      clearTimeout(planq);
      smenu=this.getElementsByTagName("dd")[0]
      if(smenu){cachetout();smenu.style.display="block"}
    	}
   dls[i].onmouseout=function(){
    if(delai)planq=setTimeout('cachetout()',delai);
  	}
   }
mu.onclick=cachetout;
}
 if(txdlnk){
	for( var ii=0;ii<txdlnk.length;ii++) {
			txdlnk[ii].onclick=function () {
				if(!this.getElementsByTagName('img')[0]){return}
				var picId='bigDynPic';
				var oldp=document.getElementById(picId);
				if(oldp)
				{
				 oldp.parentNode.removeChild(oldp);
				}
				var nc=document.createElement('div');
				this.parentNode.insertBefore(nc,this);
				nc.style.display='none';
				nc.id=picId;
				var newpic=document.createElement('img');
				newpic.src=this.href;
				newpic.alt=this.getElementsByTagName('img')[0].alt;
				newpic.title='Cliquer pour fermer';
				newpic.onclick=function()
				{
				 this.parentNode.parentNode.removeChild(this.parentNode);
				}
				nc.appendChild(newpic);
				np=document.createElement('p');
				np.appendChild(document.createTextNode(this.getElementsByTagName('img')[0].alt));
				nc.appendChild(np);
				nc.style.display='block';			
				return false;
			}
		}
	}
}
function cachetout(){for(var j=0;j<dds.length;j++)dds[j].style.display="none";}

	