// This Javascript is written by Peter Velichkov (www.creonfx.com)
// and is distributed under the following license : http://creativecommons.org/licenses/by-sa/3.0/
// Use and modify all you want just keep this comment. Thanks

function equalHeight(cl,num,defheight) {

    var className = '.' + cl;
    var maxHeight = 0;

    $$(className).each(function(el) {
        if (el.offsetHeight > maxHeight) {
            maxHeight = el.offsetHeight;
        }
    });
    
    $$(className).each(function(el) {
    el.setStyle('height', maxHeight + (defheight));
      
    });

}

function equalHeightNoExtender(cl, defheight) {
    if (cl) {
        cl.setStyle('height', cl.offsetHeight + (defheight));
    }
}

function vIE()
{ return (navigator.appName == 'Microsoft Internet Explorer') ? parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]) : -1; }


window.addEvent('load', function() {
    var boolcen = false;
    var cenheight = document.getElementById('ctl00_column_content_center').offsetHeight
    var cenleft = document.getElementById('column_content_left').offsetHeight
    if (document.getElementById('ctl00_column_content_right')) {
        var cenright = document.getElementById('column_content_left').offsetHeight
        var h = 100;
        var sub = '';
        if ((cenheight < cenleft) && (cenright < cenleft)) {
            boolcen = true;
        }
    } else {
        if (cenheight <= cenleft)
        { boolcen = true; }
    }

    if (boolcen == false) {
        if ((cenheight - cenleft) < 72 && (cenheight > cenleft)) {
            sub = 50 - (cenheight - cenleft)
            //alert(sub);
            if (sub > 50) { sub = 50 }
            equalHeight('equals', 1, sub);
        } else { equalHeight('equals', 1, 20); }
    } else { equalHeight('equals', 1, 50) }


});

