(function($){
    $.fn.humanSlider = function(options) {
        var defaults = {
        };

		var opts = $.extend(defaults, options),
			$container = $('#slider div'),
			containerRight = $container.offset().left + $container.width();
		
		$container.slider({
			stop: function(event, ui){
				var $slider = $container.find('a');
				if($slider.offset().left == containerRight){
					$.ajax({
						url: location.pathname,
						type: 'GET',
						data: location.search.substring(1) + '&humanComment=true',
						dataType: 'html',
						success: function(html){
							displayForm(html);
						}
					});
				}
			}						
		});
		
		function displayForm(html){
			$commentForm = $(html).find('.ajaxCommentForm');
			$('.container02').append($commentForm);
			$('.ajaxCommentForm').hide().slideDown("slow");
			$('.humanSlider').remove();
		}
    }
})(jQuery)
