matchHeight = function() {
    // make a collection with <div> elements with 
    // class attribute 'uniform-height' that are children of the div
    // with id uniform-height-container 
    matchElementHeights($$("#uniform-height-container .uniform-height"));
};

//
//function repeated for Departments & Partners page
//
matchHeight2 = function() {
    // make a collection with <div> elements with 
    // class attribute 'uniform-height' that are children of the div
    // with id uniform-height-container-2 
    matchElementHeights($$("#uniform-height-container-2 .uniform-height"));
};

// this function is used to set page elements in 
// the specified list to a uniform height.
matchElementHeights = function (elems) {

    var obj = new Object();
    obj.maxHeight = 0;
    
    elems.each(function(elem, index) {
            var divHeight = 0;
            
            if(elem.offsetHeight){
                 divHeight = elem.offsetHeight;
            } else if(elem.style.pixelHeight){
                 divHeight = elem.style.pixelHeight;
            }
             
            this.maxHeight = Math.max(this.maxHeight, divHeight) - 3; 
            
        }, obj);
        
     if (obj.maxHeight && obj.maxHeight > 0) {
         elems.each(function(elem, index) {
                elem.style.height = this.maxHeight + "px";
            }, obj);
     }
}

Event.observe(window, 'load', 
        function() {
        	if(document.getElementsByTagName){
        		matchHeight();
        		matchHeight2();
        	}
        }
    );

