BN_NUMBER = 1;
BN_ENGLISH = 2;
BN_HANGUL = 3;
BN_SPECIALCHARS = 4;
BN_OTHERS = 0

undefined = null; // IE Version Error undefined variable
///////////////////////////////////////////////////////////
// Cookie°ü·Ã ÇÔ¼ö
//-----------------------------------------------------------

function GetCookieValue(name) {
	var arg = name + "=";
	var alen = arg.length;
	var cookiestr = unescape(document.cookie);
	var clen = cookiestr.length;
	var i = 0;
	while (i < clen) {
	var j = i + alen;
		if (cookiestr.substring(i, j) == arg) {
//			window.alert(cookiestr.substring(i, j));
			return GetCookieByOffset(j);
		}
		i = cookiestr.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function GetCookieByOffset(offset) {
	var cookiestr = unescape(document.cookie);
	var endstr = cookiestr.indexOf (";", offset);
	if (endstr == -1)
		endstr = cookiestr.length;
	return cookiestr.substring(offset, endstr);
}

// ¿©±âºÎÅÍ ÆÛ¿Â Public Code - sjyoon
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

//setCookie(name,value,[expires],[path],[domain],[secure])
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;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
     ((secure == true) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}


///////////////////////////////////////////////////////////
// Man == 1 , Femail == 2
//-----------------------------------------------------------
// by elos. string functions.
var b19;
b19=1;
function str_replace(str,schr,rchr)
{
	var i,tempstr;
	tempstr = '';
	for(i=0;i<str.length;i++)
	{
		if(str.substring(i,i+schr.length)!=schr)
		{
			tempstr=tempstr+str.charAt(i);
		}
		else
		{
			tempstr = tempstr+rchr;
			i=i+schr.length-1;
		}
	}
	return tempstr;
}

function str_ltrim(str)
{
	var i;
	for(i=0;i<str.length;i++)
	{
		if(str.charAt(i)!=' ') break;
	}
	return str.substring(i,str.length);
}

function str_rtrim(str)
{
	var i,tempstr;
	for(i=1;i<=str.length;i++)
	{
		if(str.charAt(str.length-i)!=' ') break;
	}
	return str.substring(0,str.length-i+1);
}

function str_trim(str)
{
	return str_ltrim(str_rtrim(str));
}

//-----------------------------------------------------------
function isNet2()
{
 if(navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
  return 2;

 if(navigator.appName.indexOf("Netscape")!=-1)
  if(navigator.userAgent.indexOf("Mozilla/2.")!=-1)
   return 1;
  return 0;
}

function showzipcode(id) {
 closezipcode();
// var Net2 = isNet2();
 zipcodewindow = window.open("/scripts/tool/zipcode.asp?id="+id, "zipcode",
  "scrollbars=yes,resizable=yes,width=430,height=300,location=center");
// if(Net2==1) self.zipcodewindow.creator = self;
}

function showzipcode2(id, ziph, zipt) {
 closezipcode();
// var Net2 = isNet2();
 zipcodewindow = window.open("/scripts/tool/zipcode.asp?id="+id + "&zipcode=" + ziph.value + "-" + zipt.value, "zipcode",
  "scrollbars=yes,resizable=yes,width=430,height=300,location=center");
// if(Net2==1) self.zipcodewindow.creator = self;
}

function zipcodePopup(id, ziph, zipt) {
 closezipcode();
// var Net2 = isNet2();
 zipcodewindow = window.open("/scripts/tool/zipcodePopup.asp?id="+id + "&zipcode=" + ziph.value + "-" + zipt.value, "zipcode",
  "scrollbars=yes,resizable=yes,width=430,height=300,location=center");
// if(Net2==1) self.zipcodewindow.creator = self;
}

function zipcodePopup_seoul(id, ziph, zipt) { // ¼­¿ï °æ±â¸¸ º¸¿©ÁÜ
 closezipcode();
// var Net2 = isNet2();
 zipcodewindow = window.open("/scripts/tool/zipcodePopup_seoul.asp?id="+id + "&zipcode=" + ziph.value + "-" + zipt.value, "zipcode",
  "scrollbars=yes,resizable=yes,width=430,height=300,location=center");
// if(Net2==1) self.zipcodewindow.creator = self;
}

function showzipcodedetail(id) {
 closezipcode();
// var Net2 = isNet2();
 zipcodewindow = window.open("/cgi-bin/tool/zipcode.dll?id="+id+"&detail=1", "zipcode",
  "scrollbars=yes,resizable=yes,width=430,height=300,location=center");
// if(Net2==1) self.zipcodewindow.creator = self;
}

//-----------------------------------
// Á÷¾÷°Ë»ö 2005.5.19.  by zigis
//-----------------------------------
var JobFinderWindow = null;
function showJobFinder(id)
{
	if( JobFinderWindow != null ) {
		if( JobFinderWindow.closed == false )
			JobFinderWindow.close();
	}
	var JobFinderWindow;
	goUrl = "/scripts/tool/jobfinder.asp?id="+id;
//	JobFinderWindow = window.open(goUrl, "jobfinder", "scrollbars=no, resizable=yes, status=yes, width=457,height=400,location=center");
	JobFinderWindow = window.open(goUrl, "jobfinder", "scrollbars=no, dependent, alwaysRaised, width=457,height=400,location=center");
	JobFinderWindow.opener = self
}

///////////////////////////////////////////
// Á÷¾÷°Ë»ö New ..........  by zigis
///////////////////////////////////////////
function showJobFinder_company(productCode, id)
{
	companyCode = productCode.substring(0,3);

	// 2007.10.5 Á÷¾÷ÄÚµå ·ÎÁ÷ ¼öÁ¤

	/*
	if(productCode!=null)
	{
		checkcompany = productCode.substring(0,1);
		companyCode = productCode.substring(0,3);
	}
	if ( checkcompany == '1' )
	{
		if(companyCode=='1sy')
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=1sy";
		}
		else if (companyCode == '1dy')
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=1dy";
		}
		else
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=1dy";
		}
	}
	else if ( checkcompany == '2' )
	{
		if(companyCode == '2mt')
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=2mt";
		}
		else if(companyCode=='2ds')
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=2ds";
		}
		else if(companyCode=='2kh')
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=2kh";
		}
		else
		{
			url = "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=2kh";
		}
	}
	else
	{
		url =  "/scripts/tool/JobFinder.asp?id="+id+"&companyCode=1dy";
	}
	*/
	url = "/scripts/tool/jobfinder.asp?id="+id+"&companyCode="+companyCode;
	closezipcode();
	var JobFinderWindow;
	JobFinderWindow = window.open(url, "jobfinder", "scrollbars=no,resizable=no,width=457,height=420,location=center");
}

function showjobfinder(id) {
var zipcodewindow;
 closezipcode();
 //var Net2 = isNet2();
 zipcodewindow = window.open("/cgi-bin/tool/jobfinder.dll?id="+id, "jobfinder",
  "scrollbars=yes,resizable=yes,width=420,height=500,location=center");
 //if(Net2==1) self.zipcodewindow.creator = self;
}

function showdsjobfinder(id) {
var zipcodewindow;
 closezipcode();
 //var Net2 = isNet2();
 zipcodewindow = window.open("/cgi-bin/tool/dsjobfinder.dll?id="+id, "jobfinder",
  "scrollbars=yes,resizable=yes,width=420,height=500,location=center");
 //if(Net2==1) self.zipcodewindow.creator = self;
}

function closezipcode() {
 var Net2 = isNet2();
 if((Net2==2 && self.zipcodewindow) || (Net2==1 && self.zipcodewindow && self.popWindow.creator) || (Net2!=1 && self.zipcodewindow && self.zipcodewindow.opener)) {
  zipcodewindow.close();
  zipcodewindow = null;
 }
}


var dicwindow=null;

function showdicwindow() {
closedictionary();
dicwindow = window.open('/magazine/boheom_info/insterm/insdic.asp', 'insterm', 'scrollbars=yes,resizable=yes,width=430,height=500,location=center');
}


function showdictionary(term) {
closedictionary();
if( isNet2() == 2 )
dicwindow = window.open('/scripts/tool/instermpage.asp?book=0&term='+term, 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
else
dicwindow = window.open('/scripts/tool/instermpage.asp?book=0&term='+escape(term), 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');

}

function showfireterm(term) {
closedictionary();
if( isNet2() == 2 )
dicwindow = window.open('/scripts/tool/instermpage.asp?book=1&term='+term, 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
else
dicwindow = window.open('/scripts/tool/instermpage.asp?book=1&term='+escape(term), 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');

}


function showlifeterm(term) {
closedictionary();
if( isNet2() == 2 )
dicwindow = window.open('/scripts/tool/instermpage.asp?book=2&term='+term, 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
else
dicwindow = window.open('/scripts/tool/instermpage.asp?book=2&term='+escape(term), 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
}

function showlifeterm2(productcode, term) {
closedictionary();

if( isNet2() == 2 )
dicwindow = window.open('/scripts/tool/instermpage.asp?book=3&term='+term+'&productcode='+escape(productcode), 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
else
dicwindow = window.open('/scripts/tool/instermpage.asp?book=3&term='+escape(term)+'&productcode='+escape(productcode), 'insterm', 'scrollbars=yes,resizable=yes,width=350,height=200,location=center');
}

function closedictionary() {
 var Net2 = isNet2();
 if((Net2==2 && self.dicwindow) || (Net2==1 && self.dicwindow && self.dicwindow.creator) || (Net2!=1 && self.dicwindow && self.dicwindow.opener)) {
  dicwindow.close();
  dicwindow = null;
 }
}

function FindComboIndex( combo , string )
{
	for( i = 0 ; i < combo.options.length ; i++ ) {
		if( combo.options[i].value == string ) return i ;
	}

	return -1 ;
}

function FindTextComboIndex( combo , string )
{
	for( i = 0 ; i < combo.options.length ; i++ ) {
		if( combo.options[i].text == string ) return i ;
	}

	return -1 ;
}

function ShowWindow( file, width, height )
{
	window.open( file , "º¸Çè³Ý", "scrollbars=yes,resizable=yes,width='+width+',height='+height+',location=center" )

}

function ShowHelp( file )
{
	window.open( file , "carhelp", "toolbar=no,width=500,height=400,scrollbars=yes" )

}

function ShowHelpWH( file , w, h)
{
	window.open( file , "carhelp", "toolbar=no," + "width=" + w + ",height=" + h+",scrollbars=yes" )
}

function ShowHelpSize( file , w, h)
{
	window.open( file , "carhelp", "toolbar=no," + "width=" + w + ",height=" + h+",scrollbars=no" )
}

function findsex( ssnt )
{
	if( ssnt.charAt(0) == '1' || ssnt.charAt(0) == '3' || ssnt.charAt(0) == '5' || ssnt.charAt(0) == '7')
		return 1
	else if( ssnt.charAt(0) == '2' || ssnt.charAt(0) == '4' || ssnt.charAt(0) == '6' || ssnt.charAt(0) == '8')
		return 2
}


function findage( ssnh , b19 )
{
	if( ssnh == '000000')
		return 0;

	today = new Date()
	year = (ssnh.charAt(0)-'0')*10
	year += ssnh.charAt(1)-'0'

	month = (ssnh.charAt(2)-'0')*10
	month += ssnh.charAt(3) - '0'
	day = (ssnh.charAt(4)-'0')*10
	day += ssnh.charAt(5)-'0'

	if( b19 ) year += 1900
	else year += 2000

	age = today.getFullYear() ;

//	if( age < 1900 ) age += 1900 ;
	age = age - year

	if( (today.getMonth()+1) < month ) age = age-1
	else if( (today.getMonth()+1) == month ) {
		if( today.getDate() < day ) age = age -1
	}


	return age
}

function bfindage( ssnh , b19 ) //by jhk -- calculate boheom age
{
	if( ssnh == '000000')
		return 0;

	today = new Date()
//	addday = new Date(0,6,0,0,0,0)
	bmon = today.getMonth();
    byear = today.getFullYear();
	if( (bmon + 6) > 12)  {
		today.setMonth(bmon+6-12)
		today.setFullYear(byear+1)
	}
	else
	{
		today.setMonth(bmon+6)
	}
	year = (ssnh.charAt(0)-'0')*10
	year += ssnh.charAt(1)-'0'

	month = (ssnh.charAt(2)-'0')*10
	month += ssnh.charAt(3) - '0'
	day = (ssnh.charAt(4)-'0')*10
	day += ssnh.charAt(5)-'0'

	if( b19 ) year += 1900
	else year += 2000

	age = today.getFullYear() ;

//	if( age < 1900 ) age += 1900 ;
	age = age - year

	if( (today.getMonth()+1) < month ) age = age-1
	else if( (today.getMonth()+1) == month ) {
		if( today.getDate() < day ) age = age -1
	}


	return age
}

function bfindage2( ssnh , ssnt )
{
	if( ssnh == '000000')
		return 0;

	if( ssnt.charAt(0) == '1' || ssnt.charAt(0) == '2' || ssnt.charAt(0) == '5' || ssnt.charAt(0) == '6')
		b19 = true
	else if( ssnt.charAt(0) == '3' || ssnt.charAt(0) == '4' || ssnt.charAt(0) == '7' || ssnt.charAt(0) == '8')
		b19 = false

	today = new Date()
//	today = new Date(1990, 4, 11)
//	addday = new Date(0,6,0,0,0,0)
	bmon = today.getMonth();
    byear = today.getFullYear();

	if( (bmon + 6) > 12)
        {
		today.setMonth(bmon+6-12)
		today.setFullYear(byear+1)
	}
	else
	{
		today.setMonth(bmon+6)
	}

	year = (ssnh.charAt(0)-'0')*10
	year += ssnh.charAt(1)-'0'

	month = (ssnh.charAt(2)-'0')*10
	month += ssnh.charAt(3) - '0'

	day = (ssnh.charAt(4)-'0')*10
	day += ssnh.charAt(5)-'0'

	if( b19 ) year += 1900
	else year += 2000

	age = today.getFullYear() ;

//	if( age < 1900 ) age += 1900 ;

	age = age - year;
	if( (today.getMonth()+1) < month ) age = age-1
	else if( (today.getMonth()+1) == month ) {
		if( today.getDate() < day ) age = age -1
	}

	return age
}

/////////////////////////////////////////////////////////////
// This routine checks whether given value is a digit or not
/////////////////////////////////////////////////////////////
function check_digit( value )
{
//	for( var i = 0 ; i < value.length ; i++ )
//		if( value.charAt(i) < '0' || value.charAt(i) > '9' ) return false ;
	if(isNaN(value)==true) return false;
	return true
}

/////////////////////////////////////////////////////////////////
// This routine check whether given value is a valid date format
/////////////////////////////////////////////////////////////////
function check_date( date )
{
	for( var i = 0 ; i < 8 ; i++ )
		if( date.charAt(i) < '0' || date.charAt(i) > '9' ) return false ;

	year = parseInt(date.substring(0,4),10) ;
	if( isNaN(year) ) return false ;

	month = parseInt(date.substring(4,6),10) ;
	if( isNaN(month) ) return false ;

	if( month < 1 || month > 12 ) return false ;

	day = parseInt(date.substring(6,8),10) ;
	if( isNaN(day) ) return false ;

	if( day < 1 || day > 31 ) return false ;

	return true ;
}

//////////////////////////////////////////////////////////////////////////
// This routine checks whether given value is a right combination
// of compreg number (»ç¾÷ÀÚ¹øÈ£)
//////////////////////////////////////////////////////////////////////////
function check_compreg( compreg1, compreg2, compreg3 )
{
	if( compreg1.length != 3 ) return false;
	if( compreg2.length != 2 ) return false;
	if( compreg3.length != 5 ) return false;

	return true;

//	if ( compreg1.length != 3 && compreg2.length != 2 && compreg3.length != 5)
//	return false
}

function check_compreg_format( compreg )
{
	compreg = compreg.replace(/( *)/gi, "");
	if( compreg.length != 10 ) return false;
	if( isNaN(compreg) ) return false;

	return true
}

function check_compreg( compreg )
{
	if( !check_compreg_format(compreg) ) return false;


	sum = (compreg.charAt(0) - '0')*1 + (compreg.charAt(1) - '0')*3 +
	      (compreg.charAt(2) - '0')*7 + (compreg.charAt(3) - '0')*1 +
	      (compreg.charAt(4) - '0')*3 + (compreg.charAt(5) - '0')*7 +
	      (compreg.charAt(6) - '0')*1 + (compreg.charAt(7) - '0')*3 +
	      (compreg.charAt(8) - '0')*5;
	sum += parseInt( ((compreg.charAt(8) - '0')*5) / 10 );
	z = (10 - (sum % 10))%10;

	if( (compreg.charAt(9) - '0') != z ) {
		return false;
	}
	return true;
}

function check_compreg2(compreg) {

	if( !check_compreg_format(compreg) ) return false;

	 var sum = 0;
	 var getlist =new Array(10);
	 var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
	 for(var i=0; i<10; i++) { getlist[i] = compreg.substring(i, i+1); }
	 for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
	 sum = sum + parseInt((getlist[8]*5)/10);
	 sidliy = sum % 10;
	 sidchk = 0;
	 if(sidliy != 0) { sidchk = 10 - sidliy; }
	 else { sidchk = 0; }
	 if(sidchk != getlist[9]) { return false; }
	 return true;
}

CORPGUBUN_PERSONAL = 1;
CORPGUBUN_PROFITMAKING = 2;
CORPGUBUN_NONPROFIT = 3;
CORPGUBUN_KWAN = 4;
function GetCorpGubun(compreg)
{
	if( compreg == "" ) return CORPGUBUN_PERSONAL; // °³ÀÎ

	gubunCode = compreg.substring(3,5);

	// ¾÷¹«¿ë : »ç¾÷ÀÚÀÚ¸® 4~5 ÀÚ¸® ºñ±³
	// °ü¿ë(4)   : 83
	// ºñ¿µ¸®(3) : 82,89(-> Á¾±³´ÜÃ¼)
	// ¿µ¸®(2)   :81,84,86
	// ³ª¸ÓÁö´Â °³ÀÎ(1)

	switch(gubunCode) {
		case "83" :	Gubun = CORPGUBUN_KWAN; break;
		case "82" :	Gubun = CORPGUBUN_NONPROFIT; break;
		case "89" :	Gubun = CORPGUBUN_NONPROFIT; break;
		case "81" :	Gubun = CORPGUBUN_PROFITMAKING; break;
		case "84" :	Gubun = CORPGUBUN_PROFITMAKING; break;
		case "86" :	Gubun = CORPGUBUN_PROFITMAKING; break;
		default : 	Gubun = CORPGUBUN_PERSONAL; break;
	}

	return Gubun;
}

//////////////////////////////////////////////////////////////////////////
// This routine checks whether given value is a right combination
// of ssn number
//////////////////////////////////////////////////////////////////////////
function check_ssn_format( ssn_h , ssn_t )
{
	ssn_h = ssn_h.replace(/( *)/gi, "");
	ssn_t = ssn_t.replace(/( *)/gi, "");

	if( ssn_h.length != 6 )	return false;
	if( ssn_t.length != 7 ) return false;

	if( isNaN(ssn_h) ) return false;
	if( isNaN(ssn_t) ) return false;

	return true;
}

function check_ssn( ssn_h , ssn_t )
{
	if( !check_ssn_format(ssn_h, ssn_t) ) return false;

	//ÁÖ¹Î¹øÈ£°¡ 000000-0000000 ÀÌ¸é Ã¼Å©ÇÏÁö ¾Ê´Â´Ù.
	//ÅÂ¾Æ°¡ÀÔÀÌ°Å³ª ÁÖ¹Î¹øÈ£ ¸ð¸£´Â°æ¿ì
	//2002-06-19 5:42¿ÀÈÄ pginner
	if( ssn_h == "000000" && ssn_t == "0000000")
		return true;
	// First Check validity
	for( var i = 0 ; i < 6 ; i++) {
		if( ssn_h.charAt(i) < '0' || ssn_h.charAt(i) > '9' ) {
			return false ;
		}
	}
	for( var i = 0 ; i < 7 ; i++) {
		if( ssn_t.charAt(i) < '0' || ssn_t.charAt(i) > '9' ) {
			return false ;
		}
	}

	// First Check date
	if( ssn_t.charAt(0)== '1' || ssn_t.charAt(0) == '2' ) {
		if( check_date( "19" + ssn_h ) == false ) {
			return false ;
		}
	} else if( ssn_t.charAt(0) == '3' || ssn_t.charAt(0) == '4' ) {
		if( check_date( "20" + ssn_h ) == false ) {
			return false ;
		}
	} else if(ssn_t.charAt(0) == '5' || ssn_t.charAt(0) == '6' || ssn_t.charAt(0) == '7'  || ssn_t.charAt(0) == '8'  || ssn_t.charAt(0) == '9' ){
		if( isRegNo_fgnno( ssn_h + ssn_t ) == true ) {
			return true ;
		}
	} else {
		return false ;
	}

	// check sum
	sum = (ssn_h.charAt(0) - '0')*2 + (ssn_h.charAt(1) - '0')*3 +
	      (ssn_h.charAt(2) - '0')*4 + (ssn_h.charAt(3) - '0')*5 +
	      (ssn_h.charAt(4) - '0')*6 + (ssn_h.charAt(5) - '0')*7 +
	      (ssn_t.charAt(0) - '0')*8 + (ssn_t.charAt(1) - '0')*9 +
	      (ssn_t.charAt(2) - '0')*2 + (ssn_t.charAt(3) - '0')*3 +
	      (ssn_t.charAt(4) - '0')*4 + (ssn_t.charAt(5) - '0')*5 ;

	z = (11 - (sum % 11)) % 10

	if( (ssn_t.charAt(6) - '0') != z ) {
		return false
	}

	return true
}

//Àç¿Ü±¹ÀÎ ¹øÈ£ È®ÀÎ
function isRegNo_fgnno(fgnno) {
        var sum=0;
        var odd=0;
        buf = new Array(13);
        for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
        odd = buf[7]*10 + buf[8];
        if(odd%2 != 0) { return false; }
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
                return false;
        }
        multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
        for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
        sum = 11 - (sum%11);
        if(sum >= 10) { sum -= 10; }
        sum += 2;
        if(sum >= 10) { sum -= 10; }
        if(sum != buf[12]) { return false }
        return true;
}

function check_ssn_plan( ssn_h , ssn_t )
{
	if( !check_ssn_format(ssn_h, ssn_t) ) return false;

	// First Check validity
	for( var i = 0 ; i < 6 ; i++) {
		if( ssn_h.charAt(i) < '0' || ssn_h.charAt(i) > '9' ) {
			return false ;
		}
	}
	for( var i = 0 ; i < 7 ; i++) {
		if( ssn_t.charAt(i) < '0' || ssn_t.charAt(i) > '9' ) {
			return false ;
		}
	}

	// First Check date
	if( ssn_t.charAt(0)== '1' || ssn_t.charAt(0) == '2' ) {
		if( check_date( "19" + ssn_h ) == false ) {
			return false ;
		}
	} else if( ssn_t.charAt(0) == '3' || ssn_t.charAt(0) == '4' ) {
		if( check_date( "20" + ssn_h ) == false ) {
			return false ;
		}
	} else if(ssn_t.charAt(0) == '5' || ssn_t.charAt(0) == '6' || ssn_t.charAt(0) == '7'  || ssn_t.charAt(0) == '8'  || ssn_t.charAt(0) == '9' ){
		if( isRegNo_fgnno( ssn_h + ssn_t ) == true ) {
			return true ;
		}
	} else {
		return false ;
	}

	// check sum
	sum = (ssn_h.charAt(0) - '0')*2 + (ssn_h.charAt(1) - '0')*3 +
	      (ssn_h.charAt(2) - '0')*4 + (ssn_h.charAt(3) - '0')*5 +
	      (ssn_h.charAt(4) - '0')*6 + (ssn_h.charAt(5) - '0')*7 +
	      (ssn_t.charAt(0) - '0')*8 + (ssn_t.charAt(1) - '0')*9 +
	      (ssn_t.charAt(2) - '0')*2 + (ssn_t.charAt(3) - '0')*3 +
	      (ssn_t.charAt(4) - '0')*4 + (ssn_t.charAt(5) - '0')*5 ;

	z = (11 - (sum % 11)) % 10

	if( (ssn_t.charAt(6) - '0') != z ) {
		return false
	}

	return true
}

function check_corpno(ssn_h, ssn_t)
{
	if( !check_ssn_format(ssn_h, ssn_t) ) return false;

	sum = (ssn_h.charAt(0) - '0')*1 + (ssn_h.charAt(1) - '0')*2 +
	      (ssn_h.charAt(2) - '0')*1 + (ssn_h.charAt(3) - '0')*2 +
	      (ssn_h.charAt(4) - '0')*1 + (ssn_h.charAt(5) - '0')*2 +
	      (ssn_t.charAt(0) - '0')*1 + (ssn_t.charAt(1) - '0')*2 +
	      (ssn_t.charAt(2) - '0')*1 + (ssn_t.charAt(3) - '0')*2 +
	      (ssn_t.charAt(4) - '0')*1 + (ssn_t.charAt(5) - '0')*2 ;

	z = (10 - (sum % 10))%10;

	if( (ssn_t.charAt(6) - '0') != z ) {
		return false;
	}
	return true;
}

function SetComboValues( combo, string )
{
	if(combo != null){
		if( string != "" ) {
			index = FindComboIndex( combo , string )
			if( index != -1 )
				combo.options[i].selected = true ;
		}
	}
}
function SetTextComboValues( combo, string )
{
	if(combo != null){
		if( string != "" ) {
			index = FindTextComboIndex( combo , string )
			if( index != -1 )
				combo.options[i].selected = true ;
		}
	}
}

function checkGaipMoney(dambo, field, lowerbound, upperbound, unit)
{
	money = Number(field.value);
	if( isNaN(money) == true ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×Àº ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		field.focus();
		return false;
	}

	reTester = /\D/
	if( reTester.test(field.value) ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×¿¡ blank°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù. Á¦°ÅÇØ ÁÖ½Ê½Ã¿À.");
		field.focus();
		return false;
	}

	if( field.value == "" ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		field.focus();
		return false;
	}

	if( (money < lowerbound) || (upperbound < money) ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×Àº " + lowerbound +"¸¸¿ø ~ " + upperbound + "¸¸¿øÀÔ´Ï´Ù.");
		field.focus();
		return false;
	}

	if( money%unit != 0 ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×ÀÇ ´ÜÀ§´Â " + unit + "¸¸¿øÀÔ´Ï´Ù.");
		field.focus();
		return false;
	}

	return true;
}

function checkGaipGuJua(dambo, field, lowerbound, upperbound, unit)
{
	money = Number(field.value);
	if( isNaN(money) == true ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×ÀÇ ±¸ÁÂ´Â ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
		field.focus();
		return false;
	}

	if( field.value == "" ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		field.focus();
		return false;
	}


	money = parseFloat(field.value)
	if( (money < lowerbound) || (upperbound < money) ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×Àº " + lowerbound +"±¸ÁÂ ~ " + upperbound + "±¸ÁÂÀÔ´Ï´Ù.");
		field.focus();
		return false;
	}

	// 0.1 ±¸ÁÂÀÏ °æ¿ì 10ÀÌ multiplier

	multiplier = 1.0/unit;
	if( Math.floor(money*multiplier) != (money*multiplier) ) {
		window.alert(dambo + " °¡ÀÔ±Ý¾×ÀÇ ´ÜÀ§´Â " + unit + "±¸ÁÂÀÔ´Ï´Ù.");
		field.focus();
		return false;
	}

	return true;
}

function gonextfield(curfield, len, nextfield) {
	if( curfield.value.length == len )  {
		nextfield.focus();
	}
}

//pginner added on June 1 2001
function GetLastDayOfMonth(thisYear, thisMonth){
	if (thisMonth.value == "1"
		|| thisMonth.value == "3"
		|| thisMonth.value == "5"
		|| thisMonth.value == "7"
		|| thisMonth.value == "8"
		|| thisMonth.value == "10"
		|| thisMonth.value == "12"){
		return "31"
	}
	else if (thisMonth.value == "4"
		|| thisMonth.value == "6"
		|| thisMonth.value == "9"
		|| thisMonth.value == "11"){
		return "30"
	}
	// only February can reach here
	if(thisYear.value % 4 == 0){
		if(thisYear.value %400 == 0){
			if(thisYear.value % 2000 == 0){
				return "29"
			}
			return "28"
		}
		return "29"
	}
	return "28"
}

//pginner added on June 1 2001
function SetLastDayOfMonth(thisYear, thisMonth, thisDay){
	if (thisMonth.value == 1
		|| thisMonth.value == 3
		|| thisMonth.value == 5
		|| thisMonth.value == 7
		|| thisMonth.value == 8
		|| thisMonth.value == 10
		|| thisMonth.value == 12){
		lastDay = 31
	}
	else if (thisMonth.value == 4
		|| thisMonth.value == 6
		|| thisMonth.value == 9
		|| thisMonth.value == 11){
		lastDay = 30
	}
	else{
		if(thisYear.value % 4 == 0){
			if(thisYear.value %400 == 0){
				if(thisYear.value % 2000 == 0){
					lastDay = 29
				}
				else
					lastDay = 28
			}
			else
				lastDay = 29
		}
		else
			lastDay = 28
	}

	if (lastDay < thisDay.value){
		//alert(thisYear.value + "³â " + thisMonth.value + "¿ùÀÇ ¸»ÀÏÀº " + lastDay
		//	+ "ÀÏÀÔ´Ï´Ù." + lastDay + "ÀÏ·Î ³¯Â¥¸¦ ¼³Á¤ÇÕ´Ï´Ù.");
		thisDay.value = lastDay
	}
}

// ³¯Â¥ÀÇ À¯È¿¼ºÀ» Ã¼Å©ÇÑ´Ù. 2008/1/24
function isValidDate(yyyy, mm, dd){
	var m = parseInt(mm,10)-1;
	var d = parseInt(dd,10);
	var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if((yyyy%4 == 0 && yyyy%100 != 0) || (yyyy%400 == 0)){
		end[1] = 29;
	}
	return(d>=1 && d<=end[m]);
}


// pginner added this function on 2001-09-14
// ',", ;, \ µîÀÇ Æ¯¼ö¹®ÀÚ ÀÔ·ÂºÒ°¡
// input tag ¸ñ·ÏÀ» °¡Áø obj ¸¦ ÀÎÀÚ·Î ¹Þ¾Æ¼­ Æ¯¼ö¹®ÀÚ È®ÀÎÇÏ°í
// true/false ¸®ÅÏÇÑ´Ù.
//
// BOOL BlockSpecialChars()
function BlockSpecialChars()
{
	var obj = document.all.tags("input");
	var REG_SPECIAL_CHARS = /\"|\'|\;|\\|\&/g;

	for(i = 0 ; i < obj.length ; i++){
		// 2002-03-22 8:54¿ÀÈÄ hw1230 Ãß°¡ ¾ÏÈ£È­ ÇÊµå¶«¿¡
		if(obj[i].name=="Str1" || obj[i].name=="Str2" || obj[i].name=="Str3") continue;
		// 2002-06-12 11:44¿ÀÀü pginner Ãß°¡ Â÷·®¸ðµ¨Àº °Ë»ç¾ÈÇÔ
		if(obj[i].name=="ModelString") continue;
		if(obj[i].name=="c_RemainAddress" || obj[i].name=="p_RemainAddress") continue;
		bFound = obj[i].value.match(REG_SPECIAL_CHARS);
		if( bFound != null){
			alert('ÀÔ·Â°ª : ' + obj[i].value + '\n¿¡¼­ Æ¯¼ö¹®ÀÚ \", \', \; , \\, \& ´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.');
			//obj[i].focus();
			return false;
		}
	}
	return true;
}

// °æÇåÃß°¡ 2002-03-14
// radio button set.

function SetRadioButton(object)
{
	if(object!=null)
	{
		object.checked = true
	}
	else
	{
//		alert("Á¸ÀçÇÏÁö ¾Ê´Â radio id ÀÔ´Ï´Ù.");
	}
}


function SetRadioButtonValue(obj,val) {
	var chk = "";
	if(obj==null) return;
	for (var i = 0; i<obj.length; i++) {
		if (obj[i].value==val) {
			obj[i].checked=true;
		}
	}
}


function GetRadioButton(object) {
	var chk = "";

	for (var i = 0; i<object.length; i++) {
		if (object[i].checked) {
			chk = object[i].value;
			return chk;
		}
	}

	return null;
}

// ¶óµð¿À¹öÆ° Ã¼Å© À¯¹« È®ÀÎ
function RadioCheck(name)
{
	IsCheck = false;
	
	formName = eval(name);

	for(i = 0; i < formName.length; i++)
	{
		if(formName[i].checked)
		{
			IsCheck = true;
		}
	}

	return IsCheck;
}

function SetTextValue( obj, string)
{
	if(obj != null){
		obj.value = string;
	}
}

function SetCheckbox(obj)
{
	if(obj != null){
			obj.checked = true;
	}
}
function GetCheckbox(obj)
{
	if(obj != null)
	{
		if(obj.checked==true) return 1;
		else return 0;
	}
	return 0;
}
function UnsetCheckbox(obj)
{
	if(obj != null){
			obj.checked = false;
	}
}
// --- »ç¾÷ÀÚµî·Ï¹øÈ£ °Ë»ç JScript
function checkBizID( bizID )
{
// bizID´Â ¼ýÀÚ¸¸ 10ÀÚ¸®·Î ÇØ¼­ ¹®ÀÚ¿­·Î ³Ñ±ä´Ù.
	var checkID = new Array(1, 3, 7, 1, 3, 7, 1, 3, 5, 1);
	var tmpBizID, i, chkSum=0, c2, remander;

	for (i=0; i<=7; i++) chkSum += checkID[i] * bizID.charAt(i);

	c2 = "0" + (checkID[8] * bizID.charAt(8));
	c2 = c2.substring(c2.length - 2, c2.length);

	chkSum += Math.floor(c2.charAt(0)) + Math.floor(c2.charAt(1));

	remander = (10 - (chkSum % 10)) % 10 ;

	if (Math.floor(bizID.charAt(9)) == remander) return true; // OK!
	return false;
}


function comboDateCheck(year,month,day)
{
	// combo ÇüÅÂ¿¡ ´ëÇØ¼­¸¸ check
	var checkDate = new Date(year.value,month.value-1,day.value);
	SetComboValues(year,checkDate.getFullYear());
	SetComboValues(month,checkDate.getMonth()+1);
	SetComboValues(day,checkDate.getDate());
}

function addDate(year,month,day,toYear,toMonth,toDay,datePart,interval)
{
	/* datePart :: 'm'/'d' */
	var addDate = new Date(year.value,month.value-1,day.value);
	if(datePart=='m')
	{
		addDate.setMonth(addDate.getMonth()+interval);
		SetComboValues(toYear,addDate.getFullYear());
		SetComboValues(toMonth,addDate.getMonth()+1);
		SetComboValues(toDay,addDate.getDate());
	}
	if(datePart=='d')
	{
		addDate.setDate(addDate.getDate()+interval);
		SetComboValues(toYear,addDate.getFullYear());
		SetComboValues(toMonth,addDate.getMonth()+1);
		SetComboValues(toDay,addDate.getDate());
	}
}

////////////////////////////////////////////////////////////////////////
// E-mail pattern matching
////////////////////////////////////////////////////////////////////////
function isValidEmail(str) {
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr)) supported = 1;
	}
	if (!supported)
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);

	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9_\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");

	return (!r1.test(str) && r2.test(str) && !IsHangul(str) );
//	return (!r1.test(str) && r2.test(str));

}

function IsHangul(check_string)
{
        for( i=0; i<check_string.length; i++) {
        	if( char_check(check_string.charCodeAt(i)) == BN_HANGUL ) return true;
	}
	return false;
}

function char_check(char_ASCII) {
        //¼ýÀÚ
        if (char_ASCII >= 48 && char_ASCII <= 57 )
                return BN_NUMBER;
        //¿µ¾î
        else if ((char_ASCII>=65 && char_ASCII<=90)
                        || (char_ASCII>=97 && char_ASCII<=122))
                return BN_ENGLISH;
        //Æ¯¼ö±âÈ£
        else if ((char_ASCII>=33 && char_ASCII<=47)
                        || (char_ASCII>=58 && char_ASCII<=64)
                        || (char_ASCII>=91 && char_ASCII<=96)
                        || (char_ASCII>=123 && char_ASCII<=126))
                return BN_SPECIALCHARS;
        //ÇÑ±Û
        else if ((char_ASCII >= 12592) || (char_ASCII <= 12687))
                return BN_HANGUL;
        else
                return BN_OTHERS;
}


////////////////////////////////////////////////////////////////////////
// E-mail Setting -- by zigis
////////////////////////////////////////////////////////////////////////
function EmailSet(emailt, emailt_etc)
{
		if ( emailt.value == "±âÅ¸" )
		{
//			emailt.disabled= true ;
			emailt_etc.disabled = false;
			emailt_etc.style.border = "1 solid" ;
			emailt_etc.focus() ;
		}
		if ( emailt.value != "±âÅ¸" )
		{
			emailt_etc.value = '';
			emailt_etc.disabled = true;
			emailt_etc.style.border = "0 solid" ;
//			emailh.focus() ;
		}
}

function EmailSet_Div(emailt, emailt_etc, divname)
{
		if ( emailt.value == "±âÅ¸" )
		{
			emailt_etc.disabled = false;
			emailt_etc.style.border = "1 solid" ;
			emaildiv.style.display = "";
			emailt_etc.focus() ;
		}
		if ( emailt.value != "±âÅ¸" )
		{
			emailt_etc.value = '';
			emailt_etc.disabled = true;
			emailt_etc.style.border = "0 solid" ;
			emaildiv.style.display = "none";
		}
}

function InitEmailSet(emailt, emailt_etc)
{
		if ( emailt.value == "±âÅ¸" )
		{
			emailt_etc.disabled = false;
			emailt_etc.style.border = "1 solid" ;
		}
		if ( emailt.value != "±âÅ¸" )
		{
			emailt_etc.value = '';
			emailt_etc.disabled = true;
			emailt_etc.style.border = "0 solid" ;
		}
}


////////////////////////////////////////////////////////////////////////
// E-mail ÇÕÃÄ¼­ º¸³»±â
////////////////////////////////////////////////////////////////////////
function EmailConcat(emailh, emailt, emailt_etc, resultEmail) {
	if(emailt.value=='±âÅ¸') {
		resultEmail.value = emailh.value + '@' + emailt_etc.value;
	}
	else {
		resultEmail.value = emailh.value + '@' + emailt.value;
	}
}

function MakeEmail(emailh, emailt, emailt_etc) {
	if(emailt =='±âÅ¸') {
		return (emailh + '@' + emailt_etc);
	}
	else {
		return (emailh + '@' + emailt);
	}
}

// ÀüÈ­¹øÈ£³ª ÇÚµåÆùµî µÚ 4ÀÚ¸®¸¦ ¿¬¼ÓµÈ ¼ýÀÚ³ª °°Àº ¼ýÀÚ ³ÖÀ¸¸é ¾ÈµÊ
// ½ÇÁ¦·Î´Â ±×·± ¹øÈ£ °¡´ÉÇÏ³ª ´ëºÎºÐ ÀÏ¹ÝÀÎÀº ±×·± ¹øÈ£°¡ ¾Æ´Ô.
function isValidPhoneNumber(fourNumbers) {
   	var hand1 = parseInt(fourNumbers.substr(0,1), 10);
	var hand2 = parseInt(fourNumbers.substr(1,1), 10);
	var hand3 = parseInt(fourNumbers.substr(2,1), 10);
	var hand4 = parseInt(fourNumbers.substr(3,1), 10);
	var up4;
	var down1;

	if (hand3 == 9) up4 = hand4 + 10;
	else up4 = hand4;
	if (hand2 == 9) down1 = hand1 + 10;
	else down1 = hand1;

	//¿¬¼ÓµÈ ¹øÈ£ Ã¼Å© 2003-10-24 9:57¿ÀÀü ¿¡ Ã¼Å© ÇØÁ¦ÇÔ..¼º¿í
	if (((hand1+1 == hand2)&&(hand2+1 == hand3)&&(hand3+1 == up4))||
		((hand4+1 == hand3)&&(hand3+1 == hand2)&&(hand2+1 == down1))) {
		//return false;
		;
	}

	if ((hand1 == hand2)&&(hand2==hand3)&&(hand3==hand4)) {
		return false;
	}

	return true;
}

// Date Add  ÇÏ¿© Á¶È¸±â°£ setting ÇÏ´Â ÇÔ¼ö
// form : form object
// addDay : ´õÇØÁö´Â ³¯ÀÚ.
// addType : 1 startDay °íÁ¤ / 1ÀÌ¿ÜÀÇ °æ¿ì endDay °íÁ¤
function dateAdder(form,addDay,addType)
{
	var syear=(form.syear.value)-'0';
	var smonth=(form.smonth.value)-'0';
	var sday=(form.sday.value)-'0';
	var eyear=(form.eyear.value)-'0';
	var emonth=(form.emonth.value)-'0';
	var eday=(form.eday.value)-'0';
	smonth--;
	emonth--;


	if(addType==1)
	{
		// start Day Fixed
		eyear = syear;
		emonth = smonth;
		eday = sday+addDay;
	}else
	{
		syear = eyear;
		smonth = emonth;
		sday = eday-addDay;
	}

	startDay = new Date(syear,smonth,sday);
	endDay = new Date(eyear,emonth,eday);

	syear = startDay.getYear();
	smonth = startDay.getMonth();
	sday = startDay.getDate();
	eyear = endDay.getYear();
	emonth = endDay.getMonth();
	eday = endDay.getDate();

	smonth++;
	emonth++;

	SetComboValues(form.syear,syear);
	SetComboValues(form.smonth,smonth);
	SetComboValues(form.sday,sday);
	SetComboValues(form.eyear,eyear);
	SetComboValues(form.emonth,emonth);
	SetComboValues(form.eday,eday);
}

// Á¤ÇüÈ­µÈ select option ÀÌ ¾Æ´Ñ ´Ù¸¥ °ªÀ» ¹ÞÀ» ¶§ ÁöÁ¤µÈ textobj ¸¦ enable/disable ½ÃÅ´
function toggleTextBox(selectobj, textobj, enableKey) {
	if(selectobj.value == enableKey) {
		textobj.disabled = false;
	} else {
		textobj.disabled = true;
	}
};

// Á¤ÇüÈ­µÈ select option ÀÌ ¾Æ´Ñ ´Ù¸¥ °ªÀ» ¹ÞÀ» ¶§ ÁöÁ¤µÈ layer ¸¦ enable/disable ½ÃÅ´
function toggleTextLayer(selectobj, enableKey, layerID) {
	if(selectobj.value == enableKey) {
		document.all(layerID).style.display = '';
	} else {
		document.all(layerID).style.display = 'none';
	}
};

// Multi-Select °ü·Ã Option ÀÌµ¿ ÇÔ¼ö
function AddOption(src,dest)
{

	optionlen = src.options.length;
	var dupCheck=0;
	for( i= optionlen-1; i>=0; i--) {
		if( src.options[i].selected == true ) {
			tempOption = src.options[i];
			tempOption.selected = false;
			src.options[i] = null;
			optionlen2 = dest.options.length;
			// Áßº¹Ã¼Å©
			for(j=optionlen2-1;j>=0;j--)
				if(dest.options[j].value==tempOption.value) dupCheck=1;
			if(dupCheck==0)
				dest.options[optionlen2] = tempOption;
		}
	}
}

function SubOption(dest,src)
{
	optionlen = src.options.length;
	for( i= optionlen-1; i>=0; i--) {
		if( src.options[i].selected == true ) {
			tempOption = src.options[i];
			tempOption.selected = false;
			src.options[i] = null;
			optionlen2 = dest.options.length;
			dest.options[optionlen2] = tempOption;
		}
	}
}
//-------------------------------------------------------------------
// 20040425 À±¼ºÁø Ãß°¡
// Login ¹æ½Ä PopupÀ¸·Î º¯°æ¿¡ µû¶ó Ãß°¡µÈ ÇÔ¼ö
//-------------------------------------------------------------------
function GoPage(pageURL)
{
//	window.alert(IsLoggedIn());
	if( IsLoggedIn() )
	{
		location.href = pageURL;
		return;
	}
	LoginPage(pageURL);
}

function GoPageForIframeParent(pageURL)
{
	if( IsLoggedIn())
	{
		location.href = pageURL;
		return;
	}
	else
		LoginPageForIFrame(pageURL);
}

function GoPageAfterLogin(pageURL)
{
	GoPage(pageURL);
}

function GoPageInPopup(pageURL)
{
	if( IsLoggedIn() )
	{
		LoginWin = window.open(pageURL, "LoginPopup", "width=380, height=350, resizable, scrollable");
		return;
	}

	LoginPageInPopup(pageURL);
}

function GoPageInPopup2(pageURL)
{
	if( IsLoggedIn() )
	{
		LoginWin = window.open(pageURL, "LoginPopup", "width=380, height=350, resizable, scrollable, scrollbars=yes");
		return;
	}

	LoginPageInPopup2(pageURL);
}

function GoOpenerPage(pageURL)
{
	var myopener= top.opener;

	if( myopener != null ) {
		myopener.location.replace(pageURL);
	}
	self.close();
}

function SubmitOpenerForm(formname)
{
	var myopener= top.opener;
	if( myopener != null )
		myopener.document.forms[formname].submit();
	self.close();
}

function SubmitForm(formname)
{
	document.forms[formname].submit();
}


function IsLoggedIn()
{
	return (GetCookie("LOGIN%5FUSERKEY") != null) ;
}

printwin = null;
function Print(formname)
{
	if( location.href.indexOf("?") == -1 )
		pageURL = location.href + "?printmode=1";
	else
		pageURL = location.href + "&printmode=1";

	if( formname == "" ) {
		printwin = window.open(pageURL, "PrintPopup", "width=600, height=700, resizable, scrollable");
		return;
	}

	if ( document.forms[formname] == null ) return;

	if ( printwin != null ) printwin.close();

	form = document.forms[formname];
	if( form.method == "post" )	// post¹æ½Ä
	{
		printwin = window.open("", "PrintPopup", "width=600, height=700, resizable, scrollable");
		form.target = "PrintPopup";
		form.action = pageURL;
		form.submit();
	}
	else	// get¹æ½Ä : formÀ» submitÇÏ¸é printmode°ªÀÌ ¾ø¾îÁö±â ¶§¹®¿¡ ÀÚÃ¼ URLÀ» ±×´ë·Î ÀÌ¿ë
	{
		printwin = window.open(pageURL, "PrintPopup", "width=600, height=700, resizable");
		return;
	}
}


function goMainBanner()//ÇÃ·¹½¬ º£³Ê Á¦ÈÞ»çº°·Î °¢ ¸µÅ© º¯°æ
{
	var goUrl = document.location.hostname;

	if (goUrl == 't.boheom.net')
	{
		location.href="/ThemeProduct/private_1.asp"
	}
	else
	{
		location.href = "/mall/category/index.asp?fromWhere=Category&MyCategory=Medical"
	}

}


//¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏµµ·Ï
function NumObj()
{
	if (event.keyCode >= 48 && event.keyCode <= 57)
	{ //¼ýÀÚÅ°¸¸ ÀÔ·Â
		event.returnValue = true;
	}
	else
	{
		event.returnValue = false;
	}
}

//-------------------------------------------------------------------
// 20050328 Å¹Çü¼® Ãß°¡ : Ã¼Å©¹Ú½º¿¡ ¼±ÅÃÇÑ °ÍÀÌ ÀÖ´ÂÁö ¾ø´ÂÁöÀÇ ¿©ºÎ
// »ç¿ë¿¹Á¦ : if(!isSelect(ff,"arrAdmno")) {
//		         alert("»èÁ¦ÇÒ ÀÚ·á¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
//		         return;
//	         }
//-------------------------------------------------------------------

function isSelect(formName, chkName) {

    var ff = formName;
    for (var i=0; i<ff.elements.length; i++) {
        if (ff.elements[i].type=="checkbox" && ff.elements[i].name== chkName) {
            if (ff.elements[i].checked) return true;
        }
    }
    return false;
}
//-------------------------------------------------------------------
// 20050328 Å¹Çü¼® Ãß°¡ : Ã¼Å©¹Ú½º Ã¼Å©µÈ°Í °¹¼ö ¸®ÅÏ
// »ç¿ë¿¹Á¦ : if(selectCnt(ff,"arrAdmno")>0) {
//		         alert("1°³¸¸ ¼±ÅÃÇÏ¼¼¿ä.");
//		         return;
//	         }
//-------------------------------------------------------------------

function selectCnt(formName, chkName) {

    var ff = formName;
	var cnt = 0;
    for (var i=0; i<ff.elements.length; i++) {
        if (ff.elements[i].type=="checkbox" && ff.elements[i].name== chkName) {
            if (ff.elements[i].checked) cnt++;
        }
    }
    return cnt;
}


//-------------------------------------------------------------------
// Ã¼Å©¹Ú½º ÀüÃ¼¸¦ ¼±ÅÃÇÏ´Â ÇÔ¼ö
//-------------------------------------------------------------------
// È­¸éÀÇ ½ºÅ©¸³Æ®¿¡¼­ ¾Æ·¡¿Í °°ÀÌ »ç¿ëÇÑ´Ù.
//
// <A class="button" href="javascript:on_off_check(myForm,'check',true)">ÀüÃ¼¼±ÅÃ</A>
//
//
//
//
//-------------------------------------------------------------------
function on_off_check(formName, chkName, isCheck)
{
	var ff = formName;
	if (isCheck == true)
	{
		for (var i=0; i<ff.elements.length; i++) {
			if (ff.elements[i].type=="checkbox" && ff.elements[i].name== chkName) {
				ff.elements[i].checked = true;
			}
		}
	}
	else
	{
		for (var i=0; i<ff.elements.length; i++) {
			if (ff.elements[i].type=="checkbox" && ff.elements[i].name== chkName) {
				ff.elements[i].checked = false;
			}
        }
	}
}

// ³¯Â¥ °ËÁõ (2009/1/8)
function SetDay(syear, smonth, dayform) {
	if(smonth == "2"){
		if( syear == "2000" || syear == "2004" || syear == "2008" || syear == "2012") len = 29;
		else len = 28;
	}	else {
		if (smonth == "4" || smonth == "6" || smonth == "9" || smonth == "11" ) len = 30;
		else len = 31;
	}
	dayform.options.length = len ;
	for( i = 0 ;i < len ; i++ ) {
		dayform.options[i].text = i+1 ;
	}
}


//¿Â¶óÀÎ»ó´ã½ÅÃ»¿¡¼­ ¼­ºêÄ«Å×°í¸® ÇÑ±Û¸í
function SubCategory0907(i)
{
	var subcategory;
	if (i == '0')
	{
		subcategory = "ÀÇ·á½Çºñº¸Çè";	
	}
	else if ( i == '1')
	{
		subcategory = "°Ç°­º¸Çè";
	}
	else if (i =='2')
	{
		subcategory = "¾Ïº¸Çè";
	}
	else if (i == '3')
	{
		subcategory = "ÅÂ¾Æ/¾î¸°ÀÌº¸Çè";
	}
	else if (i == '4')
	{
		subcategory = "»óÇØ/¿îÀüÀÚº¸Çè";
	}
	else if (i == '5')
	{
		subcategory = "¿¬±Ýº¸Çè";
	}
	else if (i == '6')
	{
		subcategory = "Á¤±â/Á¾½Åº¸Çè";
	}
	else if (i == '7')
	{
		subcategory = "ÀúÃàº¸Çè";
	}
	else if (i == '8')
	{
		subcategory = "½Ç¹öº¸Çè";
	}
	else if (i == '9')
	{
		subcategory = "±âÅ¸º¸Çè";
	}
	else if (i == '10')
	{
		subcategory = "ÀÚµ¿Â÷º¸Çè";
	}
	return subcategory;
}

function use_info() // º¸Çè³Ý °³ÀÎÁ¤º¸ Ãë±Þ¹æÄ§
{
	window.open("/include/privacy_popup.asp", "", "width=550, height=470, scrollbars=yes");
}

//DIV ¹è¿­ÀÏ¶§ Åä±ÛÇÏ´Â ÇÔ¼ö
function divtoggle(layername, num)
{
	f = document.all[layername];
	for (i=0; i < f.length ; i++ )
	{
		if (i == num)
		{
			f[i].style.display = "block";
		}
		else
		{
			f[i].style.display = "none";
		}
	}
}