function iFrameHeight(obj) {
    aID = obj.id;
    var ifrm = document.getElementById(aID);

    // if contentDocument exists, W3C compliant (Mozilla)
    if (ifrm.contentDocument)
    {
        // On Safari, we need the offsetHeight, on others, the scrollHeight
        var h1 = ifrm.contentDocument.body.offsetHeight;
        var h2 = ifrm.contentDocument.body.scrollHeight;
        
        // Use whichever is smaller
        if (h1 > h2)
        {
            obj.height = h2 + 16;
        }
        else
        {
            obj.height = h1 + 16;
        }
        
        //alert(obj.height);
    }
    else // IE
    {
        obj.style.height = document.frames[aID].document.body.scrollHeight;
    }
}