function iframeAutoHeight (id, h) {
	if (!h) {
		var d = document.getElementsByTagName("div")[0];
		h = (d && d.parentNode.nodeName.toLowerCase()=="body") ? d.offsetHeight : document.body.offsetHeight;
	}
	var frame = parent.document.getElementById(id);
	frame.style.height = h + "px";
	frame.style.overflowX = "hidden";
	frame.style.overflowY = "hidden";
	frame.setAttribute("scrolling", "no");
	document.body.style.overflowX = "hidden";
	document.body.style.overflowY = "hidden";
	if (typeof(parent.setResizeDiv)=="function") parent.setResizeDiv();
	/*parent.window.scroll(0,0);*/
}

if (self.top!=self && window.name) {
	if (parent.document.getElementById(window.name)) {
		var f = function(){ iframeAutoHeight(window.name); };
		if (window.addEventListener) window.addEventListener('load', f, false);
		else window.attachEvent('onload', f);
	}
	// debat fix
	if (typeof(handleAutoHeight)!="function") {
		var handleAutoHeight = f;
	}
}
