//@ .length°¡ ºÒÇÊ¿äÇÑ ºÎºÐ¿¡ ´ëÇØ idx style·Î ÀçÁ¤ÀÇ
//@ °¢ keywordº°·Î detach method¿¡ ´ëÇÑ °íÂû.


/**
 * @(#) xjos.js version v4.00 korean(¿¢Á¶½º3) build a 100
 *
 *  Copyright(ÀúÀÛ±Ç) Notice! Do Not Erase This Comment!!! (ÀÌ ÁÖ¼®¹®À» Áö¿ìÁö ¸»°Í)
 *
 *  This xjos.js and xjos.css is used for making easy to validate form fields
 *  to develop enterprise web application.
 ** Some functionality does not works in Netscape, so use Internet Explorer is recommanded.
 ** In case of this comment be keeped, you can use and modificate this source freely.
 ** when you would modified this script source,
 ** you should update all related in-line documents and version information
 ** If you feel that your modification is good to enough,
 ** plz feel free send your source to early authors.
 ** also you can add your name on the authors list.
 *  for detailed function lists and references, see user's guide and developer's guide at http://www.lafj.net
 *  Do Not re-distribute with-out permission. especially out-side of LG-CNS.
 *
 **  caution! : xjos3 is not just an upgrade vesion of xjsv2!
 **            xjos3 support minimum keyword compatibility to xjsv2
 **            there are so many changes made. especially internal enigne functions
 **            and many Javascrit API level supports.
 **            so, use xjos3 to a new project is recommanded not upgrade from xjsv2
 **
 *  ÀÌ xjos.js ¹× xjos.css´Â DHTML°ú J-½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÏ¿© ±â¾÷È¯°æ
 *  À¥ ÀÀ¿ëÇÁ·Î±×·¥¿¡¼­ÀÇ Æû ÇÊµå À¯È¿¼º °Ë»ç¸¦ ½±°Ô ÇÏ´Âµ¥ »ç¿ëµÈ´Ù.
 ** ÀÏºÎ±â´ÉÀº ³Ý½ºÄÉÀÌÇÁ¿¡¼­ ÀÛµ¿µÇÁö ¾ÊÀ»¼öµµ ÀÖÀ¸¸ç ÀÍ½ºÇÃ·Î¸¦ »ç¿ëÇÏ´Â°ÍÀ» ±ÇÀåÇÑ´Ù.
 ** ÀÌ ÁÖ¼®¹®ÀÌ À¯ÁöµÇ´ÂÇÑ ¸¶À½²¯ ÀÌ ¼Ò½º¸¦ º¯°æ ¹× »ç¿ëÇÒ ¼ö ÀÖ´Ù.
 ** ÀÌ ½ºÅ©¸³Æ® ¼Ò½º°¡ ¼öÁ¤µÇ´Â °æ¿ì ¸ðµç in-line document¿Í ¹öÁ¯ Á¤º¸´Â ¼öÁ¤µÇ¾î¾ß ÇÑ´Ù.
 ** ¸¸¾à ´ç½ÅÀÇ º¯°æ»çÇ×ÀÌ ¸¶À½¿¡ µå´Â °æ¿ì ´ç½ÅÀÇ ¼Ò½º¸¦ ±âÁ¸ º¯°æÀÚµé¿¡°Ô º¸³»´Âµ¥
 ** ºÎ´ãÀ» ´À³¥ ÇÊ¿ä´Â ¾ø´Ù.
 ** ¶ÇÇÑ ´ç½ÅÀÇ ÀÌ¸§À» ÀúÀÚ¸ñ·Ï¿¡ Ãß°¡ÇÒ ¼öµµ ÀÖ´Ù.
 *  °¢ Æã¼Çµî¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº http://www.lafj.netÀÇ »ç¿ëÀÚ °¡ÀÌµå ¹× °³¹ßÀÚ °¡ÀÌµå¸¦ Âü°íÇÏ¶ó.
 *  Çã°¡ ¾øÀÌ Àç¹èÆ÷ ÇØ¼­´Â ¾ÈµÈ´Ù. Æ¯È÷ LG-CNSÀÇ ¿ÜºÎ·Î À¯ÃâÀ» ÇÏ¿©¼­´Â ¾ÈµÈ´Ù.
 *
 **  ÁÖÀÇ! : ±âÁ¸ÀÇ 2.xx¹öÁ¯(xjsv)¿Í´Â ÃÖ¼ÒÇÑÀÇ keyword»óÀÇ È£È¯¼º¸¸ Á¦°øµÈ´Ù.
 **          xjsvÀÇ ³»ºÎ function µîÀÇ Á¤ÀÇ¿¡ °ü·ÃµÈ »çÇ×µéÀº ¸¹Àº ºÎºÐÀÌ º¯°æµÇ¾úÀ¸¹Ç·Î
 **          ½Å±Ô°³¹ß¿¡¸¸ Àû¿ëÇÏ±â¸¦ ±ÇÇÑ´Ù.
 **          ±âÁ¸ÀÇ 2.xx¹öÁ¯±îÁöÀÇ history´Â xjsv.js¸¦ Âü°íÇÏ¶ó.
 **
 * AUTHORS LIST       E-MAIL                   HOMEPAGE
 * SungJo Kim         javalife@korea.com       http://
 * Park Su hyun       shypark@lgcns.com        http://
 * TK Shin            lovemine@nownuri.net     http://www.lovemine.pe.kr
 **
 ** MODIFICATION HISTORY
 ** DATE       Version    DEVELOPER        DESCRIPTION
 ** 2000/04/04 1.0        SungJo Kim       Initial Release (common.js)
 ** 2000/09/15 1.1        Park Su hyun
 ** 2000/10/30 1.2        SungJo Kim
 ** 2001/06/13 1.5        TK Shin          change to Document Object Model
 ** 2001/07/12 2.0        TK Shin          Adding componets
 ** 2002/03/xx 3.00       TK Shin          Reconstruct xjsv to xJos / Change internal xJos engine / Supports APIs
 ** 2003/04/24 3.10       TK Shin          Reconstruct all validation methos for support check-only routine
 ** 2003/04/24 3.11       TK Shin          alter keyword supporting
 ** 2003/04/28 3.12       TK Shin          beforeValidation/afterValidation keyword support
 ** 2003/05/02 3.13       TK Shin          sync keyword supporting
 ** 2003/05/14 3.14       TK Shin          selected_duih keyword support
 ** 2003/05/27 3.15       TK Shin          beforeFocus keyword support (change to beforeAlert)
 ** 2003/05/30 3.20       TK Shin          beforeAlert keyword support (beforeFocus Depreciated)
 ** 2003/07/15 3.21       TK Shin          ddd/hpd keyword support
 ** 2003/07/22 3.22       TK Shin          case keyword support
 ** 2003/07/22 3.30       TK Shin          refactor looping logic
 **
 ** MODIFICATION HISTORY (Build detailed)
 ** DATE        Version       BUILD  DESCRIPTION
 ** 2002.07.23 (v3.00 build a 100) : masking event repack
 ** 2002.07.24 (v3.00 build a 101) : focus_this repack
 ** 2002.08.05 (v3.00 build a 102) : X_SUPPORT_HIDDEN_TYPE option
 ** 2002.09.19 (v3.00 build a 103) : em_event_handler (srcObj.xObject[idx] Eval)
 ** 2002.10.01 (v3.00 build a 104) : fm_validat/fm_serve_submit (X_VALIDATION_ACTIVATE Option style)
 ** 2002.10.01 (v3.00 build a 110) : ff_initialize (onsubmit event handler type) -> onSubmitHandler (changed)
 ** 2002.10.01 (v3.00 build a 111) : form.copyToArray BugFix (when X_SUPPORT_HIDDEN_TYPE Option false)
 ** 2002.11.08 (v3.00 build a 112) : prevent focusing When Hidden Fields get Error
 ** 2003.02.04 (v3.00 build a 113) : Bug fix (form.elements collection contain OBJECT tags) notified by forsun@korea.com - thanks :)
 ** 2003.03.18 (v3.00 build a 120) : element.getUnmasked() method implement. this method get value after clear all X_DELIMITER_CHAR
 ** 2003.04.07 (v3.00 build a 121) : x_dek_popup_on_mouse_move function fix (scroll bar bug) notified by jyounkim@lgcns.com - thanks :)
 ** 2003.04.24 (v3.10 build a 130) : minor version up to 3.10 (validate method change)
 ** 2003.04.24 (v3.11 build a 140) : minor version up to 3.11 (alter keyword support) - base idea from Lee Sang Soo(sanglee@lgcns.com) - thanks :)
 ** 2003.04.28 (v3.12 build a 150) : minor version up to 3.12 (beforeValidation/afterValidation keyword support)
 ** 2003.05.02 (v3.13 build a 160) : minor version up to 3.13 (sync keyword support) - base idea from Lee Sang Soo(sanglee@lgcns.com) - thanks :)
 ** 2003.05.14 (v3.13 build a 161) : element.amIhide() method implement. this method find element is hide even it hiding from element hierarchy
 ** 2003.05.14 (v3.14 build a 170) : minor version up to 3.14 (selected_duih keyword support) - base idea from (happypark@lgcns.com) - thanks :)
 ** 2003.05.27 (v3.15 build a 180) : minor version up to 3.15 (beforeFocus keyword support) - base idea from (happypark@lgcns.com) - thanks :)
 ** 2003.05.27 (v3.15 build a 181) : (X_VALIDATE_ON_HIDE/X_VALIDATE_ON_READONLY options support) - base idea from (happypark@lgcns.com) - thanks :)
 ** 2003.05.29 (v3.15 build a 182) : Bug fix (focusing error occurs when element is hided by element hierarchy)
 ** 2003.05.30 (v3.20 build a 190) : minor version up to 3.20 (change alerting style) & (beforeAlert keyword support instead beforeFocus)
 ** 2003.05.30 (v3.20 build a 191) : minor bugfix at element.alert() method
 ** 2003.07.15 (v3.21 build a 200) : ddd/hpd keyword support (requested from LG-CARD prj)
 ** 2003.07.16 (v3.21 build a 201) : stop appling element.select() when element is textarea - base idea from (hhlee@lgcns.com) - thanks :)
 ** 2003.07.22 (v3.22 build a 210) : minor version up to 3.22 (case keyword support) - base idea from (johylee@lgcns.com) - thanks :)
 ** 2003.07.23 (v3.22 build a 211) : Bug fix (MakeCompact.java miss a line at detachX bug)
 ** 2003.07.25 (v3.22 build a 220) : required style change (add mute attribute) - base idea from Lee Sang Soo(sanglee@lgcns.com) - thanks :)
 ** 2003.07.26 (v3.22 build a 221) : fix (make autofocus don't move focus when arrow keys(include home/end/pgup/pgdn) entered)
 ** 2003.07.28 (v3.22 build a 230) : X_DELIMITER_NUMBER option support (this delimiter exclude . -)
 ** 2003.07.28 (v3.22 build a 231) : money keyword is enhanced. now money support . - & validate method
 ** 2003.07.29 (v3.22 build a 232) : changed element.getUnmasked() to support money type masking
 ** 2003.07.29 (v3.22 build a 233) : ee_mask_masking is changed to simple logic
 ** 2003.07.29 (v3.22 build a 240) : form.refreshX() / element.refreshX() method implements
 ** 2003.07.29 (v3.22 build a 300) : all functions have build version it self on comment
 ** 2003.07.29 (v3.22 build a 301) : fix (make autofocus don't move focus when all special keys entered)
 ** 2003.07.30 (v3.22 build a 302) : case keyword support onpaste event
 ** 2003.07.30 (v3.22 build a 303) : element.addXObj() will don't work when no-existence class is assigned
 ** 2003.07.30 (v3.22 build a 304) : fix (element.clearX() mehtod erase xObject CSS class also)
 ** 2003.09.19 (v3.22 build a 305) : many chages for engine (all chages are droped)
 ** 2003.11.14 (v3.22 build a 306) : going back to v3.22 build a 304
 ** 2003.11.14 (v3.22 build a 307) : fix ( xFactory() didn't blocking type 1 xa_support_matrix)
 ** 2003.11.14 (v3.22 build a 308) : xDek Div Tag Object, now run as singleton style
 ** 2003.11.14 (v3.30 build a 389) : element.alert change to element.alertMsg
 ** 2003.11.14 (v3.30 build a 400) : refactor looping logic for performance
 ** 2003.12.17 (v3.30 build a 401) : bugfix element.eventHandler() for refacor bug
 ** 2004.01.29 (v3.30 build a 402) : em_attach_x_object is call element.getXObj(xKey)) but this method is dropped at v3.22 a 305
 **
 */

////////////////////////////////////////////////////////////////////////////////////////////////
///   version up ±ÔÄ¢ v3.11 a 140 ->vA.BC D EFG
///   A:¿ÏÀüÈ÷´Ù¸¥ÄÁ¼Á B:±¸Á¶Àûº¯È­ C:Å°¿öµåÃß°¡µî
///   D:a(¾ËÆÄ¹öÁ¯), b(º£Å¸¹öÁ¯), ¾øÀ» °æ¿ì Á¤½Ä
///   EF:±â´É°³¼±µîÀ» Ç¥ÇöÇÏ´Â seq, G:bug-fixµîÀ» Ç¥ÇöÇÏ´Â seq
////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///   xJos Internal Resource Bundles
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var xaOptionTable = {

  /**** General Options *******************************************************************************************/
  "X_ACTIVATE"               : true,
  "X_SHOW_ELAPSED"           : true,
  "X_SUPPORT_HIDDEN_TYPE"    : true,
  "X_COLOR_SET_USE_CSS"      : false,
  "X_ALLOW_MULTI_CREATE"     : false,
  "X_DISABLE_ON_HIDE"        : true,
  "X_ERASE_VALUE_ON_DISABLE" : true,

  /**** Submit Process Options ************************************************************************************/
  "X_HOOK_SUBMIT_EVENT_ACTIVATE" : true,
  "X_VALIDATION_ACTIVATE"        : true,
  "X_DYNAMIC_SEND_VALUE"         : true,
  "X_DYNAMIC_ACTION_URL"         : true,
  "X_DISABLE_SUBMIT_ON_SUBMIT"   : true,
  "X_DISABLE_SUBMIT_TIMEOUT"     : 3000,
  "X_DISABLE_SUBMIT_TYPE"        : "submit,button",

  /**** Performance Options ***************************************************************************************/
  "X_RESTRICT_APPLY"       : false,
  "X_BINDING_RULE_APPLY"   : true,

  /**** Validation Options ****************************************************************************************/
  "X_VALIDATE_ON_MASK"         : true,
  "X_VALIDATE_ON_HIDE"         : true,
  "X_VALIDATE_ON_READONLY"     : true,
  "X_VALIDATE_ON_DISABLED"     : true,
  "X_VALIDATE_DO_ALERT"        : true,
  "X_VALIDATE_DO_ERROR_ACTION" : true,
  "X_VALIDATE_DO_TRIM_VALUE"   : true, //! trim_this·Î º¯°æ?

  /**** Keyword Options *******************************************************************************************/
  "X_REQUIRED_IGNORE_WHITESPACE" : true,
  "X_FOCUS_THIS_USE_TIMEOUT"     : 30, //use -1, for focus_this not use timeout
  "X_DAYS_IN_MONTH"              : [31,28,31,30,31,30,31,31,30,31,30,31],
  "X_CSN_MULTIPLIERS"            : [1,3,7,1,3,7,1,3,5],
  "X_FSN_MULTIPLIERS"            : [2,3,4,5,6,7,8,9,2,3,4,5],
  "X_AUTO_FOCUS_FKEY"            : [229,16,17,18,21,25,9,8,37,38,39,40,33,34,35,36,45,91,93,19,20,144,145], //0,8,46
  "X_STRIP_WHITE_SPACE_CHAR"     : /\s/g,
  "X_STRIP_SPECIAL_CHAR"         : /(\(|\)|\[|\]|\{|\}|\<|\>|\"|\'|\`|\~|\$|\!|\#|\%|\^|\&|\@|\,|\.|\;|\:|\\|\/|\||\*|\=|\-|\?)*/g, // ( ) [ ] { } < > " ' ` ~  $ ! # % ^ & @  , . ; :  \ / |  * = - ?
  "X_HPD"                        : ["011", "016", "017", "018", "019", "0130"],
  "X_DDD"                        : ["02", "031", "032", "033", "041", "042", "043", "051", "052", "053", "054", "055", "061", "062", "063", "064", "080", "0502", "0505"],

  /**** Literal Definition ****************************************************************************************/
  "X_MASK_DATE"          : "9999/99/99" ,
  "X_MASK_PSN"           : "999999-9999999" ,
  "X_MASK_CSN"           : "999-99-99999" ,
  "X_FILTER_ALPHA"       : "[a-zA-Z]" ,
  "X_FILTER_NUM"         : "[0-9]" ,
  "X_FILTER_ALNUM"       : "[A-Za-z0-9]" ,
  "X_FILTER_INTEGER"     : "[0-9\\-\\+]" ,
  "X_FILTER_FLOAT"       : "[0-9\\.\\-\\+]" ,
  "X_FILTER_HEXA"        : "[a-fA-F0-9\\-\\+]" ,
  "X_REGEXP_ALPHA"       : /^[a-zA-Z]+$/ ,
  "X_REGEXP_NUM"         : /^[0-9]+$/ ,
  "X_REGEXP_ALNUM"       : /^[A-Za-z0-9]+$/ ,
  "X_REGEXP_INTEGER"     : /^(\+|\-|\d*)\d+$/ ,
  "X_REGEXP_FLOAT"       : /^(\-|\+|\d*)\d+(\.|\d)\d*$/ ,
  "X_REGEXP_HEXA"        : /^(\+|\-|[a-fA-F0-9]*)[a-fA-F0-9]+$/ ,
  "X_DELIMITER_NUMBER"   : /([^0-9\.\-])/g ,
  "X_DELIMITER_CHAR"     : /(\,|\.|\/|\$|\^|\*|\(|\)|\+|\?|\\|\{|\}|\||\[|\]|-|:)/g  // ,./$^*()+?\{}|[]-:

};


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  xJos Class Definitions blow
///  Defines support matrix (type 0:not used, 1:keyword only, 2:keyword and value, 3:keyword or value)
///  * xJos key word(command)´Â element°¡ °¡Áø method/attributeÀÇ ÀÌ¸§°ú °°¾Æ¼­´Â ¾ÈµÈ´Ù.
///  * Àû¿ë ¿ì¼±¼øÀ§´Â xaSupportMatrixÀÇ ¼ø¼­·Î Àû¿ëµÈ´Ù.
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var xaSupportMatrix = {
  "required"           : [3,  "xo_required",           "text,password,textarea,radio,checkbox,select-one,select-multiple,file"],
  "reg_exp"            : [2,  "xo_reg_exp",            "text,password"],
  "filter"             : [2,  "xo_filter",             "text,password,textarea"],
  "mask"               : [2,  "xo_mask",               "text"],
  "alphabetic"         : [1,  "xo_alphabetic",         "text,password"],
  "numeric"            : [1,  "xo_numeric",            "text,password"],
  "alpha_numeric"      : [1,  "xo_alpha_numeric",      "text,password"],
  "integer"            : [1,  "xo_integer",            "text,password"],
  "float"              : [1,  "xo_float",              "text,password"],
  "hexa"               : [1,  "xo_hexa",               "text,password"],
  "maxlength"          : [2,  "xo_minlength",          "text,password,textarea,file"],
  "minlength"          : [2,  "xo_minlength",          "text,password,textarea,file"],
  "maxbyte"            : [2,  "xo_maxbyte",            "text,password,textarea,file"],
  "minbyte"            : [2,  "xo_minbyte",            "text,password,textarea,file"],
  "maxvalue"           : [2,  "xo_maxvalue",           "text,password"],
  "minvalue"           : [2,  "xo_minvalue",           "text,password"],
  "money"              : [1,  "xo_money",              "text"],
  "dollar"             : [1,  "xo_dollar",             "text"],
  "date"               : [1,  "xo_date",               "text"],
  "credit_card"        : [1,  "xo_credit_card",        "text,password"],
  "email"              : [1,  "xo_email",              "text"],
  "domain"             : [1,  "xo_domain",             "text"],
  "psn"                : [1,  "xo_psn",                "text,password"],
  "csn"                : [1,  "xo_csn",                "text,password"],
  "lsn"                : [1,  "xo_lsn",                "text,password"],
  "fsn"                : [1,  "xo_fsn",                "text,password"],
  "plain_box"          : [1,  "xo_plain_box",          "text,password,textarea,file,submit,button,reset"],
  "edit_align"         : [2,  "xo_edit_align",         "text,password,textarea"],
  "ime"                : [2,  "xo_ime",                "text,password,textarea"],
  "lable"              : [1,  "xo_lable",              "text"],
  "auto_focus"         : [1,  "xo_auto_focus",         "text,password"],
  "enter_move_focus"   : [1,  "xo_enter_move_focus",   "text,password,radio,checkbox,select-one,select-multiple,file,button,reset"],
  "focus_this"         : [1,  "xo_focus_this",         "text,password,textarea,radio,checkbox,select-one,select-multiple,file,submit,button,reset"],
  "show_this"          : [1,  "xo_show_this",          "text,password,textarea,radio,checkbox,select-one,select-multiple,file,submit,button,reset"],
  "hide_this"          : [1,  "xo_hide_this",          "text,password,textarea,radio,checkbox,select-one,select-multiple,file,submit,button,reset"],
  "disable_this"       : [1,  "xo_disable_this",       "text,password,textarea,radio,checkbox,select-one,select-multiple,file,submit,button,reset"],
  "readonly_this"      : [1,  "xo_readonly_this",      "text,password,textarea"],
  "selected_duih"      : [1,  "xo_selected_duih",      "select-one,select-multiple"],
  "show_fields"        : [2,  "xo_show_fields",        "text,password,textarea,radio,checkbox,select-one,select-multiple,file"],
  "hide_fields"        : [2,  "xo_hide_fields",        "text,password,textarea,radio,checkbox,select-one,select-multiple,file"],
  "enable_fields"      : [2,  "xo_enable_fields",      "text,password,textarea,radio,checkbox,select-one,select-multiple,file"],
  "disable_fields"     : [2,  "xo_disable_fields",     "text,password,textarea,radio,checkbox,select-one,select-multiple,file"],
  "trim_this"          : [3,  "xo_trim_this",          "text,password,textarea,file"],
  "strip_special_char" : [1,  "xo_strip_special_char", "text,password,textarea"],
  "strip_white_space"  : [1,  "xo_strip_white_space",  "text,password,textarea"],
  "ddd"                : [1,  "xo_ddd",                "text,select-one"],
  "hpd"                : [1,  "xo_hpd",                "text,select-one"],
  "case"               : [2,  "xo_case",               "text,password,textarea"],
  "send_value"         : [2,  "xo_send_value",         "submit"],
  "dyna_action"        : [2,  "xo_dyna_action",        "submit"],
  "status_bar"         : [2,  "xo_status_bar",         "text,password,textarea,radio,checkbox,select-one,select-multiple,file,submit,button,reset"],
  "sync"               : [2,  "xo_sync",               "text,password,radio,checkbox,select-one"],
  "is_value"           : [2,  "xo_is_value",           "text,password"],
  "filesize_limit"     : [2,  "xo_filesize_limit",     "file"]
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  Defines messages
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var xaMessagesTable = {
  "required"       : [ "ÇÊ¼öÀÔ·ÂÀÔ´Ï´Ù." ],
  "reg_exp"        : [ "Regular Expression(Á¤±Ô½Ä)¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù. \nÇü½ÄÀÌ @¿¡ ÀûÇÕÇØ¾ß ÇÕ´Ï´Ù." ],
  "mask"           : [ "Àß¸øµÈÇü½ÄÀÇ ÀÔ·ÂÀÔ´Ï´Ù.\n[@]Çü½ÄÀ¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." ],
  "alphabetic"     : [ "alphabetic Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "numeric"        : [ "numeric Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "alpha_numeric"  : [ "alphabetic È¤Àº numeric Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "integer"        : [ "integer(Á¤¼ö) Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "float"          : [ "½Ç¼öÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "hexa"           : [ "16Áø¼ö(Hexa)Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "maxlength"      : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ ÀÚ¸´¼ö°¡ ³Ê¹« Å®´Ï´Ù. \nÃÖ´ë @ÀÚ¸®ÀÌÇÏ ÀÔ´Ï´Ù." ],
  "minlength"      : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ ÀÚ¸´¼ö°¡ ³Ê¹« ÀÛ½À´Ï´Ù. \nÃÖ¼Ò @ÀÚ¸®ÀÌ»ó ÀÔ´Ï´Ù." ],
  "maxbyte"        : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ ÀÚ¸´¼ö°¡ ³Ê¹« Å®´Ï´Ù. \nÃÖ´ë @ ÀÚ¸®ÀÌÇÏ ÀÔ´Ï´Ù. \n(ÇÑ±Û ÇÑ±ÛÀÚ¸¦ 2ÀÚ¸®·Î °è»ê)" ],
  "minbyte"        : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ ÀÚ¸´¼ö°¡ ³Ê¹« ÀÛ½À´Ï´Ù. \nÃÖ¼Ò @ ÀÚ¸®ÀÌ»óÀÔ´Ï´Ù. \n(ÇÑ±Û ÇÑ±ÛÀÚ¸¦ 2ÀÚ¸®·Î °è»ê)" ],
  "maxvalue"       : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ °ªÀÌ ³Ê¹« Å®´Ï´Ù. \nÇöÀç°ªÀº @ÀÔ´Ï´Ù. \nÃÖ´ë @ ÀÌÇÏÀÇ °ªÀÌ¶ó¾ß ÇÕ´Ï´Ù." ],
  "minvalue"       : [ "ÀÔ·ÂµÈ Ç×¸ñÀÇ °ªÀÌ ³Ê¹« ÀÛ½À´Ï´Ù. \nÇöÀç°ªÀº @ ÀÔ´Ï´Ù. \nÃÖ¼Ò @ ÀÌ»óÀÇ °ªÀÌ¶ó¾ß ÇÕ´Ï´Ù." ],
  "money"          : [ "ÀûÀýÇÑ ±Ý¾×(¿øÈ­) Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "dollar"         : [ "ÀûÀýÇÑ ±Ý¾×(´Þ·¯) Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "date"           : [ "³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "credit_card"    : [ "Credit Card ¹øÈ£ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "email"          : [ "ÀÌ¸ÞÀÏ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù." ],
  "domain"         : [ "µµ¸ÞÀÎ Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "psn"            : [ "ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "csn"            : [ "ÀÔ·ÂÇÑ »ç¾÷ÀÚ µî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "lsn"            : [ "ÀÔ·ÂÇÑ ¹ýÀÎ¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "fsn"            : [ "ÀÔ·ÂÇÑ Àç¿Ü±¹ÀÎ µî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù." ],
  "hpd"            : [ "@´Â ¿Ã¹Ù¸¥ ÈÞ´ëÆù/PCS ±¹¹øÀÌ ¾Æ´Õ´Ï´Ù." ],
  "ddd"            : [ "@´Â ¿Ã¹Ù¸¥ DDD ¹øÈ£°¡ ¾Æ´Õ´Ï´Ù." ],
  "is_value"       : [ "[@]Ç×¸ñÀÇ ÀÔ·Â°ªÀÌ [@]Ç×¸ñÀÇ ÀÔ·Â°ª°ú Æ²¸³´Ï´Ù.", "xJos Says :\n[@]¿¡¼­ÀÇ is_value »ç¿ëÀÌ Æ²·È½À´Ï´Ù. \n[@]¿¡ ÇØ´çÇÏ´Â ÀÔ·ÂÇÊµå ¿ÀºêÁ§Æ®°¡ Á¸ÀçÇÏÁö ¾Ê°Å³ª \nÇØ´ç ÀÔ·ÂÇÊµå°¡ ¿©·¯°³ÀÔ´Ï´Ù." ],
  "filesize_limit" : [ "¼±ÅÃµÈ ÆÄÀÏÀÇ »çÀÌÁî°¡ ³Ê¹« Å®´Ï´Ù. [@]ÀÌÇÏÀÌ¿©¾ß ÇÕ´Ï´Ù." ],
  "itemname"       : [ "ÀÔ·Â¿À·ù ¹ß»ý : Ç×¸ñ¸í[@]\n\n" ],
  "disable_submit" : [ "ÀÌÁß ¿äÃ» ¹æÁö :\nÀá½Ã ÈÄ¿¡ ´Ù½Ã ½ÃµµÇØ ÁÖ½Ê½Ã¿À."]
};


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///   String °´Ã¼ Extention
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : String.trim()
 * @object       : String °´Ã¼ (this)
 * @param        : .
 * @return       : String - TrimµÈ String
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : StringÀÇ °ªÀ» TrimÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_trim()  { return this.replace(/^\s+/ ,"").replace(/\s+$/ ,"");  }

/*******************************************************************************************************************
 * @prototype    : String.lTrim()
 * @object       : String °´Ã¼ (this)
 * @param        : .
 * @return       : String - left(¾ÕÂÊ)ÀÌ TrimµÈ String
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : StringÀÇ left(¾ÕÂÊ)À» trimÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_left_trim()  { return this.replace(/^\s*/,""); }

/*******************************************************************************************************************
 * @prototype    : String.rTrim()
 * @object       : String °´Ã¼ (this)
 * @param        : .
 * @return       : String - right(µÚÂÊ)ÀÌ TrimµÈ String
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : StringÀÇ right(µÚÂÊ)À» trimÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_right_trim() { return this.replace(/\s*$/,""); }

/*******************************************************************************************************************
 * @prototype    : String.isNum()
 * @object       : String °´Ã¼ (this)
 * @param        : .
 * @return       : Boolean - numberÀÎ°æ¿ì true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : StringÀÇ °ªÀÌ numberÀÎÁö¸¦ Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_is_num () { return /\d/.test(this); }

/*******************************************************************************************************************
 * @prototype    : String.getByte()
 * @object       : String °´Ã¼ (this)
 * @param        : .
 * @return       : Integer - StringÀÇ byte ¼ö
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : StringÀÇ ±æÀÌ¸¦ byte·Î °è»êÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_get_byte()  {
  var len = 0;
  var itill = this.length;
  for (var idx=0 ; idx < itill ; idx++, len++)   {
    if ( (this.charCodeAt(idx)<0) || (this.charCodeAt(idx)>127) ) len ++;
  }
  return len;
}

/*******************************************************************************************************************
 * @prototype    : String.hack(mainsep, subsep)
 * @object       : String °´Ã¼ (this)
 * @param        : String - mainsep (1Â÷ array¸¦ °áÁ¤ÇÒ separator (ex:&))
 * @param        : String - subsep  (2Â÷ array¸¦ °áÁ¤ÇÒ separator (ex:=))
 * @return       : Array - ºÐ¼®µÈ StringÀÇ °ªÀ» °¡Áø 2Â÷ Array (length´Â Ç×»ó 0ÀÌ¸ç for..inÀ¸·Î accessÇÏ¿©¾ß ÇÑ´Ù.)
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / String.getUrlCompositeArray()
 * @interkeyword : .
 * @todo         : .
 * @desc         : String °ªÀ» ºÐ¼®ÇÏ¿© 2Â÷ Array°ªÀ» ±¸¼ºÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_hack(mainsep, subsep)  {
  var rArray = new Array;
  var aArray = this.split(mainsep);
  var tArray;

  for(var idx=0; idx < aArray.length ; idx++)  {
    tArray = aArray[idx].split(subsep);
    if (typeof(tArray[0]) == "undefined") continue;
    rArray[length] = [ tArray[0], (typeof(tArray[1]) == "undefined" ) ? null : tArray[1] ];
  }

  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : String.substituteAt(substitute,[substitute...])
 * @object       : String °´Ã¼ (this)
 * @param        : String - substitute (Ä¡È¯´ëÀÔµÉ ¹®ÀÚ¿­ ÁýÇÕ)
 * @return       : String - ¹®ÀÚ¿­ÀÇ @°¡ substitute ¹®ÀÚ¿­·Î Ä¡È¯µÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ¹®ÀÚ¿­ÀÇ @¸¦ substitute·Î ¼øÂ÷ÀûÀ¸·Î Ä¡È¯ÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_substitute_at()  {
  var target = this;
  var itill = arguments.length;
  for (var idx=0; idx < itill; idx++) {
    target = target.replace(/@/i, arguments[idx]);
  }
  return target;
}

/*******************************************************************************************************************
 * @prototype    : String.filtering(filter)
 * @object       : String °´Ã¼ (this)
 * @param        : String - filter (Ã£À» ¹®ÀÚ¿­ ÆÐÅÏ Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @return       : Boolean - filter¿Í matchµÇ´Â ¹®ÀÚ¸¸À» °¡Áø ¹®ÀÚ¿­
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : String °ªÀÇ °¢ ¹®ÀÚÁß filter¿Í ÀÏÄ¡ÇÏ´Â ¹®ÀÚ¸¸À» ³²±â°í ³ª¸ÓÁö¸¦ »èÁ¦ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function sm_filtering(filter)  {
  var result = "";
  var re = new RegExp(filter);
  for (var idx=0; idx < this.length; idx++) result += re.test(this.charAt(idx)) ? this.charAt(idx) : "";
  delete re;
  return result;
}

/*******************************************************************************************************************
 * @prototype    : String.contain(key)
 * @object       : String °´Ã¼ (this)
 * @param        : Object - key (ºñ±³ÇÒ node)
 * @return       : Boolean - key°ªÀÌ String°ú °°À¸¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : String °ªÀÌ key¿Í °°À¸¸é true¸¦ ¸®ÅÏÇÑ´Ù. (Array.contain°úÀÇ È£È¯¼ºÀ» À§ÇØ ÀÛ¼º)
 * @attention    : .
 ******************************************************************************************************************/
function sm_contain(key)  {
  return (this == key) ? true : false;
}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///   Array °´Ã¼ Extention
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : Array.compact([remove,[remove...]])
 * @object       : Array °´Ã¼ (this)
 * @param        : Object - remove (Á¦°ÅÇÒ node)
 * @return       : Array - »õ·Î ±¸¼ºµÈ Array
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.22
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : Array °ª Áß ºñÇÒ´çµÈ ºÎºÐ°ú remove·Î ÁöÁ¤µÈ node¸¦ Á¦°ÅÇÑ »õ·Î¿î Array¸¦ ±¸¼ºÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function am_compact()  {
  var nArray = new Array;
  var params = xuGetArray(arguments);
  for (key in this) {
    if (typeof(this[key]) == "function" ) continue;
    if (typeof(this[key]) == "undefined") continue;
    if (params.contain(this[key])) continue;
    if (key == parseInt(key,10) ) nArray[nArray.length] = this[key];
    else nArray[key] = this[key];
  }
  return nArray;
}

/*******************************************************************************************************************
 * @prototype    : Array.hack(mainsep,  subsep)
 * @object       : Array °´Ã¼(this)
 * @param        : String  - mainsep (1Â÷  array¸¦ °áÁ¤ÇÒ separator (ex:&))
 * @param        : String  - subsep  (2Â÷  array¸¦ °áÁ¤ÇÒ separator (ex:=))
 * @return       : String  - 2Â÷ Array¸¦ mainsep,subsepÀ¸·Î ¿¬°áÇÑ String
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / Array.getUrlCompositeString()
 * @interkeyword : .
 * @todo         : .
 * @desc         : ¾Æ·¡ ÇüÅÂÀÇ Array¸¦ ºÐ¼®ÇÏ¿© URL Composite StringÀ» ÀÛ¼ºÇÑ´Ù.
                   ´ë»óÀÌ elementµéÀ» °¡Áö°í ÀÖ´Â 1Â÷ Array : ÀÌ¶§ elementÀÇ name ¹× value·Î ±¸¼ºÇÑ´Ù.
                   ´ë»óÀÌ 2Â÷ Array : °ªÀ» ºÐ¼®ÇÏ¿© 1Â÷ Array´Â mainsepÀ¸·Î 2Â÷ Array´Â subsepÀ» ÀÌ¿ëÇÏ¿© ¿¬°áÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function am_hack(mainsep, subsep)  {
  var nArray = new Array;
  var node = null;

  for (key in this) {
    node = this[key];
    if (typeof(node) == "function" ) continue;
    if (typeof(node) == "undefined") continue;
    if (node instanceof Array) nArray[nArray.length] = node.join(subsep);
    else if(typeof(node.name) && node.getValue && node.getValue() != null ) nArray[nArray.length] = node.name + subsep + node.getValue() ;
  }
  return nArray.join(mainsep);
}

/*******************************************************************************************************************
 * @prototype    : Array.contain(key)
 * @object       : Array °´Ã¼ (this)
 * @param        : Object - key (ºñ±³ÇÒ node)
 * @return       : Boolean - key°ªÀÌ ArrayÁß¿¡ ÀÖÀ¸¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / Array.hasValue()
 * @interkeyword : .
 * @todo         : .
 * @desc         : Array¿¡ nodeÁß key°ªÀ» °¡Áø node°¡ ÀÖ´ÂÁö °Ë»çÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function am_contain(k)  {
  for (key in this) {
    if (typeof(key) == "function" ) continue;
    if (this[key] == k) return true;
  }
  return false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  Pseudo-inheritance Method Extension (for Elements and Forms)
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : form.setCss(attr)
 * @prototype    : element.setCss(attr)
 * @object       : form °´Ã¼ (this)
 * @object       : element °´Ã¼ (this)
 * @param        : String -  attr (Ãß°¡ÇÒ CSS ClassÀÇ name)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ´ë»ó°´Ã¼¿¡ attrÀÌ¸§ÀÇ CSS Class¸¦ Ãß°¡ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function pm_set_css(attr)  {
  var css = this.getAttribute("className");
  if (!css) {
    this.setAttribute("className", attr);
    return;
  }
  if (!css.split(" ").contain(attr)) {
    this.setAttribute("className", css + " " + attr);
  }
}

/*******************************************************************************************************************
 * @prototype    : form.unsetCss(attr)
 * @prototype    : element.unsetCss(attr)
 * @object       : form °´Ã¼ (this)
 * @object       : element °´Ã¼ (this)
 * @param        : String -  attr (Á¦°ÅÇÒ CSS ClassÀÇ name)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ´ë»ó°´Ã¼¿¡ attrÀÌ¸§ÀÇ CSS ClassÀÌ Á¸ÀçÇÏ¸é Á¦°ÅÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function pm_unset_css(attr)  {
  if (!this.getAttribute("className")) return;
  var cArray = this.getAttribute("className").split(" ");
  cArray = cArray.compact(attr);
  this.setAttribute("className", cArray.join(" "));
}

/*******************************************************************************************************************
 * @prototype    : form.containCSS(attr)
 * @prototype    : element.containCSS(attr)
 * @object       : form °´Ã¼ (this)
 * @object       : element °´Ã¼ (this)
 * @param        : String -  attr (CSS ClassÀÇ name)
 * @return       : Boolean - ÇØ´ç °´Ã¼¿¡ attr ÀÌ¸§ÀÇ CSS Class°¡ Á¸ÀçÇÏ¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / fprm.hasCss() / element.hasCss()
 * @interkeyword : .
 * @todo         : .
 * @desc         : ´ë»ó°´Ã¼¿¡ attrÀÌ¸§ÀÇ CSS Class°¡ Á¸ÀçÇÏ´ÂÁö¸¦ °Ë»çÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function pm_contain_css(attr)  {
  if (!this.getAttribute("className"))  return false;
  var classArr = this.getAttribute("className").split(" ");
  return classArr.contain(attr);
}

/*******************************************************************************************************************
 * @prototype    : form.toggleCss(insert, [delete, [delete...]])
 * @prototype    : element.toggleCss(insert, [delete, [delete...]])
 * @object       : form °´Ã¼ (this)
 * @object       : element °´Ã¼ (this)
 * @param        : String -  insert (»ðÀÔµÉ CSS ClassÀÇ name)
 * @param        : String -  delete (»èÁ¦µÉ CSS ClassÀÇ name)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ´ë»ó°´Ã¼ÀÇ CSS Class¿¡ insertÀÌ¸§ÀÇ CSS Class¸¦ Ãß°¡ÇÏ°í  delete ÀÌ¸§ÀÇ CSS Class°¡ Á¸ÀçÇÏ¸é Á¦°ÅÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function pm_toggle_css()  {

  if (!this.getAttribute("className")) {
    this.setAttribute("className", arguments[0]);
    return;
  }

  var params = xuGetArray(arguments);
  var cArray = this.getAttribute("className").split(" ");
  var nArray = new Array;

  var itill = cArray.length;
  for ( var idx=0; idx<itill; idx++) {
    if ( !params.contain(cArray[idx]) ) nArray[nArray.length] = cArray[idx];
  }
  nArray[nArray.length] = arguments[0];
  this.setAttribute("className", nArray.join(" "));
  delete nArray;
}

/*******************************************************************************************************************
 * @prototype    : form.doAction(execCmd)
 * @prototype    : element.doAction(execCmd)
 * @object       : form °´Ã¼ (this)
 * @object       : element °´Ã¼ (this)
 * @param        : String - execCmd (½ÇÇàÇÒ javascript function ÀÇ ±¸¹®)
 * @return       : Object - ½ÇÇàÇÑ javascript function À¸·Î ºÎÅÍ ¸®ÅÏµÈ °ª
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : execCmd·Î Á¤ÀÇµÈ javascript ±¸¹®À» functionÀ¸·Î ½ÇÇàÇÑ´Ù. ÀÌ¶§ functionÀº anonymous functionÀ¸·Î ½ÇÇàµÈ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function pm_do_action(execCmd, type) {
  var tfunc  = new Function(execCmd);
  window.xJos.set(this, type);
  var flag = tfunc();
  delete tfunc;
  if (flag && xJos.cancel) flag = false;
  window.xJos.clear();
  return flag;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  Element Extension
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*******************************************************************************************************************
 * @prototype    : element.initialize(parent)
 * @object       : element °´Ã¼(this)
 * @param        : Object - parent (ºÎ¸ðÅ¬·¡½º (form))
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ attribute, method, eventµîÀ» defineÇÏ°í ÃÊ±âÈ­ ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_initialize(parent)  {

  //attribute
  this.xjos      = true;       //tagged by xJos
  this.xBuffer   = new Array;  //detected xJos keywords buffering array
  this.xBuffered = false;      //buffer flag for window.xBuffer
  this.parent    = parent;     //represent parentNode/form/parentElement
  this.svalue    = null;       //stored value
  this.impotence = false;      //element.validate disabler flag
  this.bgColor   = this.style.backgroundColor;

  //Pseudo-inheritance Method definition
  this.setCss      = pm_set_css;
  this.unsetCss    = pm_unset_css;
  this.containCSS  = pm_contain_css;

  this.toggleCss   = pm_toggle_css;
  this.doAction    = pm_do_action;

  //methods definition
  this.get      = em_get;
  this.set      = em_set;
  this.clear    = em_clear;
  this.getValue = em_get_value;
  this.setValue = em_set_value;
  this.contain  = em_contain;
  this.store    = em_store;
  this.restore  = em_restore;

  this.setBgColor   = em_set_bg_color;
  this.unsetBgColor = em_unset_bg_color;

  this.disable       = em_disable;
  this.enable        = em_enable;
  this.show          = em_show;
  this.hide          = em_hide;
  this.setReadOnly   = em_set_readonly;
  this.unsetReadOnly = em_unset_readonly
  this.setCheck      = em_set_check;
  this.unsetCheck    = em_unset_check;

  this.trim  = em_trim;
  this.lTrim = em_left_trim;
  this.rTrim = em_right_trim;

  this.call  = em_call;

  this.amIhide             = em_am_i_hide;
  this.getNextFocus        = em_get_next_focus;
  this.getPrevFocus        = em_get_prev_focus;
  this.preventFocusHandler = ee_prevent_focus_handler;

  //binding events (delegate to xJos keyword)
  this.eventHandler = em_event_handler;

  this.detachEvent("onkeypress",  this.eventHandler);
  this.detachEvent("onkeyup",     this.eventHandler);
  this.detachEvent("onkeydown",   this.eventHandler);
  this.detachEvent("onfocus",     this.eventHandler);
  this.detachEvent("onblur",      this.eventHandler);
  this.detachEvent("onchange",    this.eventHandler);
  this.detachEvent("onclick",     this.eventHandler);
  this.detachEvent("onmouseover", this.eventHandler);
  this.detachEvent("onmouseout",  this.eventHandler);
  this.detachEvent("onpaste",     this.eventHandler);

  this.attachEvent("onkeypress",  this.eventHandler);
  this.attachEvent("onkeyup",     this.eventHandler);
  this.attachEvent("onkeydown",   this.eventHandler);
  this.attachEvent("onfocus",     this.eventHandler);
  this.attachEvent("onblur",      this.eventHandler);
  this.attachEvent("onchange",    this.eventHandler);
  this.attachEvent("onclick",     this.eventHandler);
  this.attachEvent("onmouseover", this.eventHandler);
  this.attachEvent("onmouseout",  this.eventHandler);
  this.attachEvent("onpaste",     this.eventHandler);

  //xjos engines method
  this.xFactory = em_x_factory;
  this.attachX  = em_attach_x;
  this.detachX  = em_detach_x;
  this.clearX   = em_clear_x;

  this.getMessage = em_get_message;
  this.alertX     = em_alert_x;
  this.validate   = em_validate;

  this.masking          = em_masking;
  this.unmasking        = em_unmasking;
  this.getMaskedValue   = em_get_masked_value;
  this.getUnmaskedValue = em_get_unmasked_value;

  this.getMaskedValueHandler = null;
  this.getUnmaskedValueHandler = null;
  this.setMaskHandler = em_set_mask_handler;

  //initialize keyword
  this.xFactory();
}

/*******************************************************************************************************************
 * @prototype    : element.get()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : Object - elementÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selected)
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selectedIndex Array)À» ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get() {

  switch (this.type) {
    case "text" :   case "password" :    case "textarea" :
    case "file" :   case "hidden" :
      return this.value;
    break;

    case "select-one" :
      return [this.selectedIndex];
    break;

    case "select-multiple" :
      var sArray = new Array;
      var itill = this.options.length;
      for (var idx=0; idx<itill ; idx++) {
        if (this.options[idx].selected) {
            sArray[sArray.length] = idx;
        }
      }
      return sArray;
    break;

    case "radio" :  case "checkbox" :
      return this.checked;
    break;
  }
  return null;
}

/*******************************************************************************************************************
 * @prototype    : element.set(sval)
 * @object       : element °´Ã¼(this)
 * @param        : Object - sval (elementÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selected))
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selectedIndex/selectedIndex Array)¸¦ ¼¼ÆÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set(sval) {
   switch (this.type) {
    case "text" :   case "password" :   case "textarea" :
    case "file" :   case "hidden" :
      this.value = sval;
    break;

    case "select-one" :
      this.selectedIndex = sval[0];
    break;

    case "select-multiple" :
      var itill = sval.length;
      for (var idx=0; idx< itill ; idx++) {
        this.options[sval[idx]].selected = true;
      }
    break;

    case "radio" :  case "checkbox" :
      this.checked = sval;
    break;
   }
}

/*******************************************************************************************************************
 * @prototype    : element.clear()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selected)À» Á¦°ÅÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_clear()  {

   switch (this.type) {
    case "text" :   case "password" :    case "textarea" :
    case "file" :   case "hidden" :
      this.value = "";
    break;

    case "select-one" : case "select-multiple" :
      this.selectedIndex = -1;
    break;

    case "radio" :  case "checkbox" :
      this.checked = false;
    break;
  }
}

/*******************************************************************************************************************
 * @prototype    : element.getValue()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : Object(String, String Array) - element°´Ã¼ÀÇ value
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ value°ªÀ» ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_value() {

  switch (this.type) {
    case "text" :   case "password" :    case "textarea" :
    case "file" :   case "hidden" :
      return this.value;
    break;

    case "select-one" :
      return this.options[this.selectedIndex].value;
    break;

    case "select-multiple" :
      var sArray = new Array;
      var itill = this.options.length;
      for (var idx=0; idx<itill; idx++) {
        if (this.options[idx].selected) {
            sArray[sArray.length] = this.options[idx].value;
        }
      }
      return sArray;
    break;

    case "radio" :  case "checkbox" :
      if (this.checked) return this.value;
    break;
  }

  return "";

}

/*******************************************************************************************************************
 * @prototype    : element.setValue(sval)
 * @object       : element °´Ã¼(this)
 * @param        : Object(String, String Array) - sval (element°´Ã¼¿¡ ÇÒ´çÇÒ value)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ value°ªÀ» ¼³Á¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set_value(val) {

  switch (this.type) {
    case "text" :   case "password" :    case "textarea" :
    case "file" :   case "hidden"   :    case "select-one" :
      this.value = val;
    break;

    case "select-multiple" :
      var itill = this.options.length;
      for (var idx=0; idx<itill; idx++) {
        if (val.contain(this.options[idx].value))
          this.options[idx].selected = true;
      }
    break;

    case "radio" :  case "checkbox" :
      this.checked = (this.value == val) ? true : false;
    break;
  }
}

/*******************************************************************************************************************
 * @prototype    : element.contain([value, [value...]])
 * @object       : element °´Ã¼(this)
 * @param        : String - value (Á¸ÀçÇÏ´ÂÁö °Ë»çÇÒ value)
 * @return       : Boolean - value°ªÀÌ Á¸ÀçÇÏ´Â °æ¿ì °æ¿ì true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / String.hasValue()
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼¿¡ value¿¡ ÇØ´ç ÇÏ´Â value°¡ Á¸ÀçÇÏ´ÂÁö °Ë»çÇÑ´Ù. value°¡ »ý·«µÈ °æ¿ì¿¡´Â °ªÀÌ ÀÖ´Â °æ¿ì, Ã¼Å©µÈ °æ¿ì, ¼±ÅÃµÈ °æ¿ìµîÀÌ true.
 * @attention    : parameter°¡ 1°³ÀÌ°í ArrayÀÎ °æ¿ì, Ã£À» value´Â ÇØ´ç Array¿¡¸¸ ÀÇÁ¸ÇÑ´Ù.
 ******************************************************************************************************************/
function em_contain() {

  var params = arguments[0] instanceof Array ? arguments[0] : xuGetArray(arguments);

  switch (this.type) {
    case "text" :   case "password" :    case "textarea" :
    case "file" :   case "hidden"   :
      return (arguments.legnth == 0 && this.value.length) ? true : params.contain(this.value);
    break;

    case "select-one" :
      if (this.selectedIndex == -1) return false;
      if (arguments.legnth == 0 && this.options[this.selectedIndex].value.length) return true;
      if (arguments.legnth > 0 && params.contain(this.value) ) return true;
    break;

    case "select-multiple" :
      if (this.selectedIndex == -1) return false;
      var itill = this.options.length;
      for (var idx=0; idx<itill; idx++) {
        if (!this.options[idx].selected) continue;
        if (arguments.legnth == 0 && this.options[idx].value.length) return true;
        if (arguments.legnth > 0 && params.contain(this.options[idx].value) ) return true;
      }
    break;

    case "radio" :  case "checkbox" :
      if (!this.checked) return false;
      if (arguments.legnth == 0) return this.checked;
      if (arguments.legnth == 0 && params.contain(this.value)) return true;
    break;
  }
  return false;
}

/*******************************************************************************************************************
 * @prototype    : element.store()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selected)À» ³»ºÎº¯¼ö·Î ÀúÀåÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_store()  {
  this.svalue = this.get();
}

/*******************************************************************************************************************
 * @prototype    : element.restore(()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ Áß¿ä ¼Ó¼º°ª(value/checked/selected)À» ³»ºÎº¯¼ö·ÎºÎÅÍ º¹¿øÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_restore()  {
  if (this.svalue == null) return;
  this.set(this.svalue);
}


/*******************************************************************************************************************
 * @prototype    : element.setBgColor(nColor [,nCss])
 * @object       : element °´Ã¼(this)
 * @param        : String - newColor (»ö»ó°ª ex:#FFFFF)
 * @param        : String - newCss   (CSS Class ÀÌ¸§)
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_COLOR_SET_USE_CSS (¹è°æ»ö ¼³Á¤½Ã css¸¦ ÀÌ¿ëÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ ¹è°æ»öÀ» ¼³Á¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set_bg_color(nColor, nCss)  {
  window.xGetOption("X_COLOR_SET_USE_CSS") ? this.setCss(nCss) : this.style.backgroundColor = nColor;
}

/*******************************************************************************************************************
 * @prototype    : element.unsetBgColor([oCss])
 * @object       : element °´Ã¼(this)
 * @param        : String - oldCss (CSS Class ÀÌ¸§)
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_COLOR_SET_USE_CSS (¹è°æ»ö ¼³Á¤ÇØÁ¦½Ã css¸¦ ÀÌ¿ëÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ±â ¼³Á¤µÈ element°´Ã¼ÀÇ ¹è°æ»öÀ» ¼³Á¤À» ÇØÁ¦ÇÑ´Ù. ÀÌ¶§ css¸¦ »ç¿ëÇÏÁö ¾Ê´Â °æ¿ì, °´Ã¼ÀÇ bgColor ¼Ó¼ºÀ» »ç¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_unset_bg_color(oCss)  {
  window.xGetOption("X_COLOR_SET_USE_CSS") ? this.unsetCss(oCss) : this.style.backgroundColor = this.bgColor;
}

/*******************************************************************************************************************
 * @prototype    : element.disable()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_DISABLED   (DisableµÈ element¿¡ ´ëÇÏ¿© validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : Boolean - X_ERASE_VALUE_ON_DISABLE (Disable ½ÃÅ³¶§ value°ªÀ» ³»ºÎ°ªÀ¸·Î ÀúÀåÇÑµÚ, Á¦°ÅÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼¸¦ disbale ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_disable()  {
  if (this.getAttribute("disabled")) return;
  this.setAttribute("disabled",true);
  this.setBgColor("#cccccc", "xjs_disable");
  if (window.xGetOption("X_VALIDATE_ON_DISABLED")) this.impotence = true;

  if (window.xGetOption("X_ERASE_VALUE_ON_DISABLE")) {

    switch (this.type) {
      case "text" :   case "password" :   case "textarea" :
      case "file" :   case "image" :
      case "select-one" :  case "select-multiple" :
      case "radio" :  case "checkbox" :
        this.store(); this.clear();
      break;
    }

  }
}

/*******************************************************************************************************************
 * @prototype    : element.enable()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_DISABLED   (DisableµÈ element¿¡ ´ëÇÏ¿© validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : Boolean - X_ERASE_VALUE_ON_DISABLE (Enable ½ÃÅ³¶§ ÀúÀåµÈ value°ªÀ» º¹¿øÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼¸¦ enable ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_enable()  {
  if (!this.getAttribute("disabled")) return;
  this.removeAttribute("disabled");
  this.unsetBgColor("xjs_disable");
  if(window.xGetOption("X_VALIDATE_ON_DISABLED")) this.impotence = false;

  if (window.xGetOption("X_ERASE_VALUE_ON_DISABLE")) {
    switch (this.type) {
      case "text" :   case "password" :   case "textarea" :
      case "file" :   case "image" :
      case "select-one" :  case "select-multiple" :
      case "radio" :  case "checkbox" :
       this.restore();
      break;
    }
  }
}

/*******************************************************************************************************************
 * @prototype    : element.show()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_DISABLE_ON_HIDE (Show½Ã element¸¦ enable½ÃÅ²´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼¸¦ show½ÃÅ²´Ù. (use this.style.visibility visible/hidden if postion blocked.)
 * @attention    : .
 ******************************************************************************************************************/
function em_show()  {
   if (this.containCSS("xjs_show")) return;
   if (window.xGetOption("X_DISABLE_ON_HIDE")) this.enable();
   this.toggleCss("xjs_show", "xjs_hide");
}

/*******************************************************************************************************************
 * @prototype    : element.hide()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_DISABLE_ON_HIDE (hide½Ã element¸¦ disable½ÃÅ²´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         :  element°´Ã¼¸¦ hide½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_hide()  {
  if (this.containCSS("xjs_hide")) return;
  this.toggleCss("xjs_hide", "xjs_show");
  if (  window.xGetOption("X_DISABLE_ON_HIDE")) this.disable();
}

/*******************************************************************************************************************
 * @prototype    : element.setReadOnly()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : input,password,textarea°´Ã¼¸¦ readOnly·Î ¼³Á¤ ½ÃÅ²´Ù. ´Ü disableµÇ¾î ÀÖ´Â °æ¿ì º¯È­½ÃÅ°Áö ¾Ê´Â´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set_readonly()  {
  if ( this.readOnly || this.getAttribute("disabled")) return;
  switch (this.type) {
    case "text" :
    case "password" :
    case "textarea" :
      this.readOnly = true;
      this.setBgColor("#FFFFCC", "xjs_readonly");
      this.detachEvent("onfocus", this.preventFocusHandler);
      this.attachEvent("onfocus", this.preventFocusHandler);
    break;
 }
}

/*******************************************************************************************************************
 * @prototype    : element.unsetReadOnly()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       :
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ readOnly¼³Á¤À» ÇØÁ¦ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_unset_readonly()  {
  if ( !this.readOnly ) return;
  switch (this.type) {
    case "text" :
    case "password" :
    case "textarea" :
      this.readOnly = false;
      this.unsetBgColor("xjs_readonly");
      this.detachEvent("onfocus", this.preventFocusHandler);
    break;
 }
}

/*******************************************************************************************************************
 * @prototype    : element.setCheck()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼°¡ checkbox/radioÀÎ °æ¿ì checkÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set_check()  {
  switch (this.type) {
    case "checkbox" :
    case "radio" :
      this.checked  = true;
    break;
 }
}

/*******************************************************************************************************************
 * @prototype    : element.unsetCheck()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼°¡ checkbox/radioÀÎ °æ¿ì checkµÈ °ªÀ» ÇØÁ¦ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_unset_check()  {
  switch (this.type) {
    case "checkbox" :
    case "radio" :
      this.checked  = false;
    break;
 }
}

/*******************************************************************************************************************
 * @prototype    : element.trim()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / String.valueTrim()
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ value¿¡ trim()¸¦ Àû¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_trim()  { if (typeof(this.value) == "string") this.value =  this.value.trim(); }

/*******************************************************************************************************************
 * @prototype    : element.lTrim()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : xJos v3.0 / xfunction build 100 / String.leftTrim()
 * @desc         : element°´Ã¼ÀÇ value¿¡ lTrim()¸¦ Àû¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_left_trim() { if (typeof(this.value) == "string") this.value =  this.value.lTrim(); }

/*******************************************************************************************************************
 * @prototype    : element.rTrim()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / String.rightTrim()
 * @interkeyword : .
 * @todo         : .
 * @desc         : element°´Ã¼ÀÇ value¿¡ rTrim() ¸¦ Àû¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_right_trim() { if (typeof(this.value) == "string") this.value =  this.value.rTrim(); }

/*******************************************************************************************************************
 * @prototype    : element.call(func)
 * @object       : element °´Ã¼(this)
 * @param        : String - func (½ÇÇàÇÒ methodÀÇ ÀÌ¸§)
 * @return       : Object - ½ÇÇàµÈ func¿¡¼­ ¸®ÅÏµÈ °ª
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : !callµÇ´Â funcÀÇ parameter¸¦ Ã³¸®ÇÏ´Â ±â´É Ãß°¡
 * @desc         : element°´Ã¼ÀÇmethod¸¦ callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_call(func)  {
  var ecmd = "this." + func + "()";
  try { return eval(ecmd); } catch(e) {return ;}
}

/*******************************************************************************************************************
 * @prototype    : element.amIhide()
 * @object       : element °´Ã¼(this)
 * @param        :
 * @return       : boolean - element°¡ º¸ÀÌÁö ¾Ê´Â ÄÁÆ®·ÑÀÎ °æ¿ì true.
 * @event        :
 * @option       :
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.13
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : this È¤Àº this°¡ ¼ÓÇÑ element hierarchyÁß ÇÏ³ª°¡ display="none" È¤Àº style.visibility="hidden" À¸·Î µÇ¾î ÀÖ´ÂÁö ÆÇ´ÜÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_am_i_hide()  {
  var oCraft = this;
  do {
    if ( ( oCraft.containCSS && oCraft.containCSS("xjs_hide")) ||
         ( oCraft.style && ( oCraft.style.display =='none' || oCraft.style.visibility =='hidden') ) ||
         ( oCraft.currentStyle && ( oCraft.currentStyle.display =='none' || oCraft.currentStyle.visibility =='hidden' ) )
       ) return true;
    oCraft = oCraft.parentElement;
  } while (oCraft && oCraft.tagName != "BODY");

  return false;
}

/*******************************************************************************************************************
 * @prototype    : element.getNextFocus([objname])
 * @object       : element °´Ã¼(this)
 * @param        : String - objname (´ÙÀ½ focusÇÒ elementÀÇ ÀÌ¸§)
 * @return       : Object - element (´ÙÀ½ focusÇÒ element °´Ã¼)
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : !element°¡ ¸¹À»¶§ element.length¸¦ »ç¿ëÇÏ¿© ÃÊ±â À§Ä¡ ÆÄ¾Ç½Ã performance ¹®Á¦ ¹ß»ý°¡´ÉÇÔ
 * @desc         : focus°¡ °¡´ÉÇÑ ´ÙÀ½ Â÷·ÊÀÇ element¸¦ ¸®ÅÏÇÑ´Ù.objnameÀÌ ¸í½ÃµÈ °æ¿ì, objname°ú ÀÏÄ¡ÇÏ´Â ´ÙÀ½ Â÷·ÊÀÇ focus°¡ °¡´ÉÇÑ element¸¦ ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_next_focus(objname)  {
  if (this.parent.elements.length == 1 && this==this.parent.elements[0]) return this;

  var selfIndex = 0;
  var itill = this.parent.elements.length;
  var oCraft = null;
  for (var idx=0; idx < itill; idx++) {
    if (this.parent.elements[idx] == this) selfIndex = idx;
  }

  do {
    selfIndex ++;
    if (selfIndex >= itill ) selfIndex = 0;
    oCraft = this.parent.elements[selfIndex];
    if (oCraft == this) break;
    if (objname && oCraft.name && oCraft.name == objname) break;
  } while ( typeof(oCraft) == 'undefined' || oCraft.tagName == "OBJECT" || oCraft.readOnly ||
            ( oCraft.type && oCraft.type=='hidden') ||
            ( oCraft.amIhide && oCraft.amIhide() ) ||
            ( oCraft.getAttribute && oCraft.getAttribute("disabled")) ||
            ( objname && oCraft.name && oCraft.name != objname )
           );

  return oCraft;
}

/*******************************************************************************************************************
 * @prototype    : element.getPrevFocus([objname])
 * @object       : element °´Ã¼(this)
 * @param        : String - objname (ÀÌÀü focusÇÒ elementÀÇ ÀÌ¸§)
 * @return       : Object - element (ÀÌÀü focusÇÒ element °´Ã¼)
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : !element°¡ ¸¹À»¶§ element.length¸¦ »ç¿ëÇÏ¿© ÃÊ±â À§Ä¡ ÆÄ¾Ç½Ã performance ¹®Á¦ ¹ß»ý°¡´ÉÇÔ
 * @desc         : focus°¡ °¡´ÉÇÑ ÀÌÀü Â÷·ÊÀÇ element¸¦ ¸®ÅÏÇÑ´Ù.objnameÀÌ ¸í½ÃµÈ °æ¿ì, objname°ú ÀÏÄ¡ÇÏ´Â ÀÌÀü Â÷·ÊÀÇ focus°¡ °¡´ÉÇÑ element¸¦ ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_prev_focus(objname)  {

  if (this.parent.elements.length == 1 && this==this.parent.elements[0]) return this;

  var selfIndex = 0;
  var itill = this.parent.elements.length;
  var oCraft = null;

  for (var idx=0; idx < itill; idx++) {
    if (this.parent.elements[idx] == this) selfIndex = idx;
  }

  do {
    selfIndex --;
    if (selfIndex < 0 ) selfIndex = itill - 1 ;
    oCraft = this.parent.elements[selfIndex];
    if (oCraft == this) break;
    if (objname && oCraft.name && oCraft.name == objname) break;
  } while ( typeof(oCraft) == 'undefined' || oCraft.tagName == "OBJECT" || oCraft.readOnly ||
            ( oCraft.type && oCraft.type=='hidden') ||
            ( oCraft.amIhide && oCraft.amIhide() ) ||
            ( oCraft.getAttribute && oCraft.getAttribute("disabled") ) ||
            ( objname && oCraft.name && oCraft.name != objname )
           );

  return oCraft;
}

/*******************************************************************************************************************
 * @prototype    : element.preventFocusHandler()
 * @object       : element °´Ã¼(this)
 * @param        :
 * @return       :
 * @event        : element.onfocus
 * @option       :
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡ focus°¡ ¿ÔÀ»¶§ focus¸¦ preventÇÑ´Ù. ÀÌ¶§ ´ÙÀ½ focusalbe Object·Î focus¸¦ °­Á¦ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function ee_prevent_focus_handler()  {
  var sCraft = window.event.srcElement;
  var fCraft = null;
  try {
    fCraft = sCraft.getNextFocus();
    if (fCraft != sCraft) fCraft.focus();
  } catch (e) {
    if (sCraft.blur) sCraft.blur();
  }
}

/*******************************************************************************************************************
 * @prototype    : element.eventHandler()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : element.(onkeypress/onkeyup/onkeydown/onfocus/onblur/onchange/onclick/onmouseover/onmouseout)
 * @option       :
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 103
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡ event°¡ ¹ß»ýÇÒ °æ¿ì ÀÌ¸¦ xObject¿¡ delegateÇÑ´Ù. text, password, fileµî¿¡ focus°¡ À§Ä¡ÇÏ´Â °æ¿ì ÀÚµ¿À¸·Î selectÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_event_handler()  {
  var oSrc = window.event.srcElement;
  var type = window.event.type;
  if (!oSrc.xjos || !oSrc.xBuffer.length ) return;
  var itill = oSrc.xBuffer.length ;
  var ecmd = "";

  for (var idx=0; idx < itill; idx++) {
    ecmd = "window." + oSrc.xBuffer[idx] + "_on" + type ;
    try {
      if ( eval(ecmd) && eval(ecmd + "(oSrc, window.event)") == false) { window.event.returnValue = false; return false; }
    } catch(e) {}
  }

  if ( type == 'focus' && ( oSrc.type == "text" || oSrc.type == "password" || oSrc.type == "file" ) && oSrc.select)  {
    oSrc.select();
  }

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  xJos Element Engine Extension
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*******************************************************************************************************************
 * @prototype    : element.xFactory()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 103
 * @origin       : .
 * @interkeyword : .
 * @todo         : !ÀüÃ¼ÀûÀ¸·Î ±âº»ÀûÀ¸·Î Àû¿ëÇÒ keyword¸¦ ¾î¶»°Ô Àû¿ëÇÒ °ÍÀÎ°¡?
 * @desc         : element¿¡ Àû¿ëÇÒ xJos Keyword¸¦ ÆÇ´ÜÇÏ¿© ÀûÀýÇÑ xObject¿Í mappingÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_x_factory()  {

  for (key in xaSupportMatrix) {
    try {
     if (this.getAttribute(key) != null) this.attachX(key);
    } catch (e) {}
  }
}

/*******************************************************************************************************************
 * @prototype    : element.attachX(key [,val])
 * @object       : element °´Ã¼(this)
 * @param        : String - key (»õ·Î Àû¿ëÇÒ xJos Keyword)
 * @param        : String - val (»õ·Î Àû¿ëÇÒ xJos KeywordÀÇ value/attribute)
 * @return       : Boolean - xJos Keyword Àû¿ë¿¡ ¼º°øÇÏ¸é true
 * @event        : .
 * @option       : Boolean - X_BINDING_RULE_APPLY  (true:xJos keyword binding½Ã¿¡ ruleÀ» Àû¿ëÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 102 / element.addXObj()
 * @origin       : xJos v3.0 / xfunction build 102 / element.attachX()
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡ »õ·Î¿î xJos keyword¸¦ Àû¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_attach_x(key, val) {
  var config = xaSupportMatrix[key];
  if (!config) return false; //key is not in xaSupportMatrix

  val = ( typeof(val) == "undefined" ) ? this.getAttribute(key) : val ;

  try {
     if (window.xGetOption("X_BINDING_RULE_APPLY")) {
      if ( !config[0] || ( config[0] == 1 && val)) return false;
      if ( config[0] == 2 && !val) return false;
      if (!config[2].split(",").contain(this.type)) return false; //not support type
     }

    if (this.xBuffer.contain(key)) return false; //already bound

    this.xBuffer[this.xBuffer.length] = config[1];

    if (!this.xBuffered) {
      this.xBuffered=true;
      var buffer = window.xBuffer[this.form.uniqueID];
      buffer[buffer.length] = this;
    }

    this.setAttribute(key, typeof(val) == "undefined" ? "" : val);

    var cbFunc = "window." + config[1] + "_attach";
    try { if (eval(cbFunc)) eval(cbFunc + "(this)"); } catch (e) {}

  } catch(e) { return false; }

  return true;
}

/*******************************************************************************************************************
 * @prototype    : element.detachX(key)
 * @object       : element °´Ã¼(this)
 * @param        : String - key (Àû¿ëÇØÁ¦ÇÒ xJos Keyword)
 * @return       : Boolean - xJos Keyword Àû¿ëÇØÁ¦¿¡ ¼º°øÇÏ¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : !detach½Ã¿¡ window.xBuffer¿¡ bufferingµÈ element´Â Á¦°ÅÇÏÁö ¾Ê°í ÀÖ´Ù.
 * @desc         : element¿¡ ±â Àû¿ëµÈ xJos keyword¸¦ Á¦°Å ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_detach_x(key)  {
  if (!this.xBuffer.length ) return false;
  var config = xaSupportMatrix[key];
  if (!config) return false;

  var flag = false;
  var nBuffer = new Array;
  var itill = this.xBuffer.length;
  for (var idx=0; idx < itill; idx++) {
    if (this.xBuffer[idx] == config[1]) flag = true;
    else nBuffer[nBuffer.length] = this.xBuffer[idx];
  }

  if (flag) {
    var cbFunc = "window." + config[1] +"_detach";
    try { if (eval(cbFunc)) eval(cbFunc +"(this)"); } catch (e) {}
    this.removeAttribute(key);
    this.unsetBgColor("xjs_error");
    this.xBuffer = nBuffer;
  }

  return true;
}

/*******************************************************************************************************************
 * @prototype    : element.clearX([deep])
 * @object       : element °´Ã¼(this)
 * @param        : Boolean - deep (trueÀÎ °æ¿ì xJos keyword Àû¿ë attribute¸¦ Á¦°ÅÇÑ´Ù.)
 * @return       : Boolean - xJos Keyword Àû¿ëÇØÁ¦¿¡ ¼º°øÇÏ¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 105
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡ Àû¿ëµÈ xjos keyword¸¦ ¸ðµÎ Á¦°Å ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_clear_x(deep)  {
  if (!this.xBuffer.length ) return false;

  var itill = this.xBuffer.length;
  for (var idx=0; idx < itill; idx++) {
    try {
      var cbFunc = "window." + this.xBuffer[idx] +"_detach";
      try { if (eval(cbFunc)) eval(cbFunc +"(this)"); } catch (e) {}
      if (deep) this.removeAttribute(this.xBuffer[idx].replace(/^xo_/ig, ""));
      this.unsetBgColor("xjs_error");
      delete this.xBuffer[idx];
    } catch (e) {return false;}
  }

  this.xBuffer = new Array;
  window.xBuffer[this.form.uniqueID] = window.xBuffer[this.form.uniqueID].compact(this);
  this.xBuffered = false;

  return true;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  xJos Element Engine Support Extension
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : element.getMessage(key [, index])
 * @object       : element °´Ã¼(this)
 * @param        : String - key (Ã£À» ¸Þ¼¼ÁöÀÇ key (ex:xjos keyword))
 * @param        : Integer - index (Ã£À» ¸Þ¼¼ÁöÀÇ index)
 * @return       : String - Ã£¾ÆÁø ¸Þ¼¼Áö
 * @event        : String - ¹ßÇàÇÒ ¸ÞÁ¦Áö
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : itemname - ¸Þ¼¼Áö Á¶¸³½Ã¿¡ itemnameÀ¸·Î ÁöÁ¤µÈ message¸¦ Ãß°¡ÇÑ´Ù.
 * @interkeyword : *_msg - ¸Þ¼¼Áö Á¶¸³½Ã Á¤ÀÇµÈ ¸Þ¼¼Áö ´ë½Å »ç¿ëÇÒ ¸Þ¼¼Áö¸¦ Á¤ÀÇÇÑ´Ù. (keyword base)
 * @todo         : !message keywordÀÇ ±¸Çö (element¿¡¼­ ¿¡·¯ ¹ß»ý½Ã¿¡ Å°¿öµå¿Í ¹«°üÇÏ°Ô »ç¿ëÇÏ´Â ¸Þ¼¼Áö)
 * @desc         : ÁÖ¾îÁø key ¹× index¿¡ ÀûÇÕÇÑ ¸ÞÁ¦Áö¸¦ itemname°ú *_msg Å°¿öµå¸¦ °í·ÁÇÏ¿© ¹ÝÈ¯ÇÑ´Ù. Ä¡È¯Àº ¼öÇàÇÏÁö ¾Ê´Â´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_message(key, index) {
  var imsg = "";
  var result = "";
  var itemname = this.getAttribute("itemname");
  var _msg = this.getAttribute(key + "_msg");
  if (itemname) {
    imsg  = xaMessagesTable["itemname"][0];
    imsg  = (imsg) ? imsg.substituteAt(itemname) : "";
  }
  try {
    index = index ? index : 0;
    result = imsg + ( _msg ? _msg : xaMessagesTable[key][index] );
  } catch (e) { result = "xJos (" + key + ", " + index + ") ¸Þ¼¼Áö°¡ Á¤ÀÇµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.!!"; }
  return result.toString();
}

/*******************************************************************************************************************
 * @prototype    : element.alertX(message)
 * @object       : element °´Ã¼(this)
 * @param        : String - message (alertÀ¸·Î ¹ßÇàÇÒ message)
 * @return       : Boolean - ¸Þ¼¼Áö ¹ßÇà ¹× action ¼öÇà¿¡ ¼º°øÇÏ¸é true
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @option       : Boolean - X_VALIDATE_DO_ALERT (true:¿¡·¯ ¹ß»ý½Ã ¿¡·¯¸Þ½ÃÁö¸¦ ¹ßÇàÇÑ´Ù.)
 * @option       : Boolean - X_VALIDATE_DO_ERROR_ACTION (true:¿¡·¯ ¹ß»ý½Ã ´ë»ó element¿¡ focus,select ¹× ¹è°æ»öÀ» º¯°æÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.20 / xfunction build 101 / element.alertMsg()
 * @interkeyword : onActionBegin - alert ¸Þ¼¼Áö°¡ ¹ßÇàµÇ±â Àü¿¡ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @interkeyword : onActionEnd - alert ¸Þ¼¼Áö°¡ ¹ßÇàµÈ ÈÄ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @todo         : .
 * @desc         : ÁÖ¾îÁø Message¸¦ alertÀ¸·Î ¹ßÇàÇÏ°í, focus ¼öÇà ¹× ¹è°æ»öÀ» error·Î º¯°æÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_alert_x(message)  {
  var execCmd = null;

  execCmd = this.getAttribute("onActionBegin");
  if (execCmd && tihs.doAction(execCmd, "ActionBegin") == false) return false;

  if (window.xGetOption("X_VALIDATE_DO_ALERT")) window.alert(message);
  if (window.xGetOption("X_VALIDATE_DO_ERROR_ACTION")) {
    if (this.type == 'hidden' && window.xGetOption("X_SUPPORT_HIDDEN_TYPE") ) {
      if (this.getNextFocus && this.getNextFocus()) this.getNextFocus().focus();
      } else {
        if ( !this.amIhide()) this.focus();
        this.setBgColor("#EEFFB6", "xjs_error");
      }
  }

  execCmd = this.getAttribute("onActionEnd");
  if (execCmd && this.doAction(execCmd, "ActionEnd") == false) return false;

  return true;
}

/*******************************************************************************************************************
 * @prototype    : element.validate()
 * @object       : element °´Ã¼(this)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_HIDE (°¨ÃçÁø element¿¡ ´ëÇÏ¿© validate¸¦ ¼öÇàÇÑ´Ù.)
 * @option       : Boolean - X_VALIDATE_ON_READONLY (Readonly·Î ÁöÁ¤µÈ element¿¡ ´ëÇÏ¿© validate¸¦ ¼öÇàÇÑ´Ù.)
 * @option       : Boolean - X_VALIDATE_DO_TRIM_VALUE (validationÀ» ¼öÇàÇÏ±â Àü¿¡ ´ë»ó value¿¡ ´ëÇÏ¿© trimÀ» ¼öÇàÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : onValidateBegin - validationÀÌ ¼öÇàµÇ±â Àü¿¡ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @interkeyword : onValidateEnd - validationÀÌ ¼öÇàµÈ ÈÄ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @todo         : .
 * @desc         : element¿¡ Àû¿ëµÈ ¸ðµç xJos KeywordÀÇ validationÀ» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_validate()  {

  var flag = true;
  var execCmd = null;

  if ( !this.xBuffer || !this.xBuffer.length ) return true;
  if ( this.impotence || this.getAttribute("disabled")) return true;

  if (!window.xGetOption("X_VALIDATE_ON_HIDE") && this.amIhide()) return true;
  if (this.readOnly && !window.xGetOption("X_VALIDATE_ON_READONLY")) return true;

  if (window.xGetOption("X_VALIDATE_DO_TRIM_VALUE") ) this.value = this.value.trim();

  execCmd = this.getAttribute("onValidateBegin");
  if (execCmd && this.doAction(execCmd, "ValidateBegin") == false) flag = false;

  var itill = this.xBuffer.length;
  for ( var idx=0; flag && idx < itill ; idx++ ) {
      var cbFunc = "window." + this.xBuffer[idx] + "_validate";
    try {
      if (eval(cbFunc) && eval(cbFunc + "(this)") == false) flag = false;
    } catch (e) { ;}
  }

  execCmd = this.getAttribute("onValidateEnd");
  if (flag && execCmd && this.doAction(execCmd, "ValidateEnd") == false) flag = false;

  if (flag) {
    this.unsetBgColor("xjs_error");
  }

  return flag;

}

/*******************************************************************************************************************
 * @prototype    : element.masking()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ value¸¦ maskingµÈ value·Î Ä¡È¯ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_masking()  {
  this.value = this.getMaskedValue();
}

/*******************************************************************************************************************
 * @prototype    : element.unmasking()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ value¸¦ unmaskingµÈ value·Î Ä¡È¯ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_unmasking()  {
  this.value = this.getUnmaskedValue();
}

/*******************************************************************************************************************
 * @prototype    : element.getMaskedValue()
 * @object       : element °´Ã¼(this)
 * @param        : String - mask°¡ Àû¿ëµÈ value
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ value¿¡ ´ëÇÏ¿© maskingµÈ value¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_masked_value()  {
  return ( this.getMaskedValueHandler) ?  this.getMaskedValueHandler(this) : this.value;
}

/*******************************************************************************************************************
 * @prototype    : element.getUnmaskedValue()
 * @object       : element °´Ã¼(this)
 * @param        : .
 * @return       : String - mask°¡ Á¦°ÅµÈ value
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / element.getUnmasked()
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ value¿¡ ´ëÇÏ¿© unmaskingµÈ value¸¦ ¹ÝÈ¯ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_get_unmasked_value()  {
  return ( this.getUnmaskedValueHandler) ?  this.getUnmaskedValueHandler(this) : this.value;
}

/*******************************************************************************************************************
 * @prototype    : element.setMaskHandler(getMaskedValueHandler, getUnmaskedValueHandler)
 * @object       : element °´Ã¼(this)
 * @param        : Function - getMaskedValueHandler (getMaskedValue ½Ã¿¡ È£ÃâÇÒ function)
 * @param        : Function - getUnmaskedValueHandler (getUnmaskedValue ½Ã¿¡ È£ÃâÇÒ function)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / element.setMask()
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡¼­ »ç¿ëÇÒ getMaskedValueHandler ¹× getUnmaskedValueHandler¸¦ ÁöÁ¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function em_set_mask_handler(getMaskedValueHandler, getUnmaskedValueHandler)  {
  if (this.getMaskedValueHandler == null) this.getMaskedValueHandler = getMaskedValueHandler;
  if (this.getUnmaskedValueHandler == null) this.getUnmaskedValueHandler = getUnmaskedValueHandler;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///   Form °´Ã¼ Extension
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : form.initialize()
 * @object       : form °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : form°´Ã¼ÀÇ attribute, method, eventµîÀ» defineÇÏ°í element °´Ã¼¸¦ ÃÊ±âÈ­ ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_initialize() {

  //attribute
  this.xjos      = true;       //tagged by xJos
  this.impotence = false;      //make form useless attribute
  window.xBuffer[this.uniqueID] = new Array; //detected xJos-binding elements buffering array

  //Pseudo-inheritance Method definition
  this.setCss      = pm_set_css;
  this.unsetCss    = pm_unset_css;
  this.containCSS  = pm_contain_css;

  this.toggleCss   = pm_toggle_css;
  this.doAction    = pm_do_action;

  //methods definition
  this.count         = fm_count;
  this.clear         = fm_clear;

  this.disable       = fm_disable;
  this.enable        = fm_enable;
  this.show          = fm_show;
  this.hide          = fm_hide;
  this.setReadOnly   = fm_set_readonly;
  this.unsetReadOnly = fm_unset_readonly
  this.setCheck      = fm_set_check;
  this.unsetCheck    = fm_unset_check;

  this.trim  = fm_trim;
  this.lTrim = fm_left_trim;
  this.rTrim = fm_right_trim;

  this.call       = fm_call;
  this.callByType = fm_call_by_type;
  this.setSendValue = fm_set_send_value;
  this.setDynaAction = fm_set_dyna_action;

  this.getElementsByNames = fm_get_elements_by_names;
  this.getxJosElementsByNames = fm_get_xjos_elements_by_names;

  this.appendHiddenElementsByURI = fm_append_hidden_elements_by_uri;
  this.appendHiddenElement       = fm_append_hidden_element;
  this.appendElementByTag        = fm_append_element_by_tag;

  this.copyToArray     = fm_copy_to_array;

  //xjos engines method
  this.xFactory = fm_x_factory;
  this.attachX  = fm_attach_x;
  this.detachX  = fm_detach_x;
  this.clearX   = fm_clear_x;
  this.finishAttachX = fm_finish_attach_x;

  this.validate  = fm_validate;
  this.masking   = fm_masking;
  this.unmasking = fm_unmasking;

  //xjos submit-framework method
  if (this.onsubmit) this.userOnSubmitHandler = this.onsubmit;
  this.onsubmit = fe_onsubmit;
  this.fireSubmit = fm_fire_submit;
  this.serveSubmit = fm_serve_submit;

  //initialize element
  this.xFactory();
}

/*******************************************************************************************************************
 * @prototype    : form.count(names, [value [,value...]])
 * @object       : form °´Ã¼(this)
 * @param        : String - names  (countÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @param        : String - value (countÇÒ value)
 * @return       : Integer - countµÈ °¹¼ö
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø element°¡ value¸¦ °¡Áø °æ¿ì¸¦ countÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_count(names)  {
  var eArray = this.getElementsByNames(names);
  var mCnt = 0;
  var flag = null;
  var itill = eArray.length;
  for (var idx=0; idx < itill; idx++) {
    if (eArray[idx].tagName == "OBJECT" ) continue;
    flag = arguments.length > 1 ? eArray[idx].contain(xuGetArray(arguments, 1)) : eArray[idx].contain();
    if (flag) mCnt ++;
  }

  return mCnt;
}

/*******************************************************************************************************************
 * @prototype    : form.clear(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (clear()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ clear()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_clear(names) { this.call('clear', names); }

/*******************************************************************************************************************
 * @prototype    : form.disable(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (disable()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ disable()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_disable(names) { this.call('disable', names); }

/*******************************************************************************************************************
 * @prototype    : form.enable(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (enable()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ enable()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_enable(names) { this.call('enable', names); }

/*******************************************************************************************************************
 * @prototype    : form.show(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (show()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ show()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_show(names) { this.call('show', names); }

/*******************************************************************************************************************
 * @prototype    : form.hide(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (hide()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ hide()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_hide(names) { this.call('hide', names); }

/*******************************************************************************************************************
 * @prototype    : form.setReadOnly(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (setReadOnly()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ setReadOnly()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_set_readonly(names) { this.call('setReadOnly', names); }

/*******************************************************************************************************************
 * @prototype    : form.unsetReadOnly(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (unsetReadOnly()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ unsetReadOnly()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_unset_readonly(names) { this.call('unsetReadOnly', names); }

/*******************************************************************************************************************
 * @prototype    : form.setCheck(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (setCheck()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ setCheck()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_set_check(names) { this.call('setCheck', names); }

/*******************************************************************************************************************
 * @prototype    : form.unsetCheck(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (unsetCheck()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ unsetCheck()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_unset_check(names) { this.call('unsetCheck', names); }

/*******************************************************************************************************************
 * @prototype    : form.trim(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (trim()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ trim()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_trim(names) { this.call('trim', names); }

/*******************************************************************************************************************
 * @prototype    : form.lTrim(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (lTrim()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ lTrim()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_left_trim(names) { this.call('lTrim', names); }

/*******************************************************************************************************************
 * @prototype    : form.rTrim(names)
 * @object       : form °´Ã¼(this)
 * @param        : String - names (rTrim()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ rTrim()À» callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_right_trim(names) { this.call('rTrim', names); }

/*******************************************************************************************************************
 * @prototype    : form.call(func [,names [,limitor]])
 * @object       : form °´Ã¼(this)
 * @param        : String - func (Àû¿ëÇÒ ÇÔ¼öÀÌ¸§)
 * @param        : String - names (elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @param        : Boolean - limitor (xJos keyword°¡ Àû¿ëµÈ element¿¡¼­¸¸ Ã£À» °ÍÀÎÁö¸¦ ÁöÁ¤)
 * @return       : Object - ½ÇÇàµÈ func¿¡¼­ ¸®ÅÏµÈ °ª
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / form.methodWrapper()
 * @origin       : xJos v3.0 / xfunction build 101 / form.applyAll()
 * @origin       : xJos v3.0 / xfunction build 101 / form.applyNamed()
 * @origin       : xJos v3.0 / xfunction build 100 / form.callObjMethod()
 * @interkeyword : .
 * @todo         : !callµÇ´Â funcÀÇ parameter¸¦ Ã³¸®ÇÏ´Â ±â´É Ãß°¡
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø element¸¦ ´ë»óÀ¸·Î delegate method¸¦ callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_call(func, names, limitor) {
  var eArray = (limitor) ? this.getxJosElementsByNames(names) : this.getElementsByNames(names) ;
  var itill = eArray.length;
  for (var idx=0; idx < itill ; idx++) {
    if (eArray[idx].tagName == "OBJECT" || !eArray[idx].xjos ) continue;
    try { eArray[idx].call(func) } catch (e) {};
  }
  return ;
}

/*******************************************************************************************************************
 * @prototype    : form.callByType(func, types)
 * @object       : form °´Ã¼(this)
 * @param        : String - func (Àû¿ëÇÒ ÇÔ¼öÀÌ¸§)
 * @param        : String - types (elementÀÇ type È¤Àº ,·Î ±¸ºÐµÈ typeµé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / form.applyTyped()
 * @interkeyword : .
 * @todo         : !typeÀÇ Æ¯¼º¿¡ µû¶ó element.length¸¦ looping ÇØ¾ß ÇÏ¹Ç·Î ´ë·« ³¶ÆÐ
 * @desc         : types¿¡ matchµÇ´Â typeÀ» °¡Áø °´Ã¼µéÀ» ´ë»óÀ¸·Î func ÇÔ¼ö¸¦ callÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_call_by_type(func, types)  {
  var tArray = types.split(",");
  var itill = this.elements.length;
  for (var idx=0; idx < itill; idx++) {
    if (this.elements[idx].tagName == "OBJECT" ) continue;
    if (tArray.contain(this.elements[idx].type)) {
    try { this.elements[idx].call(func) } catch (e) {};
    }
  }
}

/*******************************************************************************************************************
 * @prototype    : form.setSendValue(param)
 * @object       : form °´Ã¼(this)
 * @param        : String - param (send_value·Î »ý¼ºÇÒ elementÀÇ ¼Ó¼º°ª name=value&aename=shin&phone=019ÀÇ ÇüÅÂ)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / fm_set_send_value
 * @interkeyword : .
 * @todo         : .
 * @desc         : send_value·Î »ç¿ëÇÒ ¹®ÀÚ¿­À» ¼¼ÆÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_set_send_value(param)  {
  this.setAttribute("send_value", val);
}

/*******************************************************************************************************************
 * @prototype    : form.setSendValue(param)
 * @object       : form °´Ã¼(this)
 * @param        : String - param (send_value·Î »ý¼ºÇÒ elementÀÇ ¼Ó¼º°ª name=value&aename=shin&phone=019ÀÇ ÇüÅÂ)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / fm_set_send_value
 * @interkeyword : .
 * @todo         : .
 * @desc         : send_value·Î »ç¿ëÇÒ ¹®ÀÚ¿­À» ¼¼ÆÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_set_dyna_action(param) {
	alert(param);
  this.setAttribute("dyna_action", param);
}

/*******************************************************************************************************************
 * @prototype    : form.getElementsByNames([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names (Ã£À» elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @return       : Array - ÇØ´çµÇ´Â element array
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names¿¡ ÇØ´çµÇ´Â elementµéÀ» Ã£¾Æ¼­ Array·Î ±¸¼ºÇÏ¿© ¸®ÅÏÇÑ´Ù. ÀÌ¶§ typeÀÌ OBJECTÀÎ element°¡ Æ÷ÇÔµÉ ¼ö ÀÖÀ½À» ÁÖÀÇÇÏ¶ó.
 * @attention    : .
 ******************************************************************************************************************/
function fm_get_elements_by_names(names)  {
  if (!names) return xuGetArray(this.elements);
  var rArray = new Array;
  var nArray = names.split(",");
  for (var idx=0; idx < nArray.length; idx++) {
    try { rArray = rArray.concat(xuGetArray(this.elements(nArray[idx]))) } catch(e) {};
  }
  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : form.getxJosElementsByNames([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names (Ã£À» elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @return       : Array - ÇØ´çµÇ´Â element array
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xjos keyword¸¦ »ç¿ëÇÑ elementÁß¿¡¼­ name È¤Àº ,·Î ±¸ºÐµÈ names¿¡ ÇØ´çµÇ´Â elementµéÀ» Ã£¾Æ¼­ Array·Î ±¸¼ºÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_get_xjos_elements_by_names(names)  {
  var xBuffer = window.xBuffer[this.uniqueID];
  if (!names) return xBuffer;
  var rArray = new Array;
  var nArray = names.split(",");
  var itill = xBuffer.length;
  for (var idx=0; idx < itill; idx++) {
    if (nArray.contain(xBuffer[idx].name)) rArray[rArray.length] = xBuffer[idx];
  }
  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : form.appendHiddenElementsByURI(uRi)
 * @object       : form °´Ã¼(this)
 * @param        : String - uRi  (»ý¼ºÇÒ hidden fieldsÀÇ name=value ½Öµé, name=value&name=valueÀÇ ÇüÅÂ)
 * @return       : Array - »ý¼ºµÈ Element¸¦ ³»ºÎÀûÀ¸·Î °¡Áö°í ÀÖ´Â Array
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / form.addHiddenFields()
 * @interkeyword : .
 * @todo         : .
 * @desc         : name=value&name=value ÇüÅÂ·Î ÀÌ·ç¾îÁø uRi¸¦ ºÐ¼®ÇÏ¿© Hidden field¸¦ »ý¼º/Ãß°¡ÇÏ°í ¸®ÅÏ ¹Þ´Â´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_append_hidden_elements_by_uri(uRi){
  var rArray = new Array;
  var uArray = uRi.hack("&","=");
  var itill = uArray.length;
  var name, value, key;

  for (var idx=0; idx<uArray.length; idx++) {
    try { rArray = rArray.concat(this.appendHiddenElement(uArray[idx][0], uArray[idx][1] )); } catch (e) {}
  }

  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : form.appendHiddenElement(eName [,eValue])
 * @object       : form °´Ã¼(this)
 * @param        : String - eName  (»ý¼ºÇÒ hidden fieldsÀÇ name)
 * @param        : String - eValue (»ý¼ºÇÒ hidden fieldsÀÇ value, »ý·«½Ã¿¡´Â ""·Î Ä¡È¯µÊ)
 * @return       : Array - »ý¼ºµÈ Element¸¦ ³»ºÎÀûÀ¸·Î °¡Áö°í ÀÖ´Â Array
 * @event        : .
 * @option       : Boolean - X_ALLOW_MULTI_CREATE (°°Àº ÀÌ¸§ÀÇ element°¡ ÀÌ¹Ì Á¸ÀçÇÒ °æ¿ì, true : µ¿ÀÏÇÑ ÀÌ¸§ÀÇ element¸¦ »õ·Î »ý¼º, false : °°Àº ÀÌ¸§ÀÇ ¸ðµç ±âÁ¸ element¿¡ value¸¦ »õ·Î assign)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 100 / form.createHidden()
 * @interkeyword : .
 * @todo         : !dynymicÇÏ°Ô »ý¼ºµÈ element¿¡´Â xcreated¸¦ true·Î »ý¼ºÇÑ´Ù. ÀÌ attributeÀÇ È°¿ëµµ?
 * @desc         : eName ÀÌ¸§ÀÇ hidden field¸¦ »ý¼ºÇÏ°í eValue°ªÀ¸·Î ¼³Á¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_append_hidden_element(eName, eValue){

  var eArray = this.getElementsByNames(eName);
  var rArray = new Array;
  eValue = ( typeof(eValue) == "undefined") ? "" : eValue ;
  if (eArray.length > 0 && !window.xGetOption("X_ALLOW_MULTI_CREATE")) {
    for (var idx=0; idx < eArray.length; idx++) {
      try { eArray[idx].setValue(eValue); } catch(e) {}
    }
    return eArray;
  }

  var oElement = document.createElement("input");
  oElement.setAttribute("type", "hidden");
  oElement.setAttribute("value", eValue);
  oElement.setAttribute("xcreated", true);
  this.insertBefore(oElement);
  rArray[0] = oElement;
  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : form.appendElementByTag(eTag, eParam [,oSibling])
 * @object       : form °´Ã¼(this)
 * @param        : String - eTag (»ý¼ºÇÒ elementÀÇ Tag)
 * @param        : String - eParam (»ý¼ºÇÒ elementÀÇ ¼Ó¼º°ª name=txtAddress&value=na&required=trueÀÇ ÇüÅÂ)
 * @param        : String - oSibling(»õ·Î »ý¼ºµÉ element°¡ À§Ä¡ÇÒ Sibling Element)
 * @return       : Array - »ý¼ºµÈ Element¸¦ ³»ºÎÀûÀ¸·Î °¡Áö°í ÀÖ´Â Array
 * @event        : .
 * @option       : Boolean - X_ALLOW_MULTI_CREATE (°°Àº ÀÌ¸§ÀÇ element°¡ ÀÌ¹Ì Á¸ÀçÇÒ °æ¿ì, true : µ¿ÀÏÇÑ ÀÌ¸§ÀÇ element¸¦ »õ·Î »ý¼º, false : °°Àº ÀÌ¸§ÀÇ ¸ðµç ±âÁ¸ element¿¡ value¸¦ »õ·Î assign)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : xJos v3.0 / xfunction build 101 / form.createObject()
 * @interkeyword : .
 * @todo         : !»ý¼ºµÈ element´Â xJos initialize¸¦ ¼öÇàÇÏÁö´Â ¾Ê´Â´Ù.
 * @todo         : !dynymicÇÏ°Ô »ý¼ºµÈ element¿¡´Â xcreated¸¦ true·Î »ý¼ºÇÑ´Ù. ÀÌ attributeÀÇ È°¿ëµµ?
 * @desc         : eleTag¿¡ ÇØ´çµÇ´Â °´Ã¼¸¦ »ý¼ºÇÏ°í, ÇØ´ç °´Ã¼ÀÇ attribute¸¦ ¼¼ÆÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_append_element_by_tag(eTag, eParam, oSibling){

  var pArray = cParam.hack("&","=");
  var oElement = document.createElement(eTag);
  for (var idx=0; idx < pArray.length; idx++ ) {
    oElement.setAttribute(pArray[idx][0], pArray[idx][1]);
  }

  var eName = oElement.getAttribute("name");
  if (eName && !window.xGetOption("X_ALLOW_MULTI_CREATE" )  ) {
    var eArray = this.getElementsByNames(eName);
    var eValue = oElement.getAttribute("value");
    for (var idx=0; idx < eArray.length; idx++) {
      try { eArray[idx].setValue(eValue); } catch(e) {}
    }
    delete oElement;
    return eArray;
  }

  oElement.setAttribute("xcreated", true);

  (oSibling) ? this.insertBefore(oElement, oSibling) : this.insertBefore(oElement);

  rArray[0] = oElement;
  return rArray;
}

/*******************************************************************************************************************
 * @prototype    : form.copyToArray([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names  (Array·Î copyÇÒ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @return       : Array - formÀÇ °¢ elemetÀÇ name/value°ªÀ» Array·Î Æ÷ÇÔÇÏ´Â 2Â÷¿ø Array
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : formÀÇ element Áß name È¤Àº ,·Î ±¸ºÐµÈ names¿Í matchµÇ´Â elementÀÇ name/value¸¦ 2Â÷ Array·Î º¯È¯ÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_copy_to_array(names)  {
  var eArray = this.getElementsByNames(names);
  var rArray = new Array;
  var itill = eArray.length;
  var value = null;

  for (var idx=0; idx < itill ; idx++) {
    if (eArray[idx].tagName == "OBJECT" ) continue;
    if (eArray[idx].type == "button" || eArray[idx].type == "submit" || eArray[idx].type == "reset" ) continue;
    if (!window.xGetOption("X_SUPPORT_HIDDEN_TYPE") && eArray[idx].type == 'hidden') continue;
    if (!eArray[idx].xjos ) continue;
    value = eArray[idx].getValue();
    if ( value == null ) continue;
    if ( value instanceof Array) { //when select-multiple
      for (var jdx=0; jdx < value.length; jdx++) {
        rtnArr[rtnArr.length] = [ eArray[idx].name, value[jdx] ];
      }
    } else {
      rtnArr[rtnArr.length] = [ eArray[idx].name, value ];
    }
  }

  return rtnArr;
}

/*******************************************************************************************************************
 * @prototype    : form.xFactory()
 * @object       : form °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @option       : Boolean - X_RESTRICT_APPLY      (true:element¿¡ xjos attribute°¡ Á¸ÀçÇÏ´Â °æ¿ì¿¡¸¸ initialize¸¦ ¼öÇàÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : form ÇÏÀ§ÀÇ element¿¡ ´ëÇÏ¿© initialize¸¦ ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_x_factory() {
  var itill = this.elements.length;
  var optH = window.xGetOption("X_SUPPORT_HIDDEN_TYPE");
  var optR = window.xGetOption("X_RESTRICT_APPLY");
  var oInput = null;
  for(var idx=0; idx < itill ; idx++) {
    oInput = this.elements[idx];
    if (oInput.tagName == "OBJECT" ) continue;
    if (optR && oInput.getAttribute("xjos") == null) continue;
    if (!optH && oInput.type == 'hidden') continue;
    oInput.initialize = em_initialize;
    oInput.initialize(this);
    //!attach all binding keywords
    //if (window.xGetOption("X_CSS_PLAINED")) this.attahX("plain_box");
    //if (window.xGetOption("X_NEXT_FOCUS_ON_ENTER")) this.addXObj("enter_move_focus", "xo_enter_move_focus");
  }
}

/*******************************************************************************************************************
 * @prototype    : form.attachX(names, key [,val])
 * @object       : form °´Ã¼(this)
 * @param        : String - names(´ë»óÀÌ µÉ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @param        : String - key  (»õ·Î Àû¿ëÇÒ xJos Keyword)
 * @param        : String - val  (»õ·Î Àû¿ëÇÒ xJos KeywordÀÇ value/attribute)
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : formÀÇ element Áß name È¤Àº ,·Î ±¸ºÐµÈ names¿Í matchµÇ´Â element¿¡ ´ëÇÏ¿© »õ·Î¿î xJos keyword¸¦ Àû¿ëÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_attach_x(names, key, val) {
  var eArray = this.getElementsByNames(names);
  var itill = eArray.length;
  for (var idx=0; idx < itill ; idx++) {
    if (eArray[idx].tagName == "OBJECT" ) continue;
    if (!window.xGetOption("X_SUPPORT_HIDDEN_TYPE") && eArray[idx].type == 'hidden') continue;
    eArray[idx].attachX(key, val);
  }
}

/*******************************************************************************************************************
 * @prototype    : form.detachX(names, key)
 * @object       : form °´Ã¼(this)
 * @param        : String - names(´ë»óÀÌ µÉ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @param        : String - key  (»õ·Î Àû¿ëÇÒ xJos Keyword)
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : formÀÇ element Áß name È¤Àº ,·Î ±¸ºÐµÈ names¿Í matchµÇ´Â element¿¡ ´ëÇÏ¿© element¿¡ ±â Àû¿ëµÈ xJos keyword¸¦ Á¦°Å ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_detach_x(names, key) {
  var eArray = this.getElementsByNames(names);
  var itill = eArray.length;
  for (var idx=0; idx < itill ; idx++) {
    if (eArray[idx].tagName == "OBJECT" ) continue;
    if (!window.xGetOption("X_SUPPORT_HIDDEN_TYPE") && eArray[idx].type == 'hidden') continue;
    eArray[idx].detachX(key);
  }
}

/*******************************************************************************************************************
 * @prototype    : form.clearX(names, [deep])
 * @object       : form °´Ã¼(this)
 * @param        : String - names(´ë»óÀÌ µÉ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @param        : Boolean - deep (trueÀÎ °æ¿ì xJos keyword Àû¿ë attribute¸¦ Á¦°ÅÇÑ´Ù.)
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_SUPPORT_HIDDEN_TYPE (true:¼öÇà½Ã hidden typeÀÇ element¸¦ Æ÷ÇÔÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element¿¡ Àû¿ëµÈ xjos keyword¸¦ ¸ðµÎ Á¦°Å ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_clear_x(deep) {
  var eArray = this.getElementsByNames(names);
  var itill = eArray.length;
  for (var idx=0; idx < itill ; idx++) {
    if (eArray[idx].tagName == "OBJECT" ) continue;
    if (!window.xGetOption("X_SUPPORT_HIDDEN_TYPE") && eArray[idx].type == 'hidden') continue;
    eArray[idx].clearX(deep);
  }
}

/*******************************************************************************************************************
 * @prototype    : form.finishAttachX()
 * @object       : form °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_SHOW_ELAPSED (true:¼öÇà¿¡ °É¸° ½Ã°£À» status bar¿¡ Ç¥½ÃÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : element.attachX()µîÀ» »ç¿ëÇÏ¿© xJos BufferÀÇ rearrange°¡ ÀÏ¾î³­ °æ¿ì, ÀÌ¸¦ Á¤¸®ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_finish_attach_x() {
  var target = window.xBuffer[this.uniqueID];
  var start = new Date();
  target.sort(xuSortFunction);
  var end = new Date();
  if (window.xGetOption("X_SHOW_ELAPSED")) window.status = " xJos xBuffer refresh elasped = " + (end - start) + " m/s";
}

/*******************************************************************************************************************
 * @prototype    : form.validate([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names  (countÇÒ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_SHOW_ELAPSED (true:¼öÇà¿¡ °É¸° ½Ã°£À» status bar¿¡ Ç¥½ÃÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 102
 * @origin       : .
 * @interkeyword : onValidateBegin - validationÀÌ ¼öÇàµÇ±â Àü¿¡ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @interkeyword : onValidateEnd - validationÀÌ ¼öÇàµÈ ÈÄ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @todo         : !validation¿¡¼­ submit event cancel logic?
 * @todo         : !alter keyword´Â ¾î¶»°Ô Àû¿ëÇÒ °ÍÀÎ°¡?
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ validationÀ» ¼öÇàÇÑ´Ù. ÀÌ¶§, element´Â xJos keyword°¡ »ç¿ë µÈ °æ¿ì·Î Á¦ÇÑµÈ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_validate(names) {
  var execCmd = "";
  var flag = true;
  var eArray = this.getxJosElementsByNames(names);

  execCmd = this.getAttribute("onValidateBegin");
  if (execCmd && this.doAction(execCmd, "ValidateBegin") == false) flag = false;

  var start = new Date();

  var itill = eArray.length;
  for(var idx=0; flag && idx < itill; idx++){
    if (eArray[idx].validate && eArray[idx].validate() == false ) flag = false;
  }

  var end = new Date();
  if (flag && window.xGetOption("X_SHOW_ELAPSED")) window.status = " xJos validation elasped = " + (end - start) + " m/s";

  execCmd = this.getAttribute("onValidateEnd");
  if (flag && execCmd && this.doAction(execCmd, "ValidateEnd") == false) flag = false;

  return flag;
}

/*******************************************************************************************************************
 * @prototype    : form.masking([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names (masking()À» Àû¿ëÇÒ elementÀÇ name È¤Àº ,·Î ±¸ºÐµÈ names)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ masking()À» callÇÑ´Ù. ÀÌ¶§, element´Â xJos keyword°¡ »ç¿ë µÈ °æ¿ì·Î Á¦ÇÑµÈ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_masking(names) { this.call('masking', names, true); }

/*******************************************************************************************************************
 * @prototype    : form.unmasking([names])
 * @object       : form °´Ã¼(this)
 * @param        : String - names (unmasking()À» Àû¿ëÇÒ elementÀÇ ÀÌ¸§ È¤Àº ,·Î ±¸ºÐµÈ ÀÌ¸§µé)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : names¿¡ matchµÇ´Â nameÀ» °¡Áø elementÀÇ unmasking()À» callÇÑ´Ù. ÀÌ¶§, element´Â xJos keyword°¡ »ç¿ë µÈ °æ¿ì·Î Á¦ÇÑµÈ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_unmasking(names) { this.call('unmasking', names, true); }


/*******************************************************************************************************************
 * @prototype    : form.onSubmitHandler()
 * @object       : form °´Ã¼(this)
 * @param        : .
 * @return       : Boolean - submit ÁØºñ¿¡ ½ÇÆÐÇÏ¸é false
 * @event        : form.onsubmit
 * @option       : Boolean - X_HOOK_SUBMIT_EVENT_ACTIVATE (true:xJos°¡ onSubmit Event¸¦ ÇÚµé¸µÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 101
 * @origin       : .
 * @interkeyword : .
 * @todo         : !onSubmitÀÌ ¼öÇàµÈ µÚ¿¡ xJos°¡ user defined functionÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀÌ ¾ø´Ù.
 * @desc         :  xJos°¡ on submit event¸¦ ÇÚµé¸µÇÏ°í ÀÚµ¿À¸·Î submitµÈ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fe_onsubmit()  {
  if ( !window.xGetOption("X_HOOK_SUBMIT_EVENT_ACTIVATE")) return;

  /* not user defined function but onSubmit ananoymouse function should return false if wants cancle event */
  if (this.userOnSubmitHandler && this.userOnSubmitHandler() == false) { window.event.returnValue = false; return false; }

  var oform = (window.event && window.event.type=='submit' && window.event.returnValue != false ) ? window.event.srcElement : null;

  if ( oform && oform.serveSubmit(window.event) == false) {
    window.event.returnValue = false;
    return false;
  }

}

/*******************************************************************************************************************
 * @prototype    : form.fireSubmit()
 * @object       : form °´Ã¼(this)
 * @param        : .
 * @return       : Boolean - submit ÁØºñ¿¡ ½ÇÆÐÇÏ¸é false
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : onSubmitBegin - SubmitÀÌ ¼öÇàµÇ±â Àü¿¡ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @interkeyword : onSubmitEnd - SubmitÀÌ ¼öÇàµÈ ÈÄ¿¡ ¸í½ÃµÈ functionÀ» ¼öÇàÇÑ´Ù.
 * @todo         : .
 * @desc         : xJos°¡ submit()À» È£ÃâÇÏµµ·Ï ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_fire_submit(evnt)  {
  var oform = (evnt && evnt.type=='submit') ? evnt.srcElement : this;
  execCmd = oform.getAttribute("onSubmitBegin");
  if (execCmd && oform.doAction(execCmd, "SubmitBegin") == false) flag = false;

  if ( this.serveSubmit() ) this.submit();
  else return false;

  execCmd = this.getAttribute("onSubmitEnd");
  if (execCmd && this.doAction(execCmd, "SubmitEnd") == false) flag = false;

  if (this.target && this.target.toLowerCase != "_self") this.masking();
}

/*******************************************************************************************************************
 * @prototype    : form.serveSubmit([evnt])
 * @object       : form °´Ã¼(this)
 * @param        : Event - evnt (form.onsubmit¿¡¼­ »ý¼ºµÈ event °³Ã¼)
 * @return       : Boolean - submit ÁØºñ¿¡ ¼º°øÇÏ¸é true
 * @event        : form.onsubmit
 * @option       : Boolean - X_VALIDATION_ACTIVATE (true:xJos°¡ onSubmit½Ã¿¡ validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : Boolean - X_DYNAMIC_ACTION_URL (true:onSubmit½Ã¿¡ dyna_actionÀ¸·Î ÁöÁ¤µÈ URI¿¡ ´ëÇÏ¿© dynamicÇÏ°Ô hidden field¸¦ ±¸¼ºÇÑ´Ù.)
 * @option       : Boolean - X_DYNAMIC_SEND_VALUE (true:onSubmit½Ã¿¡ send_value·Î ÁöÁ¤µÈ URI¿¡ ´ëÇÏ¿© dynamicÇÏ°Ô hidden field¸¦ ±¸¼ºÇÑ´Ù.)
 * @option       : Boolean - X_DISABLE_SUBMIT_ON_SUBMIT (true:ÀÌÁß submit ¹æÁö ±â´ÉÀ» »ç¿ëÇÑ´Ù. - submitÈÄ ¸îÃÊ°£ formÀ» ºñÈ°¼ºÈ­ ÇÏ°í submit°ü·Ã buttonÀ» disable ½ÃÅ²´Ù.)
 * @option       : Integer - X_DISABLE_SUBMIT_TIMEOUT (true:ÀÌÁß submit ¹æÁö½Ã submitÀ» ´Ù½Ã È°¼ºÈ­ ÇÒ ½Ã°£-ms¸¦ ¼³Á¤ÇÑ´Ù.)
 * @option       : String  - X_DISABLE_SUBMIT_TYPE (true:ÀÌÁß submit ¹æÁö½Ã disable ½ÃÅ³ element typeÀ» Á¤ÀÇÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : confirm
 * @todo         : ! send_value´Â keyword·Î ÁöÁ¤ÇÏ¿©¾ß ÇÑ´Ù.
 * @desc         : submit ÀÌÀü ´Ü°è¸¦ ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function fm_serve_submit(evnt)  {
  var flag = true;
  var execCmd = "";

  var oform = (evnt && evnt.type=='submit') ? evnt.srcElement : this;

  if ( flag && oform.impotence ) {
    alert(xaMessagesTable["disable_submit"][0]);
    flag = false;
  }

  if ( flag && window.xGetOption("X_VALIDATION_ACTIVATE") && oform.validate ) {
    flag = oform.validate();
  }

  var con = oform.getAttribute("confirm");
  if ( flag && con != null && !confirm(con) ) flag = false;

  if ( flag && oform.unmasking) oform.unmasking();

  var dynaAction = oform.getAttribute("dyna_action");

  if ( flag && window.xGetOption("X_DYNAMIC_ACTION_URL") && dynaAction ) {
    oform.action = dynaAction;
    oform.removeAttribute("dyna_action");
  }

  var sendvalue = oform.getAttribute("send_value");
  if ( flag && window.xGetOption("X_DYNAMIC_SEND_VALUE") && sendvalue  ) {
    window.xCreatedBuffer = oform.appendHiddenElementsByURI(sendvalue);
    oform.removeAttribute("send_value");
  }

  if ( flag && window.xGetOption("X_DISABLE_SUBMIT_ON_SUBMIT")) {
    oform.impotence = true;
    var timeout = window.xGetOption("X_DISABLE_SUBMIT_TIMEOUT");
    this.callByType("disable", window.xGetOption("X_DISABLE_SUBMIT_TYPE"));
    if (oform.name) setTimeout("document."+ oform.name + ".impotence = false", timeout);
    if (oform.name) setTimeout("document."+ oform.name + ".callByType('enable', window.xGetOption('X_DISABLE_SUBMIT_TYPE'))", timeout);
  }

  return flag;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  xJos Class Definitions blow
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 *** @xkeyword     : required (ÇÊ¼öÀÔ·Â)
 ===================================================================================================================
 *** @xclass       : xo_required
 *** @xattach      : xo_required_attach
 *** @xdetach      : xo_required_detach
 *** @xcss         : xjs_required
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_required_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : jsx v1.5
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÇÊ¼ö ÀÔ·ÂÀ» Ã¼Å©ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_required.attach(oInput)
 * @object       : xo_required
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : xJos v3.0 / xfunction build 100 / xo_required()
 * @interkeyword : .
 * @todo         : .
 * @desc         : required Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_required_attach(oInput) {
  if (oInput.getAttribute("required") != "mute") {
    oInput.setCss("xjs_required");
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_required.detach(oInput)
 * @object       : xo_required
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : required Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_required_detach(oInput) {
  if (oInput.getAttribute("required") != "mute") {
    oInput.unsetCss("xjs_required");
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_required.validate(oInput)
 * @object       : xo_required
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_REQUIRED_IGNORE_WHITESPACE (true:ºó ¹®ÀÚ¿­Àº required¿¡¼­ ¿¡·¯·Î Ãë±ÞÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÇÊ¼öÀÔ·ÂÀ» Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_required_validate(oInput) {
  var flag = true;

  if (!oInput.value) flag = false;

  if(flag && window.xGetOption("X_REQUIRED_IGNORE_WHITESPACE") && /^\s*$/.test(oInput.value)) flag = false;

  if (flag && oInput.type == "checkbox" && !oInput.checked ) flag = false;
  if (flag && oInput.type == "radio" && !oInput.checked ) flag = false;
  if (flag && ( oInput.type == "select-one" || oInput.type == "select-multiple" )  && !oInput.selectedIndex == -1 ) flag = false;

  if (!flag) {
    oInput.alertX(oInput.getMessage("required"));
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : reg_exp (Á¤±Ô½Ä)
 ===================================================================================================================
 *** @xclass       : xo_reg_exp
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_reg_exp_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÌ Á¤ÀÇÇÑ Á¤±Ô½Ä¿¡ ¸Â´Â ÀûÀýÇÑ °ªÀÎÁö¸¦ Ã¼Å© ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_reg_exp.validate(oInput)
 * @object       : xo_reg_exp
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ Á¤ÀÇÇÑ Á¤±Ô½Ä¿¡ ¸Â´Â ÀûÀýÇÑ °ªÀÎÁö¸¦ Ã¼Å© ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_reg_exp_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  var val = oInput.getAttribute("reg_exp");
  var regExp = val instanceof RegExp ? val : new RegExp(val);

  if (!regExp.test(oInput.value)) {
    oInput.alertX(oInput.getMessage("reg_exp").substituteAt(regExp));
    flag = false;
  }

  delete regExp;
  return flag;

}


/*******************************************************************************************************************
 *** @xkeyword     : filter (ÇÊÅÍ)
 ===================================================================================================================
 *** @xclass       : xo_filter
 *** @xattach      : xo_filter_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onkeypress - xo_filter_onkeypress
 *** @xevent       : onpaste - xo_filter_onpaste
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Á¤ÀÇµÈ filter¿¡ ÀÇ°ÅÇÏ¿© »ç¿ëÀÚÀÇ ÀÔ·Â Å° °ªÀ» ¸·´Â´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_filter.attach(oInput)
 * @object       : xo_filter
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : filter Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_filter_attach(oInput) {
   var filter = oInput.getAttribute("filter");
   if (filter && !oInput.getAttribute("mask") && oInput.value) oInput.value = oInput.value.filtering(filter);
}

/*******************************************************************************************************************
 * @prototype    : xo_filter.onkeypress(oInput, oEvent)
 * @object       : xo_filter
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onkeypress
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onkeypress°¡ ¹ß»ý½Ã Á¤ÀÇµÈ filter¿¡ ÇØ´çµÇÁö ¾Ê´Â ÀÔ·ÂÅ° °ªÀ» cancel ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_filter_onkeypress(oInput, oEvent) {
  var filter = oInput.getAttribute("filter");
  if (filter) {
    var sKey = String.fromCharCode(oEvent.keyCode);
    var re = new RegExp(filter);
    if(sKey!="\r" && !re.test(sKey)) oEvent.returnValue=false;
    delete re;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_filter.onpaste(oInput, oEvent)
 * @object       : xo_filter
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onpaste
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : paste°¡ ¹ß»ýµÇ¾î clipboard¿¡¼­ data°¡ copy½Ã¿¡ Á¤ÀÇµÈ filter¿¡ ÇØ´çµÇÁö ¾Ê´Â ¹®ÀÚ¸¦ cancel ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_filter_onpaste(oInput, oEvent) {
  try {
    var val = window.clipboardData.getData("Text");
    window.clipboardData.setData("Text", val.filtering(oInput.getAttribute("filter")));
  } catch (e) {}
}


/*******************************************************************************************************************
 *** @xkeyword     : mask (¸¶½ºÅ©)
 ===================================================================================================================
 *** @xclass       : xo_mask
 *** @xattach      : xo_mask_attach
 *** @xdetach      : xo_mask_detach
 *** @xcss         : .
 *** @xevent       : onfocus - xo_mask_onfocus
 *** @xevent       : onblur - xo_mask_onblur
 *** @xoption      : Boolean - X_VALIDATE_ON_MASK (true:mask keyword Àû¿ë½Ã mask¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_mask_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Á¤ÀÇµÈ mask¿¡ µû¶ó masking/unmasking ±â´ÉÀ» ¼öÇàÇÑ´Ù. X_VALIDATE_ON_MASK OptionÀÌ TrueÀÎ°æ¿ì ValidationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_mask.attach(oInput)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : mask Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_attach(oInput) {
  oInput.setMaskHandler(xo_mask_get_masked_value, xo_mask_get_unmasked_value);
  oInput.masking();
}

/*******************************************************************************************************************
 * @prototype    : xo_mask.detach(oInput)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : mask Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_detach(oInput) {
  oInput.unmasking();
  oInput.setMaskHandler(null, null);
}

/*******************************************************************************************************************
 * @prototype    : xo_mask.onblur(oInput, oEvent)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onblur°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ masking ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_onblur(oInput, oEvent)  { oInput.masking(); }

/*******************************************************************************************************************
 * @prototype    : xo_mask.onfocus(oInput, oEvent)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onfocus
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onfocus°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ unmasking ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_onfocus(oInput, oEvent) { oInput.unmasking(); }

/*******************************************************************************************************************
 * @prototype    : xo_mask.getMaskedValueHandler(oInput)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - mask°¡ Àû¿ëµÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getMaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_get_masked_value(oInput)  {
  if (!oInput.value) return oInput.value;
  var value = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");

  var mask = oInput.getAttribute("mask");
  var result = "";

  var itill = value.length;
  var jtill = mask.length;;
  for(var idx=0, jdx=0; idx< itill && jdx < jtill; idx++, jdx++){
     if ( mask.charAt(jdx) != "9") result += mask.charAt(jdx++);
     result += value.charAt(idx);
  }

  return result;
}


/*******************************************************************************************************************
 * @prototype    : xo_mask.getUnmaskedValueHandler(oInput)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - mask°¡ ÇØÁ¦µÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getUnmaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_mask_get_unmasked_value(oInput) {
  if (!oInput.value) return oInput.value;
  return oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");
}

/*******************************************************************************************************************
 * @prototype    : xo_mask.validate(oInput)
 * @object       : xo_mask
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_MASK (true:mask keyword Àû¿ë½Ã mask¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÁÖ¾îÁø maskÀÇ ÇüÅÂ¿Í ÀÏÄ¡ÇÏ´ÂÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/

function xo_mask_validate(oInput)  {
  if ( !window.xGetOption("X_VALIDATE_ON_MASK")) { return true; }
  var flag = true;
  if (!oInput.value) return flag;

  var mask = oInput.getAttribute("mask");
  oInput.masking();

  var pattern=oInput.mask.replace(window.xGetOption("X_DELIMITER_CHAR"),"\\$1");
      pattern=pattern.replace(/9/g ,"\\d");

  var regExp = new RegExp("^"+pattern+"$");
  if(!regExp.test(oInput.value))  {
    flag = false;
    oInput.alertX(oInput.getMessage("mask").substituteAt(mask));
  }

  delete regExp;
  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : alphabetic (¾ËÆÄºª)
 ===================================================================================================================
 *** @xclass       : xo_alphabetic
 *** @xattach      : xo_alphabetic_attach
 *** @xdetach      : xo_alphabetic_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_ALPHA ("[a-zA-Z]" : aplphabeticÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_REGEXP_ALPHA (/^[a-zA-Z]+$/ : aplphabeticÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_alphabetic_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ alphabetic ÇÊÅÍ¸¦ Àû¿ëÇÏ°í validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_alphabetic.attach(oInput)
 * @object       : xo_alphabetic
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_ALPHA ("[a-zA-Z]" : aplphabeticÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : alphabetic Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alphabetic_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_ALPHA"));
}

/*******************************************************************************************************************
 * @prototype    : xo_alphabetic.detach(oInput)
 * @object       : xo_alphabetic
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_ALPHA ("[a-zA-Z]" : aplphabeticÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : alphabetic Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alphabetic_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_ALPHA")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_alphabetic.validate(oInput)
 * @object       : xo_alphabetic
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_ALPHA (/^[a-zA-Z]+$/ : aplphabeticÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ alphabeticÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alphabetic_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  if (!window.xGetOption("X_REGEXP_ALPHA").test(oInput.value)) {
    oInput.alertX(oInput.getMessage("alphabetic"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : numeric (¼ýÀÚ)
 ===================================================================================================================
 *** @xclass       : xo_numeric
 *** @xattach      : xo_numeric_attach
 *** @xdetach      : xo_numeric_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption       : RegExp - X_REGEXP_NUM (/^[0-9]+$/ : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_numeric_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ alphabetic ÇÊÅÍ¸¦ Àû¿ëÇÏ°í validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_numeric.attach(oInput)
 * @object       : xo_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : numeric Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_numeric_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
}

/*******************************************************************************************************************
 * @prototype    : xo_numeric.detach(oInput)
 * @object       : xo_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : numeric Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_numeric_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_numeric.validate(oInput)
 * @object       : xo_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_NUM (/^[0-9]+$/ : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ numericÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_numeric_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  if (!window.xGetOption("X_REGEXP_NUM").test(oInput.value)) {
    oInput.alertX(oInput.getMessage("numeric"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : alpha_numeric (¾ËÆÄºª or ¼ýÀÚ)
 ===================================================================================================================
 *** @xclass       : xo_alpha_numeric
 *** @xattach      : xo_alpha_numeric_attach
 *** @xdetach      : xo_alpha_numeric_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : RegExp - X_REGEXP_ALNUM (/^[A-Za-z0-9]+$/ : alpha_numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : String - X_FILTER_ALNUM ("[A-Za-z0-9]" : alpha_numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xvalidation  : xo_alpha_numeric_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ alpha_numeric ÇÊÅÍ¸¦ Àû¿ëÇÏ°í submit½Ã¿¡ validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_alpha_numeric.attach(oInput)
 * @object       : xo_alpha_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_ALNUM ("[A-Za-z0-9]" : alpha_numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : numeric Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alpha_numeric_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_ALNUM"));
}

/*******************************************************************************************************************
 * @prototype    : xo_alpha_numeric.detach(oInput)
 * @object       : xo_alpha_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_ALNUM ("[A-Za-z0-9]" : alpha_numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : numeric Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alpha_numeric_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_ALNUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_numeric.validate(oInput)
 * @object       : xo_numeric
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_ALNUM (/^[A-Za-z0-9]+$/ : alpha_numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ alpha_numericÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_alpha_numeric_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  if (!window.xGetOption("X_REGEXP_ALNUM").test(oInput.value)) {
    oInput.alertX(oInput.getMessage("alpha_numeric"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : integer (Á¤¼ö)
 ===================================================================================================================
 *** @xclass       : xo_integer
 *** @xattach      : xo_integer_attach
 *** @xdetach      : xo_integer_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_INTEGER ("[0-9\\-\\+]" : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_integer_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ integer ÇÊÅÍ¸¦ Àû¿ëÇÏ°í submit½Ã¿¡ validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_integer.attach(oInput)
 * @object       : xo_integer
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_INTEGER ("[0-9\\-\\+]" : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : integer Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_integer_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_INTEGER"));
}

/*******************************************************************************************************************
 * @prototype    : xo_integer.detach(oInput)
 * @object       : xo_integer
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_INTEGER ("[0-9\\-\\+]" : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : integer Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_integer_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_INTEGER")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_integer.validate(oInput)
 * @object       : xo_integer
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ integer(Á¤¼öÇü) ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_integer_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  if (!window.xGetOption("X_REGEXP_INTEGER").test(oInput.value)) {
    oInput.alertX(oInput.getMessage("integer"));
    flag = false;
  }

  // if (parseInt(oInput.value, 10) == "NaN") oInput.value = "";
  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : float (½Ç¼ö)
 ===================================================================================================================
 *** @xclass       : xo_float
 *** @xattach      : xo_float_attach
 *** @xdetach      : xo_float_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xvalidation  : xo_float_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ float ÇÊÅÍ¸¦ Àû¿ëÇÏ°í submit½Ã¿¡ validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_float.attach(oInput)
 * @object       : xo_float
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : float Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_float_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_FLOAT"));
}

/*******************************************************************************************************************
 * @prototype    : xo_float.detach(oInput)
 * @object       : xo_float
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : float Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_float_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_FLOAT")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_float.validate(oInput)
 * @object       : xo_float
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ float(½Ç¼öÇü) ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_float_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;
  if (!window.xGetOption("X_REGEXP_INTEGER").test(oInput.value) && !window.xGetOption("X_REGEXP_FLOAT").test(oInput.value) ) {
    oInput.alertX(oInput.getMessage("float"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : hexa (16Áø¼ö)
 ===================================================================================================================
 *** @xclass       : xo_hexa
 *** @xattach      : xo_hexa_attach
 *** @xdetach      : xo_hexa_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : RegExp - X_REGEXP_HEXA (/^(\+|\-|[a-fA-F0-9]*)[a-fA-F0-9]+$/ : hexa¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : String - X_FILTER_HEXA ("[a-fA-F0-9\\-\\+]" : hexa¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xvalidation  : xo_hexa_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ hexa ÇÊÅÍ¸¦ Àû¿ëÇÏ°í submit½Ã¿¡ validationÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_hexa.attach(oInput)
 * @object       : xo_hexa
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_HEXA ("[a-fA-F0-9\\-\\+]" : hexa¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hexa Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hexa_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_HEXA"));
}

/*******************************************************************************************************************
 * @prototype    : xo_hexa.detach(oInput)
 * @object       : xo_hexa
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_HEXA ("[a-fA-F0-9\\-\\+]" : hexa¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hexa Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hexa_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_HEXA")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_hexa.validate(oInput)
 * @object       : xo_hexa
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_REGEXP_HEXA (/^(\+|\-|[a-fA-F0-9]*)[a-fA-F0-9]+$/ : hexa¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ hexa(16Áø¼öÇü) ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hexa_validate(oInput) {
  var flag = true;

  if (!oInput.value) return true;

  if (!window.xGetOption("X_REGEXP_HEXA").test(oInput.value) ) {
    oInput.alertX(oInput.getMessage("hexa"));
    flag = false;
  }

  // if (parseInt(oInput.value, 16).toString(16) == "NaN") oInput.value = "";
  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : maxlength (ÃÖ´ëÀÚ¸®)
 ===================================================================================================================
 *** @xclass       : xo_maxlength
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_maxlength_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : xJos v4.0
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ëÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (UniCode)
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_maxlength.validate(oInput)
 * @object       : xo_maxlength
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ëÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (UniCode)
 * @attention    : .
 ******************************************************************************************************************/
function xo_maxlength_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var val = oInput.getAttribute("minlength");

  if (oInput.value.length > val) {
    oInput.alertX(oInput.getMessage("maxlength").substituteAt(val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : minlength (ÃÖ¼ÒÀÚ¸®)
 ===================================================================================================================
 *** @xclass       : xo_minlength
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_minlength_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ¼ÒÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (UniCode)
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_minlength.validate(oInput)
 * @object       : xo_minlength
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ¼ÒÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (UniCode)
 * @attention    : .
 ******************************************************************************************************************/
function xo_minlength_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var val = oInput.getAttribute("minlength");

  if (oInput.value.length < val) {
    oInput.alertX(oInput.getMessage("minlength").substituteAt(val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : maxbyte (ÃÖ´ëByte)
 ===================================================================================================================
 *** @xclass       : xo_maxbyte
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_maxbyte_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ëÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (byte)
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_maxbyte.validate(oInput)
 * @object       : xo_maxbyte
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ëÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (byte)
 * @attention    : .
 ******************************************************************************************************************/
function xo_maxbyte_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var val = oInput.getAttribute("maxbyte");

  if (oInput.value.getByte() > val) {
    oInput.alertX(oInput.getMessage("maxbyte").substituteAt(val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : minbyte (ÃÖ¼ÒByte)
 ===================================================================================================================
 *** @xclass       : xo_minbyte
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_minbyte_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         :  ÀÔ·ÂµÈ °ªÀÇ ÃÖ¼ÒÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (byte)
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_minbyte.validate(oInput)
 * @object       : xo_minbyte
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ¼ÒÀÚ¸®¸¦ Ã¼Å© ÇÑ´Ù. (byte)
 * @attention    : .
 ******************************************************************************************************************/
function xo_minbyte_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var val = oInput.getAttribute("minbyte");

  if (oInput.value.getByte() < val) {
    oInput.alertX(oInput.getMessage("minbyte").substituteAt(val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : maxvalue (ÃÖ´ë°ª)
 ===================================================================================================================
 *** @xclass       : xo_maxvalue
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_maxvalue_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ë°ªÀ» ÃÊ°úÇÏ´ÂÁö °Ë»ç ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_maxvalue.validate(oInput)
 * @object       : xo_maxvalue
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÇ ÃÖ´ë°ªÀ» ÃÊ°úÇÏ´ÂÁö °Ë»ç ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_maxvalue_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var tval = parseFloat(oInput.value);
  var val  = oInput.getAttribute("maxvalue");

  if (tval > val) {
    oInput.alertX(oInput.getMessage("maxvalue").substituteAt(tval, val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : minvalue (ÃÖ¼Ò°ª)
 ===================================================================================================================
 *** @xclass       : xo_minvalue
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_minvalue_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂµÈ °ªÀÌÃÖ¼Ò°ª ¹Ì¸¸ÀÎÁö °Ë»ç ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_minvalue.validate(oInput)
 * @object       : xo_minvalue
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌÃÖ¼Ò°ª ¹Ì¸¸ÀÎÁö °Ë»ç ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_minvalue_validate(oInput)  {
  var flag = true;
  if (!oInput.value) return flag;

  var tval = parseFloat(oInput.value);
  var val  = oInput.getAttribute("maxvalue");

  if (tval < val) {
    oInput.alertX(oInput.getMessage("minvalue").substituteAt(tval, val));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : money (±Ý¾×)
 ===================================================================================================================
 *** @xclass       : xo_money
 *** @xattach      : xo_money_attach
 *** @xdetach      : xo_money_detach
 *** @xcss         : .
 *** @xevent       : onfocus - xo_money_onfocus
 *** @xevent       : onblur - xo_money_onblur
 *** @xoption      : Boolean - X_VALIDATE_ON_MASK (true:money keyword Àû¿ë½Ã money¿¡ ´ëÇÑ mask validationÀ» ¼öÇàÇÑ´Ù.)
 *** @xoption      : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_money_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ numberÇÊÅÍ¸¦ Àû¿ëÇÏ°í ±Ý¾×¿¡ ¸Â°Ô 3ÀÚ¸®¼ö¸¶´Ù ,¸¦ »ðÀÔÇÏ´Â mask¸¦ Àû¿ëÇÑ´Ù. X_VALIDATE_ON_MASK OptionÀÌ TrueÀÎ°æ¿ì ValidationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_money.attach(oInput)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : money Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_FLOAT"));
  oInput.setMaskHandler(xo_money_get_masked_value, xo_money_get_unmasked_value);
  oInput.masking();
}

/*******************************************************************************************************************
 * @prototype    : xo_money.detach(oInput)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : money Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_detach(oInput) {
  oInput.unmasking();
  oInput.setMaskHandler(null, null);
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_FLOAT")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_money.onblur(oInput, oEvent)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onblur°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ moneying ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_onblur(oInput, oEvent)  {  oInput.masking(); }

/*******************************************************************************************************************
 * @prototype    : xo_money.onfocus(oInput, oEvent)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onfocus
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onfocus°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ unmoneying ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_onfocus(oInput, oEvent) { oInput.unmasking(); }

/*******************************************************************************************************************
 * @prototype    : xo_money.getMaskedValueHandler(oInput)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - money°¡ Àû¿ëµÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getMaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_get_masked_value(oInput) {
  if (!oInput.value) return oInput.value;

  var value = oInput.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");

  value = parseFloat(value, 10).toString();
  if (value == "NaN") return "0";

  var result = "";
  var mArray = value.split(".");
  var iPart = mArray[0];
  var fPart = mArray[1];
  var itill = iPart.length;

  for( var idx=0; idx < itill; idx++){
    if (idx != 0 && ( idx % 3 == itill % 3) && iPart.charAt(idx - 1) !="-") result += ",";
    if (idx < itill ) result += iPart.charAt(idx);
  }

  if ( fPart ) result += "." + fPart;

  return result;
}

/*******************************************************************************************************************
 * @prototype    : xo_money.getUnmaskedValueHandler(oInput)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - money mask°¡ ÇØÁ¦µÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getUnmaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_get_unmasked_value(oInput) {
  if (!oInput.value) return oInput.value;
  return oInput.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");
}

/*******************************************************************************************************************
 * @prototype    : xo_money.validate(oInput)
 * @object       : xo_money
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_MASK (true:money keyword Àû¿ë½Ã money¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÁÖ¾îÁø money(½Ç¼öÇü ±Ý¾×)ÀÇ ÇüÅÂ¿Í ÀÏÄ¡ÇÏ´ÂÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_money_validate(oInput) {
  if ( !window.xGetOption("X_VALIDATE_ON_MASK")) { return true; }
  var flag = true;
  if (!oInput.value) return true;

  var val = this.parent.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");

  if (!window.xGetOption("X_REGEXP_INTEGER").test(val) && !window.xGetOption("X_REGEXP_FLOAT").test(val) ) {
    oInput.alertX(oInput.getMessage("money"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : dollar (´Þ·¯È­)
 ===================================================================================================================
 *** @xclass       : xo_dollar
 *** @xattach      : xo_dollar_attach
 *** @xdetach      : xo_dollar_detach
 *** @xcss         : .
 *** @xevent       : onfocus - xo_dollar_onfocus
 *** @xevent       : onblur - xo_dollar_onblur
 *** @xoption      : Boolean - X_VALIDATE_ON_MASK (true:dollar keyword Àû¿ë½Ã dollar¿¡ ´ëÇÑ mask validationÀ» ¼öÇàÇÑ´Ù.)
 *** @xoption      : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_dollar_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ª¿¡ ´ëÇØ numberÇÊÅÍ¸¦ Àû¿ëÇÏ°í ´Þ·¯È­¿¡ ¸Â°Ô ¼Ò¼ýÁ¡ 2ÀÚ¸®¸¦ ¸ÂÃß°í, Á¤¼ö 3ÀÚ¸®¼ö¸¶´Ù ,¸¦ »ðÀÔÇÏ´Â mask¸¦ Àû¿ëÇÑ´Ù. X_VALIDATE_ON_MASK OptionÀÌ TrueÀÎ°æ¿ì ValidationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/


/*******************************************************************************************************************
 * @prototype    : xo_dollar.attach(oInput)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : dollar Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_FLOAT"));
  oInput.setMaskHandler(xo_dollar_get_masked_value, xo_dollar_get_unmasked_value);
  oInput.masking();
}

/*******************************************************************************************************************
 * @prototype    : xo_dollar.detach(oInput)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_FLOAT ("[0-9\\.\\-\\+]" : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : dollar Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_detach(oInput) {
  oInput.unmasking();
  oInput.setMaskHandler(null, null);
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_FLOAT")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_dollar.onblur(oInput, oEvent)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onblur°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ dollaring ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_onblur(oInput, oEvent)  { oInput.masking(); }

/*******************************************************************************************************************
 * @prototype    : xo_dollar.onfocus(oInput, oEvent)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onfocus
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onfocus°¡ ¹ß»ý½Ã ÀÔ·ÂÇÊµåÀÇ value¸¦ undollaring ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_onfocus(oInput, oEvent) { oInput.unmasking(); }

/*******************************************************************************************************************
 * @prototype    : xo_dollar.getMaskedValueHandler(oInput)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - dollar°¡ Àû¿ëµÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getMaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_get_masked_value(oInput) {
  if (!oInput.value) return oInput.value;

  var value = oInput.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");

  value = parseFloat(value, 10).toString();
  if (value == "NaN") return "0";

  var result = "";
  var mArray = value.split(".");
  var iPart = mArray[0];
  var fPart = mArray[1];
  var itill = iPart.length;

  for( var idx=0; idx < itill; idx++){
    if (idx != 0 && ( idx % 3 == itill % 3) && iPart.charAt(idx - 1) !="-") result += ",";
    if (idx < itill ) result += iPart.charAt(idx);
  }

  if ( !fPart ) result += ".00";
  else if (fPart.length == 1 ) result += "." + fPart +"0";
  else if (fPart.length == 2 ) result += "." + fPart;
  else if (fPart.length >  2 ) result += "." + fPart.substr(0, 2);

  return result;
}

/*******************************************************************************************************************
 * @prototype    : xo_dollar.getUnmaskedValueHandler(oInput)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : String - dollar mask°¡ ÇØÁ¦µÈ ¹®ÀÚ¿­
 * @event        : .
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInput.getUnmaskedValue()°¡ È£ÃâµÉ¶§ ½ÇÁ¦·Î È£ÃâµÇ´Â handler.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_get_unmasked_value(oInput) {
  if (!oInput.value) return oInput.value;
  return oInput.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");
}

/*******************************************************************************************************************
 * @prototype    : xo_dollar.validate(oInput)
 * @object       : xo_dollar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Boolean - X_VALIDATE_ON_MASK (true:dollar keyword Àû¿ë½Ã dollar¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.)
 * @option       : RegExp - X_DELIMITER_NUMBER (/([^0-9\.\-])/g : number delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : RegExp - X_REGEXP_INTEGER (/^(\+|\-|\d*)\d+$/ : integer¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : RegExp - X_REGEXP_FLOAT (/^(\-|\+|\d*)\d+(\.|\d)\d*$/ : float¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÁÖ¾îÁø dollar(½Ç¼öÇü ±Ý¾×)ÀÇ ÇüÅÂ¿Í ÀÏÄ¡ÇÏ´ÂÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_dollar_validate(oInput) {
  if ( !window.xGetOption("X_VALIDATE_ON_MASK")) { return true; }
  var flag = true;
  if (!oInput.value) return true;

  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_NUMBER"),"");

  if (!window.xGetOption("X_REGEXP_INTEGER").test(val) && !window.xGetOption("X_REGEXP_FLOAT").test(val) ) {
    oInput.alertX(oInput.getMessage("dollar"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : date (³¯Â¥)
 ===================================================================================================================
 *** @xclass       : xo_date
 *** @xattach      : xo_date_attach
 *** @xdetach      : xo_date_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : String - X_MASK_DATE ("9999/99/99" : date¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : Array  - X_DAYS_IN_MONTH  (°¢ ´ÞÀÇ °¡´ÉÇÑ ¸¶Áö¸· ³¯Â¥¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 *** @xvalidation  : xo_date_validate
 *** @dependency   : filter
 *** @dependency   : mask
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : !YYYYMMDD, YYMMDD, YYMM, MMDDµîÀÇ ÇüÅÂ¸¦ Áö¿ø ¹× ½Ã°£°ü·Ã ±â´ÉÁö¿ø.
 *** @desc         : ³¯ÀÚÀÔ·Â¿¡ ÇØ´çÇÏ´Â filter ¹× mask¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_date.attach(oInput)
 * @object       : xo_date
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @option       : String - X_MASK_DATE ("9999/99/99" : date¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : date Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_date_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
  if (!oInput.getAttribute("mask"))   oInput.attachX("mask",   window.xGetOption("X_MASK_DATE"));
}

/*******************************************************************************************************************
 * @prototype    : xo_date.detach(oInput)
 * @object       : xo_date
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @option       : String - X_MASK_DATE ("9999/99/99" : date¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : date Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_date_detach(oInput) {
  if (oInput.getAttribute("mask") == window.xGetOption("X_MASK_DATE")) oInput.detachX("mask");
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}


/*******************************************************************************************************************
 * @prototype    : xo_date.validate(oInput)
 * @object       : xo_date
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : Array  - X_DAYS_IN_MONTH  (°¢ ´ÞÀÇ °¡´ÉÇÑ ¸¶Áö¸· ³¯Â¥¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÀûÀýÇÑ date(³¯Â¥)ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_date_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var iYear, iMonth, iDay;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");

  if ( val.length != 8 ) flag = false;

  if (flag) {
    try {
      iYear = val.substr(0,4); iMonth = val.substr(4,2); iDay = val.substr(6,2);
      if ( iYear == null  || iMonth == null || iDay == null ||
           !iYear.isNum() || !iMonth.isNum() || !iDay.isNum() ||
           iMonth > 12 || iMonth < 1 || iDay < 1 ) flag = false ;
    } catch (e) { flag = false; }
  }

  if (flag) {
     var dArray = window.xGetOption("X_DAYS_IN_MONTH");
     var iDaysInMonth = (iMonth != 2) ? dArray[iMonth-1] : (( iYear%4 == 0 && iYear%100 != 0 || iYear % 400==0 ) ? 29 : 28 );
     if( iDay > iDaysInMonth ) flag = false ;
  }

  if(!flag) {
    oInput.alertX(oInput.getMessage("date"));
  }

  return flag;

}


/*******************************************************************************************************************
 *** @xkeyword     : credit_card (Å©·¹µðÆ® Ä«µå)
 ===================================================================================================================
 *** @xclass       : xo_credit_card
 *** @xattach      : xo_credit_card_attach
 *** @xdetach      : xo_credit_card_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_credit_card_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ½Å¿ëÄ«µå ¹øÈ£¿¡ ÇØ´çÇÏ´Â filter¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_credit_card.attach(oInput)
 * @object       : xo_credit_card
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : credit_card Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_credit_card_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
}

/*******************************************************************************************************************
 * @prototype    : xo_credit_card.detach(oInput)
 * @object       : xo_credit_card
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : credit_card Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_credit_card_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_credit_card.validate(oInput)
 * @object       : xo_credit_card
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·Â°ªÀÌ ÀÏ¹ÝÀûÀÎ credit card ¹øÈ£¿¡ ºÎÇÕÇÏ´ÂÁö Ã¼Å©ÇÑ´Ù. 19ÀÚ¸® ÀÌÇÏÀÇ Å©·¹µðÆ® Ä«µå ¹øÈ£¸¦ luhn mod - 10 test¸¦ ÀÌ¿ëÇÏ¿© Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_credit_card_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var sum = 0;
  var mul = 1;
  var tproduct;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");
  var len = val.length;
  if (len > 19) flag = false;

  for (var idx = 0; flag && idx < len; idx++) {
    tproduct = parseInt(val.substring(len-idx-1,len-idx) ,10) * mul;
    sum += (tproduct >= 10) ? (tproduct % 10) + 1 : tproduct;
    mul = (mul == 1) ? mul + 1 : mul - 1;
  }

  if ( flag && (sum % 10) != 0) flag = false;

  if (!flag)  {
    oInput.alertX(oInput.getMessage("credit_card"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : email (ÀÌ¸ÞÀÏ)
 ===================================================================================================================
 *** @xclass       : xo_email
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_email_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : !email¿¡ °ü·ÃµÈ filter°¡ ÇÊ¿äÇÒ±î? [\w|\.|\-|\@] as [A-Za-z0-9_-@\.]
 *** @desc         : email adress¿¡ ´ëÇÑ ÀÏ¹ÝÀûÀÎ validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_email.validate(oInput)
 * @object       : xo_email
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·Â°ªÀÌ ÀÏ¹ÝÀûÀÎ  e-mail addressÀÎÁö Ã¼Å©ÇÑ´Ù. core script from http://tech.irt.org/articles/js049/index.htm
 * @attention    : .
 ******************************************************************************************************************/
function xo_email_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var re = /^\w+((-|\.)\w+)*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,4}$/;

  if (!re.test(this.parent.value)) {
    oInput.alertX(oInput.getMessage("email"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : domain (µµ¸ÞÀÎ)
 ===================================================================================================================
 *** @xclass       : xo_domain
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_domain_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : domain¿¡ ´ëÇÑ validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_domain.validate(oInput)
 * @object       : xo_domain
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·Â°ªÀÌ domain ÀÌ¸§ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_domain_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var re = /^[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,4}$/;

  if (!re.test(this.parent.value)) {
    oInput.alertX(oInput.getMessage("domain"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : psn (ÁÖ¹Îµî·Ï¹øÈ£)
 ===================================================================================================================
 *** @xclass       : xo_psn
 *** @xattach      : xo_psn_attach
 *** @xdetach      : xo_psn_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : String - X_MASK_PSN ("999999-9999999" : psn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_psn_validate
 *** @dependency   : filter
 *** @dependency   : mask
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÁÖ¹Îµî·Ï ¹øÈ£ÀÔ·Â¿¡ ÇØ´çÇÏ´Â filter ¹× mask¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_psn.attach(oInput)
 * @object       : xo_psn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_PSN ("999999-9999999" : psn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : psn Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_psn_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
  if (!oInput.getAttribute("mask"))   oInput.attachX("mask",   window.xGetOption("X_MASK_PSN"));
}

/*******************************************************************************************************************
 * @prototype    : xo_psn.detach(oInput)
 * @object       : xo_psn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_PSN ("999999-9999999" : psn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : psn Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_psn_detach(oInput) {
  if (oInput.getAttribute("mask") == window.xGetOption("X_MASK_PSN")) oInput.detachX("mask");
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_psn.validate(oInput)
 * @object       : xo_psn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÀûÀýÇÑ psn(ÁÖ¹Îµî·Ï ¹øÈ£)ÀÎÁö Ã¼Å©ÇÑ´Ù. Âü°í) µÞÀÚ¸®°¡ 3,4·Î ½ÃÀÛÇÏ¸é, 2000³â ÀÌÈÄ Ãâ»ýÀÚ, 7,8·Î ½ÃÀÛÇÏ¸é ±ÍÈ­ÀÚ.
 * @attention    : .
 ******************************************************************************************************************/
function xo_psn_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var sum = 0;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");

  for (idx = 0, jdx = 2; jdx < 10; idx++, jdx++) sum += val.charAt(idx) * jdx ;
  for (idx = 8, jdx = 2; jdx <  6; idx++, jdx++) sum += val.charAt(idx) * jdx ;

  var nam = sum % 11;
  var cDigit = 11 - nam ;
  cDigit = (cDigit >= 10 ) ? cDigit - 10 : cDigit;
  if ( !val.toString().isNum() || val.charAt(12) != cDigit)  {
    oInput.alertX(oInput.getMessage("psn"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : csn (»ç¾÷ÀÚµî·Ï¹øÈ£)
 ===================================================================================================================
 *** @xclass       : xo_csn
 *** @xattach      : xo_csn_attach
 *** @xdetach      : xo_csn_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : String - X_MASK_CSN ("999-99-99999" : csn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : Array  - X_CSN_MULTIPLIERS (CSN Check Seed¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 *** @xvalidation  : xo_csn_validate
 *** @dependency   : filter
 *** @dependency   : mask
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : »ç¾÷ÀÚµî·Ï¹øÈ£¿¡ ÇØ´çÇÏ´Â filter ¹× mask¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_csn.attach(oInput)
 * @object       : xo_csn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_CSN ("999-99-99999" : csn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : csn Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_csn_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
  if (!oInput.getAttribute("mask"))   oInput.attachX("mask",   window.xGetOption("X_MASK_CSN"));
}

/*******************************************************************************************************************
 * @prototype    : xo_csn.detach(oInput)
 * @object       : xo_csn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_CSN ("999-99-99999" : csn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : csn Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_csn_detach(oInput) {
  if (oInput.getAttribute("mask") == window.xGetOption("X_MASK_CSN")) oInput.detachX("mask");
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_csn.validate(oInput)
 * @object       : xo_csn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : Array  - X_CSN_MULTIPLIERS (CSN Check Seed¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÀûÀýÇÑ csn(»ç¾÷ÀÚ µî·Ï¹øÈ£)ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_csn_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var sum = 0;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");
  var mArray = window.xGetOption("X_CSN_MULTIPLIERS");

  for(idx=0 ; idx < 9 ; idx++) sum += val.charAt(idx) * mArray[idx];

  sum = sum + ((val.charAt(8) * 5 ) / 10);
  var nam = Math.floor(sum) % 10;
  var cDigit = ( nam == 0 ) ? 0 : 10 - nam;
  if ( !val.toString().isNum() || val.charAt(9) != cDigit) {
    oInput.alertX(oInput.getMessage("csn"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : lsn (¹ýÀÎ¹øÈ£)
 ===================================================================================================================
 *** @xclass       : xo_lsn
 *** @xattach      : xo_lsn_attach
 *** @xdetach      : xo_lsn_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : String - X_MASK_PSN ("999999-9999999" : lsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : xo_lsn_validate
 *** @dependency   : filter
 *** @dependency   : mask
 *** @author       : ????() - hyonhi@yahoo.co.kr
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : »ç¾÷ÀÚµî·Ï¹øÈ£¿¡ ÇØ´çÇÏ´Â filter ¹× mask¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_lsn.attach(oInput)
 * @object       : xo_lsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @option       : String - X_MASK_PSN ("999999-9999999" : lsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : lsn Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_lsn_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
  if (!oInput.getAttribute("mask"))   oInput.attachX("mask",   window.xGetOption("X_MASK_PSN"));
}

/*******************************************************************************************************************
 * @prototype    : xo_lsn.detach(oInput)
 * @object       : xo_lsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_PSN ("999999-9999999" : lsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : lsn Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_lsn_detach(oInput) {
  if (oInput.getAttribute("mask") == window.xGetOption("X_MASK_PSN")) oInput.detachX("mask");
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_lsn.validate(oInput)
 * @object       : xo_lsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ????() - hyonhi@yahoo.co.kr
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : !//114971-0005056 110111-0797005
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÀûÀýÇÑ lsn(»ç¾÷ÀÚ µî·Ï¹øÈ£)ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_lsn_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var sum = 0;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");
  for (idx = 0; idx < 12; idx++) sum += val.charAt(idx) * (idx % 2 + 1);

  var nam = sum % 10;
  var cDigit = 10 - nam ;
  cDigit = (cDigit >= 10 ) ? cDigit-10:cDigit;
  if ( !val.toString().isNum() || val.charAt(12) != cDigit) {
    oInput.alertX(oInput.getMessage("lsn"));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : fsn (Àç¿Ü±¹ÀÎ µî·Ï¹øÈ£)
 ===================================================================================================================
 *** @xclass       : xo_fsn
 *** @xattach      : xo_fsn_attach
 *** @xdetach      : xo_fsn_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : String - X_MASK_PSN ("999999-9999999" : fsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 *** @xoption      : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xoption      : Array  - X_FSN_MULTIPLIERS (FSN Check Seed¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 *** @xvalidation  : xo_fsn_validate
 *** @dependency   : filter
 *** @dependency   : mask
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Àç¿Ü±¹ÀÎ µî·Ï¹øÈ£¿¡ ÇØ´çÇÏ´Â filter ¹× mask¸¦ Àû¿ëÇÏ°í, validationÀ» ¼öÇàÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_fsn.attach(oInput)
 * @object       : xo_fsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @option       : String - X_MASK_PSN ("999999-9999999" : fsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : fsn Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_fsn_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
  if (!oInput.getAttribute("mask"))   oInput.attachX("mask",   window.xGetOption("X_MASK_PSN"));
}

/*******************************************************************************************************************
 * @prototype    : xo_fsn.detach(oInput)
 * @object       : xo_fsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @xoption      : String - X_MASK_PSN ("999999-9999999" : fsn¿¡ »ç¿ëÇÒ mask ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : fsn Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_fsn_detach(oInput) {
  if (oInput.getAttribute("mask") == window.xGetOption("X_MASK_PSN")) oInput.detachX("mask");
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_fsn.validate(oInput)
 * @object       : xo_fsn
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : RegExp - X_DELIMITER_CHAR (delimiter¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @option       : Array  - X_FSN_MULTIPLIERS (FSN Check Seed¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         :
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÀûÀýÇÑ fsn(Àç¿Ü±¹ÀÎ µî·Ï¹øÈ£)ÀÎÁö Ã¼Å©ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_fsn_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  var sum = 0;
  var val = oInput.value.replace(window.xGetOption("X_DELIMITER_CHAR"),"");
  var vArray = val.match(/[0-9]/g);
  var odd = vArray[7]*10 + vArray[8];
  if (odd % 2 != 0) flag = false;
  if ( flag && vArray[11] < 6 || vArray[11] > 9 ) flag = false;

  if (flag) {
    var mArray = window.xGetOption("X_FSN_MULTIPLIERS");
    for (var idx=0 ; idx < 12 ; idx++) sum += (vArray[idx] *= mArray[idx]);
    sum = 11 - (sum % 11);
    sum = (sum >= 10) ? sum - 10 : sum;
    sum += 2;
    sum = (sum >= 10) ? sum - 10 : sum;
    if (sum != vArray[12]) flag = false;
  }

  if (!flag) {
    oInput.alertX(oInput.getMessage("fsn"));
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : plain_box (Æò¸éÈ­)
 ===================================================================================================================
 *** @xclass       : xo_plain_box
 *** @xattach      : xo_plain_box_attach
 *** @xdetach      : xo_plain_box_detach
 *** @xcss         : xjs_flat_box
 *** @xcss         : xjs_flat_button
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ºê¶ó¿ìÁ®ÀÇ default ÀÔ·ÂÇÊµå ¸ð¾çÀÎ 3D styleÀ» flat style·Î º¯°æÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_plain_box.attach(oInput)
 * @object       : xo_plain_box
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : plain_box Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_plain_box_attach(oInput) {
  var css = "";
  switch(oInput.type)    {
      case "text" : case "password" :
      case "file" : case "textarea" :
        css = "xjs_flat_box";
      break;
      case "button" : case "reset" : case "submit" :
        css = "xjs_flat_button";
      break;
  }
  oInput.setCss(css);
}

/*******************************************************************************************************************
 * @prototype    : xo_plain_box.detach(oInput)
 * @object       : xo_plain_box
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : plain_box Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_plain_box_detach(oInput) {
  var css = "";
  switch(this.parent.type)    {
      case "text" : case "password" :
      case "file" : case "textarea" :
        css = "xjs_flat_box";
      break;

      case "button" : case "reset" : case "submit" :
        css = "xjs_flat_button";
      break;
  }
  oInput.unsetCss(css);
}


/*******************************************************************************************************************
 *** @xkeyword     : edit_align (Á¤·Ä¹æ½Ä)
 ===================================================================================================================
 *** @xclass       : xo_edit_align
 *** @xattach      : xo_edit_align_attach
 *** @xdetach      : xo_edit_align_detach
 *** @xcss         : xjs_right
 *** @xcss         : xjs_center
 *** @xcss         : xjs_left
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â ÇÊµåÀÇ ÀÔ·Â alignÀÇ Á¤·Ä ¹æ½ÄÀ» Á¤ÀÇÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_edit_align.attach(oInput)
 * @object       : xo_edit_align
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : edit_align Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_edit_align_attach(oInput) {
  var css = "xjs_left";
  var type = oInput.getAttribute("edit_align").toLowerCase();
  switch(type) {
      case "right"  : css = "xjs_right";  break;
      case "center" : css = "xjs_center"; break;
      case "left"   : css = "xjs_left";   break;
  }
  oInput.setCss(css);
}

/*******************************************************************************************************************
 * @prototype    : xo_edit_align.detach(oInput)
 * @object       : xo_edit_align
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : edit_align Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_edit_align_detach(oInput) {
  var css = "xjs_left";
  var type = oInput.getAttribute("edit_align").toLowerCase();
  switch(type) {
      case "right"  : css = "xjs_right";  break;
      case "center" : css = "xjs_center"; break;
      case "left"   : css = "xjs_left";   break;
  }
  oInput.unsetCss(css);
}


/*******************************************************************************************************************
 *** @xkeyword     : ime (ÀÔ·Â±â-ÇÑ¿µÀüÈ¯)
 ===================================================================================================================
 *** @xclass       : xo_ime
 *** @xattach      : xo_ime_attach
 *** @xdetach      : xo_ime_detach
 *** @xcss         : xjs_imeKor
 *** @xcss         : xjs_imeEng
 *** @xcss         : xjs_imeDis
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµåÀÇ ±âº» IME(input method editor)¸¦ Á¤ÀÇÇÑ´Ù. (ÇÑ¿µÀüÈ¯)
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_ime.attach(oInput)
 * @object       : xo_ime
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ime Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_ime_attach(oInput) {
  var css = "xjs_imeEng";
  var type = oInput.getAttribute("ime").toLowerCase();
  switch(type) {
      case "kor"     : css = "xjs_imeKor"; break;
      case "eng"     : css = "xjs_imeEng"; break;
      case "engonly" : css = "xjs_imeDis"; break;
  }
  oInput.setCss(css);
}

/*******************************************************************************************************************
 * @prototype    : xo_ime.detach(oInput)
 * @object       : xo_ime
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ime Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_ime_detach(oInput) {
  var css = "xjs_imeEng";
  var type = oInput.getAttribute("ime").toLowerCase();
  switch(type) {
      case "kor"     : css = "xjs_imeKor"; break;
      case "eng"     : css = "xjs_imeEng"; break;
      case "engonly" : css = "xjs_imeDis"; break;
  }
  oInput.unsetCss(css);
}


/*******************************************************************************************************************
 *** @xkeyword     : lable (·¹ÀÌºí)
 ===================================================================================================================
 *** @xclass       : xo_lable
 *** @xattach      : xo_lable_attach
 *** @xdetach      : xo_lable_detach
 *** @xcss         : xjs_lable
 *** @xevent       : onfocus - xo_lable_onfocus
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµåÀÇ ¸ð¾çÀ» lable·Î ¹Ù²Ù°í, ¼öÁ¤ÇÏÁö ¸øÇÏµµ·Ï ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_lable.attach(oInput)
 * @object       : xo_lable
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : lable Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_lable_attach(oInput) {
  window.xo_lable_onfocus = oInput.preventFocusHandler;
  oInput.setCss("xjs_lable");
}

/*******************************************************************************************************************
 * @prototype    : xo_lable.detach(oInput)
 * @object       : xo_lable
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : lable Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_lable_detach(oInput) {
  oInput.unsetCss("xjs_lable");
  window.xo_lable_onfocus = null;
}


/*******************************************************************************************************************
 *** @xkeyword     : auto_focus (ÀÚµ¿ÀÌµ¿)
 ===================================================================================================================
 *** @xclass       : xo_auto_focus
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onkeyup - xo_auto_focus_onkeyup
 *** @xoption      : Array  - X_AUTO_FOCUS_FKEY (Æ¯¼öÅ°¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå¿¡ ÀÔ·Â°ªÀÌ maxlength¿¡ µµ´ÞÇßÀ»¶§ ÀÚµ¿À¸·Î ´ÙÀ½ÀÔ·ÂÇÊµå·Î focus¸¦ ÀÌµ¿½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_auto_focus.onkeyup(oInput, oEvent)
 * @object       : xo_auto_focus
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onkeyup
 * @option       : Array  - X_AUTO_FOCUS_FKEY (Æ¯¼öÅ°¸¦ Á¤ÀÇÇÏ´Â Array °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : auto focus°¡ Àû¿ëµÈ element¿¡ ´ëÇØ maxlength¿¡ µµ´Þ½Ã ÀÚµ¿À¸·Î ´ÙÀ½ element·Î Æ÷Ä¿½º¸¦ ÀÌµ¿ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_auto_focus_onkeyup(oInput, oEvent) {
  var kArray = window.xGetOption("X_AUTO_FOCUS_FKEY");
  if ( kArray.contain(oEvent.keyCode)) return;
  if ( oInput.value.length >= oInput.getAttribute("maxlength") ) try { oInput.getNextFocus().focus(); } catch (e) {}
}


/*******************************************************************************************************************
 *** @xkeyword     : enter_move_focus (¿£ÅÍ·Î Æ÷Ä¿½º ÀÌµ¿)
 ===================================================================================================================
 *** @xclass       : xo_enter_move_focus
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onkeypress - xo_enter_move_focus_onkeypress
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : enterÅ°¸¦ ´­·¶À»¶§ ´ÙÀ½ element·Î focus¸¦ ¿Å±ä´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_enter_move_focus.onkeypress(oInput, oEvent)
 * @object       : xo_enter_move_focus
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onkeypress
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : enter_move_focus°¡  Àû¿ëµÈ element¿¡ ´ëÇØ  enter°¡ ´­·ÈÀ»¶§, ´ÙÀ½ element¿¡ focus ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_enter_move_focus_onkeydown(oInput, oEvent) {
  if ( oEvent.keyCode == 13 ) try {
     //oInput.getNextFocus().focus(); oEvent.returnValue = false;
     oEvent.keyCode = 9;
     } catch (e) {}
}


/*******************************************************************************************************************
 *** @xkeyword     : focus_this (ÃÖÃÊ Æ÷Ä¿½Ì)
 ===================================================================================================================
 *** @xclass       : xo_focus_this
 *** @xattach      : xo_focus_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : È­¸éÀÌ ·ÎµùµÉ¶§ ÃÖÃÊ focus¸¦ °¡Áú ÀÔ·ÂÇÊµå¸¦ °áÁ¤ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : focus_this.attach(oInput)
 * @object       : focus_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : focus_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_focus_this_attach(oInput) {
  if (!oInput.form.name || window.xGetOption("X_FOCUS_THIS_USE_TIMEOUT") < 0) oInput.focus();
  else window.setTimeout("document.all["+oInput.sourceIndex+"].focus()", window.xGetOption("X_FOCUS_THIS_USE_TIMEOUT"));
}


/*******************************************************************************************************************
 *** @xkeyword     : show_this (ÃÖÃÊ º¸ÀÌ±â)
 ===================================================================================================================
 *** @xclass       : xo_show_this
 *** @xattach      : xo_show_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå¸¦ Ã³À½ Ç¥½ÃµÉ¶§ º¸ÀÌ°Ô ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_show_this.attach(oInput)
 * @object       : xo_show_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : show_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_show_this_attach(oInput) { oInput.show(); }


/*******************************************************************************************************************
 *** @xkeyword     : hide_this (ÃÖÃÊ °¨Ãß±â)
 ===================================================================================================================
 *** @xclass       : xo_hide_this
 *** @xattach      : xo_hide_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå¸¦ Ã³À½ Ç¥½ÃµÉ¶§ º¸ÀÌÁö ¾Ê°Ô ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : hide_this.attach(oInput)
 * @object       : hide_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hide_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hide_this_attach(oInput) { oInput.hide(); }


/*******************************************************************************************************************
 *** @xkeyword     : disable_this (ÃÖÃÊ ºñÈ°¼ºÈ­)
 ===================================================================================================================
 *** @xclass       : xo_disable_this
 *** @xattach      : xo_disable_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå¸¦ Ã³À½ Ç¥½ÃµÉ¶§ disable ½ÃÅ³ ¶§ »ç¿ëÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : disable_this.attach(oInput)
 * @object       : disable_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : disable_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_disable_this_attach(oInput) { oInput.disable(); }


/*******************************************************************************************************************
 *** @xkeyword     : readonly_this (ÃÖÃÊ ÀÐ±âÀü¿ëÈ­)
 ===================================================================================================================
 *** @xclass       : xo_readonly_this
 *** @xattach      : xo_readonly_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå¸¦ Ã³À½ Ç¥½ÃµÉ¶§ readOnly ½ÃÅ³ ¶§ »ç¿ëÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : readonly_this.attach(oInput)
 * @object       : readonly_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : readonly_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_readonly_this_attach(oInput) { oInput.setReadOnly(); }


/*******************************************************************************************************************
 *** @xkeyword     : selected_duih (select element¸¦ ÀÌ¿ëÇÑ Dynamic UI Handler)
 ===================================================================================================================
 *** @xclass       : xo_selected_duih
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onchange - xo_selected_duih_onchange
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : select boxÀÇ Option°ª¿¡ µû¶ó DynamicÇÑ È­¸é È¿°ú¸¦ ÁöÁ¤ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_selected_duih.onchange(oInput, oEvent)
 * @object       : xo_selected_duih
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onchange
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : selectµÈ option¿¡ ÁÖ¾îÁø internal keyword¿¡ µû¶ó Dynamic UI Handler ÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_selected_duih_onchange(oInput, oEvent) {
  var iArray = oInput.get();
  var itill =iArray.length;
  var oCraft = null;
  for (var idx=0; idx <itill; idx++) {
    if (iArray[idx] == -1 ) continue;
    if (oCraft.getAttribute(selected_show)          ) oInput.show(oCraft.getAttribute(selected_show));
    if (oCraft.getAttribute(selected_hide)          ) oInput.hide(oCraft.getAttribute(selected_hide));
    if (oCraft.getAttribute(selected_enable)        ) oInput.enable(oCraft.getAttribute(selected_enable)) ;
    if (oCraft.getAttribute(selected_disable)       ) oInput.disable(oCraft.getAttribute(selected_disable));
    if (oCraft.getAttribute(selected_set_readonly)  ) oInput.setReadOnly(oCraft.getAttribute(selected_set_readonly));
    if (oCraft.getAttribute(selected_unset_readonly)) oInput.unsetReadOnly(oCraft.getAttribute(selected_unset_readonly));
  }
}


/*******************************************************************************************************************
 *** @xkeyword     : show_fields (Dynamic ÇÊµå º¸ÀÌ±â)
 ===================================================================================================================
 *** @xclass       : xo_show_fields
 *** @xattach      : xo_show_fields_attach
 *** @xdetach      : xo_show_fields_detach
 *** @xcss         : .
 *** @xevent       : onblur   - xo_show_fields_onblur
 *** @xevent       : onchange - xo_show_fields_onchange
 *** @xevent       : onclick  - xo_show_fields_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : show_values
 *** @todo         : .
 *** @desc         : ÁöÁ¤µÈ ÀÔ·ÂÇÊµåµéÀ» show_valuesÀÇ Á¶°Ç¿¡ ¸Â´Â °æ¿ì show½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_show_fields.attach(oInput)
 * @object       : xo_show_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : show_fields Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_show_fields_attach(oInput) {
  switch (oInput.type) {
    case "text" :  case "password" :  case "textarea" :  case "file" :
      xo_show_fields_onblur = xo_show_fields_duiHandler   ; break;
    case "select-one" : case "select-multiple" :
      xo_show_fields_onchange = xo_show_fields_duiHandler ; break;
    case "radio" :  case "checkbox" :
      xo_show_fields_onclick = xo_show_fields_duiHandler  ; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_show_fields.detach(oInput)
 * @object       : xo_show_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : show_fields Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_show_fields_detach(oInput) {
  xo_show_fields_onblur   = null ;
  xo_show_fields_onchange = null ;
  xo_show_fields_onclick  = null ;
}

/*******************************************************************************************************************
 * @prototype    : xo_show_fields.onblur/onchange/onclick(oInput, oEvent)
 * @object       : xo_show_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onchange
 * @event        : oInput.onblur
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInputÀÇ value°¡ show_values °ª°ú matchµÇ¸é show_fields¿¡ Á¤ÀÇµÈ element¸¦ show½ÃÅ°°í ±×·¸Áö ¾Ê´Ù¸é hide½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_show_fields_duiHandler(oInput, oEvent) {
  var names = oInput.getAttribute("show_fields");
  var condition = oInput.getAttribute("show_values");
  var flag = condition ? oInput.contain(condition.split(",")) : oInput.contain();
  flag ? oInput.form.show(names) : oInput.form.hide(names);
}


/*******************************************************************************************************************
 *** @xkeyword     : hide_fields (Dynamic ÇÊµå °¨Ãß±â)
 ===================================================================================================================
 *** @xclass       : xo_hide_fields
 *** @xattach      : xo_hide_fields_attach
 *** @xdetach      : xo_hide_fields_detach
 *** @xcss         : .
 *** @xevent       : onblur   - xo_hide_fields_onblur
 *** @xevent       : onchange - xo_hide_fields_onchange
 *** @xevent       : onclick  - xo_hide_fields_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : hide_values
 *** @todo         : .
 *** @desc         : ÁöÁ¤µÈ ÀÔ·ÂÇÊµåµéÀ» hide_valuesÀÇ Á¶°Ç¿¡ ¸Â´Â °æ¿ì hide½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_hide_fields.attach(oInput)
 * @object       : xo_hide_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hide_fields Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hide_fields_attach(oInput) {
  switch (oInput.type) {
    case "text" :  case "password" :  case "textarea" :  case "file" :
      xo_hide_fields_onblur = xo_hide_fields_duiHandler   ; break;
    case "select-one" : case "select-multiple" :
      xo_hide_fields_onchange = xo_hide_fields_duiHandler ; break;
    case "radio" :  case "checkbox" :
      xo_hide_fields_onclick = xo_hide_fields_duiHandler  ; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_hide_fields.detach(oInput)
 * @object       : xo_hide_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hide_fields Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hide_fields_detach(oInput) {
  xo_hide_fields_onblur   = null ;
  xo_hide_fields_onchange = null ;
  xo_hide_fields_onclick  = null ;
}

/*******************************************************************************************************************
 * @prototype    : xo_hide_fields.onblur/onchange/onclick(oInput, oEvent)
 * @object       : xo_hide_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onchange
 * @event        : oInput.onblur
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInputÀÇ value°¡ show_values °ª°ú matchµÇ¸é hide_fields¿¡ Á¤ÀÇµÈ element¸¦ hide½ÃÅ°°í ±×·¸Áö ¾Ê´Ù¸é show½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hide_fields_duiHandler(oInput, oEvent) {
  var names = oInput.getAttribute("hide_fields");
  var condition = oInput.getAttribute("hide_values");
  var flag = condition ? oInput.contain(condition.split(",")) : oInput.contain();
  flag ? oInput.form.hide(names) : oInput.form.show(names);
}


/*******************************************************************************************************************
 *** @xkeyword     : enable_fields (Dynamic ÇÊµå È°¼ºÈ­)
 ===================================================================================================================
 *** @xclass       : xo_enable_fields
 *** @xattach      : xo_enable_fields_attach
 *** @xdetach      : xo_enable_fields_detach
 *** @xcss         : .
 *** @xevent       : onblur   - xo_enable_fields_onblur
 *** @xevent       : onchange - xo_enable_fields_onchange
 *** @xevent       : onclick  - xo_enable_fields_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : enable_values
 *** @todo         : .
 *** @desc         : ÁöÁ¤µÈ ÀÔ·ÂÇÊµåµéÀ» enable_valuesÀÇ Á¶°Ç¿¡ ¸Â´Â °æ¿ì enable½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_enable_fields.attach(oInput)
 * @object       : xo_enable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : enable_fields Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_enable_fields_attach(oInput) {
  switch (oInput.type) {
    case "text" :  case "password" :  case "textarea" :  case "file" :
      xo_enable_fields_onblur = xo_enable_fields_duiHandler   ; break;
    case "select-one" : case "select-multiple" :
      xo_enable_fields_onchange = xo_enable_fields_duiHandler ; break;
    case "radio" :  case "checkbox" :
      xo_enable_fields_onclick = xo_enable_fields_duiHandler  ; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_enable_fields.detach(oInput)
 * @object       : xo_enable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : enable_fields Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_enable_fields_detach(oInput) {
  xo_enable_fields_onblur   = null ;
  xo_enable_fields_onchange = null ;
  xo_enable_fields_onclick  = null ;
}

/*******************************************************************************************************************
 * @prototype    : xo_enable_fields.onblur/onchange/onclick(oInput, oEvent)
 * @object       : xo_enable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onchange
 * @event        : oInput.onblur
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInputÀÇ value°¡ enable_values °ª°ú matchµÇ¸é enable_fields¿¡ Á¤ÀÇµÈ element¸¦ enable½ÃÅ°°í ±×·¸Áö ¾Ê´Ù¸é disable½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_enable_fields_duiHandler(oInput, oEvent) {
  var names = oInput.getAttribute("enable_fields");
  var condition = oInput.getAttribute("enable_values");
  var flag = condition ? oInput.contain(condition.split(",")) : oInput.contain();
  flag ? oInput.form.enable(names) : oInput.form.disable(names);
}


/*******************************************************************************************************************
 *** @xkeyword     : disable_fields (Dynamic ÇÊµå ºñÈ°¼ºÈ­)
 ===================================================================================================================
 *** @xclass       : xo_disable_fields
 *** @xattach      : xo_disable_fields_attach
 *** @xdetach      : xo_disable_fields_detach
 *** @xcss         : .
 *** @xevent       : onblur   - xo_disable_fields_onblur
 *** @xevent       : onchange - xo_disable_fields_onchange
 *** @xevent       : onclick  - xo_disable_fields_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : disable_values
 *** @todo         : .
 *** @desc         : ÁöÁ¤µÈ ÀÔ·ÂÇÊµåµéÀ» disable_valuesÀÇ Á¶°Ç¿¡ ¸Â´Â °æ¿ì disable½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_disable_fields.attach(oInput)
 * @object       : xo_disable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : disable_fields Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_disable_fields_attach(oInput) {
  switch (oInput.type) {
    case "text" :  case "password" :  case "textarea" :  case "file" :
      xo_disable_fields_onblur = xo_disable_fields_duiHandler   ; break;
    case "select-one" : case "select-multiple" :
      xo_disable_fields_onchange = xo_disable_fields_duiHandler ; break;
    case "radio" :  case "checkbox" :
      xo_disable_fields_onclick = xo_disable_fields_duiHandler  ; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_disable_fields.detach(oInput)
 * @object       : xo_disable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : disable_fields Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_disable_fields_detach(oInput) {
  xo_disable_fields_onblur   = null ;
  xo_disable_fields_onchange = null ;
  xo_disable_fields_onclick  = null ;
}

/*******************************************************************************************************************
 * @prototype    : xo_disable_fields.onblur/onchange/onclick(oInput, oEvent)
 * @object       : xo_disable_fields
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onchange
 * @event        : oInput.onblur
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oInputÀÇ value°¡ disable_values °ª°ú matchµÇ¸é disable_fields¿¡ Á¤ÀÇµÈ element¸¦ disable½ÃÅ°°í ±×·¸Áö ¾Ê´Ù¸é enable½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_disable_fields_duiHandler(oInput, oEvent) {
  var names = oInput.getAttribute("disable_fields");
  var condition = oInput.getAttribute("disable_values");
  var flag = condition ? oInput.contain(condition.split(",")) : oInput.contain();
  flag ? oInput.form.disable(names) : oInput.form.enable(names);
}


/*******************************************************************************************************************
 *** @xkeyword     : trim_this (ÁÂ¿ì °ø¹é¹®ÀÚ Á¦°Å)
 ===================================================================================================================
 *** @xclass       : xo_trim_this
 *** @xattach      : xo_trim_this_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onblur - xo_trim_this_onblur
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ ÀÔ·ÂÇÊµåÀÇ ¾çÂÊ¿¡ ÀÖ´Â whitespace¸¦ Á¦°ÅÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_trim_this.attach(oInput)
 * @object       : xo_trim_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : trim_this Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_trim_this_attach(oInput) {
  if (!oInput.value) return;
  switch (parent.getAttribute("trim")) {
    case "left"  : oInput.value = this.parent.value.lTrim(); break;
    case "right" : oInput.value = this.parent.value.rTrim(); break;
    default      : oInput.value = this.parent.value.trim() ; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_trim_this.onblur(oInput, oEvent)
 * @object       : xo_trim_this
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : trimÀÌ Àû¿ëµÈ element¿¡ ´ëÇØ onblur½Ã¿¡ trimÀ» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_trim_this_onblur(oInput, oEvent) {
  if (!oInput.value) return;
  switch (parent.getAttribute("trim")) {
    case "left"  : oInput.value = this.parent.value.lTrim(); break;
    case "right" : oInput.value = this.parent.value.rTrim(); break;
    default      : oInput.value = this.parent.value.trim() ; break;
  }
}


/*******************************************************************************************************************
 *** @xkeyword     : strip_white_space (¸ðµç °ø¹é¹®ÀÚ Á¦°Å)
 ===================================================================================================================
 *** @xclass       : xo_strip_white_space
 *** @xattach      : xo_strip_white_space_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onblur - xo_strip_white_space_onblur
 *** @xoption      : RegExp - X_STRIP_WHITE_SPACE_CHAR (°ø¹é¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         :  »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ ÀÔ·ÂÇÊµå¿¡ Á¸ÀçÇÏ´Â ¸ðµç °ø¹é¹®ÀÚ¸¦ Á¦°ÅÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_strip_white_space.attach(oInput)
 * @object       : xo_strip_white_space
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : RegExp - X_STRIP_WHITE_SPACE_CHAR (°ø¹é¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : strip_white_space Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_strip_white_space_attach(oInput) {
  if (!oInput.value) return;
  oInput.value = oInput.value.replace(window.xGetOption("X_STRIP_WHITE_SPACE_CHAR"), "");
}

/*******************************************************************************************************************
 * @prototype    : xo_strip_white_space.onblur(oInput, oEvent)
 * @object       : xo_strip_white_space
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : RegExp - X_STRIP_WHITE_SPACE_CHAR (°ø¹é¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : strip_white_space°¡ Àû¿ëµÈ element¿¡ ´ëÇØ onblur½Ã¿¡ °ø¹é¹®ÀÚµéÀ» »èÁ¦ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_strip_white_space_onblur(oInput, oEvent) {
  if (!oInput.value) return;
  oInput.value = oInput.value.replace(window.xGetOption("X_STRIP_WHITE_SPACE_CHAR"), "");
}


/*******************************************************************************************************************
 *** @xkeyword     : strip_special_char (¸ðµç Æ¯¼ö¹®ÀÚ Á¦°Å)
 ===================================================================================================================
 *** @xclass       : xo_strip_special_char
 *** @xattach      : xo_strip_special_char_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onblur - xo_strip_special_char_onblur
 *** @xoption      : RegExp - X_STRIP_SPECIAL_CHAR (Æ¯¼ö¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ ÀÔ·ÂÇÊµå¿¡ Á¸ÀçÇÏ´Â ¸ðµç Æ¯¼ö¹®ÀÚ¸¦ Á¦°ÅÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_strip_special_char.attach(oInput)
 * @object       : xo_strip_special_char
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : RegExp - X_STRIP_SPECIAL_CHAR (Æ¯¼ö¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : strip_special_char Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_strip_special_char_attach(oInput) {
  if (!oInput.value) return;
  oInput.value = oInput.value.replace(window.xGetOption("X_STRIP_SPECIAL_CHAR"), "");
}

/*******************************************************************************************************************
 * @prototype    : xo_strip_special_char.onblur(oInput, oEvent)
 * @object       : xo_strip_special_char
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @option       : RegExp - X_STRIP_SPECIAL_CHAR (Æ¯¼ö¹®ÀÚ¸¦ Ç¥ÇöÇÏ´Â Á¤±Ô½Ä °´Ã¼)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : strip_special_char°¡ Àû¿ëµÈ element¿¡ ´ëÇØ onblur½Ã¿¡ ¸ðµç Æ¯¼ö¹®ÀÚ¸¦ Á¦°ÅÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_strip_special_char_onblur(oInput, oEvent) {
  if (!oInput.value) return;
  oInput.value = oInput.value.replace(window.xGetOption("X_STRIP_SPECIAL_CHAR"), "");
}


/*******************************************************************************************************************
 *** @xkeyword     : hpd (ÈÞ´ëÆù/PCS ÀüÈ­¹øÈ£ ±¹¹ø)
 ===================================================================================================================
 *** @xclass       : xo_hpd
 *** @xattach      : xo_hpd_attach
 *** @xdetach      : xo_hpd_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : Arraay - X_HPD (ÈÞ´ëÆù/PCS ÀüÈ­¹øÈ£ ±¹¹øÀ» Á¤ÀÇÇÏ´Â String Array)
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xvalidation  : xo_hpd_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÈÞ´ëÆù ¹× PCS ±¹¹øÀÎÁö¸¦ Ã¼Å©ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_hpd.attach(oInput)
 * @object       : xo_hpd
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hpd Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hpd_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
}

/*******************************************************************************************************************
 * @prototype    : xo_hpd.detach(oInput)
 * @object       : xo_hpd
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : hpd Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hpd_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_hpd.validate(oInput)
 * @object       : xo_hpd
 * @param        : Object  - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Arraay - X_HPD (ÈÞ´ëÆù/PCS ÀüÈ­¹øÈ£ ±¹¹øÀ» Á¤ÀÇÇÏ´Â String Array)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ ÈÞ´ëÆù/PCS ±¹¹ø Áß ÇÏ³ªÀÎÁö °Ë»çÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_hpd_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  if (!window.xGetOption("X_HPD").contain(oInput.value)) {
    oInput.alertX(oInput.getMessage("hpd").substituteAt(oInput.value));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : ddd (DDD ÀüÈ­¹øÈ£)
 ===================================================================================================================
 *** @xclass       : xo_ddd
 *** @xattach      : xo_ddd_attach
 *** @xdetach      : xo_ddd_detach
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 *** @xoption      : Arraay - X_DDD (DDD ÀüÈ­¹øÈ£ ±¹¹øÀ» Á¤ÀÇÇÏ´Â String Array)
 *** @xvalidation  : xo_ddd_validate
 *** @dependency   : filter
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        : .
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Àü±¹ÀüÈ­¹øÈ£ ±¹¹ø(DDD)ÀÎÁö¸¦ Ã¼Å©ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_ddd.attach(oInput)
 * @object       : xo_ddd
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ddd Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_ddd_attach(oInput) {
  if (!oInput.getAttribute("filter")) oInput.attachX("filter", window.xGetOption("X_FILTER_NUM"));
}

/*******************************************************************************************************************
 * @prototype    : xo_ddd.detach(oInput)
 * @object       : xo_ddd
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : String - X_FILTER_NUM ("[0-9]" : numericÀ» Ç¥ÇöÇÏ´Â Á¤±Ô½Ä ¹®ÀÚ¿­)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ddd Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_ddd_detach(oInput) {
  if (oInput.getAttribute("filter") == window.xGetOption("X_FILTER_NUM")) oInput.detachX("filter");
}

/*******************************************************************************************************************
 * @prototype    : xo_ddd.validate(oInput)
 * @object       : xo_ddd
 * @param        : Object  - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : Arraay - X_DDD (DDD ÀüÈ­¹øÈ£ ±¹¹øÀ» Á¤ÀÇÇÏ´Â String Array)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·ÂµÈ °ªÀÌ Àü±¹ÀüÈ­¹øÈ£ ±¹¹ø(DDD) ±¹¹ø Áß ÇÏ³ªÀÎÁö °Ë»çÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_ddd_validate(oInput) {
  var flag = true;
  if (!oInput.value) return true;

  if (!window.xGetOption("X_DDD").contain(oInput.value)) {
    oInput.alertX(oInput.getMessage("ddd").substituteAt(oInput.value));
    flag = false;
  }

  return flag;
}


/*******************************************************************************************************************
 *** @xkeyword     : case (´ë¼Ò¹®ÀÚ·Î °­Á¦)
 ===================================================================================================================
 *** @xclass       : xo_case
 *** @xattach      : xo_case_attach
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : onkeypress - xo_case_onkeypress
 *** @xevent       : onpaste - xo_case_onpaste
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Á¤ÀÇµÈ case¿¡ ÀÇ°ÅÇÏ¿© »ç¿ëÀÚ ÀÔ·Â¹®ÀÚ¸¦ ´ë¹®ÀÚ È¤Àº ¼Ò¹®ÀÚ·Î º¯°æÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_case.attach(oInput)
 * @object       : xo_case
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : case Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_case_attach(oInput) {
  if (!oInput.value) return;
  switch(oInput.getAttribute("case")) {
   case "lower" :  oInput.value = oInput.value.toLowerCase(); break;
   case "upper" :  oInput.value = oInput.value.toUpperCase(); break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_case.onkeypress(oInput, oEvent)
 * @object       : xo_case
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onkeypress
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onkeypress ¹ß»ý½Ã Á¤ÀÇµÈ case¿¡ ÀÇ°ÅÇÏ¿© »ç¿ëÀÚ ÀÔ·Â¹®ÀÚ¸¦ ´ë¹®ÀÚ È¤Àº ¼Ò¹®ÀÚ·Î º¯°æÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_case_onkeypress(oInput, oEvent) {
  var code = oEvent.keyCode;
  switch(oInput.getAttribute("case")) {
   case "lower" :  if (code >= 65 && code <= 90)  oEvent.keyCode += 32; break;
   case "upper" :  if (code >= 97 && code <= 122) oEvent.keyCode -= 32; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_case.onpaste(oInput, oEvent)
 * @object       : xo_case
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onpaste
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onpaste(ºÙ¿©³Ö±â) ¹ß»ý½Ã Á¤ÀÇµÈ case¿¡ ÀÇ°ÅÇÏ¿© Å¬¸³º¸µå µ¥ÀÌÅÍ¸¦ ´ë¹®ÀÚ È¤Àº ¼Ò¹®ÀÚ·Î º¯°æÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_case_onpaste(oInput, oEvent) {
  if (!oInput.value) return;
  switch(oInput.getAttribute("case")) {
   case "lower" :  window.clipboardData.setData("Text", window.clipboardData.getData("Text").toLowerCase()); break;
   case "upper" :  window.clipboardData.setData("Text", window.clipboardData.getData("Text").toUpperCase()); break;
  }
}


/*******************************************************************************************************************
 *** @xkeyword     : send_value (°ªº¸³»±â)
 ===================================================================================================================
 *** @xclass       : xo_send_value
 *** @xattach      : .
 *** @xdetach      : xo_send_value_detach
 *** @xcss         : .
 *** @xevent       : onclick - xo_send_value_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : send_valueÀÌ Àû¿ëµÈ element¿¡ ´ëÇØ onclick½Ã¿¡ formÀÇ send_value Ç×¸ñ°ªÀ» ³»ºÎ ¼³Á¤ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_send_value.detach(oInput)
 * @object       : xo_send_value
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : send_value Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_send_value_detach(oInput) {
  if (oInput.getAttribute("send_value") == oInput.form.getAttribute("send_value")) oInput.form.removeAttribute("send_value");
}

function xo_dyna_action_detach(oInput) {
  if (oInput.getAttribute("dyna_action") == oInput.form.getAttribute("dyna_action")) oInput.form.removeAttribute("dyna_action");
}

/*******************************************************************************************************************
 * @prototype    : xo_send_value.onclick(oInput, oEvent)
 * @object       : xo_send_value
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : onclick(ºÙ¿©³Ö±â) ¹ß»ý½Ã ÀÔ·ÂÇÊµå¿¡ Á¤ÀÇµÈ send_value°ªÀ» form¿¡ ÁöÁ¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_send_value_onclick(oInput, oEvent) {
  oInput.form.setAttribute("send_value", oInput.getAttribute("send_value"));
}

function xo_dyna_action_onclick(oInput, oEvent) {
  oInput.form.setAttribute("dyna_action", oInput.getAttribute("dyna_action"));
}
/*******************************************************************************************************************
 *** @xkeyword     : status_bar (»óÅÂ¹Ù)
 ===================================================================================================================
 *** @xclass       : xo_status_bar
 *** @xattach      : xo_status_bar_attach
 *** @xdetach      : xo_status_bar_detach
 *** @xcss         : .
 *** @xevent       : onfocus     - xo_status_bar_onfocus
 *** @xevent       : onblur      - xo_status_bar_onblur
 *** @xevent       : onmouseover - xo_status_bar_onmouseover
 *** @xevent       : onmouseout  - xo_status_bar_onmouseout
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·ÂÇÊµå°¡ Mouse over È¤Àº Æ÷Ä¿½º µÇ¾úÀ»¶§, ºê¶ó¿ìÁ®ÀÇ status bar¿¡ Ç¥½ÃµÉ ¹®ÀÚ¿­À» Á¤ÀÇÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_status_bar.attach(oInput)
 * @object       : xo_status_bar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : status_bar Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_status_bar_attach(oInput) {
  xo_status_bar_onfocus     = xo_status_bar_show;
  xo_status_bar_onblur      = xo_status_bar_kill;
  xo_status_bar_onmouseover = xo_status_bar_show;
  xo_status_bar_onmouseout  = xo_status_bar_kill;
}

/*******************************************************************************************************************
 * @prototype    : xo_status_bar.detach(oInput)
 * @object       : xo_status_bar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : status_bar Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_status_bar_detach(oInput) {
  xo_status_bar_onfocus     = null;
  xo_status_bar_onblur      = null;
  xo_status_bar_onmouseover = null;
  xo_status_bar_onmouseout  = null;
}

/*******************************************************************************************************************
 * @prototype    : xo_status_bar.onfocus/onmouseover(oInput, oEvent)
 * @object       : xo_status_bar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onfocus
 * @event        : oInput.onmouseover
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : status_bar°¡ Àû¿ëµÈ element¿¡ ´ëÇØ onfocus/onmouseover½Ã¿¡ Á¤ÀÇµÈ ¹®ÀÚ¿­À» status bar¿¡ Ç¥½ÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_status_bar_show(oInput, oEvent) {
  window.status = oInput.getAttribute("status_bar");
}

/*******************************************************************************************************************
 * @prototype    : xo_status_bar.onblur/onmouseout(oInput, oEvent)
 * @object       : xo_status_bar
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onblur
 * @event        : oInput.onmouseout
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : status_bar°¡ Àû¿ëµÈ element¿¡ ´ëÇØ onblur/onmouseout½Ã¿¡ status barÀÇ ³»¿ëÀ» Áö¿î´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_status_bar_kill(oInput, oEvent) {
  window.status = "" ;
}


/*******************************************************************************************************************
 *** @xkeyword     : sync (µ¿Àû°ªÀÏÄ¡)
 ===================================================================================================================
 *** @xclass       : xo_sync
 *** @xattach      : xo_sync_attach
 *** @xdetach      : xo_sync_detach
 *** @xcss         : .
 *** @xevent       : onkeyup  - xo_sync_onkeyup
 *** @xevent       : onchange - xo_sync_onchange
 *** @xevent       : onclick  - xo_sync_onclick
 *** @xoption      : .
 *** @xvalidation  : .
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : Æ¯Á¤ elementÀÇ °ªÀÌ º¯ÇÒ¶§ ´Ù¸¥ elementÀÇ °ªÀ» ÀÚµ¿À¸·Î º¯°æÇÏ¿© µÎ elementÀÇ °ªÀ» ÀÏÄ¡½ÃÅ²´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_sync.attach(oInput)
 * @object       : xo_sync
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : sync Å°¿öµå°¡ attachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_sync_attach(oInput) {
  switch (this.parent.type) {
    case "text"   : case "password"   : xo_sync_onkeyup  = xo_sync_handler; break;
    case "hidden" : case "select-one" : xo_sync_onchange = xo_sync_handler; break;
    case "radio"  : case "checkbox"   : xo_sync_onclick  = xo_sync_handler; break;
  }
}

/*******************************************************************************************************************
 * @prototype    : xo_sync.detach(oInput)
 * @object       : xo_sync
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : sync Å°¿öµå°¡ detachµÉ ¶§ ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_sync_detach(oInput) {
  xo_sync_onkeyup  = null;
  xo_sync_onchange = null;
  xo_sync_onclick  = nnll;
}

/*******************************************************************************************************************
 * @prototype    : xo_sync.onkeyup/onchange/onclick(oInput, oEvent)
 * @object       : xo_sync
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @param        : Event - oEvent  (oInput¿¡¼­ catchµÈ event °³Ã¼)
 * @return       : .
 * @event        : oInput.onkeyup
 * @event        : oInput.onchange
 * @event        : oInput.onclick
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : elementÀÇ type¿¡ µû¶ó °¢°¢ÀÇ elementÀÇ value¸¦ sync ½ÃÅ²´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xo_sync_handler(oInput, oEvent) {
  var tArray = oInput.form.getElementsByNames(oInput.getAttribute("sync"));
  var itill = tArray.length;
  for (var idx=0; idx < itill; idx++) {
    tArray.setValue(oInput.getValue());
  }
}


/*******************************************************************************************************************
 *** @xkeyword     : is_value (°ªÀÏÄ¡ Ã¼Å©)
 ===================================================================================================================
 *** @xclass       : xo_is_value
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_is_value_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         : ÀÔ·Â°ªÀÌ ´Ù¸¥ ÀÔ·ÂÇÊµåÀÇ ÀÔ·Â°ª°ú °°ÀºÁö¸¦ °Ë»çÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_is_value.validate(oInput)
 * @object       : xo_is_value
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : ÀÔ·Â°ªÀÌ ´Ù¸¥ ÀÔ·ÂÇÊµåÀÇ ÀÔ·Â°ª°ú °°ÀºÁö¸¦ °Ë»çÇÑ´Ù.
 * @attention    : Æû ³»ºÎÀÇ element¸¸À» ºñ±³ÇÒ ¼ö ÀÖÀ¸¸ç, ´Ü°Ç ºñ±³¸¸ÀÌ °¡´ÉÇÏ´Ù.
 ******************************************************************************************************************/
function xo_is_value_validate(oInput) {
  if (!oInput.value) return true;
  var flag = true;
  var tInputs = oInput.form.getElementsByNames(oInput.getAttribute("is_value"));

  if (tInputs.length != 1) {
    oInput.alertX(oInput.getMessage("is_value", 1).substituteAt(oInput.name, oInput.getAttribute("is_value")));
    flag = false;
  }

  if (tInputs[0].getValue() != oInput.getValue()) {
    var item1 = oInput.isAttrValue("itemname") ? oInput.getAttribute("itemname") : oInput.name;
    var item2 = tInputs[0].isAttrValue("itemname") ? tInputs[0].getAttribute("itemname") : tInputs[0].name;
    oInput.alertX(oInput.getMessage("is_value").substituteAt(item1, item2) );
    flag = false;

  }
  return flag;
}

/*******************************************************************************************************************
 *** @xkeyword     : filesize_limit (ÆÄÀÏ »çÀÌÁî Ã¼Å©)
 ===================================================================================================================
 *** @xclass       : xo_filesize_limit
 *** @xattach      : .
 *** @xdetach      : .
 *** @xcss         : .
 *** @xevent       : .
 *** @xoption      : .
 *** @xvalidation  : xo_filesize_limit_validate
 *** @dependency   : .
 *** @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 *** @since        :
 *** @origin       : .
 *** @interkeyword : .
 *** @todo         : .
 *** @desc         :  input type=file¿¡¼­ »ç¿ëÀÚ°¡ ÁöÁ¤ÇÑ ÆÄÀÏÀÇ Å©±â limitÀ» Ã¼Å©ÇÑ´Ù.
 *** @attention    : .
 ******************************************************************************************************************/

/*******************************************************************************************************************
 * @prototype    : xo_filesize_limit.validate(oInput)
 * @object       : xo_filesize_limit
 * @param        : Object - oInput (keyword°¡ bindingµÈ element °´Ã¼)
 * @return       : Boolean - validation¿¡ ¼º°øÇÏ°Å³ª validation ´ë»óÀÌ ¾Æ´Ï¸é true
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 110
 * @origin       : .
 * @interkeyword : .
 * @todo         : !ÀÓÀÇ·Î »ý¼ºÇÑ Img ÅÂ±×¸¦ RemoveÇØ¾ß ÇÑ´Ù.
 * @desc         : input type=file¿¡¼­ »ç¿ëÀÚ°¡ ÁöÁ¤ÇÑ ÆÄÀÏÀÇ Å©±â limitÀ» Ã¼Å©ÇÑ´Ù.
 * @attention    : Internet Explorer 5.5ÀÌ»ó¿¡¼­ »ç¿ëÀÌ °¡´ÉÇÏ´Ù.
 ******************************************************************************************************************/
function xo_filesize_limit_validate(oInput) {
	if (xJScriptEngineVersion < 5.5) return;
  if (!oInput.value) return true;
  var flag = true;
  var limit = oInput.getAttribute("filesize_limit").toUpperCase();
  if (limit.indexOf("KB") == limit.length -2) limit = parseInt(limit.substring(0, limit.length-2), 10) * 1024;
  else if (limit.indexOf("MB") == limit.length -2) limit = parseInt(limit.substring(0, limit.length-2), 10) * 1048576;
  limit = parseInt(limit, 10);
 	var oIMG = document.createElement("IMG");
  oIMG.dynsrc = oInput.value;
  if (oIMG.fileSize > limit) {
    oInput.alertX(oInput.getMessage("filesize_limit").substituteAt(oInput.getAttribute("filesize_limit")));
    flag = false;
  }
  //oIMG.removeNode(true);
  //document.removeChild(oIMG);

  return flag;
}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  Initialize & windows Extendsion
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*******************************************************************************************************************
 * @prototype    : window.xJosEventClass()
 * @object       : xJosEventClass (this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos ³»ºÎ ÀÌº¥Æ® ÇÚµé¸µÀ» À§ÇÑ xJos Event °´Ã¼¸¦ Á¤ÀÇÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xJosEventClass() {
  this.type = null;
  this.srcElement = null;
  this.cancel = false;
  this.set = xjos_event_set;
  this.clear = xjos_event_clear;
}

/*******************************************************************************************************************
 * @prototype    : xJosEventClass.clear()
 * @object       : xJosEventClass
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos Event °´Ã¼ÀÇ ¼³Á¤µÈ °ªµéÀ» ¸ðµÎ Áö¿î´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xjos_event_clear() {
  this.xkey = null;
  this.type = null;
  this.srcElement = null;
  this.cancel = false;
}

/*******************************************************************************************************************
 * @prototype    : xJosEventClass.set(o, type)
 * @object       : xJosEventClass
 * @param        : Object - o (xJos Event¸¦ fireÇÑ Object)
 * @param        : String - type (xJos Event Type)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos Event °´Ã¼ÀÇ ¼³Á¤µÈ °ªµéÀ» ¸ðµÎ Áö¿î´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xjos_event_set(o, type){
  this.srcElement = o;
  this.type = type;
  this.cancel = false;
}

/*******************************************************************************************************************
 * @prototype    : window.xGetOption(key)
 * @object       : window °´Ã¼(this)
 * @param        : String - key (Ã£À» xJos Option key)
 * @return       : Object - Ã£¾ÆÁø xJos Option Value
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos OptionÁß¿¡ key matchµÇ´Â node¸¦ Ã£¾Æ¼­ ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function wm_get_option(optStr) {
  return xaOptionTable[optStr];
}

/*******************************************************************************************************************
 * @prototype    : window.xSetOption(key, value)
 * @object       : window °´Ã¼(this)
 * @param        : String - key   (Ã£À» xJos Option key)
 * @param        : Object - value (xJos Option¿¡ key·Î ÇÒ´çÇÒ node°ª)
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos OptionÁß¿¡ key matchµÇ´Â node¿¡ value¸¦ ¼¼ÆÃÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function wm_set_option(optStr, attr) {
  xaOptionTable[optStr]=attr;
}

/*******************************************************************************************************************
 * @prototype    : window.xuSortFunction(one, two)
 * @object       : String °´Ã¼ (this)
 * @param        : Object - one (ºñ±³ÇÒ ´ë»ó)
 * @param        : Object - two (ºñ±³ÇÒ ´ë»ó)
 * @return       : Integer - ºñ±³°á°ú
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : Array.sort¿¡¼­ ³»ºÎÀûÀ¸·Î È£ÃâµÇ´Â ÇÔ¼ö. elementÀÇ sourceIndexÀÇ ¿ì¼± ¼øÀ§¸¦ °áÁ¤ÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xuSortFunction(one, two) {
  if ( one.sourceIndex > two.sourceIndex ) return +1;
  else if ( one.sourceIndex < two.sourceIndex )return -1;
  else return 0;
}


/*******************************************************************************************************************
 * @prototype    : window.xuGetArray(oCollection [,start [,end]])
 * @object       : window °´Ã¼(this)
 * @param        : Object - oCollection (Collection °´Ã¼)
 * @param        : Integer - start (±¸¼ºÀ» ½ÃÀÛÇÒ index - »ý·«½Ã¿¡´Â Ã³À½ºÎÅÍ)
 * @param        : Integer - end (±¸¼ºÀ» ³¡³¾ index - »ý·«½Ã¿¡´Â ³¡±îÁö)
 * @return       : Array - oCollection°ªÀÌ ´ã°ÜÁ® ÀÖ´Â Array°´Ã¼
 * @event        : N/A
 * @option       : N/A
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v4.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : oCollection°³Ã¼ÀÇ ±¸¼º¿ø¼ÒµéÀ» Array°´Ã¼·Î º¯ÇüÇÏ¿© ¸®ÅÏÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function xuGetArray(oCollection, start, end) {
  var vArray = new Array;
  if (!oCollection) return vArray;
  if (!oCollection.length) { vArray[0] = oCollection; return vArray; }
  var itill = oCollection.length;
  var is = arguments.length > 1 ? start : 0;
  var ie = arguments.length > 2 ? end   : oCollection.length;
  for (var idx=is; idx < ie;  idx++) {
    vArray[vArray.length] = oCollection[idx];
  }
  return vArray;
}

/*******************************************************************************************************************
 * @prototype    : window.extendPrototypeX
 * @object       : window
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : .
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos¿¡¼­ »ç¿ëÇÒ String ¹× ArrayÀÇ ProtoTypeÀ» È®ÀåÇÑ´Ù.
 ******************************************************************************************************************/
function extendPrototypeX()  {
  String.prototype.trim         = sm_trim;
  String.prototype.lTrim        = sm_left_trim;
  String.prototype.rTrim        = sm_right_trim;
  String.prototype.isNum        = sm_is_num;
  String.prototype.getByte      = sm_get_byte;
  String.prototype.hack         = sm_hack;
  String.prototype.substituteAt = sm_substitute_at;
  String.prototype.filtering    = sm_filtering;
  String.prototype.contain      = sm_contain;
  Array.prototype.compact       = am_compact;
  Array.prototype.hack          = am_hack;
  Array.prototype.contain       = am_contain;
}

/*******************************************************************************************************************
 * @prototype    : window.initializeX()
 * @object       : window °´Ã¼(this)
 * @param        : .
 * @return       : .
 * @event        : .
 * @option       : Boolean - X_ACTIVATE (true:xJos ¿£Áø ±âµ¿ ¹× API/Keyword¸¦ »ç¿ëÇÑ´Ù.)
 * @option       : Boolean - X_RESTRICT_APPLY (true:form¿¡ xjos¶ó´Â Attribute°¡ ¼±¾ðµÈ °æ¿ì¿¡¸¸ xJos¸¦ bindingÇÑ´Ù.)
 * @option       : Boolean - X_SHOW_ELAPSED (true:¼öÇà¿¡ °É¸° ½Ã°£À» status bar¿¡ Ç¥½ÃÇÑ´Ù.)
 * @author       : ½ÅÅÃ±Ô(Shin Tack Kyu)
 * @since        : xJos v3.0
 * @version      : xfunction build 100
 * @origin       : .
 * @interkeyword : .
 * @todo         : .
 * @desc         : xJos ÃÊ±âÈ­¸¦ ¼öÇàÇÑ´Ù.
 * @attention    : .
 ******************************************************************************************************************/
function initializeX()  {
  if (!xaOptionTable["X_ACTIVATE"]) return ;
  /*@cc_on @*/
  /*@ xJScriptEngineVersion = @_jscript_version;  @*/
  this.xGetOption = wm_get_option;
  this.xSetOption = wm_set_option;
  extendPrototypeX();
  this.xJos = new xJosEventClass();
  this.xBuffer = new Array;
  var start_x = new Date();
  var itill = document.forms.length;
  var tinput = 0;
  var opt = window.xGetOption("X_RESTRICT_APPLY");
  for ( var idx = 0 ; idx < itill ; idx++)  {
    if (opt && document.forms[idx].getAttribute("xjos") == null) continue;
    document.forms[idx].initialize = fm_initialize;
    document.forms[idx].initialize();
    tinput += document.forms[idx].length;
  }
  var end_x = new Date();
  if (window.xGetOption("X_SHOW_ELAPSED"))  window.status = " xJos init elasped = " + (end_x - start_x) + " m/s for " + tinput + " elements";
  delete start_x; delete end_x;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///  initialize xJos here!
///
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

initializeX();
