(function($) {  
	$.fn.RynoSlide = function(options) {
		var defaults = {
			direction: 'horizontal',	// Direction of animation (horizontal or vertical only)
			nextControl: '#Next',		// The ID of the next link
			prevControl: '#Prev',		// The ID of the previous link
			speed: 800,					// The speed of the animation
			easing: 'jswing'			// Set the easing of the animation (requires the jquery.easing plugin)
		};
		
		var options = $.extend(defaults, options);
		
		return this.each(function() {
			// The target <ul>
			var container = $(this);
			
			// Start from the first slide
			var curPos = 1;
			
			// Get the dimensions of a panel
			var height = $("li", container).height();
			var width = $("li", container).width();
			
			// Get the number of panels
			var count = $("li", container).size();
			
			// Set the dimensions of the container to hold all slides
			if(options.direction == 'horizontal') {
				// Set the target container's width to keep all panels on one column
				$("ul", container).css('width', (width * count));
			} else if(options.direction == 'vertical') {
				// Set the target container's height to keep all panels on one row
				$("ul", container).css('height', (height * count));
			}
			
			// The previous link was clicked
			$(options.prevControl).click(function() {
				if(curPos > 1)				// There is a slide before the current one
					curPos = curPos - 1;	// Set the position to the previous slide
				else						// We are at the first slide
					curPos = count;			// Set the position to the last slide
				
				if(options.direction == 'horizontal') {
					// Decrease the left margin, making it appear to slide left
					$("ul", container).animate({
						marginLeft: ((curPos-1) * width * -1) + 'px'
					}, options.speed, options.easing);
				} else if(options.direction == 'vertical') {
					// Decrese the top margin, making it appear to slide up
					$("ul", container).animate({
						marginTop: ((curPos-1) * height * -1) + 'px'
					}, options.speed, options.easing);
				}
				return false;
			});
			
			// The next link was clicked
			$(options.nextControl).click(function() {
				if(curPos < count)			// There is a slide after the current one
					curPos = curPos + 1;	// Set the position to the next slide
				else						// We are at the last slide
					curPos = 1;				// Set the position to the first slide
				
				if(options.direction == 'horizontal') {
					// Increase the left margin, making it appear to slide right
					$("ul", container).animate({
						marginLeft: ((curPos-1) * width * -1) + 'px'
					}, options.speed, options.easing);
				} else if(options.direction == 'vertical') {
					// Increase the top margin, making it appear to slide down
					$("ul", container).animate({
						marginTop: ((curPos-1) * height * -1) + 'px'
					}, options.speed, options.easing);
				}
				return false;
			});
		});
	};
})(jQuery);  