 /**
 * @type : intro
 * @desc : pow_common.js´Â ÇÁ·ÎÁ§Æ® Àü¹Ý¿¡ °ÉÃÄ Àü ½Ã½ºÅÛ¿¡¼­ °øÅëÀ¸·Î »ç¿ëÇÏ´Â ÀÚ¹Ù ½ºÅ©¸³Æ®¸¦ ±â¼úÇÑ
 * ÀÚ¹Ù½ºÅ©¸³Æ® ÆÄÀÏÀÌ´Ù. ºó¹øÈ÷ »ç¿ëµÇ´Â ÀÚ¹Ù½ºÅ©¸³Æ®µéÀÌ È­¸é¸¶´Ù ¹Ýº¹ÀûÀ¸·Î °³¹ßµÇÁö
 * ¾Êµµ·Ï ¹Ì¸® Á¤ÀÇµÇ¾î ÀÖ¾î¼­ pow_common.js¸¦ ¾÷¹«È­¸é¿¡ import½ÃÅ°±â¸¸ ÇÏ¸é pow_common.js¿¡ Á¤ÀÇµÇ¾î
 * ÀÖ´Â ½ºÅ©¸³Æ®µé¿¡ ´ëÇØ¼­´Â °¢ °³¹ßÀÚ°¡ º°µµ·Î °³¹ßÇÒ ÇÊ¿ä°¡ ¾ø´Ù.<br><br>
 *
 * ÇÔ¼ö Naming RuleÀº ´ÙÀ½°ú °°´Ù.
 * <pre>
 *     - cf  : common function
 *     - co  : common object
 *     - cov : common object for validation
 * </pre>
 * @version : 1.0
 * @change  :
 * <pre>
 *     <font color="blue">V1.0</font>
 *     - ÃÖÃÊ¹öÀü.
 * </pre>
 */


 /** ÀÌ ºÎºÐÀº document·Î generateµÇÁö ¾Ê½À´Ï´Ù.
 * @JScript Âü°íÀÚ·á
 * - isNaN : ´ÙÀ½Àº ¸ðµÎ ¼ýÀÚ·Î º»´Ù. - "001", "0", "", null
 * - substr(index[, length]) -> indexºÎÅÍ ³¡±îÁö È¤Àº length°¹¼ö¸¸Å­.
 * - substring(start, end)  -> start indexºÎÅÍ end indexÀü±îÁöÀÇ string
 * Date ¿ÀºêÁ§Æ® »ý¼ºÀÚµé - dateObj = new Date()
 *                        - dateObj = new Date(dateVal)
 *                        - dateObj = new Date(year, month, date[, hours[, minutes[, seconds[,ms]]]])
 */

/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ alert box·Î º¸¿©ÁØ ÈÄ ¸®ÅÏÇÑ´Ù. cfGetMsg ÂüÁ¶.
 * @sig    : msgId[, paramArray]
 * @param  : msgId required common.jsÀÇ °øÅë ¸Þ¼¼Áö ¿µ¿ª¿¡ ¼±¾ðµÈ ¸Þ¼¼Áö ID
 * @param  : paramArray optional ¸Þ¼¼Áö¿¡¼­ '@' ¹®ÀÚ¿Í Ä¡È¯µÉ µ¥ÀÌÅÍ Array. ArrayÀÇ index¿Í ¸Þ¼¼Áö ³»ÀÇ '@' ¹®ÀÚÀÇ ¼ø¼­°¡ ÀÏÄ¡ÇÑ´Ù.
 *           Ä¡È¯µÉ µ¥ÀÌÅÍ´Â [] »çÀÌ¿¡ ÄÞ¸¶¸¦ ±¸ºÐÀÚ·Î ÇÏ¿© ±â¼úÇÏ¸é Array ·Î ÀÎ½ÄµÈ´Ù.
 * @return : Ä¡È¯µÈ ¸Þ¼¼Áö ½ºÆ®¸µ
 * @author : ÀÓÀçÇö
 */

function cfAlertMsg(msgId, paramArray) {
	if (cfIsNull(msgId)) {
		alert("Á¸ÀçÇÏÁö ¾Ê´Â ¸Þ½ÃÁöÀÔ´Ï´Ù.");
		return null;
	}
	var msg;
	var code;
	if ( msgId.indexOf("MSG_")>=0)
		code = eval(msgId.cut(0,msgId.indexOf("MSG_")).trim());
	else if(msgId.indexOf("[DSET")>=0){

		code = msgId.substring(msgId.lastIndexOf("]")+1,msgId.length);

	}
	else if(msgId.indexOf("[TRNS")>=0){

		code = msgId.substring(msgId.lastIndexOf("]")+1,msgId.length);

	}
	else
		code = msgId;

	msg = new coMessage().getMsg(code, paramArray);
	alert(msg);
	return msg;
}

/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ confirm box·Î º¸¿©ÁØ ÈÄ ¸®ÅÏÇÑ´Ù. cfGetMsg ÂüÁ¶.
 * @sig    : msgId[, paramArray]
 * @param  : msgId      required common.jsÀÇ °øÅë ¸Þ¼¼Áö ¿µ¿ª¿¡ ¼±¾ðµÈ ¸Þ¼¼Áö ID
 * @param  : paramArray optional ¸Þ¼¼Áö¿¡¼­ '@' ¹®ÀÚ¿Í Ä¡È¯µÉ ½ºÆ®¸µ Array. (ArrayÀÇ index¿Í
 *           ¸Þ¼¼Áö ³»ÀÇ '@' ¹®ÀÚÀÇ ¼ø¼­°¡ ÀÏÄ¡ÇÑ´Ù.)
 * @return : Ä¡È¯µÈ ¸Þ¼¼Áö ½ºÆ®¸µ
 * @author : ÀÓÀçÇö
 */
function cfConfirmMsg(msgId, paramArray) {
	if (cfIsNull(msgId)) {
		alert("Á¸ÀçÇÏÁö ¾Ê´Â ¸Þ½ÃÁöÀÔ´Ï´Ù.");
		return null;
	}

	return confirm(new coMessage().getMsg(msgId, paramArray));
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ¼ýÀÚ ¾Õ¿¡ ÁöÁ¤µÈ ÀÚ¸´¼ö¸¸Å­ zero character ¸¦ »ðÀÔÇÑ´Ù.
 * <pre>
 *     cfDigitalNumber(5, 123);
 * </pre>
 * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì "00123" ÀÌ¶ó´Â StringÀ» ¸®ÅÏÇÑ´Ù.
 * @sig    : length, number
 * @param  : length required ¼ýÀÚ¸¦ Ç¥ÇöÇÏ´Â ±æÀÌ
 * @param  : number required º¯È¯µÉ ¼ýÀÚ
 * @return : º¯È¯µÈ ½ºÆ®¸µ
 * @author : ÀÓÀçÇö
 */
function cfDigitalNumber(length, number) {
	var numStr = number + "";
	var zeroChars = "";

	for (var i = 0; i < (length - number.length); i++) {
		zeroChars = zeroChars + "0";
	}

	return (zeroChars + numStr);
}

/**
 * @type   : function
 * @access : public
 * @desc   : element¸¦ disable ½ÃÅ²´Ù.
 * <pre>
 *     cfDisable(oRegistBtn);
 * </pre>
 * @sig    : oElement
 * @param  : oElement required disable ÇÏ°íÀÚ ÇÏ´Â element
 * @author : ÀÓÀçÇö
 */
function cfDisable(obj) {
	if (cfIsNull(obj)) {
		return;
	}

	if (obj.length != null) {
		for (var i = 0; i < obj.length; i++) {
			cfProcessChildElement(obj[i], cfDisableElement);
		}
	} else {
		cfProcessChildElement(obj, cfDisableElement);
	}
}

/*
	- <input type=text> ÀÇ °æ¿ì disable½Ã¿¡ ±ÛÀÚ»öÀ» ÁöÁ¤ÇÒ ¼ö ¾ø´Ù. µû¶ó¼­ disable ´ë½Å readOnly·Î ¹Ù²Û´Ù.
	- EMEditÀÇ °æ¿ì ¿ª½Ã disable½Ã¿¡ ±ÛÀÚ»öÀ» ÁöÁ¤ÇÒ ¼ö ¾ø´Ù. µû¶ó¼­ disable ´ë½Å readOnly·Î ¹Ù²Û´Ù.
	- °¡¿ì½º Radio´Â ReadOnly°¡ ¾øÀ¸¸ç EnableÀ» false·Î ¼³Á¤ÇÏ¸é ±ÛÀÚ»öÀ» ¹Ù²Ü ¼ö°¡ ¾ø´Ù. ±ÛÀÚ»ö¹Ù²Þ Æ÷±â.
	- <input type=checkbox> ÀÇ °æ¿ì ReadOnly°¡ ¾øÀ¸¸ç disabled¸¦ true·Î ÇÒ °æ¿ì box³»ºÎ »ö±òÀ» ¹Ù²Ü ¼ö°¡ ¾ø´Ù. box »ö¹Ù²Þ Æ÷±â.
	- °¡¿ì½º CodeComboÀÇ °æ¿ì InheritColor¼Ó¼ºÀ» true·Î ÇÏ¶ó°í °¡ÀÌµåÇÏ¿´À¸¸ç InheritColor¼Ó¼ºÀÌ trueÀÏ °æ¿ì, ¹è°æ»ö°ú
	  ±ÛÀÚ»öÀ» ¸ðµÎ ¹Ù²Ü ¼ö°¡ ÀÖ´Ù. ´Ü, ReadOnly´Â ¾øÀ¸¸ç EnableÀ» false·Î ÇØ¾ß ÇÑ´Ù. EnableÀÌ falseÀÏ °æ¿ì´Â ¹è°æ»ö°ú ±ÛÀÚ»öÀÌ
	  °íÁ¤µÇ¾î¼­ ¹Ù²Ü ¼ö°¡ ¾ø´Ù.
*/

function cfDisableElement(oElement, argArr) {
	switch (cfGetElementType(oElement)) {
		case "BUTTON" :
			oElement.disabled = true;

			if (oElement.className != null &&
			    (oElement.className.substr(0, 7) == "btnGrid" ||
			     oElement.className.substr(0, 7) == "btnIcon" ) &&
			   	oElement.currentStyle.backgroundImage.substr(oElement.currentStyle.backgroundImage.length - 15, 9) != "_disabled"
			   ) {
			   	oElement.style.backgroundImage =
			   		oElement.currentStyle.backgroundImage.substr(0, oElement.currentStyle.backgroundImage.length - 6) + "_disabled" +
			   		oElement.currentStyle.backgroundImage.substr(oElement.currentStyle.backgroundImage.length - 6);
			}

			break;

		case "CHECKBOX" :
		case "RADIO" :
		case "IMG":			//2004-12-22 Á¤ÈÆ±Ô Ãß°¡
		case "RESET" :
		case "SELECT" :
		case "SUBMIT" :
			oElement.disabled = true;
			break;

		case "FILE" :
		case "PASSWORD" :
		case "TEXT" :
		case "TEXTAREA" :
			oElement.readOnly = true;
			//oElement.style.color = "#454648";  // ÀÏ¹Ý ÅØ½ºÆ® ±âº»»ö»ó
			oElement.style.color = "#808080";    // EMEdit Disable½Ã »ö»ó°ú µ¿ÀÏ.
			oElement.style.backgroundColor = "#E3E2DF";  // HTML ¿ÀºêÁ§Æ®ÀÇ ±âº» disabled color.
			                                             // Text´Â background°¡ ÇÏ¾á»öÀ¸·Î ³²´Â´Ù. µû¶ó¼­ ½ºÅ¸ÀÏ·Î ÀÓÀÇ·Î ÁöÁ¤ÇÏ¿´À½.
			break;

		case "GE" :
//			oElement.ReadOnly = true;
//			oElement.ReadOnlyBackColor = "#DEDEDE";
//			oElement.ReadOnlyForeColor = "#454648";
			oElement.Enable = false;
			oElement.DisabledBackColor = "#DEDEDE";
			break;

		case "GCC" :
		case "GLC" :
			oElement.Enable = false;
			break;

		case "GIF" :
		case "GRDO" :
		case "GTA" :
			oElement.Enable = false;
			break;

		default :
			break;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : element¸¦ enable ½ÃÅ²´Ù.
 * <pre>
 *     cfEnable(oRegistBtn);
 * </pre>
 * @sig    : oElement
 * @param  : oElement required enable ÇÏ°íÀÚ ÇÏ´Â element È¤Àº element array
 * @author : ÀÓÀçÇö
 */
function cfEnable(obj) {
	if (cfIsNull(obj)) {
		return;
	}

	if (obj.length != null) {
		for (var i = 0; i < obj.length; i++) {
			cfProcessChildElement(obj[i], cfEnableElement);
		}
	} else {
		cfProcessChildElement(obj, cfEnableElement);
	}
}

function cfEnableElement(oElement, argArr) {
	switch (cfGetElementType(oElement)) {
		case "BUTTON" :
			oElement.disabled = false;

			if (oElement.className != null &&
			    (oElement.className.substr(0, 7) == "btnGrid" ||
			     oElement.className.substr(0, 7) == "btnIcon"
			    )
			   ) {
			   	if (oElement.currentStyle.backgroundImage.substr(oElement.currentStyle.backgroundImage.length - 15, 9) == "_disabled") {
				   	oElement.style.backgroundImage =
				   		oElement.currentStyle.backgroundImage.cut(oElement.currentStyle.backgroundImage.length - 15, 9);
				}
			}

			break;

		case "CHECKBOX" :
		case "RADIO" :
		case "RESET" :
		case "SELECT" :
		case "SUBMIT" :
		case "IMG" :           //2005-03-11 Á¤¿¬ÁÖ Ãß°¡
			oElement.disabled = false;
			break;

		case "FILE" :
		case "PASSWORD" :
		case "TEXT" :
		case "TEXTAREA" :
			oElement.readOnly = false;
			oElement.style.color = "#454648";
			oElement.style.backgroundColor = "";
			break;

		case "GE" :
//			oElement.ReadOnly = false;
			oElement.Enable = true;
			break;

		case "GCC" :
		case "GLC" :		//2004/10/12-Á¤ÈÆ±Ô Ãß°¡
			oElement.Enable = true;
			break;

		case "GIF" :
		case "GRDO" :
		case "GTA" :
			oElement.Enable = true;
			break;

		default :
			break;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : ¼­¹ö¿¡¼­ ÇöÀç½Ã°£À» ÀÐ¾î¿Í¼­ ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ Date ¿ÀºêÁ§Æ®·Î º¯È¯ÇÑ´Ù.
 *           Date ¿ÀºêÁ§Æ®·ÎºÎÅÍ ½ºÆ®¸µ ÇüÅÂ·Î ³¯Â¥ È¤Àº ½Ã°£À» ¾òÀ¸·Á¸é Date.format() ¸Þ¼Òµå¸¦ ÂüÁ¶ÇÒ °Í.
 * @return : Date ¿ÀºêÁ§Æ®
 * @author : ÀÓÀçÇö
 */
function cfGetCurrentDate() {
	var dataSet;
	var dateString;

	if (document.all("coCurrentDateGDS") == null) {
		dataSet = document.createElement("<OBJECT>");
		dataSet.classid = "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49";
		dataSet.id = "coCurrentDateGDS";
		dataSet.SyncLoad = "true";
		dataSet.DataId = "/" + DOC_ROOT + "/GetCurrentDateR.pcg";
		// </head> ÅÂ±× Á÷Àü¿¡ DataSet »ðÀÔ
		for (var i = 0; i < document.all.length; i++) {
			if (document.all[i].tagName == "HEAD") {
				document.all[i].insertAdjacentElement("beforeEnd", dataSet);
				break;
			}
		}
	} else {
		dataSet = document.all("coCurrentDateGDS");
	}

	dataSet.Reset();
	dateString = dataSet.NameValue(1, "dateString");
	dataSet.clearData();

	if (cfIsNull(dateString)) {
		return null;
	}

	return new Date(dateString.substr(0, 4),
	                Number(dateString.substr(4, 2)) -1,
	                dateString.substr(6, 2),
	                dateString.substr(8, 2),
	                dateString.substr(10, 2),
	                dateString.substr(12, 2)
	               )
}

/**
 * @type   : function
 * @access : public
 * @desc   : ElementÀÇ typeÀ» ¾Ë·ÁÁØ´Ù. ¸®ÅÏµÇ´Â element type stringÀº ´ÙÀ½°ú °°´Ù.
 * <pre>
 *     BUTTON   : html button input tag
 *     CHECKBOX : html checkbox input tag
 *     FILE     : html file input tag
 *     HIDDEN   : html hidden input tag
 *     IMAGE    : html image input tag
 *     PASSWORD : html password input tag
 *     RADIO    : html radio input tag
 *     RESET    : html reset input tag
 *     SUBMIT   : html submit input tag
 *     TEXT     : html text input tag
 *     SELECT   : html select tag
 *     TEXTAREA : html textarea tag
 *     GCC      : °¡¿ì½º CodeCombo
 *     GLC      : °¡¿ì½º LuxeCombo
 *     GRDO     : °¡¿ì½º Radio
 *     GTA      : °¡¿ì½º TextArea
 *     GIF      : °¡¿ì½º InputFile
 *     GE       : °¡¿ì½º EMEdit
 *     GDS      : °¡¿ì½º DataSet
 *     GTR      : °¡¿ì½º Transaction
 *     GCHT     : °¡¿ì½º Chart
 *     GID      : °¡¿ì½º ImageData
 *     GG       : °¡¿ì½º Grid
 *     GTB      : °¡¿ì½º Tab
 *     GTV      : °¡¿ì½º TreeView
 *     GM       : °¡¿ì½º Menu
 *     GB       : °¡¿ì½º Bind
 *     GRPT     : °¡¿ì½º Report
 *     GS       : °¡¿ì½º Scale
 *     null     : ±âÅ¸
 * </pre>
 * @sig    : oElement
 * @param  : oElement required element
 * @return : elementÀÇ typeÀ» Ç¥ÇöÇÏ´Â string
 * @author : ÀÓÀçÇö
 */
function cfGetElementType(oElement) {
	if (oElement == null) {
		return null;
	}

	switch (oElement.tagName) {
		case "INPUT":
			switch (oElement.type) {
				case "button" :
					return "BUTTON";
				case "checkbox" :
					return "CHECKBOX";
				case "file" :
					return "FILE";
				case "hidden" :
					return "HIDDEN";
				case "image" :
					return "IMAGE";
				case "password" :
					return "PASSWORD";
				case "radio" :
					return "RADIO";
				case "reset" :
					return "RESET";
				case "submit" :
					return "SUBMIT";
				case "text" :
					return "TEXT";
				default :
					return null;
			}
		case "SELECT":
			return "SELECT"
		case "TEXTAREA":
			return "TEXTAREA"
		case "IMG":
			return "IMG";	//2004-12-22 Á¤ÈÆ±ÔÃß°¡
		case "OBJECT":
			    switch (oElement.attributes.classid.nodeValue.toUpperCase()) {
				case "CLSID:FD4C6571-DD20-11D2-973D-00104B15E56F": // CodeCombo Component
					return "GCC"
				case "CLSID:60109D65-70C0-425C-B3A4-4CB001513C69": // Luxe Component
					return "GLC"
				case "CLSID:754F3DC4-0C79-4C92-AD64-A806D8FF2AB0": // Radio Component
					return "GRDO"
                case "CLSID:91B0A4F0-3206-4564-9BB4-AF9055DEF8A1": // TextArea Component
					return "GTA"
				case "CLSID:69F1348F-3EBE-11D3-973D-0060979E2A03": // InputFile Component
					return "GIF"
				case "CLSID:E6876E99-7C28-43AD-9088-315DC302C05F": // EMedit Component
					return "GE"
				case "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49": // DataSet Component
					return "GDS"
				case "CLSID:0A2233AD-E771-11D2-973D-00104B15E56F": // Transaction Component
					return "GTR"
				case "CLSID:B5F6727A-DD38-11D2-973D-00104B15E56F": // Chart Component
					return "GCHT"
				case "CLSID:BCB3A52D-F8E7-11D3-973E-0060979E2A03": // ImageData Component
					return "GID"
				case "CLSID:1F57AEAD-DB12-11D2-A4F9-00608CEBEE49": // Grid Component
					return "GG"
				case "CLSID:ED382953-E907-11D3-B694-006097AD7252": // Tab Component
					return "GTab"
				case "CLSID:4401B994-DD33-11D2-B539-006097ADB678": // TreeView Component
					return "GTree"
				case "CLSID:7A54CBF0-2CB4-11D4-973E-0060979E2A03": // Menu Component
					return "GM"
				case "CLSID:9C9AB433-EA85-11D2-A4F9-00608CEBEE49": // Bind Component
					return "GB"
				case "CLSID:37D13B2F-E5EB-11D2-973D-00104B15E56F": // Report Component
					return "GRPT"
				case "CLSID:8D6D8F1E-2567-4916-8036-50D3F7F01563": // Scale Component
					return "GS"
                default:
                	return null;
			}
		default :
			return null;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : ½ºÆ®¸µÀÇ ÀÚ¸´¼ö¸¦ Byte ´ÜÀ§·Î È¯»êÇÏ¿© ¾Ë·ÁÁØ´Ù. ¿µ¹®, ¼ýÀÚ´Â 1ByteÀÌ°í ÇÑ±ÛÀº 2ByteÀÌ´Ù.(ÀÚ/¸ð Áß¿¡ ÇÏ³ª¸¸ ÀÖ´Â ±ÛÀÚµµ 2ByteÀÌ´Ù.)
 * @sig    : value
 * @param  : value required ½ºÆ®¸µ
 * @return : ½ºÆ®¸µÀÇ ±æÀÌ
 * @author : Â÷Á¾È£
 */
function cfGetByteLength(value){
	var byteLength = 0;

	if (cfIsNull(value)) {
		return 0;
	}

	var c;

	for(var i = 0; i < value.length; i++) {
		c = escape(value.charAt(i));

		if (c.length == 1) {
			byteLength ++;
		} else if (c.indexOf("%u") != -1)  {
			byteLength += 2;
		} else if (c.indexOf("%") != -1)  {
			byteLength += c.length/3;
		}
	}

	return byteLength;
}

/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ ¸®ÅÏÇÑ´Ù.
 * <pre>
 * // °øÅë ¸Þ¼¼Áö ¿µ¿ª
 * var MSG_NO_CHANGED        = "º¯°æµÈ »çÇ×ÀÌ ¾ø½À´Ï´Ù.";
 * var MSG_SUCCESS_LOGIN     = "@´Ô ¾È³çÇÏ¼¼¿ä?";
 * ...
 * var message1 = cfGetMsg(MSG_NO_CHANGED);
 * var message2 = cfGetMsg(MSG_SUCCESS_LOGIN, ["È«±æµ¿"]);
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ message2 ÀÇ °ªÀº "È«±æµ¿´Ô ¾È³çÇÏ¼¼¿ä?" °¡ µÈ´Ù.
 * @sig    : msgId[, paramArray]
 * @param  : msgId      required common.jsÀÇ °øÅë ¸Þ¼¼Áö ¿µ¿ª¿¡ ¼±¾ðµÈ ¸Þ¼¼Áö ID
 * @param  : paramArray optional ¸Þ¼¼Áö¿¡¼­ '@' ¹®ÀÚ¿Í Ä¡È¯µÉ µ¥ÀÌÅÍ Array. ArrayÀÇ index¿Í
 *           ¸Þ¼¼Áö ³»ÀÇ '@' ¹®ÀÚÀÇ ¼ø¼­°¡ ÀÏÄ¡ÇÑ´Ù. Ä¡È¯µÉ µ¥ÀÌÅÍ´Â [] »çÀÌ¿¡ ÄÞ¸¶¸¦ ±¸ºÐÀÚ·Î ÇÏ¿© ±â¼úÇÏ¸é Array ·Î ÀÎ½ÄµÈ´Ù.
 * @return : Ä¡È¯µÈ ¸Þ¼¼Áö ½ºÆ®¸µ
 * @author : ÀÓÀçÇö
 */
function cfGetMsg(msgId, paramArray) {
	return new coMessage().getMsg(msgId, paramArray);
}

/**
 * @type   : function
 * @access : private
 * @desc   : Object¸¦ ÃÊ±âÈ­ÇÑ´Ù.
 * @sig    : obj[, iniVal]
 * @param  : parentObj required ÃÊ±âÈ­ÇÒ ´ë»ó ¿ÀºêÁ§Æ®
 * @param  : iniVal    optional ÃÊ±â°ª
 * @author : ±è¼öÈ£
 */
function cfIniObject(obj) {
	var	iniVal = "";

	switch (obj.tagName) {
		case "INPUT":
			switch (obj.type) {
				case "checkbox":
					obj.checked = 0;
					break;
				case "button" :
					break;
				case "image" :
					break;
				default :
					obj.value = "";
					break;
			}

			break;

		case "SELECT":
			obj.selectedIndex = 0;
			break;
		case "TEXTAREA":
			obj.value = "";
			break;

		case "OBJECT":
			switch (obj.attributes.classid.nodeValue.toUpperCase()) {
				case "CLSID:FD4C6571-DD20-11D2-973D-00104B15E56F": // CodeCombo Component
				case "CLSID:60109D65-70C0-425C-B3A4-4CB001513C69": // LuxCombo Component, 2004/10/12 - Á¤ÈÆ±Ô Ãß°¡
					obj.Index = 0;
                    break;
				case "CLSID:754F3DC4-0C79-4C92-AD64-A806D8FF2AB0": // Radio Component
				case "CLSID:E6876E99-7C28-43AD-9088-315DC302C05F": // EMedit Component
                case "CLSID:91B0A4F0-3206-4564-9BB4-AF9055DEF8A1": // TextArea Component
					obj.Text = "";
					break;
				case "CLSID:69F1348F-3EBE-11D3-973D-0060979E2A03": // InputFile Component
                    break;
                default :
                	break;
			}
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : »ç¿ëÀÚ°¡ ´©¸¥ key°¡ enter key ÀÎÁö ¿©ºÎ¸¦ ¾Ë·ÁÁØ´Ù.
 * <pre>
 *     function fncOnKeyPress() {
 *         ...
 *         if (cfIsEnterKey()) {
 *             ...
 *         }
 *     }
 *     ...
 *     &lt;input type="text" onkeypress="fncOnKeyPress()"&gt;
 * </pre>
 * @return : enter key ¿©ºÎ
 * @author : ÀÓÀçÇö
 */
function cfIsEnterKey() {
	if (event.keyCode == 13) {
		return true;
	}

	return false;
}

/**
 * @type   : function
 * @access : public
 * @desc   : °ªÀÌ null ÀÌ°Å³ª white space ¹®ÀÚ·Î¸¸ ÀÌ·ç¾îÁø °æ¿ì true¸¦ ¸®ÅÏÇÑ´Ù.
 * <pre>
 *     cfIsNull("  ");
 * </pre>
 * À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì true¸¦ ¸®ÅÏÇÑ´Ù.
 * @sig    : value
 * @param  : value required ÀÔ·Â°ª
 * @return : boolean. null(È¤Àº white space) ¿©ºÎ
 * @author : ÀÓÀçÇö
 */
function cfIsNull(value) {
	if (value == null ||
	    (typeof(value) == "string" && value.trim() == "")
	   ) {
		return true;
	}

	return false;
}

/**
 * @type   : function
 * @access : public
 * @desc   : °ªÀÌ ÁöÁ¤µÈ ±×·ì³»¿¡ Á¸ÀçÇÏ´ÂÁö¸¦ ¾Ë·ÁÁØ´Ù.
 * <pre>
 *     cfIsIn(3, [1, 2, 3]);                     // -> true
 *     cfIsIn(3, [4, 5, 6]);                     // -> false
 *     cfIsIn('F', ['A', 'B', 'F']);             // -> true
 *     cfIsIn('F', ['A', 'B', 'C']);             // -> false
 *     cfIsIn("lim", ["lim", "kim", "park"]);    // -> true
 *     cfIsIn("lim", ["lee", "kim", "park"]);    // -> false
 * </pre>
 * @sig    : value, valueArray
 * @param  : value      required ºñ±³ÇÏ°í ½ÍÀº °ª
 * @param  : valueArray required ºñ±³ÇÏ°í ½ÍÀº °ª¿¡ ´ëÇÑ ºñ±³ ´ë»óÀÌ µÇ´Â °ªµéÀÇ ÁýÇÕ. array Å¸ÀÔÀÌ¸ç array
 *           ³»ÀÇ °¢ elementÀÇ µ¥ÀÌÅÍ Å¸ÀÔÀº value ÆÄ¶ó¹ÌÅÍÀÇ Å¸ÀÔ°ú ÀÏÄ¡ÇØ¾ß ÇÑ´Ù.
 * @return : boolean. °ªÀÌ ÁöÁ¤µÈ ±×·ì³»¿¡ Á¸ÀçÇÏ´ÂÁö ¿©ºÎ.
 * @author : ÀÓÀçÇö
 */
function cfIsIn(value, valueArray) {
	for (var i = 0; i < valueArray.length; i++) {
		if (value == valueArray[i]) {
			return true;
		}
	}

	return false;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÆäÀÌÁö°¡ ´Ù¸¥ ÆäÀÌÁö·ÎºÎÅÍ ·ÎµåµÈ ÆäÀÌÁöÀÎÁö ¿©ºÎ¸¦ ¾Ë·ÁÁØ´Ù.
 * @sig    : pageId
 * @param  : pageId required ÇöÀç ÆäÀÌÁö id
 * @author : ÀÓÀçÇö
 */
function cfIsNaviPage(pageId) {
	if (GLB_FRAME_MAIN_NAVI.receivePageId != null && GLB_FRAME_MAIN_NAVI.receivePageId == pageId) {
		return true;
	}

	return false;
}



/**
 * @type   : function
 * @access : public
 * @desc   : ¹èÄ¡ÀÛ¾÷ÀÌ ½ÃÀÛµÊÀ» ¾Ë·ÁÁÖ´Â ¼­ºêÃ¢À» ¶ç¿ì°í, ¹èÄ¡ÀÛ¾÷À» ½ÇÁ¦·Î ½ÇÇàÇÒ ÆäÀÌÁö¸¦ ½ÇÇà½ÃÅ²´Ù. ÀÌ ¶§, ¹èÄ¡ÀÛ¾÷À» ½ÇÁ¦·Î ½ÇÇàÇÒ
 *           ÆäÀÌÁö´Â °¡½ÃÈ­¸é ¿µ¿ª ¹Û¿¡ ¶ç¿öÁö°í ¶ÇÇÑ ÆäÀÌÁö·Î ³Ñ°ÜÁÙ µ¥ÀÌÅÍ°¡ ÀÖÀ¸¸é ÆÄ¶ó¹ÌÅÍ·Î ³Ñ°ÜÁÖµÇ, µ¥ÀÌÅÍ°¡ ¿©·¯°³ÀÌ¸é
 *            ÇÏ³ªÀÇ object·Î ¸¸µé¾î¼­ ³Ñ°ÜÁÖ¸é µÈ´Ù.
 * <pre>
 *     ¿¹)
 *         var paramObj = new Object();
 *         paramObj.a = param1;
 *         paramObj.b = param2;
 *         cfNotifyBatchJobStart(url, paramObj);
 * </pre>
 * @sig    : url, paramObj
 * @param  : url required ¹èÄ¡ÀÛ¾÷À» ½ÇÁ¦·Î ½ÇÇàÇÒ ÆäÀÌÁöÀÇ url
 * @param  : paramObj ¹èÄ¡ÀÛ¾÷À» ½ÇÁ¦·Î ½ÇÇàÇÒ ÆäÀÌÁö¿¡ Àü´ÞÇÒ ¿ÀºêÁ§Æ®
 * @author : ÀÓÀçÇö
 */
function cfNotifyBatchJobStart(url, paramObj) {
	window.open("/common/notify_batchjob_start.html", "notifyBatchWindow", "left=0,top=0,height=100,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
	window.showModelessDialog(url, paramObj, "dialogLeft:3000; dialogHeight:0; dialogWidth:0px; dialogHeight:0px; help:no; status:no; scroll:no")
}

/**
 * @type   : function
 * @access : public
 * @desc   : ¹èÄ¡ÀÛ¾÷À» ½ÇÁ¦·Î ½ÇÇàÇÑ ÆäÀÌÁö¸¦ ´Ý°í ¹èÄ¡ÀÛ¾÷ÀÌ ½ÃÀÛµÊÀ» ¾Ë·ÁÁÖ¾ú´ø ¼­ºêÃ¢¿¡ ¹èÄ¡ÀÛ¾÷ÀÌ ³¡³µ´Ù´Â ¸Þ½ÃÁö¸¦ ¶ç¿î´Ù.
 * @author : ÀÓÀçÇö
 */
function cfNotifyBatchJobEnd() {
	window.close();
	window.open("/common/notify_batchjob_end.html", "notifyBatchWindow", "left=0,top=0,height=100,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
}

/**
 * @type   : function
 * @access : public
 * @desc   : window.openÀ¸·Î ¼­ºêÃ¢À» ¶ç¿ï ¶§ ¼­ºêÃ¢ÀÇ À§Ä¡¸¦ °£´ÜÇÏ°Ô ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
 * @sig    : width, height, position, [sURL] [, sName] [, sFeatures] [, bReplace]
 * @param  : width - ¼­ºêÃ¢ÀÇ ³ÐÀÌ
 * @param  : height - ¼­ºêÃ¢ÀÇ ³ôÀÌ
 * @param  : position  - ¼­ºêÃ¢ÀÇ À§Ä¡ (default : 5) <br><br>
 * <table border='1'>
 *     <tr>
 *         <td>1</td>
 *         <td>2</td>
 *         <td>3</td>
 *     </tr>
 *     <tr>
 *         <td>4</td>
 *         <td>5</td>
 *         <td>6</td>
 *     </tr>
 *     <tr>
 *         <td>7</td>
 *         <td>8</td>
 *         <td>9</td>
 *     </tr>
 * </table>
 * @param  : sURL      required window.openÀÇ sURL ÆÄ¶ó¹ÌÅÍ¿Í µ¿ÀÏ
 * @param  : sName     required window.openÀÇ sName ÆÄ¶ó¹ÌÅÍ¿Í µ¿ÀÏ
 * @param  : sFeatures required window.openÀÇ sFeatures ÆÄ¶ó¹ÌÅÍ¿Í µ¿ÀÏ
 * @param  : bReplace  required window.openÀÇ bReplace ÆÄ¶ó¹ÌÅÍ¿Í µ¿ÀÏ
 * @author : ÀÓÀçÇö
 */
function cfOpen(width, height, position, sURL, sName, sFeatures, bReplace) {
	var left = 0;
	var top = 0;

/*
	var featureNames  = ["status", "menubar", "toolbar"];
	var featureValues = ["no", "no", "no"];
	var featureTypes  = ["boolean", "boolean", "boolean"];

	if (sFeatures != null) {
		cfParseFeature(sFeatures, featureNames, featureValues, featureTypes);
	}

	var status = featureValues[0];
	var menubar = featureValues[1];
	var toolbar = featureValues[2];
*/
	if (width != null && height != null) {
		width = width + 10; // windowÀÇ ÁÂ¿ì border 5px¾¿ °¨¾È.
		height = height + 29; // titlebar´Â ±âº»À¸·Î °¨¾È.

/*
		if (status) {
			height = height + 20;
		}

		if (menubar) {
			height = height + 48;
		}

		if (toolbar) {
			height = height + 27;
		}
*/
		switch (position) {
			case 1 :
				left = 0;
				top = 0;
				break;

			case 2 :
				left = (screen.availWidth - width) / 2;
				top = 0;
				break;

			case 3 :
				left = screen.availWidth - width;
				top = 0;
				break;

			case 4 :
				left = 0;
				top = (screen.availHeight - height) / 2;
				break;

			case 5 :
				left = (screen.availWidth - width) / 2;
				top = (screen.availHeight - height) / 2;
				break;

			case 6 :
				left = screen.availWidth - width;
				top = (screen.availHeight - height) / 2;
				break;

			case 7 :
				left = 0;
				top = screen.availHeight - height;
				break;

			case 8 :
				left = (screen.availWidth - width) / 2;
				top = screen.availHeight - height;
				break;

			case 9 :
				left = screen.availWidth - width;
				top = screen.availHeight - height;
				break;

			default :
				left = (screen.availWidth - width) / 2;
				top = (screen.availHeight - height) / 2;
				break;
		}

		if (cfIsNull(sFeatures)) {

			sFeatures = "width=" +width+ ",height=" +height + ",left=" + left + ",top=" + top;
		} else {
			sFeatures = sFeatures +",width=" +width+ ",height=" +height + ",left=" + left + ",top=" + top;
		}
	}

	window.open(sURL, sName, sFeatures, bReplace);
}

/**
 * @type   : function
 * @access : private
 * @desc   : features ½ºÆ®¸µÀ» ÆÄ½ÌÇÏ¿© array¿¡ ¼ÂÆÃÇÏ´Â ³»ºÎ ÇÔ¼ö
 * @sig    : features, fNameArray, fValueArray, fTypeArray
 * @param  : features    required features¸¦ Ç¥ÇöÇÑ ½ºÆ®¸µ
 * @param  : fNameArray  required ÃßÃâÇØ¾ß ÇÒ featureÀÇ ÀÌ¸§¿¡ ´ëÇÑ array
 * @param  : fValueArray required ÃßÃâÇØ¾ß ÇÒ featureÀÇ ±âº»°ª¿¡ ´ëÇÑ array
 * @param  : fTypeArray  required ÃßÃâÇØ¾ß ÇÒ featureÀÇ µ¥ÀÌÅÍÅ¸ÀÔ¿¡ ´ëÇÑ array
 * @author : ÀÓÀçÇö
 */
function cfParseFeature(features, fNameArray, fValueArray, fTypeArray) {
	if (features == null) {
		return;
	}

	var featureArray = features.split(",");
	var featurePair;

	for (var i = 0; i < featureArray.length; i++) {
		featurePair = featureArray[i].trim().split("=");

		for (var j = 0; j < fNameArray.length; j++) {
			if (featurePair[0] == fNameArray[j]) {
				switch (fTypeArray[j]) {
					case "string" :
						fValueArray[j] = featurePair[1];
						break;
					case "number" :
						fValueArray[j] = Number(featurePair[1]);
						break;
					case "boolean" :
						if (featurePair[1].toUpperCase() == "YES" || featurePair[1].toUpperCase() == "TRUE" || featurePair[1] == "1") {
							fValueArray[j] = true;
						} else {
							fValueArray[j] = false;
						}
						break;
				}
			}
		}
	}
}

/**
 * @type   : function
 * @access : private
 * @desc   : html»ó¿¡¼­ parent element¿¡ ´ëÇÑ child element µé¿¡ ´ëÇØ ÀÏ°ýÀûÀ¸·Î µ¿ÀÏÇÑ ÇÔ¼ö¸¦ ¼öÇà½ÃÅ²´Ù.
 * @sig    : parentObj, fnc[, argArr]
 * @param  : parentObj required parent object
 * @param  : fnc required °¢ input element ¸¶´Ù ¼öÇà½ÃÅ³ ÇÔ¼ö Æ÷ÀÎÅÍ
 * @param  : argArr optional ÇÔ¼ö¿¡ Àü´ÞÇÒ ÆÄ¶ó¹ÌÅÍ. ÀÌ ¸Þ¼Òµå¸¦ ÅëÇØ È£ÃâµÇ´Â ÇÔ¼ö´Â ¹«Á¶°Ç µÎ °³ÀÇ ÆÄ¶ó¹ÌÅÍ·Î¸¸
 *           ±¸¼ºµÇ¾î¾ß ÇÑ´Ù. ÇÏ³ª´Â Ã³¸®ÇÏ·Á´Â element, ³ª¸ÓÁö ÇÏ³ª´Â Ã³¸®½Ã ÇÊ¿äÇÑ ÆÄ¶ó¹ÌÅÍµéÀÇ array °´Ã¼ÀÌ´Ù.
 * @author : ÀÓÀçÇö
 */
function cfProcessChildElement(parentObj, fnc, argArr) {
	fnc(parentObj, argArr);

	if (parentObj.all == null) {
		return;
	}

	for (var i = 0; i < parentObj.all.length; i++) {
		fnc(parentObj.all[i], argArr);
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ prompt box ·Î º¸¿©ÁØ´Ù. ¸¸¾à ÆÐ½º¿öµå¸¦ ÀÔ·Â¹Þ´Â prompt box¸¦
 *           ¶ç¿ì¸é¼­ °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ º¸¿©ÁÖ°í ½Í´Ù¸é ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µÈ´Ù.
 * <pre>
 *     // °øÅë¸Þ¼¼Áö ¿µ¿ª
 *     var MSG_INPUT_PASSWORD = "@´Ô, ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.";
 *     ...
 *     cfPromptMsg(MSG_INPUT_PASSWORD, ["È«±æµ¿"], "ÀÔ·ÂÇÏ¼¼¿ä.");
 * </pre>
 * @sig    : msgId[, paramArray[, defaultVal]]
 * @param  : msgId      required common.jsÀÇ °øÅë ¸Þ¼¼Áö ¿µ¿ª¿¡ ¼±¾ðµÈ ¸Þ¼¼Áö ID
 * @param  : paramArray optional ¸Þ¼¼Áö¿¡¼­ '@' ¹®ÀÚ¿Í Ä¡È¯µÉ ½ºÆ®¸µ Array. (ArrayÀÇ index¿Í
 *           ¸Þ¼¼Áö ³»ÀÇ '@' ¹®ÀÚÀÇ ¼ø¼­°¡ ÀÏÄ¡ÇÑ´Ù.)
 * @param  : defaultVal optional prompt box ÀÇ ÀÔ·ÂÇÊµå¿¡ º¸¿©ÁÙ ±âº»°ª.
 * @return : ÀÔ·Â¹ÞÀº String È¤Àº Integer Å¸ÀÔÀÇ ÆÐ½º¿öµå µ¥ÀÌÅÍ
 * @author : ÀÓÀçÇö
 */
function cfPromptMsg(msgId, paramArray, defaultVal) {
	if (cfIsNull(msgId)) {
		alert("Á¸ÀçÇÏÁö ¾Ê´Â ¸Þ½ÃÁöÀÔ´Ï´Ù.");
		return null;
	}

	return prompt(new coMessage().getMsg(msgId, paramArray), defaultVal);
}

/**
 * @type   : function
 * @access : public
 * @desc   : parent object (Div, Table, FieldSet ÅÂ±×)¿¡ ¼ÓÇÑ ¸ðµç child objectÀÇ °ªÀ» ÃÊ±âÈ­ÇÑ´Ù.
 * @sig    : parentObj[, iniVal]
 * @param  : parentObj required ÃÊ±âÈ­ÇÒ ºÎ¸ð ¿ÀºêÁ§Æ®
 * @param  : iniVal    optional ÃÊ±â°ª
 * @author : ±è¼öÈ£
 */
function cfReset(parentObj, iniVal) {
	cfProcessChildElement(parentObj, cfIniObject);
}




/**
 * @type   : function
 * @access : public
 * @desc   : °øÅëÀ¸·Î »ç¿ëÇÏ´Â ¿¡·¯¸Þ¼¼Áö Ã¢À» ¶ç¿î´Ù.
 * @sig    : obj
 * @param  : obj required ¿¡·¯°¡ ³­ °¡¿ì½º ¿ÀºêÁ§Æ®(DataSet or Transaction ¿ÀºêÁ§Æ®Áß ÇÏ³ª)
 * @author : ÀÓÀçÇö
 */
function cfShowError(obj) {
	var errObj = new Object();
	errObj.errCd = obj.ErrorCode;
	errObj.errMsg = obj.ErrorMsg;

  var realErrorMsg = errObj.errMsg.substring(errObj.errMsg.indexOf('[ERROR'));
  var real2Msg = realErrorMsg.substring(realErrorMsg.indexOf(']')+1);
  alert(real2Msg);



/*


	if (obj.ErrorMsg.indexOf("[BizException]") != -1) {
	   alert(obj.ErrorMsg.substr(obj.ErrorMsg.indexOf("[BizException]") + 14));
	} else if ( (obj.ErrorMsg.indexOf("[Exception]") != -1) ||
	            (obj.ErrorMsg.indexOf("[FException]") != -1) ||
	            (obj.ErrorMsg.indexOf("[SysException]") != -1)
	          ) {
		window.showModalDialog(GLB_URL_COMMON_PAGE + "error.html", errObj, "dialogWidth:790px; dialogHeight:590px; help:no; status:no; scroll:no")
	} else if (obj.ErrorMsg.indexOf("[AuthenticationFailed]") != -1) {
		location.href = "/login_sso.jsp?TARGET=$SM$" + location.href;
	} else {
		window.showModalDialog(GLB_URL_COMMON_PAGE + "error.html", errObj, "dialogWidth:790px; dialogHeight:590px; help:no; status:no; scroll:no")
	}
*/
}



/**
 * @type   : function
 * @access : public
 * @desc   : È­¸é»óÀÇ ÀÔ·Â°ú °ü·ÃµÈ ¿ÀºêÁ§Æ®¿¡ ´ëÇÑ À¯È¿¼º °Ë»ç¸¦ ½Ç½ÃÇÑ´Ù. À¯È¿¼º °Ë»ç¸¦ ¹Þ´Â ¿ÀºêÁ§Æ®µéÀº "validExp" ¶ó´Â
 *           ¼Ó¼º°ªÀ» ¼³Á¤ÇØ¾ß ÇÑ´Ù. "validExp" ¶ó´Â ¼Ó¼ºÀº ¿ø·¡ html °´Ã¼¿¡´Â Á¤ÀÇµÇ¾î ÀÖÁö ¾ÊÀº ¼Ó¼ºÀÌÁö¸¸ ´Ù¸¥ ¼Ó¼ºµéÀ»
 *           ¼³Á¤ÇÏ´Â °Í°ú °°Àº ¹æ¹ýÀ¸·Î ¼³Á¤ÇÏ¸é ÀÚµ¿À¸·Î ÇØ´ç ¿ÀºêÁ§Æ®ÀÇ ¼Ó¼ºÀ¸·Î ÀÎ½ÄµÈ´Ù.<br><br>
 *           - ÇØ´ç ¿ÀºêÁ§Æ®¿¡ ´ëÇÑ child ¿ÀºêÁ§Æ®µé±îÁöµµ °Ë»çÇÑ´Ù. ¿¹¸¦µé¾î, °Ë»ç¹ÞÀ» ¿ÀºêÁ§Æ®µéÀ» &lt;div&gt; ÅÂ±×·Î °¨½Î°í
 *             &lt;div&gt; ÅÂ±×ÀÇ id¸¦ ÆÄ¶ó¹ÌÅÍ·Î ÁØ´Ù¸é &lt;div&gt; ÅÂ±×³»ÀÇ ¸ðµç ¿ÀºêÁ§Æ®µéÀÌ ÀÚµ¿À¸·Î °Ë»ç¹Þ°Ô µÈ´Ù. ¶Ç,
 *             &lt;table&gt;¾È¿¡ ÀÔ·ÂÇÊµåµéÀº &lt;table&gt;ÀÇ id¸¦ ÆÄ¶ó¹ÌÅÍ·Î ÁÖ¸é µÈ´Ù.<br><br>
 *           - ÀÔ·Â°ªÀÇ ¾Õ°ú µÚÀÇ °ø¹éÀº À¯È¿¼º °Ë»ç¸¦ ÇÏ¸é¼­ ÀÚµ¿À¸·Î trimµÈ´Ù.
 * <pre>
 *    ¿¹1)
 *    ...
 *    function fncSave() {
 *        if (<b>cfValidate([oRecevInfo])</b>) {
 *            oDomRegiRecevGTR.post();
 *        }
 *    }
 *    ...
 *
 *    &lt;table <b>id="oRecevInfo"</b> ....&gt;
 *        ...
 *        &lt;object id="oRecevNo" classid="CLSID:E6876E99-7C28-43AD-9088-315DC302C05F" width="50" <b>validExp="Á¢¼ö¹øÈ£:yes:length=6"</b>&gt;
 *            &lt;param name="Format"    value="000000"&gt;
 *        &lt;/object&gt;
 *        ...
 *    &lt;/table&gt;
 *    ...
 * </pre>
 * validExp ¼Ó¼º°ªÀº Á¤ÇØÁø Çü½Ä¿¡ ¸Â°Ô ÀÛ¼ºµÇ¾î¾ß ÇÏ´Âµ¥ Çü½ÄÀº ¿ÀºêÁ§Æ®ÀÇ Á¾·ù¿¡ µû¶ó µÎ °¡Áö·Î ³ª´¶´Ù.<br>
 * <pre>
 *    1. ÀÏ¹Ý ¿ÀºêÁ§Æ®ÀÇ °æ¿ì (¿¹1 ÂüÁ¶)
 *        "item_name:ÇÊ¼ö¿©ºÎ:valid_expression"
 *
 *        - "item_name"¿¡´Â ÇØ´ç Ç×¸ñ¿¡ ´ëÇÑ ÀÌ¸§À» ±â¼úÇÑ´Ù.
 *        - "ÇÊ¼ö¿©ºÎ"¿¡´Â ÇØ´ç ¿ÀºêÁ§Æ®°¡ ÇÊ¼ö Ç×¸ñÀÎÁö ¿©ºÎ¸¦ yes|true|1 È¤Àº no|false|0 Å¸ÀÔÀ¸·Î ±â¼úÇÑ´Ù.
 *        - "valid_expression" Àº  cfValidateValue ÇÔ¼öÀÇ ¼³¸íÀ» ÂüÁ¶ÇÏ±â ¹Ù¶õ´Ù.
 *        - ÇÊ¼öÇ×¸ñÀÎÁö¸¸ Ã¼Å©ÇÏ·Á¸é "valid_expression" À» Ç¥±âÇÏÁö ¾ÊÀ¸¸é µÈ´Ù.
 *          ¿¹)
 *          &lt;object id="oDelivYmd" classid="CLSID:E6876E99-7C28-43AD-9088-315DC302C05F" width="80" <b>validExp="¹è´ÞÀÏÀÚ:yes"</b>&gt;
 *              ...
 *			&lt;/object&gt;
 *        - validExp ³»¿¡ ÀÓÀÇ·Î ",", ":", "=", "&", ¹®ÀÚ¸¦ »ç¿ëÇÏ°íÀÚ ÇÑ´Ù¸é "\\,", "\\:", "\\=", "\\&" ¶ó°í Ç¥±âÇØ¾ß ÇÑ´Ù.<br>
 *
 *
 *    2. °¡¿ì½º Grid ¿ÀºêÁ§Æ®ÀÇ °æ¿ì
 *        "column_id:item_name:ÇÊ¼ö¿©ºÎ[:valid_expression[:key]][,column_name:item_name:ÇÊ¼ö¿©ºÎ[:valid_expression[:key]]]..."
 *
 *        - column_id ¿¡´Â  Grid¿Í ¿¬°áµÈ DataSetÀÇ ½ÇÁ¦ ÄÃ·³ id ¸¦ Àû¾îÁØ´Ù.
 *
 *        - <font color=blue><b>dataName</b></font> ÀÌ¶ó´Â ¼Ó¼ºµµ ±â¼úÇØ ÁÖ¾î¾ß ÇÑ´Ù. dataNameÀº ÇØ´ç DataSet
 *          À» Ç¥ÇöÇÏ´Â ÀÌ¸§À» ±â¼úÇØ ÁÖ¸é µÈ´Ù.
 *
 *        - <font color=blue><b>validFeatures</b></font> ¶ó´Â ¼Ó¼ºÀº ÇÊ¿ä¿¡ µû¶ó ±â¼úÇØ ÁÖ¾î¾ß ÇÑ´Ù. validFeaturesÀº Grid Validation
 *          ¼öÇà½Ã¿¡ ÇÊ¿äÇÑ ¼öÇàÁ¶°ÇÀ» ±â¼úÇØ ÁÖ´Â ¼Ó¼ºÀ¸·Î½á ±â¼úÇØ ÁÖÁö ¾ÊÀ¸¸é ±âº» ¼öÇàÁ¶°ÇÀÌ ÀÚµ¿À¸·Î Àû¿ëµÈ´Ù.
 *          Ç¥ÇöÇÏ´Â Çü½ÄÀº <b>validFeatures="¼öÇàÁ¶°Ç¸í1=¼öÇàÁ¶°Ç°ª1,¼öÇàÁ¶°Ç¸í2=¼öÇàÁ¶°Ç°ª2, ... ¼öÇàÁ¶°Ç¸ín=¼öÇàÁ¶°Ç°ªn"</b> ÀÌ´Ù.
 *          ÇöÀç »ç¿ë°¡´ÉÇÑ ¼öÇàÁ¶°ÇÀº ´ÙÀ½°ú °°´Ù.
 *
 *          ignoreStatus : º¯°æ»çÇ×ÀÌ ¾ø´Â Row ¿¡ ´ëÇØ¼­µµ validationÀ» ¼öÇàÇÒÁö ¿©ºÎ. (yes|true|1 or no|false|0)
 *
 *        ¿¹)
 *
 *        cfValidate([oDomRegiRecevGG]);
 *        ...
 *        &ltobject id="oDomRegiRecevGG" classid="CLSID:1F57AEAD-DB12-11D2-A4F9-00608CEBEE49"
 *           width="174" height="233" style="position:absolute; left:10; top:73;" <b>dataName="¹è´Þ°á°ú¸®½ºÆ®"</b> <b>validFeatures="ignoreStatus=yes"</b>
 *         <b>validExp="regiNo:µî±â¹øÈ£:yes:length=13:key,
 *                  sendPrsnZipNo:¹ß¼ÛÀÎ¿ìÆí¹øÈ£:yes:length=6,
 *                  recPrsnZipNo:¼öÃëÀÎ¿ìÆí¹øÈ£:yes:length=6
 *                 "</b>
 *        &gt;
 *
 *        - ¸¸¾à item_nameÀ» ±â¼úÇÏÁö ¾Ê¾ÒÀ» °æ¿ì¿¡´Â GridÀÇ column_id¿¡ ÇØ´çÇÏ´Â ÄÃ·³ÀÇ ÄÃ·³¸íÀ¸·Î ÀÚµ¿À¸·Î ´ëÃ¼µÈ´Ù.
 *          ¿¹) validExp="regiNo::yes:length=13, ..."
 *
 *        - ¸¸¾à ÄÃ·³ÀÌ keyÄÃ·³ÀÏ °æ¿ì¿¡´Â ³¡¿¡ "key" ¶ó°í ¸í½ÃÇØ ÁØ´Ù. "key" ¶ó°í ¸í½ÃÇØ ÁÖ¸é ´Ù¸¥ Row¿Í µ¥ÀÌÅÍ°¡ Áßº¹µÇ¾úÀ» ¶§
 *          ¿¡·¯¸¦ ¹ß»ý½ÃÅ²´Ù. keyÄÃ·³ÀÌ ¿©·µÀÏ °æ¿ì¿¡´Â keyÄÃ·³µéÀ» ¹­¾î¼­ ÇÏ³ªÀÇ key·Î ÀÎ½ÄÇÏ±â ¶§¹®¿¡ keyÄÃ·³Áß¿¡ ÇÏ³ª¸¸
 *          Áßº¹ÀÌ µÇÁö ¾Ê¾Æµµ ÀüÃ¼°¡ Áßº¹µÇÁö ¾ÊÀº °ÍÀ¸·Î Ã³¸®µÈ´Ù. keyÄÃ·³µéÀ» ?È¾î¼? Ã³¸®ÇÏÁö ¾Ê°í keyÄÃ·³º°·Î °³º°ÀûÀÎ
 *          Áßº¹Ã¼Å©¸¦ ¿øÇÒ °æ¿ì¿¡´Â "singleKey" ¶ó°í ¸í½ÃÇÏ¸é µÈ´Ù.
 *          ´Ü, key¸¦ ¸í½ÃÇØ ÁÙ °æ¿ì¿¡´Â valid_expression À» ¹Ýµå½Ã ±âÀÔÇØ ÁÖ°í ±âÀÔÇØ ÁÙ ³»¿ëÀÌ ¾ø´õ¶óµµ
 *          ':' À» »ðÀÔÇØ¾ß ÇÑ´Ù.
 *          ¿¹) validExp="regiNo:µî±â¹øÈ£:yes::key, ...
 *
 *        - ³ª¸ÓÁö´Â 1ÀÇ °æ¿ì¿Í °°´Ù.
 * </pre>
 * @sig    : objArr
 * @param  : objectArr required À¯È¿¼º°Ë»ç¸¦ ÇÏ°íÀÚ ÇÏ´Â ¿ÀºêÁ§Æ®µéÀÇ Array.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 * @author : ÀÓÀçÇö
 */
function cfValidate(obj) {
	if (cfIsNull(obj)) {
		return;
	}

	var objArr;
	var oElement;
	var validYN = false;

	if (obj.length == null) {
		objArr = new Array(1);
		objArr[0] = obj;
	} else {
		objArr = obj;
	}

	for (var objArrIdx = 0; objArrIdx < objArr.length; objArrIdx++) {
		oElement = objArr[objArrIdx];

		switch (oElement.tagName) {
			case "TABLE":
			case "DIV":
			case "FIELDSET":
				for (var i = 0; i < oElement.all.length; i++) {
					if (!cfValidateElement(oElement.all[i])) {
						return false;
					}
				}

				break;

			default:
				if (!cfValidateElement(oElement)) {
					return false;
				}
		}
	}

	return true;
}

/**
 * @type   : function
 * @access : private
 * @desc   : °¡¿ì½º¿Í html ÀÇ ¸ðµç ¿ÀºêÁ§Æ®¿¡ ´ëÇØ À¯È¿¼º °Ë»ç¸¦ ÇÑ´Ù.
 * @sig    : oElement
 * @param  : oElement required °Ë»ç ´ë»ó Element.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 * @author : ÀÓÀçÇö
 */
function cfValidateElement(oElement) {
	if (oElement.tagName == "OBJECT" &&
	    oElement.attributes.classid.nodeValue.toUpperCase() == "CLSID:1F57AEAD-DB12-11D2-A4F9-00608CEBEE49"
	   ) {
		return cfValidateGrid(oElement);
	} else {
		return cfValidateItem(oElement);
	}
}


/**
 * @type   : function
 * @access : private
 * @desc   : °¡¿ì½º ÄÄÆ÷³ÍÆ® Áß¿¡¼­ DataSetÀ» Á¦¿ÜÇÑ ¸ðµç ¿ÀºêÁ§Æ®¿Í htmlÀÇ ¸ðµç ¿ÀºêÁ§Æ®¿¡ ´ëÇØ À¯È¿¼º °Ë»ç¸¦ ÇÑ´Ù.
 * @sig    : oElement
 * @param  : oElement required °Ë»ç ´ë»ó Element.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 * @author : ÀÓÀçÇö
 */
function cfValidateItem(oElement) {
	if (cfIsNull(oElement.validExp)) {
		return true;
	}

	var value;
	var itemValidExp = new covItemValidExp(oElement.validExp);

	switch (oElement.tagName) {
		case "INPUT":

		case "SELECT":

		case "TEXTAREA":
			oElement.value = oElement.value.trim();  // elementÀÇ °ªÀ» trim ½ÃÄÑÁØ´Ù.
			value = oElement.value;
			break;

		case "OBJECT":
			switch (oElement.attributes.classid.nodeValue.toUpperCase()) {
				case "CLSID:FD4C6571-DD20-11D2-973D-00104B15E56F": // CodeCombo Component
				case "CLSID:754F3DC4-0C79-4C92-AD64-A806D8FF2AB0": // Radio Component
					oElement.CodeValue = (oElement.CodeValue == null) ? null : oElement.CodeValue.trim();  // elementÀÇ °ªÀ» trim ½ÃÄÑÁØ´Ù.
					value = oElement.CodeValue;
                    break;
				case "CLSID:60109D65-70C0-425C-B3A4-4CB001513C69": // Lux Component 2004/10/14 Á¤ÈÆ±Ô Ãß°¡-ÀÓ½Ã validation
					var tmp = (oElement.ListExprFormat).split("^");
					value = oElement.ValueOfIndex(tmp[0], oElement.Index);
					break;
                case "CLSID:91B0A4F0-3206-4564-9BB4-AF9055DEF8A1": // TextArea Component
				case "CLSID:69F1348F-3EBE-11D3-973D-0060979E2A03": // InputFile Component
				case "CLSID:E6876E99-7C28-43AD-9088-315DC302C05F": // EMedit Component
					oElement.Text = (oElement.Text == null) ? null : oElement.Text.trim();  // elementÀÇ °ªÀ» trim ½ÃÄÑÁØ´Ù.
					value = oElement.Text;
                    break;

                default:
                	break;
			}

			break;

		default:
			return true;
	}

	if (!itemValidExp.validate(value)) {
		alert(new coMessage().getMsg(itemValidExp.errMsg, [itemValidExp.itemName]));

		if(oElement.enable != false && oElement.disabled!=true) {
			oElement.focus();
		}

		return false;
	}

	return true;
}



/**
 * @type   : function
 * @access : public
 * @desc   : »ç¿ëÀÚÀÇ ÀÔ·Â°ªÀÌ Byte·Î È¯»êµÈ ÃÖ´ë±æÀÌ¸¦ ³ÑÀ» °æ¿ì ÀÔ·ÂÀÌ ¾ÈµÇµµ·Ï ÇÏ´Â ÇÔ¼ö. <br>
 *           ¾ÈÅ¸±õ°Ôµµ Windows XP È¯°æ¿¡¼­´Â ÇÑ±Û¿¡ ´ëÇÑ Å°ÀÌº¥Æ®°¡ ¹ß»ýÇÏÁö ¾Ê¾Æ¼­ µ¿ÀÛÇÏÁö ¾Ê´Â´Ù.<br>
 *           ¿ÀºêÁ§Æ® ¼±¾ð½Ã onkeydown ÀÌº¥Æ®¿¡ ´ÙÀ½°ú °°ÀÌ ±â¼úÇØ ÁÖ¾î¾ß¸¸ ÇÑ´Ù.
 * <pre>
 *     Onkeydown="cfValidateMaxByteLength(this, max_byte_length)"
 *     (¿©±â¼­ max_byte_length ÀÚ¸®¿¡´Â Byte·Î È¯»ê½Ã ÃÖ´ë±æÀÌ¸¦ ¼ýÀÚ·Î Àû¾îÁØ´Ù.)
 *
 *     ¿¹)
 *     &lt;input type="text" size="10" onkeydown="cfValidateMaxByteLength(this, 10)"&gt;
 * </pre>
 *           ÇöÀç´Â htmlÀÇ text input, textarea ¿Í °¡¿ì½ºÀÇ EMEdit ¿¡¸¸ Àû¿ëµÈ´Ù.
 * @sig    : oElement, length
 * @param  : oElement required ÀÔ·ÂÇÊµå °´Ã¼
 * @param  : length   required max byte length
 * @author : ÀÓÀçÇö
 */
function cfValidateMaxByteLength(oElement, length) {
	var value = "";

	if (event.keyCode == 8 ||   // backspace
	    event.keyCode == 35 ||  // end key
	    event.keyCode == 36 ||  // home key
	    event.keyCode == 37 ||  // left key
	    event.keyCode == 38 ||  // up key
	    event.keyCode == 39 ||  // right key
	    event.keyCode == 40 ||  // down key
	    event.keyCode == 46     // delete key
	   ) {
	   	return true;
	}

	switch (cfGetElementType(oElement)) {
		case "TEXT" :
		case "TEXTAREA" :
			value = oElement.value;
			break;

		case "GE" :
		case "GTA" :
			value = oElement.Text;
			break;

		default :
			return;
	}

	if (cfGetByteLength(value) > length ) {
  		oElement.blur();
		oElement.focus();
		oElement.value = oElement.value.substr(0, oElement.value.length - 1);
		event.returnValue = false;
		return;
	}

	if (oElement.onkeyup == null) {
		oElement.onkeyup =
			function() {
				if (cfGetByteLength(oElement.value) > length) {
			    	oElement.blur();
			        oElement.focus();
			        oElement.value = oElement.value.substr(0, oElement.value.length - 1);
				}
			}
	}

	if (cfGetByteLength(value) == length ) {
       // ¿Ï¼ºÇÑ±Û : 0xAC00 <= c && c <= 0xD7A3
       // ÀÚÀ½ : 0x3131 <= c
       // ¸ðÀ½ : c <= 0x318E
		var c = value.charCodeAt(value.length - 1);

		if ( (0xAC00 <= c && c <= 0xD7A3) || (0x3131 <= c && c <= 0x318E) ) {
			event.returnValue = true;
    	} else {
			event.returnValue = false;
		}
	} else {
		event.returnValue = true;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : Æ¯Á¤ °ª¿¡ ´ëÇÑ À¯È¿¼º°Ë»ç¸¦ ¼öÇàÇÑ´Ù.
 * <pre>
 *     cfValidateValue(50, "minNumber=100");
 * </pre>
 * À§ÀÇ °æ¿ì 50Àº ÃÖ¼Ò°ª 100À» ³ÑÁö ¾ÊÀ¸¹Ç·Î false°¡ ¸®ÅÏµÈ´Ù.<br>
 * À¯È¿¼º °Ë»ç¸¦ ¼öÇàÇÏ±â À§ÇØ¼­´Â °Ë»çÁ¶°ÇÀ» ¸í½ÃÇØ¾ß ÇÏ´Âµ¥
 * °Ë»çÁ¶°ÇÀº 'valid expression' ÀÌ¶ó°í ºÒ¸®¿ì´Â String °ªÀ¸·Î Ç¥ÇöµÈ´Ù. valid expression¿¡ ´ëÇÑ Ç¥±âÇü½ÄÀº
 * ´ÙÀ½°ú °°´Ù.
 * <pre>
 *  	validator_name=valid_value[&validator_name=valid_value]..
 *
 *  	¿¹) "minNumber=100"
 * </pre>
 * - validator_nameÀº °Ë»çÀ¯ÇüÀ» ÀÇ¹ÌÇÏ¸ç valid_value´Â ±âÁØ °ªÀÌ µÈ´Ù. <br>
 * - °Ë»çÇ×¸ñÀº ÇÏ³ª ÀÌ»óÀÏ ¼ö ÀÖÀ¸¸ç °Ë»çÇ×¸ñ°£¿¡´Â "&" ¹®ÀÚ·Î ±¸ºÐÇÏ¿© ÇÊ¿äÇÑ ¸¸Å­ ³ª¿­ÇÏ¸é µÈ´Ù. <br>
 * - valid_value¿¡ ",", ":", "=", "&", ¹®ÀÚ¸¦ »ç¿ëÇÏ°íÀÚ ÇÑ´Ù¸é "\\,", "\\:", "\\=", "\\&" ¶ó°í Ç¥±âÇØ¾ß ÇÑ´Ù.<br>
 * - À§ÀÇ ¿¹¿¡¼­´Â "minNumber" (ÃÖ¼Ò°ª)¶ó´Â À¯È¿¼º °Ë»çÇ×¸ñÀ» ¸í½ÃÇÏ¿´°í minNumber ¿¡´ëÇÑ ±âÁØ°ªÀ¸·Î "100" ÀÌ ¼³Á¤µÇ¾î ÀÖ´Ù.
 * ¸¸ÀÏ 100º¸´Ù ÀÛÀº °ªÀ» ÀÔ·ÂÇßÀ» ¶§´Â 100 ÀÌ»óÀÇ °ªÀ» ÀÔ·ÂÇÏ¶ó´Â alert box°¡ ¶ß°Ô µÈ´Ù.
 * - validator_nameÀº ¹Ì¸® Á¤ÀÇµÇ¾î ÀÖ´Â °Í¸¸ »ç¿ëÇÒ ¼ö ÀÖ°í °¢ °Ë»çÀ¯Çü¸¶´Ù valid_valueÀÇ ÇüÅÂµµ ´Ù¸£´Ù.(valid_value°¡ ¾ø´Â °Íµµ ÀÖ´Ù.)
 * ÇöÀç Á¤ÀÇµÈ °Ë»çÀ¯ÇüÀº ´ÙÀ½°ú °°´Ù.
 * <br><br>
 * <table border=1 style="border-collapse:collapse; border-width:1pt; border-style:solid; border-color:000000;">
 * 		<tr>
 * 			<td align="center" bgcolor="#CCCCFFF">°Ë»çÀ¯Çü</td>
 * 			<td align="center" bgcolor="#CCCCFFF">±âÁØ°ª ÇüÅÂ</td>
 * 			<td align="center" bgcolor="#CCCCFFF">¼³¸í</td>
 * 			<td align="center" bgcolor="#CCCCFFF">¿¹</td>
 * 		</tr>
 * 		<tr>
 * 			<td>length</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>ÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö°¡ ±âÁØ°ª°ú ÀÏÄ¡ÇÏ´ÂÁö¸¦ °Ë»çÇÑ´Ù. ÀÏ¹ÝÀûÀ¸·Î HTML¿¡¼­´Â ÇÑ±Û, ¿µ¹®, ¼ýÀÚ ¸ðµÎ 1ÀÚ¸®¾¿ ÀÎ½ÄµÈ´Ù.</td>
 * 			<td>length=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>byteLength</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>Byte·Î È¯»êµÈ ÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö¸¦ byte·Î È¯»êÇÏ¿© ÀÚ¸´¼ö°¡ ±âÁØ°ª°ú ÀÏÄ¡ÇÏ´ÂÁö¸¦ °Ë»çÇÑ´Ù.(¼ýÀÚ ¹× ¿µ¹®Àº 1byte, ÇÑ±ÛÀº 2byteÀÌ´Ù.)</td>
 * 			<td>byteLength=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>minLength</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>ÃÖ¼ÒÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö°¡ ±âÁØ°ª ÀÌ»óÀÌ µÇ´ÂÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>minLength=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>minByteLength</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>Byte·Î È¯»êµÈ ÃÖ¼ÒÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö¸¦ byte·Î È¯»êÇÏ¿© ÀÚ¸´¼ö°¡ ±âÁØ°ª ÀÌ»óÀÌ µÇ´ÂÁö¸¦ °Ë»çÇÑ´Ù.(¼ýÀÚ ¹× ¿µ¹®Àº 1byte, ÇÑ±ÛÀº 2byteÀÌ´Ù.)</td>
 * 			<td>minByteLength=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>maxLength</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>ÃÖ´ëÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö°¡ ±âÁØ°ª ÀÌÇÏ°¡ µÇ´ÂÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>maxLength=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>maxByteLength</td>
 * 			<td>0º¸´Ù Å« Á¤¼ö</td>
 * 			<td>Byte·Î È¯»êµÈ ÃÖ´ëÀÚ¸´¼ö °Ë»ç. ÀÔ·Â°ªÀÇ ÀÚ¸´¼ö¸¦ byte·Î È¯»êÇÏ¿© ÀÚ¸´¼ö°¡ ±âÁØ°ª ÀÌÇÏ°¡ µÇ´ÂÁö¸¦ °Ë»çÇÑ´Ù.(¼ýÀÚ ¹× ¿µ¹®Àº 1byte, ÇÑ±ÛÀº 2byteÀÌ´Ù.)</td>
 * 			<td>maxByteLength=6</td>
 * 		</tr>
 * 		<tr>
 * 			<td>number</td>
 * 			<td>None or decimal format string. decimal format string Çü½ÄÀº "(Á¤¼öÀÚ¸´¼ö.¼Ò¼öÀÚ¸´¼ö)" ÀÌ´Ù.</td>
 * 			<td>¼ýÀÚ°Ë»ç. ÀÔ·Â°ªÀÌ ¼ýÀÚÀÎÁö¸¦ °Ë»çÇÑ´Ù. ¸¸ÀÏ ÀÔ·Â°ª¿¡ ´ëÇÑ decimal formatÀ» ÁöÁ¤ÇÏ¿´À» ¶§´Â format¿¡ ¸Â´ÂÁöµµ °Ë»çÇÑ´Ù.</td>
 * 			<td>number, number=(5.2)</td>
 * 		</tr>
 * 		<tr>
 * 			<td>minNumber</td>
 * 			<td>¼ýÀÚ</td>
 * 			<td>ÃÖ¼Ò¼ö °Ë»ç. ÀÔ·Â°ªÀÌ ÃÖ¼ÒÇÑ ±âÁØ°ª ÀÌ»óÀÌ µÇ´ÂÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>minNumber=100</td>
 * 		</tr>
 * 		<tr>
 * 			<td>maxNumber</td>
 * 			<td>¼ýÀÚ</td>
 * 			<td>ÃÖ´ë¼ö °Ë»ç. ÀÔ·Â°ªÀÌ ±âÁØ°ª ÀÌÇÏÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>maxNumber=300</td>
 * 		</tr>
 * 		<tr>
 * 			<td>inNumber</td>
 * 			<td>"¼ýÀÚ~¼ýÀÚ" Çü½ÄÀ¸·Î Ç¥±â.</td>
 * 			<td>¹üÀ§°ª °Ë»ç. ÀÔ·Â°ªÀÌ ±âÁØÀÌ µÇ´Â µÎ ¼ö¿Í °°°Å³ª È¤Àº µÎ ¼ö »çÀÌ¿¡ Á¸ÀçÇÏ´Â °ªÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>inNumber=100~300</td>
 * 		</tr>
 * 		<tr>
 * 			<td>minDate</td>
 * 			<td>YYYYMMDD Çü½ÄÀÇ ³¯Â¥ ½ºÆ®¸µ.</td>
 * 			<td>ÃÖ¼Ò³¯Â¥ °Ë»ç. ÀÔ·ÂµÈ ³¯Â¥°¡ ±âÁØ³¯Â¥ÀÌ°Å³ª ±âÁØ³¯Â¥ ÀÌÈÄÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>minDate=20020305</td>
 * 		</tr>
 * 		<tr>
 * 			<td>maxDate</td>
 * 			<td>YYYYMMDD Çü½ÄÀÇ ³¯Â¥ ½ºÆ®¸µ. ¿¹) maxDate=20020305</td>
 * 			<td>ÃÖ´ë³¯Â¥ °Ë»ç. ÀÔ·ÂµÈ ³¯Â¥°¡ ±âÁØ³¯Â¥ÀÌ°Å³ª ±âÁØ³¯Â¥ ÀÌÀüÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>maxDate=20020305</td>
 * 		</tr>
 * 		<tr>
 * 			<td>format</td>
 * 			<td>format characterµé°ú ´Ù¸¥ ¹®ÀÚµéÀ» Á¶ÇÕÇÑ ½ºÆ®¸µ.<br>
 * 				<table>
 * 					<tr>
 * 						<td><b>format character</b></td>
 * 						<td><b>desc</b></td>
 * 					</tr>
 * 					<tr>
 * 						<td>#</td>
 * 						<td>¹®ÀÚ¿Í ¼ýÀÚ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>h, H</td>
 * 						<td>ÇÑ±Û(H´Â °ø¹éÆ÷ÇÔ)</td>
 * 					</tr>
 * 					<tr>
 * 						<td>A, Z</td>
 * 						<td>¹®ÀÚ(Z´Â °ø¹éÆ÷ÇÔ)</td>
 * 					</tr>
 * 					<tr>
 * 						<td>0, 9</td>
 * 						<td>¼ýÀÚ (9´Â °ø¹éÆ÷ÇÔ)</td>
 * 					</tr>
 * 				</table>
 * 			</td>
 * 			<td>Çü½Ä °Ë»ç. ÀÔ·ÂµÈ °ªÀÌ ÁöÁ¤µÈ Çü½Ä¿¡ ¸Â´ÂÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>format=000-000</td>
 * 		</tr>
 * 		<tr>
 * 			<td>ssn</td>
 * 			<td>ÁÖ¹Îµî·Ï¹øÈ£ 13ÀÚ¸®</td>
 * 			<td>ÁÖ¹Îµî·Ï¹øÈ£ °Ë»ç. ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ À¯È¿ÇÑÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>ssn</td>
 * 		</tr>
 * 		<tr>
 * 			<td>csn</td>
 * 			<td>»ç¾÷ÀÚµî·Ï¹øÈ£ 10ÀÚ¸®</td>
 * 			<td>»ç¾÷ÀÚµî·Ï¹øÈ£ °Ë»ç. ÀÔ·ÂÇÑ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ À¯È¿ÇÑÁö¸¦ °Ë»çÇÑ´Ù.
 *              (¿¹, 2019009930)
 *          </td>
 * 			<td>csn</td>
 * 		</tr>
 * 		<tr>
 * 			<td>filterIn</td>
 * 			<td>ÇÊÅÍ¸µÇÏ¿© ¾ò°íÀÚ ÇÏ´Â ½ºÆ®¸µÀ» ";"¹®ÀÚ¸¦ ±¸ºÐÀÚ·Î »ç¿ëÇÏ¿© ³ª¿­ÇÑ´Ù.(´Ü ";" ¹®ÀÚ¸¦ ÇÊÅÍ¸µÇÏ°í ½ÍÀ» ¶© "\;"¶ó°í Ç¥±âÇÑ´Ù.
 *          </td>
 * 			<td>ÀÔ·Â°ª¿¡ ÁöÁ¤µÈ ¹®ÀÚ³ª ½ºÆ®¸µ ÀÌ¿Ü¿¡ ´Ù¸¥ °ªÀÌ ÀÖ´ÂÁö¸¦ °Ë»çÇÑ´Ù. ÇÏ³ªµµ ¾ø´Ù¸é À¯È¿ÇÏ´Ù.</td>
 * 			<td>filter=%;<;ÀÓÀçÇö;\\;;haha<br>(ÀÔ·Â°ª ³»¿¡ "%","<","ÀÓÀçÇö",";","haha" Áß¿¡ ÇÏ³ª¶óµµ ÀÖ´ÂÁö °Ë»çÇÑ´Ù.)
 *          </td>
 * 		</tr>
 * 		<tr>
 * 			<td>filterOut</td>
 * 			<td>ÇÊÅÍ¸µÇÏ¿© °É·¯³»°í ½ÍÀº ½ºÆ®¸µÀ» ";"¹®ÀÚ¸¦ ±¸ºÐÀÚ·Î »ç¿ëÇÏ¿© ³ª¿­ÇÑ´Ù.(´Ü ";" ¹®ÀÚ¸¦ ÇÊÅÍ¸µÇÏ°í ½ÍÀ» ¶© "\;"¶ó°í Ç¥±âÇÑ´Ù.
 *          </td>
 * 			<td>ÀÔ·Â°ª¿¡ ÁöÁ¤µÈ ¹®ÀÚ³ª ½ºÆ®¸µÀÌ ÀÖ´ÂÁö¸¦ °Ë»çÇÑ´Ù. ÇÏ³ªµµ ¾ø´Ù¸é À¯È¿ÇÏ´Ù.</td>
 * 			<td>filter=%;<;ÀÓÀçÇö;\\;;haha<br>(ÀÔ·Â°ª ³»¿¡ "%","<","ÀÓÀçÇö",";","haha" Áß¿¡ ÇÏ³ª¶óµµ ÀÖ´ÂÁö °Ë»çÇÑ´Ù.)
 *          </td>
 * 		</tr>
 * 		<tr>
 * 			<td>email</td>
 * 			<td>ÀÌ¸ÞÀÏ ÁÖ¼Ò</td>
 * 			<td>ÀÔ·ÂÇÑ ¸ÞÀÏÁÖ¼Ò°¡ À¯È¿ÇÑ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>email</td>
 * 		</tr>
 * 		<tr>
 * 			<td>date</td>
 * 			<td>format characterÀÇ Á¶ÇÕÀ¸·Î ÀÌ·ç¾îÁø ³¯ÀÚ¿¡ ´ëÇÑ ÆÐÅÏ ½ºÆ®¸µ.<br>
 * 				<table>
 * 					<tr>
 * 						<td><b>format character</b></td>
 * 						<td><b>desc</b></td>
 * 					</tr>
 * 					<tr>
 * 						<td>YYYY</td>
 * 						<td>4ÀÚ¸® ³âµµ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>YY</td>
 * 						<td>2ÀÚ¸® ³âµµ. 2000³â ÀÌÈÄ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>MM</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ´Þ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>DD</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ÀÏ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>hh</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ½Ã°£. 12½Ã ±âÁØ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>HH</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ½Ã°£. 24½Ã ±âÁØ </td>
 * 					</tr>
 * 					<tr>
 * 						<td>mm</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ºÐ</td>
 * 					</tr>
 * 					<tr>
 * 						<td>ss</td>
 * 						<td>2ÀÚ¸® ¼ýÀÚÀÇ ÃÊ</td>
 * 					</tr>
 * 				</table>
 * 			</td>
 * 			<td>³¯Â¥ °Ë»ç. ÀÔ·ÂµÈ ½ºÆ®¸µ°ªÀ» ³¯Â¥·Î È¯»êÇÏ¿© À¯È¿ÇÑ ³¯Â¥ÀÎÁö¸¦ °Ë»çÇÑ´Ù.</td>
 * 			<td>date=YYYYMMDD  ÀÏ ¶§ ÀÔ·Â°ªÀÌ '20020328' ÀÏ °æ¿ì -> À¯È¿<br>
 *              date=YYYYMMDD  ÀÏ ¶§ ÀÔ·Â°ªÀÌ '20020230' ÀÏ °æ¿ì -> ¿À·ù<br>
 *              date=Today is YY-MM-DD' ÀÏ ¶§ ÀÔ·Â°ªÀÌ 'Today is 02-03-28' ÀÏ °æ¿ì -> À¯È¿<br><br>
 * 				Âü°í) format¹®ÀÚ°¡ Áßº¹ÇØ¼­ ³ª¿À´õ¶óµµ Ã³À½ ³ª¿Â ¹®ÀÚ¿¡ ´ëÇØ¼­¸¸ format¹®ÀÚ·Î ÀÎ½ÄµÈ´Ù.
 *                    YYYY¿Í YY, hh¿Í HH µµ Áßº¹À¸·Î º»´Ù. ³¯Â¥´Â ³â,¿ùÀÌ Á¸ÀçÇÒ ¶§¸¸ Á¤È®È÷ Ã¼Å©ÇÏ°í
 *                    ¸¸ÀÏ ³â, ¿ùÀÌ ¾ø´Ù¸é 1 ~ 31 »çÀÌÀÎÁö¸¸ Ã¼Å©ÇÑ´Ù.
 * 			</td>
 * 		</tr>
 * </table>
 * @sig    : value, validExp
 * @param  : value    required °Ë»ç ´ë»óÀÌ µÇ´Â °ª.
 * @param  : validExp required »ç¿ëÀÚ°¡ ÁöÁ¤ÇÑ Valid Expression String.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 * @author : ÀÓÀçÇö
 */
function cfValidateValue(value, validExp) {
	var valueValidExp = new covValueValidExp(validExp);

	if (!valueValidExp.validate(value)) {
		return false;
	}

	return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·Â¹ÞÀº ¿ÀºêÁ§Æ®µéÀ» hide ÇÏ´Â ÇÔ¼ö <br>
 *           °´Ã¼ÀÇ style ¿¡¼­ display ¼Ó¼ºÀ» noneÀ¸·Î Ä¡È¯ÇÏ¿© ±¸ÇöÇÑ´Ù.<br>
 * <pre>
 *     cfHideObject( obj );
 *     cfHideObject( [obj1, obj2, obj3] );
 * </pre>
 * @sig    : objArr
 * @param  : objectArr required È­¸é¿¡¼­ ¼û±â°íÀÚ ÇÏ´Â ¿ÀºêÁ§Æ®µéÀÇ Array.
 * @return : void
 * @author : ±èÇö±¸
 */
function cfHideObject( obj ) {
	if (cfIsNull(obj)) {
		return;
	}

	var objArr;
	var oElement;

	if (obj.length == null) {
		objArr = new Array(1);
		objArr[0] = obj;
	} else {
		objArr = obj;
	}

	for (var objArrIdx = 0; objArrIdx < objArr.length; objArrIdx++) {

		oElement = objArr[objArrIdx];

		oElement.style.display = "none";
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : ¼û°ÜÁø ¿ÀºêÁ§Æ®µéÀ» º¸¿©ÁÖ´Â ÇÔ¼ö <br>
 *           °´Ã¼ÀÇ style ¿¡¼­ display ¼Ó¼ºÀ» inline(default)À¸·Î Ä¡È¯ÇÏ¿© ±¸ÇöÇÑ´Ù.<br>
 * <pre>
 *     cfShowObject( obj );
 *     cfShowObject( [obj1, obj2, obj3] );
 * </pre>
 * @sig    : objArr
 * @param  : objectArr required È­¸é¿¡¼­ º¸¿©ÁÖ°íÀÚ ÇÏ´Â ¿ÀºêÁ§Æ®µéÀÇ Array.
 * @return : void
 * @author : ±èÇö±¸
 */
function cfShowObject( obj ) {
	if (cfIsNull(obj)) {
		return;
	}

	var objArr;
	var oElement;

	if (obj.length == null) {
		objArr = new Array(1);
		objArr[0] = obj;
	} else {
		objArr = obj;
	}

	for (var objArrIdx = 0; objArrIdx < objArr.length; objArrIdx++) {

		oElement = objArr[objArrIdx];

		oElement.style.display = "inline";
	}
}


//---------------------------------------- ÀÌÇÏ °´Ã¼¼±¾ð ------------------------------------------------------------------------------//

///////////////////////////// coMessage /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : ¸Þ¼¼Áö¸¦ °ü¸®ÇÏ´Â °´Ã¼ÀÌ´Ù.
 * @author : ÀÓÀçÇö
 */
function coMessage() {
	// method
	this.getMsg = coMessage_getMsg;
}

/**
 * @type   : method
 * @access : public
 * @object : coMessage
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ Ä¡È¯ÇÏ¿© ¾Ë·ÁÁØ´Ù.
 * @sig    : message[, paramArray]
 * @param  : message    required common.jsÀÇ °øÅë ¸Þ¼¼Áö ¿µ¿ª¿¡ ¼±¾ðµÈ ¸Þ¼¼Áö ID
 * @param  : paramArray optional ¸Þ¼¼Áö¿¡¼­ '@' ¹®ÀÚ¿Í Ä¡È¯µÉ ½ºÆ®¸µ Array. (ArrayÀÇ index¿Í
 *           ¸Þ¼¼Áö ³»ÀÇ '@' ¹®ÀÚÀÇ ¼ø¼­°¡ ÀÏÄ¡ÇÑ´Ù.)
 * @return : Ä¡È¯µÈ ¸Þ¼¼Áö ½ºÆ®¸µ
 */
function coMessage_getMsg(message, paramArray) {
	if (cfIsNull(message)) {
		return null;
	}

	var index = 0;
	var re = /@/g;
	var count = 0;

	if (paramArray == null) {
		return message;
	}

	while ( (index = message.indexOf("@", index)) != -1) {
		if (paramArray[count] == null) {
			paramArray[count] = "";
		}

		message = message.substr(0, index) + String(paramArray[count]) +
		          message.substring(index + 1);

		index = index + String(paramArray[count++]).length;
	}

	return message;
}

///////////////////////////// coGridColumn /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : Grid ¿¡ ¼±¾ðµÈ ÄÃ·³Á¤º¸¸¦ ´ã°íÀÖ´Â °´Ã¼ÀÌ´Ù.
 * @author : ÀÓÀçÇö
 */
function coGridColumn() {
	this.attrNames = new Array();
	this.attrValues = new Array();
	this.attrCnt = 0;

	// method
	this.hasAttribute = coGridColumn_hasAttribute;
	this.setAttribute = coGridColumn_setAttribute;
	this.getAttribute = coGridColumn_getAttribute
}

/**
 * @type   : method
 * @access : public
 * @object : coGridColumn
 * @desc   : ÄÃ·³¿¡ Æ¯Á¤ ¼Ó¼ºÀÌ Á¤ÀÇµÇ¾î ÀÖ´ÂÁö ¾Ë·ÁÁØ´Ù.
 * @sig    : attrName
 * @param  : attrName required ¼Ó¼º¸í
 * @return : ¼Ó¼º Á¸Àç¿©ºÎ
 */
function coGridColumn_hasAttribute(attrName) {
	for (var i = 0; i < this.attrCnt; i++) {
		if (attrName.toUpperCase() == this.attrNames[i].toUpperCase()) {
			return true;
		}
	}

	return false;
}

/**
 * @type   : method
 * @access : public
 * @object : coGridColumn
 * @desc   : ÄÃ·³¿¡ »õ·Î¿î ¼Ó¼ºÀ» Ãß°¡ÇÑ´Ù.
 * @sig    : attrName, attrValue
 * @param  : attrName required ¼Ó¼º¸í
 * @param  : attrValue required ¼Ó¼º°ª
 * @return : ¼Ó¼º Á¸Àç¿©ºÎ
 */
function coGridColumn_setAttribute(attrName, attrValue) {
	this.attrNames[this.attrCnt]  = attrName.toUpperCase();
	this.attrValues[this.attrCnt] = attrValue;
	this.attrCnt++;
}

/**
 * @type   : method
 * @access : public
 * @object : coGridColumn
 * @desc   : ÄÃ·³ÀÇ Æ¯Á¤ ¼Ó¼º°ªÀ» ¾Ë·ÁÁØ´Ù.
 * @sig    : attrName
 * @param  : attrName required ¼Ó¼º¸í
 * @return : ¼Ó¼º°ª
 */
function coGridColumn_getAttribute(attrName) {
	for (var i = 0; i < this.attrCnt; i++) {
		if (this.attrNames[i] == attrName) {
			return this.attrValues[i];
		}
	}
}

///////////////////////////// coGridFormat /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : Grid FormatÀ» ÆÄ½ÌÇÑ ÈÄ Á¤º¸¸¦ ÀúÀåÇÑ´Ù.
 * @author : ÀÓÀçÇö
 */
function coGridFormat(format) {
	this.format = format;
	this.columns = new Array();

	// method
	this.existsColumn = coGridFormat_existsColumn;
	this.parse  = coGridFormat_parse;

	// initialize
	this.parse();
}

/**
 * @type   : method
 * @access : parse
 * @object : coGridFormat
 * @desc   : ÆÄ½ÌÇÑ´Ù.
 */
function coGridFormat_parse() {
	var tagRE = /<(fc|c|g|fg|x|fx)>/i;
	var colAttrRE = /([\w_]+)\s*=\s*['"]?([^<'"\s,]+)/i;
	var gFormat = this.format;
	var tagMatch;
	var colAttrData;
	var colAttrMatch;
	var colAttrName;
	var colAttrValue;
	var colCnt = 0;

	while ((tagMatch = gFormat.match(tagRE)) != null) {
		this.columns[colCnt] = new coGridColumn();
		colAttrData = gFormat.substring(tagMatch.lastIndex, gFormat.indexOf("<", tagMatch.lastIndex));

		while ( (colAttrMatch = colAttrData.match(colAttrRE)) != null) {
			colAttrName = colAttrMatch[1].toUpperCase();
			colAttrValue = colAttrMatch[2];
			this.columns[colCnt].setAttribute(colAttrName, colAttrValue);
			colAttrData = colAttrData.substr(colAttrMatch.lastIndex);
		}

		gFormat = gFormat.substr(tagMatch.lastIndex);
		colCnt++;
	}
}

/**
 * @type   : method
 * @access : public
 * @object : coGridFormat
 * @desc   : Grid¿¡ ¼±¾ðµÈ ÄÃ·³µé Áß¿¡¼­ Æ¯Á¤ colid¸¦ °¡Áø ÄÃ·³ÀÌ Á¸ÀçÇÏ´ÂÁö¸¦ ¾Ë·ÁÁØ´Ù.
 * @sig    : colId
 * @param  : colId required ¼Ó¼º¸í
 * @return : ÄÃ·³ Á¸Àç¿©ºÎ
 */
function coGridFormat_existsColumn(colId) {
	for (var i = 0; i < this.columns.length; i++) {
		if (this.columns[i].hasAttribute("ID") &&
		    this.columns[i].getAttribute("ID") == colId) {
			return true;
		}
	}

	return false;
}

///////////////////////////// coMap /////////////////////////////
/**
 * @type   : object
 * @access : public
 * @desc   : String parameter ¿¡ ´ëÇÑ name°ú value ½ÖµéÀ» °¡Áø °´Ã¼
 * @author : ÀÓÀçÇö
 */
function coMap() {
	// fields

	this.names = new Array();
	this.values = new Array();
	this.count = 0;

	// methods
	this.getValue          = coMap_getValue;
	this.put               = coMap_put;
	this.getNameAt         = coMap_getNameAt;
	this.getValueAt        = coMap_getValueAt;
	this.size              = coMap_size;
	this.getMaxNameLength  = coMap_getMaxNameLength;
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : name¿¡ ¸Â´Â ÆÄ¶ó¹ÌÅÍ°ªÀ» ¸®ÅÏÇÑ´Ù.
 * @sig    : name
 * @param  : name required mapÀÇ nameÀ¸·Î »ç¿ëÇÒ °ª
 * @return : ÆÄ¶ó¹ÌÅÍ°ª
 */
function coMap_getValue(name) {
	for (var i = 0; i < this.count; i++) {
		if (this.names[i] == name) {
			return this.values[i];
		}
	}

	return null;
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : »õ·Î¿î mapÀ» Ãß°¡ÇÑ´Ù. °°Àº name°¡ Á¸ÀçÇÒ °æ¿ì overwriteÇÑ´Ù.
 * @sig    : name, value
 * @param  : name  required mapÀÇ name·Î »ç¿ëÇÒ °ª
 * @param  : value required mapÀÇ value·Î »ç¿ëÇÒ °ª
 * @return : ÆÄ¶ó¹ÌÅÍ°ª
 */
function coMap_put(name, value) {
	for (var i = 0; i < this.count; i++) {
		if (this.names[i] == name) {
			this.values[i] = value;
			return;
		}
	}

	this.names[this.count] = name;
	this.values[this.count++] = value;
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : ÁöÁ¤µÈ index¿¡ ÀÖ´Â mapÀÇ nameÀ» ¾Ë·ÁÁØ´Ù.
 * @sig    : index
 * @param  : index - mapÀÇ index
 * @return : name
 */
function coMap_getNameAt(index) {
	return this.names[index];
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : ÁöÁ¤µÈ index¿¡ ÀÖ´Â mapÀÇ value¸¦ ¾Ë·ÁÁØ´Ù.
 * @sig    : index
 * @param  : index required mapÀÇ index
 * @return : value
 */
function coMap_getValueAt(index) {
	return this.values[index];
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : mapÀÇ name-value ½ÖÀÇ °¹¼ö¸¦ ¾Ë·ÁÁØ´Ù.
 * @return : name-value ½ÖÀÇ °¹¼ö
 */
function coMap_size() {
	return this.count;
}

/**
 * @type   : method
 * @access : public
 * @object : coMap
 * @desc   : map ³»ÀÇ name °ªµéÀ» StringÀ¸·Î È¯»êÇÏ¿© ÃÖ´ë±æÀÌ¸¦ ¾Ë·ÁÁØ´Ù.
 * @return : max name length
 */
function coMap_getMaxNameLength() {
	var maxLength = 0;

	for (var i = 0; i < this.count; i++) {
		if (String(this.names[i]).length > maxLength) {
			maxLength = String(this.names[i]).length;
		}
	}

	return maxLength;
}

///////////////////////////// coParameterMap /////////////////////////////
/**
 * @type   : object
 * @access : public
 * @desc   : String parameter ¿¡ ´ëÇÑ name°ú value ½ÖµéÀ» °¡Áø °´Ã¼
 * @author : ÀÓÀçÇö
 */
function coParameterMap() {
	// fields

	/**
	 * @type   : field
	 * @access : private
	 * @object : coParameterMap
	 * @desc   : ÆÄ¶ó¹ÌÅÍ ÀÌ¸§À» ´ã°íÀÖ´Â array
	 */
	this.names = new Array();

	/**
	 * @type   : field
	 * @access : private
	 * @object : coParameterMap
	 * @desc   : ÆÄ¶ó¹ÌÅÍ °ªÀ» ´ã°íÀÖ´Â array
	 */
	this.values = new Array();

	/**
	 * @type   : field
	 * @access : private
	 * @object : coParameterMap
	 * @desc   : ÆÄ¶ó¹ÌÅÍÀÇ °³¼ö
	 */
	this.count = 0;

	// methods
	this.getValue          = coParameterMap_getValue;
	this.put               = coParameterMap_put;
	this.getNameAt         = coParameterMap_getNameAt;
	this.getValueAt        = coParameterMap_getValueAt;
	this.size              = coParameterMap_size;
	this.getMaxNameLength  = coParameterMap_getMaxNameLength;
	this.getMaxValueLength = coParameterMap_getMaxValueLength;
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : name¿¡ ¸Â´Â ÆÄ¶ó¹ÌÅÍ°ªÀ» ¸®ÅÏÇÑ´Ù.
 * @sig    : name
 * @param  : name required mapÀÇ nameÀ¸·Î »ç¿ëÇÒ °ª
 * @return : ÆÄ¶ó¹ÌÅÍ°ª
 */
function coParameterMap_getValue(name) {
	for (var i = 0; i < this.count; i++) {
		if (this.names[i] == name) {
			return this.values[i];
		}
	}

	return null;
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : »õ·Î¿î mapÀ» Ãß°¡ÇÑ´Ù. °°Àº name°¡ Á¸ÀçÇÒ °æ¿ì overwriteÇÑ´Ù.
 * @sig    : name, value
 * @param  : name  required mapÀÇ name·Î »ç¿ëÇÒ °ª
 * @param  : value required mapÀÇ value·Î »ç¿ëÇÒ °ª
 * @return : ÆÄ¶ó¹ÌÅÍ°ª
 */
function coParameterMap_put(name, value) {
	for (var i = 0; i < this.count; i++) {
		if (this.names[i] == name) {
			this.values[i] = value;
			return;
		}
	}

	this.names[this.count] = name;
	this.values[this.count++] = value;
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : ÁöÁ¤µÈ index¿¡ ÀÖ´Â mapÀÇ nameÀ» ¾Ë·ÁÁØ´Ù.
 * @sig    : index
 * @param  : index required mapÀÇ index
 * @return : name
 */
function coParameterMap_getNameAt(index) {
	return this.names[index];
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : ÁöÁ¤µÈ index¿¡ ÀÖ´Â mapÀÇ value¸¦ ¾Ë·ÁÁØ´Ù.
 * @sig    : index
 * @param  : index required mapÀÇ index
 * @return : value
 */
function coParameterMap_getValueAt(index) {
	return this.values[index];
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : mapÀÇ name-value ½ÖÀÇ °¹¼ö¸¦ ¾Ë·ÁÁØ´Ù.
 * @return : name-value ½ÖÀÇ °¹¼ö
 */
function coParameterMap_size() {
	return this.count;
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : map ³»ÀÇ name °ªµéÀ» StringÀ¸·Î È¯»êÇÏ¿© ÃÖ´ë±æÀÌ¸¦ ¾Ë·ÁÁØ´Ù.
 * @return : max name length
 */
function coParameterMap_getMaxNameLength() {
	var maxLength = 0;

	for (var i = 0; i < this.count; i++) {
		if (String(this.names[i]).length > maxLength) {
			maxLength = String(this.names[i]).length;
		}
	}

	return maxLength;
}

/**
 * @type   : method
 * @access : public
 * @object : coParameterMap
 * @desc   : map ³»ÀÇ value °ªµéÀ» StringÀ¸·Î È¯»êÇÏ¿© ÃÖ´ë±æÀÌ¸¦ ¾Ë·ÁÁØ´Ù.
 * @return : max value length
 */
function coParameterMap_getMaxValueLength() {
	var maxLength = 0;

	for (var i = 0; i < this.count; i++) {
		if (String(this.values[i]).length > maxLength) {
			maxLength = String(this.values[i]).length;
		}
	}

	return maxLength;
}

//-------------------------- À¯È¿¼º °Ë»ç¸¦ À§ÇÑ °´Ã¼ ¼±¾ð -----------------------------//
/*
 * @Validator °´Ã¼ÀÇ ±¸Á¶
 *   - ¼Ó¼º : exception,   -> validityÀÇ sub¼Ó¼ºÀÌ´Ù. validity°¡ true¸é exceptionÀº ¹«Á¶°Ç falseÀÌ°í
 *                            validity°¡ falseÀÎ °æ¿ì falseÀÇ ¿øÀÎÀÌ exceptionÀÎÁö ¿©ºÎ¸¦ ¾Ë·ÁÁØ´Ù.
 *                            exceptionÀº »ç¿ëÀÚ ÀÔ·Â¿¡ ´ëÇÑ ½ÇÁ¦ validation°ú´Â ¹«°üÇÑ ¿¡·¯¸¦ ÀÇ¹ÌÇÑ´Ù.
 *                            true/false Áß ÇÏ³ª.
 *            message,     -> ¿À·ù¸Þ¼¼Áö¸¦ ´ã°í ÀÖ´Ù.
 *            validity,    -> À¯È¿¼º°Ë»ç°á°ú¸¦ ´ã°í ÀÖ´Ù. true/false Áß ÇÏ³ª.
 *            value        -> À¯È¿¼º °Ë»ç ´ë»ó °ª.
 *
 *   - ¸Þ¼Òµå : validate() -> À¯È¿¼º °Ë»ç¸¦ ¼öÇàÇÑ´Ù.
 *                            À¯È¿ÇÒ °æ¿ì, validity¸¦ true·ÎÇÏ°í true¸¦ returnÇÏ°í
 *                            À¯È¿ÇÏÁö ¾ÊÀ» °æ¿ì,  validity¸¦ false·ÎÇÏ°í false¸¦ returnÇÏ°í
 *                            message¿¡ ¿À·ù¸Þ¼¼Áö¸¦ ±â¼úÇÑ´Ù.
 *                            exceptionÀÇ °æ¿ì´Â exceptionÀ» true·Î ÇÏ°í message¿¡ ¸Þ¼¼Áö¸¦ ±â¼úÇÑ´Ù.
 *
 *   - Ãß°¡½Ã ÇÒÀÏ :
 *     1) validator°´Ã¼¸¦ Á¤ÀÇÇÑ´Ù.
 *     2) covValidExp °´Ã¼ÀÇ getValidators ¸Þ¼Òµå¿¡ validator°´Ã¼¸¦ µî·ÏÇÑ´Ù.
 */

///////////////////////////// covValueValidExp /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : À¯È¿¼º °Ë»ç¿¡ ´ëÇÑ Ç¥Çö(expression)À» °´Ã¼È­ ÇÏ¿´´Ù.
 *             - expression Çü½Ä<br>
 *               Ç×¸ñÀÌ¸§:ÇÊ¼öÇ×¸ñ¿©ºÎ:À¯È¿¼ºÇ×¸ñ<br>
 *               ¿¹) "Á¢¼ö¹øÈ£:yes:length=6"
 *             - À¯È¿¼º Ç×¸ñ Çü½Ä
 *               À¯È¿¼ºÇ×¸ñ¸í=À¯È¿°ª[&À¯È¿¼ºÇ×¸ñ¸í=À¯È¿°ª]..
 *               ¿¹) "length=13&ssn"
 * @sig    : expression
 * @param  : expression required valid expression string.
 * @author : ÀÓÀçÇö
 */
function covValueValidExp(expression) {
    // data;
    this.validItems = new Array();
    this.errMsg = "";

    // method
    this.init = covValueValidExp_init;
    this.parse = covValueValidExp_parse;
    this.validate = covValueValidExp_validate;

    // initialize
    this.init(expression);
}

/**
 * @type   : method
 * @access : private
 * @object : covValueValidExp
 * @desc   : ÃÊ±âÈ­¸¦ ¼öÇàÇÑ´Ù.
 * @sig    : expression
 * @param  : expression required valid expression string.
 * @author : ÀÓÀçÇö
 */
function covValueValidExp_init(expression) {
	this.parse(expression);
}

/**
 * @type   : method
 * @access : private
 * @object : covValueValidExp
 * @desc   : covValidExp °´Ã¼ÀÇ parse ¸Þ¼Òµå.
 *           valid expressionÀ» parsingÇÑ´Ù.
 * @sig    : expression
 * @param  : expression required valid expression string.
 */
function covValueValidExp_parse(expression) {
	if (cfIsNull(expression)) {
		return;
	}

	var validItemExps = expression.advancedSplit("&", "i");
	var validItem;

	for (var i = 0; i < validItemExps.length; i++) {
		validItemPair = validItemExps[i].trim().advancedSplit("=", "i");
		validItem = new Object();
		validItem.name  = validItemPair[0].trim();
		validItem.value = validItemPair[1];  // parsedExp[1] Àº Á¸ÀçÇÏÁö ¾ÊÀ» ¼öµµ ÀÖÁö¸¸ ÀÚ¹Ù½ºÅ©¸³Æ®¿¡¼­´Â
		this.validItems[i] = validItem;      // ÀÌ·± °æ¿ì "undefined" ¶ó´Â °ªÀ» ¸®ÅÏÇÑ´Ù.
	}
}

/**
 * @type   : method
 * @access : private
 * @object : covValueValidExp
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required °Ë»ç´ë»ó°ª
 */
function covValueValidExp_validate(value) {
	var validators = new Array();
	var count = 0;

	for (var i = 0; i < this.validItems.length; i++) {
		switch (this.validItems[i].name) {
			case "length" :
				validators[count++] = new covLengthValidator(this.validItems[i].value);
				break;

			case "byteLength" :
				validators[count++] = new covByteLengthValidator(this.validItems[i].value);
				break;

			case "minLength" :
				validators[count++] = new covMinLengthValidator(this.validItems[i].value);
				break;

			case "minByteLength" :
				validators[count++] = new covMinByteLengthValidator(this.validItems[i].value);
				break;

			case "maxLength" :
				validators[count++] = new covMaxLengthValidator(this.validItems[i].value);
				break;

			case "maxByteLength" :
				validators[count++] = new covMaxByteLengthValidator(this.validItems[i].value);
				break;

			case "number" :
				validators[count++] = new covNumberValidator(this.validItems[i].value);
				break;

			case "minNumber" :
				validators[count++] = new covMinNumberValidator(this.validItems[i].value);
				break;

			case "maxNumber" :
				validators[count++] = new covMaxNumberValidator(this.validItems[i].value);
				break;

			case "inNumber" :
				validators[count++] = new covInNumberValidator(this.validItems[i].value);
				break;

			case "minDate" :
				validators[count++] = new covMinDateValidator(this.validItems[i].value);
				break;

			case "maxDate" :
				validators[count++] = new covMaxDateValidator(this.validItems[i].value);
				break;

			case "format" :
				validators[count++] = new covFormatValidator(this.validItems[i].value);
				break;

			case "ssn" :
				validators[count++] = new covSsnValidator(this.validItems[i].value);
				break;

			case "csn" :
				validators[count++] = new covCsnValidator(this.validItems[i].value);
				break;

			case "filterIn" :
				validators[count++] = new covFilterInValidator(this.validItems[i].value);
				break;

			case "filterOut" :
				validators[count++] = new covFilterOutValidator(this.validItems[i].value);
				break;

			case "email" :
				validators[count++] = new covEmailValidator(this.validItems[i].value);
				break;

			case "date" :
				validators[count++] = new covDateValidator(this.validItems[i].value);
				break;

			default :
				break;
		}
	}

	for (var i = 0; i < validators.length; i++) {
		if (!validators[i].validate(value)) {
			this.errMsg = validators[i].message;
			return false;
		}
	}

	return true;
}

///////////////////////////// covItemValidExp /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : À¯È¿¼º °Ë»ç¿¡ ´ëÇÑ Ç¥Çö(expression)À» °´Ã¼È­ ÇÏ¿´´Ù.
 *             - expression Çü½Ä<br>
 *               Ç×¸ñÀÌ¸§:ÇÊ¼öÇ×¸ñ¿©ºÎ:À¯È¿¼ºÇ×¸ñ<br>
 *               ¿¹) "Á¢¼ö¹øÈ£:yes:length=6"
 *             - À¯È¿¼º Ç×¸ñ Çü½Ä
 *               À¯È¿¼ºÇ×¸ñ¸í=À¯È¿°ª[&À¯È¿¼ºÇ×¸ñ¸í=À¯È¿°ª]..
 *               ¿¹) "length=13&ssn"
 * @sig    : expression, itemName
 * @param  : expression required valid expression string.
 * @param  : itemName   required ¾ÆÀÌÅÛ¸í
 * @author : ÀÓÀçÇö
 */
function covItemValidExp(expression, itemName) {
    // data;
    this.itemName;
    this.required;
    this.valueValidExp;

    // method
    this.parse = covItemValidExp_parse;
    this.validate = covItemValidExp_validate;

    // initialize
    this.parse(expression, itemName);
}

/**
 * @type   : method
 * @access : public
 * @object : covItemValidExp
 * @desc   : valid expressionÀ» parsingÇÑ´Ù.
 * @sig    : expression, itemName
 * @param  : expression required valid expression string.
 * @param  : itemName   required ¾ÆÀÌÅÛ¸í
 */
function covItemValidExp_parse(expression, itemName) {
	if (cfIsNull(expression)) {
		return;
	}

	var columns = expression.advancedSplit(":", "i");

	if (cfIsNull(columns[1])) {
		return;
	}

	if (cfIsNull(columns[0])) {
		if (!cfIsNull(itemName)) {
			this.itemName = itemName.trim();
		} else {
			return;
		}
	} else {
		this.itemName = columns[0].trim();
	}

	this.required = (columns[1].trim().toUpperCase() == "YES" ||
	                 columns[1].trim().toUpperCase() == "TRUE" ||
	                 columns[1].trim() == "1"
	                ) ? true : false;

	if ((columns[2]) != null) {
		this.valueValidExp = new covValueValidExp(columns[2].trim());
	}
}

/**
 * @type   : method
 * @access : public
 * @object : covItemValidExp
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required °Ë»çÇÒ °ª
 */
function covItemValidExp_validate(value) {
	// Ç¥Çö½Ä¿¡ ÇÊ¼öÇ×¸ñµé(¾ÆÀÌÅÛ¸í, ÇÊ¼ö¿©ºÎ)À» ±â¼úÇÏÁö ¾ÊÀ» °æ¿ì´Â Ç¥Çö½ÄÀÌ ¾ø´Ù°í °£ÁÖ.
	if (cfIsNull(this.itemName) || cfIsNull(this.required)) {
		return true;
	}

	if (this.required && cfIsNull(value)) {
		this.errMsg = MSG_COM_ERR_002;
		return false;
	}

	if (!this.required && cfIsNull(value)) {
		return true;
	}

	if (this.valueValidExp == null) {
		return true;
	}

	if (!this.valueValidExp.validate(value)) {
		this.errMsg = this.valueValidExp.errMsg;
		return false;
	}

	return true;
}

///////////////////////////// covColumnValidExp /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : GridÀÇ ÄÃ·³ À¯È¿¼º °Ë»ç Ç¥Çö½Ä
 * @sig    : expression, oGrid
 * @param  : expression required valid expression string.
 * @param  : oGrid      required °Ë»ç´ë»ó Grid ¿ÀºêÁ§Æ®
 * @author : ÀÓÀçÇö
 */
function covColumnValidExp(expression, oGrid) {
    // data;
    this.colId;
    this.errMsg = "";
    this.errRow = -1;
    this.errItemName = "";
    this.itemValidExp;
    this.property = "NORMAL";  // NORMAL, KEY, SINGLEKEY ¼Ó¼ºÀÌ ÀÖ´Ù.

    // method
    this.parse    = covColumnValidExp_parse;
    this.validate = covColumnValidExp_validate;

    // initialize
    this.parse(expression, oGrid);
}

/**
 * @type   : method
 * @access : public
 * @object : covColumnValidExp
 * @desc   : valid expressionÀ» parsingÇÑ´Ù.
 * @sig    : expression, oGrid
 * @param  : expression required valid expression string.
 * @param  : oGrid      required °Ë»ç´ë»ó Grid ¿ÀºêÁ§Æ®
 */
function covColumnValidExp_parse(expression, oGrid) {
	var index = -1;

	var expArr = expression.advancedSplit(":", "i");

	if (expArr.length < 3) {
		return;
	}

	var itemName = null;

	this.colId = expArr[0].trim();

	if (new coGridFormat(oGrid.Format).existsColumn(this.colId)) {
		itemName = oGrid.ColumnProp(this.colId, "Name");
	}

	this.itemValidExp = new covItemValidExp(expArr[1] + ":" + expArr[2] + ":" + expArr[3], itemName);
	if (!cfIsNull(expArr[4]) && expArr[4].toUpperCase().trim() == "KEY") {
		this.property = "KEY";
	} else if (!cfIsNull(expArr[4]) && expArr[4].toUpperCase().trim() == "SINGLEKEY") {
		this.property = "SINGLEKEY";
	}
}

/**
 * @type   : method
 * @access : public
 * @object : covColumnValidExp
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : oDataSet, row
 * @param  : oDataSet required °Ë»ç´ë»ó DataSet
 * @param  : row required °Ë»ç´ë»ó DataSetÀÇ Æ¯Á¤ row ¹øÈ£
 */
function covColumnValidExp_validate(oDataSet, row) {
	if (oDataSet == null ||
	    oDataSet.tagName != "OBJECT" ||
	    oDataSet.attributes.classid.nodeValue.toUpperCase() !== "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49" ||
	    oDataSet.CountRow < 1
	   ) {
	   	return true;
	}

	var startIdx = 1;
	var endIdx = oDataSet.CountRow;
	var value;
	var rowYN = false;

	if (row != null) {
		startIdx = row;
		endIdx = row;
		rowYN = true;
	}

	for (var i = startIdx; i <= endIdx; i++) {
		value = (oDataSet.NameValue(i, this.colId) == null) ?
                 null : oDataSet.NameString(i, this.colId).trim();  // DataSetÀÇ data¸¦ trim ½ÃÅ²´Ù.

		if (this.itemValidExp != null && !this.itemValidExp.validate(value)) {
			this.errMsg = this.itemValidExp.errMsg;
			this.errRow = i;
			this.errItemName = this.itemValidExp.itemName;
			return false;
		}
	}

	return true;
}

///////////////////////////// covGridValidExp /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : Grid¿¡ ´ëÇÑ À¯È¿¼º°Ë»ç Ç¥Çö½Ä
 * @sig    : oGrid
 * @param  : oGrid required °Ë»ç´ë»ó Grid
 * @author : ÀÓÀçÇö
 */
function covGridValidExp(oGrid) {
    // data;
    this.oGrid = oGrid;
    this.columnValidExps = new Array();
	this.errMsg;
	this.errRow;
	this.errColId;
	this.errItemName = "";

    // method
    this.parse = covGridValidExp_parse;
    this.validate = covGridValidExp_validate;

    // initialize
    this.parse();
}

/**
 * @type   : method
 * @access : public
 * @object : covGridValidExp
 * @desc   : valid expressionÀ» parsingÇÑ´Ù.
 */
function covGridValidExp_parse() {
	if (cfIsNull(this.oGrid) || cfIsNull(this.oGrid.validExp)) {
		return;
	}

	var columns = this.oGrid.validExp.trim().advancedSplit(",", "it");

	for (var i = 0; i < columns.length; i++) {
    	this.columnValidExps[i] = new covColumnValidExp(columns[i], this.oGrid);
	}
}

/**
 * @type   : method
 * @access : public
 * @object : covGridValidExp
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : [row[, colId[, ignoreStatus]]]
 * @param  : row optional °Ë»ç´ë»ó GridÀÇ Æ¯Á¤ row ¹øÈ£
 * @param  : colId optional °Ë»ç´ë»ó GridÀÇ Æ¯Á¤ ÄÃ·³ÀÇ id
 * @param  : ignoreStatus optional Grid °Ë»ç½Ã row status¿¡ »ó°ü¾øÀÌ ¸ðµÎ °Ë»çÇÒ °ÍÀÎÁöÀÇ ¿©ºÎ.
 */
function covGridValidExp_validate(row, colId, ignoreStatus) {
	var oDataSet = document.all(this.oGrid.DataId);

	if (oDataSet == null ||
	    oDataSet.tagName != "OBJECT" ||
	    oDataSet.attributes.classid.nodeValue.toUpperCase() !== "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49" ||
	    oDataSet.CountRow < 1
	   ) {
	   	return true;
	}

	var startIdx;
	var endIdx;
	var nestedStartIdx;
	var nestedEndIdx;
	var keyColValidExps = new Array();
	var singleKeyColValidExps = new Array();

	// Å°ÄÃ·³ ÃßÃâ
	var keyColCnt = 0;
	var singleKeyColCnt = 0;
	for (var i = 0; i < this.columnValidExps.length; i++) {
		if (this.columnValidExps[i].property == "KEY") {
			keyColValidExps[keyColCnt++] = this.columnValidExps[i];
		} else if (this.columnValidExps[i].property == "SINGLEKEY") {
			singleKeyColValidExps[singleKeyColCnt++] = this.columnValidExps[i];
		}
	}

	if (row != null) {
		startIdx = row;
		endIdx = row;
	} else {
		startIdx = 1;
		endIdx = oDataSet.CountRow - 1;
	}

	// Áßº¹Å° Ã¼Å©
	if (keyColValidExps.length > 0 || singleKeyColValidExps.length > 0) {
		var isEqual;

		for (var i = startIdx; i <= endIdx; i++) {

			if (row != null) {
				nestedStartIdx = 1;
			} else {
				nestedStartIdx = i + 1;
			}

			for (j = nestedStartIdx; j <= oDataSet.CountRow; j++) {
				if (i == j) {
					continue;
				}

				// ÀÏ¹ÝÅ°ÄÃ·³ °Ë»ç.
				{
					isEqual = true;
					for (var k = 0; k < keyColValidExps.length; k++) {
						if (oDataSet.NameValue(i, keyColValidExps[k].colId) !=
						    oDataSet.NameValue(j, keyColValidExps[k].colId)
						   ) {
						   	isEqual = false;
						   	break;
						}
					}

					if (isEqual) {
						this.errMsg = cfGetMsg(MSG_COM_ERR_032, ["@"]);

						if (row != null) {
							this.errRow = row;  // row¸¦ ÁöÁ¤ÇÏ¿´À» ¶§´Â ÇØ´ç row¿¡ ´ëÇÑ error·Î °£ÁÖ
						} else {
							this.errRow = j; // rowÁöÁ¤ÀÌ ¾øÀ¸¸é Áßº¹µÈ µÎ°³ÀÇ µ¥ÀÌÅÍÁß ¼ø¼­»ó ³ªÁß¿¡ ÀÖ´Â row¸¦ error·Î °£ÁÖ
						}

						for (var k = 0; k < keyColValidExps.length; k++) {
							this.errItemName = this.errItemName + keyColValidExps[k].itemValidExp.itemName + ", ";
						}

						this.errItemName = this.errItemName.substring(0, this.errItemName.lastIndexOf(","));
						return false;
					}
				}

				// ½Ì±ÛÅ°ÄÃ·³ °Ë»ç.
				for (var k = 0; k < singleKeyColValidExps.length; k++) {
					if (oDataSet.NameValue(i, singleKeyColValidExps[k].colId) ==
					    oDataSet.NameValue(j, singleKeyColValidExps[k].colId)
					   ) {
						this.errMsg = cfGetMsg(MSG_COM_ERR_032, ["@"]);

						if (row != null) {
							this.errRow = row;  // row¸¦ ÁöÁ¤ÇÏ¿´À» ¶§´Â ÇØ´ç row¿¡ ´ëÇÑ error·Î °£ÁÖ
						} else {
							this.errRow = j; // rowÁöÁ¤ÀÌ ¾øÀ¸¸é Áßº¹µÈ µÎ°³ÀÇ µ¥ÀÌÅÍÁß ¼ø¼­»ó ³ªÁß¿¡ ÀÖ´Â row¸¦ error·Î °£ÁÖ
						}

						this.errItemName = singleKeyColValidExps[k].itemValidExp.itemName;
						return false;
					}
				}
			}
		}
	}

	if (row != null) {
		startIdx = row;
		endIdx = row;
	} else {
		startIdx = 1;
		endIdx = oDataSet.CountRow;
	}

	// validation ¼öÇà
	for (var i = startIdx; i <= endIdx; i++) {
		if (ignoreStatus || oDataSet.RowStatus(i) != 0) {
			for (var j = 0; j < this.columnValidExps.length; j++) {
				columnValidExp = this.columnValidExps[j];

				if (!columnValidExp.validate(oDataSet, i)) {
					this.errMsg = columnValidExp.errMsg;
					this.errRow = i;
					this.errColId = columnValidExp.colId;
					this.errItemName = columnValidExp.errItemName;
					return false;
				}
			}
		}
	}

	return true;
}

///////////////////////////// covLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'length' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ±æÀÌ¸¦ °¡Áö°í ÀÖ´ÂÁö °Ë»çÇÑ´Ù.
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covLengthValidator_validate(value) {
	if (value.length != this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_005, ["@", String(this.length)]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covByteLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'byteLength' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ byte´ÜÀ§ÀÇ ±æÀÌ¸¦ °¡Áö°í ÀÖ´ÂÁö °Ë»çÇÑ´Ù.
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covByteLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covByteLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covByteLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covByteLengthValidator_validate(value) {
	if (cfGetByteLength(value) != this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_027, ["@", String(this.length), String(Math.floor(this.length / 2))]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMinLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'minLength' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ±æÀÌ ÀÌ»óÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : length
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covMinLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covMinLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMinLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMinLengthValidator_validate(value) {
	if (value.length < this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_011, ["@", String(this.length)]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMinByteLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'minByteLength' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ byte´ÜÀ§ÀÇ ±æÀÌ ÀÌ»óÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : length
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covMinByteLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covMinByteLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMinByteLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMinByteLengthValidator_validate(value) {
	if (cfGetByteLength(value) < this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_028, ["@", String(this.length), String(Math.floor(this.length / 2))]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMaxLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'maxLength' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ±æÀÌ ÀÌ»óÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : length
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covMaxLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covMaxLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMaxLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMaxLengthValidator_validate(value) {
	if (value.length > this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_012, ["@", String(this.length)]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMaxByteLengthValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'maxByteLength' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ byte´ÜÀ§ÀÇ ±æÀÌ ÀÌÇÏÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : length
 * @param  : length required À¯È¿ÇÑ ±âÁØ±æÀÌ.
 * @author : ÀÓÀçÇö
 */
function covMaxByteLengthValidator(length) {
    // data;
    this.message = "";
    this.validity = false;
    this.length = length;

    // method
    this.validate = covMaxByteLengthValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMaxByteLengthValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMaxByteLengthValidator_validate(value) {
	if (cfGetByteLength(value) > this.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_029, ["@", String(this.length), String(Math.floor(this.length / 2))]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covNumberValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'number' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ¼ýÀÚÀÎÁö¸¦ °Ë»çÇÑ´Ù. ¶ÇÇÑ formatÀ» ÁöÁ¤ÇÏ¿´À» °æ¿ì¿¡´Â format¿¡ ¸Â´ÂÁö °Ë»çÇÑ´Ù.
 * <pre>
 *     "number" ·Î ÁöÁ¤½Ã : ¼ýÀÚÀÎÁö Ã¼Å©
 *     "number=(5.2)" ·Î ÁöÁ¤½Ã : ¼ýÀÚÀÌ¸é¼­ Á¤¼öºÎ 5ÀÚ¸® ÀÌÇÏ, ¼Ò¼öºÎ 2ÀÚ¸® ÀÌÇÏÀÎÁö¸¦ Ã¼Å©
 * </pre>
 * @author : ÀÓÀçÇö
 */
function covNumberValidator(format) {
    // data;
	re = /\(\s*(\d+)\s*.\s*(\d+)\s*\)/;
	this.iLength;
	this.dLength;

	this.message = "";
	this.validity = false;

    // method
    this.validate = covNumberValidator_validate;

	// initialize
	{
		if (cfIsNull(format)) {
			return;
		}

		r = format.match(re);

		if (r == null) {
			return;
		}

		this.iLength = Number(r[1]);
		this.dLength = Number(r[2]);
	}
}

/**
 * @type   : method
 * @access : public
 * @object : covNumberValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covNumberValidator_validate(value) {
	if (isNaN(value)) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_007, ["@"]);
		return false;
	} else if (!cfIsNull(this.iLength)) {
		var strValue = String(value);
		var idx = strValue.indexOf('.');
		var iNumStr = strValue.substr(0, idx);
		var dNumStr = strValue.substr(idx + 1);

		if (iNumStr.length > this.iLength) {
			this.message = new coMessage().getMsg(MSG_COM_ERR_059, ["@", String(this.iLength)]);
			return false;
		} else if (dNumStr.length > this.dLength) {
			this.message = new coMessage().getMsg(MSG_COM_ERR_060, ["@", String(this.dLength)]);
			return false;
		}
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMinNumberValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'minNumber' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ÃÖ¼Ò°ªÀ» ³Ñ´ÂÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : minNumber
 * @param  : minNumber required À¯È¿ÇÑ ±âÁØ ÃÖ¼Ò°ª.
 * @author : ÀÓÀçÇö
 */
function covMinNumberValidator(minNumber) {
    // data;
    this.message = "";
    this.validity = false;
    this.minNumber = minNumber;

    // method
    this.validate = covMinNumberValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMinNumberValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMinNumberValidator_validate(value) {
	// ±âÁØ°ªÀÌ ¼ýÀÚ°¡ ¾Æ´Ñ°æ¿ì ¹«Á¶°Ç true;
	if (isNaN(this.minNumber)) {
		this.validity = true;
		return true;
	}

	if (isNaN(value)) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_007, ["@"]);
		return false;
	}

	this.minNumber = Number(this.minNumber);
	value          = Number(value);

	if (value < this.minNumber) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_013, ["@", String(this.minNumber)]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMaxNumberValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'maxNumber' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ÃÖ´ë°ªÀ» ³ÑÁö ¾Ê´ÂÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : maxNumber
 * @param  : maxNumber À¯È¿ÇÑ ±âÁØ ÃÖ´ë°ª.
 * @author : ÀÓÀçÇö
 */
function covMaxNumberValidator(maxNumber) {
    // data;
    this.message = "";
    this.validity = false;
    this.maxNumber = (maxNumber == null) ? "" : maxNumber.trim();

    // method
    this.validate = covMaxNumberValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMaxNumberValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMaxNumberValidator_validate(value) {
	// ±âÁØ°ªÀÌ ¼ýÀÚ°¡ ¾Æ´Ñ°æ¿ì ¹«Á¶°Ç true;
	if (isNaN(this.maxNumber)) {
		this.validity = true;
		return true;
	}

	if (isNaN(value)) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_007, ["@"]);
		return false;
	}

	this.maxNumber = Number(this.maxNumber);
	value          = Number(value);

	if (value > this.maxNumber) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_014, ["@", String(this.maxNumber)]);
		return false;
	}

	this.validity = true;
	return true;
}


///////////////////////////// covInNumberValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'inNumber' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ¹üÀ§ ³»ÀÇ °ªÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : inNumber
 * @param  : inNumber required ¼ýÀÚÀÇ ¹üÀ§¸¦ ³ªÅ¸³»´Â ½ºÆ®¸µ. ¿¹) "1~100"
 * @author : ÀÓÀçÇö
 */
function covInNumberValidator(inNumber) {
    // data;
    this.message = "";
    this.validity = false;
    this.minNumber;
    this.maxNumber;

    // method
    this.validate = covInNumberValidator_validate;

    // initialize
	this.minNumber = inNumber.substring(0, inNumber.indexOf("~"));
	this.maxNumber = inNumber.substr(inNumber.indexOf("~") + 1);

	this.minNumber = (this.minNumber == null) ? "" : this.minNumber.trim();
	this.maxNumber = (this.maxNumber == null) ? "" : this.maxNumber.trim();
}

/**
 * @type   : method
 * @access : public
 * @object : covInNumberValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covInNumberValidator_validate(value) {
	// ±âÁØ°ªÀÌ ¼ýÀÚ°¡ ¾Æ´Ñ°æ¿ì ¹«Á¶°Ç true;
	if (isNaN(this.minNumber) || isNaN(this.maxNumber)) {
		this.validity = true;
		return true;
	}

	if (isNaN(value)) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_007, ["@"]);
		return false;
	}

	this.minNumber = Number(this.minNumber);
	this.maxNumber = Number(this.maxNumber);
	value     = Number(value);

	if (value < this.minNumber || value > this.maxNumber) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_006, ["@", String(this.minNumber), String(this.maxNumber)]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMinDateValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'minDate' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ³¯Â¥¸¦ ³Ñ´ÂÁö¸¦ °Ë»çÇÑ´Ù.
 *           'YYYYMMDD' Çü½ÄÀ¸·Î ³¯Â¥¸¦ Ç¥±âÇØ¾ß ÇÑ´Ù.
 *             ¿¹) minDate=20020315
 * @sig    : minDate
 * @param  : minDate required À¯È¿ÇÑ ±âÁØ ÃÖ¼Ò°ª.
 * @author : ÀÓÀçÇö
 */
function covMinDateValidator(minDate) {
    // data;
    this.message = "";
    this.validity = false;
    this.minDate = minDate;

    // method
    this.validate = covMinDateValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMinDateValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMinDateValidator_validate(value) {
	if (!(new covDateValidator("YYYYMMDD").validate(value))) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_018, ["@"]);
		return false;
	}

	if (value < this.minDate) {
		var msgParams = new Array(4);
		msgParams[0] = "@";
		msgParams[1] = this.minDate.substring(0,4);
		msgParams[2] = this.minDate.substring(4,5) == "0" ? this.minDate.substring(5,6) : this.minDate.substring(4,6);
		msgParams[3] = this.minDate.substring(6,7) == "0" ? this.minDate.substring(7,8) : this.minDate.substring(6,8)
		this.message = new coMessage().getMsg(MSG_COM_ERR_025, msgParams);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covMaxDateValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'maxDate' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ÁöÁ¤µÈ ÃÖ´ë°ªÀ» ³ÑÁö ¾Ê´ÂÁö¸¦ °Ë»çÇÑ´Ù.
 * @sig    : maxDate
 * @param  : maxDate required À¯È¿ÇÑ ÃÖ´ë³¯Â¥°ª.
 * @author : ÀÓÀçÇö
 */
function covMaxDateValidator(maxDate) {
    // data;
    this.message = "";
    this.validity = false;
    this.maxDate = maxDate;

    // method
    this.validate = covMaxDateValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covMaxDateValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covMaxDateValidator_validate(value) {
	if (!(new covDateValidator("YYYYMMDD").validate(value))) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_018, ["@"]);
		return false;
	}

	if (value > this.maxDate) {
		var msgParams = new Array(4);
		msgParams[0] = "@";
		msgParams[1] = this.maxDate.substring(0,4);
		msgParams[2] = this.maxDate.substring(4,5) == "0" ? this.maxDate.substring(5,6) : this.maxDate.substring(4,6);
		msgParams[3] = this.maxDate.substring(6,7) == "0" ? this.maxDate.substring(7,8) : this.maxDate.substring(6,8)
		this.message = new coMessage().getMsg(MSG_COM_ERR_024, msgParams);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covFormatValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'format' Ç×¸ñ¿¡ ´ëÇÑ validator. °ªÀÌ ¸¶½ºÅ©·Î Ç¥ÇöµÈ Çü½Ä°ú ÀÏÄ¡ÇÏ´ÂÁö °Ë»çÇÑ´Ù.
 *             - format characters
 *               #    : ¹®ÀÚ¿Í ¼ýÀÚ
 *               h, H : ÇÑ±Û (H´Â °ø¹éÆ÷ÇÔ)
 *               A, Z : ¹®ÀÚ (Z´Â °ø¹éÆ÷ÇÔ)
 *               0, 9 : ¼ýÀÚ (9´Â °ø¹éÆ÷ÇÔ)
 * @sig    : format
 * @param  : format required Æ÷¸ä ½ºÆ®¸µ.
 * @author : ÀÓÀçÇö
 */
function covFormatValidator(format) {
    // data;
    this.message  = "";
    this.validity = false;
    this.format   = format

    // method
    this.validate = covFormatValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covFormatValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covFormatValidator_validate(value) {
	if (value.length != this.format.length) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
		return false;
	}

	for (var i = 0; i < this.format.length; i++) {
		switch(this.format.charAt(i)) {
			case 'h' :
				var cCode = value.charCodeAt(i);
				if ( (value.charAt(i) == " ") ||
				     !((0xAC00 <= cCode && cCode <= 0xD7A3) || (0x3131 <= cCode && cCode <= 0x318E))
				   ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;

			case 'H' :
				var cCode = value.charCodeAt(i);
				if ( (value.charAt(i) != " ") &&
				     !((0xAC00 <= cCode && cCode <= 0xD7A3) || (0x3131 <= cCode && cCode <= 0x318E))
				   ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;

			case '0' :
				if (isNaN(value.charAt(i)) || value.charAt(i) == " ") {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;

			case '9' :
				if (isNaN(value.charAt(i))) {
					if (value.charAt(i) != " ") {
						this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
						return false;
					}
				}
				break;

			case 'A' :
				if ( (value.charAt(i) == " ") || !isNaN(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;

			case 'Z' :
				if ( (value.charAt(i) != " ") && !isNaN(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;

			case '#' :
				break;

			default :
				if (value.charAt(i) != this.format.charAt(i)) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_026, ["@", this.format]);
					return false;
				}
				break;
		}
	}

	this.validity = true;
	return true;
}

///////////////////////////// covSsnValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'ssn' Ç×¸ñ¿¡ ´ëÇÑ validator. ÀÔ·ÂµÈ ÁÖ¹Îµî·Ï¹øÈ£°¡ À¯È¿ÇÑÁö °Ë»çÇÑ´Ù.
 * @author : ÀÓÀçÇö
 */
function covSsnValidator() {
    // data;
    this.message = "";
    this.validity = false;

    // method
    this.validate = covSsnValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covSsnValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : ssn
 * @param  : ssn required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covSsnValidator_validate(ssn) {
	if ( ssn == null || ssn.trim().length != 13 || isNaN(ssn) )  {
		this.message = new coMessage().getMsg(MSG_COM_ERR_016, ["@"]);
		return false;
	}

	var jNum1 = ssn.substr(0, 6);
	var jNum2 = ssn.substr(6);

	/*
	  Àß¸øµÈ »ý³â¿ùÀÏÀ» °Ë»çÇÕ´Ï´Ù.
	  2000³âµµºÎÅÍ ¼º±¸º° ¹øÈ£°¡ ¹Ù²î¿´½¿À¸·Î ±¸º°¼ö°¡ 2º¸´Ù ÀÛ´Ù¸é
	  1900³âµµ »ýÀÌµÇ°í 2º¸´Ù Å©´Ù¸é 2000³âµµ ÀÌ»ó»ýÀÌ µË´Ï´Ù.
	  ´Ü 1800³âµµ »ýÀº °è»ê¿¡¼­ Á¦¿ÜÇÕ´Ï´Ù.
	*/
	bYear = (jNum2.charAt(0) <= "2") ? "19" : "20";

	// ÁÖ¹Î¹øÈ£ÀÇ ¾Õ¿¡¼­ 2ÀÚ¸®¸¦ ÀÌ¾î¼­ 4ÀÚ¸®ÀÇ »ý³âÀ» ÀúÀåÇÕ´Ï´Ù.
	bYear += jNum1.substr(0, 2);

	// ´ÞÀ» ±¸ÇÕ´Ï´Ù. 1À» »«°ÍÀº ÀÚ¹Ù½ºÅ©¸³Æ®¿¡¼­´Â 1¿ùÀ» 0À¸·Î Ç¥±âÇÏ±â ¶§¹®ÀÔ´Ï´Ù.
	bMonth = jNum1.substr(2, 2) - 1;

	bDate = jNum1.substr(4, 2);

	bSum = new Date(bYear, bMonth, bDate);

	// »ý³â¿ùÀÏÀÇ Å¸´ç¼ºÀ» °Ë»çÇÏ¿© °ÅÁþÀÌ ÀÖÀ»½Ã ¿¡·¯¸Þ¼¼Áö¸¦ ³ªÅ¸³¿
	if ( bSum.getYear() % 100 != jNum1.substr(0, 2) || bSum.getMonth() != bMonth || bSum.getDate() != bDate) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_016, ["@"]);
		return false;
	}

	total = 0;
	temp = new Array(13);

	for (i = 1; i <= 6; i++) {
		temp[i] = jNum1.charAt(i-1);
	}

	for (i = 7; i <= 13; i++) {
		temp[i] = jNum2.charAt(i-7);
	}

	for (i = 1; i <= 12; i++) {
		k = i + 1;

		// °¢ ¼ö¿Í °öÇÒ ¼ö¸¦ »Ì¾Æ³À´Ï´Ù. °ö¼ö°¡ ¸¸ÀÏ 10º¸´Ù Å©°Å³ª °°´Ù¸é °è»ê½Ä¿¡ ÀÇÇØ 2·Î ´Ù½Ã ½ÃÀÛÇÏ°Ô µË´Ï´Ù.
		if(k >= 10) k = k % 10 + 2;

		// °¢ ÀÚ¸®¼ö¿Í °è»ê¼ö¸¦ °öÇÑ°ªÀ» º¯¼ö total¿¡ ´©ÀûÇÕ»ê½ÃÅµ´Ï´Ù.
		total = total + (temp[i] * k);
	}

	// ¸¶Áö¸· °è»ê½ÄÀ» º¯¼ö last_num¿¡ ´ëÀÔÇÕ´Ï´Ù.
	last_num = (11- (total % 11)) % 10;

	// laster_numÀÌ ÁÖ¹Î¹øÈ£ÀÇ¸¶Áö¸·¼ö¿Í °°Àº¸é ÂüÀ» Æ²¸®¸é °ÅÁþÀ» ¹ÝÈ¯ÇÕ´Ï´Ù.
	if(last_num != temp[13]) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_016, ["@"]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covCsnValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : 'csn' Ç×¸ñ¿¡ ´ëÇÑ validator. ÀÔ·ÂµÈ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ À¯È¿ÇÑÁö °Ë»çÇÑ´Ù.
 * @author : ÀÓÀçÇö
 */
function covCsnValidator() {
    // data;
    this.message = "";
    this.validity = false;

    // method
    this.validate = covCsnValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covCsnValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : csn
 * @param  : csn required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covCsnValidator_validate(csn) {
	if ( csn == null || csn.length != 10 || isNaN(csn) )  {
		this.message = new coMessage().getMsg(MSG_COM_ERR_017, ["@"]);
		return false;
	}

	var sum = 0;
	var nam = 0;
	var checkDigit = -1;
	var checkArray = [1,3,7,1,3,7,1,3,5];

	for(i=0 ; i < 9 ; i++)
	  sum += csn.charAt(i) * checkArray[i];

	sum = sum + ((csn.charAt(8) * 5 ) / 10);

	nam = Math.floor(sum) % 10;

	checkDigit = ( nam == 0 ) ? 0 : 10 - nam;

	if ( csn.charAt(9) != checkDigit) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_017, ["@"]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covFilterInValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : ÁöÁ¤µÈ ¹®ÀÚ ÀÌ¿Ü¿¡ ´Ù¸¥ ¹®ÀÚ°¡ µé¾îÀÖÀ» °æ¿ì À¯È¿ÇÏÁö ¾ÊÀº °ÍÀ¸·Î ÆÇ´ÜÇÑ´Ù.
 *           Æ¯Á¤ ¹®ÀÚµé¿¡ ´ëÇÑ Æ¯¼ö¹®ÀÚ°¡ ¾Æ·¡¿¡ ³ª¿ÍÀÖ´Ù.<br>
 * <pre>
 *         ;    - \;
 *         ÇÑ±Û - \h
 *         ¿µ¹® - \a
 *         ¼ýÀÚ - \n
 * </pre>
 * @sig    : fStr
 * @param  : fStr required filter¿¡ ´ëÇÑ Ç¥Çö
 * @author : ÀÓÀçÇö
 */
function covFilterInValidator(fStr) {
    // data;
    this.message = "";
    this.validity = false;
    this.fStrArr = fStr.advancedSplit(";", "i");

    for (var i = 0; i < this.fStrArr.length; i++) {
    	if (this.fStrArr[i] == "\\h") {
    		this.fStrArr[i] = "ÇÑ±Û";
    	} else if (this.fStrArr[i] == "\\a") {
    		this.fStrArr[i] = "¿µ¹®";
    	} else if (this.fStrArr[i] == "\\n") {
    		this.fStrArr[i] = "¼ýÀÚ";
    	}
    }

    // method
    this.validate = covFilterInValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covFilterInValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covFilterInValidator_validate(value) {
	var isIn = false;
	var c
	var cCode;

	for (var i = 0; i < value.length; i++) {
		isIn = false;
		c = value.charAt(i);
		cCode = value.charCodeAt(i);

		for (var j = 0; j < this.fStrArr.length; j++) {
			if (this.fStrArr[j] == "ÇÑ±Û" &&
			    ((0xAC00 <= cCode && cCode <= 0xD7A3) || (0x3131 <= cCode && cCode <= 0x318E))
			   ) {
				isIn = true;
			} else if ( this.fStrArr[j] == "¿µ¹®" &&
			            ((0x61 <= cCode && cCode <= 0x7A) || (0x41 <= cCode && cCode <= 0x5A))
			          ) {
				isIn = true;
			} else if (this.fStrArr[j] == "¼ýÀÚ" && !isNaN(c)) {
				isIn = true;
			} else if (this.fStrArr[j] == c) {
				isIn = true;
			}
		}

		if (!isIn) {
			this.message = new coMessage().getMsg(MSG_COM_ERR_036, ["@", this.fStrArr.toString()]);
			return false;
		}
	}

	this.validity = true;
	return true;
}

///////////////////////////// covFilterOutValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : ÁöÁ¤µÈ ½ºÆ®¸µµéÀÌ µé¾îÀÖÀ» °æ¿ì À¯È¿ÇÏÁö ¾ÊÀº°ÍÀ¸·Î ÆÇ´ÜÇÑ´Ù.
 *           ºÐ¸®ÀÚ´Â ";"¸¦ »ç¿ëÇÑ´Ù. ";" È¤Àº ";"¹®ÀÚ°¡ µé¾î°£ ½ºÆ®¸µÀ» ÇÊÅÍ¸µÇÏ·Á ÇÒ °æ¿ì´Â
 *           "\\;"¶ó°í Ç¥±âÇØ¾ß ÇÑ´Ù.
 * @sig    : fStr
 * @param  : fStr required filter¿¡ ´ëÇÑ Ç¥Çö
 * @author : ÀÓÀçÇö
 */
function covFilterOutValidator(fStr) {
    // data;
    this.message = "";
    this.validity = false;
    this.fStrArr = fStr.advancedSplit(";", "i");

    // method
    this.validate = covFilterOutValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covFilterValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covFilterOutValidator_validate(value) {
	for (var i = 0; i < this.fStrArr.length; i++) {
		if (value.indexOf(this.fStrArr[i]) != -1) {
			this.message = new coMessage().getMsg(MSG_COM_ERR_033, ["@", this.fStrArr.toString()]);
			return false;
		}
	}

	this.validity = true;
	return true;
}

///////////////////////////// covEmailValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : ÀÔ·Â°ªÀÌ email Çü½Ä¿¡ ÀûÇÕÇÑÁö¸¦ °Ë»çÇÑ´Ù.
 * @author : ÀÓÀçÇö
 */
function covEmailValidator() {
    // data;
    this.message = "";
    this.validity = false;

    // method
    this.validate = covEmailValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covEmailValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covEmailValidator_validate(value) {
	var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;

	if (value.search(format) == -1) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_037, ["@"]);
		return false;
	}

	this.validity = true;
	return true;
}

///////////////////////////// covDateValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : °ªÀÌ DateÇü½ÄÀÎÁö¸¦ °Ë»çÇÑ´Ù.
 *
 *            format¹®ÀÚ :  YYYY,  -> 4ÀÚ¸® ³âµµ
 *                          YY,    -> 2ÀÚ¸® ³âµµ. 2000³â ÀÌÈÄ.
 *                          MM,    -> 2ÀÚ¸® ¼ýÀÚÀÇ ´Þ.
 *                          DD,    -> 2ÀÚ¸® ¼ýÀÚÀÇ ÀÏ.
 *                          hh,    -> 2ÀÚ¸® ¼ýÀÚÀÇ ½Ã°£. 12½Ã ±âÁØ
 *                          HH,    -> 2ÀÚ¸® ¼ýÀÚÀÇ ½Ã°£. 24½Ã ±âÁØ
 *                          mm,    -> 2ÀÚ¸® ¼ýÀÚÀÇ ºÐ.
 *                          ss     -> 2ÀÚ¸® ¼ýÀÚÀÇ ÃÊ.
 *
 *            ¿¹)
 *                'YYYYMMDD' -> '20020328'
 *                'YYYY/MM/DD' -> '2002/03/28'
 *                'Today : YY-MM-DD' -> 'Today : 02-03-28'
 *
 *            Âü°í)
 *                  format¹®ÀÚ°¡ Áßº¹ÇØ¼­ ³ª¿À´õ¶óµµ Ã³À½ ³ª¿Â ¹®ÀÚ¿¡ ´ëÇØ¼­¸¸
 *                  format¹®ÀÚ·Î ÀÎ½ÄµÈ´Ù. YYYY¿Í YY, hh¿Í HH µµ Áßº¹À¸·Î º»´Ù.
 *                  ³¯Â¥´Â ³â,¿ùÀÌ Á¸ÀçÇÒ ¶§¸¸ Á¤È®È÷ Ã¼Å©ÇÏ°í ¸¸ÀÏ ³â, ¿ùÀÌ ¾ø´Ù¸é
 *                  1 ~ 31 »çÀÌÀÎÁö¸¸ Ã¼Å©ÇÑ´Ù.
 *
 * @sig    : dateExp
 * @param  : dateExp required Date Format expression.
 *             ¿¹) 2002³â 3¿ù 12ÀÏ -> "YYYY-MM-DD"(Date Format Expression) -> "2002-03-12"
 * @author : ÀÓÀçÇö
 */
function covDateValidator(dateExp) {
    // data;
    this.message = "";
    this.validity = false;
    this.dateExp = dateExp;
    this.year = null;
    this.month = null;

    // method
    this.validate = covDateValidator_validate;
    this.checkLength = covDateValidator_checkLength;
    this.checkYear = covDateValidator_checkYear;
    this.checkMonth = covDateValidator_checkMonth;
    this.checkDay = covDateValidator_checkDay;
    this.checkHour = covDateValidator_checkHour;
    this.checkMin = covDateValidator_checkMin;
    this.checkSec = covDateValidator_checkSec;
    this.checkRest = covDateValidator_checkRest;
}

/**
 * @type   : method
 * @access : public
 * @object : covDateValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value   required °Ë»ç´ë»óÀÌ µÇ´Â Date ½ºÆ®¸µ °ª.
 * @return : boolean - À¯È¿¼º ¿©ºÎ
 */
function covDateValidator_validate(value) {
	this.value = value;

	if ( this.checkLength(value) &&
		 this.checkYear(value) &&
		 this.checkMonth(value) &&
		 this.checkDay(value) &&
		 this.checkHour(value) &&
		 this.checkMin(value) &&
		 this.checkSec(value) &&
		 this.checkRest(value)
	   ) {
		this.validity = true;
		return true;
	} else {
		this.validity = false;
		return false;
	}
}

function covDateValidator_checkLength() {

	if (this.value.length == this.dateExp.length) {
		return true;
	} else {
		this.message = new coMessage().getMsg(MSG_COM_ERR_005, ["@", String(this.dateExp.length)]);
		return false;
	}
}

function covDateValidator_checkYear() {
	var index = -1;

	if ( (index = this.dateExp.indexOf("YYYY")) != -1 ) {
		subValue = this.value.substr(index, 4);
		if ( !isNaN(subValue) &&
			 (subValue > 0)
		   ) {
			this.dateExp = this.dateExp.cut(index, 4);
			this.value = this.value.cut(index, 4);
			this.year = subValue;
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_015, ["@"]);
			return false;
		}
	}

	if ( (index = this.dateExp.indexOf("YY")) != -1 ) {
		subValue = "20" + this.value.substr(index, 2);
		if ( !isNaN(subValue) &&
			 (subValue > 0)
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			this.year = subValue;
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_015, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkMonth() {
	var index = -1;

	if ( (index = this.dateExp.indexOf("MM")) != -1 ) {
		subValue = this.value.substr(index, 2);
		if ( !isNaN(subValue) &&
		     (subValue > 0) &&
		     (subValue <= 12)
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			this.month = subValue;
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_019, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkDay() {
	var index = -1;
	var days = 0;

	if ( (index = this.dateExp.indexOf("DD")) != -1 ) {
		if ( (this.year != null) && (this.month != null) ) {
			days = (this.month != 2) ? GLB_DAYS_IN_MONTH[this.month-1] : (( (this.year % 4) == 0 && (this.year % 100) != 0 || (this.year % 400) == 0 ) ? 29 : 28 );
		} else {
			days = 31;
		}

		subValue = this.value.substr(index, 2);
		if ( (!isNaN(subValue)) &&
		     (subValue > 0) &&
		     (subValue <= days)
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkHour() {
	var index = -1;

	if ( (index = this.dateExp.indexOf("hh")) != -1 ) {
		subValue = this.value.substr(index, 2);
		if ( !isNaN(subValue) &&
		     (subValue >= 0) &&
		     (subValue <= 12)
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_021, ["@"]);
			return false;
		}
	}

	if ( (index = this.dateExp.indexOf("HH")) != -1 ) {
		subValue = this.value.substr(index, 2);
		if ( !isNaN(subValue) &&
		     (subValue >= 0) &&
		     (subValue < 24)
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_021, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkMin() {
	var index = -1;

	if ( (index = this.dateExp.indexOf("mm")) != -1 ) {
		subValue = this.value.substr(index, 2);
		if ( !isNaN(subValue) &&
		     (subValue >= 0) &&
		     (subValue < 60 )
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			this.month = subValue;
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_022, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkSec() {
	var index = -1;

	if ( (index = this.dateExp.indexOf("ss")) != -1 ) {
		subValue = this.value.substr(index, 2);
		if ( (!isNaN(subValue)) &&
		     (subValue >= 0) &&
		     (subValue < 60 )
		   ) {
			this.dateExp = this.dateExp.cut(index, 2);
			this.value = this.value.cut(index, 2);
			this.month = subValue;
			return true;
		} else {
			this.message = new coMessage().getMsg(MSG_COM_ERR_023, ["@"]);
			return false;
		}
	}

	return true;
}

function covDateValidator_checkRest() {
	if (this.value == this.dateExp) {
		return true;
	}

	return false;
}


///////////////////////////// covNullValidator /////////////////////////////
/**
 * @type   : object
 * @access : private
 * @desc   : ¹«Á¶°Ç validÇÑ °á°ú¸¦ °¡Áø validator.
 * @author : ÀÓÀçÇö
 */
function covNullValidator() {
    // data;
    this.message = "";
    this.validity = true;

    // method
    this.validate = covNullValidator_validate;
}

/**
 * @type   : method
 * @access : public
 * @object : covNullValidator
 * @desc   : validationÀ» ¼öÇàÇÑ´Ù.
 * @return : boolean - ¹«Á¶°Ç true.
 */
function covNullValidator_validate() {
	this.message = new coMessage().getMsg(MSG_COM_INF_007);
	return true;
}




function setEMEditValue (sEditName, EMEditValue) {
	eval(sEditName).text = EMEditValue;
}




/**
 * @type   : function
 * @access : public
 * @desc   : ¸ð´Þ ÆË¾÷À» ¶ì¿î´Ù.
 * @sig    : url[,width][,height][,parameter]
 * @param	 :	sURL		url
 * @param	 :	sWidth		window width(optional)
 * @param	 :	sHeight		window height(optional)
 * @param	 :	vArguments	passed Arguments(optional)
 * <pre>
 * ex) openModalPopup('popup_test1.htm')
 *     openModalPopup('popup_test1.htm','600','400','aaa')
 *     openModalPopup('popup_test1.htm','600','400','aaa','bbb','ccc')
 * </pre>
 * @return :	window object
 * @author :
 */

function openModalPopup (sURL) {
	var sWidth, sHeight;
	var sFeatures;
	var oWindow;
	var vArguments = new Array();

	sHeight	= 200 + "px";
	sWidth	= 200 + "px";

  // ÆË¾÷»çÀÌÁî¿¡ ´ëÇÑ ¾Æ±Ô¸ÕÆ®¸¦ ÀÔ·ÂÇß´Ù¸é ±× »çÀÌÁî·Î ¹Ù²ãÁØ´Ù.
	if (arguments[1] != null && arguments[1] != "") sWidth = arguments[1] + "px" ;
	if (arguments[2] != null && arguments[2] != "") sHeight = arguments[2] + "px" ;


	// ¸ÞÀÎ ÆäÀÌÁöÀÎ °æ¿ì Ã¹¹øÂ° ÆÄ¶ó¹ÌÅÍ´Â À©µµ¿ì°´Ã¼, ÆË¾÷ÀÎ °æ¿ì È£ÃâÀÎÀÚÀÇ Ã¹¹øÂ° ÆÄ¶ó¹ÌÅÍ

	if (B_MAIN_PAGE)
		vArguments[0] = window;
	else {
		vArguments[0] = window.dialogArguments[0];
		}


	// ÆË¾÷È£Ãâ½Ã ÆÄ¶ó¹ÌÅÍ´Â [1]¹øÂ°ºÎÅÍ
	for (var i=3; i<arguments.length; i++) {
		vArguments[i-2] = arguments[i] ;
	}

	sFeatures =  "dialogWidth:" + sWidth + "; dialogHeight:" + sHeight ;
	sFeatures += ";center:yes;resizable:no;scroll:no;status:no";

	oWindow = window.showModalDialog(sURL, vArguments, sFeatures);

	return oWindow;
}


/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·ÂÅØ½ºÆ® ¹Ú½º¿¡ ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô ÇÑ´Ù.
 * @sig    :
 * @param  : ÀÌº¥Æ®ÄÚµå
 * <pre>
 *     onkeypress="javascript:cfNumberOnly()";
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô ÇÑ´Ù.
 * </pre>
 * @return :
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfNumberOnly() {
	var lkeycode = window.event.keyCode;
	var sOrg = String.fromCharCode(lkeycode);

  	if(!sOrg.match(/^[\d|\.]/))			// New Code
		window.event.keyCode = 0;
//	if  (lkeycode < 48 || lkeycode > 57)
//		window.event.keyCode = 0;
}


/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·ÂÅØ½ºÆ® ¹Ú½º¿¡ ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·Â.
 * @sig    :
 * @param  : ÀÌº¥Æ®ÄÚµå
 * <pre>
 *     onkeypress="javascript:cfAlpaNumberOnly();"
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·Â.
 * </pre>
 * @return :
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfAlpaNumberOnly() {

	var lkeycode = window.event.keyCode;
	var sOrg = String.fromCharCode(lkeycode);
	//alert ( sOrg ) ;
	//alert ( "lkeycode:" + lkeycode + ";sOrg" + sOrg ) ;


	if  ( lkeycode < 48 )
	{
		window.event.keyCode = 0;
	} else if ( lkeycode >= 48 && lkeycode <= 57 )
	{
		// Åë°ú
	} else if ( lkeycode > 57 && lkeycode < 65 )
	{
		window.event.keyCode = 0;
	} else if ( lkeycode >= 65 && lkeycode <= 90 )
	{
		// Åë°ú
	} else if ( lkeycode > 90 && lkeycode < 97 )
	{
		window.event.keyCode = 0;
	} else if ( lkeycode >= 97 && lkeycode <= 122 )
	{
		// Åë°ú
	} else
	{
		window.event.keyCode = 0;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·Â°ªÀÌ ¿µ¹®°ú ¼ýÀÚÀÎÁö Ã¼Å©
 * @sig    :
 * @param  : ¹®ÀÚ¿­
 * <pre>
 *     onkeypress="javascript:cfNoHangul("123");"
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¿µ¹®°ú ¼ýÀÚÀÎÁö Ã¼Å©
 * </pre>
 * @return : Ä¡È¯µÈ ¹®ÀÚ¿­ ½ºÆ®¸µ
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfNoHangul(sOrg) {
	var AlphaDigit;
	var IDLength;
	var NumberChar, CompChar;
	var ChkFlag;

	AlphaDigit= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	IDLength = sOrg.length;

	for (i = 0; i < IDLength; i++) {
		NumberChar = sOrg.charAt(i);
 		ChkFlag = false;
 		for (j = 0; j < AlphaDigit.length ; j++) {
    		CompChar = AlphaDigit.charAt(j);
   			if (NumberChar.toLowerCase() == CompChar.toLowerCase()){
      			ChkFlag = true;
   			}
 		}
   		if (ChkFlag == false) return false;
	}
	return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : Æ¯¼ö ¹®ÀÚÀÇ »ç¿ëÀ» ¸·´Â´Ù.
 * @sig    :
 * @param  : ¹®ÀÚ¿­
 * <pre>
 *     cfNoSpecialChar("123");"
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¿µ¹®°ú ¼ýÀÚÀÎÁö Ã¼Å©
 * </pre>
 * @return : Ä¡È¯µÈ ¹®ÀÚ¿­ ½ºÆ®¸µ
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfNoSpecialChar(sOrg) {
	var AlphaDigit;
	var IDLength;
	var NumberChar, CompChar;
	var ChkFlag;

	AlphaDigit= "'<>!@#$%^&*" + '"';

	IDLength = sOrg.length;

	for (i = 0; i < IDLength; i++) {
		NumberChar = sOrg.charAt(i);
 		ChkFlag = true;
 		for (j = 0; j < AlphaDigit.length ; j++) {
    		CompChar = AlphaDigit.charAt(j);
   			if (NumberChar.toLowerCase() == CompChar.toLowerCase()){
      			ChkFlag = false;
   			}
 		}
   		if (ChkFlag == false) return false;
	}
	return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : 1000 ´ÜÀ§ ¸¶´Ù ÄÄ¸¶(,) Âï¾îÁØ´Ù.
 * @sig    :
 * @param  : ¿ÀºêÁ§Æ® id
 * <pre>
 *     cfComma1000(object_id);"
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì 1000 ´ÜÀ§ ¸¶´Ù ÄÄ¸¶(,) Âï¾îÁØ´Ù.
 * </pre>
 * @return :
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfComma1000(obj1) {

	var sOrg = eval(obj1).value.trim() ;

	if(isNaN(sOrg) || sOrg.length==0) return "";

  	var sRetVal 		= "";
  	var sTmpVal			= "";
  	var sFractionVal	= "";

 	sOrg = sOrg.toString();
 	sOrg = sOrg.replace(/,/g,"");

  	var lLengh = sOrg.search(/\./);

  	if (lLengh<0) {
  		lLengh = sOrg.length;
  	}
  	else
  		sFractionVal = sOrg.substr(lLengh);

  	lLengh		= lLengh;
  	var lRemainder 	= lLengh % 3;

	if (lRemainder == 0 && lLengh > 0)
		lRemainder	= 3;

	sRetVal	= sOrg.substr(0,lRemainder);

  	while(lRemainder < lLengh) {
  		sTmpVal = sTmpVal + "," + sOrg.substr(lRemainder,3);
  		lRemainder 	+= 3;
  	}
  	sRetVal	= sRetVal + sTmpVal + sFractionVal;

	eval(obj1).value = sRetVal ;
}


/**
 * @type   : function
 * @access : public
 * @desc   : ¼Ò¼öÁ¡À» Âï¾îÁØ´Ù.
 * @sig    :
 * @param  : ¹®ÀÚ¿­, Á¤¹Ðµµ(¼Ò¼öÁ¡ÀÌÇÏ ÀÚ¸®¼ö)
 * <pre>
 *     cfNumeric(value);"
 *      ¼Ò¼öÁ¡À» Âï¾îÁØ´Ù.
 * </pre>
 * @return : Ä¡È¯µÈ ¹®ÀÚ¿­ ½ºÆ®¸µ
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfFractionFormat(sOrg, iSize) {
	if(isNaN(sOrg) || sOrg.length==0) return "";
	if(parseInt(iSize)<0) return sOrg;

	var nm;
 	sOrg		= sOrg.replace(/,/g,"");

	var nm = parseFloat(sOrg);
	var sZero = '';
	var iTen;

	for(var i=1; i <= iSize; i++) { sZero += '0';}

	iTen = parseInt(1 + sZero);

	nm = (Math.round(nm*iTen)/iTen).toString();
	p = nm.search(/\./);

	return (p>=0)?(nm+sZero).substr(0,p+iSize+1):(iSize==0)?nm:nm+"." + sZero;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·ÂÅØ½ºÆ® ¹Ú½º¿¡ ÀüÈ­¹øÈ£ÀÔ·Â(¼ýÀÚ¿Í '-' ¸¸ Çã¿ë) , °èÁÂ¹øÈ£µµ
 * @sig    :
 * @param  : ÀÌº¥Æ®ÄÚµå
 * <pre>
 *     onkeypress="javascript:cfPhoneNumberOnly();"
 *     À§¿Í°°ÀÌ »ç¿ëÇßÀ» °æ¿ì ¼ýÀÚ¿Í '-' ¸¸ Çã¿ë
 * </pre>
 * @return :
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfPhoneNumberOnly() {

	var lkeycode = window.event.keyCode;
	var sOrg = String.fromCharCode(lkeycode);
	//alert ( sOrg ) ;
	//alert ( "lkeycode:" + lkeycode + ";sOrg" + sOrg ) ;

	if  ( lkeycode == 45 )
	{
		// Åë°ú ( '-')
	} else if ( lkeycode >= 48 && lkeycode <= 57 )
	{
		// Åë°ú (¼ýÀÚ)
	} else
	{
		window.event.keyCode = 0;
	}

}


/**
 * @type   : function
 * @access : public
 * @desc   : ÄÄ¸¶¸¦ ¾ø¾Ø ¼ýÀÚ¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @sig    :
 * @param  : ¹®ÀÚ¿­
 * <pre>
 *     cfNumeric(value);"
 *     ÄÄ¸¶(,)¸¦ ¾ø¾Ø ¼ýÀÚ¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * </pre>
 * @return : Ä¡È¯µÈ ¹®ÀÚ¿­ ½ºÆ®¸µ
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfNumeric(sOrg) {
	var nm;
	sOrg = sOrg.replace(/,/g,"");
	nm = parseFloat(sOrg).toString();
	return (isNaN(nm)?0:nm);
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·ÂµÈ datasetÀÌ C,U,D ÀÛ¾÷ÀÌ ÀÖ¾úÀ¸¸é confirm Ã¢À» ¶ì¿ì°í ±× °á°ú¸¦ return ÇÑ´Ù.
 * @sig    : DataSetArray
 * @param  :
 * <pre>
 *     cfIsCUD([dataset1,dataset2 ]);"
 * </pre>
 * @return : confirm °á°ú
 * @author : ¿ÕÁ¤ÀÏ
 */

 function cfIsCUD(dataSetArray) {


   var rFlag = true;


   for ( i = 0 ; i < dataSetArray.length ; i++)
   {
   	     var str =   dataSetArray[i].Text;
			   var strArray = str.advancedSplit("\n", "i");

			   for (j = 1 ; j < strArray.length-1 ; j++)
			   {
			       var tempArray = strArray[j].advancedSplit(",", "i");

			       if ( tempArray[0] == "I" || tempArray[0] == "D" || tempArray[0] == "U" )
			       rFlag = false;

			   }
   }

   if (rFlag == false)
   return cfConfirmMsg(MSG_COM_ERR_064);
   else true;

 }

/**
 * @type   : function
 * @access : public
 * @desc   : ÁöÁ¤µÈ textbox¿¡ ÀÔ·ÂÇÑ ÀÚ¸®¼ö ÀÌ»óÀ¸·Î ÀÔ·ÂÀ» ÇÏ¸é ´ÙÀ½ obj·Î Æ÷Ä¿½º¸¦ ÀÌµ¿ÇÑ´Ù.
 * @sig    : obj1, len, obj2
 * @param  : ±æÀÌ Ã¼Å©¸¦ ÇÒ obj
 * @param  : ±æÀÌ
 * @param  : Æ÷Ä¿½Ì µÉ obj
 * <pre>
 *     autotab(obj1, 6, obj2);"
 * </pre>
 * @return : void
 * @author : ¼­Áø¿µ
 */
function autotab ( obj1,len, obj2 )
{
    if(eval(obj1).value.length >= len )
    {
      eval(obj2 ).focus() ;
    }
}


/**
 * @type   : function
 * @access : public
 * @desc   : ³¯Â¥°ªÀ» °¡Áö°í ÀÖ´Â emeditÀÇ °ªÀ» ºñ±³ÇØ¼­ ½ÃÀÛÀÏÀÌ ¸¶°¨ÀÏº¸´Ù Å©¸é false¸¦ ¸®ÅÏÇÑ´Ù.
 *           µÎ°ªÀÌ ¸ðµÎ ÀÖÀ»¶§¿¡¸¸ ºñ±³¸¦ ÇÏ°í µÑÁßÇÏ³ª¿¡¸¸ °ªÀÌ µé¾î ÀÖÀ»°æ¿ì true¸¦ ¸®ÅÏÇÑ´Ù.
 * @sig    : from_dt,to_dt, msg1, msg2
 * @param  : ½ÃÀÛÀÏÀ» ´ãÀº gauce emedit °´Ã¼
 * @param  : ¸¶°¨ÀÏ ´ãÀº gauce emedit °´Ã¼
 * @param  : ½ÃÀÛÀÏ°ú ¸ÅÄªµÇ´Â ¸Þ½ÃÁö
 * @param  : ¸¶°¨ÀÏ°ú ¸ÅÄªµÇ´Â ¸Þ½ÃÁö
 * <pre>
 *     cfCheckFromTo(from_dt,to_dt, msg1, msg2)
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */

function cfCheckFromTo(from_dt,to_dt, msg1, msg2){

 if(from_dt.Text.trim() == "" && to_dt.Text.trim() == "")return true;
 if(from_dt.Text.trim() == "" && to_dt.Text.trim() != "")return true;
 if(from_dt.Text.trim() != "" && to_dt.Text.trim() == "")return true;

 if(!cfValidateValue(from_dt.Text.trim(), "maxNumber=" + to_dt.Text.trim())) {
   cfAlertMsg(MSG_COM_ERR_048,[msg1,msg2]);

   from_dt.Text="";
   from_dt.focus();
   return false;
 }
  return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : »ç¿ø °Ë»ö ÆË¾÷À» ¶ì¿î´Ù.
 * @sig    : obj1, obj2, obj3, obj4
 * @param  : »ç¹øÀÌ µé¾î°¥ object ¸í
 * @param  : »ç¿ø¸íÀÌ µé¾î°¥ object ¸í
 * @param  : ºÎ¼­ÄÚµå°¡ µé¾î°¥ object ¸í
 * @param  : ºÎ¼­¸íÀÌ µé¾î°¥ object ¸í
 * @param  : ºÎ¼­¸í °ª
 * @param  : ÀÚµ¿ °Ë»ö ¿©ºÎ
 * <pre>
 *     cfEmpListPop('oEmpId','oEmpNm')
 *     cfEmpListPop('oEmpId','oEmpNm','oDeptCd','oDeptNm','°æ¿µÁö¿ø´ã´ç',true)
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfEmpListPop(obj1, obj2, obj3, obj4, deptNm, autoSearch) {

    var returnValue = openModalPopup('/' + DOC_ROOT + '/cdauth/cd/EmpListP.jsp','565','480', deptNm, autoSearch);


    if (returnValue != null ) {
	      eval(obj1).value = returnValue[0];
	      eval(obj2).value = returnValue[1];

          if (eval(obj3) != null)
              eval(obj3).value = returnValue[2];
	      if (eval(obj4) != null)
	          eval(obj4).value = returnValue[3];
    }
}


/**
 * @type   : function
 * @access : public
 * @desc   : °¢Á¾ code °Ë»ö ÆË¾÷ ÇÔ¼ö ³»¿¡¼­ ¾²ÀÎ´Ù.
 * @sig    : °Ë»ö type, obj1, obj2, param, param, obj3
 * @param  : ÆË¾÷ Å¸ÀÔ
 * @param  : id object
 * @param  : name object
 * @param  : Ãß°¡ parameter
 * @param  : Ãß°¡ parameter
 * @param  : ÀÚµ¿ °Ë»ö ¿©ºÎ ÀÚµ¿ ÀüÃ¼ Á¶È¸ ¼³Á¤ ,Y : ÀüÃ¼ °Ë»ö , ÀÔ·Â°ªÀÌ ¾ø°Å³ª N ÀÌ¸é ÀüÃ¼ °Ë»ö ¾ÈÇÔ.
 * @param  : obj3
 * @param  : obj4
 * @param  : fncName ÆË¾÷ÀÌ ¼öÇàµÈÈÄ ½ÇÇàÇØ¾ßÇÒ  function name
 * <pre>
 *
 * "DEPT"           ºÎ¼­ °Ë»ö
 * "BRCH"           Áö»ç °Ë»ö
 * "DSTINCD"        ±¸ºÐÄÚµå                     , param¿¡ ±¸ºÐÄÚµå±×·ì ÀÔ·Â ÇÊ¿ä
 *
 * ex) cfComCdPop('DEPT', 'oDeptCd', 'oDeptNm' )
 * ex) cfComCdPop('BRCH', 'oBrchCd', 'oBrchNm', oBrchCd.value, '', 'Y', 'oUpBrchCd', 'oUpBrchNm')
 *
 * </pre>
 * @return : void
 * @author : Á¤¿¬ÁÖ
 */
function cfComCdPop(type, obj1, obj2, param, param2, autoSearch, obj3, obj4, fncName){

    var vReturnValue;

    if (type == "DEPT") {

        vReturnValue = openModalPopup('/' + DOC_ROOT + '/cdauth/cd/DeptListP.jsp','565','480', param, autoSearch );

    } else if (type == "BRCH") {

        vReturnValue = openModalPopup('/' + DOC_ROOT + '/cdauth/cd/BrchListP.jsp','565','480', param, autoSearch );

    } else if (type == "DSTINCD") {

        vReturnValue = openModalPopup('/' + DOC_ROOT + '/cdauth/cd/ComCdListP.jsp','565','480', param, param2, autoSearch );

    }

    if (vReturnValue != null ) {

        eval(obj1).value = vReturnValue[0];
        eval(obj2).value = vReturnValue[1];

        if (eval(obj3) != null ) {

            eval(obj3).value = (vReturnValue[2] == null) ? "":vReturnValue[2];
        }
        if (eval(obj4) != null ) {

            eval(obj4).value = (vReturnValue[3] == null) ? "":vReturnValue[3];
        }

    }

    // ´ÙÀ½¿¡ Á¶È¸ÈÄ ¼öÇàÇÒ  functionÀÌ ÀÖÀ¸¸é function À» ¼öÇàÇÑ´Ù.
    if ( fncName !=null && fncName !="") {

        eval(fncName)();

    }

}


/**
 * @type   : function
 * @access : public
 * @desc   : °¢Á¾ code onblur ÀÌº¥Æ® ¹ß»ý½Ã ÄÚµå °ª¿¡ ÇØ´çÇÏ´Â cd¿Í nm À» ÁöÁ¤ÇÑ obj¿¡ ÇÒ´çÇÑ´Ù.
 * @sig    : °Ë»ö type, obj1, obj2, param, fncName
 * @param  : °Ë»ö Å¸ÀÔ
 * @param  : id object
 * @param  : name object
 * @param  : Ãß°¡ parameter
 * @param  : ÀÚµ¿Á¶È¸ÈÄ ½ÇÇàÇÒ function
 * <pre>
 *
 * "DEPT"           ºÎ¼­ °Ë»ö
 * "BRCH"           Áö»ç °Ë»ö
 * "DSTINGRP"       ±¸ºÐÄÚµå±×·ì
 * "DSTINCD"        ±¸ºÐÄÚµå
 *
 * ex) cfComCdSearch('DEPT', 'oDeptCd', 'oDeptNm' );
 * ex) cfComCdSearch('DSTINCD', 'oDstinCd', 'oDstinCdNm', '01');
 *
 * </pre>
 * @return : void
 * @author : Á¤¿¬ÁÖ
 */

function cfComCdSearch(type, obj1, obj2, param, fncName) {
    // ÀÓ½Ã·Î Data¸¦ ÀúÀåÇÒ DataSetÀ» ÁöÁ¤
	var dataSet;
	// dataset ¸íÄª
	var dsId = "ComCdGDS";

	if (document.all(dsId) == null) {

      	dataSet = document.createElement("<OBJECT>");
      	dataSet.classid = "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49";
      	dataSet.id = dsId;
        dataSet.SyncLoad = "true";

      	// </head> ÅÂ±× Á÷Àü¿¡ DataSet »ðÀÔ
      	for (var i = 0; i < document.all.length; i++) {
        	if (document.all[i].tagName == "HEAD") {
      			document.all[i].insertAdjacentElement("beforeEnd", dataSet);
      			break;
      		}
      	}
	} else {
		dataSet = document.all(dsId);
	}

    dataSet.DataID = "/" + DOC_ROOT + "/ComCdR.pcg" + "?id=" + eval(obj1).value + "&param=" + param + "&type=" + type;
    dataSet.Reset();

    if (dataSet.CountRow == 1) {

        eval(obj1).value = dataSet.NameValue(1,"id");
        eval(obj2).value = dataSet.NameValue(1,"nm");

    } else {

        eval(obj1).value ="";
        eval(obj2).value ="";

    }

    // ´ÙÀ½¿¡ Á¶È¸ÈÄ ¼öÇàÇÒ  functionÀÌ ÀÖÀ¸¸é function À» ¼öÇàÇÑ´Ù.
    if ( fncName !=null && fncName !="") {

        eval(fncName)();

    }
}

/**
 * @type   : function
 * @access : public
 * @desc   : °¢Á¾ ÄÚµå¿Í  NameÀ» Á¶È¸ÇÏ¿© LuxeCombo¸¦ »ý¼ºÇÑ´Ù.
 * @sig    : type, dsId, comboId, param, searchType
 * @param  : °Ë»ö Å¸ÀÔ
 * @param  : »ý¼ºÇÒ dataSet Id
 * @param  : dataSet°ú ¿¬°áÇÒ LuxeCombo Id
 * @param  : Ãß°¡ parameter
 * @param  : Á¶È¸¿ë,ÀÔ·Â¿ë  1 : ÀÔ·Â¿ë(ÀüÃ¼ option ¾øÀ½),  2 : Á¶È¸¿ë(ÀüÃ¼ option Ãß°¡)
 * <pre>
 *
 * "DEPT"           ºÎ¼­ °Ë»ö
 * "BRCH"           Áö»ç °Ë»ö
 * "DSTINGRP"       ±¸ºÐÄÚµå±×·ì
 * "DSTINCD"        ±¸ºÐÄÚµå
 *
 * ex) cfRestComCdGDS('DEPT', 'temp', 'oCommCd')
 * ex) cfRestComCdGDS('DEPT', 'temp', 'oCommCd', '', 2 )
 *
 * </pre>
 * @return : void
 * @author : Á¤¿¬ÁÖ
 */
function cfRestComCdGDS(type, dsId, comboId, param, searchType ) {

  // ÀÓ½Ã·Î Data¸¦ ÀúÀåÇÒ DataSetÀ» ÁöÁ¤
	var dataSet;

	if (document.all(dsId) == null) {
  	    dataSet = document.createElement("<OBJECT>");
  	    dataSet.classid = "CLSID:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49";
  	    dataSet.id = dsId;
  	    dataSet.SyncLoad = "true";

  	    // </head> ÅÂ±× Á÷Àü¿¡ DataSet »ðÀÔ
  	    for (var i = 0; i < document.all.length; i++) {
  	    	if (document.all[i].tagName == "HEAD") {
  	    		document.all[i].insertAdjacentElement("beforeEnd", dataSet);
  	    		break;
  	    	}
  	    }
	} else {
		dataSet = document.all(dsId);
	}

    dataSet.SortExpr = "+sortOrder+printSeqno";
    eval(comboId).ComboDataID = dsId;
    dataSet.DataID = "/" + DOC_ROOT + "/ComCd2ListR.pcg" + "?param=" + param + "&type=" + type;
    dataSet.Reset();

    // Á¶È¸¿ëÀÌ¸é ÀüÃ¼ optionÀ» Ãß°¡ÇÑ´Ù.
    if( searchType == 2 ){
        cfAddOption( dataSet, "cd", "", "nm", "ÀüÃ¼" );
        eval(comboId).Index = 0;
    }
}


/**
 * @type   : function
 * @access : public
 * @desc   : ¿ìÆí¹øÈ£¿Í 1Â÷ ÁÖ¼Ò¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @sig    : obj1, obj2
 * @param  : ¿ìÆí¹øÈ£¸¦ ¹ÞÀ» obj
 * @param  : 1Â÷ ÁÖ¼Ò¸¦ ¹ÞÀ» obj
 * @param  : ½Ã,µµ ¸¦ ¹ÞÀ» obj
 * @param  : ½Ã,±º,±¸ ¸¦ ¹ÞÀ» obj
 * @param  : À¾, ¸é, µ¿ À» ¹ÞÀ» obj
 * @param  : ¾ÆÆÄÆ®, ºôµù, ¸® ¹ÞÀ» obj
 * <pre>
 *     cfZipCdPop('oZipCd', 'oAddr')
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfZipCdPop(obj1, obj2, obj3, obj4, obj5, obj6) {
  var returnValue = openModalPopup('/' + DOC_ROOT + '/cdauth/cd/ZipCdP.jsp','505','400');

  if (returnValue != null )
  {
	  if(eval(obj1) != null){
		  eval(obj1).Text = returnValue[0];
		  eval(obj2).value = returnValue[1];
	  }

	  if (eval(obj3) != null )
      eval(obj3).value = returnValue[2];

	  if (eval(obj4) != null )
      eval(obj4).value = returnValue[3];

	  if (eval(obj5) != null )
      eval(obj5).value = returnValue[4];

	  if (eval(obj6) != null )
      eval(obj6).value = returnValue[5];
  }
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·Â Æû Áß¿¡¼­ ÇÏ³ª ÀÌ»óÀÇ °ªÀÌ Á¸ÀçÇÏ´ÂÁö °Ë»ç
 *			 °´Ã¼ÀÇ name ¼Ó¼ºÀ» ÂüÁ¶ÇÏ¸ç, <input type=text> ¿¡ ÇÑÇÑ´Ù.
 *
 * @sig    :
 * @param  : Ã¼Å©ÇÏ°íÀÚ ÇÏ´Â ÀÔ·Â Æû IDs
 * <pre>
 *     cfExistValues('oZipCd', oAddr)
 * </pre>
 * @return : Boolean
 * @author : Á¤ÈÆ±Ô
 */
function cfExistValues(){
    var isOk=false;
    var i = 0;
    var arrName = "";
    var oId;

    if(!arguments.length) return true;

    while(arguments[i]){
        oId = eval(arguments[i++]);
        if(!cfIsNull(oId.value)) {
            isOk = true;
            break;
        }
        arrName += "["+oId.name + "] ";
    }

    if(!isOk) {
        cfAlertMsg(MSG_COM_ERR_067, [arrName]);		// ÁßÀÇ ÇÏ³ª´Â ¹Ýµå½Ã ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.
        eval(arguments[0]).focus();
    }

    return isOk;
}

/**
 * @type   : function
 * @access : public
 * @desc   : Á¶È¸Á¶°Ç Æû¿¡ EnterKey ÀÌº¥Æ®¸¦ ºÎ¿©
 *			 <input type=text>, emedit ¿¡ ÇÑÇÑ´Ù.
 *
 * @sig    :
 * @param  : ÀÌº¥Æ® ¹ß»ý½Ã ¼öÇàÇÒ function ¸í, ¹ÌÀÔ·Â½Ã fncRetrieve ·Î ¼³Á¤µÊ
 * @param  : Æ¯Á¤ function¿¡ ÇØ´çÇÏ´Â event¸¦ ÁÙ object ÀÇ array
 * <pre>
 *     cfSetEvent(fnc)
 *     cfSetEvent(fnc, ['sId', 'sNm'])
 * </pre>
 * @return :
 * @author : Á¤ÈÆ±Ô, ¼öÁ¤ ¿ÕÁ¤ÀÏ (emedit µ¿Àû event handler Ãß°¡ )
 */
function cfSetEvent(fnc,features){
	try{
		if(fnc == null || fnc == undefined) fnc = fncRetrieve;

		var allId= document.all;
		var len = allId.length;
		var emeditEventHandlers = new Array();

		if(features == null || features == undefined) {

    		for(var i=0;i < len; i++){

	            switch (cfGetElementType(allId[i])) {
            		case "TEXT" :
            		case "HIDDEN" :
            		case "PASSWORD" :
            		case "SUBMIT" :
            		case "RESET" :
        			    if((allId[i].id.charAt(0) == 's')) allId[i].onkeydown = function (){if(event.keyCode == 13) fnc()};
        			    break;
        			case "GE" :

        			    if((allId[i].id.charAt(0) == 's')) {
                            // event handler Á¤ÀÇ
                            str = "<script DEFER language=JavaScript for=" + allId[i].id + " event=onKeyDown(kcode,scode)>" +
                                  "if (kcode == 13) " +  fnc.toString().substring(fnc.toString().indexOf('{')) +
                                  "</script> ";
                            // Á¤ÀÇµÈ event handler¸¦ handler array¿¡ Ãß°¡
                            emeditEventHandlers.push(str);
                        }
        			    break;
            		default :
            			break;
        	    }

    		}
		} else {

    		for(var i=0;i < len; i++){
    		    for ( j = 0 ; j < features.length; j++) {
                    if(allId[i].id.indexOf(features[j]) != -1) {
                        switch (cfGetElementType(allId[i])) {
                    		case "TEXT" :
                    		case "HIDDEN" :
                    		case "PASSWORD" :
                    		case "SUBMIT" :
                    		case "RESET" :
                			    allId[i].onkeydown = function (){if(event.keyCode == 13) fnc()};
                			    break;
                			case "GE" :
        			            if((allId[i].id.charAt(0) == 's')) {
                                    // event handler Á¤ÀÇ
                                    str = "<script DEFER language=JavaScript for=" + allId[i].id + " event=onKeyDown(kcode,scode)>" +
                                          "if (kcode == 13) " +  fnc.toString().substring(fnc.toString().indexOf('{')) +
                                          "</script> ";
                                    // Á¤ÀÇµÈ event handler¸¦ handler array¿¡ Ãß°¡
                                    emeditEventHandlers.push(str);
                                }
                			    break;
                    		default :
                    			break;
                	    }

            	    }
    			}
    		}
        }


        var headElement;
        // emedit handler°¡ ÀÖ´Ù¸é tag ¸íÀÌ headÀÎ element¸¦ ±¸ÇÑ´Ù.
        if (emeditEventHandlers.length > 0 ) {
      	    for (var j = 0; j < document.all.length; j++) {
      	    	if (document.all[j].tagName == "HEAD") {
                    headElement = document.all[j]
      	    	    break;
      	    	}
      	    }
  	    }

        // head tagÀÇ ³¡¿¡ emedit handler¸¦ Ãß°¡ÇÑ´Ù.
  	    for (var i =0 ; i < emeditEventHandlers.length ; i++ ) {
  	        headElement.insertAdjacentHTML('beforeEnd','<input type=hidden>'+emeditEventHandlers[i]);
  	    }

	}catch(e){}


}

/**
 * @type   : function
 * @access : public
 * @desc   : ÆË¾÷ÀÌ ¿ÀÇÂµÉ¶§ job_typeÀ» ºÐ¼®ÇØ¼­ Ä«Å×ÄÚ¸® Text¸¦ ¼³Á¤ÇÑ´Ù.
 *
 * @sig    :
 * @param  : dialogArgument·Î ¹ÞÀº job_type
 * @param  : Ãâ·ÂÇÏ°íÀÚ ÇÏ´Â À§Ä¡
 * <pre>
 *     cfSetCtg(JOB_INSERT), cfSetCtg(JOB_UPDATE, oCtg);
 * </pre>
 * @return :
 * @author : Á¤ÈÆ±Ô
 */
function cfSetCtg(aJobType, aWhere){
	var oWhere = (aWhere == null)?oCtg:aWhere;

	if(aJobType==JOB_INSERT) oWhere.innerText = "µî·Ï";
	else if(aJobType==JOB_UPDATE) oWhere.innerText = "»ó¼¼Á¶È¸/¼öÁ¤";
}



/**
 * @type   : function
 * @access : public
 * @desc   : Loading È­¸éÀ» È­¸é¿¡ ¶ì¿î´Ù.
 * @sig    : iFrameId, posx, posy
 * @param  : iFrameID
 * @param  : x À§Ä¡
 * @param  : y À§Ä¡
 * <pre>
 *    cfStartLoading('LowerFrame')
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfStartLoading(iFrameId, posx, posy ) {

    var x;
    var y;

    if (posx == null && posx == null) {

        x = document.body.clientWidth/2 + document.body.scrollLeft - 145;
        y = document.body.clientHeight/2 + document.body.scrollTop - 44;

    } else {

        x = posx;
        y = posy;
    }


    document.getElementById(iFrameId).style.posLeft=x;
    document.getElementById(iFrameId).style.posTop=y;

    //ÇØ´ç DataSetÀº ¹Ýµå½Ã SyncLoad°¡ false¿©¾ßÇÑ´Ù.

    document.getElementById(iFrameId).style.display = "";

}

/**
 * @type   : function
 * @access : public
 * @desc   : Loading È­¸éÀ» ¾ø¾Ø´Ù.
 * @sig    : iFrameId
 * @param  : iFrameID
 * <pre>
 *    cfEndLoading('LowerFrame')
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfEndLoading(iFrameId) {

    document.getElementById(iFrameId).style.display = "none";
}

/**
 * @type   : function
 * @access : public
 * @desc   : body ÅÂ±× ³¡¿¡ iframe À» µî·ÏÇÑ´Ù.
 * @sig    : iFrameID
 * @param  : iFrameID
 * <pre>
 *    cfSetLoadFrame('LowerFrame')
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfSetLoadFrame(iFrameId) {

    var vFrameId;

    if(iFrameId !=null) {
        vFrameId = iFrameId;
    } else vFrameId = 'LowerFrame';

	if(document.all(vFrameId)!=null) return;	//Á¤ÈÆ±Ô Ãß°¡, fncOnload()¸¦ µÎ¹ø ÀÌ»ó È£ÃâÇÒ °æ¿ì°¡ ÀÖÀ½..

    var vInFrame = '<iframe id="'+vFrameId+ '" style="display:none; position:absolute; left:600px; top:800px; width:333px; height:133px" FrameBorder="0" src="/images/cyber/loading.gif">' +
                   '</iframe>';

  	for (var i = 0; i < document.all.length; i++) {
    	if (document.all[i].tagName == "BODY") {
  			document.all[i].insertAdjacentHTML("beforeEnd", vInFrame);
  			break;
  		}
  	}

}


/**
 * @type   : function
 * @access : public
 * @desc   : ÁöÁ¤µÈ textBoxÀÇ ¾È¿¡ ¿ÀÁ÷ ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÅä·Ï ÇÑ´Ù.
 * @sig    : objectArray
 * @param  : objectArray
 * <pre>
 *    cfSetObjNumberOnly([sId,sNm])
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfSetObjNumberOnly(objArray) {

    if (eval(objArray).length != null) {

        for ( i = 0 ; i < objArray.length ; i++) {

            eval(objArray[i]).onkeypress = function (){cfNumberOnly()};
            eval(objArray[i]).style.imeMode = "disabled";
        }

    } else {
        eval(objArray).onkeypress = function (){cfNumberOnly()};
        eval(objArray).style.imeMode = "disabled";
    }

}

/**
 * @type   : function
 * @access : public
 * @desc   : INPUT TEXT¿¡ ¿µ¹® ÀÔ·Â½Ã ´ë¹®ÀÚ·Î º¯È¯(ÄÚµå¼º µ¥ÀÌÅÍ ÀÔ·Â½Ã)
 * @sig    :
 * @param  :
 * <pre>
 *    onkeydown=cfUpperCase()
 * </pre>
 * @return : void
 * @author : Á¤ÈÆ±Ô
 */
function cfUpperCase(){
	var vElement = event.srcElement;

	if((event.keyCode >= 65)&&(event.keyCode <=90 )){
		event.returnValue = false;
		vElement.value += String.fromCharCode(event.keyCode).toUpperCase();
	}
}


/**
 * @type   : function
 * @access : public
 * @desc   : ¼­¹ö¿¡ ÀÖ´Â fileÀ» ´Ù¿î·Îµå ÇÑ´Ù.
 * @sig    : spec, dir, filename, downloadfilename, openflag
 * @param  : spec : ¾÷¹« ±¸ºÐ , (AM, BATCH, BM, CCM, ECARE, GROUP,PP)
 * @param  : dir  : spec ÀÌÈÄ¿¡ Á¸ÀçÇÏ´Â directory ¸í ex) 'temp/aaa'
 * @param  : filename  : ´Ù¿î ¹ÞÀ» ÆÄÀÏ ÀÌ¸§
 * @param  : downloadfilename  : ´Ù¿î·Îµå Ã¢ÀÌ ¶ã¶§ º¸¿©Áú ÆÄÀÏÀÇ ÀÌ¸§
 * <pre>
 *    spec Àº laf.xml¿¡ Á¤ÇØÁø °ª¿¡ µû¶ó °¡Á®¿Â´Ù. ½ÇÁ¦ ÆÄÀÏÀÇ ¼­¹ö °æ·Î´Â specÀ¸·Î °¡Á®¿Â °ª°ú dir + filename À¸·Î °áÁ¤µÈ´Ù.
 *
 *    cfDownLoadFile(spec, dir, filename, downloadfilename)
 * </pre>
 * @return : void
 * @author : ¿ÕÁ¤ÀÏ
 * ´Ù¿î¹Þ±âÀ§ÇÑ ÃÖ¼ÒÁ¤º¸ == http://localhost:8080/homepage/DownFront?&spec=homepagef01&filename=20054019_TB_IHZFILEMGR.txt
  */
function cfDownLoadFile(spec, dir, filename, downloadfilename){
	var mm = "";
	//spec = "homepagef01";
	//dir = "c:/laf/upload/homepagef01";
	//filename = "»õ ÅØ½ºÆ® ¹®¼­.txt ";
	//downloadfilename = "»õ ÅØ½ºÆ® ¹®¼­.txt ";
	mm += "spec=>" + spec + "\n";
	mm += "dir=>" + dir + "\n";
	mm += "filename=>" + filename + "\n";
	mm += "downloadfilename=>" + downloadfilename + "\n";

    var vInFrame = '<iframe name="fileFrame" id="fileFrame" style="display:none; position:absolute; left:0; top:0; width:0; height:0" FrameBorder="0">' +
                   '</iframe>';

	mm += "vInFrame => " + vInFrame + "\n";
    var vAction = '/' + DOC_ROOT + '/DownFront?spec=' + spec + '&dir=' + dir + '&filename=' + filename + '&downloadfilename=' + downloadfilename + '&openflag=' +'' ;

	//alert(" " + vAction);
	mm += "vInFrame => " + vInFrame + "\n";
    //var vFormText = '<form name="fileForm"  id="fileForm" method="post" action="'+vAction+'" target="fileFrame"></form>'
    //var vFormText = '<form name="fileForm"  id="fileForm" method="post" action="'+vAction+'" target="_top"></form>'
    var vFormText = '<form name="fileForm"  id="fileForm" method="post" action="'+vAction+'" target="fileFrame"></form>'

	mm += "vFormText" + vFormText + "\n";

    // page¿¡ ´Ù¿î·Îµå¸¦ À§ÇÑ iframe ÀÌ Á¸ÀçÇÏÁö ¾ÊÀ¸¸é »õ·Î ¸¸µç´Ù.
    if (document.getElementById('fileFrame') == null ) {

      	for (var i = 0; i < document.all.length; i++) {
        	if (document.all[i].tagName == "BODY") {
      			document.all[i].insertAdjacentHTML("beforeEnd", vInFrame);
      			break;
      		}
      	}
  	}

    // page¿¡ ´Ù¿î·Îµå¸¦ À§ÇÑ form ÀÌ Á¸Àç ÇÏÁö ¾ÊÀ¸¸é »õ·Î ¸¸µç´Ù.
    if (document.getElementById('fileForm') == null ) {

      	for (var i = 0; i < document.all.length; i++) {
        	if (document.all[i].tagName == "BODY") {
      			document.all[i].insertAdjacentHTML("beforeEnd", vFormText);
      			break;
      		}
      	}
  	} else { // ÀÌ¹Ì form ÀÌ Á¸ÀçÇÏ¸é
  	    document.fileForm.action = vAction;
  	}

  	document.fileForm.submit();
}


/**
 * @type   : function
 * @access : public
 * @desc   : emedit³ª text box¿¡ ÇöÀç ³¯Â¥¸¦ settingÇÑ´Ù.
 * @sig    : objArray ,Format
 * @param  : textbox,Emeidt ÇüÅÂÀÇ object Array
 * @param  : ³¯Â¥ Æ÷¸Ë
 * <pre>
 *
 *    cfSetCurrentDate(['oStartDate','oEndDate'],'YYYYMMDD')
 * </pre>
 * @return : String
 * @author : ¿ÕÁ¤ÀÏ
 */
function cfSetCurrentDate(objArray, format){

    var vCurDate = cfGetCurrentDate().format(format);

    if (objArray.length != null) {

        for ( i=0; i < objArray.length ; i++) {

            if ( cfGetElementType(eval(objArray[i])) == 'TEXT' || cfGetElementType(eval(objArray[i])) == 'HIDDEN') {
                eval(objArray[i]).value = vCurDate;
            } else if (cfGetElementType(objArray[i]) == 'GE') {
                eval(objArray[i]).Text = vCurDate;
            }
        }
    } else {

        if ( cfGetElementType(eval(objArray)) == 'TEXT' || cfGetElementType(eval(objArray)) == 'HIDDEN') {
            eval(objArray).value = vCurDate;
        } else if (cfGetElementType(eval(objArray)) == 'GE') {
            eval(objArray).Text = vCurDate;
        }
    }
}

/**
 * @type   : function
 * @access : public
 * @desc   : Scroll ¹ß»ý½Ã Top Link ±â´É.
 * @sig    :
 * @param  :
 * <pre>
 *    fncSetScrollFnc();	// OnLoad Event¿¡ ±â¼úÇÑ´Ù.
 * </pre>
 * @return :
 * @author : Á¤ÈÆ±Ô
 */

function cfSetScrollFnc(){
	var oBody = document.body;

	var oTopSpot = "<a name=topSpot></a>";		// top position
	oBody.insertAdjacentHTML("afterBegin", oTopSpot);

	var oTopLink = "<div id=oDiv style='position:absolute;z-index:10;visibility:hidden'>"		//ÃÊ±â ÀÌ¹ÌÁö À§Ä¡
				 + "  <a href=#topSpot onfocus=this.blur()>"
				 + "	<img src=/images/top.gif border=0 id=imgTop>"
				 + "  </a>"
				 + "</div>";
	oBody.insertAdjacentHTML("beforeEnd", oTopLink);

	oBody.onscroll = fncGoTop;
}

//topImgÀÇ ÁÂÇ¥¸¦ ¼³Á¤ÇÑ´Ù.
function fncGoTop(){
	var oBody = document.body;
	if (oBody.scrollTop == 0) {
		oDiv.style.visibility="hidden";
	}else {
		var imgX = oBody.clientWidth  + oBody.scrollLeft - imgTop.width  - 15;  //XÁÂÇ¥¼³Àý
		var imgY = oBody.clientHeight + oBody.scrollTop  - imgTop.height - 10;  //YÁÂÇ¥¼³Á¤

		oDiv.style.pixelLeft = imgX; //ÀÌ¹ÌÁöÀÇ XÁÂÇ¥ ¼³Á¤
		oDiv.style.pixelTop = imgY;  //ÀÌ¹ÌÁöÀÇ YÁÂÇ¥ ¼³Á¤
		oDiv.style.visibility="visible";
	}
}


/**
 *  Copyright(ÀúÀÛ±Ç) Do Not Erase This Comment!!! (ÀÌ ÁÖ¼®¹®À» Áö¿ìÁö ¸»°Í)
 *
 *  In the case of modifing source, you should email to all the authors
 *  in the below author list for information ( such as all set of modified sources,
 *  information of modifications, etc..)
 *  If provided modifications are proved reasonable, we may update imgbutton.htc
 *  reflecting your ideas on modifications
 *  Furthermore, if your modifications are proved valuable, it is possible to add
 *  your information on the authors list under deliberation.
 *
 *  (Caution!) DO NOT redistribute without permission.
 *             Distribution to outside of LG CNS is NOT permitted.
 *
 *  ¼Ò½º¸¦ º¯°æÇÏ¿© »ç¿ëÇÏ´Â °æ¿ì ¾Æ·¡ÀÇ ÀúÀÚ ¸®½ºÆ®¿¡ µî·ÏµÈ ¸ðµç ÀúÀÛÀÚ¿¡°Ô
 *  º¯°æµÈ ¼Ò½º ÀüÃ¼¿Í º¯°æµÈ »çÇ×À» mail·Î ¾Ë·Á¾ß ÇÑ´Ù.
 *  ÀúÀÛÀÚ´Â Á¦°øµÈ ¼Ò½º°¡ À¯¿ëÇÏ´Ù°í ÆÇ´ÜµÇ´Â °æ¿ì ÇØ´ç »çÇ×À» ¹Ý¿µÇÒ ¼ö ÀÖ´Ù.
 *  Áß¿äÇÑ Idea¸¦ Á¦°øÇÏ¿´´Ù°í ÆÇ´ÜµÇ´Â °æ¿ì ÇùÀÇÇÏ¿¡ ÀúÀÚ List¿¡ ¹Ý¿µÇÒ ¼ö ÀÖ´Ù.
 *
 *  (ÁÖÀÇ!) ¿øÀúÀÚÀÇ Çã¶ô¾øÀÌ Àç¹èÆ÷ ÇÒ ¼ö ¾øÀ¸¸ç LG CNS ¿ÜºÎ·ÎÀÇ À¯ÃâÀ» ÇÏ¿©¼­´Â ¾ÈµÈ´Ù.
 *
 **
 * AUTHORS LIST       E-MAIL                   HOMEPAGE
 * TK Shin            tkyushin@lgcns.com       http://www.javatoy.net
 *
 **
 ** MODIFICATION HISTORY
 ** DATE       Version    DEVELOPER        DESCRIPTION
 ** 2006/02/06 0.8        Shin Tack Kyu    Initial Release
 **
 ** Detail Build HISTORY
 ** DATE        BUILD  DESCRIPTION
 ** 2006/02/06 a100   alpha Release
 */
document.attachEvent ("onreadystatechange", function() {
   if (document.readyState=="complete")   {
     if (window.objectPatch) window.objectPatch();
   }
   window.objectPatch();
})

function objectPatch() {
	var os = document.getElementsByTagName("object");
	for (var idx=0; idx < os.length; idx++) {
		var peer = os[idx];
		var clsid = peer.getAttribute("classid");

		if (!clsid) continue;
		switch (clsid.toLowerCase()) {

			case "clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" :  // media player
			//case "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" :  // flash //2008³â È¨ÆäÀÌÁö ¸®´º¾ó ÀÛ¾÷µµÁß ÇÃ·¡½¬¿Í Áßº¹ ¿À·ù°¡ ¹ß»ýÇÏ¿© ¸·À½ 2008.11.23 À±±Ù¿ë
			case "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" :  // editor
			case "clsid:48f0c2af-bfa3-491f-a11b-2e9f0c0011f5" :  // editor
 			case "clsid:1663ed61-23eb-11d2-b92f-008048fdd814" :  // print

			var html = peer.outerHTML;

  				peer.outerHTML = html;
			    break;
	  	default:
			   break;
	}
	}
}


    /*
    *  Input/textarea µîÀÇ ¹ÙÀÌÆ® ¼ö¸¦ °è»êÇÏ¿© Ãâ·ÂÇÑ´Ù.
    */
    function length_count(filed, max_count, name)
    {
        if (window.event.keycode != 13)
        {   
            var str;
            var str_count = 0;
            var cut_count = 0;
            var str_length = filed.value.length;
    
            for(k=0; k < str_length; k++)
            {
                str = filed.value.charAt(k);
                
                if(escape(str).length > 4)
                {
                    str_count += 2; 
                }else{
                    // (\r\nÀº 1byte Ã³¸®)
                    if(escape(str)=='%0A') {
                    }else if(escape(str)=='%0D') {
                    	str_count +=2;
                    } else {
                        str_count ++;
                    }
                }

                if(max_count < str_count)
                {
                    alert("±ÛÀÚ¼ö°¡ "+ max_count +" byte ÀÌ»óÀº »ç¿ëºÒ°¡´ÉÇÕ´Ï´Ù");
                    if(escape(str).length > 4) str_count -= 2; 
                    else str_count--;
    
                    filed.value = filed.value.substring(0,k);
                    break;
                }
            }
            
        }   
        document.all[name].innerHTML = str_count;
    }
    
    /*
    *  Input/textarea µîÀÇ ¶óÀÎ¼ö ¹× ¹ÙÀÌÆ® ¼ö¸¦ °è»êÇÏ¿© Ãâ·ÂÇÑ´Ù.
(2005-09-14 ±è±¤¿µ Ãß°¡)
    */
    function line_length_count(filed, max_line, max_count, name)
    {
        if (window.event.keycode != 13)
        {   
            var str;
            var str_count = 0;
            var cut_count = 0;
			var str_line_count = 0;
			var start_line_point = 0;
			var end_line_point = 0;

            var str_length = filed.value.length;
    
            for(k=0; k < str_length; k++)
            {
                str = filed.value.charAt(k);
                if(escape(str).length > 4)
                {
                    str_count += 2; 
                }else{
                    // (\r\nÀº 1byte Ã³¸®)
                    if(escape(str)=='%0A') {
					    str_line_count += 1;
					    
                    }else if(escape(str)=='%0D') {
                    	str_count +=2;
                    } else {
                        str_count ++;
                    }
                }

                if(max_line <= str_line_count)
                {
                    alert("¶óÀÎ¼ö´Â "+ max_line +" ÁÙ ÀÌÇÏ·Î ÀÛ¼ºÇÏ¼¼¿ä");
                    if(escape(str).length > 4) str_count -= 2; 
                    else str_count--;
                    
                    filed.value = filed.value.substring(0,k-1);
                    break;
                }
                if(max_count < str_count)
                {
                    var han_count =  max_count /2;
                    
                    alert("ÀÔ·ÂÇÑµµ¸¦ ÃÊ°úÇØ¼­ ÃÊ°úÀÔ·ÂºÎºÐÀÌ »èÁ¦µÇ¾ú½À´Ï´Ù.\nÇÑ±Û "+han_count+"ÀÚ ¿µ¹®/¼ýÀÚ "+max_count+"ÀÚ ±îÁö ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
                    if(escape(str).length > 4) str_count -= 2; 
                    else str_count--;
    
                    filed.value = filed.value.substring(0,k);
                    break;
                }
            }
            
        }   
        document.all[name].innerHTML = str_count;
    }
    
    /*
    *  ÇØ´ç ÇÊµåÀÇ ¹ÙÀÌÆ®°ªÀ» ¸Æ½º°ª°ú ºñ±³ÇÑ´Ù.
    */
    function byteCheck(filed, max_count) {
        if (window.event.keycode != 13)
        {   
            var str;
            var str_count = 0;
            var cut_count = 0;
            var str_length = filed.value.length;
    
            for(k=0; k < str_length; k++)
            {
                str = filed.value.charAt(k);
                if(escape(str).length > 4)
                {
                    str_count += 2; 
                }else{
                    // (\r\nÀº 1byte Ã³¸®)
                    if(escape(str)=='%0A') {
                    } else {
                        str_count++;
                    }
                }
    
                if(max_count < str_count)
                {
                    alert("±ÛÀÚ¼ö°¡ "+ max_count +" byte ÀÌ»óÀº »ç¿ëºÒ°¡´ÉÇÕ´Ï´Ù");
                    if(escape(str).length > 4) str_count -= 2; 
                    else str_count--;
    
                    filed.value = filed.value.substring(0,k);
                    break;
                }
            }
            
        }
        
        
    }       

/*
*  ÇØ´ç input °ªÀ» 64ºñÆ®·Î ÀÎÄÚµù ÇÏ¿© ¹ÝÈ¯ ÇÔ
*  Ç¥´ë¿µC 2010.07.20
*/
function encode64(input) {
	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var output = "";
	var chr1, chr2, chr3 = "";
	var enc1, enc2, enc3, enc4 = "";
	var i = 0;

	do {
		chr1 = input.charCodeAt(i++);
		chr2 = input.charCodeAt(i++);
		chr3 = input.charCodeAt(i++);

		enc1 = chr1 >> 2;
		enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		enc4 = chr3 & 63;

		if (isNaN(chr2)) {
			enc3 = enc4 = 64;
		} else if (isNaN(chr3)) {
			enc4 = 64;
		}

		output = output +
        keyStr.charAt(enc1) +
        keyStr.charAt(enc2) +
        keyStr.charAt(enc3) +
        keyStr.charAt(enc4);
		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";
	} while (i < input.length);
	
	return output;
}

/*
*  ÇØ´ç input °ªÀ» stringÀ¸·Î º¯È¯ÇÏ¿© ¹ÝÈ¯ ÇÔ
*  Ç¥´ë¿µC 2010.07.20
*/
function decode64(input) {
	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var output = "";
	var chr1, chr2, chr3 = "";
	var enc1, enc2, enc3, enc4 = "";
	var i = 0;

	var base64test = /[^A-Za-z0-9\+\/\=]/g;
	input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	do {
		enc1 = keyStr.indexOf(input.charAt(i++));
		enc2 = keyStr.indexOf(input.charAt(i++));
		enc3 = keyStr.indexOf(input.charAt(i++));
		enc4 = keyStr.indexOf(input.charAt(i++));

		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;

		output = output + String.fromCharCode(chr1);

		if (enc3 != 64) {
			output = output + String.fromCharCode(chr2);
		}
		if (enc4 != 64) {
			output = output + String.fromCharCode(chr3);
		}

		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";

	} while (i < input.length);

	return output;
}