(function($) {
	$.fn.accordion = function(settings) {
		var jQueryMatchedObj = this;
		
		this.find("li > .header").click(function() {
			var elem = $(this);
			
			if(elem.parent().parent().parent().attr("id") == "accordion") $(this).next().toggle("fast");
			else {
				elem.parent().parent().find("li > a").next().hide("fast");
				if(elem.next().css("display") == "none") elem.next().show("fast");
			}
			
			return false;
		}).next().hide();
		
		this.find("#expand").click(function() {
			jQueryMatchedObj.find("li > .header").next().show("fast");
		});
		
		this.find("#collapse").click(function() {
			jQueryMatchedObj.find("li > .header").next().hide("fast");
		});
	};
})(jQuery);
