﻿<!--
// 브라우저 버젼 체크
function BrowserCheck() 
{
	if(window.navigator.userAgent.indexOf("SV1") != -1) {
		return "SV1";
	} else if(window.navigator.userAgent.indexOf("IE") != -1 ) {
		if(window.navigator.userAgent.indexOf("MSIE 7.0") != -1)
			return "IE7";
		else if(window.navigator.userAgent.indexOf("MSIE 8.0") != -1)
			return "IE8";
		else
			return "IE6";
	} else {
		return "";
	}
}

// 팝업창 자동 리사이즈
function SelfResize()
{
	var szResult = BrowserCheck();
	var add_width = 10;
	var add_height = 0;

	if(szResult == "SV1") {
		add_height = 30;
	} else if(szResult == "IE7" || szResult == "IE8") {
		add_height = 50;
	} else if(szResult == "" ) {
		add_height = 60;
	} else {
		add_height = 0;
	}

	try
	{
		var oBody  = document.body;
		window.resizeTo(oBody.scrollWidth+add_width, oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight)+add_height );
	}
	catch (e)
	{
		Trace("SelfResize()오류:"+e.description);
	}
}


// 팝업창 자동 리사이즈
function SelfResize2(nWidth, nHeight)
{
	var szResult = BrowserCheck();
	var add_width = 10;
	var add_height = 0;

	if(szResult == "SV1") {
		add_height = 30;
	} else if(szResult == "IE7" || szResult == "IE8") {
		add_height = 50;
	} else if(szResult == "" ) {
		add_height = 60;
	} else {
		add_height = 0;
	}

	try
	{
		window.resizeTo(nWidth+add_width, nHeight+add_height );
	}
	catch (e)
	{
		Trace("SelfResize2()오류:"+e.description);
	}
}


// 브라우저 닫기
function SelfClose()
{
	var szResult = BrowserCheck();

	if(szResult == "IE7" || szResult == "IE8")
	{
		window.open('about:blank','_self').close();
	}
	else
	{
		self.opener = this; 	
		self.close();
	}
}
//-->