var andrewleclair_slideshow = {

	init: function() {
		
		var that = this;
	
		/*$('.slideshow img').hide();*/
		
		$('.slideshow').each(function() {
			
			$(this).cycle({
				fx: 'fade',
				speed: 300,
				timeout: 0,
				next: '#' + $(this).attr('id'),
				before: that.onBefore
			});
			
		});
		
		
		/*
		$('.slideshow').cycle({
			fx: 'scrollHorz',
		    speed:  400,
			next: this,
			prev: null,
		    timeout: 0,
			nowrap: 0
		}, function() {
			$('.slideshow img').show();
		});
		
		$('#first').click(function() {
			$('.slideshow').cycle(0); 
			return false;
		});
		*/
	},

	onBefore: function(curr, next, opts, fwd) {
		$(this).parent().next().html(this.alt);
	},

	onAfter: function(curr, next, opts, fwd) {
		$('#pager #current span').html(opts.currSlide + 1);
		$('#pager #count span').html(opts.slideCount);
		if(opts.currSlide == 0) {
			$('#pager #first').css('visibility', 'hidden');
		} else {
			$('#pager #first').css('visibility', 'visible');
		}
	}

};
