  bv = parseInt(navigator.appVersion);
  arrSubmenu = new Array();
  nTimeoutId = 0;
  
  if (bv >= 3) ver = "n3"
  else ver = "n2"
	
  if (ver == "n3")
  {
    m1on = new Image();
		m1off = new Image();
    m2on = new Image();
		m2off = new Image();
    m3on = new Image();
		m3off = new Image();
    m4on = new Image();
		m4off = new Image();
    m5on = new Image();
		m5off = new Image();
    m6on = new Image();
		m6off = new Image();
    m7on = new Image();
		m7off = new Image();
    m8on = new Image();
		m8off = new Image();
		
	notaon = new Image();
		notaoff = new Image();		

	m9on = new Image();
		m9off = new Image();		
	m10on = new Image();
		m10off = new Image();		
	m11on = new Image();
		m11off = new Image();		
		
				
		m1on.src = "../images/uvod-on.gif";
		m1off.src = "../images/uvod-off.gif";
		m2on.src = "../images/clen-on.gif";
		m2off.src = "../images/clen-off.gif";
		m3on.src = "../images/repertoar-on.gif";
		m3off.src = "../images/repertoar-off.gif";
		m4on.src = "../images/koncerty-on.gif";
		m4off.src = "../images/koncerty-off.gif";
		m5on.src = "../images/foto-on.gif";
		m5off.src = "../images/foto-off.gif";
		m6on.src = "../images/kontakt-on.gif";
		m6off.src = "../images/kontakt-off.gif";
		m7on.src = "../images/english-on.gif";
		m7off.src = "../images/english-off.gif";
		m8on.src = "../images/deutsch-on.gif";
		m8off.src = "../images/deutsch-off.gif";
		
		notaon.src = "../images/nota-on.gif";
		notaoff.src = "../images/nota-off.gif";
		
		m9on.src = "c-on.gif";
		m9off.src = "c-off.gif";
		m10on.src = "d-on.gif";
		m10off.src = "d-off.gif";
		m11on.src = "e-on.gif";
		m11off.src = "e-off.gif";
						
	}	


	
  function hl(nIx, sSrc)
  {
    if (ver == "n3") 
    {
      imgOn = eval(sSrc + ".src");
      document.images[nIx].src = imgOn;
    }
  }


  
  function Datum_()
  {
		var dtDate = new Date();
		var sDate = dtDate.getDate() + "." + (dtDate.getMonth()+1) + "." + dtDate.getFullYear();
		var eleDatum = document.getElementById("datum");
		eleDatum.innerHTML = sDate;
  }


  
  
  function OpenWindow(sImg, nWidth, nHeight)
  {
		var scrollbars = "no";
		var nWindowWidth = window.screen.width;
		var nWindowHeight = window.screen.height - 48;
			
		if (nWidth > nWindowWidth)
		{
			if (scrollbars == "yes")
			nWidth = nWindowWidth - 16;
			else
			nWidth = nWindowWidth;
			scrollbars = "yes";
		}
				
		if (nHeight > nWindowHeight)
		{
			nHeight = nWindowHeight;
			nWidth = nWidth + 16;
			scrollbars = "yes";
		}
			
		var nTop = (nWindowHeight - nHeight) / 2;
		var nLeft = (nWindowWidth - nWidth) / 2;
			
		var sFeatures = "resizable=no, scrollbars=" + scrollbars + ", status=no, titlebar=yes, toolbar=no, width=" + nWidth + "px, height=" + nHeight + "px, left=" + nLeft + "px, top=" + nTop + "px";
		var a = window.open("photo.htm#image=" + sImg, "_blank", sFeatures, false);
		a.focus();
  }
  


  function ResizeMenu(arrIdsSubmenu)
  {
		var elHorniRoh = document.getElementById("levyhorni");
			
		for (var i=0; i<arrIdsSubmenu.length; i=i+2)
		{			
			var elSubmenu = document.getElementById(arrIdsSubmenu[i]);
		
			if ((elSubmenu) && (elHorniRoh))
				elSubmenu.style.left = elHorniRoh.offsetLeft + arrIdsSubmenu[i+1];
		}
  }



  function SetBackground(sId, nColor)
  {
		var elSubItem = document.getElementById(sId);
			
		if (elSubItem)
		{
			if (nColor == 1)
				elSubItem.style.backgroundColor = "#FBF8FF";
			else
				elSubItem.style.backgroundColor = "";				
		}				
  }


  
  
  function visibleSubmenu(sId, bShow)
  {
			arrSubmenu[sId] = bShow;
			
			if (bShow == true)
			{
				window.clearTimeout(nTimeoutId);
				onTimeout();
			}
			else
				nTimeoutId = window.setTimeout("onTimeout()", 500);
  }
  
  function CloseAll()
  {
		for (name in arrSubmenu)
		{
			arrSubmenu[name] = false;			
			
			var elSubMenu = document.getElementById(name);
			 			
			if (elSubMenu)
				elSubMenu.style.visibility = "hidden";
		}
  }
  
  
  function onTimeout()			
  {
		for (name in arrSubmenu)
		{
			var elSubMenu = document.getElementById(name); 
			
			if (elSubMenu)
			{
				if (arrSubmenu[name] == true)
					elSubMenu.style.visibility = "visible";
					
				else
					elSubMenu.style.visibility = "hidden";
			}				
		}
  }

