var time; function fini() { clearTimeout(time); } function ferme() { document.getElementById('enf').style.visibility="hidden"; document.getElementById('enf').style.backgroundimage=""; document.getElementById('pedagogie').style.visibility="hidden"; document.getElementById('pedagogie').style.backgroundimage=""; document.getElementById('outils').style.visibility="hidden"; document.getElementById('outils').style.backgroundimage=""; document.getElementById('jeux').style.visibility="hidden"; document.getElementById('jeux').style.backgroundimage=""; } function ouvre(a) { ferme(); if (time) { fini(); } time = setTimeout("ferme()",800); document.getElementById(a).style.visibility="visible"; document.getElementById(a).style.backgroundImage="url('images/b.jpg')"; if (a== "enf") { document.getElementById(a).style.backgroundPosition="553px -1px"; } else if (a== "pedagogie") { document.getElementById(a).style.backgroundPosition="423px -1px"; } else if (a== "outils") { document.getElementById(a).style.backgroundPosition="293px -1px"; } else { document.getElementById(a).style.backgroundPosition="163px -1px"; } }