<!--
/*************************************************************
 * ÆÄÀÏ¸í : stdlib.js
 * ±â  ´É : ±âº» ÇÔ¼ö ¶óÀÌºê·¯¸®.
 * ÀÛ¼ºÀÚ : hamhaja
 * ÀÛ¼ºÀÏ : 2002.09.02
 * ÃÖÁ¾¼öÁ¤ÀÏ : 2005.12.30
**************************************************************/
/**
* ÄÞ¸¶ ºÙÀÌ±â
* 2005-01-04
*/
function add_comma(str)
{
	// ÄÞ¸¶¸¦ Á¦°Å
	str = str.delete_comma(str);
	if (isNaN(str)) return str;
	// ÃÊ±âÈ­
	var result = "";
	var negNum = false;
	var comNum, rest, first, end;
	var posUnit = 3;	
	// À½¼öÀÎ°æ¿ì
	if (eval(str) < 0)
	{
		negNum = true;
		str = -1 * str;
		result += '-';
	}
	str = str.toString(10);
	if (str.length < 0) return '0';	
	comNum	= parseInt((str.length - 1) / posUnit);		// µé¾î°¥ ÄÞ¸¶ °³¼ö
	rest	= str.length % posUnit ;						// Ã¹ ÄÞ¸¶°¡ ¿À±âÀü ¸Ç ¾Õ ÀÚ¸®
	first	= 0;											// ½ÃÀÛ ÀÎµ¦½º
	if (rest == 0) end = rest = posUnit;
	else end = rest;	
	result += str.substring(first, end);
	for (var i = 1; i <= comNum; i++)
	{
		first = end;
		end = (i * posUnit) + rest;
		result += ',' + str.substring(first, end);
	}
	return result;
}
/**
* ÀÚµ¿À¸·Î ÄÞ¸¶ ºÙÀÌ±â..
* 2006-01-23
*/
function auto_add_comma(o)
{
	o.value = add_comma(o.value.trim());
}
/**
* ¹®ÀÚ¿­ ±æÀÌ¸¦ ÆÇ´ÜÇÏ°í ÀÚµ¿À¸·Î Æ÷Ä¿½º¸¦ ³Ñ±ä´Ù.
* 2004-02-24
*/
function auto_focus(obj, len, focus)
{
	if (obj.value.length == len)
		focus.focus();
}
/**
* ÁÖ¹Îµî·Ï ¹øÈ£ÀÇ À¯È¿¼ºÀ» Ã¼Å©ÇÑ´Ù.         
*/
function check_jumin(it)
{
	var IDtot = 0;
	var IDAdd = "234567892345";	
	if (!isNaN(it))	// ÁÖ¹Îµî·Ï¹øÈ£°¡ ¼ýÀÚ(Á¤»óÀûÀÎ °ª)ÀÌ¸é
	{
		for (i=0; i < 12; i++)
			IDtot = IDtot + eval(it.substring(i, i+1)) * eval(IDAdd.substring(i, i+1));
		IDtot = 11 - (IDtot % 11);		
		if (IDtot == 10) IDtot=0;
		else if (IDtot == 11) IDtot=1;
		if (eval(it.substring(12, 13)) == IDtot) return true;
	}	
	return false;
}
//-->	