$(document).ready(function() {

	// CYCLE FUNCTIONS
	
		$('#slider-container').cycle({	
			fx: 'fade',
			prev:   '#homeFeature .slide-left', 
			next:   '#homeFeature .slide-right',
			after:	onAfter
			
		});
	
	// SLIDE COUNTER
	
		var totalSlides = $("#homeFeature #slider-container > div.slider").length;
		$('#homeFeature .count').html("1 of " + totalSlides + ""); 
		
		function onAfter(curr,next,opts) {
		var slideNumber = (opts.currSlide + 1) + ' of ' + opts.slideCount;
		$('#homeFeature .count').html(slideNumber); 
		}
	
	// PLAY PAUSE BUTTON EFFECTS
	
		$('.playPause').toggle(function() {
		
			$(this).css("backgroundPosition", "center bottom");
		
			$('#slider-container').cycle('pause'); 
		
		}, function() {
		
			$(this).css("backgroundPosition", "center top");
		
			$('#slider-container').cycle('resume', true);
		
		});

});
