// Property Indexes
var piName = 0, piURL = 1, piItems = 2;

var arrMenus = [
  ['Capabilities', '', [
    ['IT Support', '/capabilities/it_support.php'],
    ['Application Development', '/capabilities/app_develop.php'],
    ['CIO Strategy', '/capabilities/cio_strategy.php']
  ]],
  ['Case Studies', '', [
    ['Mercedes-Benz', '/casestudies/mbusa.php'],
    ['Kraft Foods', '/casestudies/kfi.php'],
    ['HSBC Bank', '/casestudies/hsbc.php'],
    ['Connecticut Bar Association', '/casestudies/ctbar.php'],
    ['Manhattan Mortgage', '/casestudies/mm.php'],
    ['Sabo Media', '/casestudies/sabo.php']
  ]],
  ['About Us', '/about/', [
    ['Acentric Management', '/about/management.php'],
    ['IT Philosophy', '/about/it_philosophy.php'],
    ['Contact Us', '/about/contact.php']
  ]],
  ['Team Engine', 'https://teamengine.net']
];

//var arrMenus = [
//  ['Capabilities', '/capabilities/', [
//    ['Business Software Solutions', '/capabilities/softsol.php'],
//    ['Technology Advisory Services', '/capabilities/advisory.php']
//  ]],
//  ['Case Studies', '/casestudies/', [
//    ['HSBC Bank', '/casestudies/hsbc.php'],
//    ['Mercedes-Benz', '/casestudies/mbusa.php'],
//    ['Connecticut Bar Association', '/casestudies/ctbar.php'],
//    ['Merrill Lynch', '/casestudies/merrill.php'],
//    ['Kraft Foods', '/casestudies/kfi.php'],
//    ['Republic National Bank', '/casestudies/rnbimg.php'],
//    ['Manhattan Mortgage', '/casestudies/tmmc.php']
//  ]],
//  ['About Acentric', '/about/', [
//    ['Acentric Management', '/about/management.php'],
//    ['Contact Acentric', '/about/contact.php']
//  ]],
//  ['Client Login', 'https://teamengine.net']
//];

var arrTimeoutIDs = new Array(arrMenus.length);

function ShowItems(intMenuID) {
  var objMenu = document.getElementById('objMenu' + intMenuID);
  objMenu.getElementsByTagName('A')[0].className = 'clsMenuHeaderOver';
  var objDIV = objMenu.getElementsByTagName('DIV');
  if (objDIV.length > 0)
    objDIV[0].style.display = '';
}

function HideItems(intMenuID) {
  var objMenu = document.getElementById('objMenu' + intMenuID);
  objMenu.getElementsByTagName('A')[0].className = 'clsMenuHeader';
  var objDIV = objMenu.getElementsByTagName('DIV');
  if (objDIV.length > 0)
    objDIV[0].style.display = 'none';
}

var strMenu = '';
for (var i = 0; i < arrMenus.length; i++) {
  var strEvents = ' onmouseover="clearTimeout(arrTimeoutIDs[' + i + ']); ShowItems(' + i + ')"' +
    ' onmouseout="arrTimeoutIDs[' + i + '] = setTimeout(\'HideItems(' + i + ')\', 100)"';
  strMenu += '<td id=objMenu' + i + '><a href="' + arrMenus[i][piURL] + '" class=clsMenuHeader' +
    (arrMenus[i][piItems] == null ? ' target=_blank' : '') + strEvents + '>' +
    '<img src="/images/clear.gif" width=0px height=100% align=absmiddle>' +
    '<img src="/images/icon-logo.gif" class=clsMenuImage align=absmiddle>' + arrMenus[i][piName] + '</a>';
  if (arrMenus[i][piItems] != null) {
    strMenu += '<div class=clsMenuItems style="display: none"' + strEvents + '>';
    for (var j = 0; j < arrMenus[i][piItems].length; j++)
      strMenu += '<a href="' + arrMenus[i][piItems][j][piURL] + '">' +
        '<img src="/images/clear.gif" width=0px height=100% align=absmiddle>' +
       	 arrMenus[i][piItems][j][piName] + '</a>';
    strMenu += '</div>';
  }
  strMenu += '</td>';
}
document.write('<table class=clsMenu cellpadding=0 cellspacing=0><tr>' + strMenu + '</tr></table>');
