// JavaScript Document

function showmenu(id)
{
		document.getElementById(id).style.visibility  = 'visible';

}

function hidemenu(id)
{
		document.getElementById(id).style.visibility  = 'hidden';
}

function menu_show(menu)
{
	document.getElementById('menu1').style.display='none';
	document.getElementById('menu2').style.display='none';
	document.getElementById('menu3').style.display='none';
	document.getElementById('menu4').style.display='none';
	document.getElementById('menu5').style.display='none';
	document.getElementById('menu6').style.display='none';
	document.getElementById(menu).style.display='inline';
}

function menu_hide(menu)
{
	document.getElementById(menu).style.display='none';
}

function wopen(url,name,w,h)
    { w=window.open(url,name,"width="+w+",height="+h+",resizable=yes,toolbar=0,location=0,status=0,menubar=0,directories=0,scrollbars=yes");
w.focus();
    }

    

function show(opa){
var dvTop  =document.getElementById("Top");
var dvCount=document.getElementById("Count");
if(dvTop){ dvTop.style.visibility='';}
if(dvCount){ dvCount.style.visibility='';}
}

function show_all(){
onl=1;
// задержка отображения меню и картинок.
setTimeout('show(0)',0);
}





function mnu(wh,sh,color){
var mn=document.getElementById("smm"+wh);
if(sh)mn.style.background=color;
else mn.style.background="";
}

var i;
var t;
var onl=0;

function set_i(num,on_off){
if(!onl) return;

var d;


 d=document.getElementById("sm"+num);

// If we want show submenu and 'open' image for menu
if(on_off)
 {
  // Hide all submenus
  all_off();

  // Clear timeout for hide last selected submenus
  clearTimeout(t);


  // Show submenu if menu have it
  d.style.visibility='visible';
  d.style.display='block';
 }

// or we want hide menu and submenu
else
 {
  // Start timeout for submenu and close menu if mouse cursor is out

  off(num);
 }
}



// Start timeout for current submenu, can't work if user choise other menu
function off(num)
 {
  t=setTimeout("document.all.sm"+num+".style.visibility='hidden';document.all.sm"+num+".style.display='none';",500);
 }


// Hide all submenus
function all_off()
 {
  for(var i=1;i<=10;i++)
    {
     var id=document.getElementById("sm"+i);
     if(id){id.style.visibility='hidden';id.style.display='none';}
    }
  }

