// energy4me

$.fn.nextTag = function(tag) {
	var idx = $(this).siblings().index($(this).prev()[0]);
	return $(this).siblings().gt(idx).filter(tag).eq(0);
};

$.fn.showHide = function(settings) {
	settings = jQuery.extend({
		widget: "widget",
		open: "open",
		closed: "closed",
		outdent: "outdent"
	}, settings);
//	var proto = document.createElement("span");
	$(this).each( function() {
		var target = "";
		if ($(this).children("ul").size() > 0) {
			target = $(this).children("ul"); // target is second child li
		}
		target.hide();
//		$(proto).clone().addClass(settings.widget).addClass(settings.closed).prependTo($(this));
		$(this).hover(
			function() {
				$(target).slideDown();			
			},
			function() {
				$(target).slideUp();			
			});
	});		
};
