function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) {
    var iframeElement = document.getElementById
(iframeWindow.name);
    if ( iframeWindow.document.height >= 1000 ) { iframeElement.style.height = iframeWindow.document.height + 'px'; }
	   else { iframeElement.style.height = '1000px'; }
    iframeElement.style.width = iframeWindow.document.width + 'px';
  }
  else if (document.all) {
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat') 
    {
		if ( iframeWindow.document.documentElement.scrollHeight >= 1000 )
		{
      iframeElement.style.height = 
iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
		}
		else
		{
			iframeElement.style.height = "1005px";
		}
      iframeElement.style.width = 
iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
    }
    else {
		if ( iframeWindow.document.body.scrollHeight >= 1000 )
		{
      iframeElement.style.height = 
iframeWindow.document.body.scrollHeight + 5 + 'px';
		}
		else
		{
			iframeElement.style.height = "1005px";
		}
      iframeElement.style.width = 
iframeWindow.document.body.scrollWidth + 5 + 'px';
    }
  }
}
