﻿var timer

function resizeIframeLoad() {
    if (window.self == window.parent) {
        return false;
    }
    else { //if (document.getElementById && document.all) {
        window.parent.document.getElementById('ifrm').style.height = '500px';
        var FramePageHeight = document.body.scrollHeight + 10;
        if (FramePageHeight < 500) { FramePageHeight = 500 }
        window.parent.document.getElementById('ifrm').style.height = FramePageHeight + 'px';
    }
}
function resizeIframeClick() {
    if (window.parent.document.documentElement.scrollTop > 0) {
        var y = parent.document.documentElement.scrollTop
    }
    if (window.self == window.parent) return false;
    else if (document.getElementById && document.all) {
        window.parent.document.getElementById('ifrm').style.height = '500px';
        var FramePageHeight = document.body.scrollHeight + 10;
        window.parent.document.getElementById('ifrm').style.height = FramePageHeight + 'px';
    }
    if (window.parent.document.documentElement.scrollTop > 0) {
        window.scrollTo(0, y)
    }
}

function resize() {
    window.clearTimeout(timer)
    timer = window.setTimeout('resizeIframeClick()', 250)
}
