
function resizeIFrameXY(iframe, sAlternateWidth, sAlternateHeight) 
{
    if (iframe)
    {
        try {
            var iWidth = 500
            var iHeight = 300
            
            if (sAlternateWidth != "")
                iWidth = Math.max(iWidth, parseInt(sAlternateWidth))
            if (sAlternateHeight != "")
                iHeight = Math.max(iHeight, parseInt(sAlternateHeight))
            
            if ( iframe.contentDocument ) // firefox 
            {
                iframe.height = Math.max(iHeight, iframe.contentDocument.body.scrollHeight + 90); 
                iframe.width = Math.max(iWidth, iframe.contentDocument.width + 5); 
            } 
            else // IE 
            {
                iframe.style.height = Math.max(iHeight, iframe.contentWindow.document.body.scrollHeight + 50); 
                iframe.style.width = Math.max(iWidth, iframe.contentWindow.document.body.scrollWidth);
            }
        }
        catch (e)   // Access denied to URLs of different domain
        {

            try {
                if (iframe.contentDocument) // firefox
                {
                    iframe.height = sAlternateHeight;   // e.g. "500px" or "100%"
                    iframe.width = sAlternateWidth;   // e.g., "800px" or "100%"
                }
                else // IE
                {
                    iframe.style.height = sAlternateHeight;   // e.g. "500px" or "100%"
                    iframe.style.width = sAlternateWidth;   // e.g., "800px" or "100%"
                    iframe.style.zIndex = -1;    // Some external sites put their frame's zindex high, which blocks menus.
                }
            }
            catch (e)
            { }
        }
   }
} 

function resizeIFrameElse(iframe, sAlternateHeight) 
{
    resizeIFrameXY(iframe, "800px", sAlternateHeight);
} 
function resizeIFrame(iframe)
{
    resizeIFrameXY(iframe, "800px", "500px");
}


function resizeIFrameY(iframe, sAlternateHeight) 
{
    if (iframe)
    {
        try {
            var iHeight = 300
            
            if (sAlternateHeight != "")
                iHeight = Math.max(iHeight, parseInt(sAlternateHeight))
            
            if ( iframe.contentDocument ) // firefox 
            {
                iframe.height = Math.max(iHeight, iframe.contentDocument.body.scrollHeight + 90); 
            } 
            else // IE 
            {
                iframe.style.height = Math.max(iHeight, iframe.contentWindow.document.body.scrollHeight + 50); 
            }
        }
        catch (e)   // Access denied to URLs of different domain
        {
        }
   }
} 

function resizeIFrameHeight(iframe) 
{
    resizeIFrameY(iframe, "500px");
}
