﻿function AutoFitAll()
{
    var ex;
    try
    {
        if(window!=parent)
        {
            var iframes=parent.document.getElementsByTagName("iframe");
            var i;
            for(i=0;i<iframes.length;i++)
            {
                //obj=parent.document.getElementById("frame1");
                if(iframes[i].contentWindow==window)
                {
                    var h1=0, h2=0;
                    if(document.documentElement && document.documentElement.scrollHeight)
                    {
                        h1=document.documentElement.scrollHeight;
                    }
                    
                    if(document.body) h2=document.body.scrollHeight;

                    var h=Math.max(h1, h2);
                    if(document.all) 
                    {
                        h += 4;
                    }
                    if(window.opera)
                    {
                        h += 1;
                    }
                    iframes[i].style.height = h-3 +"px";
                }
            }
        }
    }
    catch (ex){}
}
