/**
 * @type : intro
 * @desc : comm.js´Â ÇÁ·ÎÁ§Æ® Àü¹Ý¿¡ °ÉÃÄ Àü ½Ã½ºÅÛ¿¡¼­ °øÅëÀ¸·Î »ç¿ëÇÏ´Â ÀÚ¹Ù ½ºÅ©¸³Æ®¸¦ ±â¼úÇÑ
 * ÀÚ¹Ù½ºÅ©¸³Æ® ÆÄÀÏÀÌ´Ù. ºó¹øÈ÷ »ç¿ëµÇ´Â ÀÚ¹Ù½ºÅ©¸³Æ®µéÀÌ È­¸é¸¶´Ù ¹Ýº¹ÀûÀ¸·Î °³¹ßµÇÁö
 * ¾Êµµ·Ï ¹Ì¸® Á¤ÀÇµÇ¾î ÀÖ¾î¼­ comm.js¸¦ ¾÷¹«È­¸é¿¡ import½ÃÅ°±â¸¸ ÇÏ¸é comm.js¿¡ Á¤ÀÇµÇ¾î
 * ÀÖ´Â ½ºÅ©¸³Æ®µé¿¡ ´ëÇØ¼­´Â °¢ °³¹ßÀÚ°¡ º°µµ·Î °³¹ßÇÒ ÇÊ¿ä°¡ ¾ø´Ù.
 * ÇÔ¼ö Naming RuleÀº ´ÙÀ½°ú °°´Ù.
 * <pre>
 *     - cf  : common function
 *     - co  : common object
 *     - cov : common object for validation
 * </pre>
 * <font color=red>¡ØÁÖÀÇ»çÇ×</font>
 * <pre>
 *     - comm.js¸¦ importÇÏ´Â html È­¸é¿¡¼­´Â object id¸¦ ÁöÁ¤ÇÒ ¶§, ´ÙÀ½¿¡ ³ª¿­µÈ id´Â
 *       ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù.
 *
 *       coTreeViewImageComnGIDS
 * </pre>
 * @version : 1.0
 */

window.status = "¹®È­°ü±¤Æ÷ÅÐ ¿ÀÇÂÁ¦ÁÖµµÀÔ´Ï´Ù.";

//----------------------------- Error Message ------------------------------//
var MSG_COM_ERR_001 = "@Àº(´Â) ÇÊ¼ö ÀÔ·Â Ç×¸ñÀÔ´Ï´Ù.";
var MSG_COM_ERR_002 = "@Àº(´Â) @ÀÚ¸®¼ö¸¸Å­ ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_003 = "@Àº(´Â) @ºÎÅÍ @»çÀÌ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_004 = "@Àº(´Â) ¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_005 = "@Àº(´Â) @ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_006 = "@Àº(´Â) @ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_007 = "@Àº(´Â) @ ÀÌ»óÀ¸·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_008 = "@Àº(´Â) @ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_009 = "@Àº(´Â) ³âµµ°¡ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_010 = "@Àº(´Â) À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.";
var MSG_COM_ERR_011 = "@Àº(´Â) À¯È¿ÇÑ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.";
var MSG_COM_ERR_012 = "@Àº(´Â) À¯È¿ÇÑ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù.";
var MSG_COM_ERR_013 = "@Àº(´Â) ¿ùÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_014 = "@Àº(´Â) ÀÏÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_015 = "@Àº(´Â) ½Ã°¡ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_016 = "@Àº(´Â) ºÐÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_017 = "@Àº(´Â) ÃÊ°¡ Àß¸øµÇ¾ú½À´Ï´Ù.";
var MSG_COM_ERR_018 = "@Àº(´Â) @³â @¿ù @ÀÏ ÀÌÈÄÀÌ¾î¾ß ÇÕ´Ï´Ù.";
var MSG_COM_ERR_019 = "@Àº(´Â) @³â @¿ù @ÀÏ ÀÌÀüÀÌ¾î¾ß ÇÕ´Ï´Ù.";
var MSG_COM_ERR_020 = "@Àº(´Â) '@' Çü½ÄÀÌ¾î¾ß ÇÕ´Ï´Ù.\n" +
                      "  - # : ¹®ÀÚ È¤Àº ¼ýÀÚ\n" +
                      "  - h, H : ÇÑ±Û(H´Â °ø¹éÆ÷ÇÔ)\n" +
                      "  - A, Z : ¹®ÀÚ(Z´Â °ø¹éÆ÷ÇÔ)\n" +
                      "  - 0, 9 : ¼ýÀÚ(9´Â °ø¹éÆ÷ÇÔ)";
var MSG_COM_ERR_021 = "@Àº(´Â) @ÀÚ¸®¼ö¸¸Å­ ÀÔ·ÂÇÏ½Ê½Ã¿À. (ÇÑ±ÛÀº @ÀÚ¸®¼ö)";
var MSG_COM_ERR_022 = "@Àº(´Â) @ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇÏ½Ê½Ã¿À. (ÇÑ±ÛÀº @ÀÚ ÀÌ»ó)";
var MSG_COM_ERR_023 = "@Àº(´Â) @ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À. (ÇÑ±ÛÀº @ÀÚ ÀÌÇÏ)";
var MSG_COM_ERR_024 = "@Àº(´Â) Áßº¹µÉ ¼ö ¾ø½À´Ï´Ù.";
var MSG_COM_ERR_025 = "@Àº(´Â) ´ÙÀ½ ¹®ÀÚ°¡ ¿Ã ¼ö ¾ø½À´Ï´Ù.\n@";
var MSG_COM_ERR_026 = "@Àº(´Â) ´ÙÀ½ ¹®ÀÚ¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.\n@";
var MSG_COM_ERR_027 = "@Àº(´Â) À¯È¿ÇÑ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.";
var MSG_COM_ERR_028 = "@Àº(´Â) Á¤¼öºÎ¸¦ @ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.";
var MSG_COM_ERR_029 = "@Àº(´Â) ¼Ò¼öºÎ¸¦ @ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À." ;
var MSG_COM_ERR_030 = "<ERP ÅëÁ¦>\n\n ÅëÁ¦µÈ °Å·¡Ã³ ÀÔ´Ï´Ù. " ;
var MSG_COM_ERR_031 = "<NEO ÅëÁ¦>\n\n @ @." ;
var MSG_COM_ERR_032 = "ÇØ´ç SET¸ðµ¨À» ÀÔ·Â ÇÏ½Ê½Ã¿ä." ;
var MSG_COM_ERR_033 = "À¯ÅëÃ¤³ÎÀ» ¼±ÅÃÇÏ½Ê½Ã¿À." ;

//------------------------------  °øÅë ½ºÅ©¸³Æ® ¿µ¿ªÀÔ´Ï´Ù. -----------------------------//

// Global º¯¼ö¼±¾ð
var GLB_MONTH_IN_YEAR       = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var GLB_SHORT_MONTH_IN_YEAR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var GLB_DAY_IN_WEEK         = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var GLB_SHORT_DAY_IN_WEEK   = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var GLB_DAYS_IN_MONTH       = [31,28,31,30,31,30,31,31,30,31,30,31];
var GLB_ENABLE_COLOR		= "#FFFFFF";
var GLB_DISABLE_COLOR		= "#E8E8E8";
var _loadingWin;

if (top.location.href.toLowerCase().indexOf('.openjejudo.com/') < 0)
	top.location.href='http://www.openjejudo.com/';

///////////////////////////// JavaScript ³»Àå°´Ã¼ È®Àå /////////////////////////////

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ simpleReplace ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. simpleReplace ¸Þ¼Òµå´Â
 *           ½ºÆ®¸µ ³»¿¡ ÀÖ´Â Æ¯Á¤ ½ºÆ®¸µÀ» ´Ù¸¥ ½ºÆ®¸µÀ¸·Î ¸ðµÎ º¯È¯ÇÑ´Ù. String °´Ã¼ÀÇ replace ¸Þ¼Òµå¿Í µ¿ÀÏÇÑ
 *           ±â´ÉÀ» ÇÏÁö¸¸ °£´ÜÇÑ ½ºÆ®¸µÀÇ Ä¡È¯½Ã¿¡ º¸´Ù À¯¿ëÇÏ°Ô »ç¿ëÇÒ ¼ö ÀÖ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var str = "abcde"
 *     str = str.simpleReplace("cd", "xx");
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abxxe"°¡ µÈ´Ù.
 * @sig    : oldStr, newStr
 * @param  : oldStr required ¹Ù²î¾î¾ß µÉ ±âÁ¸ÀÇ ½ºÆ®¸µ
 * @param  : newStr required ¹Ù²î¾îÁú »õ·Î¿î ½ºÆ®¸µ
 * @return : replaced String.
 * @author : ÀÓÀçÇö
 */
String.prototype.simpleReplace = function(oldStr, newStr) {
	var rStr = oldStr;

	rStr = rStr.replace(/\\/g, "\\\\");
	rStr = rStr.replace(/\^/g, "\\^");
	rStr = rStr.replace(/\$/g, "\\$");
	rStr = rStr.replace(/\*/g, "\\*");
	rStr = rStr.replace(/\+/g, "\\+");
	rStr = rStr.replace(/\?/g, "\\?");
	rStr = rStr.replace(/\./g, "\\.");
	rStr = rStr.replace(/\(/g, "\\(");
	rStr = rStr.replace(/\)/g, "\\)");
	rStr = rStr.replace(/\|/g, "\\|");
	rStr = rStr.replace(/\,/g, "\\,");
	rStr = rStr.replace(/\{/g, "\\{");
	rStr = rStr.replace(/\}/g, "\\}");
	rStr = rStr.replace(/\[/g, "\\[");
	rStr = rStr.replace(/\]/g, "\\]");
	rStr = rStr.replace(/\-/g, "\\-");

  	var re = new RegExp(rStr, "g");
    return this.replace(re, newStr);
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ trim ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. trim ¸Þ¼Òµå´Â ½ºÆ®¸µÀÇ ¾Õ°ú µÚ¿¡
 *           ÀÖ´Â white space ¸¦ Á¦°ÅÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var str = " abcde "
 *     str = str.trim();
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abede"°¡ µÈ´Ù.
 * @return : trimed String.
 * @author : ÀÓÀçÇö
 */
String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ trimAll ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. trim ¸Þ¼Òµå´Â ½ºÆ®¸µ ³»¿¡
 *           ÀÖ´Â white space ¸¦ ¸ðµÎ Á¦°ÅÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var str = " abc de "
 *     str = str.trimAll();
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abcde"°¡ µÈ´Ù.
 * @return : trimed String.
 * @author : ÀÓÀçÇö
 */
String.prototype.trimAll = function() {
    return this.replace(/\s*/g, "");
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ cut ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. cut ¸Þ¼Òµå´Â ½ºÆ®¸µÀÇ Æ¯Á¤ ¿µ¿ªÀ»
 *           Àß¶ó³½´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var str = "abcde"
 *     str = str.cut(2, 2);
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abe"°¡ µÈ´Ù.
 * @sig    : start, length
 * @param  : start  required start index to cut
 * @param  : length required length to cut
 * @return : cutted String.
 * @author : ÀÓÀçÇö
 */
String.prototype.cut = function(start, length) {
    return this.substring(0, start) + this.substr(start + length);
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ insert ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. insert ¸Þ¼Òµå´Â ½ºÆ®¸µÀÇ Æ¯Á¤ ¿µ¿ª¿¡
 *           ÁÖ¾îÁø ½ºÆ®¸µÀ» »ðÀÔÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var str = "abcde"
 *     str = str.insert(3, "xyz");
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ str´Â "abcxyzde"°¡ µÈ´Ù.
 * @sig    : start, length
 * @param  : index required »ðÀÔÇÒ À§Ä¡. ÇØ´ç ½ºÆ®¸µÀÇ index ¹Ù·Î ¾Õ¿¡ »ðÀÔµÈ´Ù. index´Â 0ºÎÅÍ ½ÃÀÛ.
 * @param  : str   required »ðÀÔÇÒ ½ºÆ®¸µ.
 * @return : inserted String.
 * @author : ÀÓÀçÇö
 */
String.prototype.insert = function(index, str) {
    return this.substring(0, index) + str + this.substr(index);
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : String.split() ¿Í °°Áö¸¸ ¿©·¯°¡Áö ¿É¼ÇÀ» ÁÙ ¼ö ÀÖ´Ù.
 * <pre>
 *     option list
 *
 *     - i : ignored split
 *         ±¸ºÐÀÚ ¹®ÀÚ ¾Õ¿¡ "\" °¡ ºÙ¾îÀÖÀ» ¶§´Â ±¸ºÐÀÚ·Î ÀÎ½ÄÇÏÁö ¾Ê´Â´Ù. ('\' ¹®ÀÚ¸¦ stringÀ¸·Î Ç¥ÇöÇÒ ¶§´Â "\\" ·Î ÇØ¾ßÇÔ)
 *             var str = "abc,de\\,fg"
 *             var strArr = str.advancedSplit(",", "i");
 *         À§ÀÇ ¿¹¿¡¼­ strArr[0]´Â "abc", strArr[1]´Â "de,fg"°¡ µÈ´Ù.
 *
 *     - t : trimed split
 *         split ÈÄ¿¡ splited string µéÀ» trim ½ÃÅ²´Ù.
 *             var str = "abc,  de,fg"
 *             var strArr = str.advancedSplit(",", "t");
 *         À§ÀÇ ¿¹¿¡¼­ strArr[0]´Â "abc", strArr[1]´Â "de", strArr[2]´Â "fg"°¡ µÈ´Ù.
 * </pre>
 * ¿É¼ÇµéÀº º¹ÇÕÀûÀ¸·Î »ç¿ëµÉ ¼ö ÀÖ´Ù.
 * <pre>
 *     var str = "abc,  de\\,fg"
 *     var strArr = str.advancedSplit(",", "it");
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ strArr[0]´Â "abc", strArr[1]´Â "de,fg"°¡ µÈ´Ù.
 * @sig    : delim, options
 * @param  : delim   required delimenator
 * @param  : options required ¿É¼ÇÀ» ³ªÅ¸³»´Â ¹®ÀÚµéÀ» ³ª¿­ÇÑ ½ºÆ®¸µ
 * @return : splited string array.
 * @author : ÀÓÀçÇö
 */
String.prototype.advancedSplit = function(delim, options) {
	if (options == null || options.trim() == "") {
		return this.split(delim);
	}

	var optionI = false;
	var optionT = false;

	options = options.trim().toUpperCase();

	for (var i = 0; i < options.length; i++) {
		if (options.charAt(i) == 'I') {
			optionI = true;
		} else if (options.charAt(i) == 'T') {
			optionT = true;
		}
	}

	var arr = new Array();
	var cnt = 0;
	var startIdx = 0;
	var delimIdx = -1;
	var str = this;
	var temp = 0;

	while ( (delimIdx = (str == null) ?
	         -1 : str.indexOf(delim, startIdx)
	        ) != -1
	      ) {

		if (optionI && str.substr(delimIdx - 1, 2) == '\\' + delim) {
			str = str.cut(delimIdx - 1, 1);
			startIdx = delimIdx;
			continue;
		}

		arr[cnt++] = optionT ? str.substring(0, delimIdx).trim() :
		                       str.substring(0, delimIdx);
		str = str.substr(delimIdx + 1);
		startIdx = 0;
	}

	arr[cnt] = (str == null) ? "" : str;

	return arr;
}

/**
 * @type   : prototype_function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ String °´Ã¼¿¡ toDate ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. toDate ¸Þ¼Òµå´Â ³¯Â¥¸¦ Ç¥ÇöÇÏ´Â
 *           ½ºÆ®¸µ °ªÀ» ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ Date °´Ã¼·Î º¯È¯ÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     var date = "2002-03-05".toDate("YYYY-MM-DD")
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ date º¯¼ö´Â ½ÇÁ¦·Î 2002³â 3¿ù 5ÀÏÀ» Ç¥ÇöÇÏ´Â Date ¿ÀºêÁ§Æ®¸¦ °¡¸£Å²´Ù.
 * @sig    : [pattern]
 * @param  : pattern optional Date¸¦ Ç¥ÇöÇÏ°í ÀÖ´Â ÇöÀçÀÇ StringÀ» patternÀ¸·Î Ç¥ÇöÇÑ´Ù. (default : YYYYMMDD)
 * <pre>
 *     # syntex
 *
 *       YYYY : year(4ÀÚ¸®)
 *       YY   : year(2ÀÚ¸®)
 *       MM   : month in year(number)
 *       DD   : day in month
 *       HH   : hour in day (0~23)
 *       mm   : minute in hour
 *       ss   : second in minute
 *       SS   : millisecond in second
 *
 *     <font color=red>ÁÖÀÇ)</font> YYYY(YY)´Â ¹Ýµå½Ã ÀÖ¾î¾ß ÇÑ´Ù. YYYY(YY) ¸¸ »ç¿ëÇÒ °æ¿ì´Â 1¿ù 1ÀÏÀ» ±âÁØÀ¸·Î
 *     ÇÏ°í YYYY¿Í MM ¸¸»ç¿ëÇÒ °æ¿ì´Â 1ÀÏÀ» ±âÁØÀ¸·Î ÇÑ´Ù.
 * </pre>
 * @return : º¯È¯µÈ Date Object.
 * @author : ÀÓÀçÇö
 */
String.prototype.toDate = function(pattern) {
	var index = -1;
	var year;
	var month;
	var day;
	var hour = 0;
	var min  = 0;
	var sec  = 0;
	var ms   = 0;
	var newDate;

	if (pattern == null) {
		pattern = "YYYYMMDD";
	}

	if ((index = pattern.indexOf("YYYY")) == -1 ) {
		index = pattern.indexOf("YY");
		year = "20" + this.substr(index, 2);
	} else {
		year = this.substr(index, 4);
	}

	if ((index = pattern.indexOf("MM")) != -1 ) {
		month = this.substr(index, 2);
	} else {
		month = 1;
	}

	if ((index = pattern.indexOf("DD")) != -1 ) {
		day = this.substr(index, 2);
	} else {
		day = 1;
	}

	if ((index = pattern.indexOf("HH")) != -1 ) {
		hour = this.substr(index, 2);
	}

	if ((index = pattern.indexOf("mm")) != -1 ) {
		min = this.substr(index, 2);
	}

	if ((index = pattern.indexOf("ss")) != -1 ) {
		sec = this.substr(index, 2);
	}

	if ((index = pattern.indexOf("SS")) != -1 ) {
		ms = this.substr(index, 2);
	}

	newDate = new Date(year, month - 1, day, hour, min, sec, ms);
	if (month > 12) {
		newDate.setFullYear(year + 1);
	} else {
		newDate.setFullYear(year);
	}

	return newDate;
}

/**
 * @type   : prototype_function
 * @object : Date
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ³»Àå °´Ã¼ÀÎ Date °´Ã¼¿¡ format ¸Þ¼Òµå¸¦ Ãß°¡ÇÑ´Ù. format ¸Þ¼Òµå´Â Date °´Ã¼°¡ °¡Áø ³¯Â¥¸¦
 *           ÁöÁ¤µÈ Æ÷¸äÀÇ ½ºÆ®¸µÀ¸·Î º¯È¯ÇÑ´Ù.
 * <pre>
 *     var dateStr = new Date().format("YYYYMMDD");
 *
 *     Âü°í : Date ¿ÀºêÁ§Æ® »ý¼ºÀÚµé - dateObj = new Date()
 *                                   - dateObj = new Date(dateVal)
 *                                   - dateObj = new Date(year, month, date[, hours[, minutes[, seconds[,ms]]]])
 * </pre>
 * À§ÀÇ ¿¹¿¡¼­ ¿À´Ã³¯Â¥°¡ 2002³â 3¿ù 5ÀÏÀÌ¶ó¸é dateStrÀÇ °ªÀº "20020305"°¡ µÈ´Ù.
 * default patternÀº "YYYYMMDD"ÀÌ´Ù.
 * @sig    : [pattern]
 * @param  : pattern optional º¯È¯ÇÏ°íÀÚ ÇÏ´Â ÆÐÅÏ ½ºÆ®¸µ. (default : YYYYMMDD)
 * <pre>
 *     # syntex
 *
 *       YYYY : hour in am/pm (1~12)
 *       MM   : month in year(number)
 *       MON  : month in year(text)  ¿¹) "January"
 *       mon  : short month in year(text)  ¿¹) "Jan"
 *       DD   : day in month
 *       DAY  : day in week  ¿¹) "Sunday"
 *       day  : short day in week  ¿¹) "Sun"
 *       hh   : hour in am/pm (1~12)
 *       HH   : hour in day (0~23)
 *       mm   : minute in hour
 *       ss   : second in minute
 *       SS   : millisecond in second
 *       a    : am/pm  ¿¹) "AM"
 * </pre>
 * @return : Date¸¦ Ç¥ÇöÇÏ´Â º¯È¯µÈ String.
 * @author : ÀÓÀçÇö
 */
Date.prototype.format = function(pattern) {
    var year      = this.getFullYear();
    var month     = this.getMonth() + 1;
    var day       = this.getDate();
    var dayInWeek = this.getDay();
    var hour24    = this.getHours();
    var ampm      = (hour24 < 12) ? "AM" : "PM";
    var hour12    = (hour24 > 12) ? (hour24 - 12) : hour24;
    var min       = this.getMinutes();
    var sec       = this.getSeconds();

    var YYYY = "" + year;
    var YY   = YYYY.substr(2);
    var MM   = (("" + month).length == 1) ? "0" + month : "" + month;
    var MON  = GLB_MONTH_IN_YEAR[month-1];
    var mon  = GLB_SHORT_MONTH_IN_YEAR[month-1];
    var DD   = (("" + day).length == 1) ? "0" + day : "" + day;
    var DAY  = GLB_DAY_IN_WEEK[dayInWeek];
    var day  = GLB_SHORT_DAY_IN_WEEK[dayInWeek];
    var HH   = (("" + hour24).length == 1) ? "0" + hour24 : "" + hour24;
    var hh   = (("" + hour12).length == 1) ? "0" + hour12 : "" + hour12;
    var mm   = (("" + min).length == 1) ? "0" + min : "" + min;
    var ss   = (("" + sec).length == 1) ? "0" + sec : "" + sec;
    var SS   = "" + this.getMilliseconds();

    var dateStr;
    var index = -1;

    if (typeof(pattern) == "undefined") {
    	dateStr = "YYYYMMDD";
    } else {
    	dateStr = pattern;
    }

	dateStr = dateStr.replace(/YYYY/g, YYYY);
	dateStr = dateStr.replace(/YY/g,   YY);
	dateStr = dateStr.replace(/MM/g,   MM);
	dateStr = dateStr.replace(/MON/g,  MON);
	dateStr = dateStr.replace(/mon/g,  mon);
	dateStr = dateStr.replace(/DD/g,   DD);
	dateStr = dateStr.replace(/DAY/g,  DAY);
	dateStr = dateStr.replace(/day/g,  day);
	dateStr = dateStr.replace(/hh/g,   hh);
	dateStr = dateStr.replace(/HH/g,   HH);
	dateStr = dateStr.replace(/mm/g,   mm);
	dateStr = dateStr.replace(/ss/g,   ss);
	dateStr = dateStr.replace(/(\s+)a/g, "$1" + ampm);

	return dateStr;
}

/**
 * @type   : prototype_function
 * @object : Date
 * @access : public
 * @desc   : ÇöÀç Date °´Ã¼ÀÇ ³¯Â¥º¸´Ù ÀÌÈÄ³¯Â¥¸¦ °¡Áø Date °´Ã¼¸¦ ¸®ÅÏÇÑ´Ù.
 *           ¿¹¸¦ µé¾î ³»ÀÏ ³¯Â¥¸¦ ¾òÀ¸·Á¸é ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µÈ´Ù.
 * <pre>»ç¿ë¿¹ :
 *    <font color=blue>ÁÖ·Î format()°ú ÇÔ²² »ç¿ëÇÑ´Ù.</font>
 *     var oneDayAfter = new Date.after(0, 0, 1); => Fri Apr 11 13:19:45 UTC+0900 2003
 *     var oneDayAfter = new Date.after(0, 0, 1).format( "YYYYYMMDD" ); => 20030411
 *
 *     ¤· ´ÙÀ½³¯ÀÇ °æ¿ì : after( 0, 0, 1 );
 *     ¤· ´ÙÀ½´ÞÀÇ °æ¿ì : after( 0, 1, 0 );
 *     ¤· ³»³âÀÇ °æ¿ì : after( 1, 0, 0 );
 *
 * </pre>
 * @sig    : [years[, months[, dates[, hours[, minutes[, seconds[, mss]]]]]]]
 * @param  : years   optional ÀÌÈÄ ³â¼ö
 * @param  : months  optional ÀÌÈÄ ¿ù¼ö
 * @param  : dates   optional ÀÌÈÄ ÀÏ¼ö
 * @param  : hours   optional ÀÌÈÄ ½Ã°£¼ö
 * @param  : minutes optional ÀÌÈÄ ºÐ¼ö
 * @param  : seconds optional ÀÌÈÄ ÃÊ¼ö
 * @param  : mss     optional ÀÌÈÄ ¹Ð¸®ÃÊ¼ö
 * @return : ÀÌÈÄ³¯Â¥¸¦ Ç¥ÇöÇÏ´Â Date °´Ã¼
 * @author : ÀÓÀçÇö
 */
Date.prototype.after = function(years, months, dates, hours, miniutes, seconds, mss) {
    if (years == null)    years    = 0;
    if (months == null)   months   = 0;
    if (dates == null)    dates    = 0;
    if (hours == null)    hours    = 0;
    if (miniutes == null) miniutes = 0;
    if (seconds == null)  seconds  = 0;
    if (mss == null)      mss      = 0;

	return new Date(this.getFullYear() + years,
	                this.getMonth() + months,
	                this.getDate() + dates,
	                this.getHours() + hours,
	                this.getMinutes() + miniutes,
	                this.getSeconds() + seconds,
	                this.getMilliseconds() + mss
	               );
}
// alert(new Date().after(1, 1, 1, 1, 1, 1).format("YYYYMMDD HHmmss"));
//alert(new Date().after(0, 0, 3).format( "YYYYMMDD" ));

/**
 * @type   : prototype_function
 * @object : Date
 * @access : public
 * @desc   : ÇöÀç Date °´Ã¼ÀÇ ³¯Â¥º¸´Ù ÀÌÀü³¯Â¥¸¦ °¡Áø Date °´Ã¼¸¦ ¸®ÅÏÇÑ´Ù.
 *           ¿¹¸¦ µé¾î ¾îÁ¦ ³¯Â¥¸¦ ¾òÀ¸·Á¸é ´ÙÀ½°ú °°ÀÌ ÇÏ¸é µÈ´Ù.
 * <pre>»ç¿ë¿¹ :
 *    <font color=blue>ÁÖ·Î format()°ú ÇÔ²² »ç¿ëÇÑ´Ù.</font>
 *     var oneDayBefore = new Date.before(0, 0, 1); => Fri Apr 11 13:19:45 UTC+0900 2003
 *     var oneDayBefore = new Date.before(0, 0, 1).format( "YYYYYMMDD" ); => 20030411
 *
 *     ¤· ÇÏ·çÀü : before( 0, 0, 1 );
 *     ¤· ÇÑ´ÞÀü : before( 0, 1, 0 );
 *     ¤· ÀÏ³âÀü : before( 1, 0, 0 );
 * </pre>
 *
 * @sig    : [years[, months[, dates[, hours[, minutes[, seconds[, mss]]]]]]]
 * @param  : years   optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ³â¼ö
 * @param  : months  optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ¿ù¼ö
 * @param  : dates   optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ÀÏ¼ö
 * @param  : hours   optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ½Ã°£¼ö
 * @param  : minutes optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ºÐ¼ö
 * @param  : seconds optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ÃÊ¼ö
 * @param  : mss     optional ÀÌÀüÀ¸·Î µ¹¾Æ°¥ ¹Ð¸®ÃÊ¼ö
 * @return : ÀÌÀü³¯Â¥¸¦ Ç¥ÇöÇÏ´Â Date °´Ã¼
 * @author : ÀÓÀçÇö
 */
Date.prototype.before = function(years, months, dates, hours, miniutes, seconds, mss) {
    if (years == null)    years    = 0;
    if (months == null)   months   = 0;
    if (dates == null)    dates    = 0;
    if (hours == null)    hours    = 0;
    if (miniutes == null) miniutes = 0;
    if (seconds == null)  seconds  = 0;
    if (mss == null)      mss      = 0;

	return new Date(this.getFullYear() - years,
	                this.getMonth() - months,
	                this.getDate() - dates,
	                this.getHours() - hours,
	                this.getMinutes() - miniutes,
	                this.getSeconds() - seconds,
	                this.getMilliseconds() - mss
	               );
}
//alert(new Date().before(1, 1, 1, 1, 1, 1).format("YYYYMMDD HHmmss"));


///////////////////////////// È­¸é ¸Þ¼¼Áö Ã³¸® ºÎºÐ /////////////////////////////


/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ alert box·Î º¸¿©ÁØ ÈÄ ¸®ÅÏÇÑ´Ù. cfGetMsg ÂüÁ¶.
 * <pre>»ç¿ë¿¹ :
 *
 *    var MSG_COM_INF_001 = "¼º°øÀûÀ¸·Î ÀúÀåÇÏ¿´½À´Ï´Ù.";
 *    var MSG_COM_INF_002 = "@À»(¸¦) ¼º°øÀûÀ¸·Î ÀúÀåÇÏ¿´½À´Ï´Ù.";
 *    var MSG_COM_ERR_001 = "@Àº(´Â) @ÀÚ¸®¼ö¸¸Å­ ÀÔ·ÂÇÏ½Ê½Ã¿À.";
 *     ...
 *    cfAlertMsg( MSG_COM_INF_001 );
 *    cfAlertMsg( MSG_COM_INF_002, ["ÀÛ¾÷"] );
 *    cfAlertMsg( MSG_COM_ERR_001, ["¸ðµ¨","¼¼"] );
 * </pre>
 * @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 = new coMessage().getMsg(msgId, paramArray);
	alert(msg);
	return msg;
}

/**
 * @type   : function
 * @access : public
 * @desc   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ confirm box·Î º¸¿©ÁØ ÈÄ ¸®ÅÏÇÑ´Ù. cfGetMsg ÂüÁ¶.
 * <pre>»ç¿ë¿¹ :
 *
 *    var MSG_COM_CFM_001 = "@À»(¸¦) ÀúÀåÇÏ½Ã°Ú½À´Ï±î?";
 *     ...
 *    cfConfirmMsg( MSG_COM_CFM_001, ["³»¿ª"] );
 * </pre>
 * @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   : °øÅë¸Þ¼¼Áö¿¡ Á¤ÀÇµÈ ¸Þ¼¼Áö¸¦ 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);
}


///////////////////////////// Popup °ü·Ã  /////////////////////////////

/**
 * @type   : function
 * @access : public
 * @desc   : StringÀ» ÀÔ·Â¹Þ¾Æ ¿µ¹® È¤Àº ¼ýÀÚ·Î¸¸ ÀÌ·ç¾îÁ³´ÂÁö È®ÀÎ.
 * <pre>»ç¿ë¿¹ :
 *
 *     onClick="cfCheckAlphaNumeric(txt_whCd.value)"
 *
 * </pre>
 * @sig    : value
 * @param  : value 	required Ã¼Å©ÇÒ String
 * @return : boolean
 * @author : ¾È½Â¿í
 */
function cfCheckAlphaNumeric(value) {
	for ( var i = 0 ; i < value.length ; i++ ) {

		if ((value.charAt(i) >= '0' && value.charAt(i) <= '9')) {
			// pass
		} else if ((value.charAt(i) >= 'a' && value.charAt(i) <= 'z')) {
			// pass
		} else if ((value.charAt(i) >= 'A' && value.charAt(i) <= 'Z')){
			// pass
		} else {
			return false;
		}
	}

	return true;

}

/**
 * @type   : function
 * @access : public
 * @desc   : StringÀ» ÀÔ·Â¹Þ¾Æ ¿µ¹® È¤Àº ¼ýÀÚ·Î¸¸ ÀÌ·ç¾îÁ³´ÂÁö È®ÀÎ.
 * <pre>»ç¿ë¿¹ :
 *
 *     onClick="cfCheckAlphaNumeric(txt_whCd.value)"
 *
 * </pre>
 * @sig    : value
 * @param  : value 	required Ã¼Å©ÇÒ String
 * @return : boolean
 * @author : ¾È½Â¿í
 */
function cfCheckUpperAlphaNumeric(value) {
	for ( var i = 0 ; i < value.length ; i++ ) {

		if ((value.charAt(i) >= '0' && value.charAt(i) <= '9')) {
			// pass
		} else if ((value.charAt(i) >= 'A' && value.charAt(i) <= 'Z')){
			// pass
		} else {
			return false;
		}
	}

	return true;

}
/**
 * @type   : function
 * @access : public
 * @desc   : StringÀ» ÀÔ·Â¹Þ¾Æ ¿µ¹® È¤Àº ¼ýÀÚ·Î¸¸ ÀÌ·ç¾îÁ³´ÂÁö È®ÀÎ, ´Ü, '-'´Â ÀÔ·Â °¡´É.
 * <pre>»ç¿ë¿¹ :
 *
 *     onClick="cfCheckAlphaNumericWithFilter(txt_whCd.value)"
 *
 * </pre>
 * @sig    : value
 * @param  : value 	required Ã¼Å©ÇÒ String
 * @return : boolean
 * @author : ¾È½Â¿í
 */
function cfCheckAlphaNumericWithFilter(value) {
	for ( var i = 0 ; i < value.length ; i++ ) {
		if(value.charAt(i)=='-'){
			//pass
		} else if (value.charAt(i) == '.' ) { 
			//pass
		} else if (value.charAt(i) == '/' ) { 
			//pass
		} else if ((value.charAt(i) >= '0' && value.charAt(i) <= '9')) {
			// pass
		} else if ((value.charAt(i) >= 'a' && value.charAt(i) <= 'z')) {
			// pass
		} else if ((value.charAt(i) >= 'A' && value.charAt(i) <= 'Z')){
			// pass
		} else {
			return false;
		}
	}

	return true;

}

/**
 * @type   : function
 * @access : public
 * @desc   : StringÀ» ÀÔ·Â¹Þ¾Æ ¼ýÀÚ·Î¸¸ ÀÌ·ç¾îÁ³´ÂÁö È®ÀÎ, ´Ü, '-'´Â ÀÔ·Â °¡´É.
 * <pre>»ç¿ë¿¹ :
 *
 *     onClick="cfCheckAlphaNumericWithFilter(txt_whCd.value)"
 *
 * </pre>
 * @sig    : value
 * @param  : value 	required Ã¼Å©ÇÒ String
 * @return : boolean
 * @author : ¾È½Â¿í
 */
function cfCheckNumericWithFilter(value) {
	for ( var i = 0 ; i < value.length ; i++ ) {
		if(value.charAt(i)=='-'){
			//pass
		} else if ((value.charAt(i) >= '0' && value.charAt(i) <= '9')) {
			// pass
		} else {
			return false;
		}
	}
	return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÔ·ÂÇÑ °ªÀÇ ÀÚ¸®¼ö±îÁö ¹Ý¿Ã¸²°ªÀ» ¸®ÅÏÇÑ´Ù.

 * <pre>»ç¿ë¿¹ :
 *
 *     cfAdvancdeRound(123.456,2) ---> 123.46
 *
 * </pre>
 * @sig    : number value, length
 * @param  : number value : ¹Ý¿Ã¸²ÇÏ°íÀÚ ÇÏ´Â ¼ö
 * @param  : length : ¼Ò¼ýÁ¡ ÀÌÇÏ ÀÚ¸®¼ö
 * @return :
 * @author : Á¤ÈÆ±Ô
 */
function cfAdvancedRound(val, len){
	var div=Math.pow(10,len);
	var newVal=Math.round(val*div)/div;
	return newVal;
}

///////////////////////////// ³¯Â¥ °ü·Ã      /////////////////////////////
/**
 * @type   : function
 * @access : public
 * @desc   : 2°³ÀÇ ³¯Â¥¸¦ ºñ±³ÇØ¼­ ¾ÕÀÇ ³¯Â¥°¡ µÚÀÇ ³¯Â¥º¸´Ù Å©¸é false¸¦ ¹ÝÈ¯ÇÏ°í
 * 			 ¾ÕÀÇ ³¯Â¥°¡ ÀÛÀ¸¸é true¸¦ ¹ÝÈ¯ÇÑ´Ù.<br>
 *
 * <pre>»ç¿ë¿¹ :
 *
 *     onClick="cfCompareDate(mEditFromDate.text, mEditToDate.text )"
 *
 * </pre>
 * @sig    : start_date, end_date
 * @param  : start_date required ½ÃÀÛ³¯Â¥, Çü½Ä:YYYYMMDD
 * @param  : end_date 	required ³¡³¯Â¥, Çü½Ä:YYYYMMDD
 * @return : boolean
 * @author : ¾È½Â¿í
 */
function cfCompareDate( start_date, end_date )
{
    var f_year  = parseInt( start_date.substr(0,4), 10 );
    var f_month = parseInt( start_date.substr(4,2), 10 );
    var f_day   = parseInt( start_date.substr(6,2), 10 );
    var t_year  = parseInt( end_date.substr(0,4), 10 );
    var t_month = parseInt( end_date.substr(4,2), 10 );
    var t_day   = parseInt( end_date.substr(6,2), 10 );

    if( f_year > t_year )
        return false;
    else if( f_year == t_year && f_month > t_month )
        return false;
    else if( f_year == t_year && f_month == t_month && f_day > t_day )
        return false;

    return true;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÇöÀç ÀÏÀÚ¸¦ ¸®ÅÏÇØÁØ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetToday(); => 20030411
 * </pre>
 * @sig    :
 * @param  :
 * @return : ÇöÀçÀÏÀÚ(YYYYMMDD)
 * @author : Á¶µ¿Áø
 */
function cfGetToday()
{
	var day = new Date();
	var year = day.getYear();
	var month = day.getMonth()+1;
	var mdate = day.getDate();

	if ( month < 10 )
	{
		month = "0" + month;
	}

	if ( mdate < 10 )
	{
		mdate = "0" + mdate;
	}

	var currentDate = year +""+ month +""+ mdate;

	return currentDate;
}


/**
 * @type   : function
 * @access : public
 * @desc   : ÇöÀçÀÏ ±âÁØ ÇÑ´ÞÀüÀÇ ³¯Â¥¸¦ ¸®ÅÏÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetLastMonth(); => 20030411
 * </pre>
 * @sig    :
 * @param  :
 * @return : ÇöÀçÀÏÀÚ(YYYYMMDD)
 * @author : ±è¿ìÇõ
 */
function cfGetLastMonth(now){

	var nowYear = eval(now.substring(0,4));
	var nowMonth = eval(now.substring(4,6));
	var nowDay = eval(now.substring(6,8));

	if(nowMonth == 1){
		nowMonth = 12
		nowYear = nowYear - 1
	}else{
		nowMonth = nowMonth - 1
	}
	
	if ( nowMonth < 10 )
	{
		nowMonth = "0" + nowMonth;
	}
	if ( nowDay < 10 )
	{
		nowDay = "0" + nowDay;
	}
  
	var currentDate = nowYear +""+ nowMonth +""+ nowDay;
	return currentDate;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÁöÁ¤ÇÑ ³¯Â¥¿ÍÀÇ Gap¸¸Å­ÀÇ ³¯Â¥¸¦ ¸®ÅÏÇØÁØ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 * 1. ¿À´Ãº¸´Ù 3ÀÏÈÄ ³¯Â¥
 *     cfGetGapDate( cfGetToday(), 3 );
 *
 * 2. ¿À´Ãº¸´Ù 3ÀÏÀü ³¯Â¥
 *     cfGetGapDate( cfGetToday(), -3 );
 *
 * 3. Á÷Á¢ ³¯Â¥¸¦ ÁöÁ¤ÇÑ °æ¿ì
 *     cfGetGapDate( '20030228', 1 ); => 20020301
 * </pre>
 * @sig    :
 * @param  : ÁöÁ¤ÇÏ°íÀÚ ÇÏ´Â ³¯Â¥, °£°Ý(Gap)
 * @author : Á¶µ¿Áø
 */
function cfGetGapDate( yyyymmdd, gap )
{
	var tdyy = yyyymmdd.substr(0,4);
	var tdmm = parseInt(yyyymmdd.substr(4,2),10) - 1;
	var tddd = yyyymmdd.substr(6,2);
	var tgap = gap;

	ffday=new Date(tdyy,tdmm,tddd)
	gaps = parseInt(tddd,10) + parseInt(tgap,10)
	ffday.setDate(gaps)

	var yyto = ffday.getFullYear();
	var mmto = ffday.getMonth() + 1;
	var ddto = ffday.getDate();

	mmto += "";
	ddto += "";

	if( mmto.length == 1 )
		mmto = "0" + mmto;

	if( ddto.length == 1 )
		ddto = "0" + ddto;

	return yyto+""+mmto+""+ddto;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÇØ´ç ³â¿ùÀÇ ¸¶Áö¸· ³¯Â¥ ±¸ÇÏ´Â ÇÔ¼ö<br>
 * <pre>»ç¿ë¿¹ :
 *
 * cfGetLastDay( calYear,calMonth );
 *
 *  # cfGetLastDay( 2003,3 ); => 31
 *
 * </pre>
 * @sig    :
 * @param  : calYear  - ÇØ´ç ³âµµ, calMonth - ÇØ´ç ¿ù
 * @author : ¾È½Â¿í
 */
function cfGetLastDay( calYear,calMonth ) {
	if (((calYear %4 == 0) && (calYear % 100 != 0))||(calYear % 400 == 0))
		GLB_DAYS_IN_MONTH[1] = 29;
	else {
		GLB_DAYS_IN_MONTH[1] = 28;
	}
	var nDays = GLB_DAYS_IN_MONTH[calMonth-1];
	return nDays;
}

/**
 * @type   : function
 * @access : public
 * @desc   : ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ¼ýÀÚ ¾Õ¿¡ ÁöÁ¤µÈ ÀÚ¸´¼ö¸¸Å­ zero character ¸¦ »ðÀÔÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 *     cfDigitalNumber(5, 123); => 00123
 *     cfDigitalNumber(2, 123); => 123
 * </pre>
 * @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 - numStr.length); i++) {
		zeroChars = zeroChars + "0";
	}

	return (zeroChars + numStr);
}

/**
 * @type   : function
 * @access : public
 * @desc   : element¸¦ disable ½ÃÅ²´Ù. GAUCEÀÇ Visual objectµéÀÌ ¸ðµÎ Æ÷ÇÔµÈ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 * 1. ÇÏ³ªÀÇ element¸¦ disable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfDisable( btn_save );
 *
 * 2. ¿©·¯°³ÀÇ element¸¦ disable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfDisable( [cc_sysTp, cc_msgTp, cc_msgUsecase, txt_msgContent] );
 *
 * </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;
      		oElement.style.cursor = "default";
			break;

		case "CHECKBOX" :
		case "RADIO" :
		case "RESET" :
		case "SELECT" :
		case "SUBMIT" :
			oElement.disabled = true;
			break;

		case "FILE" :
		case "PASSWORD" :
		case "TEXT" :
		case "TEXTAREA" :
		    oElement.style.background = GLB_DISABLE_COLOR;
		    oElement.style.color = "#666666";
		    //oElement.className = "input_textarea";
			oElement.readOnly = true;
			oElement.disabled = false;
			break;

		case "IMAGE" :
	      	oElement.disabled = true;
	      	oElement.style.cursor = "default";
			break;

		case "GE" :
			oElement.Enable = false;
			oElement.DisabledBackColor = GLB_DISABLE_COLOR;
			break;

		case "GCC" :
		case "GLC" :
			oElement.Enable = false;
			oElement.DisableBackColor = GLB_DISABLE_COLOR;
			break;

		case "GRDO" :
			oElement.Enable = false;
			oElement.Reset();
			break;
		case "GIF" :
		case "GTA" :
			oElement.Enable = false;
			break;

		default :
			break;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : element¸¦ enable ½ÃÅ²´Ù. GAUCEÀÇ Visual objectµéÀÌ ¸ðµÎ Æ÷ÇÔµÈ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 * 1. ÇÏ³ªÀÇ element¸¦ enable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfEnable( btn_save );
 *
 * 2. ¿©·¯°³ÀÇ element¸¦ enable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfEnable( [cc_sysTp, cc_msgTp, cc_msgUsecase, txt_msgContent] );
 *
 * </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);
	}
}

// È­¸é±ÇÇÑ¿¡ ´ëÇÑ Btn Á¦¾î ·ÎÁ÷ Ãß°¡(¼Û°æÁØ)
function cfEnableElement(oElement, argArr) {
	switch (cfGetElementType(oElement)) {
		case "BUTTON" :
			if( cfCheckBtnAuth(oElement)){
				oElement.disabled = false;
	     		oElement.style.cursor = "hand";
			}else{ //±ÇÇÑÀÌ ¾øÀ¸¸é
				cfDisable([oElement]);
			}
			break;

		case "CHECKBOX" :
		case "RADIO" :
		case "RESET" :
		case "SELECT" :
		case "SUBMIT" :
			oElement.disabled = false;
			break;

		case "FILE" :
		case "PASSWORD" :
		case "TEXT" :
		case "TEXTAREA" :
		    oElement.style.background = GLB_ENABLE_COLOR;
		    oElement.color = "#666666";
			oElement.readOnly = false;
			oElement.disabled = false;
			break;

		case "IMAGE" :
			if( cfCheckBtnAuth(oElement)){
				oElement.disabled = false;
				oElement.style.cursor = "hand";
			}else{ //±ÇÇÑÀÌ ¾øÀ¸¸é
				cfDisable([oElement]);
			}
			break;

		case "GE" :
			oElement.Enable = true;
			break;

		case "GCC" :
		case "GLC" :
			oElement.Enable = true;
			break;

		case "GRDO" :
			oElement.Enable = true;
			oElement.Reset();
			break;

		case "GIF" :
		case "GTA" :
			oElement.Enable = true;
			break;

		default :
			break;
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : button ElementÀÇ roleÁ¤º¸(C,R,U,D)¸¦ ÀÐ¾î¼­ ÇØ´ç È­¸é role(winRole)¿¡ Æ÷ÇÔµÇ¾îÀÖ´ÂÁö¸¦ checkÇÑ´Ù.
 * <pre>
 *           <input type .... role="C">
 *           <input type .... role="R">
 *           <input type .... role="CRUD">
 * </pre>
 * @sig    : oElement
 * @param  : oElement required element
 * @return : elementÀÇ Á¤ÀÇµÈ roleÀÌ È­¸é roleÁ¤º¸¿¡ ÀÖ´ÂÁöÀÇ ¿©ºÎ¸¦ check
 * @author : ¼Û°æÁØ
 */
 var winRole = "CRUD"; //Default È­¸é±ÇÇÑ

 function cfCheckBtnAuth(obj){
	// ÇØ´ç objectÀÇ role°ªÀ» °¡Á®¿Â´Ù.
 	var role = obj.role;

	// ÇØ´ç buttonÀÇ roleÀÌ µî·ÏµÇ¾î ÀÖÁö ¾Ê´Â °æ¿ì¿¡´Â ±ÇÇÑÀÖ´Â°É·Î °¡Á¤ÇÑ´Ù.
 	if( role == undefined || role.length == 0 )  return true;

	for( var i = 0 ; i < role.length ; i++){
		// role Cd°¡ roleInfo¿¡ ÀÖ´ÂÁö Check
		var tmp1 = role.charAt(i);
		var inx = winRole.indexOf(tmp1);
		if( inx >= 0) return true;
	}

    return false;
 }

/**
 * @type   : function
 * @access : private
 * @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 "IMG":
			return "IMAGE"
		case "SELECT":
			return "SELECT"
		case "TEXTAREA":
			return "TEXTAREA"
		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": // LuxeCombo 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ÀÌ´Ù.)
 * <pre>»ç¿ë¿¹ :
 *      cfGetByteLength( txt_empNm.value );
 *
 * </pre>
 * @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>
 * @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 = false;
					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
					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 : 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   : È­¸é»óÀÇ ÀÔ·Â°ú °ü·ÃµÈ ¿ÀºêÁ§Æ®¿¡ ´ëÇÑ À¯È¿¼º °Ë»ç¸¦ ½Ç½ÃÇÑ´Ù. À¯È¿¼º °Ë»ç¸¦ ¹Þ´Â ¿ÀºêÁ§Æ®µéÀº "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 : 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   : ÅØ½ºÆ® ¹Ú½º³»ÀÇ ¸ðµç ¹®ÀÚ¸¦ ´ë¹®ÀÚ·Î º¯È¯ÇØÁØ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 *     cfCharToUpper( txt_empCd );
 * </pre>
 * @sig    : txt_obj
 * @param  : HTML Text
 * @return : ´ë¹®ÀÚ
 * @author : Á¶µ¿Áø
 */
function cfCharToUpper( textObj ) {
  var code = textObj.value;

  for ( i = 0; i < textObj.value.length; i++ ) {
    if ((code.charAt(i)>unescape('%60')) && (code.charAt(i)<unescape('%7b'))) {
      textObj.value = code.toUpperCase();
      break;
    }
  }
}

/**
 * @type   : function
 * @access : public
 * @desc   : Input Box, TextArea, EMEditÀÇ °ªÀ» ÃÊ±âÈ­(Empty String)½ÃÅ°°í,<br>
 * Code ComboÀÇ index¸¦ 0À¸·Î ÃÊ±âÈ­ ½ÃÄÑÁØ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 * 1. ÇÏ³ªÀÇ element¸¦ enable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfInitiate( txt_msgContent );
 *
 * 2. ¿©·¯°³ÀÇ element¸¦ enable ½ÃÅ°°íÀÚ ÇÒ °æ¿ì
 *     cfInitiate( [cc_msgTpS, eme_registDate, txt_msgContent] );
 *
 * </pre>
 * @sig    : oElement
 * @param  : oElement required enable ÇÏ°íÀÚ ÇÏ´Â element È¤Àº element array
 * @author : Á¶µ¿Áø
 */
function cfInitiate(obj) {
	if (cfIsNull(obj)) {
		return;
	}

	if (obj.length != null) {
		for (var i = 0; i < obj.length; i++) {
			cfProcessChildElement(obj[i], cfInitiateElement);
		}
	} else {
		cfProcessChildElement(obj, cfInitiateElement);
	}
}

function cfInitiateElement(oElement, argArr) {
	switch (cfGetElementType(oElement)) {
		case "TEXT" :
		case "TEXTAREA" :
			oElement.value = "";
			break;

		case "GE" :
		case "GTA" :
			oElement.text = "";
			break;

		case "GCC" :
		case "GLC" :
			oElement.index = 0;
			break;

		case "CHECKBOX" :
			oElement.checked = false;
			break;

		default :
			break;
	}
}






//---------------------------------------- ÀÌÇÏ °´Ã¼¼±¾ð ------------------------------------------------------------------------------//

///////////////////////////// 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_001;
		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_024, ["@"]);

						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_024, ["@"]);

						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_002, ["@", 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_021, ["@", 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_005, ["@", 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_022, ["@", 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_006, ["@", 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_023, ["@", 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_004, ["@"]);
		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_028, ["@", String(this.iLength)]);
			return false;
		} else if (dNumStr.length > this.dLength) {
			this.message = new coMessage().getMsg(MSG_COM_ERR_029, ["@", 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_004, ["@"]);
		return false;
	}

	this.minNumber = Number(this.minNumber);
	value          = Number(value);

	if (value < this.minNumber) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_007, ["@", 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_004, ["@"]);
		return false;
	}

	this.maxNumber = Number(this.maxNumber);
	value          = Number(value);

	if (value > this.maxNumber) {
		this.message = new coMessage().getMsg(MSG_COM_ERR_008, ["@", 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_004, ["@"]);
		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_003, ["@", 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_012, ["@"]);
		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_018, 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_012, ["@"]);
		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_019, 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´Â °ø¹éÆ÷ÇÔ)
 * 				 n, N : ¿µ¹®ÀÌ³ª ¼ýÀÚ(NÀº °ø¹éÆ÷ÇÔ)
 * @sig    : format
 * @param  : format required Æ÷¸ä ½ºÆ®¸µ.
 * @author : ÀÓÀçÇö
 */
function covFormatValidator(format) {
	// data;
	this.message  = "";
	this.validity = false;
	this.format   = format

	// method
	this.validate = covFormatValidator_validate;
	this.checkAlphaNumeric = covFormatValidator_AlphaNumericValidate;
}

/**
 * @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_020, ["@", 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_020, ["@", 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_020, ["@", this.format]);
					return false;
				}
				break;

			case '0' : // ¼ýÀÚ(°ø¹é¾øÀ½)
				if (isNaN(value.charAt(i)) || value.charAt(i) == " ") {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;

			case '9' : // ¼ýÀÚ(°ø¹éÆ÷ÇÔ)
				if (isNaN(value.charAt(i))) {
					if (value.charAt(i) != " ") {
						this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
						return false;
					}
				}
				break;

			case 'A' : // ¿µ¹®(°ø¹é¾øÀ½)
				if ( (value.charAt(i) == " ") || !isNaN(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;

			case 'Z' : // ¿µ¹®(°ø¹éÆ÷ÇÔ)
				if ( (value.charAt(i) != " ") && !isNaN(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;

			case 'n' : // ¿µ¹®ÀÌ°Å³ª ¼ýÀÚ(°ø¹é¾øÀ½)
				if ( (value.charAt(i) == " ") || !this.checkAlphaNumeric(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;

			case 'N' : // ¿µ¹®ÀÌ°Å³ª ¼ýÀÚ(°ø¹éÆ÷ÇÔ)
				if ( (value.charAt(i) != " ") && !this.checkAlphaNumeric(value.charAt(i)) ) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;

			case '#' :
				break;

			default :
				if (value.charAt(i) != this.format.charAt(i)) {
					this.message = new coMessage().getMsg(MSG_COM_ERR_020, ["@", this.format]);
					return false;
				}
				break;
		}
	}

	this.validity = true;
	return true;
}

/**
 * @type   : method
 * @access : public
 * @object : covFormatValidator
 * @desc   : ¿µ¹® ÀÌ³ª ¼ýÀÚÀÎÁö¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.
 * @sig    : value
 * @param  : value required À¯È¿¼º °Ë»ç ´ë»ó°ª.
 * @return : boolean. À¯È¿¼º ¿©ºÎ.
 */
function covFormatValidator_AlphaNumericValidate(value) {

	if ((value >= '0' && value <= '9')) {
		// pass
	} else if ((value >= 'a' && value <= 'z')) {
		// pass
	} else if ((value >= 'A' && value <= 'Z')){
		// pass
	} else {
		this.message = new coMessage().getMsg(MSG_COM_ERR_011, ["@"]);
		return false;
	}

	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_010, ["@"]);
		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_010, ["@"]);
		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_010, ["@"]);
		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_011, ["@"]);
		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_011, ["@"]);
		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_026, ["@", 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_025, ["@", 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_027, ["@"]);
		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_002, ["@", 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_009, ["@"]);
			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_009, ["@"]);
			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_013, ["@"]);
			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_014, ["@"]);
			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_015, ["@"]);
			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_015, ["@"]);
			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_016, ["@"]);
			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_017, ["@"]);
			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;
}

/**
 * @type   : function
 * @access : public
 * @desc   : Ã³¸®Áß ¸Þ½ÃÁö È­¸éÀ» È£ÃâÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfShowWaiting(); => È­¸é¿¡ Ã³¸®ÁßÀÌ¶ó´Â ¸Þ½ÃÁö È­¸éÀÌ ³ªÅ¸³­´Ù.
 *	                       Á¶È¸, µî·Ï, ¼öÁ¤, »èÁ¦ Ã³¸® ½Ã¿¡ ¼­¹ö ·ÎÁ÷ È£Ãâ Á÷ÈÄ¿¡
 *                         ÀÌ ¸Þ¼Òµå¸£ È£ÃâÇØ ÁØ´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @author : ¼Û°æÁØ
 */
function cfShowWaiting() {

	if( _loadingWin != "undefined" && _loadingWin != null)
	    cfHideWaiting();
	    
	document.body.style.cursor="wait";
    centered = "yes"; // or "yes". relative position to the screen.
	xPos = 10; //absolute position from left. centered value mast be "no".
	yPos = 10; //absolute position from top. centered value mast be "no".
	botClose="/images/loading.gif"; // 14x14 px
	botClose_on="/images/loading.gif"; 
	botMinimize="/images/loading.gif"; //for popup object version.
	botMinimize_on="/images/loading.gif";  //for popup object version. SP1
	topBorder=0;
	botBorder=0;
	rightBorder=0;
	leftBorder=0;
	borderColor="#cccccc";  // for none: ""
	borderColorOn="#dddddd"; // for none: ""
	backGroundImage="/images/loading.gif"; // or "image.gif"
	titleImage=""; // if this is "image.gif", image.gif will be placed instead of the winTitle 
	titleFontFamily="±¼¸²";
	fontStyle= "normal";  // or "italic"
	titleFontSize= 9; 
	titleFontWeight="nolmal"; // or "nolmal"
	titleFontColor= "#000000";
	titleAlign= "top";  // or "top"  //also for close & minimize button
	scrollbars="no"; // or "no"
  
    _loadingWin = openwin('',scrollbars,170,80,'Loading..',botClose,botClose_on,botMinimize,botMinimize_on,topBorder,botBorder,rightBorder,leftBorder,borderColor,borderColorOn,backGroundImage,titleImage,titleFontFamily,fontStyle,titleFontSize,titleFontColor,titleFontWeight,titleAlign,centered,xPos,yPos);
}

/**
 * @type   : function
 * @access : public
 * @desc   : Ã³¸®Áß ÆäÀÌÁö ´Ý±â<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfHideWaiting(); => È­¸é¿¡ ³ªÅ¸³ª Ã³¸®ÁßÀÌ¶ó´Â ¸Þ½ÃÁö È­¸éÀ» »èÁ¦ÇÑ´Ù.
 *	                       Á¶È¸, µî·Ï, ¼öÁ¤, »èÁ¦ Ã³¸® ½Ã¿¡ Ã³¸® ·ÎÁ÷ÀÌ ³¡³­ ÈÄ¿¡
 *                         ÀÌ ¸Þ¼Òµå¸¦ È£ÃâÇÑ´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @author : ¼Û°æÁØ
 */
function cfHideWaiting() {
	 document.body.style.cursor="default";
	 if (_loadingWin != "undefined" && _loadingWin != null) {
	 	_loadingWin.close();
	 }
	 window.focus();
}

 /**
 * @type   : function
 * @access : public
 * @desc   : Ã³¸®Áß È­¸éÀ» ´ÙÀÌ³ª¹ÍÇÏ°Ô Ã³¸®ÇÑ´Ù.<br>
 * @author : ¾È½Â¿í
 */
function openwin(path,scrollbars,width,height,winTitle,botClose,botClose_on,botMinimize,botMinimize_on,topBorder,botBorder,rightBorder,leftBorder,borderColor,borderColorOn,backGroundImage,titleImage,titleFontFamily,fontStyle,titleFontSize,titleFontColor,titleFontWeight,titleAlign,centered,xPos,yPos)
{
	var navVersion      = window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5,window.navigator.appVersion.indexOf ("MSIE") + 8);
    var navPlatformWin  = window.navigator.platform.indexOf("Win32");
	var navName         = window.navigator.appName;
	var chromelessVersion = 0;

	if(navName=="Microsoft Internet Explorer" && navPlatformWin>=0)  /// Define ChromelessVersion
	{
		if (navVersion >= 4.0)
		{
			chromelessVersion = 1;
			if (navVersion >= 5.5)
			{
			chromelessVersion = 1;
			var spVersion = window.navigator.appMinorVersion.indexOf(";SP");
			if (navVersion >= 6.0 && spVersion>=0)
				{
				chromelessVersion = 2;
				}
			}
		}
	}

	w = leftBorder+width+rightBorder;
	h = topBorder+height+botBorder;
	if(centered=="yes"){myXpos=(screen.width-w)/2;myYpos=(screen.height-h)/2}else{myXpos=xPos;myYpos=yPos}

	if(chromelessVersion == 0)
	{
	win = window.open(path, "", "left="+myXpos+",top="+myYpos+",width="+width+",height="+height+",toolbar=0,scrollbars="+scrollbars+",resizable=0");
	win.focus();
	}
	else
	{

	if(titleAlign=="bottom"){align=(h-20)}else{align=8}
	if(titleImage!=""){titleContent='<img src='+titleImage+'>'}else{titleContent=winTitle}

	if(chromelessVersion == 1)
	{
	suportPopup=0;
	hiddenShowDiv="hidden";
	myIframe="show";
	win=window.open("","",'fullscreen');
	win.resizeTo(w,h);
	win.moveTo(myXpos,myYpos);
	}

	if(chromelessVersion == 2)
	{
	var suportPopup=1;
	var hiddenShowDiv="show";
	var myIframe="hidden";
	win=window.open("","",'width=100,height=100,scrollbars='+scrollbars+',left=0,top=3000');
	}
	var parentCode=''+
	'<html><head><title>'+winTitle+'</title>'+
	'<script language="JavaScript" type="text/javascript"\>'+
	'iev='+suportPopup+';'+
	'g=1;'+
	'x='+myXpos+';'+
	'y='+myYpos+';'+
	'if(iev)'+
	'{'+
	'popup = window.createPopup();'+
	'}'+
	'popupCode =\'\'+'+
	'\'<html><head><title></title>\'+'+
	'\'<script language=\"JavaScript\" type=\"text/javascript\"\>\'+'+
	'\'iev='+suportPopup+';\'+'+
	'\'myX = \'+x+\';\'+'+
	'\'myY= \'+y+\';\'+'+
	'\'document.onselectstart=new Function(\"return false;\");\'+'+
	'\'document.ondragstart=new Function(\"return false;\");\'+'+
	'\'document.oncontextmenu=new Function(\"return false;\");\'+'+
	'\'document.onmousemove=move;\'+'+
	'\'estatus=\"up\";\'+'+
	'\'function move()\'+'+
	'\'{\'+'+
	'\'if(estatus==\"down\")\'+'+
	'\'{\'+'+
	'\'x=event.x;\'+'+
	'\'y=event.y;\'+'+
	'\'estatus=\"drag\";\'+'+
	'\'}\'+'+
	'\'else if(estatus==\"drag\")\'+'+
	'\'{\'+'+
	'\'myX=(event.screenX-x);\'+'+
	'\'myY=(event.screenY-y);\'+'+
	'\'if(iev)\'+'+
	'\'{\'+'+
	'\'parent.popup.show(myX,myY,'+w+','+h+');\'+'+
	'\'}\'+'+
	'\'else\'+'+
	'\'{\'+'+
	'\'self.moveTo(myX,myY,'+w+','+h+');\'+'+
	'\'}\'+'+
	'\'}\'+'+
	'\'else\'+'+
	'\'{\'+'+
	'\'top.window.x=myX;\'+'+
	'\'top.window.y=myY;\'+'+
	'\'estatus=\"up\";\'+'+
	'\'}\'+'+
	'\'}\'+'+
	'\'</script\\>\'+'+
	'\'<style type=\"text/css\">\'+'+
	'\'BODY{border:0px;}\'+'+
	'\'#pages{position:absolute;left:'+leftBorder+'px; top:'+topBorder+'px;visibility:'+hiddenShowDiv+';width:'+width+'px;height:'+(height+1)+'px;z-index:4;}\'+'+
	'\'#myIframe{position:absolute;left:'+leftBorder+'px; top:'+topBorder+'px;visibility:'+myIframe+';width:'+width+'px;height:'+(height+1)+'px;z-index:4;}\'+'+
	'\'#clos{position:absolute;left:'+(w-20)+'px;top:'+align+'px;width:14;height:14;border:0px;z-index:3;}\'+'+
	'\'#min{position:absolute;left:'+(w-38)+'px;top:'+align+'px;visibility:'+hiddenShowDiv+';width:14;height:14;border:0px;z-index:3;}\'+'+
	'\'#windowDrag{position:absolute;left:0px; top:0px; width:100%;height:100%;z-index:2;}\'+'+
	'\'#title{font-family:'+titleFontFamily+';font-style:'+fontStyle+';font-weight:'+titleFontWeight+';font-size:'+titleFontSize+'pt;color:'+titleFontColor+';position:absolute;left:8px; top:'+align+'px; width:550px;height:20px;z-index:1;}\'+'+
	'\'#backgroundImage{position:absolute;left:0px; top:0px; width:100%; background-image:url('+backGroundImage+');height:100%;z-index:0;}\'+'+
	'\'</style>\'+'+
	'\'</head>\'+'+



   '\'<body bgcolor=#E7EBEF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><table width=170 height=80 border=0 cellpadding=7 cellspacing=0>\'+'+
   '\'<tr><td><table width=100% height=100% border=0 cellpadding=0 cellspacing=0>\'+'+
   '\'<tr><td width=5 rowspan=2><img src=/images/load_l.gif></td><td height=34 align=center valign=bottom bgcolor=#FFFFFF>\'+'+
   '\'<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=115 height=15>\'+'+
   '\'<param name=movie value=/images/loading.swf>\'+'+
   '\'<param name=menu value=false><param name=quality value=high>\'+'+
   '\'<embed src=/images/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=142 height=25></embed></object></td>\'+'+
   '\'<td width=5 rowspan=2><img src=/images/load_r.gif></td></tr>\'+'+
   '\'<tr><td height=33 align=center bgcolor=#FFFFFF><img src=/images/load_txt.gif></td></tr>\'+'+
   '\'</table></td></tr></table>\'+'+


	'\'</body>\'+'+
	'\'</html>\';'+
	'function showPopup()'+
	'{'+
	'if(iev)'+
	'{'+
	'popup.show(x,y,'+w+','+h+');'+
	'if(g)'+
	'{'+
	'popup.document.open();'+
	'popup.document.write(popupCode);'+
	'popup.document.close();'+
	'g=0;'+
	'}'+
	'}else{'+
	'document.open();'+
	'document.write(popupCode);'+
	'document.close();'+
	'}'+
	'}'+
	'onfocus = function(){if(g){showPopup();}else{showPopup();if(top.opener&&!top.opener.closed){top.opener.window.focus()};top.window.blur()}}'+
	'</script\>'+
	'</head>'+
	'<body>'+
	'</body>'+
	'</html>';
	win.document.open();
	win.document.write(parentCode);
	win.document.close();
	win.focus();
	}
	return win;
}	

/**
 * @type   : function
 * @access : public
 * @desc   : ÇØ´ç¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "YYYYMMDD" ÇüÅÂ·Î °¡Á®¿Â´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetFirstDate(); => ÇØ´ç ¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "20030301" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @return : ÇØ´ç¿ùÀÇ Ã¹Â° ³¯Â¥(YYYYMMDD)
 * @author : ÀåÈñÁ¤
 */
	function cfGetFirstDate()
	{
		var day = new Date();
		var year = day.getFullYear();
		var month = day.getMonth() + 1;

		if ( month < 10 )
		{
			month = "0" + month;
		}

		var firstDate = year + "" + month + "01";

		return firstDate;
	}

/**
 * @type   : function
 * @access : public
 * @desc   : ÇØ´ç¿ùÀÇ ¸¶Áö¸· ³¯Â¥¸¦ "YYYYMMDD" ÇüÅÂ·Î °¡Á®¿Â´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetLastDate(); => ÇØ´ç ¿ùÀÇ ¸¶Áö¸· ³¯Â¥¸¦ "20030331" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @return : ÇØ´ç¿ùÀÇ ¸¶Áö¸· ³¯Â¥(YYYYMMDD)
 * @author : ÀåÈñÁ¤
 */
	function cfGetLastDate()
	{
		var day = new Date();
		var year = day.getFullYear();
		var month = day.getMonth() + 1;

		var lastDate =year + "" + month + cfGetLastDay(year,month);

		return lastDate;
	}

/**
 * @type   : function
 * @access : public
 * @desc   : Àü¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "YYYYMMDD" ÇüÅÂ·Î °¡Á®¿Â´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetFirstDate(); => Àü¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "20030301" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @return : Àü¿ùÀÇ Ã¹Â° ³¯Â¥(YYYYMMDD)
 * @author : ÀåÈñÁ¤
 */
	function cfGetPrivFirstDate()
	{
		var day = new Date();
		var year = day.getFullYear();
		var month = day.getMonth() ;

		if ( month < 10 )
		{
			month = "0" + month;
		}

		var firstDate = year + "" + month + "01";

		return firstDate;
	}
/**
 * @type   : function
 * @access : public
 * @desc   : ÇØ´ç¿ùÀ» "YYYYMM" ÇüÅÂ·Î °¡Á®¿Â´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetThisMonth(); => ÇØ´ç ¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "200303" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @return : ÇØ´ç¿ù(YYYYMM)
 * @author : ÀåÈñÁ¤
 */
	function cfGetThisMonth()
	{
		var day = new Date();
		var year = day.getFullYear();
		var month = day.getMonth() + 1;

		var thisMonth = year + "" + month ;

		return thisMonth;
	}
/**
 * @type   : function
 * @access : public
 * @desc   : Àü¿ùÀ» "YYYYMM" ÇüÅÂ·Î °¡Á®¿Â´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetPrivMonth(); => Àü ¿ùÀÇ Ã¹Â° ³¯Â¥¸¦ "200303" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : none
 * @return : Àü¿ù(YYYYMM)
 * @author : ÀåÈñÁ¤
 */
	function cfGetPrivMonth()
	{
		var day = new Date();
		var year = day.getFullYear();
		var month = day.getMonth() ;

		var privMonth = year + "" + month ;

		return privMonth;
	}

/**
 * @type   : function
 * @access : public
 * @desc   : °Ç¼ö¸¦ ³ªÅ¸³»´Â TEXT¸¦ ¸¸µç´Ù..<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(5); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ¼Û°æÁØ
 */
	function cfGetCntText(cnt)
	{
		return "ÃÑ (" + cnt + ") °Ç";
	}

 /**
 * @type   : function
 * @access : public
 * @desc   : °Ç¼ö¸¦ ³ªÅ¸³»´Â TEXT¸¦ ¸¸µç´Ù..´Ü subsum Àº Á¦¿ÜÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : Á¤ÈÆ±Ô
 */
	function cfGetCntTextExceptSum(gds)
	{
		var realCnt=0;
		for(i=1;i<=gds.CountRow;i++){
			if(gds.SysStatus(i)==4)
				continue;
			realCnt++;
		}
		return cfGetCntText(realCnt);
	}

 /**
 * @type   : function
 * @access : public
 * @desc   : °Ç¼ö¸¦ ³ªÅ¸³»´Â TEXT¸¦ ¸¸µç´Ù..´Ü subsum Àº Á¦¿ÜÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : Á¤ÈÆ±Ô
 */

function cfNavi(naviid){
	var url
	url = "/navi/navi_popup.asp?naviid=" + naviid;
	newin(540, 637, url, '³×ºñ°ÔÀÌÅÍ', 200, 200);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : °Ç¼ö¸¦ ³ªÅ¸³»´Â TEXT¸¦ ¸¸µç´Ù..´Ü subsum Àº Á¦¿ÜÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : Á¤ÈÆ±Ô
 */

function cfShopLog(shoplogid, sUrls, id){
	var url = "/shopad/shopad_default.asp?shoplogid=" + shoplogid + "&sUrls=" + sUrls.replace("&", "%^%") + "&id=" + id;
	var left = (screen.width / 2) - 425;
	var top = (screen.height / 2) - 295;
	newin(850, 550, url, '¼¥·Î±×', top, left);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapCoordinate(SidoName, SigunguName, DongName){
	var url
	url = "/info/map_popup.asp?SidoName=" + SidoName + "&SigunguName=" + SigunguName + "&DongName=" + DongName;

	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapAdmin(){
	var url
	url = "/info/map_admin.asp"
	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}

function cfMapAdmin2(sidoname, gu_name, dong_name, zipcode){
	var url
	url = "/info/map_admin.asp?SidoName=" + sidoname + "&SigunguName=" + gu_name + "&DongName=" + dong_name + "&zipCode=" + zipcode;
	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfMapUserShow(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapUserShow(Msg, mapx, mapy, symbolID, shoplogid){
	if(mapx == "" || mapy == ""){
		alert("ÁöµµÁ¤º¸ÀÔ·Â ÀüÀÔ´Ï´Ù.");
	}else{
	var url
	url = "/info/MapDefault.asp?Msg=" + Msg + "&mapx=" + mapx + "&mapy=" + mapy + "&symbolID=" + symbolID + "&shoplogid=" + shoplogid;

	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
	}
}

function cfMapUserShow2(shoplogid){
	var url
	url = "/info/MapDefault.asp?shoplogid=" + shoplogid;

	newin(screen.width - 10, screen.height - 57, url, 'Áöµµº¸±â', 0, 0);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfMapUserShow(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapAdminPostCode(PostCode, shoplogid, shopname){
	var url
	url = "/info/map_admin_postcode.asp?PostCode=" + PostCode + "&shoplogid=" + shoplogid + "&shopname=" + shopname;

	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfMapUserShow(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapAdminXY(mapx, mapy, shoplogid){
	var url
	url = "/info/map_admin_xy.asp?mapx=" + mapx + "&mapy=" + mapy + "&shoplogid=" + shoplogid;

	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}


 /**
 * @type   : function
 * @access : public
 * @desc   : ÁÂÇ¥¸¦ Â÷À»¼ö ÀÖ´Â ¸ÊÃ¢
 * <pre>»ç¿ë¿¹ :
 *
 *     cfMapInfoXY(mapx, mapy, signboard); => 
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : ±è¿ìÇõ
 */

function cfMapInfoXY(mapx, mapy, signboard){
	var url
	url = "/info/map_info_xy.asp?mapx=" + mapx + "&mapy=" + mapy + "&signboard=" + signboard;

	newin(screen.width - 10, screen.height - 57, url, 'ÁÖ¼ÒÃ£±â', 0, 0);
}



 /**
 * @type   : function
 * @access : public
 * @desc   : °Ç¼ö¸¦ ³ªÅ¸³»´Â TEXT¸¦ ¸¸µç´Ù..´Ü subsum Àº Á¦¿ÜÇÑ´Ù.<br>
 * <pre>»ç¿ë¿¹ :
 *
 *     cfGetCntText(GauceDataSet); => °Ç¼ö¸¦ "ÃÑ (?) °Ç" ÇüÅÂ·Î °¡Á®¿Â´Ù.
 * </pre>
 * @sig    :
 * @param  : °Ç¼ö
 * @return : ÃÑ ( ) °Ç
 * @author : Á¤ÈÆ±Ô
 */

function newin(width,height,url,name,top,left) {
	msgWindow=window.open(url,name,'statusbar=no,scrollbars=no,status=no,resizable=no,width='+width+',height='+height+',top='+top+',left='+left);
	window.msgWindow.focus();
	msgWindow.opener = self;
	if(parseInt(navigator.appVersion) >= 4){msgWindow.window.focus();}
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ÀüÈ­¹øÈ£ÀÇ Á¤È®ÇÑ ÀÚ¸´¼ö¸¦ Ã¼Å©ÇØ³½´Ù
 * <pre>»ç¿ë¿¹ :
 *		if(!cfPhoneValidator(parentform.phone.value)){
 *			alert("ÀüÈ­¹øÈ£ ¾ç½Ä¿¡ ¸ÂÃç ÀÔ·ÂÇØ ÁÖ¼¼¿ä. ¡Ø¿¹) 02-2658-8845");
 *			document.parentform.phone.focus();
 *		}else{
 *			searchShoplogid()	
 *		}
 *
 *     cfPhoneValidator(PhoneNumber)
 * </pre>
 * @sig    :
 * @param  : ÀüÈ­¹øÈ£
 * @return : ture/false
 * @author : ±è¿ìÇõ
 */

function cfPhoneValidator(PhoneNumber){
	var intNumber
	if(cfCheckNumericWithFilter(PhoneNumber)){
		intNumber = PhoneNumber.split("-")
		if(intNumber.length == 2){
			if(intNumber[0].length == 4 && intNumber[1].length == 4){
				return true;
			}else{
				return false;
			}
		}else if(intNumber.length == 3){
			if((intNumber[0].length == 2 || intNumber[0].length == 3) && (intNumber[1].length == 3 || intNumber[1].length == 4) && intNumber[2].length == 4){
				return true;
			}else{
				return false;
			}
		}else{
			return false;
		}
	}else{
		return false;
	}
}



 /**
 * @type   : function
 * @access : public
 * @desc   : ÅÂ±× »ç¿ëÀ» Á¦ÇÑÇÕ´Ï´Ù.
 * <pre>»ç¿ë¿¹ :
 * function tagCheck() {
 *		ToCheck = document.form.subject.value;
 *		Checked = tagDel(ToCheck);
 *		document.form.subject.value = Checked;
 *	}
 *     tagDel(Word)
 * </pre>
 * @sig    :
 * @param  : textfield °ª
 * @return :  ÅÂ±×¸¦ Á¦¿ÜÇÑ ¹®ÀÚ
 * @author : ¾ÈÇöÁ¤
 */

function tagDel(Word) {
	a = Word.indexOf("<");
	b = Word.indexOf(">");
	len = Word.length;
	c = Word.substring(0, a);
	if(b == -1)
		b = a;
	d = Word.substring((b + 1), len);
	Word = c + d;
	tagCheck1 = Word.indexOf("<");
	if(tagCheck1 != -1)
		Word = tagDel(Word);
	return Word;
}

 /**
 * @type   : function
 * @access : public
 * @desc   : ¸Þ´ºÀÌµ¿
 * @sig    :
 * @param  : int (¸Þ´º¹øÈ£)
 * @return :  ¾øÀ½
 * @author : ÇÑ¼÷Èñ
 */

function goTop() {
	top.location.href='/';
}

function goTopMenu(no) {
	var aMenu=[
	'/main.asp'

	,'/shoplog/'
	,'/event/200505/'
	,'/event/jejutour/aut_cartel.asp'
	,'/info/'
	,'/navi/'
	,'/my/'
	];
	top.mainFrame.location.href=aMenu[no];
}

function goTopURL(URL) {
	top.location.href=URL;
}

/*¸µÅ© Å×µÎ¸®Á¡¼± ¸ðµÎ ¾ø¾Ö±â */
function bluring(){ 
        if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
        document.body.focus(); 
} 
document.onfocusin=bluring; 


//-- ÀÏ¹ÝÀûÀ¸·Î ´Ü¼øÇÑ ÇÃ·¡½¬ ÀÏ °æ¿ì2
/*
	-- ÆÄ¶ó¹ÌÅÍ Á¤º¸ --

	width : °¡·ÎÅ©±â
	height : ¼¼·ÎÅ©±â
	url : ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
	fvalues : ÆÄ¶ó¹ÌÅÍ °ª
*/


function swfView(width, height, url, fvalues){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
	document.write("		codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='transparent'> ");
	document.write("	<param name='flashVars'			value='"+fvalues+"'/> ");  
	document.write("	<embed src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' ");
	document.write("		allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}



var imgObj = new Image();
function showImgWin(imgName) {
  imgObj.src = imgName;
  setTimeout("createImgWin(imgObj)", 100);
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 100);
    return;
  }
  imageWin = window.open("", "imageWin",
    "width=" + imgObj.width + ",height=" + imgObj.height);
  imageWin.document.write("<html><title>Á÷°Å·¡¿©ÇàÁ¤º¸-¿ÀÇÂÁ¦ÁÖµµ</title><body style='margin:0'>");
  imageWin.document.write("<img src='" + imgObj.src + "' onClick='javascript:window.close()'>");
  imageWin.document.write("</body><html>");
  }
