var old;
var memold;
var subold;

if(document.layers)
{
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=do_out;
} else
{
document.onmouseup=do_out;
}

function do_out()
{
if(old)
hide_layer(old);
memold=old; old="";
do_submenu();
}

function show_layer(x)
{

if (document.getElementById && document.getElementById(x) != null)

node = document.getElementById(x).style.visibility='visible';

else if(document.layers)
document.layers[x].visibility="show";

else
document.all[x].style.visibility="visible";

}


function hide_layer(x)
{

if (document.getElementById && document.getElementById(x) != null)

node = document.getElementById(x).style.visibility='hidden';

else if(document.layers)
document.layers[x].visibility="hide";
else
document.all[x].style.visibility="hidden";

}


function do_submenu(x)
{

if(subold)
{
hide_layer(subold);
subold="";
}

if(x)
{
show_layer(x);
subold=x;
}

}
function openPicture(imageName) {
  if (window.newWindow) newWindow.close();  
  newWindow = window.open("","Photo","scrollbars,resizable");
  newWindow.document.open();
  newWindow.document.write('<html><title>Vilniaus Miškų Urėdija</title><body bgcolor=#F6FFE7>'); 
  newWindow.document.write('<center><img src='+imageName+' border=1></center>');
  newWindow.document.write('</body></html>');
  newWindow.document.close();
  newWindow.focus();
}