var IE = false ;
if (window.navigator.appName.indexOf("Explorer") !=-1)
{
	IE = true;
}

// Iframe ³»¿¡¼­ È£ÃâÇÏ¿© ÆäÀÌÁö ³ôÀÌ¸¦ ¸ÂÃá´Ù.
function iframe_Init(min)
{
	try 
	{
		var timeArray = new Array(200, 500, 700, 1000, 1200, 1500, 1700, 3500, 7000, 12000, 20000);
		for(var i=0; i < timeArray.length; i++)
			setTimeout('_iframe_Init(\''+min+'\')', timeArray[i]);
	}catch (e) {}
}

// Iframe ³»¿¡¼­ È£ÃâÇÏ¿© ÆäÀÌÁö ³ôÀÌ¸¦ ¸ÂÃá´Ù.
function _iframe_Init(min)
{
	try
	{
		if(min==null || min=="undefined") min = 0;

		if (self.name!=null && self.name!="")
	    {
	        parent._resizeIframe(self.name, min);
	    }
	}catch (e) {}
}

// Á÷Á¢»ç¿ëÀº ±ÝÇÔ. iframe_Init()¸¦ »ç¿ëÇÒ°Í.
function _resizeIframe(name, min)
{
	if(min==null || min=="undefined") min = 0;
    if(name==null || name=="") return;
    
    try
    {
		if (!window.opera)
		{
			if (IE)
			{
				var oBody = document.frames(name).document.body;
				frmWidth = oBody.scrollWidth;// + (oBody.offsetWidth - oBody.clientWidth);
				frmHeight = oBody.scrollHeight;// + (oBody.offsetHeight - oBody.clientHeight);
			}
			else
			{
				var oBody = document.getElementById(name).contentDocument.body;
				frmWidth = oBody.offsetWidth;
				frmHeight = oBody.offsetHeight;
			}

			//alert(frmWidth + ' ' + frmHeight);
			var oIFrame = document.getElementById(name);
			
			if (name == "myframe")
			{	
				if (frmHeight < 540)
					oIFrame.height = 540;
				else
					oIFrame.height = frmHeight;
			}
			else
				oIFrame.height = frmHeight;
		}
    
    }catch (e) {}
}

if (window.addEventListener)
	window.addEventListener("load", iframe_Init, false);
else if (window.attachEvent)
	window.attachEvent("onload", iframe_Init);
else
	window.onload=iframe_Init;