$( document ).ready(function()
			{	// if services
				if ($(".barmenu2Services a").length > 0)
				{
					$(".page-item-12 a").css("background", "url(http://199.236.88.136/wp-content/themes/eliot-sinclair/images/back-nav-top-hover.png)");
					$(".page-item-12 a").css("color","#fff");
					$(".barmenu2Services:nth-child(1)").css("border-left","none");
				} 
				
				// if projects
				if ($(".scroll-pane:contains(Waikakariki)").length > 0)
				{
					$(".page-item-14 a").css("background", "url(http://199.236.88.136/wp-content/themes/eliot-sinclair/images/back-nav-top-hover.png)");
					$(".page-item-14 a").css("color","#fff");
					
				} 
				
				// if contact us
				if ($(".barmenu2Contact a").length > 0)
				{
					$(".page-item-16 a").css("background", "url(http://199.236.88.136/wp-content/themes/eliot-sinclair/images/back-nav-top-hover.png)");
					$(".page-item-16 a").css("color","#fff");
					
				} 
				

				// if company
				if ($(".barmenu2Company a").length > 0)
				{
					$(".page-item-18 a").css("background", "url(http://199.236.88.136/wp-content/themes/eliot-sinclair/images/back-nav-top-hover.png)");
					$(".page-item-18 a").css("color","#fff");
					$(".barmenu2Company:nth-child(1)").css("border-left","none");
				}  
				
				
				
				
				// if 
				//if ($("#sidebar-scroll").length > 0)
				//{
				//	$(".scroll-pane:nth-child(1)").css("background-color","#CB0000");
					
						
				//} 
				
				
				// for overview
				//if ($(".scroll-pane:contains(Site Surveys)").length > 0)
				//{	// then modify css of specific list-item (child)
				//	$(".barmenu2Services:nth-child(2)").css("background-color","#CB0000");
					//$(".barmenu2Services:nth-child(1)").css("border-left","none");
				//} 
				// if on post inside surveying(page), then highlight subpage = surveying
				// if specific class contains specific word (string)				
				if ($(".scroll-pane:contains(Site Surveys)").length > 0)
				{	// then modify css of specific list-item (child)
					$(".barmenu2Services:nth-child(2)").css("background-color","#CB0000");
					//$(".barmenu2Services:nth-child(1)").css("border-left","none");	
				}  
				
				// if third list item (engineering)
				if ($(".scroll-pane:contains(Retaining Wall Design)").length > 0)
				{
					$(".barmenu2Services:nth-child(3)").css("background-color","#CB0000");
					//$(".barmenu2Services:nth-child(1)").css("border-left","none");
				}  
				
				// if fourth list item (planning)
				if ($(".scroll-pane:contains(Planning Investigations)").length > 0)
				{
					$(".barmenu2Services:nth-child(4)").css("background-color","#CB0000");
					//$(".barmenu2Services:nth-child(1)").css("border-left","none");
				} 
				 // if fifth list item (architecture)
				if ($(".scroll-pane:contains(Feasibility Studies)").length > 0)
				{
					$(".barmenu2Services:nth-child(5)").css("background-color","#CB0000");
					//$(".barmenu2Services:nth-child(1)").css("border-left","none");
				} 
				
				
				// if second list item (contact-us)
				if ($(".scroll-pane:contains(Rangiora)").length > 0)
				{	// then modify css of specific list-item (child)
					$(".barmenu2Contact:nth-child(2)").css("background-color","#CB0000");
					$(".barmenu2Contact:nth-child(1)").css("border-left","none");
				}  
				
				
				// if second list item (staff profiles)
				if ($(".noscroll:contains(Associates)").length > 0)
				{	// then modify css of specific list-item (child)
					$(".barmenu2Company:nth-child(2)").css("background-color","#CB0000");
					
				}  
				
				// if director category (staff profiles)
				if (/\/directors\//.test(window.location))
				{	// then modify css of specific list-item (child)
					$("#sidebar-scroll li:nth-child(1)").css("background-color","#d8d1c8");
					$("#sidebar-scroll li:nth-child(1)").css("border-bottom","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(1)").css("border-top","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(1)").css("font-weight","bold");
				} 
				
				// if principals category (staff profiles)
				if (/\/principals\//.test(window.location))
				{	// then modify css of specific list-item (child)
					$("#sidebar-scroll li:nth-child(2)").css("background-color","#d8d1c8");
					$("#sidebar-scroll li:nth-child(2)").css("border-bottom","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(2)").css("border-top","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(2)").css("font-weight","bold");
				} 
				
				// if associates category (staff profiles)
				//if ($('#content a:has(a[href*="associates"]'))
				if (/\/associates\//.test(window.location))
				{	// then modify css of specific list-item (child)
					$("#sidebar-scroll li:nth-child(3)").css("background-color","#d8d1c8");
					$("#sidebar-scroll li:nth-child(3)").css("border-bottom","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(3)").css("border-top","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(3)").css("font-weight","bold");

				} 
				
				// if manager category (staff profiles)
				if (/\/managers\//.test(window.location))
				{	// then modify css of specific list-item (child)
					$("#sidebar-scroll li:nth-child(4)").css("background-color","#d8d1c8");
					$("#sidebar-scroll li:nth-child(4)").css("border-bottom","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(4)").css("border-top","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(4)").css("font-weight","bold");
				}  
				
				// if manager category (staff profiles)
				if (/\/experts\//.test(window.location))
				{	// then modify css of specific list-item (child)
					$("#sidebar-scroll li:nth-child(5)").css("background-color","#d8d1c8");
					$("#sidebar-scroll li:nth-child(5)").css("border-bottom","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(5)").css("border-top","dashed 1px #999");
					$("#sidebar-scroll li:nth-child(5)").css("font-weight","bold");
				} 				

			});
