$.fn.equalize = function(minHeight, maxHeight) {
	var tallest = (minHeight) ? minHeight : 0;
	function addSize(elem,baseHeight,operation) {
		var btop = parseInt(elem.css('border-top-width'));
		var bbot = parseInt(elem.css('border-bottom-width'));
		var ptop = parseInt(elem.css('padding-top'));
		var pbot = parseInt(elem.css('padding-bottom'));
		if (operation == 'subtract') {
			if (!isNaN(ptop)) baseHeight -= ptop;
			if (!isNaN(pbot)) baseHeight -= pbot;
			if (!isNaN(btop)) baseHeight -= btop;
			if (!isNaN(bbot)) baseHeight -= bbot;
		} else {
			if (!isNaN(ptop)) baseHeight += ptop;
			if (!isNaN(pbot)) baseHeight += pbot;
			if (!isNaN(btop)) baseHeight += btop;
			if (!isNaN(bbot)) baseHeight += bbot;
		}
		return baseHeight;
	}
	this.each(function() {
		var height = $(this).height();
		height = addSize($(this),height);
		if (height > tallest) tallest = height;
	});
	if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
	return this.each(function() {
		tallest2 = addSize($(this),tallest,'subtract')
	$(this).height(tallest2);
	});
}
$.fn.navigationize = function(assetid) {
	$(this).addClass('active');
	var curlvl = 1;
	var tmp = '';
	function getlevel($element) {return $element.attr("class").charAt(5);}
	$lis = $("ul#nav").children();
		$lis.each(function () {
			var lvl = getlevel($(this));
			if (lvl != 1) {
				if (lvl > curlvl) {tmp += '<ul class=level'+lvl+'>';}
				else if (lvl < curlvl) {tmp += '</ul>';}
				tmp += '<li class="'+$(this).attr("class")+'">'+$(this).html()+'</li>\n';
				$(this).remove();
			}
			else {
				if (curlvl > lvl) {
					$(tmp).insertBefore($(this));
					tmp = '';
				}
			}
			curlvl = lvl;
	});
	$("ul#nav ul").hide();
	$("li.active + ul").show();
	$("ul:has(.active)").show();
}
$.fn.rando = function() {
	$(this).hide();
	var sl = $(this), slln = sl.length, rn = Math.floor(Math.random()*slln);
	$(sl[rn]).show();
}