/** 
 * »õÃ¢¶Ù¿ì±â
 */
function fnNW(url,width,height,name) 
{
	var bsleft=(screen.width/2)-width/2;
	var bstop=(screen.height/2)-height/2;
	if(name) var NW=open(url,name,'left='+bsleft+',top='+bstop+',width='+width+',height='+height+',toolbars=no,scrollbars=no,resizable=no');
	else var NW=open(url,'','left='+bsleft+',top='+bstop+',width='+width+',height='+height+',toolbars=no,scrollbars=no,resizable=no');
	//NW.document.location.href = url;
	NW.focus();
}

/**
 * »õÃ¢¶Ù¿ì±â(½ºÅ©·ÏÆ÷ÇÔ)
 */
function fnNWs(url,width,height,name,bstop,bsleft) 
{
	if(bstop=='') var bsleft = (screen.width/2)-width/2;
	if(bsleft=='') var bstop = (screen.height/2)-height/2;
	if(name) var NWs = open(url,name,'left='+bsleft+',top='+bstop+',width='+width+',height='+height+',toolbars=no,scrollbars=yes,resizable=yes');
	else var NWs = open(url,'','left='+bsleft+',top='+bstop+',width='+width+',height='+height+',toolbars=no,scrollbars=yes,resizable=yes');
	//NWs.document.location.href = url;
	NWs.focus();
}

/**
 * »õÃ¢¶Ù¿ì±â(Æ¯Á¤À§Ä¡)
 */
function fnNWp(url,swidth,sheight,st,sl,so,ro,obj) 
{
	var bsleft=(screen.width/2)-swidth/2;
	if(screen.height>600) var bstop=(screen.height/2)-sheight/2; 
	else var bstop=10;
	
	if(so=='') so="no";
	if(ro=='') so="no";
	if(st!='') bstop=st;
	if(sl!='') bsleft=sl;
	var obj=window.open(url,obj,"scrollbars="+so+",resizable="+ro+",width="+swidth+",height="+sheight+",top="+bstop+",left="+bsleft);
	obj.focus();
}

/**
 * XP SP2Ã¼Å©
 */
function IsWinXPSP2() 
{
	try
	{
		var info = window.clientInformation;
		var reg1 = /[^A-Z0-9]MSIE[ ]+6.0[^A-Z0-9]/i;
		var reg2 = /[^A-Z0-9]WINDOWS[ ]+NT[ ]+5.1[^A-Z0-9]/i;

		if ((info.appMinorVersion.replace(/\s/g,"").toUpperCase().indexOf(";SP2;") >= 0) &&
			(reg1.test(info.userAgent) == true) && (reg2.test(info.userAgent) == true))
		{
			return true;
		}
	}
	catch(e)
	{
		return false;
	}
	
	return false;
}

/**
 * ÄíÅ°°ü·Ã
 */
function getCookie(name) 
{
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) 
	{
		begin = dc.indexOf(cname);
		
		if (begin != -1) 
		{
			begin += cname.length;       
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
		} 
	}
	return null;
}

function setCookie(name, value) 
{
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expires );
		
	document.cookie = name + "=" + value +
	((expires == null) ? "" : ("; expires="+todayDate.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

/**
 * °î¹éÁ¦°Å
 */
function trim(str) 
{ 
	var count = str.length; 
	var len = count;                 
	var st = 0; 
	while ((st < len) && (str.charAt(st) <= ' '))  st++; 
	while ((st < len) && (str.charAt(len - 1) <= ' ')) len--; 
	return ((st > 0) || (len < count)) ? str.substring(st, len) : str ;   
}

/**
 * ÆË¾÷°øÁö
 */
function openpop(url, key, swidth, sheight, st, sl, so)
{
	var bsleft = (screen.width/2)-swidth/2;
	if(screen.height > 600) var bstop = (screen.height/2)-sheight/2; 
	else var bstop = 10;
	
	if(so == '') so = "no";
	if(st != '') bstop = st;
	if(sl != '') bsleft = sl;
	if (getCookie('eye'+key) != 1) 
	{
	    try 
	    {
		    var openwin = window.open(url,"openwin"+key,"status=yes,scrollbars="+so+",resizable=no,width="+swidth+", height="+sheight+",top="+bstop+",left="+bsleft);
		    openwin.focus();
		} catch(e) 
		{
		    ;
		} 
		
	}
}

/**
 * ¿ÀÇÂ ÀÌº¥Æ® ÆË¾÷
 */
function popopen() 
{
	window.open('popup_event.aspx', 'popupen', 'width=430,height=650,status=yes,scrollbars=no, resizable=no,menubar=no');
}

function popup_agree() 
{
	window.open('popup_agree.aspx', 'popup_agree', 'width=591,height=371,status=yes,scrollbars=no, resizable=no,menubar=no');
}

function popup_safepolicy() 
{
	window.open('popup_safepolicy.aspx', 'popup_safepolicy', 'width=591,height=371,status=yes,scrollbars=no, resizable=no,menubar=no');
}

function popup_emailpolicy() 
{
	window.open('popup_emailpolicy.aspx', 'popup_emailpolicy', 'width=464,height=240,status=yes,scrollbars=no, resizable=no,menubar=no');
}