var mTime = [];

function mInit()
{
  var li = document.getElementById('hMenu').getElementsByTagName('li');
  for(a = 0; a < li.length; a++) {
    if(li.item(a).className == 'nadmenu') {
      li.item(a).onmouseover = new Function('zvyr(this, true);');
      li.item(a).onmouseout = new Function('zvyr(this, false);');
    }
  }

  var ul = document.getElementById('hMenu').getElementsByTagName('ul');
  for(a = 0; a < ul.length; a++) {
    ul.item(a).parentNode.onmouseover = new Function('zobr(\'' + ul.item(a).id + '\');');
    ul.item(a).parentNode.onmouseout = new Function('schov(\'' + ul.item(a).id + '\');');
  }
}


function zobr(id)
{
  var licko = document.getElementById(id);

  if (mTime[id]) {
    clearTimeout(mTime[id]);
    mTime[id] = null;
  }
  document.getElementById(id).style.display = 'block';
  licko.parentNode.style.backgroundColor = '#1E5B8F';
}


function schov(id)
{
  mTime[id] = setTimeout('sh(\''+ id +'\');', 20);
}


function sh(id) {
  document.getElementById(id).style.display = 'none';
  var licko = document.getElementById(id);
  licko.parentNode.style.backgroundColor = '#031829';
}




function zvyr(node, stav) {
  if(stav) {
    node.style.backgroundColor = '#1E5B8F';
  } else {
    node.style.backgroundColor = '#031829';
  }
}

