jQuery(document).ready(function() {
	// Data and Guides Menu - slide
	jQuery('#data-menu').hover(function() { jQuery(this).stop().animate({width: 175},350); }, function() { jQuery(this).stop().animate({width: 45},350); } );
	
	jQuery('#workstream-globaltrends .workstream-rotator').addClass('active');
	jQuery('.workstream').hover(function() {
		jQuery('.workstream div').removeClass('active');
		jQuery(this).children('div').addClass('active');
	});	

	jQuery(document).ready(function() {
		
		jQuery('.slide').css('display', 'none');
		jQuery('.filter h3.slider').toggleClass('up');
		
		jQuery('.filter h3').click(function() {
			jQuery(this).siblings('.slide').slideToggle(
				function() {
					jQuery(this).prev().toggleClass('up');
				}
			);
		});
	});

	// Hide 2nd level nav unless clicked on
	jQuery('ul.sub-menu').hide();
	jQuery('li.current_page_item ul.sub-menu, li.current-menu-ancestor ul.sub-menu').show();
	
	// back to top scroll function. Any link with a hash (#) will scroll to that id on the page
	/*jQuery('a[href*=#]').click(function() {
		if(!jQuery(this).parent().parent().hasClass('ui-tabs-nav')) {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
				var $target = jQuery(this.hash);
				$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					var targetOffset = $target.offset().top;
					targetOffset = targetOffset - 35;
					jQuery('html,body').animate({scrollTop: targetOffset}, 500);
					return false;
				}
			}
		}
	});*/

});
