// Detailed Options Page http://jquery.malsup.com/cycle/options.html

(function (jQuery) {
	jQuery(document).ready(function() {
		jQuery('#home-banner-show').cycle({
			// note: idx is reference to the slide number starting at 0
			// slideExpr: '#something', // in the event that the object below id=slideshow is not the repeating elements, you can define which sub element it really should use
			cleartype: true, // enable cleartype corrections
			cleartypeNoBg: true,
			fx: 'fade', // choose your transition type, ex: blindX, blindY, blindZ, curtainX, curtainY, fade, fadeZoom, growX, growY, none, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz, scrollVert, shuffle, slideX, slideY, toss, turnUp, turnDown, turnLeft, turnRight, cover (direction up|right|down|left), uncover, wipe, zoom
			speed: 1000,
			timeout: 4000,  // 0 to disable auto advance or basically make it not start
			sync: true, // true or false
			startingSlide: 0, // zero based
			prev: '#banner-previous',
			next: '#banner-next',
			// pager: '#home-banner-pager',
			// pagerAnchorBuilder: pagerFactory,
			// pagerEvent: 'mouseover',
			// pauseOnPagerHover: true,
			pause: true, // pause on hover
			delay: 1000
		});

		jQuery('#home-stories-show').cycle({
			// note: idx is reference to the slide number starting at 0
			// slideExpr: '#something', // in the event that the object below id=slideshow is not the repeating elements, you can define which sub element it really should use
			cleartype: true, // enable cleartype corrections
			cleartypeNoBg: true,			
			fx: 'fade', // choose your transition type, ex: blindX, blindY, blindZ, curtainX, curtainY, fade, fadeZoom, growX, growY, none, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz, scrollVert, shuffle, slideX, slideY, toss, turnUp, turnDown, turnLeft, turnRight, cover (direction up|right|down|left), uncover, wipe, zoom
			speed: 500,
			timeout: 0, // 0 to disable auto advance or basically make it not start
			sync: true, // true or false
			startingSlide: 0, // zero based
			prev: '#stories-previous',
			next: '#stories-next',
			pager: '#home-stories-pager',
			pagerAnchorBuilder: pagerFactory
		});

		// Customizes the pager function
		function pagerFactory(idx, slide) {
			var s = idx == 0 ? ' style=""' : '';
			return '<li'+s+'><a href="javascript:void(0);">'+(idx+1)+'</a></li>';
			// Below code uses the slide source as a thumbnail 50x50
			// return '<li><a href="javascript:void(0);"><img src="' + slide.src + '" width="50" height="50" /></a></li>'; 
			
		};
		
		// Banner Pause Button
		// jQuery('#banner-stop').click(function() { 
		//	jQuery('#home-banner-show').cycle('pause'); 
		// });
		
		// Banner Resume Button
		// jQuery('#banner-play').click(function() { 
		//	jQuery('#home-banner-show').cycle('resume', true); 
		// });
		
		// have navigation controls fadein/out when hovering over the master slideshow element
		jQuery('.home-content-banner').hover(
			function() { jQuery('.home-banner-buttons').fadeIn(); },
			function() { jQuery('.home-banner-buttons').fadeOut(); }
		);
		
	});

})(jQuery);
