/**
 * Adjusts the size of the iframe to its content.
 */
function adjustIFrameSize (iframeWindow) {
	try {
		
		var size = 3000;
		if (iframeWindow.document.height) {
			var iframeElement = document.getElementById(iframeWindow.name);
			size = iframeWindow.document.height;
		} else if (document.all) {	
			var iframeElement = document.all[iframeWindow.name];
			if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {					
				size = iframeWindow.document.documentElement.scrollHeight;
			} else {
				size = iframeWindow.document.body.scrollHeight;
			}
		}
		iframeElement.style.height = (size+25)+"px";
	}catch( ex ) {
		//alert("Error: "+ex);
	}
}

/**
 * Calls the iframe-surrounding document to adjust the
 * size of the iframe to its content and scrolls to the 
 * top of the document.
 *
 * To prevent from unintended error messages, the main part 
 * is within a try and catch block.  
 */
function adjustIframe(scrollToTop) {
	try {
		if(parent.adjustIFrameSize) {
			
			if(!Prototype.Browser.Gecko) // if firefox keep height to 1600px
				parent.adjustIFrameSize(window);
				
			if(scrollToTop) {
				parent.scrollTo(0,0);
			}
		}
	} catch( ex ) {
	}
}
