(function($) {
	$.fn.extend( {
		switchTabs : function() {
			var target = this;
			var ids = new Array();
			$(this).find("a").each(function() {
				var id = '#' + this.href.split('#')[1];
				if(ids.length == 0) {
					$(id).show();
					$(this).parent().addClass("active");
				}
				else
					$(id).hide();
				ids.push(id);
				$(this).click(function() {
					$(ids).each(function(t) {
						$(ids[t]).hide();
						
					});
					var idToShow = '#' + this.href.split('#')[1];
					$(idToShow).show();
					target.find("li").removeClass("active");
					$(this).parent().addClass("active");
					return false;
				});
			});
			return this;
		}
	});
})(jQuery);