(function () {
    var contentIframe = document.getElementById("bot_frame");
    function autoheightIframe()
    {
        if (navigator.appName == "Microsoft Internet Explorer" &&
            navigator.appVersion.search("MSIE 7") > -1)
        {
            contentIframe.contentDocument = document.frames["bottom_content"].document;
        }
    
        var mainDivision = contentIframe.contentDocument.getElementById("main");
        contentIframe.height = mainDivision.offsetHeight;
        contentIframe.style.height = contentIframe.height + "px";
        
        if (navigator.appVersion.search("KHTML") > -1)
        {
            var divisions = document.getElementsByTagName("div");
            document.body.removeChild(divisions[divisions.length - 1]);
        }
    }
    
    if ("addEventListener" in contentIframe)
        contentIframe.addEventListener("load", autoheightIframe, false);
    else if ("attachEvent" in contentIframe)
        contentIframe.attachEvent("onload", autoheightIframe);
    else contentIframe.onload = autoheightIframe;
})();
