var openImg = 'pics/open.gif'; var closeImg = 'pics/closed.gif'; function preload(){ /* if(document.images){ Open = new Image(20,20); Closed = new Image(29,20); Open.src = "obrazky/open.gif"; Closed.src = "obrazky/closed.gif"; } */ } function encodeN(cislo) { if (cislo<10) return "0"+cislo; else return "" + cislo; } // open/close a specific folder function toggle(item){ var elt = document.getElementById('menu'+encodeN(item)); var obr = document.getElementById("obr" + encodeN(item)); if (elt.style.display == 'none'){ // if it's closed, open it elt.style.display = ''; obr.src = openImg; } else { elt.style.display = 'none'; // if it's open, close it obr.src = closeImg; } }