function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) { // FireFox
    var iframeElement = document.getElementById(iframeWindow.name);
    var windowSize = iframeWindow.document.height * 1;

    if(!iframeElement) return;
    iframeElement.style.height = iframeWindow.document.height + 'px';
    iframeElement.style.width = iframeWindow.document.width + 'px';
    iframeElement.setAttribute("scrolling", "no");

    if(windowSize > 32000) { // FireFox bug: will size correctly but not display dynamic content past the 32000px mark
    	iframeElement.setAttribute("scrolling", "yes");
    	iframeElement.style.height = "32000px";
    }
  }
  else if (document.all) {
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat'){
      iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
      if((iframeWindow.document.documentElement.scrollWidth + 5) < 965) {
        iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
      }
      iframeElement.setAttribute("scrolling", "no");
    } else {
      iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
      iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
      iframeElement.setAttribute("scrolling", "no");
    }
  }
}