(function($) {
	$.fn.extend( {
		accordion : function() {
			return this.each(function() {
				if ($(this).data('accordiated'))
					return false;
				$.each($(this).find('ul, li>div'), function() {
					$(this).data('accordiated', true);
					$(this).hide()
				});
				$.each($(this).find('a:not(.foo)'), function() {
					$(this).click(function(e) {
						activate(e.target);
						return void (0)
					})
				});
				var d = false;
				if (location.hash)
					d = $(this).find('a[href=' + location.hash + ']')[0];
				else if ($(this).find('li.current'))
					d = $(this).find('li.current a')[0];
				if (d) {
					activate(d, 'toggle', 'parents');
					$(d).parents().show()
				}
				function activate(a, b, c) {
					$(a)[(c || 'parent')]('li').toggleClass('active')
							.siblings().removeClass('active').children(
									'ul, div').slideUp('fast');
					$(a).siblings('ul, div')[(b || 'slideToggle')]
							((!b) ? 'fast' : null)
				}
			})
		}
	})
})(jQuery);
$(document).ready(function() {
	var $div = $('#test');
	var height = $div.height();
	$div.hide().css( {
		height : 0
	});
	$('a.showme').click(function() {
		if ($div.is(':visible')) {
			$div.animate( {
				height : 0
			}, {
				duration : 200,
				complete : function() {
					$div.hide();
				}
			});
		} else {
			$div.show().animate( {
				height : height
			}, {
				duration : 200
			});

			$("#user").focus();
	        			
		}
		return false;
	});
});
