/*   JForm   : °ËÁõÇÒ ¸ðµç °´Ã¼¸¦ ´ã´Âµ¥ »ç¿ë.  JText   : ÅØ½ºÆ® µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JNumber : ¼ýÀÚ µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JMoney  : È­Æó µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JSelect : Drop/Down µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JCheck  : Ã¼Å©¹Ú½º¿Í ¶óµð¿À ¹öÆ°À» °ËÁõÇÏ´Âµ¥ »ç¿ë.  JSsn    : ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JMail   : ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JDate   : ³¯Â¥ µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.  JFile   : ÆÄÀÏ ¾÷·Îµå µ¥ÀÌÅÍ¸¦ °ËÁõÇÏ´Âµ¥ »ç¿ë.*/var DAY_OF_WEEK = new Array("ÀÏ","¿ù","È­","¼ö","¸ñ","±Ý","Åä");function JForm() {    /* Member field */    this.children = new Array    /* Member Method */    this.add = jform_add;    this.validate = jform_validate;    return this;}function jform_add(child) {    this.children[this.children.length] = child;    return this;}function jform_validate() {    for (var i = 0; i < this.children.length; i++) {        if (!this.children[i].validate()) {            return false;        }    }    return true;}function JText(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.min;    this.max;        this.filterCheck;    this.nullCheck = true;    this.rangeCheck;    /* Member Method */    this.validate = jtext_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;    this.filter = jtext_filter;    this.focus = jtext_focus;    return this;}function jtext_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        alert(messages.get("JSM-1004", ul(this.name)));        return this.focus();    }        if (this.rangeCheck && (trimmed(value).length != 0) && !checkCharacterSize(value, this.min, this.max)) {        if (this.min == this.max) {            messages.alert("JSM-1005", [this.name, this.min]);        } else {            messages.alert("JSM-1006", [this.name, this.min, this.max]);        }        return this.focus();    }    if (this.filterCheck && isSpecial(value)) {        messages.alert("JSM-1007", [this.name]);        return this.focus();    }    return true;}function jtext_nullable() {    this.nullCheck = false;    return this;}function jtext_range(min, max) {    this.rangeCheck = true;    this.min = min;    this.max = max;    return this;}function jtext_filter() {    this.filterCheck = true;    return this;}function jtext_focus() {    this.object.focus();    this.object.select();    return false;}function JNumber(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.nullCheck = true;    this.rangeCheck;        this.min;    this.max;    /* Member Method */    this.validate = jnumber_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;    this.focus = jtext_focus;        return this;}function jnumber_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", ul(this.name));        return this.focus();    }    if (isNaN(value)) {        messages.alert("JSM-1008", this.name);        return this.focus();    }        if (this.rangeCheck && (trimmed(value).length != 0) && !checkNumberSize(value, this.min, this.max)) {        if (this.min == this.max) {            messages.alert("JSM-1009", [this.name, this.min]);        } else {            messages.alert("JSM-1010", [this.name, wa(this.min), this.max]);        }        return this.focus();    }    return true;}function JSelect(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.min;    this.max;    this.nullCheck = true;    this.rangeCheck;        /* Member Method */    this.validate = jselect_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;    this.focus = jselect_focus;    return this;}function jselect_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1011", ul(this.name));        return this.focus();    }    var number = isSelected(this.object);    if (this.rangeCheck && number != 0 && (number < this.min || number > this.max)) {        if (this.min == this.max) {            messages.alert("JSM-1012", [this.name, this.min]);        } else {            messages.alert("JSM-1013", [this.name, wa(this.min), this.max]);        }        return this.focus();    }    return true;}function jselect_focus() {    this.object.focus();    return false;}function isSelected(item) {    if (item == null) return 0;    var result = 0;    for (var i = 0; i < item.length; i++) {        if (item[i].selected) {            result++;        }    }    return result;}function JCheck(name, object) {    /* Member Field */    this.name = name;    this.object = object;        this.min;    this.max;    this.nullCheck = true;    this.rangeCheck;    /* Member Method */    this.validate = jcheck_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;    this.focus = jcheck_focus;    return this;}function jcheck_validate() {    var number = isChecked(this.object);    if (this.nullCheck && number == 0) {        messages.alert("JSM-1011", ul(this.name));        return this.focus();    }    if (this.rangeCheck && number != 0 && (number < this.min || number > this.max)) {        if (this.min == this.max) {            messages.alert("JSM-1012", [this.name, this.min]);        } else {            messages.alert("JSM-1013", [this.name, wa(this.min), this.max]);        }        return this.focus();    }    return true;}function jcheck_focus() {    return false;}function isSpecial(s) {    for (i = 0; i < s.length; i++) {           /* Check that current character letter. */        var c = s.charAt(i);        if (c == "'" || c == "." || c == "\"") {            return true;        }    }    return false;}function isChecked(list) {    if (list == null) return 0;    var result = 0;    /* list arrayÀÇ µ¥ÀÌÅÍ°¡ 1ÀÎ °æ¿ì */    if (list.checked) {        return 1;    }    for (var i = 0; i < list.length; i++) {        if (list[i].checked) {            result++;        }    }    return result;}function trimmed(value) {    value = value.replace(/^\s+/, "");  /* remove leading white spaces */    value = value.replace(/\s+$/g, ""); /* remove trailing while spaces */    return value;}function checkCharacterSize(data, min, max) {    var total = 0;    for (var i = 0; i < data.length; i++) {        var a = data.charAt(i);        /* ÇÑ±ÛÀÎ °æ¿ì ±æÀÌ°¡ 6 ÀÌ´Ù. */        if (escape(a).length >= 6) {            total = total + 2;        } else {            total = total + 1;        }    }    return total >= min && total <= max;}function checkNumberSize(data, min, max) {    if(max <= 0) {        return data >= min;    } else {        return data >= min && data <= max;    }}function JMoney(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.nullCheck = true;    this.rangeCheck;        this.min;    this.max;    /* Member Method */    this.validate = jmoney_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;    this.focus = jtext_focus;    return this;}function jmoney_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", ul(this.name));        return this.focus();    }    value = value.replace(/,|\s+/g, "");    if (isNaN(value)) {        messages.alert("JSM-1008", this.name);        return this.focus();    }    if (this.rangeCheck && (trimmed(value).length != 0) && !checkNumberSize(value, this.min, this.max)) {        if (this.min == this.max) {            messages.alert("JSM-1014", [this.name, this.min]);        } else {            messages.alert("JSM-1015", [this.name, wa(this.min), this.min]);        }        return this.focus();    }    return true;}function JSsn(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.nullCheck = true;    /* Member Method */    this.validate = jssn_validate;    this.nullable = jtext_nullable;    this.focus = jtext_focus;    return this;}function jssn_validate() {    var value = this.object.value;    if (isNaN(value.replace(/-|\s+/g, ""))) {        messages.alert("JSM-1008", this.name);        return this.focus();    }    if (!this.nullCheck && trimmed(value).length == 0) {        return true;    }    var year = value.substring(0, 2);    var month = value.substring(2, 4);    var day = value.substring(4, 6);    var sex = value.substring(13, 14);    if ((value.length != 14 ) || (year < 25 || month < 1 || month >12 || day < 1)) {        messages.alert("JSM-1016", ul(this.name));        return this.focus();    }    if ((sex != 1 && sex !=2 )) {        messages.alert("JSM-1016", ul(this.name));        return this.focus();    }    return true;}function JMail(name, object) {    /* Member Field */    this.name = name;    this.object = object;    this.nullCheck = true;    /* Member Method */    this.validate = jmail_validate;    this.nullable = jtext_nullable;    this.range = jtext_range;        this.focus = jtext_focus;    return this;}function jmail_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", ul(this.name));        return this.focus();    }        if (!this.nullCheck && trimmed(value).length == 0) {        return true;    }    /* ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÇ Çã¿ëµÇ´Â ÃÖ´ë Å©±â Ã¼Å© */    /*    var re = new RegExp("(^[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*@[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*$)");    if (!re.test(value)) {        messages.alert("JSM-1017", un(this.name));        return this.focus();    }    */        //@ ¿©ºÎ Ã¼Å©    value_arr = value.split("@");        if (value_arr.length != 2) {	    messages.alert("JSM-1017", un(this.name));	    return this.focus();    }    //@ ¾Õ¿¡ .¸¸ ÀÖ°Å³ª ¾øÀ¸¸é ¿¡·¯    else if (value_arr[0] == "" || value_arr[0] == ".") {		messages.alert("JSM-1017", un(this.name));	    return this.focus();    } else {    	value_divination = value_arr[1].split(".");		//@ µÚ¿¡ .ÀÌ 1¿¡¼­ 4°³ »çÀÌ¸é ¿¡·¯ 		if (value_divination.length < 2 || value_divination.length > 5) {			messages.alert("JSM-1017", un(this.name));	    	return this.focus(); 		} 		//@ µÚ¿¡ ¸¶Áö¸· .µÚ¿¡ 2ÀÚ¿¡¼­ 3ÀÚ º¸´Ù ÀûÀ¸¸é ¿¡·¯ 		else if (value_divination[value_divination.length-1].length < 2 || value_divination[value_divination.length-1].length > 3) {			messages.alert("JSM-1017", un(this.name));	    	return this.focus(); 		}    }        return true;}/** *    Date Å¸ÀÔ °ËÁõ¿¡ »ç¿ëµÈ´Ù. */function JDate(name, object, re) {    /* Member Field */    this.name = name;    this.object = object;         this.nullCheck = true;    this.rangeCheck = false;        this.date = null;        if (re)  {    	this.re = re;    } else {		this.re = /^\d{4}[-.\/]?\d{2}[-.\/]?\d{2}$/;    }        this.min = null; /* YYYYMMDD Format */    this.max = null; /* YYYYMMDD Format */        this.format = "YYYY³âMM¿ùDDÀÏ(DAY)";    /* Member Method */    this.validate = jdate_validate;    this.nullable = jtext_nullable;    this.focus = jtext_focus;    this.range = jtext_range;        this.toDate = jdate_toDate;    this.parse = jdate_parse;    this.toString = jdate_toString;        this.getYear  = jdate_getYear;    this.getMonth = jdate_getMonth;    this.getDate  = jdate_getDate;        this.getDay = jdate_getDay;    this.parse();        return this;}/* µ¥ÀÌÅÍ Å¸ÀÔ À¯È¿¼º Å×½ºÆ®  */function jdate_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", ul(this.name));        return this.focus();    }        if (!this.nullCheck && trimmed(value).length == 0) {        return true;    }      if (this.date == null) {        messages.alert("JSM-1018", wa(this.name));        return this.focus();        }         if (this.rangeCheck) {        var aDate = this.toDate();        var minDate, maxDate;                if (this.min != null) {            minDate = new JDate().parse(this.min);        } else {            minDate = new JDate().parse("10000101");        }        if (this.max != null) {            maxDate = new JDate().parse(this.max);        } else {            maxDate = new JDate().parse("99991231");        }        if (this.min == null && aDate > maxDate.toDate()) {            messages.alert("JSM-1019", [this.name, maxDate]);            return this.focus();                    } else if (this.max == null && aDate < minDate.toDate()) {            messages.alert("JSM-1020", [this.name, minDate]);            return this.focus();        } else if (aDate > maxDate.toDate() || aDate < minDate.toDate()) {            messages.alert("JSM-1021", [this.name, minDate, maxDate]);            return this.focus();        }    }        return true;}/* Date ÆÄ½Ì  *//* ³¯Â¥ µ¥ÀÌÅÍ ÀÎÁö °ËÁõÇÑ´Ù. ÀÏÂ÷ÀûÀ¸·Î´Â Á¤±Ô½ÄÀ» ÀÌ¿ëÇÑ´Ù. *//* ³â,¿ù,ÀÏ »çÀÌÀÇ Delimiter´Â ".-/" Áß ÇÏ³ªÀÌ°Å³ª ºó¹®ÀÚÀ» »ç¿ëÇÑ´Ù. *//* Date Object¸¦ ÃÊ±âÈ­ÇÏ¿© µ¥ÀÌÅÍ°¡ ÀûÇÕÇÑÁö Ã¼Å©ÇÑ´Ù. */function jdate_parse() {    var value = this.object;    if (jdate_parse.arguments.length > 0) {        value = jdate_parse.arguments[0];    } else if (this.object && typeof this.object=="object") {        value = this.object.value;    } else {        this.date = new Date();        return this;    }        this.date = null;    if (value.search(this.re) >= 0) {        value = value.replace(/[-.\/]/g,"");        var aDate = new Date(value.substring(0,4),value.substring(4,6)-1,value.substring(6,8));        if (   aDate.getFullYear()  == Math.abs(value.substring(0,4))            && aDate.getMonth() == Math.abs(value.substring(4,6))-1             && aDate.getDate()  == Math.abs(value.substring(6,8)) ) {            this.date = aDate;        }    }    return this;}/* Date Å¸ÀÔÀ¸·Î º¯È¯ */function jdate_toDate() {    return this.date;}function jdate_getYear() {    return this.date == null ? 1000 : this.date.getFullYear();}function jdate_getMonth() {    var num = (this.date == null ? 0 : this.date.getMonth()+1);    return (num < 10 ? '0' + new String(num) : num);}function jdate_getDate() {    var num = (this.date == null ? 0 : this.date.getDate());    return (num < 10 ? '0' + new String(num) : num);}function jdate_getDay() {    return (this.date == null ? DAY_OF_WEEK[0] : DAY_OF_WEEK[this.date.getDay()]);}/* ½ºÆ®¸µÀ¸·Î º¯È¯  */function jdate_toString() {    var formatString = this.format;    if (jdate_toString.arguments.length > 0) {        formatString = jdate_toString.arguments[0];    }    var str = formatString.replace(/YYYY/g , this.getYear());    str = str.replace(/MM/g , this.getMonth());    str = str.replace(/DD/g , this.getDate());    str = str.replace(/DAY/g , this.getDay());    str = str.replace(/yy/g , new String(this.getYear()).substring(2,4));    return str;}/* ÆÄÀÏ¾÷·Îµù½Ã ÀÔ·ÂÆÄÀÏ¿¡ ´ëÇÑ °ËÁõÀ» ½Ç½ÃÇÑ´Ù.  */function JFile(name, type) {    /* Member Field */    this.name = name;    this.object = document.forms[0].j_file;    this.type = type;    this.nullCheck = true;    this.allowedExtension;    this.disallowedExtension;    this.nullable = jtext_nullable;    this.extension = jfile_extension;    this.xExtension = jfile_xExtension;    this.validate = jfile_validate;    return this;}/*È®Àå¸í Ã¼Å©*/function jfile_extension(array) {    this.allowedExtension = array;    return this;}/*ÀÔ·Â±ÝÁöµÈ È®Àå¸í Ã¼Å©*/function jfile_xExtension(array) {    this.disallowedExtension = array;    return this;}function jfile_validate() {	/*¸¸¶¥ Ã¤¿î upload¸¦ ¼öÁ¤ÇÒ¶§ object´Â ¾ø´Ù. */	if (!this.object) {		return true;	}	/*IE ¹ö±×·Î ÀÎÇÑ ÀÔ·Â°ª Á¤È®¼º Ã¼Å© */	var re = /^[a-z]:\\(.){0,300}$/i;	if (!this.object.length) {		var temp = this.object;		this.object = new Array();		this.object[0] = temp;	}	for (var i = 0; i < this.object.length; i++) {        if (this.type) {                        var extension = this.object[i].value;            if (extension != "" && !extension.match(re)) {            	messages.alert("JSM-1022");            	this.object[i].focus();        		return false;            }        }    }        if (this.nullCheck) {        var countInputName = "j_file_count";        if (this.type) {            countInputName += "_" + this.type;        }        var countInput = document.forms[0][countInputName];        if (!countInput || countInput.value < 1) {            messages.alert("JSM-1023", this.name);            return false;        }    }    if (this.allowedExtension) {        var passed = true;        for (var i = 0; i < this.object.length; i++) {            if (this.type) {                var spanNode = this.object[i].nextSibling;                if (!spanNode || spanNode.getElementsByTagName("input")[0].value != this.type) {                    continue;                }            }            var extension = this.object[i].value;            if (trimmed(extension).length == 0) {                continue;            }            var index = extension.lastIndexOf(".");            if (index == -1) {                passed = false;                break;            }            extension = extension.substring(index + 1).toLowerCase();            for(var j = 0; j < this.allowedExtension.length ; j++) {                if (this.allowedExtension[j].toLowerCase() == extension) {                    break;                }                if (j == this.allowedExtension.length - 1) {                    passed = false;                }            }        }        if (!passed) {            messages.alert("JSM-1024", [this.name, this.allowedExtension.join(", ")]);            return false;        }    }    if (this.disallowedExtension) {        var passed = true;        for (var i = 0; i < this.object.length; i++) {            if (this.type) {                var spanNode = this.object[i].nextSibling;                if (!spanNode || spanNode.getElementsByTagName("input")[0].value != this.type) {                    continue;                }            }            var extension = this.object[i].value;            if (trimmed(extension).length == 0) {                continue;            }            var index = extension.lastIndexOf(".");            if (index == -1) {                break;            }            extension = extension.substring(index + 1).toLowerCase();            for(var j = 0; j < this.disallowedExtension.length ; j++) {                if (this.disallowedExtension[j].toLowerCase() == extension) {                	passed = false;                    break;                }                if (j == this.disallowedExtension.length - 1) {                    passed = true;                }            }        }        if (!passed) {            messages.alert("JSM-1025", [this.name, this.disallowedExtension.join(", ")]);            return false;        }    }        return true;}/** *    Crontab Expression Å¸ÀÔ °ËÁõ¿¡ »ç¿ëµÈ´Ù. */function JCronExpression(name, object) {    /* Member Field */    this.name = name;    this.object = object;         this.nullCheck = true;    	this.re = new RegExp("^(((([0-9]|[0-5][0-9]),)*([0-9]|[0-5][0-9]))|(([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))|([\\?])|([\\*]))[\\s](((([0-9]|[0-5][0-9]),)*([0-9]|[0-5][0-9]))|(([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))|([\\?])|([\\*]))[\\s](((([0-9]|[0-1][0-9]|[2][0-3]),)*([0-9]|[0-1][0-9]|[2][0-3]))|(([0-9]|[0-1][0-9]|[2][0-3])(/|-)([0-9]|[0-1][0-9]|[2][0-3]))|([\\?])|([\\*]))[\\s](((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]),)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)|(([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(/|-)([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)|(L)|([\\?])|([\\*]))[\\s](((([1-9]|0[1-9]|1[0-2]),)*([1-9]|0[1-9]|1[0-2]))|(([1-9]|0[1-9]|1[0-2])(/|-)([1-9]|0[1-9]|1[0-2]))|(((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC),)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-|/)(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))|([\\?])|([\\*]))[\\s]((([1-7],)*([1-7]))|([1-7](/|-)([1-7]))|(((MON|TUE|WED|THU|FRI|SAT|SUN),)*(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)|((MON|TUE|WED|THU|FRI|SAT|SUN)(-|/)(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)|(([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))?(L)?)|([1-7]#([1-7])?)|([\\?])|([\\*]))([\\s]19[7-9][0-9]|20[0-9]{2})?$");               /* Member Method */    this.validate = jcron_validate;    this.nullable = jtext_nullable;    this.focus = jtext_focus;        return this;}function jcron_validate() {    var value = this.object.value;    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", this.name);        return this.focus();    }        if (!this.nullCheck && trimmed(value).length == 0) {        return true;    }            if (!this.re.test(value)) {    	messages.alert("JSM-1026", wa(this.name));    	return this.focus();    }        return true;}/** *  Textarea¿¡ NewLineÀ¸·Î ±¸ºÐµÈ Properties Å¸ÀÔ °ËÁõ¿¡ »ç¿ëµÈ´Ù. */function JProperties(name, object, requiredProps) {    /* Member Field */    this.name = name;    this.object = object;         this.nullCheck = true;        /* ÄÞ¸¶(,)·Î ±¸ºÐµÈ ÇÊ¼öÇÊµå¸í*/    this.requiredProps = requiredProps;   	this.re = new RegExp("^[_0-9a-zA-Z-\.]+=");        /* Member Method */    this.validate = jproperties_validate;    this.nullable = jtext_nullable;    this.focus = jtext_focus;        return this;}function jproperties_validate() {    var value = this.object.value;    var props = new Array();    if (this.nullCheck && trimmed(value).length == 0) {        messages.alert("JSM-1004", this.name);        return this.focus();    }        if (!this.requiredProps && !this.nullCheck && trimmed(value).length == 0) {        return true;    }        var lines = trimmed(value).split("\n");    for(var i=0; i < lines.length ; i++) {    	if (!this.re.test(lines[i])) {    		messages.alert("JSM-1027", [this.name, un(lines[i])]);    		return this.focus();    	} else {    		var idx = lines[i].indexOf("=");    		props[lines[i].substring(0,idx)] = lines[i].substring(idx+1,lines[i].length);    	}    }        if(this.requiredProps) {    	var rProps = this.requiredProps.split(",");    	for(var i=0; i<rProps.length ; i++) {    		if(!props[rProps[i]]) {        		messages.alert("JSM-1028", [this.name, ka(rProps[i])]);    			return this.focus();    		}    	}    }        return true;}/* ³»ºÎÇÔ¼ö (ÇÑ±Û Á¾¼ºÃ¼Å©) */function isJongsong(wd) {    var INDETERMINATE = 0;    var NOJONGSONG = 1;    var JONGSONG = 2;    word = new String(wd);                    /* ¼ýÀÚ°¡ µé¾î¿À´Â µî¿¡ ´ëºñÇØ ¹«Á¶°Ç ¹®ÀÚ¿­·Î ¹Ù²Þ */    numStr1 = "013678lmnLMN";                 /* 'Á¶' Àü±îÁö´Â 0ÀÌ ¹ÞÄ§ÀÌ ÀÖ´Â°É·Î ³ª¿È --; */    numStr2 = "2459aefhijkoqrsuvwxyzAEFHIJKOQRSUVWXYZ";    /* bdgptµéÀº ÀÐ±â¿¡ µû¶ó ¹ÞÄ§ÀÌ ÀÖ±âµµ ÇÏ°í ¾ø±âµµ ÇÑ´Ù°í ÆÇ´Ü. */    /* ´ë¹®ÀÚ´Â ´Üµ¶À¸·Î ÀÐÀ» ¶§¸¦ °¨¾ÈÇÏ¸é ¹ÞÄ§ ÀÖ´Ù°í È®Á¤µÇ´Â °ÍÀÌ ´õ ÀûÀ½. */        if (word == null || word.length < 1) {        return INDETERMINATE;    }        lastChar = word.charAt(word.length - 1);    lastCharCode = word.charCodeAt(word.length - 1);        if (numStr1.indexOf(lastChar) > -1) {        return JONGSONG;    }else if (numStr2.indexOf(lastChar) > -1) {        return NOJONGSONG;    }        if (lastCharCode<0xac00 || lastCharCode>0xda0c) {        return INDETERMINATE;    }    else{        lastjongseong = (lastCharCode - 0xAC00) % (21*28) % 28  ;                if (lastjongseong == 0){            return NOJONGSONG;        }else{            return JONGSONG;        }    }}/* ³»ºÎÇÔ¼ö (À»/¸¦) */function ul(s) {    var ul0 = new Array("(À»)¸¦", "¸¦", "À»");    return s + ul0[isJongsong(s)];}/* ³»ºÎÇÔ¼ö (ÀÌ/°¡) */function ka(s){    var ka0 = new Array("(ÀÌ)°¡", "°¡", "ÀÌ");    return s + ka0[isJongsong(s)];}/* ³»ºÎÇÔ¼ö (Àº/´Â) */function un(s){    var un0 = new Array("(Àº)´Â", "´Â", "Àº");    return s + un0[isJongsong(s)];}/* ³»ºÎÇÔ¼ö (¿Í/°ú) */function wa(s){    var arr = new Array("(¿Í)°ú", "¿Í", "°ú");    return s + arr[isJongsong(s)];}
