var u = document.URL.split('/');
var v = u[u.length - 1];
var x = '';
var z = '<table border="0" cellpadding="0" cellspacing="0" align="center" width="154">';
var y;
var a = new Array();

function menuitem(text,url,group,ms) {
	this.text = text;
	this.url = url;
	this.group = group;
	this.ms = ms;
	a[a.length] = text + '|' + url + '|' + group + '|' + ms;
	if (x.length == 0 && v == url) {
		x = group;
	}
}

/* MENU BELOW BETWEEN COMMENT LINES */
/* y = new menuitem('link text','link url','menu group','main or sub'); */

/*---------------------------------------------------------------------*/

y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Home','index.htm','home','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;About Us','about.htm','about','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Our People','about_people.htm','about','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office Locations','serviceareas.htm','areas','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Services','services.htm','services','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Electrical','services_electrical.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mechanical','services_mechanical.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Design','services_design.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lighting','services_lighting.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEGG','tegg.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CurrentSAFE','currentsafe.htm','services','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEGG','tegg.htm','tegg','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Residential /<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CurrentSAFE','http://www.teamhumphrey.com/currentsafe','currentsafe','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Renewable Energy','http://www.teamhumphrey.com/renewableenergy','renewable','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Portfolio','portfolio.htm','portfolio','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Safety/Training','safety.htm','safety','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;News','news.htm','news','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Community Service','news_community.htm','news','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;References','references.htm','references','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Architectural','references_architectural.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Engineering','references_engineering.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;General Contractor','references_gc.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Owner','references_owner.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trade','references_trade.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mechanical','references_mechanical.htm','references','sub');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Endorsements','endorsements.htm','endorsements','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Publications','publications.htm','publications','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Careers','careers.htm','careers','main');
y = new menuitem('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contact Us','contact.htm','contact','main');

/*---------------------------------------------------------------------*/

if (x.length == 0) {
	x = a[0].split('|')[2];
}

var g = 1;
function setbg() {
	if (g == 0) {
		z += 'background="images\/button_bg.jpg"';
	} else {
		z += 'bgcolor="#2F0797"';
	}
}

for (b = 0 ; b < a.length; b++) {
	if (a[b].split('|')[3] == 'main') {
		if (b != 0) {
			z += '<tr><td ';
			setbg();
			z += '><img src="images\/spacer.gif" alt="" width="154" height="8" border="0"><\/td><\/tr>';
		}
		if (g == 0) {
			g = 1;
		} else {
			g = 0;
		}
		z += '<tr><td ';
		setbg();
		z += '><img src="images\/spacer.gif" alt="" width="154" height="8" border="0"><br><a href="' + a[b].split('|')[1] + '" class="mainmenu">' + a[b].split('|')[0] + '</a><\/td><\/tr>';
	} else if (a[b].split('|')[2] == x) {
		z += '<tr><td ';
		setbg();
		z += '>\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;<a href="' + a[b].split('|')[1] + '" class="mainmenusub">' + a[b].split('|')[0] + '</a><\/td><\/tr>';
	}
	
}

z += '<tr><td ';
setbg();
z += '><img src="images\/spacer.gif" alt="" width="154" height="8" border="0"><\/td><\/tr>';
z += '<tr><td><img src="images\/menu_bg.jpg" alt="" width="154" height="187" border="0"><\/td><\/tr></table>';

document.open;
document.write(z);
document.close;