// perform JavaScript after the document is scriptable.
jQuery(document).ready(function(){
								
	jQuery("ul.tabs").tabs("div.panes > div", { 
 
    // configuration variables 
    current: 'current', 
    effect: 'fade',
	event: 'mouseover'
 
});

	jQuery('ul.sf-menu').superfish();
	
	//Removes the last pipe from the menu
	jQuery('.bi-menu li:last-child').css({'background-image':'none'});
	jQuery('.sf-navbar li li:last-child').css({'background-image':'none'});
	
	jQuery("#nav .sf-menu .page-item-2 ul").addClass('');

	//jQuery('ul.sf-menu.current_page_parent').slideDown('ul.sf-menu ul');
	jQuery("ul.sf-menu > li:nth-child(1) ul").css({'padding-left' : '0px','background-color':'#fff'});
	jQuery("ul.sf-menu > li:nth-child(2) ul").css({'padding-left' : '80px','background-color':'#fff'});
	jQuery("ul.sf-menu > li:nth-child(3) ul").css({'padding-left' : '202px','background-color':'#fff'});
	jQuery("ul.sf-menu > li:nth-child(4) ul").css({'padding-left' : '296px','background-color':'#fff'});
	jQuery("ul.sf-menu > li:nth-child(5) ul").css({'padding-left' : '375px','background-color':'#fff'});
	jQuery('#mycarousel').jcarousel();
	jQuery('#work-breadcrumbs a:last').addClass('selected');
	//jQuery('#w-thumbs').hide();
	//jQuery('#w-thumbs').fadeIn('slow');
	jQuery("#center-left-enlarge a").fancybox(); 
	//jQuery("#center-left-video a").fancybox();
	
	
	jQuery("#lha-video").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
	
	
	jQuery('li.current_page_parent').addClass('current_page_item');
	jQuery('li.current_page_ancestor').addClass('current_page_item');
	jQuery('#top-nav-line').hide();
	jQuery('#work-links .work-tabs li').append('<span> </span');
	
	/*Mask for Capabilities vertical line*/
	jQuery('.capabilities-services #panes-wrapper').prepend('<div style="height:130px; width:700px; background-color:#fff;position:absolute; top:20px; left:0; z-index:100"></div');

    
    if (document.getElementById('servicesID')!=null) {
    var liCount=document.getElementById('servicesID').getElementsByTagName('li').length;
    
    if (liCount < 5){
		jQuery('.tabs').makeacolumnlists({cols: 1, colWidth: 0, equalHeight: 'li'});
	}
	else if(liCount< 9){
		jQuery('.tabs').makeacolumnlists({cols: 1, colWidth: 0, equalHeight: 'li'});
	}
	else {
		jQuery('.tabs').makeacolumnlists({cols: 1, colWidth: 0, equalHeight: 'li'});
	}

	}
	
	
	
	//About Top Nav Link
	
	jQuery('.page-item-3987').mouseover(function(){
		jQuery('#top-nav-line').show();
		jQuery('#top-nav-line2').hide();
		jQuery('#top-nav-line').css({'left' : '125px'});
		
	
	});
	jQuery('.page-item-3987').mouseout(function(){
		jQuery('#top-nav-line').hide();
		jQuery('#top-nav-line2').show();
		jQuery('#top-nav-line2').css({'visibility' : 'visible'});
	
	});
	
	
	//Capabilities Top Nav Link
	
	jQuery('.page-item-9').mouseover(function(){
		jQuery('#top-nav-line').show();
		jQuery('#top-nav-line2').hide();
		jQuery('#top-nav-line').css({'left' : '204px'});
	
	});
	jQuery('.page-item-9').mouseout(function(){
		jQuery('#top-nav-line').hide();
		jQuery('#top-nav-line2').show();
	
	});
	
	
	//Proces Top Nav Link
	
	jQuery('.page-item-34').mouseover(function(){
		jQuery('#top-nav-line').show();
		jQuery('#top-nav-line2').hide();
		jQuery('#top-nav-line').css({'left' : '325px'});
	
	});
	jQuery('.page-item-34').mouseout(function(){
		jQuery('#top-nav-line').hide();
		jQuery('#top-nav-line2').show();
	
	});
	
		//Proces Top Nav Link
	
	jQuery('.page-item-39').mouseover(function(){
		jQuery('#top-nav-line').show();
		jQuery('#top-nav-line2').hide();
		jQuery('#top-nav-line').css({'left' : '420px'});
	
	});
	jQuery('.page-item-39').mouseout(function(){
		jQuery('#top-nav-line').hide();
		jQuery('#top-nav-line2').show();
	
	});
	
	//Capablities
	
	



	
});




	function openNav(){
		
		var curlocation = location.href;
		
		if(curlocation.indexOf(".com/") >= 0){
			var aCurLocation = curlocation.split("/");

			switch(aCurLocation[3].toLowerCase()){
				case "about": alert('about');break;
				//case "about": jQuery('#nav .page-item-2 ul').show();break;
				case "capabilities": alert('capabilities');break;
				case "process": alert('process');break;
				case "work": alert('work');break;
				case "contact": alert('contact');break;
				case "category/services": alert('contact');break;
			}			
		}	
	}

	jQuery(document).ready(function(){
		
		var curlocation = location.href;
		
		if(curlocation.indexOf(".com/") >= 0){
			var aCurLocation = curlocation.split("/");

			switch(aCurLocation[3].toLowerCase()){
				case "about": 
				jQuery('#top-nav-line2').show();
				jQuery('#top-nav-line2').css({'left' : '125px'});
				//jQuery('#nav .page-item-2 ul a').css({'visibility':'hidden'});
				jQuery('.bi-menu').css({'padding-left':'0px'});
				break;
				
				
				case "capabilities":
				
				jQuery('#top-nav-line2').show();
				jQuery('#top-nav-line2').css({'left' : '204px'});
				//jQuery('#nav .page-item-9 ul a').css({'visibility':'hidden'});
				jQuery('.bi-menu').css({'padding-left':'80px'});
				
				break;
				
				case "process": 
				jQuery('#top-nav-line2').show();
				jQuery('#top-nav-line2').css({'left' : '325px'});
				//jQuery('#nav .page-item-34 ul a').css({'visibility':'hidden'});
				jQuery('.bi-menu').css({'padding-left':'202px'});
				break;
				
				
				case "work":
				case "category":
				case "services":
				case "markets":
				jQuery('#top-nav-line2').show();
				jQuery('#top-nav-line2').css({'left' : '420px'});
				jQuery('.bi-menu').css({'padding-left':'296px'});
				if(aCurLocation[4].toLowerCase() == 'services' || aCurLocation[3].toLowerCase() == 'services')
					jQuery('.page-item-63').addClass('current_page_item');
				if(aCurLocation[4].toLowerCase() == 'markets' || aCurLocation[3].toLowerCase() == 'markets')
					jQuery('.page-item-65').addClass('current_page_item');
				//jQuery('#nav .page-item-39 ul a').css({'visibility':'hidden'});
				break;
				
				
				case "contact": 
				jQuery('#top-nav-line2').show();
				jQuery('#top-nav-line2').css({'left' : '-99999px'});
				jQuery('.bi-menu').css({'padding-left':'375px'});
				//jQuery('#nav .page-item-37 ul a').css({'visibility':'hidden'});
				break;
			}			
		}	
		//jQuery(document).pngFix();
	});

