var ie5 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.0") != -1);
var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

var jQueryOn = true;
if (ie5 || ie55) {
    jQueryOn = false;
}

//Eventos
if (jQueryOn && typeof(jQuery) != "undefined") {
    $(document).ready(estruturaInit);
    $(window).load(estruturaInit);
} else {
    fncDocumentReady = function() {
        if ( !document.body )
            return setTimeout( fncDocumentReady, 13 );
        estruturaInitNoJquery();
    }
    if ( document.addEventListener )
        window.addEventListener( "load", fncDocumentReady, false );
    else if ( document.attachEvent )
        document.attachEvent("onload", fncDocumentReady);
    
    fncDocumentReady();
}

/*
-> ALTURA DAS COLUNAS */
function estruturaInit() { //altura do layout
    if ($.isFunction(arguments[0]))
        $ = arguments[0];
    
    var maxHeight = 0;
    
    if ($('#content #content-left')[0].scrollHeight > maxHeight)
        maxHeight = $('#content #content-left')[0].scrollHeight;
    if ($('#content #content-right')[0].scrollHeight > maxHeight)
        maxHeight = $('#content #content-right')[0].scrollHeight;
    
    maxHeight += $('#content #content-top')[0].scrollHeight;
    
    $('#content').height(maxHeight);
}
function estruturaInitNoJquery() { //altura do layout
    var maxHeight = 0;
    
    if (document.getElementById('content-left').scrollHeight > maxHeight)
        maxHeight = document.getElementById('content-left').scrollHeight;
    if (document.getElementById('content-right').scrollHeight > maxHeight)
        maxHeight = document.getElementById('content-right').scrollHeight;

    maxHeight += document.getElementById('content-top').scrollHeight;
    
    document.getElementById('content').style.height = maxHeight;
}



