function expandElements() {
	if (!document.body)
		return;

	tallest = getElementsByClassName(document, "*", "tallest");
	if (tallest.length < 1)
		return(0);

	// find bottom of tallest element
	maxBottom = 0;
	for (index = 0; index < tallest.length; index++) {
		tallestBottom = tallest[index].offsetHeight + tallest[index].offsetTop;
		if (tallestBottom > maxBottom)
			maxBottom = tallestBottom;
	}

	/*
	 * Ok, so we've found the tallest element - now find the elements we need to expand
	*/
	expanders = getElementsByClassName(document, "*", "expand-me");

	for (expandIndex = 0; expandIndex < expanders.length; expandIndex++) {
		expanding = expanders[expandIndex];
		
		/* expanding now points to one of the elements that we need to expand.
		 * First of all we need to work out what the padding for the element is,
		 * since we need to include this in the height calc.
		 * 
		 * The easiest way of doing this is to find the height of any content in
		 * the element, and subtract that from the height of the element.
		*/

		childHeight = 0;
		for (index = 0; index < expanding.childNodes.length; index++) {
			if (expanding.childNodes[index].offsetHeight)
				childHeight += expanding.childNodes[index].offsetHeight;
		}
		paddingHeight = expanding.offsetHeight - childHeight;
		
		/* Now that we know the height of the element, and we know the position of
		 * the bottom of the tallest element, we can calculate how much to increase
		 * the height of our expanding element.
		*/

		expanding.style.height = maxBottom - expanding.offsetTop - paddingHeight + "px";
	}
}

function getElementsByClassName(oElm, strTagName, strClassName){
// From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
// Thanks to Robert Nyman
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();

	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	
	return (arrReturnElements)
}

