/**
 * Adjusts the heights of all div elements with a class name
 * so that they alle get the height of the hightes element
 * 
 * @param className The names of the classes
 * @param padding The total padding (to be subtracted)
 * @return
 */

function adjustDivHeights(className, padding) {
	var elements = []; // Our elements 
	var divs = document.getElementsByTagName("DIV"); // All divs in the documents
	var maxHeight = 0;
	
	if (!padding) {
		padding = 0;
	}
	
	// Collect the divs and find max height
	for (var i=0; i<divs.length; i++) {
		if (divs[i].className == className) {
		
			var eleHeight = divs[i].offsetHeight - padding;
			
			maxHeight = Math.max(maxHeight, eleHeight);
			
			elements.push(divs[i]);
			
		}
	}
	
	// Set the heights on the elements
	
	for (var i=0; i<elements.length; i++) {
		elements[i].style.height = maxHeight + "px";
	}
	
}