$(document).ready(function(){
	
	// add a current class to <li> with <a class='active'>
	$('#header a.active').parent().addClass('current');

	// for secondary pages, give active class to corresponding primary menu
	$('#nice-menu-1 li').each(function(){
		if ($(this).find('a.active').length)
			$('a', this).addClass('active');
	});

	// hide third level links from primary link
	$('.menu-level-1 ul li ul li').hide();
	
	// expand only the active menu in sidebar menus.
	$('.menu-level-1 ul li a.active-trail').next('ul').find('li').show();
	$('.menu-level-1 ul li a.active-trail').parent().addClass('active');

	// hover fix for landing page menu thumbs
	$(".views-field-field-menu-thumb-fid").hover(
		function () {
			$(this).next().find('span').addClass('menu-thumb-hover');
		}, 
		function () {
			$(this).next().find('span').removeClass('menu-thumb-hover');
		}
	);

	// TODO: remove
	// hover fix for zynga-management thumbs 
	$("#mang-profiles .team").hover(
		function(){
			$(this).addClass('mang-profiles-team-hover');
		},
		function(){
			$(this).removeClass('mang-profiles-team-hover');
		}
	);

});
