//  resizeIframe(FRAMENAME) dynamically resizes the height of an iframe based on its content.
//      syntax: <body onLoad="resizeIframe('nameOfIframeOnParentPage');">
//
//  If you are using this script to resize iframes where the domain name of the child page
//  may vary from the domain name of the parent, the following MUST BE DECLARED ON BOTH
//  PARENT (in the case of sitezen pages, this can be on the page master javascript pane)
//  AND THE CHILD PAGE:
//
//      document.domain="mydomain.com";
//
//  -- Michael Lieberman <mjl@funeralnet.com> 30 Nov 2006


/* ORIGINAL
function resizeIframe(theframe) {
if (document.getElementById && (window != top))
{
	var theheight;
	var theiframe = parent.document.getElementById(theframe);
//if (! document.mimeType) alert("No document.mimeType.");
//if (! document.mimetype) alert("No document.mimetype.");
	if (!window.opera && !document.mimetype && document.all) {
	theheight = this.document.body.offsetHeight;
	} else {
	theheight = this.document.body.scrollHeight;
	}
	theiframe.style.height   = theheight + "px";
	theiframe.style.overflow = "hidden";
}
}
*/

function resizeIframe(theframe,minheight){
	var mybody = document.documentElement;
	var mybody2 = document.body
//	var mybody = document.documentElement || document.body;
	var minheight = minheight || 100;
	if (document.getElementById && (window != top)){
		var theiframe = parent.document.getElementById(theframe);
		theiframe.style.height=minheight+'px';
		var myScrollHeight = (mybody.scrollHeight > mybody2.scrollHeight)
			? mybody.scrollHeight : mybody2.scrollHeight;
		var myOffsetHeight = (mybody.offsetHeight > mybody2.offsetHeight)
			? mybody.offsetHeight : mybody2.offsetHeight;
		var theheight = (myScrollHeight > myOffsetHeight)
			? myScrollHeight : myOffsetHeight;
		theheight = (theheight > minheight)
			? theheight : minheight;
		theheight += 20;
		theiframe.style.height=theheight+'px';
		theiframe.style.overflow='hidden'; // sometimes breaks table layouts in IE [mjl]
	}
}

function resizeIframe_notop(theframe,minheight) {
	var mybody = document.body || document.documentElement;
	var minheight = minheight || 100;
	if (document.getElementById && (window != top)){
		var theiframe = parent.document.getElementById(theframe);
		//theiframe.style.height=minheight+'px';
		var theheight = (mybody.scrollHeight > mybody.offsetHeight)
		? mybody.scrollHeight : mybody.offsetHeight;
		theheight += 10;
		theiframe.style.height=theheight+'px';
		theiframe.style.overflow='hidden';
	}
}

function resizeIframe_notop2(theframe) {
	if (document.getElementById && (window != top))
	{
		var mybody = document.documentElement || document.body;
		var theheight;
		var theiframe = parent.document.getElementById(theframe);
		//if (! document.mimeType) alert("No document.mimeType.");
		//if (! document.mimetype) alert("No document.mimetype.");
		if (!window.opera && !document.mimetype && document.all) {
			theheight = this.document.body.offsetHeight;
		} else {
			//theheight = this.document.body.scrollHeight; //Aurelien 2011-03-23
			theheight = (mybody.scrollHeight > mybody.offsetHeight)
			? mybody.scrollHeight : mybody.offsetHeight;
		}
		theheight += 10;
		theiframe.style.height = theheight + "px";
		theiframe.style.overflow = "hidden";
	}
}

function listObjectProperties(obj) {
	var msg = '';
	for (var p in e) {
		msg += p + ' = "' + e.p + "\"\n";
	}
	alert(msg);
}
