function adjustIFrameSize (iframeWindow) {
  if (iframeWindow.document.height) {
	//alert("test");
    var iframeElement = parent.document.getElementById(iframeWindow.name);
    iframeElement.style.height = iframeWindow.document.height + 'px';
    iframeElement.style.width = iframeWindow.document.width + 'px';
  }else if (document.all) {
	//alert("test2");
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat'){
	//alert("test3");
      iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
      iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
	}else{

	if(iframeElement.style.height.match("px") != "px")
	{
		iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
	}
	else
	{
		var h = iframeElement.style.height.substring(0,iframeElement.style.height.length-2);
		var nh = parseInt(h);
		//alert(nh);
		//alert(iframeWindow.document.body.scrollHeight);
		if(nh < iframeWindow.document.body.scrollHeight)
		{
			iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
		}
	}
	
	if(iframeElement.style.width.match("px") != "px")
	{
      		iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
	}
	else
	{
		//alert(iframeElement.style.width);
		var w = iframeElement.style.width.substring(0,iframeElement.style.width.length-2);
		var nw = parseInt(w);
		//alert(nw);
		//alert(iframeWindow.document.body.scrollWidth);
		if(nw <= iframeWindow.document.body.scrollWidth + 5)
		{
			iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
		}
	}
    }
  }
}


