//<![CDATA[

var mItemShowing = null;
var mItemParent = null;

var menuItems = new Array();
menuItems[0] = 'l-m-o-nas';
menuItems[1] = 'l-m-produkty';
menuItems[2] = 'l-m-sluzby';
menuItems[3] = 'l-m-obchod';
menuItems[4] = 'l-m-certifikaty';
menuItems[5] = 'l-m-mzdy';

function hideAllMenuItems () {
  if (document.getElementById) {
    for (i=0; i<menuItems.length; ++i) {
      var mItem = document.getElementById(menuItems[i]);
      hideMenuItem(mItem, null);
    }
  }
}

function showHideMenuItem (e, itemId, parent) {
  if (!e) {
    e = window.event; 
  }
  e.cancelBubble = true;
  if (e.stopPropagation) e.stopPropagation();
  if (document.getElementById) {
    var mItem = document.getElementById(itemId);
    if (mItem) {
      if (!parent) {
        if (mItem.parentNode) {
          parent = mItem.parentNode.firstChild;
        }
      }
      var show = true;
      if (mItem == mItemShowing) {
        show = false;
      }
      hideMenuItem(mItemShowing, mItemParent);
      if (show) {
        showMenuItem(mItem, parent);
      }
    }
  }
}

function highlightSingleMenuItem (itemId) {
  if (document.getElementById) {
    var mItem = document.getElementById(itemId);
    if (mItem) {
      mItem.className = 'highlighted';
    }
  }
}

function hideMenuItem (item, parent) {
  if (item) {
    item.style.display = 'none';
    if (parent) {
      parent.className = '';
      mItemParent = null;
    }
    mItemShowing = null;
  }
}

function showMenuItem (item, parent) {
  if (item) {
    item.style.display = 'block';
    if (parent) {
      parent.className = 'highlighted';
      mItemParent = parent;
    }
    mItemShowing = item;
  }
}

//]]>
