
function fixResizeError()
{
	windowWidth = getWindowWidth();
	offsetLeft  = (windowWidth>795) ? Math.round((windowWidth-795)/2): (isIE)? ie6WidthAdjust: 0;
	
	hrcMenuAboutUs.position();
	hrcMenuServices.position();
	hrcMenuCareers.position();
	hrcMenuPress.position();
}


/*
---------------------------------------------------------------------

Begin Editing Here

---------------------------------------------------------------------
*/
// ItemStyle ['len', 'spacing', 'popInd', 'popPos', 'pad', 'outCol', 'overCol', 'outClass',
//  'overClass', 'outBorder', 'overBorder', 'outAlpha', 'overAlpha', 'normCursor', 'nullCursor'];


//var hBarAboutUs   = new ItemStyle(111, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_abouthrc_over.gif','', '', '0', '0', null, null);
//var hBarServices  = new ItemStyle(97, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_services_over.gif', '', '', '0', '0', null, null);
//var hBarPress     = new ItemStyle(119, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_pressroom_over.gif', '', '', '0', '0', null, null);
//var hBarCareers   = new ItemStyle(93, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_careers_over.gif', '', '', '0', '0', null, null);

// JPM 11/06/03 to get mouse to change to hand over main menu items
var hBarAboutUs   = new ItemStyle(111, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_abouthrc_over.gif','', 'categoryHover', '0', '0', null, null);
var hBarServices  = new ItemStyle(97, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_services_over.gif', '', 'categoryHover', '0', '0', null, null);
var hBarPress     = new ItemStyle(119, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_pressroom_over.gif', '', 'categoryHover', '0', '0', null, null);
var hBarCareers   = new ItemStyle(93, 0, '', 111, 0, '/images/spacer.gif', '/images/global_nav_careers_over.gif', '', 'categoryHover', '0', '0', null, null);

// The 'sub Menu' items: 22px long, 0px spacing, 'gnav_arrow.gif' for a popout indicator
// , the popout indicator is positioned 15px from the right
// edge of the item, items have 3px padding, some colours, it uses 'itemText' as the dimmed text
// class but 'itemHover' when it is moused over, and 'itemBorder' as the border stylesheet class.


var subM212 = new ItemStyle(22, -1, '/images/gnav_arrow.gif', 181, 0, '#EDEEED', '#EDEEED', 'itemText', 'itemHover', 'itemBorder', 'itemBorderHover', null, null);
var subM192 = new ItemStyle(22, -1, '/images/gnav_arrow.gif', 161, 0, '#EDEEED', '#EDEEED', 'itemText', 'itemHover', 'itemBorder', 'itemBorderHover', null, null);
var subM172 = new ItemStyle(22, -1, '/images/gnav_arrow.gif', 141, 0, '#EDEEED', '#EDEEED', 'itemText', 'itemHover', 'itemBorder', 'itemBorderHover', null, null);
var subM152 = new ItemStyle(22, -1, '/images/gnav_arrow.gif', 121, 0, '#EDEEED', '#EDEEED', 'itemText', 'itemHover', 'itemBorder', 'itemBorderHover', null, null);
var subM132 = new ItemStyle(22, -1, '/images/gnav_arrow.gif', 101, 0, '#EDEEED', '#EDEEED', 'itemText', 'itemHover', 'itemBorder', 'itemBorderHover', null, null);


// calculate the top and the left offsets
var offsetTop = 59; // Was 46 updated 08/01/2006
var sectionHeaderHeight =  26;


/*---------------------------------------------------------------------

                         About Us Menu Items

--------------------------------------------------------------------- */

// A PopupMenu() object must be passed its own name so it can reference itself when the menu
// is active. We also use a 'with' block to work with its properties and functions below.
var hrcMenuAboutUs = new PopupMenu('hrcMenuAboutUs');
with (hrcMenuAboutUs)
{
	startMenu('root', false, 129, offsetTop, sectionHeaderHeight, hBarAboutUs);

	// The text is a space then 'File', and this item pops out the 'mFile' submenu when moused over
	// as we've set 'sm:' as the action type. If you want to assign a click action (i.e. navigating to
	// a file) to one of these 'sm:' items, see the 'Optional Code' section below.

	addItem('', 'AboutUsP', 'sm:');
	
	// The URLs are set to # here, be sure to replace them with your path/file names or JS functions!
	// Also note how all the types are '', indicating these links open in the current frame.
	startMenu('AboutUsP', true, 0, 24, 152, subM152);
		addItem('Locations', '/about_Locations.asp', '');
		addItem('90th Anniversary', '/90th_TL.asp', '');
		addItem('Mission Statement', '/about_mission.asp', '');
		addItem('History', '/about_history.asp', '');
		addItem('Executive Team', '/exec_profile_ghubbell.asp', '');
		addItem('Associations', '/about_hrc_associations.asp', '');
}
hrcMenuAboutUs.onclick = function(mN, iN) 
{ 
	with (this)
	{
		// Do actions depending on the item that the mouse was over at the time of the click.
		// You may with to use nested IFs or 'switch' statements etc. if you're familiar with JS.
		if (mN == 'root')
		{
			// link to the about us section page
			location.href = '/about_hrc.asp';
		}
	}
}

/*---------------------------------------------------------------------

                         Press Menu Items

--------------------------------------------------------------------- */
var hrcMenuPress = new PopupMenu('hrcMenuPress');
with (hrcMenuPress)
{
	startMenu('root', false, 338, offsetTop, sectionHeaderHeight, hBarPress);

	addItem('', 'PressP', 'sm:');
	
	startMenu('PressP', true, 0, 24, 132, subM132);
		addItem('Press Releases', '/press_releases.asp', ''); 
		addItem('Awards', '/press_room_awards.asp', '');
		addItem('Publications', '/press_publications.asp', '');
}
hrcMenuPress.onclick = function(mN, iN) 
{ with (this)
{
	// Do actions depending on the item that the mouse was over at the time of the click.
	// You may with to use nested IFs or 'switch' statements etc. if you're familiar with JS.
	if (mN == 'root')
	{
		// link to the Press section page
		location.href = '/press_room.asp';
	}
}
}

/*---------------------------------------------------------------------

                         Careers Menu Items

--------------------------------------------------------------------- */
var hrcMenuCareers = new PopupMenu('hrcMenuCareers');
with (hrcMenuCareers)
{
	startMenu('root', false, 457, offsetTop, sectionHeaderHeight, hBarCareers);

	addItem('', 'CareersP', 'sm:');
	
	startMenu('CareersP', true, 0, 24, 132, subM132);
    	addItem('Opportunities', 'careers_opportunities.asp', '');
//		addItem('Work Environment', '#', '');
		addItem('Submit Resume', 'mailto:employment@hrc-engr.com?subject=HRC Web Site Resume Submittal', '');
		addItem('Application', '/EmploymentApplication.pdf', '');
}
hrcMenuCareers.onclick = function(mN, iN) 
{ with (this)
{
	// Do actions depending on the item that the mouse was over at the time of the click.
	// You may with to use nested IFs or 'switch' statements etc. if you're familiar with JS.
	if (mN == 'root')
	{
		// link to the Careers section page
		location.href = '/careers.asp';
	}
}
}

/*---------------------------------------------------------------------

                         Services Menu Items

--------------------------------------------------------------------- */
var hrcMenuServices = new PopupMenu('hrcMenuServices');
with (hrcMenuServices)
{
	startMenu('root', false, 241, offsetTop, sectionHeaderHeight, hBarServices);

	addItem('', 'ServicesP', 'sm:');
	startMenu('ServicesP', true, 0, 24, 208, subM212);
 	addItem('Architectural Services', 'ArchP', ' ');
	addItem('Civil Engineering', 'CivilP', 'sm:');
	addItem('Construction Services', 'ConstructionP', 'sm:');	
	addItem('Electrical Engineering', 'ElectricalP', ' ');
	addItem('Environmental Engineering', 'EnvironmentalP', 'sm:');	
	addItem('Geographic Information Systems', '/Service_Page_GIS.asp', '');
	addItem('Industrial Facilities Design', 'IndustrialP', ' ');
	addItem('MDOT Services', 'MdotP', ' ');
	addItem('Roadway Design', 'RoadwayP', ' ');
//	addItem('Storm Water Management', 'Service_Page_Stormwater.asp','');
	addItem('Structural Engineering', 'StructuralP', ' ');
	addItem('Traffic Engineering', 'TrafficP', 'sm:');
	addItem('Wastewater &amp; CSO Collection/Treatment', '/Service_Page_WastewaterCSO.asp', '');

	addItem('Water Treatment/Distribution ', '/service_page_water.asp', '');
	
	startMenu('ArchP', true, 208, 0, 152, subM152);
//		addItem('Architectural Services', 'Service_Page_Architectural.asp', '');
//		addItem('Landscape Architecture', 'Service_Page_Architectural.asp', '');

	startMenu('CivilP', true, 208, 0, 192, subM192);
		addItem('Hydraulic/Hydrological Modeling', '/subservice_civil_hydraulics.asp', '');
		addItem('Infrastructure Evaluation', '/subservice_civil_infrastructure_evaluation.asp', '');	
  		addItem('Municipal Consulting', '/subservice_civil_municipal_consulting.asp', '');		
		addItem('Parks &amp; Recreation Facilities', '/subservice_civil_parks_rec.asp', '');
		addItem('Right-of-way Acquisition', '/subservice_Civil_ROW.asp', '');		
//		addItem('Site Development', 'Service_Page_CIVIL.asp', '');
		addItem('Trenchless Technologies', '/subservice_civil_trenchless_technologies.asp', '');
	
	startMenu('ConstructionP', true, 208, 0, 152, subM152);
  		addItem('Surveying', '/subservice_Constr_Surveying.asp', '');	
//		addItem('Construction Engineering', '', '');
//		addItem('Materials Testing', '', '');
//		addItem('Observation', '', '');

	 		
	startMenu('ElectricalP', true, 208, 0, 172, subM172);
//		addItem('Instrumentation & Controls', 'service_page_electrical.asp', '');
//		addItem('Lighting', 'service_page_electrical.asp', '');
//		addItem('Power Distribution', 'service_page_electrical.asp', '');
	
	startMenu('EnvironmentalP', true, 208, 0, 212, subM212);
//		addItem('Storm Water Management', 'sub_service_tmpl.asp', '');
//		addItem('Storm water Permiting', 'sub_service_tmpl.asp', '');
//		addItem('Wetland Mapping', 'sub_service_tmpl.asp', '');
		addItem('Watershed Management', '/subservice_environmental_watershed.asp', '');
	addItem('Landscape Architecture', '/subservice_environmental_landscape_arch.asp', '');
	addItem('Engineering', '/subservice_environmental_engineering.asp', '');

	
	startMenu('GeographicP', true, 208, 0, 192,  subM192);
//		addItem('Geographic Information Systems', 'Service_Page_GIS.asp', '');
		
	startMenu('IndustrialP', true, 208, 0, 132, subM132);
//		addItem('Industrial Facilities', 'sub_service_tmpl.asp', '');
//		addItem('Spill Prevention', 'sub_service_tmpl.asp', ''); 
	
	startMenu('MdotP', true, 208, 0, 172, subM172);
//		addItem('Design', 'Service_Page_MDOT.asp', '');
//		addItem('Construction Administration', 'Service_Page_MDOT.asp', '');
//		addItem('Materials Testing', 'Service_Page_MDOT.asp', '');
	
	startMenu('RoadwayP', true, 208, 0, 132, subM132);
//		addItem('Roadway Design', 'Service_Page_Roadway.asp', '');
//		addItem('Streetscaping', 'Service_Page_Roadway.asp', '');
	
	startMenu('StructuralP', true, 208, 0, 152, subM152);
//		addItem('Structural Engineering', 'sub_service_tmpl.asp', '');
//		addItem('Bridge Design', '', '');
	
//	startMenu('TrafficP', true, 208, 0, 132, subM132);
	startMenu('TrafficP', true, 208, 0, 175, subM132);	
		addItem('Intelligent Transportation Systems', '/subservice_traffic_its.asp', '');	
//		addItem('Traffic Management', 'service_page_traffic.asp', '');
//		addItem('Non-motorized Paths', 'service_page_traffic.asp', '');
}
hrcMenuServices.onclick = function(mN, iN) 
{ with (this)
{
	// Do actions depending on the item that the mouse was over at the time of the click.
	// You may with to use nested IFs or 'switch' statements etc. if you're familiar with JS.
	if (mN == 'root')
	{
		// link to the about us section page
		location.href = 'service_main.asp';
	}
	else if (iN)
	{
		// if clicked on one of the menu items with a sub menu then link to correct page
		switch (menu[mN][iN]["href"])
		{ 
			case "ArchP": 
			location.href = '/Service_Page_Architectural.asp'; break; 
			case "CivilP": 
			location.href = '/Service_Page_CIVIL.asp'; break; 
			case "ElectricalP": 
			location.href = '/service_page_electrical.asp'; break; 
			case "EnvironmentalP": 
			location.href = '/Service_Page_Environmental.asp'; break; 
			case "ConstructionP": 
			location.href = '/Service_Page_Construction.asp'; break; 
			case "IndustrialP": 
			location.href = '/Service_Page_Industrial.asp'; break; 
			case "MdotP": 
			location.href = '/Service_Page_MDOT.asp'; break; 
			case "RoadwayP": 
			location.href = '/Service_Page_Roadway.asp'; break; 
			case "StructuralP": 
			location.href = '/Service_Page_STRUCTURAL.asp'; break; 
			case "TrafficP": 
			location.href = '/service_page_traffic.asp'; break; 
		}
	}
}
}

if (!isNS4)
{
 // Write menus now in non-NS4 browsers, by calling the "Fast" mode .update(true) method.
 hrcMenuAboutUs.update(true);
 hrcMenuServices.update(true);
 hrcMenuCareers.update(true);
 hrcMenuPress.update(true);
}
else
{
 // For Netscape 4, back up the old onload function and make a new one to update our menus.
 // This is the regular "Dynamic" mode menu update, it works in IE and NS6 too.
 var popOldOL = window.onload;
 window.onload = function()
 {
  if (popOldOL) popOldOL();
  hrcMenuAboutUs.update();
  hrcMenuServices.update();
  hrcMenuCareers.update();
  hrcMenuPress.update();
 }
}


// Other events must be assigned, these are less complicated, just add or remove menu objects.

window.onresize = function()
{
 windowWidth = getWindowWidth();
 offsetLeft  = (windowWidth>795) ? Math.round((windowWidth-795)/2): (isIE)? ie6WidthAdjust: 0;

//ns4BugCheck();
 hrcMenuAboutUs.position();
 hrcMenuServices.position();
 hrcMenuCareers.position();
 hrcMenuPress.position(); 
}

window.onscroll = function()
{
 hrcMenuAboutUs.position();
 hrcMenuServices.position();
 hrcMenuCareers.position();
 hrcMenuPress.position();
}

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = function(evt)
{
 hrcMenuAboutUs.click();
 hrcMenuServices.click();
 hrcMenuCareers.click();
 hrcMenuPress.click();

 if (isNS4) return document.routeEvent(evt);
}


// Add the effect to the 'pMenu' menu object for supported browsers. Opera doesn't support clipping
// so we turn it off, neither does IE4/Mac.
if (!window.opera)
{
 hrcMenuAboutUs.showMenu   = new Function('mN','menuAnim(this, mN, 10)');
 hrcMenuAboutUs.hideMenu   = new Function('mN','menuAnim(this, mN, -10)');

 hrcMenuServices.showMenu  = new Function('mN','menuAnim(this, mN, 10)');
 hrcMenuServices.hideMenu  = new Function('mN','menuAnim(this, mN, -10)');

 hrcMenuCareers.showMenu   = new Function('mN','menuAnim(this, mN, 10)');
 hrcMenuCareers.hideMenu   = new Function('mN','menuAnim(this, mN, -10)');

 hrcMenuPress.showMenu     = new Function('mN','menuAnim(this, mN, 10)');
 hrcMenuPress.hideMenu     = new Function('mN','menuAnim(this, mN, -10)');
}
/*
hrcMenuAboutUs.onmouseover = function(mN, iN) 
{	with (this){with (menu[mN][iN]) if (!type) status = href;}}
hrcMenuServices.onmouseover = function(mN, iN) 
{	with (this){with (menu[mN][iN]) if (!type) status = href;}}
hrcMenuCareers.onmouseover = function(mN, iN) 
{	with (this){with (menu[mN][iN]) if (!type) status = href;}}
hrcMenuPress.onmouseover = function(mN, iN) 
{	with (this){with (menu[mN][iN]) if (!type) status = href;}}
hrcMenuAboutUs.onmouseout = function() { status = '' }
hrcMenuServices.onmouseout = function() { status = '' }
hrcMenuCareers.onmouseout = function() { status = '' }
hrcMenuPress.onmouseout = function() { status = '' }

*/

