﻿function LoadContent() {

    var iframe = document.getElementById("ContentFrame");
    if (iframe != null) {
        if (iframe.contentDocument) {
            // FF
            var nH = iframe.contentDocument.body.offsetHeight;
            if (nH > 30000) {

                iframe.scrolling = "yes";
                iframe.height = "30000px";
                //alert('FireFox Requires Scroll bars');

            }
            else {
                iframe.height = iframe.contentDocument.body.scrollHeight + "px";
            }

        }
        else if (iframe.contentWindow.document.body) {
        // IE7
            iframe.scrolling = "no";
            iframe.height = iframe.contentWindow.document.body.offsetHeight + "px";
            //alert(iframe.height);
        }

        //alert(iframe.height);
    }

}

function PrintPreView(srcCmd) {

    var obj = "PrintView.aspx?id=" + srcCmd;
    //window.frames["ContentFrame"].location.reload(true);
    LoadSrcFrm("");
    LoadSrcFrm(obj);
    //window.open(obj, 'Print', 'toolbar=0,scrollbars=yes,resizable=1');
    

}
function LoadSrcFrm(srcIn) {

    //alert(srcIn);
    var obj = document.getElementById("ContentFrame");
    if (obj != null) {
        obj.src = "Cnontent.aspx?CMD=" + srcIn;
       
    }

}

function testB() {
    alert('fdsadf');
}
    function getElement(aID)
    {
        return (document.getElementById) ?
            document.getElementById(aID) : document.all[aID];
    }

    function getIFrameDocument(aID){ 
        var rv = null; 
        var frame=getElement(aID);
        // if contentDocument exists, W3C compliant (e.g. Mozilla) 
        if (frame.contentDocument)
            rv = frame.contentDocument;
        else // bad IE  ;)
            rv = document.frames[aID].document;
        return rv;
    }

    function adjustMyFrameHeight() {
        var frame = getElement("myFrame");
        alert('ddddd');
        var frameDoc = getIFrameDocument("myFrame");
    }
    
    