﻿// JScript File
// Resize the iframe content height dynamically 



//http://www.kaali.co.uk/index.pl?art=94

//resize iframe height 
function autoIframe(frameId)
{
    try{
        frame = document.getElementById(frameId);
        innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
        objToResize = (frame.style) ? frame.style : frame;
        objToResize.height = innerDoc.body.scrollHeight + 10;
    }
    catch(err){
        window.status = err.message;
    }
}

//http://forums.asp.net/t/1413071.aspx
function adjustFrameHeight(frameRefID)
{
    var frameRef = document.getElementById(frameRefID);

    if ( (frameRef.contentDocument) && (frameRef.contentDocument.body.offsetHeight) )     
    {
        // NS6 /Firefox ...
        frameRef.height = frameRef.contentDocument.body.offsetHeight + 20;
    }
    else
    {   
        //Internet Explorer       
        //frameRef.height = frameRef.document.body.scrollHeight + 20;  
        frameRef.height = frameRef.contentWindow.document.body.scrollHeight + 20; 
    }
}
