﻿function resizeIframe(iframeId) {
	var iframe = document.getElementById(iframeId);
	try {
		iframe.height = 50 + "px";
		var bHeight = iframe.contentWindow.document.body.scrollHeight;
		var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		iframe.height = height + "px";
	}
	catch (ex) {
	}
}
function resizeParentIframe(parentIframeId) {
	var iframe = window.parent.document.getElementById(parentIframeId);
	try {
		var bHeight = window.document.body.scrollHeight;
		var dHeight = window.document.documentElement.scrollHeight;
		var doHeight = window.document.documentElement.offsetHeight;
		var height = Math.max(bHeight, dHeight);
		if (CheckBrowser() != "IE") {
			if (iframe.height != doHeight) {
				iframe.height = doHeight + "px";
			}
		} else {
			if (iframe.height != height) {
				iframe.height = height + "px";
			}
		}
	}
	catch (ex) {
	}
}
function intervalParentIframe(parentIframeId, times) {
	window.setInterval("resizeParentIframe('" + parentIframeId + "')", times);
}
function CheckBrowser() {
	var app = navigator.appName;
	if (app.indexOf("Netscape") != -1) {
		return "NoIE";
	} else {
		if (app.indexOf("Microsoft") != -1) {
			return "IE";
		}
	}
}