
	// what's left of the width after the menu is drawn?
	var filler_width = (
	$('#main_nav').width() - 
	  (
	   $('#nav-home').width() + 
	   $('#nav-our-firm').width() + 
	   $('#nav-our-projects').width() + 
	   $('#nav-our-approach').width() + 
	   $('#nav-our-people').width() + 
	   $('#nav-search').width()
	  )
	  - (7)
	);

	// give that width to the filler li
	$('#main_nav li.filler').width(filler_width);
	
	// add 'current' class to main_nav link for current section
	$('body.our-projects #nav-our-projects, body.a_project #nav-our-projects').addClass('current');
	$('body.our-people #nav-our-people').addClass('current');
	$('body.our-approach #nav-our-approach').addClass('current');
	$('body.our-firm #nav-our-firm, body.parent-pageid-23 #nav-our-firm, body.some_news #nav-our-firm').addClass('current');
	// $('body.parent-pageid-23 #nav-our-firm').addClass('current');
	//
	// add 'current' class to current page's subnav li
	// our-projects
	$('body.page-id-25 #nav-our-projects').addClass('current');
	$('body.institutional #sub-institutional-overview').addClass('current');
	$('body.commercial #sub-commercial-overview').addClass('current');
	$('body.industrial #sub-industrial-overview').addClass('current');
	$('body.corporate #sub-corporate').addClass('current'); 
	$('body.education #sub-education').addClass('current');
	$('body.government #sub-government').addClass('current');
	$('body.financial-facilities #sub-financial-facilities').addClass('current');
	$('body.healthcare #sub-healthcare').addClass('current');
	$('body.residential #sub-residential').addClass('current');
	$('body.institutional #sub-institutional').addClass('current');
	$('body.interiors #sub-interiors').addClass('current');
	$('body.life-science #sub-lifesciences').addClass('current');
	$('body.mission #sub-mission-critical').addClass('current');
	$('body.mixed #sub-mixed-use').addClass('current');
	$('body.sports #sub-sports').addClass('current');
	$('body.distribution #sub-distribution').addClass('current');
	$('body.manufacturing #sub-manufacturing').addClass('current');
	$('body.process #sub-process').addClass('current');
	$('body.food #sub-food-and-beverage').addClass('current');
	$('body.page-id-8939 #nav-our-projects').addClass('current');
	// our-people
	$('body.page-id-27 #sub-business-unit-leaders').addClass('current');
	$('body.page-id-130 #sub-executive-team').addClass('current');
	$('body.page-id-132 #sub-join-our-team').addClass('current');
	$('body.page-id-6936 #nav-our-people').addClass('current');
	// $('body.join-our-team #sub-join-our-team').addClass('current');
	// our-approach
	$('body.page-id-30 #sub-our-approach').addClass('current');
	$('body.page-id-37 #sub-integrated-services').addClass('current');
	$('body.page-id-39 #sub-technology').addClass('current');
	$('body.page-id-41 #sub-safety').addClass('current');
	$('body.page-id-43 #sub-sustainability').addClass('current');
	$('body.page-id-6580 #sub-technical-services-team').addClass('current');
	$('body.page-id-7671 #sub-real-estate-services').addClass('current');
	// our-firm
	$('body.page-id-23 #sub-our-firm').addClass('current');
	$('body.page-id-4486 #sub-message').addClass('current');
	$('body.page-id-100 #sub-history').addClass('current');
	//$('body.page-id-4987 #sub-news').addClass('current');
	$('body.some_news #sub-news').addClass('current');
	$('body.page-id-4991 #sub-awards').addClass('current');
	$('body.page-id-4993 #sub-news').addClass('current');
	$('body.page-id-4993 #sub-events').addClass('current');
	$('body.page-id-102 #sub-community').addClass('current');
	$('body.page-id-3846 #sub-contact').addClass('current');
	$('body.category-143.news').find('#nav-our-firm').addClass('current');
	$('body.category-334 #nav-our-firm').addClass('current');
	$('body.category-278 #nav-our-firm').addClass('current');
	// search
	$('body.search #nav-search').addClass('current');
	//
	// remove 'current' from all subnav links on click then set to one clicked
	$('#subnav1 li').click(function(){
		$('#subnav1 li').removeClass('current');
		$(this).addClass('current');
	});
	//	
	
	
	// this fades the main_nav drop-down
	$('#main_nav .main_nav_top').hover(
		function() {
			// $('#main_nav .main_nav_top').children().stop();
			$(this).find('a.top').addClass('hover');
			$(this).stop('clearQueue','gotoEnd').find('.drop-down').fadeIn('fast');
		},
		function() {
			$(this).find('a.top').removeClass('hover');
			$(this).stop('clearQueue','gotoEnd').find('.drop-down').fadeOut(10);
			// $('#main_nav .main_nav_top').children().stop();
		}
	);
	
	$('.drop-down li').hover(
		function() {
			$(this).find('> a').css({'padding-left':'24px'}).stop('clearQueue','gotoEnd').animate({'padding-left':'+=8px'},'fast').css('color','#fddc00');
		},
		function() {
			$(this).find('> a').css({'padding-left':'32px'}).stop('clearQueue','gotoEnd').animate({'padding-left':'-=8px'},'fast').css('color','#e6392d');
		}
	);
	
	$('#main_nav .flyout').hover(
		function() {
			$(this).stop('clearQueue','gotoEnd').find('ul').fadeIn('fast');
		},
		function() {
			$(this).stop('clearQueue','gotoEnd').find('ul').fadeOut(10);
		}
	);


	
// light yellow:  #fff29a
// darker yellow: #fddc00
// orange:        #e6392d
	
	// sidebar revealer
	$('.sidebar_box.expander .toggler').click(function() {
		$(this).parent('.sidebar_box.expander').find('.sidebar_box_content').slideToggle('fast');
		$(this).find('img').fadeToggle('fast');
	});
	
	
	// project biz unit 5-post flapper
	$('.blocks').cycle({ 
		slideExpr: '.column' ,
		fx: 'scrollHorz',
		speed:  'fast', 
		timeout: 0 , 
		next:   '.scroll_forward', 
		prev:   '.scroll_back' 
	});

	
	// click anywhere in an .item go to that url
	// or maybe jump somewhere outside of the site
	$('.item').click(function(){
		var list_link = $(this).find('.excerpt a').attr('href');
		var link_target = $(this).find('.excerpt a').attr('target');
		if (link_target == '_blank') {
			window.open(list_link);
			return false ;
		}
		else {
			window.location = list_link ;
			return false ;
		}
	});


	// click anywhere in an projects 3-up box go to that url
	$('.three-up-bottom > div').click(function(){
     	window.location=$(this).find('a').attr('href');
    	return false;
	});



	// social links popper-upper
	$('#socialism').hover(
		function() {
			$('#engage').css('color','#fddc00');
			$('#social_cliques div').stop().animate({'top':'0px'});
			$(this).addClass('hovering');
		},
		function() {
			$('#engage').css('color','#ffffff');
			$('#social_cliques div').stop().animate({'top':'41px'});
			$(this).removeClass('hovering');
		}
	);
	$('#socialism.hovering #social_cliques a').click(function() {
		$('#social_cliques div').animate({'top':'41px'});
	});

	

