function SizeWidget(widgetId)
{
	var maxWidgetHeight = 10000;
	var wid = document.getElementById(widgetId);
	var firstAttempt = (arguments.length == 1);

	Trumba.Try.these(
		// Mozilla/Netscape/FireFox/Opera/Safari
		function()
		{ 
			wid.height = Math.min(wid.contentDocument.body.offsetHeight, maxWidgetHeight) + 20;
		},
		
		// Internet Explorer
		function() {
			// IE 6 exports the Document method which is really a stub to the IWebBrowser.Document
			// method.  It works fine and gives us more reliable sizing that using frames[]
			// for some reason.  Every IFRAME is an instance of a WebBrowser object.
			wid.height = Math.min(wid.Document.body.scrollHeight, maxWidgetHeight) + 2;
		},

		
		// Fallback to frames...
		function() { 
			wid.height = Math.min(frames[widgetId].document.body.scrollHeight, maxWidgetHeight) + 2;
		},
		
		// didn't work - try again if it's our first try
		function()
		{
			if (firstAttempt)
				window.setTimeout(function() { SizeWidget(widgetId, true); }, 200);
		}
	);
}

