
// Make the gallery look sane ... at least with javascript-enabled borwsers ...
function article_fix_gallery() {
    var maxh = 0;
    var id = "article_gallery";
    var div = document.getElementById(id);

    if (div==null)
        return;

    var caption = div.getElementsByTagName("caption");

    if (caption==null)
        return;

    // Determine maximum caption height
    for (var i=0; i<caption.length; i++) {
        var h = caption[i].offsetHeight;
        if (h>maxh)
            maxh = h;
    }

    // Apply maximum height to all captions, if any ...
    if (h>0) {
        for (var i=0; i<caption.length; i++) {
            caption[i].style.height = ""+maxh+"px";
        }
    }

}

window.onload = article_fix_gallery

