IframeResizer = {
    HeightAnterior: 0,
    GetPosition: function(e) {
        var left = 0;
        var top = 0;

        if (!e.offsetParent)
            left = 0;
        while (e.offsetParent) {
            left += e.offsetLeft;
            top += e.offsetTop;
            e = e.offsetParent;
        }

        left += e.offsetLeft;
        top += e.offsetTop;

        return { x: left, y: top };
    },
    GetHeight: function() {
        if (!document || !document.body) return 0;
        //var ret = document.body.scrollHeight;
        //if (ret > 0) return ret;

        var nl = document.createElement('div');
        var brl = document.createElement('br');
        brl.style.clear = 'both';
        nl.style.clear = 'both';
        nl.innerHTML = '.';
        nl.id = '__nl_test';
        document.body.appendChild(brl);
        document.body.appendChild(nl);
        ret = this.GetPosition(nl).y;
        document.body.removeChild(nl);
        document.body.removeChild(brl);
        return ret;
    },
    Resize: function() {
        var height = this.GetHeight();
        if (height > 0 && height != this.HeightAnterior) 
        {
            if (stbIFRSIframeDominio == 'localhost')
                stbIFRSIframeDominio = 'localhost/STB';
            
            var url = 'http://' + stbIFRSIframeDominio + '/js/Integracao/IframeHeightRegister.htm' + '?' + 'resize_' + stbIFRSchave + '_' + height.toString() + '#resize_' + stbIFRSchave + '_' + height.toString();
            frames['ifrControleResize'].location.href = url;
            this.HeightAnterior = height;
        }
    },
    Controller: setInterval('IframeResizer.Resize()', 2000)
}

//<!--
var strIframe = '<iframe name="ifrControleResize" ';
strIframe += 'id="ifrControleResize" height="0" width="0" frameborder="no" ';
strIframe += 'src="about:blank"></';
strIframe += 'iframe> ';
document.write(strIframe);
//-->