var i, menuId; maxTop=23;
var p = new Array("","","","");
var q = new Array("","","","");

function getNum(str)
	{
	return parseInt(str.substring(0,(str.length-2)));
	}

function slidedown(id)
	{
	e = document.getElementById('hiddenMenu'+id);
	if(getNum(e.style.top) != maxTop)
		{
		if(getNum(e.style.top) >= maxTop)
			{
			window.clearInterval(p[id]);
			p[id] = "";
			}
			else
				{
				posTop = getNum(e.style.top);
				posTop += Math.ceil((maxTop - getNum(e.style.top))/3);
				e.style.top = posTop+'px';
				}
		}
	}

function slideup(id)
	{
	var height = (id == 1) ? 174 : 89; /*89=23-(-66)*/
	var top = (id == 1) ? 151 : 66;
	e = document.getElementById('hiddenMenu'+id);
	if(getNum(e.style.top) != -top)
		{
		posTop = getNum(e.style.top);
		posTop += Math.floor((maxTop - height - getNum(e.style.top))/3);
		e.style.top = posTop+'px';
		}
		else
			{
			window.clearInterval(q[id]);
			q[id] = "";
			e.style.visibility = "hidden";
			}
	}

function showMenu(id)
  {
	e = document.getElementById('hiddenMenu'+id);
	e.style.visibility = "visible";
	window.clearInterval(p[id]);
	window.clearInterval(q[id]);
	p[id] = window.setInterval("slidedown("+id+")",30);
  }

function hideMenu(id)
  {
	e = document.getElementById('hiddenMenu'+id);
	window.clearInterval(p[id]);
	window.clearInterval(q[id]);
	q[id] = window.setInterval("slideup("+id+")",30);
	}

function dontHideMenu(id)
  {
  clearInterval(q[id]);
	showMenu(id);
  }


function changeImgOn(element)
  {
  document.getElementById(element).style.backgroundPosition = 'left -27px';
  }

function changeImgOff(element)
  {
  document.getElementById(element).style.backgroundPosition = 'left top';
  }

function changeImgOnAkt(element)
  {
  document.getElementById(element).style.backgroundPosition = 'left -81px';
  }

function changeImgOffAkt(element)
  {
  document.getElementById(element).style.backgroundPosition = 'left -54px';
  }

function Otevri(co, w, h)
  {
	window.open(co,'','width='+w+',height='+h);
	}