document.write("<iframe id='resizeFrame' width=783px height=0 frameborder=0 border=0></iframe>");

function setFrameSize() {
	try {
		setCookie("frameHeight"	, document.body.scrollHeight + 100);
		setCookie("frameWidth"	, document.body.scrollWidth);
		/*
		if (navigator.appName == "Microsoft Internet Explorer") {
			self.resizeTo(document.body.scrollWidth, document.body.scrollHeight + 20);
		}
		else {
			parentFrameSize(document.body.scrollHeight);
		}
		*/
	}
	catch(e) {
		/*
		try {
			parentFrameSize(document.body.scrollHeight);
		}
		catch(e) {
		}
		*/
	}
}

function setFrameScrollTop(scrollTop) {
	try {
		setCookie("frameScrollTop", scrollTop);
	} catch(e) {
		
	}
}

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

function parentFrameSize(height) {
	var hosts = "";
	if (document.URL.indexOf("https://")==-1){hosts = "http://";}else{hosts = "https://";}
	var link	= hosts +"asianaclub.flyasiana.com/module/ResizeControl.jsp";
	var obj	= document.getElementById("resizeFrame");
	obj.src		= link + "?height=" + height;
}

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

		if (oldHeight != height) {
			if (navigator.appName == "Microsoft Internet Explorer") {
				// IE9 ÀÎ °æ¿ì È­¸é ³ôÀÌ ¼³Á¤ ¹æ¹ýÀÌ ±âÁ¸ IE¿Í ´Ù¸£°Ô ¼³Á¤µÈ´Ù. - 2011.04.04 (¿¡¾î¼ÒÇÁÆ®)
				var IEVersion = getInternetExplorerVersion();
				if (IEVersion < 9) {
					obj.style.height	= height;	
				} else {
					obj.height			= height;
				}
			} else {
				obj.height			= height;
			}
			oldHeight = height;
		}
		
		saveObj = obj;
	}
	catch(e) {;}

	window.setTimeout("frameOnloadResize(saveObj)", 1000);
}

function frameOnloadScrollTop(obj) {
	try {
		var scrollTop	= getCookie("frameScrollTop");
		
		if (scrollTop != -1) {
			document.documentElement.scrollTop = scrollTop;
			setCookie("frameScrollTop", -1);
		}
		
		saveObj = obj;
	}
	catch(e) {;}

	window.setTimeout("frameOnloadScrollTop(saveObj)", 500);
}

function getInternetExplorerVersion() {
	var rv = -1;
	var ua = navigator.userAgent;
	var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
	
	if (re.exec(ua) != null) {
		rv = parseFloat(RegExp.$1);
	}
	
	return rv;
}
