if (window != window.top)
	window.setTimeout(function() {
		nfwAdjustFrameElement(0);
	}, 0);

function nfwAdjustFrameElement(_nDelay)
{
	try 
	{
		document.body.onclick = function() {
			nfwAdjustFrameElement(0);
		};
		window.frameElement.height = document.body.offsetHeight + 50;
		// perchè +50? un po' di extra non fa male, e altrimenti safari in certi casi va
		// in fibrillazione (scrollbar si, scrollbar no, scrollbar si, scrollbar no...)
	}
	catch(e)
	{
		// do nothing, but required cause document.body and window.frameElement may be null here
	}
	// stop if total wait time > 10 seconds
	if (_nDelay * (_nDelay + 1) / 2 > 10000)
		return;
	_nDelay = _nDelay + 1;
	window.setTimeout(function() {
		nfwAdjustFrameElement(_nDelay);
	}, _nDelay);
}
