// create navigation containers
var navigation = new Object();

// comp
navigation.comp = new Array();
  navigation.comp[0] = new Object();
  navigation.comp[0].width = 85;
  navigation.comp[0].name  = 'About Us';
  navigation.comp[0].url   = 'company.html';

  navigation.comp[1] = new Object();
  navigation.comp[1].width = 115;
  navigation.comp[1].name  = 'Health & Safety';
  navigation.comp[1].url   = 'health.html';

// serv
navigation.serv = new Array();
  navigation.serv[0] = new Object();
  navigation.serv[0].width = 135;
  navigation.serv[0].name  = 'Project Management';
  navigation.serv[0].url   = 'project__man.html';

  navigation.serv[1] = new Object();
  navigation.serv[1].width = 85;
  navigation.serv[1].name  = 'Upgrades';
  navigation.serv[1].url   = 'upgrades.html';

  navigation.serv[2] = new Object();
  navigation.serv[2].width = 95;
  navigation.serv[2].name  = 'Maintenance';
  navigation.serv[2].url   = 'maintenance.html';

  navigation.serv[3] = new Object();
  navigation.serv[3].width = 125;
  navigation.serv[3].name  = '24 Hour Assistance';
  navigation.serv[3].url   = '24hour.html';
  
  navigation.serv[4] = new Object();
  navigation.serv[4].width =90;
  navigation.serv[4].name  = 'Spare Parts';
  navigation.serv[4].url   = 'spareparts.html';

  // prod
navigation.prod = new Array();
  navigation.prod[0] = new Object();
  navigation.prod[0].width = 100;
  navigation.prod[0].name  = 'Spiral Conveyors';
  navigation.prod[0].url   = 'spiral-conveyors.html';
  
  navigation.prod[1] = new Object();
  navigation.prod[1].width = 100;
  navigation.prod[1].name  = 'IQF Freezers';
  navigation.prod[1].url   = 'iqf-freezers.html';
  
  navigation.prod[2] = new Object();
  navigation.prod[2].width = 110;
  navigation.prod[2].name  = 'In-Line Tunnels';
  navigation.prod[2].url   = 'inline-tunnels.html';
  
  navigation.prod[3] = new Object();
  navigation.prod[3].width = 110;
  navigation.prod[3].name  = 'Used Equipment';
  navigation.prod[3].url   = 'used__equip.html';

// display navigation
function display_nav (menu_ref, cell) {
  var menu = eval('navigation.' + menu_ref);

  var nav_html = '';
  for (var i in menu) {
    nav_html += '<TD align="center" class="subNav" width="' + menu[i].width + '"><A href="' + menu[i].url + '"> ' + menu[i].name + '</A></TD>\n';
  }

  // write html
  document.getElementById('nav_cell').innerHTML = '<TABLE border="0" cellspacing="0" cellpadding="5">\n<TR>\n'
                                                + nav_html
                                                + '<TR>\n</TABLE>';

  // reset tabs
  document.getElementById("cell_a").style.background = '#0B3772';
  document.getElementById("cell_b").style.background = '#0B3772';
  document.getElementById("cell_c").style.background = '#0B3772';
  document.getElementById("cell_d").style.background = '#0B3772';
  document.getElementById("cell_e").style.background = '#0B3772';

  // colour tab
  document.getElementById("cell_" +cell).style.background = '#244B80';

}

// hide navigation
function hide_nav () {
  // write html
  document.getElementById('nav_cell').innerHTML = '&nbsp;';

  // reset tabs
  document.getElementById("cell_a").style.background = '#0B3772';
  document.getElementById("cell_b").style.background = '#0B3772';
  document.getElementById("cell_c").style.background = '#0B3772';
  document.getElementById("cell_d").style.background = '#0B3772';
  document.getElementById("cell_e").style.background = '#0B3772';
}