$(function() {
		var h,
			theNextSlide,
			index = 0,
			counter = 0,
			hashes = {},
			currentHoverIndex,
			resumeSlide=4,
			startIndex,
			m,
			menuLinks = {},
			menuTitle = {},			
			topMenu = {};
			
		
		/* grab links and menu title from first 4 */
		$('#menu-top li a').each(function(i) {
			menuLinks[i] = $(this).attr('href');
			menuTitle[i] = $(this).text();			
		});	
				
		// hide first four menu items
		$('#menu-top li:lt(4)').remove();
				

		
		$('#menu-top li a').each(function(i) {
			m = $(this).attr('class');										  
			topMenu[m] = i;
		});	
				
		var foundLink;
		var foundLinkClass;		
	

						
		$('.slideshow')
		//.before('<div id="menu-top1">')
		.cycle({
  
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			speed:    1000, // defines the number of milliseconds it will take to transition from one slide to the next.
			timeout:  5500, // specifies how many milliseconds will elapse between the start of each transition
			pause: 1, // so that pauses when user hovers over a slide
		    pauseOnPagerHover: 1,
			delay:  2000, // set a delay before 1st slide starts transitioning
			pager: '#menu-top', //instructs the plugin to create navigation elements, one for each slide, and add them to the container identified by the value of the pager.
			pagerEvent: 'mouseover',
 		    allowPagerClickBubble: true,		
			cleartype:false // darn IE
		});

		
		if (index===3) {
			$(".other-non-profit").addClass("slideshowCurrent");		
		}
		
		$('#menu-top li a').each(function(i) {										  
				$(this).attr("href", menuLinks[i]);
				$(this).text(menuTitle[i]);
		});	
		

		

});
