﻿// JScript 파일
function is_str(str)
{
	if ( typeof str == "undefined")	 	return false;
	return	str.length > 0;
}

/* 프레임 최소치 설정 */
function setMinFrameSize( width, height )
{
	frmMinWidth = width;
	frmMinHeight = height;
	minSizeVal = true;
}

/* 프레임 최대치 설정 */
function setMaxFrameSize( width, height )
{
	frmMaxWidth = width;
	frmMaxHeight = height;
	maxSizeVal = true;
}

/* 스크롤바 상단으로 */
function setScrollTop()
{
	return false;
	if (document.location.search.indexOf("26") != -1)	document.body.scrollTop = 0+"px";
}

/* 프레임 리사이즈 */
function resizeIframe(name)
{    
    
	if (!is_str(name))	name = "IFrame";	
	
	try
	{
		var oBody;
		var frmWidth;
		var frmHeight;
		if (navigator.appName == "Microsoft Internet Explorer") 
        {       
		    oBody = document.frames(name).document.body;
		    frmWidth  = oBody.scrollWidth;
	        frmHeight = oBody.scrollHeight;
		}
		else
		{
		    oBody = parent.document.getElementById(name).contentDocument.body;
		    frmWidth  = oBody.offsetWidth;//contentDocument.body.offsetHeight
		    frmHeight = oBody.offsetHeight;
		}		
		
		var oFrame = document.all[name];					
		
		if ( minSizeVal )
		{
			frmWidth  = Math.max(frmWidth, frmMinWidth);
			frmHeight = Math.max(frmHeight, frmMinHeight);
		}
		if ( maxSizeVal )
		{
			frmWidth  = Math.min(frmWidth, frmMaxWidth);
			frmHeight = Math.min(frmHeight, frmMaxHeight);
		}
		
//		alert( frmWidth );
//		alert( frmHeight );
		
		setScrollTop();
		oFrame.style.height = frmHeight+50+"px";
		oFrame.style.width  = frmWidth+"px";
	}
	catch(e){
	    alert(e);
	}
}

