/*
Uses Mochikit, so mochikit needs to be included before this
Just apply the CSS class of 'matching-column' to your divs
*/

function matchColumns(){
    contDivs = getElementsByTagAndClassName('div', 'matching-column');
    maxHeight=0;
    for (i=0;i<contDivs.length;i++) {
        if (contDivs[i].offsetHeight) {
            divHeight = contDivs[i].offsetHeight;
        } else if (contDivs[i].style.pixelHeight) {
            divHeight = contDivs[i].style.pixelHeight;
        }
        maxHeight=Math.max(maxHeight,divHeight);
    }

    for (i=0;i<contDivs.length;i++) {
        contDivs[i].style.height = maxHeight+'px';
    }
}

addLoadEvent(matchColumns);
