// Automatically fit iframe to content
function autofitIframe()
{
	var id="contentFRM";
	
	if (!window.opera && !document.mimeType && document.all && document.getElementById){
		window.parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
	}
	else if(document.getElementById) {
		window.parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px"
	}
}

// ------------------------------------------------------------------------------------------------
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// ------------------------------------------------------------------------------------------------
function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}
}

addLoadEvent(autofitIframe);	// run autofitIframe
