		$.fn.slides = function (config) {
			var defaults = {
				speed: 500,
				nextButton: '<div class=\'nB\' title=\'Next\'>&gt;</div>',
				prevButton: '<div class=\'pB\' title=\'Previous\'>&lt;</div>'
			};
			var opt = $.extend(defaults, config);

			var carousel = function (speed, nextButton, prevButton, w) {
				var currentSlide;
				return {
					Init: function (div, list, lis) {
						this.AddButtons(div, list, lis);
						currentSlide = lis.first();
						lis.not(currentSlide).find('.caption').hide();
						lis.last().prependTo(list);
						list.css({ width: 100 * lis.length + "%", marginLeft: "-" + (100 - w) + "%" });
						lis.css({ width: (100.0 / lis.length) * (w / 100) + "%" });
					},
					AddButtons: function (div, list, lis) {
						var that = this;
						div.prepend($(nextButton).click(function () { that.MoveRight(div, list, lis); }));
						div.prepend($(prevButton).click(function () { that.MoveLeft(div, list, lis); }));
					},
					MoveLeft: function (div, list, lis) {
						if (!list.is(":animated")) {
							list.find('li').last().prependTo(list);
							currentSlide.find('.caption').fadeOut(speed);
							currentSlide = currentSlide.prev('li');
							currentSlide.find('.caption').fadeIn(speed);
							list.animate({ marginLeft: "-=" + w + "%" }, 0);
							list.animate({ marginLeft: "+=" + w + "%" }, speed);
						}
					},
					MoveRight: function (div, list, lis) {
						if (!list.is(":animated")) {
							currentSlide.find('.caption').fadeOut(speed);
							currentSlide = currentSlide.next('li');
							currentSlide.find('.caption').fadeIn(speed);
							list.animate({ marginLeft: "-=" + w + "%" }, speed, function () {
								list.find('li').first().appendTo(list);
								list.animate({ marginLeft: "+=" + w + "%" }, 0);
							});
						}
					}
				}
			} (opt.speed, opt.nextButton, opt.prevButton, 60);

			$(this).each(function () {
				var list = $(this).find('ul');
				var children = $(this).find('li');
				switch (children.length) {
					case 0:
						break;
					case 1:
						break;
					case 2:
					case 3:
						list.append(children.clone());
						children = list.find('li');
						carousel.Init($(this), list, children);
						break
					default:
						carousel.Init($(this), list, children);
						break;
				}
			});
		}
		$(function(){
			$('.slides').slides();
		});
	/*CSS positions the original items, last becomes partial first, first sits appropriately

 with four in place add the two buttons with appropriate classes
 These buttons should constnatly be in the right position purely based on css
 on click of next call the next func
 on click of prev call the prev func
 */
