function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function printStr(str)
{
    document.writeln(str);
}

function printSwf(src, width, height)
{
    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
    document.writeln('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
    document.writeln('width="' + width + '" height="' + height + '" id="menu_navi" align="middle">');
    document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
    document.writeln('<param name="movie" value="' + src + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="bgcolor" value="#ffffff" />');
    document.writeln('<embed src="' + src + '" quality="high" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="menu_navi" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object>');
}

function checkTextfield(obj, errorMsg)
{
	if(obj.value.length == 0)
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}

function checkRadio(obj, index, is_event)
{
	if(obj == null) return false;

	if(obj.length == undefined)
	{
		if(is_event) obj.click();
		else obj.checked = true;
		return;
	}

	if(is_event) obj[index].click();
	else 
	{
		obj[index].checked = true;
	}
	
}

function checkSelect(obj, errorMsg, errorIndex)
{
	if(obj.selectedIndex == errorIndex)
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}

function goURL(url)
{
	location.href = url;
}

function popupWindow(url, name, width, height)
{
	w = window.open(
							url, 
							name, 
							"width=" + width + ",height=" + height + ", scrollbars=yes, status=no"
							);
	w.focus();
	return w;
}

function openPopup2(url, name, width, height, top, left, scrollbars, resizable)
{
	if(scrollbars == null) scrollbars = "no";
	if(resizable == null) resizable = "no";
	w = window.open(
							url, 
							name, 
							"width=" + width + 
							",height=" + height + 
							", scrollbars=" + scrollbars + 
							", status=no, resizable=" + resizable + 
							", top=" + top + 
							", left=" + left
							);
	w.focus();
	return w;
}

function openPopup(url, name, width, height, scrollbars, resizable)
{
	if(scrollbars == null) scrollbars = "no";
	if(resizable == null) resizable = "no";

	var top = window.screen.Height/2 - height/2 -20;
    var left = window.screen.Width/2 - width/2;

	w = window.open(
							url, 
							name, 
							"width=" + width + ",height=" + height + ", scrollbars=" + scrollbars + ", status=no, resizable=" + resizable + 
							", top=" + top + ", left=" + left
							);
	w.focus();
	return w;
}

function msg(m)
{
	alert(m);
}

function checkBusinessNum(vencod){

    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] = vencod.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;
}

function checkTextfieldForEmail(obj, errorMsg) 
{
	var strng = obj.value;
	re1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	re2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
	if( re1.test(strng) || !re2.test(strng) ) 
	{
		if(errorMsg != null && errorMsg != "") 
		{
			alert(errorMsg);
			obj.focus();
		}
		return false;
	}
	else return true;
}

function getCookie( name )
{
	var nameOfCookie = name + "="; 
	var x = 0; 

	while ( x <= document.cookie.length ) 
	{ 

		var y = (x+nameOfCookie.length); 

		if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
				if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
						endOfCookie = document.cookie.length; 
				return unescape( document.cookie.substring( y, endOfCookie ) ); 
		} 
		x = document.cookie.indexOf( " ", x ) + 1; 

		if ( x == 0 ) break; 
	} 
	return ""; 
}

function checkTextfieldForNumber(obj, errorMsg) 
{ 
	var strng = obj.value;

	if (strng.length==0 || isNaN(strng)) 
	{
		alert(errorMsg);
		obj.focus();
		return false;
	}
	else return true;
}


function checkTextfieldForSSN(obj1, obj2, errorMsg)
{
	if(!checkSSN(obj1.value, obj2.value))
	{
		alert(errorMsg);
		obj1.focus();
		return false;
	}
	else return true;
}

/**
	ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
*/
function checkSSN(idn1, idn2) 
{
	var strng = idn1 + "-" + idn2;

	re = /^[0-9]{6}-?[0-9]{7}$/;
	if (!re.test(strng)) return false;

	strng_new = strng.replace("-","");
	var year   = parseInt(strng_new.substr(0,2),10);
	var month  = parseInt(strng_new.substr(2,2),10);
	var day    = parseInt(strng_new.substr(4,2),10);
	var gender = parseInt(strng_new.charAt(6)  ,10);
	if ( month<1 || month>12 || gender<1 || gender>4 ) return false;

	var arrayOfLasts = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if(month==2) {
		year += (gender<3 ? 1900 : 2000);
		if(Q_is_leap_year(year)) arrayOfLasts[1] = 29;
	}
	if(day<1 || day>arrayOfLasts[month-1]) return false;

	var tmp = 0;
	for(var n=0; n<12; n++) tmp += (n%8+2) * parseInt(strng_new.charAt(n),10);
	tmp = (11-(tmp%11))%10;
	if (tmp != strng_new.charAt(12)) return false;
	return true;
}

function trim(str) {
	var i = 0;
	var j = 0;
	
	if (str == null || str == "" || str == "undefined")
		return "";
		
	var len = str.length;

	for (i=len - 1; i >= 0; i--) {
		if (str.charAt(i) != " " && str.charCodeAt(i) != 160) break;
	}

	for (j=0; j < i; j++) {
		if (str.charAt(j) != " " && str.charCodeAt(j) != 160) break;
	}

	return str.substring(j, i + 1);
}

function lpad(str, leng, repChar) {
    str = new String(str);
	for(var i=str.length; i<leng; i++) str = repChar + str;
    return str;
}

function rpad(str, leng, repChar) {
    for(var i=str.length; i<leng; i++)
        str=str+repChar;
    return str;
}

function returnMsg(msg, obj, ret)
{
	if(msg != "") alert(msg);
	if(obj != null) obj.focus();
	return ret;
}

function makeComma(checkText)
{
	checkText = new String(parseNumber(checkText));
	var len = checkText.length;
	var str = checkText;
	if(len < 4)
	{
		return str;
	}
	else if (len == 4)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,len);
		return str;
	}
	else if(len == 5)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,len);
		return str;
	}
	else if(len == 6)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,len);
		return str;
	}
	else if(len == 7)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,3) + "," + checkText.substr(4,len);
		return str;
	}
	else if(len == 8)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,3) + "," + checkText.substr(5,len);
		return str;
	}
	else if(len == 9)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,3) + "," + checkText.substr(6,len);
		return str;
	}
	else if(len == 10)
	{
		str = checkText.substr(0,1) + "," + checkText.substr(1,3) + "," + checkText.substr(4,3) + "," + checkText.substr(7,len);
		return str;
	}
	else if(len == 11)
	{
		str = checkText.substr(0,2) + "," + checkText.substr(2,3) + "," + checkText.substr(5,3) + "," + checkText.substr(8,len);
		return str;
	}
	else if(len == 12)
	{
		str = checkText.substr(0,3) + "," + checkText.substr(3,3) + "," + checkText.substr(6,3) + "," + checkText.substr(9,len);
		return str;
	}
	else if(len > 12)
	{
		alert("ÇöÀçÀÔ·ÂµÈ °ªÀ» È®ÀÎÇÏ¼¼¿ä!" + '\n' + "°è»êµÈ °ªÀÌ 1Á¶ÀÌ»óÀÔ´Ï´Ù!");
		return checkText;
	}
}

function remove(str, gubun)
{
	return str.split(gubun).join("");
}

function getRadioValue(obj)
{
	if(obj.length == undefined) 
	{
		if(obj.checked) return obj.value;
		else return null;
	}

	for(var i=0 ; i<obj.length ; i++)
	{
		if(obj[i].checked) return obj[i].value;
	}

	return null;
}


/**
	¶óµð¿À ¹öÆ°ÀÏ¶§ À¯¿ëÇÑ ÇÔ¼ö.
	ÇØ´ç Ç×¸ñÀÌ Ã¼Å©°¡ µÇ¾î ÀÖµç, ¾ÈµÇ¾î ÀÖµç°£¿¡ ¹«Á¶°Ç checked¼Ó¼ºÀ» true·Î ¼³Á¤ÇÑ´Ù.
*/
function check(obj, value)
{
	if(obj == null) return;
	if(obj.length == undefined)
	{
		if(obj.value == value) obj.checked = true;
	}
	else
	{
		for(var i=0 ; i<obj.length ; i++)
		{
			if(obj[i].value == value) 
			{
				obj[i].checked = true;
				return;
			}
		}
	}
}


/**
	Ã¼Å©¹Ú½ºÀÏ¶§ À¯¿ëÇÑ ÇÔ¼ö.
	ÇØ´ç Ç×¸ñÀÌ Ã¼Å©°¡ µÇ¾î ÀÖÀ¸¸é ÇØÁ¦ÇÏ°í, Ã¼Å©¾ÈµÇ¾î ÀÖÀ¸¸é Ã¼Å©ÇÏµµ·Ï ÇÑ´Ù.
*/
function check2(obj, index)
{
	if(obj == null) return;
	if(obj.length == undefined)
	{
		if(index == 0) obj.checked = !obj.checked;
	}
	else
	{
		for(var i=0 ; i<obj.length ; i++)
		{
			if(i == index) 
			{
				obj[i].checked = !obj[i].checked;
				return;
			}
		}
	}
}

/**
	@params
	name : "id" attribute name
	display : "display" attribute value
*/
function setDisplay(name, display)
{
	var obj = document.all[name];
	if(obj == null) obj = document.frm[name];
	if(obj == null) obj = document.images[name];

	if(obj == null)
	{
		alert("function[setDisplay] ERROR : Object(" + name + ") is NULL!!");
		return;
	}
	
	obj.style.display = display;
}


function leapyear(year) 
{
	if (((year%4 == 0) && (year%100 != 0)) || (year%400 == 0)) return true;
	else return false;
}

function getLastDay(month, year)
{
	var days;
	month = month-1;
	switch (month)
	{
		case 0 : days=31; break;
		case 1 : if (leapyear(year)) days=29;
					else days=28;
					break;
		case 2 : days=31; break; 
		case 3 : days=30; break;
		case 4 : days=31;  break;
		case 5 : days=30;  break;
		case 6 : days=31;  break;
		case 7 : days=31;  break;
		case 8 : days=30;  break;
		case 9 : days=31;  break;
		case 10 : days=30;  break;
		case 11 : days=31;  break;
	}
	return days;
}

function initCombo(obj)
{
	while(obj.options.length > 0)
	{
		obj.options[0] = null;
	}
}

function addOption(obj, value, text)
{
	obj.options[obj.options.length] = new Option(text, value);
}

function setText(name, text)
{
	document.all[name].innerHTML = text;
}

function getDisplay(name)
{
	var obj = document.all[name];
	if(obj == null) obj = frm[name];
	if(obj == null) alert("ERROR : '" + name + "' is null !!!");

	return obj.style.display;
}

function checkAll(obj, value)
{
	if(obj == null) return;
	if(obj.length == undefined) 
	{
		obj.checked = value;
		return;
	}

	for(var i=0 ; i<obj.length ; i++)
	{
		obj[i].checked = value;
	}
}

/**
	¶óµð¿À¹öÆ°, Ã¼Å©¹Ú½ºÀÇ Ã¼Å©¿©ºÎ¸¦ È®ÀÎÇÑ´Ù.
*/
function is_checked(obj)
{
	if(obj == null) return false;

	if(obj.length == undefined) return obj.checked;

	for(var i=0 ; i<obj.length ; i++)
	{
		if(obj[i].checked) return true;
	}

	return false;
}

function parseNumber(num)
{
	num = new String(num);
	num = remove(num, ",");
	if (num.length==0 || isNaN(num)) return 0;
	return Number(num);
}

function setReadOnlyAll(form_name, is_readonly)
{
	var formObj = document.forms[form_name];
	var obj, tagName, type;

	for(var i=0 ; i<formObj.elements.length ; i++)
	{
		obj = formObj.elements[i];
		tagName = obj.tagName;
		type = obj.type.toUpperCase();
		if(	tagName == "TEXTAREA" || 
			(tagName == "INPUT" && (type == "PASSWORD" || type == "TEXT")))
		{
			obj.readOnly = is_readonly;
		}
	}
}

function openModal(url, width, height, arg)
{
	if(arg == null) arg = window;
	var ret = showModalDialog(url,arg,"dialogWidth:" + width + "px; dialogHeight:" + height + "px; center=yes; screenTop=yes; scroll=auto; status=no; help=no;");
	return ret;
}

/**
	obj°´Ã¼ÀÇ display style¼Ó¼ºÀ» hidden, inline À¸·Î ¼³Á¤ÇÕ´Ï´Ù.
*/
function setVisible(obj, is_show)
{
	var display = "none";
	if(is_show) display = "inline";
	if(obj == null || obj.style == null) 
	{
		alert("ERROR : setVisible()\nÀÎ¼ö obj´Â style¼Ó¼ºÀ» °®Áö ¾Ê°Å³ª NULLÀÔ´Ï´Ù.");
		return;
	}
	obj.style.display = display;
}

function nvl(value, rep)
{
	if(value == null || trim(value) == "") return rep;
	return value;
}

/************************************************************

	Framework¿¡¼­ »ç¿ëÇÏ´Â ÇÔ¼öµé

************************************************************/

/**
	TEXTFIELD(INPUT TYPE=text)¿¡ ¼Ó¼ºÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
	- MONEY : ¿À¸¥ÂÊ Á¤·ÄµÇ¸ç ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°í Æ÷Ä¿½º¸¦ ÀÒ¾úÀ» ¶§ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶¸¦ Âï´Â´Ù.
	- NUMBER : ¼ýÀÚ¸¸ ÀÔ·Â°¡´É
	- NUMBER2 : (-)(.)ÀÔ·Â °¡´ÉÇÑ ¼ýÀÚÇüÅÂ
	- RIGHT : ¿À¸¥ÂÊ Á¤·Ä½ÃÅ´
	- CENTER : °¡¿îµ¥ Á¤·Ä½ÃÅ´
	- DATE : ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ¸ç, ÀÏ¹ÝÀûÀÎ ³¯Â¥Æ÷¸ËÀÎ YYYY-MM-DD ÇüÅÂ¸¦ À¯ÁöÇÑ´Ù.
*/
var is_onload = false;
function init()
{
	//alert("ok");
	is_onload = true;
	_init();
	
	// ¿ÞÂÊ¸Þ´º ÀÌ¹ÌÁö¸¦ ·Ñ¿À¹ö½Ã ÀÌ¹ÌÁö ¹Ù²î´Â ±â´ÉÀ» ¸¸µé±â À§ÇÔ.
	init_leftmenu_img();

	var align = "";
	if(document.frm == null) return;
	for(var i=0 ; i<document.frm.elements.length ; i++)
    {
        obj = document.frm.elements[i];
		if(obj.tagName == "INPUT") 
		{
			if(obj.type.toUpperCase() == "TEXT")
			{
				if(obj.getAttribute("RIGHT") != null) obj.style.textAlign = "right";
				if(obj.getAttribute("CENTER") != null) obj.style.textAlign = "center";
				if(obj.getAttribute("MONEY") != null) 
				{
					obj.style.textAlign = "right";
					obj.value = makeComma(remove(obj.value, ","));
					if(obj.value == "") obj.value = "0";
				}
				
				if(
					obj.getAttribute("MONEY") != null || obj.getAttribute("NUMBER")!= null ||
					obj.getAttribute("NUMBER2") != null || obj.getAttribute("DATE") != null
				)
				{
					// ÇÑ±Û¸ðµå½Ã¿¡´Â ¹®ÀÚÀÔ·Â½Ã ÇÊÅÍ¸µÀÌ ºÒ°¡´ÉÇÏ¹Ç·Î ¾Æ¿¹ ÇÑ±Û¸ðµå¸¦ ºÒ°¡´ÉÇÏ°Ô ¸¸µé¾î¼­ ¹®ÀÚÀÔ·ÂÀ» ºÒ°¡´ÉÇÏ°Ô ÇÔ.
					obj.style.imeMode = "disabled";
				}
				
			}
			
			obj.onfocus = _onfocus;
			obj.onblur = _onblur;
			obj.onkeydown = _onkeydown;
			obj.onfocusout = _onfocusout;
		}
	}
	is_onload = false;
}

function init_leftmenu_img()
{
	for(var i=0 ; i<document.images.length ; i++)
	{
		var img = document.images[i];
		if(img.getAttribute("LEFTMENU") != null)
		{
			img.s = img.src;
			img.onmouseover = _mouseover_img;
			img.onmouseout = _mouseout_img;
		}
	}
}

function _mouseover_img()
{
	this.s = this.src;
	if(this.src.indexOf("_over") < 0) 
	{
		this.selected = true;
		return;
	}

	this.src = remove(this.src, '_over');
}

function _mouseout_img()
{
	if(this.selected) return;
	this.src = this.s;
}

/**
	focus¸¦ ÀÒ¾úÀ»¶§ Ã³¸®µÇ´Â ÀÌº¥Æ® ÇÚµé·¯.
	onblurº¸´Ù ¸ÕÀú Ã³¸®µÈ´Ù.
*/
function _onfocusout()
{
	var obj = event.srcElement;
	_onfocusout1(obj);
}



function _onkeydown()
{
	_onkeydown1();
	var obj = event.srcElement;
	var iKey = event.keyCode;
	if(iKey == 13)
	{
		if(obj.tagName == "INPUT" && (obj.type == "text" || obj.type == "password")) 
		{
			_onenterdown(obj);
			event.returnValue = false;
			return;
		}
	}
	
	
	var s = String.fromCharCode(iKey);
	//alert(iKey);

	if(iKey != 32)
	{
		if((iKey >= 34 && iKey <= 40) || iKey == 45 || iKey == 46 || iKey == 32 || iKey == 8) return;
	}

	if(obj.getAttribute("NUMBER") != null || obj.getAttribute("MONEY") != null)
	{
		if(iKey >= 96 && iKey <= 105) 
		{
			event.returnValue = true;
			return;
		}

		if (s >= 0 && s <= 9) event.returnValue = true;
		else event.returnValue = false;
		//alert(event.returnValue);
	}
	else if(obj.getAttribute("NUMBER2") != null)
	{
		if((iKey >= 96 && iKey <= 105) || iKey == 109) event.returnValue = true;
		if ((s >= 0 && s <= 9) || iKey == 189 || iKey == 190) event.returnValue = true;
		else event.returnValue = false;
	}

	var type = obj.type.toUpperCase();
	if(obj.tagName == "INPUT")
	{
		if(type == "TEXT" || type == "PASSWORD")
		{
			//obj.blur();
			//event.returnValue = false;
		}
	}
}

function _onenterdown()	// ¿£ÅÍÅ° ÀÔ·Â½Ã¿¡ È£ÃâµÊ
{
	var obj = event.srcElement;
	_onenterdown1(obj);
}

function _onblur()
{
	var obj = event.srcElement;
	_onblur1();
	_onblur2(obj);
	
	if(obj.getAttribute("MONEY") != null) 
	{
		obj.value = makeComma(remove(obj.value, ","));
		if(obj.value == "") obj.value = "0";
	}

	if(obj.getAttribute("DATE") != null)
	{
		obj.value = obj.value.split("-").join("");
		obj.value = obj.value.substring(0, 4) + "-" + obj.value.substring(4, 6) + "-" + obj.value.substring(6, 8);
	}
}

var preValue;
function _onfocus()
{
	var obj = event.srcElement;
	_onfocus1();
	_onfocus2(obj);
	
	
	if(obj.getAttribute("MONEY") != null) obj.value = remove(obj.value, ",");
	if((obj.tagName == "INPUT" && (obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")) || obj.tagName == "TEXTAREA") 
	{
		obj.preValue = obj.value;
		obj.select();
	}
}
function _onkeydown1(){}
function _onfocus1(){}
function _onfocus2(obj){}
function _onblur1(){}
function _onblur2(obj){}
function _onfocusout1(obj){}
function _onenterdown1(obj){}


function _init()
{}

function selectRow(index)
{
	if(frm.index != null) frm.index.value = index;
	check(frm["chk[]"], index);
	_selectRow(index);
}

function _selectRow(index){}
/**
	form °´Ã¼ ÀÚµ¿Ã¼Å© & trimÀÚµ¿À¸·Î ÇØÁÜ.
	moneyÅ¸ÀÔÀº ÀÚµ¿À¸·Î ½°Ç¥(,) Á¦°ÅÇØÁÜ
*/
function _validate(frm)
{
	var obj;
    var value;
    var is_required;
	var highlight_color = "#FFDDFF";

	if(frm == null) return true;
	for(var i=0 ; i<frm.elements.length ; i++)
    {
        obj = frm.elements[i];
		if((obj.tagName == "INPUT" && (obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")) ||
			obj.tagName == "TEXTAREA" ||
			obj.tagName == "SELECT"
		) 
		{
			obj.style.backgroundColor = "";
		}
	}
    
    for(var i=0 ; i<frm.elements.length ; i++)
    {
        obj = frm.elements[i];
		value = obj.value;
        
        if(obj.getAttribute("REQUIRED") != null) is_required = true;
		else is_required = false;

        if(!is_required) continue;

        var msg = trim(obj.getAttribute("MSG"));
        if(msg == "") msg = "ÇÊ¼ö Ç×¸ñÀÔ´Ï´Ù.";

        //alert(obj.type);
		if(obj.tagName == "INPUT")
        {
            if(obj.getAttribute("EMAIL") != null)
			{
				if(value == "")
				{
					alert(msg);
					obj.focus();
					obj.style.backgroundColor = highlight_color;
					return false;
				}

				if(!checkTextfieldForEmail(obj))
				{
					alert("ÀÌ¸ÞÀÏ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
					obj.focus();
					obj.style.backgroundColor = highlight_color;
					return false;
				}
			}
			
			if(obj.type.toUpperCase() == "TEXT" || obj.type.toUpperCase() == "PASSWORD")
            {
                if(trim(value) == "")
                {
                    alert(msg);
                    obj.focus();
                    obj.style.backgroundColor = highlight_color;
					return false;
                }
            }
            else if(obj.type.toUpperCase() == "RADIO")
            {
				obj = frm[obj.name];
				if(!checkRadio(obj))
                {
                    //alert("°ÅÁþ");
					if(obj.length != undefined) 
                    {
                        msg = trim(obj[0].getAttribute("MSG"));
                        if(msg == "") msg = "ÇÊ¼ö Ç×¸ñÀÔ´Ï´Ù.";
                    }
                    alert(msg);
					return false;
                }
            }
			obj.value  = trim(value);
        }
        else if(obj.tagName == "SELECT")
        {
            value = obj[obj.selectedIndex].value;
            if(value == "")
            {
                alert(msg);
                obj.focus();
                obj.style.backgroundColor = highlight_color;
				return false;
            }
        }
		else if(obj.tagName == "TEXTAREA")
		{
			if(trim(value) == "")
			{
				alert(msg);
				obj.focus();
				obj.style.backgroundColor = highlight_color;
				return false;
			}
		}
    }

	for(var i=0 ; i<frm.elements.length ; i++)
    {
        obj = frm.elements[i];
		if(obj.tagName == "INPUT") 
		{
			if(obj.getAttribute("MONEY") != null) obj.value = remove(obj.value, ",");
		}
	}
	return true;
}



function do_nothing()
{
	return;
}

function getGridText(gridName, row, col, doc)
{
	if(doc == null) doc = document;
	
	var value;
	var obj = frm[gridName + row + "_" + col];
	if(obj == null) obj = doc.all[gridName + "_text" + row + "_" + col];
	else value = obj.value;
	
	if(obj == null) 
	{
		alert("gridName : " + gridName + "\n" + 
				"row : " + row + "\n" + 
				"col : " + col);
		//return false;
	}

	if(frm[gridName + row + "_" + col] == null) value = obj.innerHTML;

	return value;
}

function getGridCellObject(gridName, row, col, doc)
{
	if(doc == null) doc = document;
	
	var obj = frm[gridName + row + "_" + col];
	if(obj == null) obj = doc.all[gridName + "_text" + row + "_" + col];

	return obj;
}

function getGridRow(gridName, row, doc)
{
	var ret = new Array();
	
	for(var i=0 ; i<50 ; i++)
	{
		if(getGridCellObject(gridName, row, i, doc) == null) break;
		ret[i] = getGridText(gridName, row, i, doc);
	}

	return ret;
}

function submitForm(target, action, work, formObj)
{
	if(formObj == null) formObj = frm;

	formObj.target = target;

	formObj.action = action;
	if(work != null) formObj.work.value = work;

	formObj.submit();
}

