﻿var curHeight;

function checkHeight() {
    var height = getFrameHeight();
    if (curHeight != height) {
        resizeParent();
    }
};

function resizeParent() {
    if (top !== self) {
        var browserDimensions;
        var newHeight = getFrameHeight();
        curHeight = Math.max(500, newHeight);
        //alert(curHeight);
        var resizeFrame = document.getElementById('resize-frame');
        if (resizeFrame && agentUrl && agentUrl != '')
            resizeFrame.src = agentUrl + 'height=' + curHeight;
    }
};

function getFrameHeight() {
    var height;
    
    if (!window.ActiveXObject && !navigator.taintEnabled && document.html)
        height = document.html.scrollHeight;
    else if(document.body)
        height = document.body.scrollHeight;

    return height;
};

setInterval(checkHeight, 500);

