var maxHeight = 0;
var elementArray = new Array();
var matchHeight = Class.create();
matchHeight.prototype = {
	initialize: function() {
		// Get elements to match
		var matchWhat = document.getElementsByClassName('match-group');
		// Check if we found anything		
		if (matchWhat != '') {
			this.matchGroup(matchWhat);			
		}
		return false;
	},
	matchGroup: function(matchWhat) {
		elementArray = [];
		for (var i=0; i<matchWhat.length; i++) {
			var matchElement = matchWhat[i];
			elementArray[elementArray.length] = matchElement;
			if (matchElement.offsetHeight) {
				var elementHeight = matchElement.offsetHeight;
			}
			maxHeight = Math.max(maxHeight, elementHeight);
		}
		for (var i=0; i<elementArray.length; i++) {
			var element = elementArray[i];
			element.style.paddingBottom = 0;
			element.style.height = maxHeight + "px";
		}
		return false;
	}
}

Event.observe(window, 'load', initMatchHeight, false);

function initMatchHeight() {if (!document.getElementById('container')) return; myMatchHeight = new matchHeight();};
