// Note: iframe resizing doesn't work when the iframe content is from a different domain as this leads to access denied errors
function geResizeIframeHeight(elmnt)
{
	var h;
	try {
		if (elmnt.contentDocument) {
			h = elmnt.contentDocument.body.scrollHeight;
		} else {
			h = document.frames(elmnt.id).document.body.scrollHeight;
		}
		h += 100; // Add some space so that the scroll bar is hidden during the 1st load
		if (h < 150) // Occurs in IE during a refresh
			h = 3000;
		elmnt.style.height = h + 'px';
	} catch (e) {
		// Most likely because we cannot resize when the iframe is refreshed or after a form action	
		elmnt.style.height = '3000px';
	}
}

// IE requires iframe to have id for JS resizing
// To prevent duplicate ids, when there are multiple iframes on the same page, we increment the old value
if (geId) {
	geId++;
} else {
	var geId = 1;
}
var id = "geFrame" + geId;

// There is a peculiar bug in Chrome that causes problems when a query string
// parameter contains the exact string in the base URL definition. For now we
// use a workaround of replacing the string "goExpo" with "__GEDIR".
geIframeUrl = geIframeUrl.replace(/goExpo/g, '__GEDIR');

document.write('<iframe id="' + id + '" src="' + geIframeUrl + '" frameborder="0" marginheight="0" marginwidth="0" width="100%" allowtransparency="true" onload="geResizeIframeHeight(this);"></iframe>');
