function resizeOnloadIDT() {
	try {
		var height = $jq("#bottomSizeRange").offset().top + 50;
		var width = $jq(document).width();
		//if (width == 717) width = 716;
		//if (width < 730) width = 730;

		try {
			if (document.body.scrollHeight + 40 > height) height = document.body.scrollHeight + 40;
		}
		catch (ex) {}

		setCookie("frameCheckURL"	, location.href);
		setCookie("frameHeight"		, height);
		setCookie("frameWidth"		, width);
		self.resizeTo(width, height);
	}
	catch(e) {
	}
}

var resizeflag = false;
var func = null;

function setFrameSize() {
	try {
		// 기존 onload 함수 가져오기
		func = window.onload;

		// onload 이후는 로직 바로 호출
		if (resizeflag || func == null) {
			resizeOnloadIDT();
			return;
		}

		if (typeof window.onload != "function") {
			window.onload = resizeOnloadIDT;
		}
		else {
			window.onload = function() {
				resizeOnloadIDT();
				func();
			}
		}
		resizeflag = true;
	}
	catch(e) {
	}
}

function setPopupFrameSize() {
	try {
		self.resizeTo(document.body.scrollWidth + 37, document.body.scrollHeight + 40);
	}
	catch(e) {
	}
}

var saveObj = null;

function frameOnloadResize(obj) {
	try {
		if (saveObj == null) saveObj = obj;
		var width	= getCookie("frameWidth");
		var height	= getCookie("frameHeight");
		var url		= getCookie("frameCheckURL");

		//if (height == "") height = "1500";
		//if (url.indexOf("/AB/airbusan/") > -1 && parseInt(height) < 1500) height = "1500";

		if (navigator.appName == "Microsoft Internet Explorer") {
			if (obj.style.height != (height+"px")) obj.style.height = height+"px";
		}
		else {
			if (obj.height != height || obj.style.height != (height+"px")) {
				obj.height = height;
				obj.style.height = height+"px";
			}
		}
	}
	catch(e) {}	
	window.setTimeout("frameOnloadResize(saveObj)", 1000);
}

function setPopupFrameSize2(width, height) {	
	if(width == null) width=$(document).width();
	if(height == null) height=$(document).height();

	if ($("#bottomSizeRange") != null) height = $("#bottomSizeRange").offset().top;

	try {
		self.resizeTo(width+10, height+70);
	}
	catch(e) {}
}
