jQuery.fn.extend({
	showHide : function(aClassOpen, aClassClose, aInitialClass) {
		this.css("cursor", "pointer").addClass(aInitialClass ? aInitialClass : aClassClose);
		this.each(function() {
			$("." + this.id).hide();
		});
		
		this.click(function() {
			if(this.className.match(aClassOpen)) {
				this.className = this.className.replace(aClassOpen, "");
				this.className = this.className + " " + aClassClose;
			} else {
				this.className = this.className.replace(aClassClose, "");
				this.className = this.className + " " + aClassOpen;
			}
			$("." + this.id).slideToggle("fast");
		});
	},
	
	showHideSetOpen : function() {
		
	},
	
	showHideSetClosed : function() {
		
	}
});

/*$(document).ready(function() {
	$(".showHideButton").showHide("showHideOpen", "showHideClose");
});
$(document).ready(function() {
	$(".showHideButtonWhite").showHide("showHideOpenWhite", "showHideCloseWhite");
});*/

$(document).ready(function() {
	$(".sliders").showHide("sliderOpen", "sliderClosed");
});



// this is the new one. I am still getting rid of the legacy stuff. Much cleaner although a little more HTML
$(document).ready(function() {
	$(".showHide").toggler();
});

jQuery.fn.extend({
	toggler : function(openClass, closeClass, buttonClass, contentClass) {
		var openClass = openClass || "shOpen";
		var closeClass = closeClass || "shClosed";
		var buttonClass = buttonClass || "shButton";
		var contentClass = contentClass || "shContent";
		
		var button = this.children("." + buttonClass);
		var content = this.children("." + contentClass);
		content.hide();
		
		button.click(function() {
			$(this).nextAll("." + contentClass).slideToggle("medium");
			$(this).toggleClass(closeClass).toggleClass(openClass);
		})
		.css({cursor : "pointer"})
		.toggleClass(closeClass);
	}
});