window.onload = function() {
    var container = document.getElementById('boxes');
    var boxes = container.getElementsByTagName('div');
    var maxHeight = 0;
    
    for (var n = 0; n <= 1; n++) {
    	for (var i = 0; i < boxes.length; i++) {
    		if (n < 1) {
    			if (boxes[i].className == 'box' || boxes[i].className == 'box no-right-margin') {
    				maxHeight = (boxes[i].offsetHeight > maxHeight) ? boxes[i].offsetHeight : maxHeight;
    			}
    		} else {
    			if (boxes[i].className == 'box' || boxes[i].className == 'box no-right-margin') {
    				boxes[i].style.height = maxHeight + 'px';
    			}
    		}
    	}
    }
};
