$(document).ready(function(){

	
		// redefine Cycle's updateActivePagerLink function - http://www.malsup.com/jquery/cycle/pager7.html
		$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
		    $(pager).find('li').removeClass('activeLI') 
		        .filter('li:eq('+currSlideIndex+')').addClass('activeLI'); 
		};

	// activate slideshow
	$('#slideshow ul').after('<ol></ol>').cycle({ 
		timeout: 5000,
		pager: '#slideshow ol',
		pagerAnchorBuilder: function(idx, slide) {
			return '<li><a href="#">' + (idx+1) + '</a></li>'; 
		} 
	});
	
	// activate spotlight
	$('#spotlight ul').after('<ol></ol>').cycle({ 
		timeout: 2000,
		pager: '#spotlight ol',
		pagerAnchorBuilder: function(idx, slide) {
			return '<li><a href="#">' + (idx+1) + '</a></li>'; 
		} 
	});



	/* Nav Menu Dropdowns */
	
	// remove jobs sub-nav
	$('#navPrimary > li#navJobs > ul').remove();
	
	// set second-level list width to the width same as first level list
	$('#navPrimary > li > ul').css({
		'width': $('#navPrimary').css('width')
	});
	
	// add class of 'subs' to items with sub-items
	$('#navPrimary > li > ul').parent().find('> a').wrapInner('<span></span>');
	
	// hover event
	$('#navPrimary > li').hover(
		function(){ //on mouseover
			// $(this).css({ 'background-color': '#000000' }); // set background-color of hovered LI
			$(this).find('> a').addClass('navHover');
			$(this).find('ul').slideDown('fast'); // make hovered LI's child UL slide down
		},
		function(){ //on mouseout
			// $(this).css({ 'background-color': 'transparent' }); // remove background-color of hovered LI
			$(this).find('> a').removeClass('navHover');
			$(this).find('ul').slideUp('fast'); // make hovered LI's child UL slide back up
		}
	);

});