function getElem(id)
{
  var el;
  if(document.getElementById) el = document.getElementById(id);
  else el = document.all(id);
  return el;
}
function resizeIFrame(iframeId, extraHeight)
{
  try
  {
    if (typeof(extraHeight) == "undefined") extraHeight = 0;
    var iframeHeight = 0;
    var canResize = false;
    var iframe = getElem(iframeId);
    var iframeWnd = iframe.contentWindow;
    if (typeof(iframeWnd.document.height) != "undefined") // ns6
    {
      var iframeElem = getElem(iframeWnd.name);
      iframeHeight = iframeWnd.document.height;
      canResize = true;
    }
    else if (document.all) //ie
    {
      var iframeElem = document.all[iframeWnd.name];
      if (iframeWnd.document.compatMode && iframeWnd.document.compatMode != 'BackCompat') //Back compliant
      {
        iframeHeight = iframeWnd.document.documentElement.scrollHeight;
        canResize = true;
      }
      else //CSS1compliant
      {
        if (String(iframeElem) != "undefined")
        {
          iframeHeight = iframeWnd.document.body.scrollHeight;
          canResize = true;
        }
      }
    }
    if (canResize && iframeElem.style != null)
      iframeElem.style.height = iframeHeight + extraHeight + 'px';
  }
  catch(e) {}
}
