﻿function IframeLoaded(iframeID) {
    //alert('1');

    if (document.getElementById) {
        dyniframe = document.getElementById(iframeID);
        if (dyniframe && !window.opera) {
            dyniframe.style.display = "block"

            if (dyniframe.contentDocument && dyniframe.contentDocument.body.scrollHeight) { //ns6 syntax
                dyniframe.height = dyniframe.contentDocument.body.scrollHeight;
                dyniframe.style.height = dyniframe.contentDocument.body.scrollHeight + 'px';
            }
            else if (dyniframe.Document && dyniframe.Document.body.scrollHeight) //ie5+ syntax
            {
                dyniframe.height = dyniframe.Document.body.scrollHeight;
                dyniframe.style.height = dyniframe.Document.body.scrollHeight + 'px';
            }
            else if (dyniframe.contentDocument.documentElement.body == null) {
            dyniframe.height = dyniframe.contentDocument.documentElement.scrollHeight;
            dyniframe.style.height = dyniframe.contentDocument.documentElement.scrollHeight + 'px';
        }
        }
    }

    if ((document.all || document.getElementById)) {
        var tempobj = document.all ? document.all[iframeID] : document.getElementById(iframeID)
        tempobj.style.display = "block"

        if (tempobj.contentDocument && tempobj.contentDocument.body.scrollHeight) {//ns6 syntax
            tempobj.height = tempobj.contentDocument.body.scrollHeight;
            tempobj.style.height = tempobj.contentDocument.body.scrollHeight+ 'px';
        }
        else if (tempobj.Document && tempobj.Document.body.scrollHeight) //ie5+ syntax
        {
            tempobj.height = tempobj.Document.body.scrollHeight;
            tempobj.style.height = tempobj.Document.body.scrollHeight + 'px';
        }
        else if (tempobj.contentDocument.documentElement.body == null) {
        tempobj.height = tempobj.contentDocument.documentElement.scrollHeight;
        tempobj.style.height = tempobj.contentDocument.documentElement.scrollHeight + 'px';
        }
    }


}
