function getDocHeight(doc)
{
	var docHt = 0, sh, oh;
	if (doc.height) docHt = doc.height;
	if (doc.body)
	{
		if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
		if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
		if (sh && oh)
		{
			if (navigator.userAgent.toLowerCase().indexOf('chrome') > 0)
			{
				docHt = Math.min(sh, oh);
			}
			else
			{
				docHt = Math.max(sh, oh);
			}
		}
	}
	return docHt;
}

function setIframeHeight(ifrm) 
{
	var iframeWin = window.frames[ifrm];
	var iframeEl = document.getElementById ? document.getElementById(ifrm): document.all ? document.all[ifrm]: null;
	if (iframeEl && iframeWin) {
		iframeEl.style.height = "auto";
		var docHt = getDocHeight(iframeWin.document);
		docHt = (docHt < getDocHeight(this.document) - iframeEl.offsetTop) ? getDocHeight(this.document) - iframeEl.offsetTop : docHt;
		if (docHt)
			iframeEl.style.height = docHt + 20 + "px";
	}
}