// ¹Ì¾ÏÈ£È­ ºÐ±â
function go_pass(sUrl, sTarget) {
    if (sTarget == null) {
        sTarget = "_self";
    }
    tempPassForm.target = sTarget;
    tempPassForm.action = sUrl;
    tempPassForm.submit();
}

// ¾ÏÈ£È­ ºÐ±â    
function go_tempPass(sUrl, sTarget) {
    if (sTarget == null) {
        sTarget = "_self";
    }
    tempPassForm.target = sTarget;
    tempPassForm.action = sUrl;
    go_encSubmit(tempPassForm);
}
    

//»õÃ¢ ¿©´Â ÇÔ¼ö
function uf_newWin( url, winName, sizeW, sizeH) 
{
    var nLeft  = screen.width/2 - sizeW/2 ;
    var nTop  = screen.height/2 - sizeH/2 ;

    opt = ",toolbar=no,menubar=no,location=no,scrollbars=yes,status=no";
    window.open(url, winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt );

}


//»õÃ¢ »çÀÌÁî Á¤ÇÔ 
function uf_reSize ( sizeW, sizeH) 
{
    window.resizeTo( sizeW, sizeH );

}

//¿É¼ÇÀÌ ÀÖ´Â°æ¿ì

function selDataChange(form) {
    var DataIndex=form.url.selectedIndex;
    if (form.url.options[DataIndex].value != null) {
        location=form.url.options[DataIndex].value;
    }
}

function selDataChange2(form) {
    var DataIndex=form.url2.selectedIndex;
    if (form.url2.options[DataIndex].value != null) {
        location=form.url2.options[DataIndex].value;
    }
}

/**
 * ÀÔ·Â°ªÀÌ NULLÀÎÁö Ã¼Å©
 */
function isNull(input) {
    if (input.value == null || input.value == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ ½ºÆäÀÌ½º ÀÌ¿ÜÀÇ ÀÇ¹ÌÀÖ´Â °ªÀÌ ÀÖ´ÂÁö Ã¼Å©
 * ex) if (isEmpty(form.keyword)) {
 *         alert("°Ë»öÁ¶°ÇÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
 *     }
 */
function isEmpty(input) {
    if (input.value == null || input.value.replace(/ /gi,"") == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ Æ¯Á¤ ¹®ÀÚ(chars)°¡ ÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¦ Çã¿ëÇÏÁö ¾ÊÀ¸·Á ÇÒ ¶§ »ç¿ë
 * ex) if (containsChars(form.name,"!,*&^%$#@~;")) {
 *         alert("ÀÌ¸§ ÇÊµå¿¡´Â Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 */
function containsChars(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) != -1)
           return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
 *     }
 */
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}
function isStartWith(input,chars) {
    for (var inx = 0; inx < chars.length; inx++) {
       if (chars.indexOf(input.value.charAt(0)) == -1)
           return false;
    }
    return true;
}
/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºªÀÎÁö Ã¼Å©
 * ¾Æ·¡ isAlphabet() ºÎÅÍ isNumComma()±îÁöÀÇ ¸Þ¼Òµå°¡
 * ÀÚÁÖ ¾²ÀÌ´Â °æ¿ì¿¡´Â var chars º¯¼ö¸¦ 
 * global º¯¼ö·Î ¼±¾ðÇÏ°í »ç¿ëÇÏµµ·Ï ÇÑ´Ù.
 * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 *     var lowercase = "abcdefghijklmnopqrstuvwxyz"; 
 *     var number    = "0123456789";
 *     function isAlphaNum(input) {
 *         var chars = uppercase + lowercase + number;
 *         return containsCharsOnly(input,chars);
 *     }
 */
function isAlphabet(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö Ã¼Å©
 */
function isUpperCase(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö Ã¼Å©
 */
function isLowerCase(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 */
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚ ¹× ¼ýÀÚÀÎÁö Ã¼Å©
 */
function isBigAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
    return containsCharsOnly(input,chars);
}
/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,´ë½Ã(-)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumDash(input) {
    var chars = "-0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumComma(input) {
    var chars = ",0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö Ã¼Å©
 * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶
 */
function isValidFormat(input,format) {
    if (input.value.search(format) != -1) {
        return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å©
 * ex) if (!isValidEmail(form.email)) {
 *         alert("¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
 *     }
 */
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return isValidFormat(input,format);
}

/**
 * ÀÔ·Â°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼Å©
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}

/**
 * ÀÔ·Â°ªÀÇ ¹ÙÀÌÆ® ±æÀÌ¸¦ ¸®ÅÏ
 * ex) if (getByteLength(form.title) > 100) {
 *         alert("Á¦¸ñÀº ÇÑ±Û 50ÀÚ(¿µ¹® 100ÀÚ) ÀÌ»ó ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 */
function getByteLength(input) {
    var byteLength = 0;
    for (var inx = 0; inx < input.value.length; inx++) {
        var oneChar = escape(input.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}

/**
 * ÀÔ·Â°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù.
 */
function removeComma(input) {
    return input.value.replace(/,/gi,"");
}

/**
 * ÀÔ·Â°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù.(Value)
 */
function removeCommaVal(Val) {
    return Val.replace(/,/gi,"");
}

/**
 * ¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÌ ÀÖ´ÂÁö Ã¼Å©
 */
function hasCheckedRadio(input) {
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) return true;
        }
    } else {
        if (input.checked) return true;
    }
    return false;
}

/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function hasCheckedBox(input) {
    return hasCheckedRadio(input);
}


/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡  ¸î°³ÀÎÁö  ±× °³¼ö¸¦ ¹ÝÈ¯
 */
function hasMultiCheckedRadio(input) {
var kkkk = 0;
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) {
            kkkk++;
            }
        }
    } else {
         if (input.checked) kkkk=1;
    }
    return kkkk;
}

/**
 * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ¿ù(êÅ)ÀÎÁö Ã¼Å©
 */
function isValidMonth(mm) {
    var m = parseInt(mm,10);
    return (m >= 1 && m <= 12);
}

/**
 * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ÀÏ(ìí)ÀÎÁö Ã¼Å©
 */
function isValidDay(yyyy, mm, dd) {
    var m = parseInt(mm,10) - 1;
    var d = parseInt(dd,10);

    var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    if ((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0) {
        end[1] = 29;
    }

    return (d >= 1 && d <= end[m]);
}


/**
 * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ½Ã(ãÁ)ÀÎÁö Ã¼Å©
 */
function isValidHour(hh) {
    var h = parseInt(hh,10);
    return (h >= 1 && h <= 24);
}

/**
 * À¯È¿ÇÑ(Á¸ÀçÇÏ´Â) ºÐ(ÝÂ)ÀÎÁö Ã¼Å©
 */
function isValidMin(mi) {
    var m = parseInt(mi,10);
    return (m >= 1 && m <= 60);
}

/**
 * Time Çü½ÄÀÎÁö Ã¼Å©(´À½¼ÇÑ Ã¼Å©)
 */
function isValidTimeFormat(time) {
    return (!isNaN(time) && time.length == 12);
}

/**
 * À¯È¿ÇÏ´Â(Á¸ÀçÇÏ´Â) Time ÀÎÁö Ã¼Å©
 * ex) var time = form.time.value; //'200102310000'
 *     if (!isValidTime(time)) {
 *         alert("¿Ã¹Ù¸¥ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù.");
 *     }
 */
function isValidTime(time) {
    var year  = time.substring(0,4);
    var month = time.substring(4,6);
    var day   = time.substring(6,8);
    var hour  = time.substring(8,10);
    var min   = time.substring(10,12);

    if (parseInt(year,10) >= 1900  && isValidMonth(month) &&
        isValidDay(year,month,day) && isValidHour(hour)   &&
        isValidMin(min)) {
        return true;
    }
    return false;
}

/**
 * Time ½ºÆ®¸µÀ» ÀÚ¹Ù½ºÅ©¸³Æ® Date °´Ã¼·Î º¯È¯
 * parameter time: Time Çü½ÄÀÇ String
 */
function toTimeObject(time) { //parseTime(time)
    var year  = time.substr(0,4);
    var month = time.substr(4,2) - 1; // 1¿ù=0,12¿ù=11
    var day   = time.substr(6,2);
    var hour  = time.substr(8,2);
    var min   = time.substr(10,2);

    return new Date(year,month,day,hour,min);
}

/**
 * ÀÚ¹Ù½ºÅ©¸³Æ® Date °´Ã¼¸¦ Time ½ºÆ®¸µÀ¸·Î º¯È¯
 * parameter date: JavaScript Date Object
 */
function toTimeString(date) { //formatTime(date)
    var year  = date.getFullYear();
    var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
    var day   = date.getDate();
    var hour  = date.getHours();
    var min   = date.getMinutes();

    if (("" + month).length == 1) { month = "0" + month; }
    if (("" + day).length   == 1) { day   = "0" + day;   }
    if (("" + hour).length  == 1) { hour  = "0" + hour;  }
    if (("" + min).length   == 1) { min   = "0" + min;   }

    return ("" + year + month + day + hour + min)
}

/**
 * TimeÀÌ ÇöÀç½Ã°¢ ÀÌÈÄ(¹Ì·¡)ÀÎÁö Ã¼Å©
 */
function isFutureTime(time) {
    return (toTimeObject(time) > new Date());
}

/**
 * TimeÀÌ ÇöÀç½Ã°¢ ÀÌÀü(°ú°Å)ÀÎÁö Ã¼Å©
 */
function isPastTime(time) {
    return (toTimeObject(time) < new Date());
}

/**
 * ÁÖ¾îÁø Time °ú y³â m¿ù dÀÏ h½Ã Â÷ÀÌ³ª´Â TimeÀ» ¸®ÅÏ
 * ex) var time = form.time.value; //'20000101000'
 *     alert(shiftTime(time,0,0,-100,0));
 *     => 2000/01/01 00:00 À¸·ÎºÎÅÍ 100ÀÏ Àü Time
 */
function shiftTime(time,y,m,d,h) { //moveTime(time,y,m,d,h)
    var date = toTimeObject(time);

    date.setFullYear(date.getFullYear() + y); //y³âÀ» ´õÇÔ
    date.setMonth(date.getMonth() + m);       //m¿ùÀ» ´õÇÔ
    date.setDate(date.getDate() + d);         //dÀÏÀ» ´õÇÔ
    date.setHours(date.getHours() + h);       //h½Ã¸¦ ´õÇÔ

    return toTimeString(date);
}

/**
 * µÎ TimeÀÌ ¸î °³¿ù Â÷ÀÌ³ª´ÂÁö ±¸ÇÔ
 * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-)
 */
function getMonthInterval(time1,time2) { //measureMonthInterval(time1,time2)
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);

    var years  = date2.getFullYear() - date1.getFullYear();
    var months = date2.getMonth() - date1.getMonth();
    var days   = date2.getDate() - date1.getDate();

    return (years * 12 + months + (days >= 0 ? 0 : -1) );
}

/**
 * µÎ TimeÀÌ ¸çÄ¥ Â÷ÀÌ³ª´ÂÁö ±¸ÇÔ
 * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-)
 */
function getDayInterval(time1,time2) {
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);
    var day   = 1000 * 3600 * 24; //24½Ã°£

    return parseInt((date2 - date1) / day, 10);
}

/**
 * µÎ TimeÀÌ ¸î ½Ã°£ Â÷ÀÌ³ª´ÂÁö ±¸ÇÔ
 * time1ÀÌ time2º¸´Ù Å©¸é(¹Ì·¡¸é) minus(-)
 */
function getHourInterval(time1,time2) {
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);
    var hour  = 1000 * 3600; //1½Ã°£

    return parseInt((date2 - date1) / hour, 10);
}

/**
 * ÇöÀç ½Ã°¢À» Time Çü½ÄÀ¸·Î ¸®ÅÏ
 */
function getCurrentTime() {
    return toTimeString(new Date());
}

/**
 * ÇöÀç ½Ã°¢°ú y³â m¿ù dÀÏ h½Ã Â÷ÀÌ³ª´Â TimeÀ» ¸®ÅÏ
 */
function getRelativeTime(y,m,d,h) {

    return shiftTime(getCurrentTime(),y,m,d,h);
}

/**
 * ÇöÀç Ò´À» YYYYÇü½ÄÀ¸·Î ¸®ÅÏ
 */
function getYear() {
    
    return getCurrentTime().substr(0,4);
}

/**
 * ÇöÀç êÅÀ» MMÇü½ÄÀ¸·Î ¸®ÅÏ
 */
function getMonth() {
    
    return getCurrentTime().substr(4,2);
}

/**
 * ÇöÀç ìíÀ» DDÇü½ÄÀ¸·Î ¸®ÅÏ
 */
function getDay() {
    
    return getCurrentTime().substr(6,2);
}

/**
 * ÇöÀç ãÁ¸¦ HHÇü½ÄÀ¸·Î ¸®ÅÏ
 */
function getHour() {
    
    return getCurrentTime().substr(8,2);
}

/**
 * ¿À´ÃÀÌ ¹«½¼ ¿äÀÏÀÌ¾ß?
 * ex) alert('¿À´ÃÀº ' + getDayOfWeek() + '¿äÀÏÀÔ´Ï´Ù.');
 */
function getDayOfWeek() {
    var now = new Date();
    
    var day = now.getDay(); //ÀÏ¿äÀÏ=0,¿ù¿äÀÏ=1,...,Åä¿äÀÏ=6
    var week = new Array('ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä');

    return week[day];
}


/**
 * Æ¯Á¤³¯Â¥ÀÇ ¿äÀÏÀ» ±¸ÇÑ´Ù.
 */
function getDayOfWeek(time) {
    var now = toTimeObject(time);
    
    var day = now.getDay(); //ÀÏ¿äÀÏ=0,¿ù¿äÀÏ=1,...,Åä¿äÀÏ=6
    var week = new Array('ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä');

    return week[day];
}



/**
*   ¹®ÀÚ¿­ÀÇ ¿À¸¥ÂÊ ³¡¿¡¼­ ºÎÅÍ ÁöÁ¤µÈ °³¼ö¸¸Å­ÀÇ ¹®ÀÚµéÀ» ¸®ÅÏÇÑ´Ù.
*/

function substrInverse(str, num)
{
    var len;
    
    len = str.length;
    
    return str.substr(len - num, num);
}

/**
*  ¹®ÀÚ¿­·ÎÀÇ Æ¯Á¤À§Ä¡·ÎºÎÅÍ ÁöÁ¤µÈ °³¼öÀÇ ¹®ÀÚµéÀ» ¸®ÅÏÇÑ´Ù.
*/
function substrMid(str, idx, num)
{
    return str.substr( idx-1, num);
}


/**
* Cookie¼³Á¤ÇÏ±â ==> js/common/cookie.js »ç¿ëÇÒ°Í
*/

function setCookie(name, value, expire) {
          document.cookie = name + "=" + escape(value)
          + ( (expire) ? "; expires=" + expire.toGMTString() : "")
}
 
/**
* Cookie ±¸ÇÏ±â ==> js/common/cookie.js »ç¿ëÇÒ°Í
*/


function getCookie(uName) {

    var flag = document.cookie.indexOf(uName+'=');
    if (flag != -1) { 
        flag += uName.length + 1
        end = document.cookie.indexOf(';', flag) 

        if (end == -1) end = document.cookie.length
        return unescape(document.cookie.substring(flag, end))
    }
} 

/**
* ¹Ý°¢À» ÀüÀÛÀ¸·Î ¹Ù²Ù±â
*/
function Half2Full(HalfVal) 
{
    var arg;
    arg = myHalf2Full(HalfVal);
    return arg;
}

function myHalf2Full(HalfVal) 
{
    var FullChar = [
        "¡¡","£¡","£¢","££","£¤","£¥","£¦","£§","£¨",           //33~
        "£©","£ª","£«","£¬","£­","£®","£¯","£°","£±","£²",      //41~
        "£³","£´","£µ","£¶","£·","£¸","£¹","£º","£»","£¼",      //51~
        "£½","£¾","£¿","£À","£Á","£Â","£Ã","£Ä","£Å","£Æ",      //61~
        "£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î","£Ï","£Ð",      //71~
        "£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø","£Ù","£Ú",      //81~
        "£Û","£Ü","£Ý","£Þ","£ß","£à","£Á","£Â","£Ã","£Ä",      //91~
        "£Å","£Æ","£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î",      //101~
        "£Ï","£Ð","£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø",      //111~
        "£Ù","£Ú","£û","£ü","£ý","¢¦"                           //121~
        ];
    var stFinal = "";
    var ascii;
    for( i = 0; i < HalfVal.length; i++) 
    {
        ascii = HalfVal.charCodeAt(i);
        if( (31 < ascii && ascii < 128))
        {
          stFinal += FullChar[ascii-32];
        }
        else
        {
          stFinal += HalfVal.charAt(i);
        }
    }
    return stFinal;
}

function frmMoney(input) {
    input.value = putComma(input);
}

function unFrmMoney(input) {
    input.value = replace(input.value,",","");
}

function frmDate(input) {
    if(input.value=="") return 
    input.value = input.value.substring(0,4) + "-" + input.value.substring(4,6) + "-" + input.value.substring(6,8);
}

function unFrmDate(input) {
    input.value = replace(input.value,"-","");
}

function frmTime(input) {
    input.value = input.value.substring(0,2) + ":" + input.value.substring(2,4) + ":" + input.value.substring(4,6);
}

function unFrmTime(input) {
    input.value = replace(input.value,":","");
}

function frmAcct(input) {
    input.value = input.value.substring(0,3) + "-" + input.value.substring(3,9) + "-" + input.value.substring(9,14);
}

function frmAcctFormat(input) {
	
    if(input.length == 10) {
        return input.substring(0,1) + "-" + input.substring(1,4) + "-" + input.substring(4,10);
    } else if(input.length == 11) {
        return input.substring(0,3) + "-" + input.substring(3,8) + "-" + input.substring(8,11);
    } else if(input.length == 12) {
        return input.substring(0,3) + "-" + input.substring(3,9) + "-" + input.substring(9,12);
    } else if(input.length == 13) {
        return input.substring(0,3) + "-" + input.substring(3,9) + "-" + input.substring(9,11) + "-" + input.substring(11,13);
    } else {
        return input;
    }    
}

function unFrmAcct(input) {
    input.value = replace(input.value,"-","");
}

function setSelect(input,str) {
    for(i=0;i<input.options.length;i++) {
        if(input.options[i].value == str)
            input.options[i].selected=true;
    }
}

// ¿ÜÈ¯¿¡¼­ Æ¯Á¤ ÅëÈ­ÀÏ¶§ ¼Ò¼öÁ¡ÀÌÇÏ ±Ý¾×¾ø¾Ö±â 
function Curr(str1, str2) {
    obj1 = eval("frm."+str1+".value")
    obj2 = eval("frm."+str2+".style")
    if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW") {
        obj2.display = "none"
    } else {
        obj2.display = ""
    }
}

function Curr2(str1, str2, str3) {
    obj1 = eval("frm."+str1+".value")
    obj2 = eval("frm."+str2+".style")
    obj3 = eval("frm."+str3+".style")
    if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW") {
        obj2.display = "none"
        obj3.display = "none"
    } else {
        obj2.display = ""
        obj3.display = ""
    }
}

/*
* ÇÑ¹ÌÀºÇà °í°´¹øÈ£ ¼¼ÆÃ(9ÀÚ¸®)
* ¾Õ¿¡ '0'À» Ã¤¿î´Ù
* 
**/
function fill_cifno(obj) {
    var temp="";
    if(obj.value == null || obj.value.length < 1 ) {
        alert("°í°´¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
        obj.focus();
        return false;
    }
    if(obj.value.length != 9 ) {
        for(i=0;i<(9-obj.value.length);i++) {
            temp +="0";
        }
        obj.value = temp+obj.value;
    } else {
        obj.value = obj.value;
    } 
    return true;
}

// »õ·Î°íÄ§ ¹æÁö            
function history_go(backCnt) {
    if(window.opener != null) {
        opener.top.tempframe.location = "/catiE/common/msg/removeTempSession.jsp";
    } else {
        top.tempframe.location = "/catiE/common/msg/removeTempSession.jsp";
    }
    history.go(backCnt);
}

////////////////////////////////////////////////////////////////
// µ¥ÀÌÅÍ Àü¼ÛÇüÅÂ °ü·Ã
////////////////////////////////////////////////////////////////

/////////////////////////////////
//±×¸®µå¿¡¼­ Å°°ªµéÁß¿¡ ÇØ´ç name ÀÇ value À» °¡Á®¿Â´Ù.
//¿¹)alert("[" + getKeyValue(document.Main, "¼±ÅÃ", "hidden_appl_type") + "]");
//
function getKeyValue(obj, field, key) {    
    var idx = -1;
	obj.setMoveFirstRecord();
	while((idx = obj.getNextSelectedRecord(field)) > -1)
	{
	    var sSearch = obj.getCell(idx,"Å°°ª")
	    if (sSearch.length > 0) {
            var asKeyValues = sSearch.split('&');
            var asKeyValue  = '';
            for (var i = 0; i < asKeyValues.length; i++) {
                
                asKeyValue = asKeyValues[i].split('=');
                var e = document.createElement("input");
                if(asKeyValue[0] == key) {
                    return asKeyValue[1];
                }
            }
        }
	}
}

/////////////////////////////////
//±×¸®µå¿¡¼­ index Å°°ªµéÁß¿¡ ÇØ´ç name ÀÇ value À» °¡Á®¿Â´Ù.
//¿¹)alert("[" + getKeyValueByIndex(document.Main, 1, "hidden_appl_type") + "]");
//
function getKeyValueByIndex(obj, idx, key) {    
    var sSearch = obj.getCell(idx,"Å°°ª")
	if (sSearch.length > 0) {
        var asKeyValues = sSearch.split('&');
        var asKeyValue  = '';
        for (var i = 0; i < asKeyValues.length; i++) {
            asKeyValue = asKeyValues[i].split('=');
            if(asKeyValue[0] == key) {
                return asKeyValue[1];
            }
        }
    }
}

// get ¹æ½ÄÀÇ ÆÄ¶ó¹ÌÅÍ¸¦ ÇØ´çÆû¿¡ input hidden °´Ã¼·Î »ý¼ºÇÑ´Ù.
function get2post(frm,sSearch) {    
    if (sSearch.length > 0) {
        var asKeyValues = sSearch.split('&');
        var asKeyValue  = '';
        for (var i = 0; i < asKeyValues.length; i++) {
            
            asKeyValue = asKeyValues[i].split('=');
            var e = document.createElement("input");
            e.setAttribute("type","hidden");
            e.setAttribute("name",asKeyValue[0]);
            e.setAttribute("value",asKeyValue[1]);
            e.setAttribute("_temp","true");
            
//            alert("[" + e.name +"]:[" + e.value +"]");
            
            frm.appendChild(e);
        }
     }    
//     alert("form °´Ã¼ °¹¼ö" + frm.elements.length);
}         

// get2post·Î »ý¼ºÇÑ ÀÓ½Ã °´Ã¼¸¦ ÆÄ±«ÇÑ´Ù.        
function removeTempAttribute(frm){    
    var idx=0;
    while (idx<frm.elements.length) {
        var obj = frm.elements[idx];
        if( obj.getAttribute("_temp") != null && obj.getAttribute("_temp") == "true"){
            frm.removeChild(obj);
            continue;
        }
        idx++;
    }
}         

////////////////////////////////////////////////////////////////
// checkbox °ü·Ã
////////////////////////////////////////////////////////////////

// check ÇÑ °³¼ö¸¦ ¸®ÅÏÇÑ´Ù.
function getCheckedCount( aElem ) {
    
    var elem = document.all;
    var cnt = 0;
    
    for ( var i=0; i<document.all.length; i++ ) {
        if ( ( elem[i].type == "checkbox" ) && ( elem[i].checked ) && ( elem[i].name == aElem ) )    cnt = cnt + 1;
    }
    
    return cnt;
}

// ÁöÁ¤ÇÑ ÀÌ¸§À» °¡Áø ¸ðµç checkbox¸¦ check ÇÑ´Ù.
function checkAll( aElem ) {
    
    var elem = document.all;
    var cnt = 0;
    
    for ( var i=0; i<document.all.length; i++ ) {
        if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) )    elem[i].checked = true;
    }
}

// ÁöÁ¤ÇÑ ÀÌ¸§À» °¡Áø ¸ðµç checkboxÀÇ checked °ªÀ» ¹ÝÀü ÇÑ´Ù. 
function invertCheck( aElem ) {
    
    var elem = document.all;
    var cnt = 0;
    
    for ( var i=0; i<document.all.length; i++ ) {
        if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) )    {
            if ( elem[i].checked ) {
                elem[i].checked = false;
            }
            else{
                elem[i].checked = true;
            }
        }
    }
}            

////////////////////////////////
// UTIL ÇÔ¼ö
////////////////////////////////
var isDivEvent = false;

function hideOneNav() {
    if (!isDivEvent) {
        window.account.style.visibility='hidden';
    } else {
        isDivEvent = false;
    }
}

function showOneNav(obj) {
    isDivEvent = true;
    window.account.style.left = getLeftPos(obj);
    window.account.style.top = getTopPos(obj) + obj.offsetHeight - 8;
    window.account.style.visibility='visible';
    return false;
}

function getLeftPos(obj) {
    var parentObj = null;
    var clientObj = obj;
    var left = obj.offsetLeft + document.body.clientLeft;
    while((parentObj=clientObj.offsetParent) != null) {
        left = left + parentObj.offsetLeft;
        clientObj = parentObj;
    }
    return left;
}

function getTopPos(obj) {
    var parentObj = null;
    var clientObj = obj;
    var top = obj.offsetTop + document.body.clientTop;
    
    while((parentObj=clientObj.offsetParent) != null) {
        top = top + parentObj.offsetTop;
        clientObj = parentObj;
    }
    return top;
}

/**
*  ¹®ÀÚ¿­¿¡ ÀÖ´Â Æ¯Á¤¹®ÀÚÆÐÅÏÀ» ´Ù¸¥ ¹®ÀÚÆÐÅÏÀ¸·Î ¹Ù²Ù´Â ÇÔ¼ö.
*/
function replace(targetStr, searchStr, replaceStr) {
    var len, i, tmpstr;
    len = targetStr.length;
    tmpstr = "";
    for ( i = 0 ; i < len ; i++ ) {
        if ( targetStr.charAt(i) != searchStr ) {
            tmpstr = tmpstr + targetStr.charAt(i);
        } else {
            tmpstr = tmpstr + replaceStr;
        }
    }
    return tmpstr;
}

/**
*  ¹®ÀÚ¿­¿¡¼­ ÁÂ¿ì °ø¹éÁ¦°Å
*/
function trim(str) {
    return replace(str," ","");
}

/**
*    ÄÞ¸¶¼³Á¤.
*/
function putComma(input) { 
    var num = input;
    
    if (num < 0) { 
        num *= -1; 
        var minus = true
    } else {
        var minus = false
    }
    
    var dotPos = (num+"").split(".")
    var dotU = dotPos[0]
    var dotD = dotPos[1]
    var commaFlag = dotU.length%3

    if(commaFlag) {
        var out = dotU.substring(0, commaFlag) 
        if (dotU.length > 3) out += ","
    }
    else var out = ""

    for (var i=commaFlag; i < dotU.length; i+=3) {
        out += dotU.substring(i, i+3) 
        if( i < dotU.length-3) out += ","
    }

    if(minus) out = "-" + out
    if(dotD) return out + "." + dotD
    else return out 
}

//¿ùÀÇ ³¡ ÀÏÀÚ ¾ò±â
function getEndDate(datestr) {
    
    //³ÎÀÎÁö?    
    if(isEmpty(datestr)) {
        return null;
    } 
    
    //¼ýÀÚÀÎÁö?
    if(!isNum(datestr)) {
        return null;
    }
     
    //±æÀÌ°¡ 8ÀÚ¸®?
    if(datestr.length != 6) {
        return null;
    }
    
    var yy = Number(datestr.substring(0,4));
    var mm = Number(datestr.substring(4,6));
    
    //À±³â °ËÁõ
    var boundDay = "";

    if(mm != 2) {
        var mon=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
        boundDay = mon[mm-1];
    } else {
        if (yy%4 == 0 && yy%100 != 0 || yy%400 == 0) {
            boundDay = 29;
        } else {
            boundDay = 28;
        }
    }
    
    return boundDay;        
}

// Left ºóÀÚ¸® ¸¸Å­ padStr À» ºÙÀÎ´Ù.
function lpad(src, len, padStr) {
    var retStr = "";
    var padCnt = Number(len) - String(src).length;
    for(var i=0;i<padCnt;i++) retStr += String(padStr);
    return retStr+src;
}

// Right ºóÀÚ¸® ¸¸Å­ padStr À» ºÙÀÎ´Ù.
function rpad(src, len, padStr) {
    var retStr = "";
    var padCnt = Number(len) - String(src).length;
    for(var i=0;i<padCnt;i++) retStr += String(padStr);
    return src+retStr;
}

// ÀüÈ­¹øÈ£ ±¹¹ø°ËÁõ
function isValidDDDPhoneNum(dddphonenum) {

    // ³ÎÀÎ°¡?
    if (isEmpty(dddphonenum)) {
        return null;
    }
            
    if ( dddphonenum != "02"  && dddphonenum != "031" && dddphonenum != "032" && dddphonenum != "033" && dddphonenum != "041" &&
         dddphonenum != "042" && dddphonenum != "043" && dddphonenum != "051" && dddphonenum != "052" && dddphonenum != "053" &&
         dddphonenum != "054" && dddphonenum != "055" && dddphonenum != "061" && dddphonenum != "062" && dddphonenum != "063" &&
         dddphonenum != "064" && dddphonenum != "011" && dddphonenum != "016" && dddphonenum != "017" && dddphonenum != "018" && dddphonenum != "019" )
    {
        ERR_MSG = "Àß¸øµÈ ÀüÈ­¹øÈ£ ±¹¹øÀÔ´Ï´Ù.";
        return false;
    }
    
    return true;
}

// ´ë¹®ÀÚº¯È¯
function toUpperCase(str) {   
    if(isEmpty(str)) return str;
    return str.toUpperCase();
}

function toUpperCase1(str) {   
    if(isEmpty(str)) return str;
    return str.toUpperCase();
}

// ¼ýÀÚ°ËÁõ
function isNum(str) {    
    if(isEmpty(str)) return false;
    for(var idx=0;idx < str.length;idx++) {
        if(str.charAt(idx) < '0' || str.charAt(idx) > '9') {
            return false;
        }
    }
    return true;
}

// ¿µ¹®ÀÚ°ËÁõ
function isAlpha(str) {
    
    if(isEmpty(str)) return false;
    
    for(var idx=0;idx < str.length;idx++) {
        if(!((str.charAt(idx) >='a' && str <= 'z') || (str.charAt(idx) >= 'A' && str <= 'Z'))) {
            return false;
        }
    }
    return true;
}


// ÇÑ±Û°ËÁõ
function isHangul(str) {
    
    if(isEmpty(str)) return false;
    
    for(var idx=0;idx < str.length;idx++) {
      var c = escape(str.charAt(idx));
      if ( c.indexOf("%u") == -1 ) {
            return false;
        }
    }
    return true;        
}    


// ½ÇÁ¦±æÀÌ ¹ÝÈ¯( ÇÑ±Û 2byte °è»ê )    
function getByteLength(s) {
    
   var len = 0;
   if ( s == null ) return 0;
   for(var i=0;i<s.length;i++) {
      var c = escape(s.charAt(i));
      if ( c.length == 1 ) len ++;
      else if ( c.indexOf("%u") != -1 ) len += 2;
      else if ( c.indexOf("%") != -1 ) len += c.length/3;
   }
   return len;
}

// ºó°ªÀÎÁö ¸®ÅÏÇÑ´Ù.
function isEmpty(pValue){
    
    if( (pValue == "") || (pValue == null) ){
        return true;
    }
    return false;
}

//°Ë»ö³¯Â¥ À¯È¿±â°£ 
function getBoundDate1(yy,mm,dd,stdDate)
{
    var nCurYY = Number(stdDate.substring(0,4));
    var nCurMM = Number(stdDate.substring(4,6));
    var nCurDD = Number(stdDate.substring(6));
    
    var nCurEndDate = Number(lpad(getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0')),2,'0'));
    
    if(yy==0 && mm==0 && dd==0){
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0')); 
    }
    
    if (yy>0 && mm>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }
    if (mm>0 && dd>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }
    if (yy>0 && dd>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }

    var nPmm = -mm;
    var nPdd = -dd;
    
    var sYear    ="";
    var sMonth    ="";
    var sDate    ="";
    
    if (mm > 0) {
        
        if(nCurDD == 1) {
            mm--;
        }
        
        for (var idx=0; idx<mm; idx++) {
            nCurMM++;
            if (nCurMM == 13) {
                nCurYY++;
                nCurMM = 1;
            }
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        
        if(nCurDD == 1) {
            return (sYear + sMonth + lpad(getEndDate(sYear + sMonth),2,'0'));
        }
        
        var nEndDate = getEndDate(sYear + sMonth);
        if (nCurDD > nEndDate) {
            return (sYear + sMonth + lpad(nEndDate,2,0));
        }
        else{
            return (sYear + sMonth + lpad(nCurDD-1,2,0));
        }
    }

    if (mm < 0) {
        for (var idx=0; idx<nPmm; idx++) {
            nCurMM--;
            if (nCurMM == 0) {
                nCurYY--;
                nCurMM = 12;
            }
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        var nPrevDate = nCurDD+1;
        
        var nEndDate = getEndDate(sYear + sMonth);
        
        if(nEndDate <= nCurDD) {
            nCurMM++;
            if (nCurMM == 13) {
                nCurYY++;
                nCurMM = 1;
            }
            sYear     = new String(nCurYY);
            sMonth    = new String(lpad(nCurMM,2,'0'));
            return (sYear + sMonth + "01");
        }
        
        sYear     = new String(nCurYY);
        sMonth    = lpad(nCurMM,2,'0');
        return (sYear + sMonth + lpad(nCurDD+1,2,'0'));
    }
    
    if (dd > 0) {
        for (var idx=0; idx<dd; idx++) {
            nCurDD++;
            var nEndDate = Number(lpad(getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0')),2,'0'));
            if (nCurDD > nEndDate) {
                nCurMM++;
                nCurDD = 1;
                if (nCurMM > 12) {
                    nCurYY++;
                    nCurMM = 1;
                }
            }
        }
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0'));
    }
    
    if (dd < 0) {
        for (var idx=0; idx<nPdd; idx++) {
            nCurDD--;
            if (nCurDD < 1) {
                nCurMM--;
                nCurDD = getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0'));
                if (nCurMM < 1) {
                    nCurYY--;
                    nCurMM = 12;
                    nCurDD = getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0'));
                }
            }
        }
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0'));
    }                    
}            

function getBoundDate(yy,mm,dd) {
    var nCurYY = datToday.getFullYear();
    var nCurMM = datToday.getMonth()+1;
    var nCurDD = datToday.getDate();
    var nCurEndDate = Number(lpad(getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0')),2,'0'));
    
    if(yy==0 && mm==0 && dd==0) {
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0')); 
    }
    
    if (yy>0 && mm>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }
    if (mm>0 && dd>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }
    if (yy>0 && dd>0) { alert("°°ÀÌ »ç¿ë ºÒ°¡"); }
    
    var nPyy = -yy;
    var nPmm = -mm;
    var nPdd = -dd;
    
    var sYear    ="";
    var sMonth    ="";
    var sDate    ="";
    
    if (yy > 0) {
        for (var idx=0; idx<yy; idx++) {
            nCurYY++;            
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        
        if(nCurDD == 1) {
            return (sYear + sMonth + lpad(getEndDate(sYear + sMonth),2,'0'));
        }
        
        var nEndDate = getEndDate(sYear + sMonth);
        if (nCurDD > nEndDate) {
            return (sYear + sMonth + lpad(nEndDate,2,0));
        }
        else{
            return (sYear + sMonth + lpad(nCurDD-1,2,0));
        }
    }
    
    if (yy < 0) {
        for (var idx=0; idx<nPyy; idx++) {
            nCurYY--;
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        var nPrevDate = nCurDD+1;
        
        var nEndDate = getEndDate(sYear + sMonth);
        
        if(nEndDate <= nCurDD) {
            nCurMM++;
            if (nCurMM == 13) {
                nCurYY++;
                nCurMM = 1;
            }
            sYear     = new String(nCurYY);
            sMonth    = new String(lpad(nCurMM,2,'0'));
            return (sYear + sMonth + "01");
        }
        
        sYear     = new String(nCurYY);
        sMonth    = lpad(nCurMM,2,'0');
        return (sYear + sMonth + lpad(nCurDD+1,2,'0'));
    }
    
    if (mm > 0) {
        
        if(nCurDD == 1) {
            mm--;
        }
        
        for (var idx=0; idx<mm; idx++) {
            nCurMM++;
            if (nCurMM == 13) {
                nCurYY++;
                nCurMM = 1;
            }
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        
        if(nCurDD == 1) {
            return (sYear + sMonth + lpad(getEndDate(sYear + sMonth),2,'0'));
        }
        
        var nEndDate = getEndDate(sYear + sMonth);
        if (nCurDD > nEndDate) {
            return (sYear + sMonth + lpad(nEndDate,2,0));
        }
        else{
            return (sYear + sMonth + lpad(nCurDD-1,2,0));
        }
    }

    if (mm < 0) {
        for (var idx=0; idx<nPmm; idx++) {
            nCurMM--;
            if (nCurMM == 0) {
                nCurYY--;
                nCurMM = 12;
            }
        }
        
        sYear     = new String(nCurYY);
        sMonth    = new String(lpad(nCurMM,2,'0'));
        var nPrevDate = nCurDD+1;
        
        var nEndDate = getEndDate(sYear + sMonth);
        
        if(nEndDate <= nCurDD) {
            nCurMM++;
            if (nCurMM == 13) {
                nCurYY++;
                nCurMM = 1;
            }
            sYear     = new String(nCurYY);
            sMonth    = new String(lpad(nCurMM,2,'0'));
            return (sYear + sMonth + "01");
        }
        
        sYear     = new String(nCurYY);
        sMonth    = lpad(nCurMM,2,'0');
        return (sYear + sMonth + lpad(nCurDD+1,2,'0'));
    }
    
    if (dd > 0) {
        for (var idx=0; idx<dd; idx++){
            nCurDD++;
            var nEndDate = Number(lpad(getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0')),2,'0'));
            if (nCurDD > nEndDate) {
                nCurMM++;
                nCurDD = 1;
                if (nCurMM > 12) {
                    nCurYY++;
                    nCurMM = 1;
                }
            }
        }
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0'));
    }
    
    if (dd < 0) {
        for (var idx=0; idx<nPdd; idx++){
            nCurDD--;
            if (nCurDD < 1) {
                nCurMM--;
                nCurDD = getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0'));                                
                if (nCurMM < 1) {
                    nCurYY--;
                    nCurMM = 12;
                    nCurDD = getEndDate( new String(nCurYY) + lpad(nCurMM,2,'0'));
                }
            }
        }
        return (new String(nCurYY) + lpad(nCurMM,2,'0') + lpad(nCurDD,2,'0'));
    }                    
}            

//°Ë»ö³¯Â¥ Ã¼Å© 
function isVaildTerm(obj,yy,mm,dd) {

    var datestr = obj.value;
    
    //³ÎÀÎÁö?    
    if(isEmpty(datestr)) {
        return null;
    }
    
    // ³¯Â¥ Æ÷¸ËÁ¦°Å
    obj_removeformat(obj);
    
    //8ÀÚ¸®ÀÎÁö?
    if (getByteLength(datestr) != 8) {
        alert("³¯Â¥´Â '-'¸¦ Á¦¿ÜÇÑ 8ÀÚ¸® ¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");
        return false;
        
    }

    // yy,mm,dd,fromto°¡ ¾øÀ» °æ¿ì
    if (yy == null) yy = 0;
    if (mm == null) mm = 0;
    if (dd == null) dd = 0;
    
    // °Ë»ö³¯Â¥ À¯È¿±â°£ °¡Á®¿À±â
    var boundDate = getBoundDate(yy,mm,dd);
    
    if (yy < 0  || mm < 0  || dd < 0) {
        if ( boundDate > datestr) {
            alert("À¯È¿ÇÏÁö ¾ÊÀº °Ë»ö³¯Â¥ÀÔ´Ï´Ù.\nÀ¯È¿ÇÑ ³¯Â¥´Â" + boundDate.substring(0,4) + "³â " + boundDate.substring(4,6) + "¿ù " + boundDate.substring(6) + "ÀÏºÎÅÍ ÀÔ´Ï´Ù.");
            obj.select();
            return false;
        }
    } else {
        if ( boundDate < datestr) {
            alert("À¯È¿ÇÏÁö ¾ÊÀº °Ë»ö³¯Â¥ÀÔ´Ï´Ù.\nÀ¯È¿ÇÑ ³¯Â¥´Â" + boundDate.substring(0,4) + "³â " + boundDate.substring(4,6) + "¿ù " + boundDate.substring(6) + "ÀÏ±îÁö ÀÔ´Ï´Ù.");
            obj.select();
            return false;
        }                
    }
    return true;
}

//¿À´Ã³¯Â¥
function getToDay() {

    var date = datToday;

    var year  = date.getFullYear();
    var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
    var day   = date.getDate();

    if (("" + month).length == 1) { month = "0" + month; }
    if (("" + day).length   == 1) { day   = "0" + day;   }
        
    return ("" + year + month + day)
}

function selectComboBox(targt, optValue) {
    last = targt.length;
    for(var i=0; i<last; i++){
        if(targt.options[i].value == optValue) {
            targt.selectedIndex = i;
            targt.options[i].selected;
        }
    }
}

function isExistsComboBoxValue(targt, optValue) {
    last = targt.length;
    for(var i=0; i<last; i++) {
        if(targt.options[i].value == optValue) {
            return true;
        }
    }
    return false;
}

function getCal(aFrm, aObj) {
     window.open("/cati/common/msg/calendar.jsp?frmName="+aFrm.name + "&obj=" + aObj.name,"Window2","status=no,height=150,width=152,resizable=no,left="+x+",top="+y+",scrollbars=no");
}    

function getCalMonth(aFrm, aObj) {
     window.open("/cati/common/msg/calendar_month.jsp?frmName="+aFrm.name + "&obj=" + aObj.name,"calMonth","status=no,height=146,width=255,resizable=no,left="+x+",top="+y+",scrollbars=no");
}    

function getCalNext(aFrm, aObj) {    
     window.open("/cati/common/msg/calendar.jsp?frmName="+aFrm.name + "&obj=" + aObj.name+"&nextDate=true","Window2","status=no,height=150,width=152,resizable=no,left="+x+",top="+y+",scrollbars=no");
}   

function getCalFunc(aFrm, aObj,funName) {
     window.open("/cati/common/msg/calendar.jsp?frmName="+aFrm.name + "&obj=" + aObj.name+ "&objFunc=" + funName,"Window2","status=no,height=150,width=152,resizable=no,left="+x+",top="+y+",scrollbars=no");
} 
/*
* ÇÑ¹ÌÀºÇà »ç¾÷ÀÚ¹øÈ£ ¼¼ÆÃ(10ÀÚ¸®)
* ¾Õ¿¡ '0'À» Ã¤¿î´Ù
* 
**/
function fill_corpno(obj) {
    var temp="";
    
    if(obj.value == null || obj.value.length < 1 ) {
        return false;
    }
    
    if(obj.value.length != 10 ) {
        for(i=0;i<(10-obj.value.length);i++) {
            temp +="0";
        }
        obj.value = temp+obj.value;
    } else {
        obj.value = obj.value;
    } 
    return true;
}

/**
 *    ¹ÝÀÚ¸¦ ÀüÀÚ·Î º¯È¯
 */
function parseFull(HalfVal) {
    var FullChar = [
            "¡¡","£¡","£¢","££","£¤","£¥","£¦","£§","£¨",           //33~
            "£©","£ª","£«","£¬","£­","£®","£¯","£°","£±","£²",      //41~
            "£³","£´","£µ","£¶","£·","£¸","£¹","£º","£»","£¼",      //51~
            "£½","£¾","£¿","£À","£Á","£Â","£Ã","£Ä","£Å","£Æ",      //61~
            "£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î","£Ï","£Ð",      //71~
            "£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø","£Ù","£Ú",      //81~
            "£Û","£Ü","£Ý","£Þ","£ß","£à","£Á","£Â","£Ã","£Ä",      //91~
            "£Å","£Æ","£Ç","£È","£É","£Ê","£Ë","£Ì","£Í","£Î",      //101~
            "£Ï","£Ð","£Ñ","£Ò","£Ó","£Ô","£Õ","£Ö","£×","£Ø",      //111~
            "£Ù","£Ú","£û","£ü","£ý","¢¦"                           //121~
            ];
    var stFinal = "";
    var ascii;
    for( i = 0; i < HalfVal.length; i++) {
        ascii = HalfVal.charCodeAt(i);
        if( (31 < ascii && ascii < 128)) {
          stFinal += FullChar[ascii-32];
        } else {
            stFinal += HalfVal.charAt(i);
        }
    }
    return stFinal;
}

/**
 *    ÀüÀÚ¸¦ ¹ÝÀÚ·Î º¯È¯
 */
function parseHalf(FullVal) {
    var HalfChar = [
        " ", "!","\"","#","$","%","&","'","(",
        ")","*","+",",","-",".","/","0","1","2",
        "3","4","5","6","7","8","9",":",";","<",
        "=",">","?","@","A","B","C","D","E","F",
        "G","H","I","J","K","L","M","N","O","P",
        "Q","R","S","T","U","V","W","X","Y","Z",
        "[","\\","]","^","_","`","a","b","c","d",
        "e","f","g","h","i","j","k","l","m","n",
        "o","p","q","r","s","t","u","v","w","x",
        "y","z","{","|","}","~"
        ];
    var stFinal = "";
    var ascii;

    for(var i = 0; i < FullVal.length; i++) {
        ascii = FullVal.charCodeAt(i);
        if (65280 < ascii && ascii < 65375) {
            stFinal += HalfChar[ascii - 65280];
        } else if (12288 == ascii) {
            stFinal += HalfChar[ascii - 12288];
        } else if (65510 == ascii) {
            stFinal += HalfChar[60];
        } else {
            stFinal += FullVal.charAt(i);
        }
    }
    return stFinal;
}

// Á¶È¸Áß ´ë±âÆäÀÌÁö ÀÚµ¿¶ç¿ì±â ---½ÃÀÛ
//
//1. »ç¿ë¹æ¹ý 
//   -. Ã¢¿­±â( %¸¦ º¸¿©ÁÜ)
//      openWaitingWindow("µ¥ÀÌÅ¸¸¦ Á¶È¸ ÁßÀÔ´Ï´Ù.");
//   -. µÚ´ÜÆäÀÌÁöÁß BLS ÀÀ´ä´ë±â±îÁö º¸ÀÏ¶§ ( %¸¦ 0ºÎÅÍ ´Ù½Ã COUNTÇÔ)
//      parent.watingWindowReset("µ¥ÀÌÅ¸¸¦ °¡Á®¿À´Â ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù¸®¼¼¿ä.");
//   -. Ã¢´ÝÀ»¶§(Á¤»óÃ³¸®µÇ°Å³ª ¿¡·¯Ã³¸®½Ã)
//      parent.watingWindowClose();
//   -. ±×¸®µå¿¡ ·¹ÄÚµå º¸ÀÏ¶§ ¸Å°Ç¸¶´Ù ¾Æ·¡È£ÃâÇÏ¸é ±×¸®µå Ç¥½ÃµÇ°í ÀÖ´Â »óÅÂ¸¦ ÀüÃ¼ °Ç¼öÁß Ç¥½Ã°Ç¼ö %·Î º¸¿©ÁÜ.
//      parent.openWaitingWindow("µ¥ÀÌÅ¸¸¦ Ç¥½Ã Áß ÀÔ´Ï´Ù.(" + Math.ceil( ( !!Ç¥½ÃµÈ ÇöÀç COUNT !! )/(<-- x2Out.getInt("RCount(2VF12400822TR1)") -->)*100 ) + "%)");
//
//2.  !!! ÁÖÀÇÇÒÁ¡ !!!
//  µÚ´ÜÆäÀÌÁö¿¡¼­ ¿¡·¯Ã³¸®½Ã jsp:forwardpage="/admin/common/msg/message.jsp" »ç¿ëÇÒ¶§´Â parent.watingWindowClose();  ¾²¸é ¾ÈµÊ.!
//  ¾Æ·¡¿Í °°ÀÌ ½ºÅ©¸³Æ® Ã³¸®·Î ¿¡·¯Ã³¸®ÇÏ°Å³ª setRequestAttribute(request,"url"    , "javascript:parent.watingWindowClose();parent.reset_submit();"); ¾²¸éµÊ
//   <script language="javascript">
//       parent.watingWindowClose();
//       parent.reset_submit();
//       alert("ÀÚ·á°¡ ¾ø½À´Ï´Ù.");
//   </script>
// 
// ÀÛ ¼º ÀÚ : Àå°æÁø
// ÀÛ¼ºÀÏÀÚ : 20040319
// ÀÛ ¼º ÀÚ : ¼öÁ¤ÀÏÀÚ : Àû¿ëÀÏÀÚ : ³»     ¿ë
// Àå °æ Áø : 20040319   20040331 : ½Å ±Ô
// Àå °æ Áø : 20040320   20040331 : º¯ °æ popup window close °ËÁõ Ãß°¡

var watingWindow;

function openWaitingWindow(str) {
    if(watingWindow == null) {
        watingWindow=window.open("","watingWindow","menubar=no,height=20,width=300,innerHeight=0,innerWidth=0,outerHeight=0,screenX=400,screenY=600,menubar=0,personalbar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0");
        watingWindow.document.write("<html><head><title>Á¶È¸ÁßÀÔ´Ï´Ù.</title><meta http-equiv='Content-Type' content='text/html; charset=euc-kr'><meta http-equiv='Cache-Control' content='no-cache'/><meta http-equiv='Expires' content='0'/><meta http-equiv='Pragma' content='no-cache'/><link rel='stylesheet' href='/css/hanmi.css' type='text/css'>\n"
                                 + "<body bgcolor='#FFFFFF' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><center>\n"
                                 + "<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'>\n"
                                 + "<tr><td align='left'>\n"
                                 + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='/applet/swflash.cab#version=5,0,0,0' width='300' height='20'>\n"
                                 + "<param name='movie' value='/img/Loading01.swf'>\n"
                                 + "<param name='quality' value='high'>\n"
                                 + "<embed src='/img/Loading01.swf' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='300' height='20'></embed>\n"
                                 + "</object></td></tr>\n"
                                 + "<tr><td align='left'><form name='frm'>\n");
        watingWindow.document.write("&nbsp;&nbsp;&nbsp;<input type='text' name='msg_window_text' size='100' style='border:none;text-align:left;text-border:2' readOnly>\n");
        watingWindow.document.write("<input type='hidden' name='iswatingWindow' size='5' VALUE='true' >\n");
        watingWindow.document.write("<input type='hidden' name='watingWindow_cnt' size='5' VALUE='0' >\n");
        watingWindow.document.write("<input type='hidden' name='watingWindowText' size='5' VALUE='" + str + "'>\n");
        watingWindow.document.write("</td></tr></table></form></center></body>"
                                 + "<scr" + "ipt language='javascript'>\n"
                                 + "   var percent = 0;\n\n"
                                 + "   function openWaitingWindow_delay() {\n"
                                 + "       var timer;\n"
                                 + "       if ( document.frm.iswatingWindow.value == 'true') {\n"
                                 + "           document.frm.watingWindow_cnt.value = eval( document.frm.watingWindow_cnt.value + ' + 1');\n"
                                 + "           percent = Math.ceil(  eval(document.frm.watingWindow_cnt.value)/(100 +  eval(document.frm.watingWindow_cnt.value) * 1.5 )*100 );\n"
                                 + "           document.frm.msg_window_text.value= '' + document.frm.watingWindowText.value + '(' + percent + '%)';\n"
                                 + "           document.title= '' + document.frm.watingWindowText.value + '(' + percent + '%)';\n"
                                 + "           timer = setTimeout('openWaitingWindow_delay();', 1000);\n"
                                 + "       }\n"
                                 + "   }\n\n"
                                 + "   function watingWindowReset(str) {\n"
                                 + "       document.frm.watingWindowText.value= str;\n"
                                 + "       document.frm.watingWindow_cnt.value= '0';\n"
                                 + "       document.frm.iswatingWindow.value= 'true';\n"
                                 + "       document.title=str;\n"
                                 + "       openWaitingWindow_delay();\n"
                                 + "   }\n\n"
                                 + "   openWaitingWindow_delay();\n"
                                 + "   setTimeout('self.close();', 120000);\n"
                                 + "</scr" + "ipt>\n"
                                 + "</html>");
    } else {
        if(watingWindow.closed) {
            watingWindow = null;
            openWaitingWindow(str);
        } else {
            watingWindow.frm.iswatingWindow.value= "false";
            watingWindow.frm.msg_window_text.value=str;
            watingWindow.document.title=str;
        }
    }
}

function watingWindowClose() {
    if(watingWindow != null ) {
        watingWindow.close();
        watingWindow = null;
    }
}

function watingWindowReset(str) {
    watingWindow.document.write("<scr" + "ipt language='javascript'>  watingWindowReset('" + str + "'); </scr" + "ipt> ");
    watingWindow.document.title = str;
}
// Á¶È¸Áß ´ë±âÆäÀÌÁö ÀÚµ¿¶ç¿ì±â ---³¡

function processKey() { 
    if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || 
    (event.keyCode >= 112 && event.keyCode <= 123)) 
    { 
        event.keyCode = 0; 
        event.cancelBubble = true; 
        event.returnValue = false; 
    } 
} 
document.onkeydown = processKey;

function click() {
    window.status = '';
    if ((event.button==2) || (event.button==3))  
    {
        return false;
    }
}

function keypressed() {                                             
    if (event.keyCode==122) {                                        
        event.keyCode==122;                                
        event.keyCode=0;                                       
        return false;                                          
    }                                                          

    if (event.keyCode == 116) {                                      
        event.keyCode==116;                                
        event.keyCode=0;                                       
        return false;                                          
    }                                                          
}  

function nocontextmenu() { // IE4¿¡¼­¸¸ Àû¿ë, ´Ù¸¥ ºê¶ó¿ìÀú´Â ¹«½Ã
   event.cancelBubble = true;
   event.returnValue = false;

   return false;
}

function returnfalse() { // IE4¿¡¼­¸¸ Àû¿ë, ´Ù¸¥ ºê¶ó¿ìÀú´Â ¹«½Ã
   event.cancelBubble = true;
   event.returnValue = false;

   return false;
}

function pause(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime)
            return;
    }
}

// KB912945ÆÐÄ¡(ActiveX °ü·Ã ¼³°è º¯°æ) °ü·Ã ±×¸®µå »ðÀÔ Function 20060307 Àå°æÁø
//<º¯°æ½Ã À¯ÀÇ»çÇ×>
//     -. ¿ø·¡ ¼Ò½º´Â JSP Comment ·Î ¸·´Â´Ù.
//     -. searchservlet, columndata, appletheight, appletheight, applettitle, english °ª ÀÔ·Â.
//     -. µÎ¹øÀç ÆÄ¶ó¸ÞÅ¸ ÄÚµù ½Ã ';' name= »çÀÌ¿¡ space ÀÖÀ¸¸é ¾ÈµÊ.
//        <¿Ã¹Ù¸¥ ¼Ò½º>
//        "name=Å°°ª|width=0|type=STRING|sort=Y|edit=N|find=Y|align=CENTER|byte=0;"   + 
//        "name=Ã³¸®ÀÏ|width=80|type=DATE|sort=Y|edit=N|find=Y|align=CENTER|byte=10;"              
//        <Àß¸øµÈ ¼Ò½º> ¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¡é 
//        "name=Å°°ª|width=0|type=STRING|sort=Y|edit=N|find=Y|align=CENTER|byte=0;  "   + 
//        "name=Ã³¸®ÀÏ|width=80|type=DATE|sort=Y|edit=N|find=Y|align=CENTER|byte=10;"
function addSgrid(var_code, var_name, var_vspace, var_hspace, var_style, var_searchservlet
                , var_columndata_value, var_appletheight, var_appletwidth, var_applettitle, var_english) {
    var v_code             ;
    var v_name             ;
    var v_vspace           ;
    var v_hspace           ;
    var v_style            ;
    var v_searchservlet    ;
    var v_columndata_value ;
    var v_appletheight     ;
    var v_appletwidth      ;
    var v_applettitle      ;
    var v_english          ;
    
    v_code             = var_code               ;
    v_name             = var_name               ;
    v_vspace           = var_vspace             ;
    v_hspace           = var_hspace             ;
    v_style            = var_style              ;
    v_searchservlet    = var_searchservlet      ;
    v_columndata_value = var_columndata_value   ;
    v_appletheight     = var_appletheight       ;
    v_appletwidth      = var_appletwidth        ;
    v_applettitle      = var_applettitle        ;
    v_english          = var_english            ;
    
    if(v_code             == ""                             ) { v_code             = "com.webcash.sgrid.Main.class";                        }
    if(v_name             == ""                             ) { v_name             = "Main";                                                }
    if(v_vspace           == "" || v_vspace          == "0" ) { v_vspace           = "3";                                                   }
    if(v_hspace           == "" || v_hspace          == "0" ) { v_hspace           = "0";                                                   }
    if(v_appletheight     == "" || v_appletheight    == "0" ) { v_appletheight     = "450";                                                 }
    if(v_appletwidth      == "" || v_appletwidth     == "0" ) { v_appletwidth      = "600";                                                 }
    if(v_style            == ""                             ) { v_style            = "width:" + v_appletwidth + ";height:" + v_appletheight;}
    if(v_searchservlet    == ""                             ) { v_searchservlet    = "";                                                    }
    if(v_applettitle      == ""                             ) { v_applettitle      = "";                                                    }
    if(v_english          == ""                             ) { v_english          = "";                                                    }
    
    var applet_code = "<applet " +
        " code='"                           + v_code              + "'" +
        " name='"                           + v_name              + "'" +
        " vspace='"                         + v_vspace            + "'" +
        " hspace='"                         + v_hspace            + "'" +
        " style='"                          + v_style             + "'>" +
        "<param name=searchservlet value='" + v_searchservlet     + "'>" +     
        "<param name=columndata    value='" + v_columndata_value  + "'>\n" +
        "<param name=appletheight  value='" + v_appletheight      + "'>\n" +
        "<param name=appletwidth   value='" + v_appletwidth       + "'>\n" +
        "<param name=applettitle   value='" + v_applettitle       + "'>\n" +
        "<param name=english       value='" + v_english           + "'>\n" +
        "</applet>";
    //alert("[" + applet_code + "]");
    document.write(applet_code);                         
}

function addSgridSimple(var_searchservlet, var_columndata_value
                      , var_appletheight, var_appletwidth, var_applettitle, var_english) {
                      	
//    addSgrid("", "", "", "", "", var_searchservlet, var_columndata_value
//           , var_appletheight, var_appletwidth, var_applettitle, var_english)
    if("" == var_applettitle){
        var_applettitle = "ÇÑ±¹¾¾Æ¼ÀºÇà";
    }
    if(var_appletheight == '0' || var_appletheight == ''){
        var_appletheight = '340';
    }    
    if(var_appletwidth == '0' || var_appletwidth == ''){
        var_appletwidth = '800';
    }    
	addXgridSimple(var_searchservlet, var_columndata_value, var_appletheight, var_appletwidth, var_applettitle, var_english);
}

var PARAMETERS_DELIMITER = String.fromCharCode(1);
var PARAMETER_DELIMITER = String.fromCharCode(2);
function addApplet(var_archive, var_codebase, var_code, var_alt, var_name, var_width, var_height
, var_align, var_vspace, var_hspace, var_style, var_parameters) {
//< APPLET
//    [ARCHIVE = Archive File URL]
//    [CODEBASE = codebaseURL]
//    CODE = appletFile
//    [ALT = alternateText]
//    [NAME = appletInstanceName]
//    WIDTH = pixels
//    HEIGHT = pixels
//    [ALIGN = alignment]
//    [VSPACE = pixels]
//    [HSPACE = pixels]
//>
//[< PARAM NAME = appletParameter1 VALUE = value >]
//[< PARAM NAME = appletParameter2 VALUE = value >]
//. . .
//[alternateHTML]
//</APPLET>
//
//  <SAMPLE>
//  addApplet(
//  "../../../applet/JClass/jClass.jar",
//  ""                                 ,
//  "jclass/chart/JCChartApplet.class" ,
//  ""                                 ,
//  ""                                 ,
//  ""                                 ,
//  ""                                 ,
//  ""                                 ,
//  ""                                 ,
//  ""                                 ,
//  "width:380;height:275"             ,
//                         "background"                        + PARAMETER_DELIMITER + "222-219-222" +
//  PARAMETERS_DELIMITER + "foreground"                        + PARAMETER_DELIMITER + "black" +
//  PARAMETERS_DELIMITER + "font"                              + PARAMETER_DELIMITER + "Dialog-PLAIN-12" +
//  PARAMETERS_DELIMITER + "ZoomTrigger"                       + PARAMETER_DELIMITER + "None" +
//  PARAMETERS_DELIMITER + "TranslateTrigger"                  + PARAMETER_DELIMITER + "Shift" +
//  PARAMETERS_DELIMITER + "EditTrigger"                       + PARAMETER_DELIMITER + "Ctrl" +
//  PARAMETERS_DELIMITER + "allowUserChanges"                  + PARAMETER_DELIMITER + "false" +
//  PARAMETERS_DELIMITER + "footer.isShowing"                  + PARAMETER_DELIMITER + "true" +
//  PARAMETERS_DELIMITER + "footer.text"                       + PARAMETER_DELIMITER + "[FONT=Helvetica-plain-11]È®´ëÇØ¼­ º¸½Ã·Á¸é ¸¶¿ì½º¸¦ µå·¡±×ÇÏ½Ã°í, 'r' À» ´©¸£½Ã¸é º¹±ÍµË´Ï´Ù. " +
//  PARAMETERS_DELIMITER + "header.borderType"                 + PARAMETER_DELIMITER + "Out" +
//  PARAMETERS_DELIMITER + "header.isShowing"                  + PARAMETER_DELIMITER + "true" +
//  PARAMETERS_DELIMITER + "chartArea.background"              + PARAMETER_DELIMITER + "222-219-222" +
//  PARAMETERS_DELIMITER + "chartArea.axisBoundingBox"         + PARAMETER_DELIMITER + "true" +
//  PARAMETERS_DELIMITER + "chartArea.depth"                   + PARAMETER_DELIMITER + "10" +
//  PARAMETERS_DELIMITER + "chartArea.elevation"               + PARAMETER_DELIMITER + "22" +
//  PARAMETERS_DELIMITER + "chartArea.rotation"                + PARAMETER_DELIMITER + "18");

    var v_archive       = var_archive   ;
    var v_codebase      = var_codebase  ;
    var v_code          = var_code      ;
    var v_alt           = var_alt       ;
    var v_name          = var_name      ;
    var v_width         = var_width     ;
    var v_height        = var_height    ;
    var v_align         = var_align     ;
    var v_vspace        = var_vspace    ;
    var v_hspace        = var_hspace    ;
    var v_style         = var_style     ;
    var v_parameters    = var_parameters;
    var v_parameter     = "";
    var v_parameter_str = "";
    
    var v_searchservlet = "";
    var v_columndata    = "";
    var v_appletheight  = "";
    var v_appletwidth   = "";
    var v_applettitle   = "";
    
    v_parameters = v_parameters.split(PARAMETERS_DELIMITER);

    //for (var i = 0 ; i < v_parameters.length - 1; i++) {
    for (var i = 0 ; i < v_parameters.length; i++) {
        v_parameter = v_parameters[i].split(PARAMETER_DELIMITER);

        v_parameter_str = v_parameter_str + "<PARAM NAME=\"" + v_parameter[0] + "\" VALUE=\"" + v_parameter[1] + "\" >\n";

        if(v_parameter[0].toLowerCase() == "searchservlet" ) v_searchservlet = v_parameter[1];
        if(v_parameter[0].toLowerCase() == "columndata"    ) v_columndata    = v_parameter[1];
        if(v_parameter[0].toLowerCase() == "appletheight"  ) v_appletheight  = v_parameter[1];
        if(v_parameter[0].toLowerCase() == "appletwidth"   ) v_appletwidth   = v_parameter[1];
        if(v_parameter[0].toLowerCase() == "applettitle"   ) v_applettitle   = v_parameter[1];
    }
    //alert("v_parameter_str[" + v_parameter_str + "]");
    var applet_code = "<applet ";
    if( var_archive != "" ) {  applet_code = applet_code + " ARCHIVE =\"" + var_archive          + "\" " }
    if( v_codebase  != "" ) {  applet_code = applet_code + " CODEBASE=\"" + v_codebase           + "\" " }
    if( v_code      != "" ) {  applet_code = applet_code + " CODE    =\"" + v_code               + "\" " }
    if( v_alt       != "" ) {  applet_code = applet_code + " ALT     =\"" + v_alt                + "\" " }
    if( v_name      != "" ) {  applet_code = applet_code + " NAME    =\"" + v_name               + "\" " }
    if( v_width     != "" ) {  applet_code = applet_code + " WIDTH   =\"" + v_width              + "\" " }
    if( v_height    != "" ) {  applet_code = applet_code + " HEIGHT  =\"" + v_height             + "\" " }
    if( v_align     != "" ) {  applet_code = applet_code + " ALIGN   =\"" + v_align              + "\" " }
    if( v_vspace    != "" ) {  applet_code = applet_code + " VSPACE  =\"" + v_vspace             + "\" " }
    if( v_hspace    != "" ) {  applet_code = applet_code + " HSPACE  =\"" + v_hspace             + "\" " }
    if( var_style   != "" ) {  applet_code = applet_code + " STYLE   =\"" + var_style            + "\" " } 
    applet_code = applet_code + " >\n";
    applet_code = applet_code + v_parameter_str + "</applet>";
    //alert("applet_code[" + applet_code + "]");
    
    if(v_searchservlet == null || v_searchservlet == "") v_searchservlet = " ";
    if(v_columndata    == null || v_columndata    == "") v_columndata    = " ";
    if(v_appletheight  == null || v_appletheight  == "") v_appletheight  = "340";
    if(v_appletwidth   == null || v_appletwidth   == "") v_appletwidth   = "700";
    if(v_width         == null || v_width         == "") v_width         = "700";
    if(v_applettitle   == null || v_applettitle   == "") v_applettitle   = "ÇÑ±¹¾¾Æ¼ÀºÇà";
    if(v_name          == null || v_name          == "") v_name          = "Main";
        
    //alert("v_searchservlet[" + v_searchservlet + "]\n" +
    //      "v_columndata   [" + v_columndata    + "]\n" +
    //      "v_appletheight [" + v_appletheight  + "]\n" +
    //      "v_appletwidth  [" + v_appletwidth   + "]\n" +
    //      "v_width        [" + v_width         + "]\n" +
    //      "v_applettitle  [" + v_applettitle   + "]");

    //alert("JVMÁ¦°Å ÀÛ¾÷ ÁßÀÔ´Ï´Ù. ÀÌ ¸Þ½ÃÁö°¡ º¸ÀÌ¸é °ü·Ã °³¹ßÀÚ¿¡°Ô ¿¬¶ô ¹Ù¶ø´Ï´Ù.\n\n\n»ç¿ëÇÁ·Î±×·¥ [" + location.pathname + "]\n\n\n\n applet_code[" + applet_code.substring(0,30) + "]");
    //
    // »ç¿ë¼Ò½º ÄÚµå¸¦ ³ªÁß¿¡¶óµµ ¾Ë ¼ö ÀÖµµ·Ï ¼öÁýÇÏ´Â ½ºÅ©¸³Æ®¸¦ ¸¸µé¾î¾ßÇÔ.
    //
    addXgridSimple2( v_searchservlet, v_columndata, v_appletheight, v_appletwidth, v_applettitle, "Main", v_name);

    //document.write(applet_code);
}

//document.onkeydown     = keypressed;
//document.oncontextmenu = nocontextmenu;      // IE5+ ¿ë



///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ÀÌÇÏ´Â CitiGroup CATi¿ëÀ¸·Î Ãß°¡ÇÏ¿´À½ 
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

/**
 * XGrid Object ÅÂ±×¸¦ ¾²´Â °øÅëÇÔ¼ö 
 * °øÅëÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¹öÁ¯ÀÇ º¯°æµîÀÌ ¿ëÀÌÇÏ°Ô ÇÑ´Ù.
 * strID : ½ºÅ©¸³Æ®¿¡¼­ °´Ã¼¸¦ Á¢±ÙÇÒ¶§ »ç¿ëÇÏ´Â °´Ã¼ÀÇ ÀÌ¸§(Main)
 * width : °´Ã¼ÀÇ Æø(600)
 * height : °³Ã¼ÀÇ ³ôÀÌ(450)
 */
function writeXGridObject(strID, strWidth, strHeight) {
	var ObjTag = '<OBJECT id="'+strID+'" ';
	ObjTag = ObjTag + 'classid="clsid:3E086D34-0ED5-4A8E-BB6A-C4DF5AC4357B" ';
	ObjTag = ObjTag + 'codebase="/js/CitiGroupXGrid.cab#version=1,0,2,66" ';
	ObjTag = ObjTag + 'width='+strWidth+' height='+strHeight+' align=center hspace=0 vspace=0 hide=true ></OBJECT>';
	document.write(ObjTag);
}

/**
 * XGrid Object ÅÂ±×¸¦ ¾²´Â °øÅëÇÔ¼ö 
 * °øÅëÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¹öÁ¯ÀÇ º¯°æµîÀÌ ¿ëÀÌÇÏ°Ô ÇÑ´Ù.
 * strID : ½ºÅ©¸³Æ®¿¡¼­ °´Ã¼¸¦ Á¢±ÙÇÒ¶§ »ç¿ëÇÏ´Â °´Ã¼ÀÇ ÀÌ¸§(Main)
 * width : °´Ã¼ÀÇ Æø(600)
 * height : °³Ã¼ÀÇ ³ôÀÌ(450)
 */
function writeXGridObject1(strID, strWidth, strHeight) {
	var ObjTag = '<OBJECT id="'+strID+'" ';
	ObjTag = ObjTag + 'classid="clsid:3E086D34-0ED5-4A8E-BB6A-C4DF5AC4357B" ';
	ObjTag = ObjTag + 'codebase="WCXG.ocx#version=1,0,2,66" ';
	ObjTag = ObjTag + 'width='+strWidth+' height='+strHeight+' align=center hspace=0 vspace=0 hide=true ></OBJECT>';
	document.write(ObjTag);
}

function addSgridSimple2(param1, rows, x_height, x_width, x_title, param6) {    
    if(x_height == '0' || x_height == ''){
        x_height = '340';
    }    
    if(x_width == '0' || x_width == ''){
        x_width = '800';
    }
	writeXGridObject("Main", x_width, x_height);
	initSecond(document.Main, rows, x_title);
}

//XGrid Ãß°¡
function addXgridSimple(param1, rows, x_height, x_width, x_title, param6) {
    if(x_height == '0' || x_height == ''){
        x_height = '340';
    }    
    if(x_width == '0' || x_width == ''){
        x_width = '800';
    }
	writeXGridObject("Main", x_width, x_height);
	initSecond(document.Main, rows, x_title);
}

function addXgridSimple2(param1, rows, x_height, x_width, x_title, param6, param7) {
    if(x_height == '0' || x_height == ''){
        x_height = '340';
    }    
    if(x_width == '0' || x_width == ''){
        x_width = '800';
    }
	writeXGridObject(param7, x_width, x_height);
	initSecond(eval("document."+param7), rows, x_title);
}

/******************************************************************************
   documentÀÇ ÅÂ±× ¼Ó¼ºÁß search == "Y" °Í¸¸ search_cap°ú search_valÀ»
   ÀÌ¿ëÇÏ¿© ±×¸®µå ÀÎ¼â ¹× ÆÄÀÏÀúÀå½Ã °Ë»öÁ¶°ÇÀ» ¼³Á¤ÇÑ´Ù.
 *****************************************************************************/
function makeSearchCondition(xgrid_obj) {
	xgrid_obj.SearchCondition = "";
	var search_condition = ""
	var objs = document.all;
	for (var idx=0; idx < objs.length; idx++) {
		var obj = document.all[idx];
					
		try{
			if (obj == null || (typeof obj == "undefined")) continue;
			if (obj.type == null || obj.type == "undefined") continue;
		}
		catch(e){
			continue;
		}
		
		var TAG_NAME = obj.tagName;
	
		if (TAG_NAME == "INPUT" || TAG_NAME == "SELECT" || TAG_NAME == "TEXTAREA") {
			if (obj.search == "Y") {
				//var search_caption = r_f_b(obj.search_cap, 20, " ");
				var search_caption = obj.search_cap;
				var search_value = "";
				
				switch(obj.type) {
					case "radio" :
					case "checkbox" :
						if (obj.checked == true) {
							if (typeof obj.search_val == "undefined")
								search_value = obj.value;
							else
								search_value = obj.search_val;
						}
						break;
					case "text" :
					case "password" :
					case "hidden" :
						if (typeof obj.search_val == "undefined")
							search_value = obj.value;
						else 
							search_value = obj.search_val;
						break;
					case "select-one" :
						search_value = obj.options[obj.selectedIndex].text;
						break;
				}
				
				if (search_value != "") {
					search_condition = search_condition + "<B>" + search_caption + " : </B>" + search_value + "";
				}
			}
		}
		
	}
	xgrid_obj.SearchCondition = search_condition;;
}

/******************************************************************************
   ±×¸®µå ÀÎ¼â ¹× ÆÄÀÏÀúÀå½Ã °Ë»öÁ¶°ÇÀ» Ãß°¡ÇÑ´Ù.
 *****************************************************************************/
function addSearchCondition(xgrid_obj, search_caption, search_value) {
	var search_condition = xgrid_obj.SearchCondition;
	//search_condition = search_condition + "<B>" + r_f_b(search_caption, 20, " ") + " : </B>" + search_value + "";
	search_condition = search_condition + "<B>" + search_caption + " : </B>" + search_value + "";
	xgrid_obj.SearchCondition = search_condition;
}

/******************************************************************************
   ÀÔ·Â°ª¿¡ ±æÀÌ¼ö ¸¸Å­ ÇØ´ç¹®ÀÚ Ã¼¿ò.
 *****************************************************************************/
function r_f_b(src, len, padStr) {
    var retStr = "";
    var padCnt = Number(len) - getByteLength(src);
    for(var i=0;i<padCnt;i++) retStr += String(padStr);
    return src+retStr;
} 

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ÀÌÇÏ´Â CitiGroup CATi¿ëÀ¸·Î Ãß°¡ ³¡
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


function setNewOTPValue(resValue, obj1,obj2){
    // frm = °á°ú Æû,resValue = ÀÔ·Â°ª, obj1 = Ã¹¹øÂ° ÇÊµå°ª, obj2 = µÎ¹øÂ° ÇÊµå°ª
    
    if(resValue.length <= 6){
        obj1.value = resValue;
        obj2.value = "  0000";
    }else if(resValue.length == 7){
        obj1.value = resValue;
        obj2.value = resValue.substring(6) + " 0000";
    } else {
        obj1.value = resValue.substring(0,6);
        obj2.value = resValue.substring(6);
    }
}

function strLeng(strIn){          
	var strOut = 0;          
	for ( i = 0 ; i < strIn.length ; i++){          
		ch = strIn.charAt(i);          
		if ((ch == "\n") || ((ch >= "¤¿") && (ch <= "È÷")) || ((ch >="¤¡") && (ch <="¤¾")))           
			strOut += 2;          
		else          
			strOut += 1;          
	}           
	return (strOut);          
}	

function saup_ck(obj1,obj2,obj3)          
{         
	if(!(obj1.value)||!(obj2.value)||!(obj3.value)){
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		obj1.focus();
		return false;
	}

	li_value = new Array(10);          
	if ( getByteLength(obj1.value) == 3 && getByteLength(obj2.value) == 2 && getByteLength(obj3.value) == 5){          
	    if ( ( isNumber(obj1)) && ( isNumber(obj2)) && ( isNumber(obj3))){          
	        li_value[0] = ( parseFloat(obj1.value.substring(0 ,1))  * 1 ) % 10;          
            li_value[1] = ( parseFloat(obj1.value.substring(1 ,2))  * 3 ) % 10;          
            li_value[2] = ( parseFloat(obj1.value.substring(2 ,3))  * 7 ) % 10;          
            li_value[3] = ( parseFloat(obj2.value.substring(0 ,1))  * 1 ) % 10;          
            li_value[4] = ( parseFloat(obj2.value.substring(1 ,2))  * 3 ) % 10;          
            li_value[5] = ( parseFloat(obj3.value.substring(0 ,1))  * 7 ) % 10;          
            li_value[6] = ( parseFloat(obj3.value.substring(1 ,2))  * 1 ) % 10;          
            li_value[7] = ( parseFloat(obj3.value.substring(2 ,3))  * 3 ) % 10;          
            li_temp = parseFloat(obj3.value.substring(3,4))  * 5 + "0";          
            li_value[8] = parseFloat(li_temp.substring(0,1)) + parseFloat(li_temp.substring(1,2));          
            li_value[9] =  parseFloat(obj3.value.substring(4,5));          
            li_lastid = (10 - ( ( li_value[0] + li_value[1] + li_value[2] + li_value[3] + li_value[4] + li_value[5] + li_value[6] + li_value[7] + li_value[8] ) % 10 ) ) % 10;          
            
            if (li_value[9] != li_lastid){          
                alert("\n»ç¾÷ÀÚµî·Ï¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù.");          
                obj1.select();          
                obj1.focus();          
                return false;          
            }else{
                return true;
            }
        }else {             
             alert("»ç¾÷ÀÚ ½ÂÀÎ ¹øÈ£´Â 123-45-56789ÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");          
             obj1.focus();          
             obj1.select();          
             return false;          
        }
    }else {              
  		alert("»ç¾÷ÀÚ ½ÂÀÎ ¹øÈ£´Â 123-45-56789ÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");          
  		obj1.focus();          
  		obj1.select();          
  		return false;          
    } 

	return true;    	             
}


//¹ýÀÎµî·Ï¹øÈ£ Ã¼Å©
function corpno_ck(obj1,obj2){
	if(!(obj1.value)||!(obj2.value)){
		alert("¹ýÀÎµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		obj1.focus();
		return false;
	}
	li_value = new Array(13);          
	if ( getByteLength(obj1.value) == 6 && getByteLength(obj2.value) == 7){          
   		if ( ( isNumber(obj1)) && ( isNumber(obj2)) ){          
          li_value[0] = parseFloat(obj1.value.substring(0 ,1))  * 1 ;          
          li_value[1] = parseFloat(obj1.value.substring(1 ,2))  * 2 ;          
          li_value[2] = parseFloat(obj1.value.substring(2 ,3))  * 1 ;          
          li_value[3] = parseFloat(obj1.value.substring(3 ,4))  * 2 ;          
          li_value[4] = parseFloat(obj1.value.substring(4 ,5))  * 1 ;          
          li_value[5] = parseFloat(obj1.value.substring(5 ,6))  * 2 ;          
          li_value[6] = parseFloat(obj2.value.substring(0 ,1))  * 1 ;          
          li_value[7] = parseFloat(obj2.value.substring(1 ,2))  * 2 ;          
          li_value[8] = parseFloat(obj2.value.substring(2 ,3))  * 1 ;          
          li_value[9] = parseFloat(obj2.value.substring(3 ,4))  * 2 ;          
          li_value[10] = parseFloat(obj2.value.substring(4 ,5))  * 1 ;          
          li_value[11] = parseFloat(obj2.value.substring(5 ,6))  * 2 ;          
          li_value[12] = parseFloat(obj2.value.substring(6,7));          
          li_lastid = 10 - ( ( li_value[0] + li_value[1] + li_value[2] + li_value[3] + li_value[4] + li_value[5] + li_value[6] + li_value[7] + li_value[8] + li_value[9] + li_value[10] + li_value[11] ) % 10 );          
          if ( li_lastid == 10 ) li_lastid = 0 ;  
          if (li_value[12] != li_lastid){          
            alert("\n¹ýÀÎµî·Ï¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù.");          
            obj1.select();          
            obj1.focus();          
            return false;          
          }else          
            return true;
        }else          
             alert("¹ýÀÎµî·Ï¹øÈ£´Â 123456-1234567ÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");          
             obj1.focus();          
             obj1.select();          
             return false;          
    }else {          
  		alert("¹ýÀÎµî·Ï¹øÈ£´Â 123456-1234567ÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");          
  		obj1.focus();          
  		obj1.select();          
  		return false;          
    } 

	return true;    	             
}

var disabledArray;
				
function removeDisabled(aFrm){					
	var iCnt = 0;
	for (var idx=0; idx<aFrm.length; idx++){
		var obj = aFrm.elements[idx];
		try{    		    
    		if(obj.type == 'text' || obj.type == 'radio' || obj.type == 'textarea' || obj.type == 'hidden' || obj.type == 'checkbox' || (obj.type).indexOf("select") > -1){					    
    			if((obj.name).indexOf("_shttp_") == -1) {
    			    if(obj.name != ''){				        			        
        				if(obj.type == 'radio' || obj.type == 'checkbox'){								        				    
        					var vRad = obj.name;					
        					var vRad1 = eval("aFrm." + vRad);					
        					if(vRad1.length > 1){
        						for(iRadio = 0 ; iRadio < vRad1.length ; iRadio++){
        							if(vRad1[iRadio].disabled == true){							
        								iCnt++;
        								if(iRadio < (vRad1.length -1)){
        									idx++;
        								}
        							}
        						}
        					} else {
        						if(obj.disabled == true){
        							iCnt++;
        						}
        					}
        				} else {
        					if(obj.disabled == true){
        						iCnt++;
        					}
        				}
        			}
    			}
    		}
    	}catch(e){
    	}
	}		
	
	disabledArray = new Array(iCnt);	
	var iCount = 0;
	for (var idx=0; idx<aFrm.length; idx++){
		var obj = aFrm.elements[idx];
		try{
    		if(obj.type == 'text' || obj.type == 'radio' || obj.type == 'textarea' || obj.type == 'hidden' || obj.type == 'checkbox' || (obj.type).indexOf("select") > -1){			
    			if((obj.name).indexOf("_shttp_") == -1) {
    			    if(obj.name != ''){	
        				if(obj.type == 'radio' || obj.type == 'checkbox'){				
        					var vRad = obj.name;
        					var vRad1 = eval("aFrm." + vRad);
        					if(vRad1.length > 1){
        						for(iRadio = 0 ; iRadio < vRad1.length ; iRadio++){
        							if(vRad1[iRadio].disabled == true){														
        								disabledArray[iCount] = vRad1[iRadio].name + "[" + iRadio + "]";
        								vRad1[iRadio].disabled = false;
        								iCount++;
        								if(iRadio < (vRad1.length -1)){
        									idx++;
        								}
        							}
        						}
        					} else {
        						if(obj.disabled == true){						
        							disabledArray[iCount] = obj.name;
        							obj.disabled = false;
        							iCount ++;
        						}
        					}
        				} else {
        					if(obj.disabled == true){					
        						disabledArray[iCount] = obj.name;
        						obj.disabled = false;
        						iCount ++;
        					}
        				}
        			}
    			}
    		}	
    	}catch(e){
	    }	
	}	
}

function repareDisabled(aFrm){					
	var iCnt = 0;	
	if(disabledArray.length > 0){		
		for (var idx=0; idx<disabledArray.length; idx++){				
			var repareObj = eval("aFrm." + disabledArray[idx]);						
			repareObj.disabled = true;			
		}
	}
}						

/******************************************************************************
*******************************************************************************
** XGrid °ü·ÃÃß°¡ (2007-10-26)
*******************************************************************************
*******************************************************************************/

/* TxMouseButton ¼Ó¼º °ª */
// Constants for enum TxMouseButton
  mbLeft    = 0;    // ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°
  mbRight   = 1;    // ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°
  mbMiddle  = 2;    // ¸¶¿ì½º °¡¿îµ¥ ¹öÆ°

/* SetStyleProperty ÇÔ¼ö¿¡ AStyleType ÀÎÀÚ¿¡ ¼³Á¤ ÇÏ´Â °ª */
// Constants for enum TxStyle
  snBackground  = 0;  // ¹è°æ ½ºÅ¸ÀÏ
  snContent     = 1;    // Cell ¿µ¿ª ½ºÅ¸ÀÏ
  snFooter      = 2;    // Sumary Ç¥½Ã ºÎºÐ, ÇÏ´Ü ½ºÅ¸ÀÏ
  snHeader      = 3;    // ÇØ´õ ½ºÅ¸ÀÏ
  snIndicator   = 4;    // Indicator ½ºÅ¸ÀÏ
  snInactive    = 5;    // ºñÈ°¼ºÈ­½Ã ½ºÅ¸ÀÏ
  snSelection   = 6;    // ¼±ÅÃµÈ ¿µ¿ª ½ºÅ¸ÀÏ
  snContentEven = 7;  // Cell ¿µ¿ª Â¦¼ö Row ½ºÅ¸ÀÏ
  snContentOdd  = 8;  // Cell ¿µ¿ª È¦¼ö Row ½ºÅ¸ÀÏ
  snBandHeader  = 9;  // BandHeader ½ºÅ¸ÀÏ
  
/* SetStyleProperty ÇÔ¼ö¿¡ AProperty ÀÎÀÚ¿¡ ¼³Á¤ ÇÏ´Â °ª */
spColor       = 0;    // StyleÀÇ Color ÇÁ·ÎÆÛÆ¼
spFontColor   = 1;    // StyleÀÇ FontColor ÇÁ·ÎÆÛÆ¼
spFontHeight  = 2;    // StyleÀÇ FontHeight ÇÁ·ÎÆÛÆ¼
spFontName    = 3;    // StyleÀÇ FontName ÇÁ·ÎÆÛÆ¼
spFontSize    = 4;    // StyleÀÇ FontSize ÇÁ·ÎÆÛÆ¼
spFontStyle   = 5;    // StyleÀÇ FontStye ÇÁ·ÎÆÛÆ¼
spTag         = 6;    // StyleÀÇ Tag ÇÁ·ÎÆÛÆ¼
spTextColor   = 7;    // StyleÀÇ TextColor ÇÁ·ÎÆÛÆ¼

/* SetStyleProperty ÇÔ¼ö¿¡ APropertyÀÎÀÚ°¡  spFontStyleÀÏ¶§ °ª¿¡ ¼³Á¤ÇÏ´Â °ª(or ¿¬»êÀ¸·Î ´Ù¼öÀÇ ¼Ó¼ºÀ» ¼³Á¤) */
fsBold        = 1;
fsItalic      = 2;
fsUnderline   = 4;
fsStrikeOut   = 8;

/* LookAndFeelKind */
lfFlat      = 0;
lfStandard  = 1;
lfUltraFlat = 2;
lfOffice11  = 3;

/* ±×¸®µå Á¾·ù »ó¼ö Á¤ÀÇ */
gkSearch    = 0; //Á¶È¸¿ë±×¸®µå
gkModify    = 1; //ÆíÁý¿ë±×¸®µå(ÀÔ·Â/¼öÁ¤/»èÁ¦/Ã£±â/ÃÊ±âÈ­/ÆÄÀÏÀÐ±â/ÆÄÀÏÀúÀå/¼öÃëÀÎÁ¶È¸/Àü¼Û ¹öÆ°µîÀ» ±×¸®µå³»¿¡ ´õ ±×¸°´Ù.)

/* ÆíÁý¿ë ±×¸®µå ¿¡¼­ »ç¿ëµÉ ¹öÆ°ÀÇ Á¤·Ä */
gaLeft  = 0; //¿ÞÂÊÁ¤·Ä
gaRight = 1; //¿À¸¥ÂÊÁ¤·Ä

/* ÆíÁý¿ë ±×¸®µå ¿¡¼­ ¼öÃëÀÎÁ¶È¸¹öÆ° Visible */
gsReceiveBtnView      = 0;
gsReceiveBtnNoneView  = 1;

/* ColumnTypeÁ¤ÀÇ »ó¼ö */
//0:AHN 1:A 2:H 3:N 4:AN 5:HN 6:AH (TextColumnHeader¿¡¼­¸¸ »ç¿ë) ±âº» ctAHN
ctAHN = 0;
ctA   = 1;
ctH   = 2;
ctN   = 3;
ctAN  = 4;
ctHN  = 5;
ctAH  = 6;
ctLAN = 7;

/* OpenFileType */


// Constants for enum TxBandProperty
  bpCaption           = 3;
  bpFixedKind         = 4;
  bpHeaderAlignHorz   = 5;
  bpHeaderAlignVert   = 6;
  bpHoldOwnColumnOnly = 7;
  bpMoving            = 8;
  bpSizing            = 9;
  bpParentBandIndex   = 10;
  bpColIndex          = 11;
  bpVisible           = 12;
  bpWidth             = 13;
  
// Constants for enum TxNullStyle
  nsUnchecked     = 0;
  nsInactive      = 1;
  nsGrayedChecked = 2;

// Constants for enum TxAlignVert
  avTop     = 0;
  avBottom  = 1;
  avCenter  = 2;

// Constants for enum TxAlignHorz
  ahLeft    = 0;
  ahRight   = 1;
  ahCenter  = 2;

// Constants for enum TxFooterKind
  fkAverage = 0;
  fkCount   = 1;
  fkMax     = 2;
  fkMin     = 3;
  fkNone    = 4;
  fkSum     = 5;

// Constants for enum TxNullStyle
//type TxNullStyle
  nsUnchecked     = 0;
  nsInactive      = 1;
  nsGrayedChecked = 2;

// Constants for enum TxBandProperty
//type TxBandProperty
  bpCaption           = 3;
  bpFixedKind         = 4;
  bpHeaderAlignHorz   = 5;
  bpHeaderAlignVert   = 6;
  bpHoldOwnColumnOnly = 7;
  bpMoving            = 8;
  bpSizing            = 9;
  bpParentBandIndex   = 10;
  bpColIndex          = 11;
  bpVisible           = 12;
  bpWidth             = 13;

// Constants for enum TxColumnStatus
//type TxColumnStatus
  csVisible   = 1;
  csFiltering = 2;
  csSearch    = 4;
  csGroup     = 8;
  csPrint     = 16;
  csSTRING    = 256;
  csSTRINGA   = 512;
  csSTRINGH   = 768;
  csSTRINGN   = 1024;
  csSTRINGAH  = 1280;
  csSTRINGAN  = 1536;
  csSTRINGHN  = 1792;
  csSTRINGAHN = 2048;

// Constants for enum TxColumnPropertiesStatus
//type TxColumnPropertiesStatus
  psCombobox  = 0;

//MRDÆÄÀÏ ÀÎ¼â °ü·Ã »ó¼ö Á¤ÀÇ(¿ì¸®ÀºÇà)
  mrdPreview  = 0; //¹Ì¸®º¸±â
  mrdPrint    = 1; //ÀÎ¼â
  
  
/******************************************************************************
   XGrid¿¡ ÄÃ·³À» Ãß°¡ÇÏ´Â ÇÔ¼ö
 *****************************************************************************/
  /* [ AType, ACaption, AAlignDataHorz, AAlignDataVert, AAlignHeaderHorz, AAlignHeaderVert: STRING;
              AVisible, ASorting, ASizing, AVerSizing, AMoving, ACellMerging,
              ADisableEditor: WordBool; AWidth, AColIndex, ARowIndex, ALineCount,
              AParentBandIndex: integer 
            ] */

/*
    function AddBandHeader(const ACaption: string;
      AHeaderAlignHorz: TxAlignHorz; AHeaderAlignVert: TxAlignVert;
      AWidth: Integer; AVisible, AMoving, ASizing,
      AHoldOwnColumnOnly: Boolean; const AFixedKind: string;
      AColIndex, AParentBandIndex: Integer): Integer; safecall;
*/

function AppendImageColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex)
{
  if (colIndex == undefined) colIndex = -1;
	if (rowIndex == undefined) rowIndex = -1;
	if (bandindex == undefined) bandindex = 0;
	if (sortable == undefined) sortable = false;
	if (filterable == undefined) filterable = true;
	if (readonly == undefined) readonly = true;
	if (align == undefined) align = 'center';
	if (AMoving == undefined) AMoving = true;
	//if (ASizing == undefined) ASizing = true;
	//if (AMaxlength == undefined) AMaxlength = 0;
  //if (ARequired == undefined) ARrequired = 0;
  
	var idx = grid.AddColumnHeader('image', caption, align, 'center', 'center', 'center'
						, visible, sortable, true, false, true, false
						, readonly, width, colIndex, rowIndex, 1
						, bandindex , filterable
					    );
	var columnObj = grid.GetColumn(idx);
	columnObj.Moving = AMoving;
}
function AppendComboColumnHeader(grid, caption, width, visible, sortable,filterable, readonly, align, AMoving, colIndex, ARequired, AMaxlength,rowIndex, bandindex) {
  if (colIndex == undefined) colIndex = -1;
	if (rowIndex == undefined) rowIndex = -1;
	if (bandindex == undefined) bandindex = 0;
	if (sortable == undefined) sortable = false;
	if (filterable == undefined) filterable = true;
	if (readonly == undefined) readonly = true;
	if (align == undefined) align = 'center';
	if (AMoving == undefined) AMoving = true;
	//if (ASizing == undefined) ASizing = true;
	if (AMaxlength == undefined) AMaxlength = 0;
  	if (ARequired == undefined) ARrequired = 0;
  
	var idx = grid.AddColumnHeader('combo', caption, align, 'center','center', 'center', visible, sortable, true,false, true, false, readonly, width,colIndex, rowIndex, 1, bandindex , filterable,ARequired, AMaxlength);
	var columnObj = grid.GetColumn(idx);
	columnObj.Moving = AMoving;
}

function AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, ARequired, AMaxlength, rowIndex, bandindex) {    
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'center';
  if (AMoving == undefined) AMoving = true;
  if (ARequired == undefined) ARequired = false;
  if (AMaxlength == undefined) AMaxlength = 0;  
  var AColumnType = ctAHN;
  //alert(ARequired);
  //if (headalign == undefined) headalign = 'center';
  //if (AMaxLength == undefined) AMaxLength = 0;
  //if (ARequired == undefined) ARrequired = 0;
  
  //alert(maxlength);
  //alert(required);
  var idx  = '';
                                //AType, ACaption, AAlignDataHorz, AAlignDataVert, AAlignHeaderHorz, AAlignHeaderVert
    try{                                
        idx = grid.AddColumnHeader('text', caption , align         , 'center'      , 'center'        , 'center'
                //AVisible,ASorting,ASizing, AVerSizing, AMoving, ACellMerging
                , visible, sortable, true  , false     , true   , false
                //ADisableEditor, AWidth, AColIndex,ARowIndex,ALineCount
                , readonly      , width , colIndex, rowIndex, 1
                //AParentBandIndex, AFiltering
                , bandindex       , filterable, ARequired, AMaxlength ,AColumnType
                );
    }catch(e1){        
        idx = grid.AddColumnHeader('text', caption , align         , 'center'      , 'center'        , 'center'
                //AVisible,ASorting,ASizing, AVerSizing, AMoving, ACellMerging
                , visible, sortable, true  , false     , true   , false
                //ADisableEditor, AWidth, AColIndex,ARowIndex,ALineCount
                , readonly      , width , colIndex, rowIndex, 1
                //AParentBandIndex, AFiltering
                , bandindex       , filterable, ARequired, AMaxlength
                );
    }
  var columnObj = grid.GetColumn(idx);
  if(caption.indexOf('°èÁÂ') > -1 || caption.indexOf('¾îÀ½¹øÈ£') > -1){
  } else {
      try{        
        grid.SetColumnDataType(idx, 'standard');
      }catch(e2){    
      }
  }
  //SetStyleProperty(snContent, spTextColor,  RgbColor(102, 102, 102));
  columnObj.Moving = AMoving;

}

function AppendCheckColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex) {
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'center';
  if (AMoving == undefined) AMoving = true;
  if (caption == '¼±ÅÃ' ) readonly = false;
    
  var idx = grid.AddColumnHeader('check', caption, align, 'center', 'center', 'center'
            , visible, sortable, true, false, true, false
            , readonly, width, colIndex, rowIndex, 1
            , bandindex , filterable
              );
  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;
}

function AppendCheckColumnHeader2(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex) {
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'center';
  if (AMoving == undefined) AMoving = true;
//  if (caption == '¼±ÅÃ' ) readonly = false;

  var idx = grid.AddColumnHeader('check', caption, align, 'center', 'center', 'center'
            , visible, sortable, true, false, true, false
            , readonly, width, colIndex, rowIndex, 1
            , bandindex , filterable
              );
  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;
}

function AppendRadioColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, colIndex, rowIndex, bandindex) {
  //alert('TEST0');
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'center';

  readonly = true;
    
  var idx = grid.AddColumnHeader('radio', caption, align, 'center', 'center', 'center'
            , visible, sortable, true, false, true, false
            , readonly, width, colIndex, rowIndex, 1
            //, bandindex , filterable
              );
}

function AppendCurrencyColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, ARequired, AMaxLength, rowIndex, DecimalPlaces, DecimalChar, bandindex) {
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'right';
  if (AMoving == undefined) AMoving = true;
  if (DecimalChar == undefined) DecimalChar = '#';
  if (ARequired == undefined) ARequired = false;
  if (AMaxLength == undefined) AMaxLength = 0;
  var idx = grid.AddColumnHeader('currency', caption, align, 'center', 'center', 'center'
              , visible, sortable, true, false, true, false
              , readonly, width, colIndex, rowIndex, 1
              , bandindex , filterable, ARequired, AMaxLength
                );

  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;
  
  if (DecimalPlaces != undefined)
  {
    try{
      var cc = grid.GetColumn(idx);
      var cp = cc.GetProperties();
      var DecimalStr = '';
      for(var i=0;i<DecimalPlaces;i++)
        DecimalStr += DecimalChar;

      cp.DecimalPlaces = DecimalPlaces;
      cp.DisplayFormat = "\,0." + DecimalStr +";-\,0." + DecimalStr;
    }catch(E){
      
    }
  }
}

//function AppendCurrencyColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex) {
//  if (colIndex == undefined) colIndex = -1;
//  if (rowIndex == undefined) rowIndex = -1;
//  if (sortable == undefined) sortable = false;
//  if (filterable == undefined) filterable = true;
//  if (readonly == undefined) readonly = true;
//  if (align == undefined) align = 'right';
//  if (AMoving == undefined) AMoving = true;

//  var idx = grid.AddColumnHeader('currency', caption, align, 'center', 'center', 'center'
//              , visible, sortable, true, false, true, false
//              , readonly, width, colIndex, rowIndex, 1
//              , 0 , filterable 
//                );
//  var columnObj = grid.GetColumn(idx);
//  columnObj.Moving = AMoving;
//}

function AppendHyperLinkColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex) {
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'center';
  if (AMoving == undefined) AMoving = true;
  
  var idx = grid.AddColumnHeader('hyperlink', caption, align, 'center', 'center', 'center'
              , visible, sortable, true, false, true, false
              , readonly, width, colIndex, rowIndex, 1
              , bandindex , filterable 
                );
  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;               
}

function AppendMaskColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex) {
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'left';
  if (AMoving == undefined) AMoving = true;
  
  var idx = grid.AddColumnHeader('mask', caption, align, 'center', 'center', 'center'
              , visible, sortable, true, false, true, false
              , readonly, width, colIndex, rowIndex, 1
              , bandindex , filterable 
                );
  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;               

}

function AppendTextAColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextHColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextNColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextAHColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextANColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextHNColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function AppendTextAHNColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  AppendTextColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex);
}

function ShowSeq(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  
}

function AppendDateColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'left';
  if (AMoving == undefined) AMoving = true;

  var idx = grid.AddColumnHeader('date', caption, align, 'center', 'center', 'center'
              , visible, sortable, true, false, true, false
              , readonly, width, colIndex, rowIndex, 1
              , bandindex , filterable 
                );
  var columnObj = grid.GetColumn(idx);
  columnObj.Moving = AMoving;                     
}

function AppendIntColumnHeader(grid, caption, width, visible, sortable, filterable, readonly, align, AMoving, colIndex, rowIndex, bandindex){
  if (colIndex == undefined) colIndex = -1;
  if (rowIndex == undefined) rowIndex = -1;
  if (bandindex == undefined) bandindex = 0;
  if (sortable == undefined) sortable = false;
  if (filterable == undefined) filterable = true;
  if (readonly == undefined) readonly = true;
  if (align == undefined) align = 'left';
  if (AMoving == undefined) AMoving = true;

  var idx = grid.AddColumnHeader('text', caption, align, 'center', 'center', 'center'
              , visible, sortable, true, false, true, false
              , readonly, width, colIndex, rowIndex, 1
              , bandindex , filterable 
                );
  var columnObj = grid.GetColumn(idx);
  columnObj.ValueType = "integer";
}
/******************************************************************************
name=Å°°ª   |width=0  |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=cre_date |width=0  |type=HIDDEN  |sort=N|edit=N|find=Y|align=CENTER;
name=cre_time |width=0  |type=HIDDEN  |sort=N|edit=N|find=Y|align=CENTER;
name=rejectsayu |width=0  |type=HIDDEN  |sort=N|edit=N|find=Y|align=CENTER;
name=¼±ÅÃ   |width=50 |type=RADIO   |sort=N|edit=Y|find=N|align=CENTER;
name=½ÅÃ»ÀÏÀÚ |width=90 |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=Åë È­    |width=60 |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=°³¼³±Ý¾× |width=100  |type=STRINGN |sort=Y|edit=N|find=Y|align=RIGHT;
name=¼±Àû±âÀÏ |width=90 |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=À¯È¿±âÀÏ |width=90 |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=½Å¿ëÀå¹øÈ£ |width=100  |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
name=Á¢¼ö»óÅÂ |width=87 |type=STRING  |sort=Y|edit=N|find=Y|align=CENTER;
 *****************************************************************************/
function initSecond(grid, columnheader_def, titlename)
{
  try{
    grid.BeginUpdate();
    grid.GridName = titlename;
    
    InitGridDesign(grid , 0, 0, "¾¾Æ¼ÀºÇà", titlename, "189, 207, 231", "0,0,0", "BOLD", true, false, 10, 1);
    
    var arr = columnheader_def.split(';');
    var i, j, strLine, opst;
    var op, value, spIndex;
    grid.ClearAllObj();
  
    var vName, vWidth, vType, vSort;
    var vEdit, vFind, vAlign, visible;
  
    for(i=0;i<arr.length;i++)
    {
      strLine = arr[i];
      if(strLine == '') continue;
      strLine = strLine.split('|');
  
      vName = '';
      vWidth = 0;
      vType = '';
      vSort = true;
      vEdit = true;
      vFind = true;
      vAlign = 'center';
  
      for(j=0;j<strLine.length;j++)
      {
        opst = strLine[j];
        spIndex = opst.search('=');
        op = opst.substr(0, spIndex);
        value = opst.substr(spIndex+1, opst.length-spIndex-1);
        op = op.toLowerCase();
        value = value.toLowerCase();
  //alert(op + '\n' + value);
        if(op == 'name'){
  //alert(op + '\n' + 'vName = value;' + '\n' + vName);
          vName = opst.substr(spIndex+1, opst.length-spIndex-1);
        }else if(op == 'width'){
  //alert(op + '\n' + 'vWidth = value;' + '\n' + vWidth);
          vWidth = value;
        }else if(op == 'type'){
  //alert(op + '\n' + 'vType = value;' + '\n' + vType);
          vType = value;
        }else if(op == 'sort'){
  //alert(op + '\n' + 'vSort = value;' + '\n' + vSort);
          vSort = (value == 'y') ? true : false;
        }else if(op == 'edit'){
  //alert(op + '\n' + 'vEdit = value;' + '\n' + vEdit);
          vEdit = (value == 'y') ? false : true;
        }else if(op == 'find'){
  //alert(op + '\n' + 'vFind = value;' + '\n' + vFind);
          vFind = (value == 'y') ? true : false;
        }else if(op == 'align'){
  //alert(op + '\n' + 'vAlign = value;' + '\n' + vAlign);
          vAlign = value;
        }
        //name=¼±ÅÃ   |width=50 |type=RADIO   |sort=N|edit=Y|find=N|align=CENTER;
      }
      //if( strLine.length <= 1 ) continue;

/*
  alert(strLine.length + '\n\n' + '"' + vName + '", '+
  '"' + vWidth + '", '+
  '"' + vType + '", '+
  '"' + vSort + '", '+
  '"' + vEdit + '", '+
  '"' + vFind + '", '+
  '"' + vAlign + '"');
*/
      if(vName == 'Å°°ª') visible = false;
      else visible = true;
      // ¿©±â¼­ ÄÃ·³ ÇØ´õ Á¤ÀÇÇØÁÖ±â. 
      if( vType.search('choice') >= 0 )
        {
          ;
        }
        else if( vType.search('boolean') >= 0 )
        {
//alert("vType.search('boolean')");
          AppendCheckColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('check') >= 0 )
        {
//alert("vType.search('check')");
          AppendCheckColumnHeader2(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('radio') >= 0 )
        {
//alert("vType.search('radio')");
          AppendRadioColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('currency') >= 0 )
        {
//alert("vType.search('currency')");
          AppendCurrencyColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('hidden') >= 0 )
        {
//alert("vType.search('hidden')");
        visible = false;
          AppendTextColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringhn') >= 0 )
        {
//alert("vType.search('stringhn')");
          AppendTextHNColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringah') >= 0 )
        {
//alert("vType.search('stringah')");
          AppendTextAHColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringan') >= 0 )
        {
//alert("vType.search('stringan')");
          AppendTextANColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringahn') >= 0 )
        {
//alert("vType.search('stringahn')");
          AppendTextAHNColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringa') >= 0 )
        {
//alert("vType.search('stringa')");
          AppendTextAColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringh') >= 0 )
        {
//alert("vType.search('stringh')");
          AppendTextHColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('stringn') >= 0 )
        {
//alert("vType.search('stringn')");
          AppendTextNColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('string') >= 0 )
        {
//alert("vType.search('string')");
          AppendTextColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('seq') >= 0 )
        {
//alert("vType.search('seq')");
          ShowSeq(grid, vName, vWidth, visible, vSort, filterable, vEdit, vAlign);
        }
        else if( vType.search('date') >= 0 )
        {
//alert("vType.search('date')");
          AppendTextColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else if( vType.search('int') >= 0 )
        {
//alert("vType.search('int')");
          AppendIntColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
        else
        {
//alert("Default");
          AppendTextColumnHeader(grid, vName, vWidth, visible, vSort, true, vEdit, vAlign);
        }
    }
  }catch(e){
    
  }finally{
    grid.EndUpdate();
    grid.LoadFromRegstry();
  }
}


/******************************************************************************
   XGridÀÇ Å×¸¶¸¦ ¼³Á¤ÇÏ´Â ÇÔ¼ö
 *****************************************************************************/
function InitGridDesign( grid , XH, XW, XBankName, XAppletTitle, XTitleBackColor, XTitleForeColor, XFontStyle, XCheckboxAll, XSetnoseq, XPrintFontSize, XOrientation) {
  if (XBankName == undefined)   XBankName   = "¾¾Æ¼ÀºÇà";   
  if (XAppletTitle == undefined)  XAppletTitle  = "-";  
  if (XTitleBackColor == undefined) XTitleBackColor = "235, 235, 235";      
  if (XTitleForeColor == undefined) XTitleForeColor = "102, 102, 102";      
  if (XFontStyle == undefined)    XFontStyle    = "BOLD";
  if ((XCheckboxAll == undefined) || (XCheckboxAll == '') )     XCheckboxAll = "false";
  if (XSetnoseq == undefined)     XSetnoseq = "false";

  with( grid ) {
    /*
    if (XOrientation == undefined)
      grid.PrintOrientation = 1;
    else
      grid.PrintOrientation = XOrientation;

    if (XPrintFontSize == undefined)
      grid.PrintFontSize = 10;
    else
      grid.PrintFontSize = XPrintFontSize;
      
    Indicator = true;
    IndicatorShowSeq = true;
    IndicatorWidth = 40;
    AutoWidth = false;
    */
    GridName = XAppletTitle;
    BankName = XBankName;
    // »ç¿ëÀÚ Á¤º¸(ini)ÆÄÀÏ ÀúÀå À§Ä¡ ÁöÁ¤
    // ÁöÁ¤ ÇÏÁö ¾ÊÀ¸¸é ±âº» Æú¼­ »ý¼ºµÊ.
    DefaultPath = GetSystemDirInfo.substring(0,2) + '\\citibank\\';
    PrintFontSize = XPrintFontSize;
    //alert('"'+XCheckboxAll+'"');
    XCheckboxAll = true;
    if((XCheckboxAll == true) || (XCheckboxAll == 'true'))
      CheckBoxAll = true;
    
    GridFontName = '±¼¸²';
    GridFontSize = 9;  //FontSize Á¶Á¤ .. ±âº»Àº 9
    SetLanguage('kor');   //ÇÑ±Û : kor , ¿µ¹® : eng
    //SetLanguage('eng');   //ÇÑ±Û : kor , ¿µ¹® : eng
    //GridLineColor = RgbColor(204, 204, 204);
    GridLineColor = RgbColor(211, 211, 211);
    HeaderBorderColor = RgbColor(255, 255, 255);
    HeaderHeight = 20;
    CellHeight = 20;
    //Footer = true;
    Footer = false;
    GridLine_set = 'B'; //±×¸®µå ¶óÀÎÁöÁ¤ H-°¡·Î, V-¼¼·Î, B-¾çÂÊ´Ù, N-¶óÀÎ¾øÀ½.
    

    // Indicator º¸¿©ÁÖÁö ¾ÊÀ½
    Indicator = true;
    IndicatorShowSeq = true;
    IndicatorWidth = 40;
    AutoWidth = false;
    
    // »ó¼¼º¸±â ±â´É »ç¿ë ¾ÈÇÔ.
    DetailFrameWidth = 1;
    DetailFrameColor = RgbColor(204, 204, 204);
    DetailedView = true; // ´õºíÅ¬¸¯½Ã »ó¼¼º¸±â ¿©ºÎ
    FooterFrameStyle = lfFlat;
    FooterSeparatorColor = RgbColor(204, 204, 204);
    
    FooterLineColor = RgbColor(231, 231, 231);
    
    FooterBorderColor = RgbColor(204, 204, 204); //À§ÀÇ FooterLineColor¿Í °°°ÔÇÏ¸é ¾Èº¸ÀÓ..
    
    PrintPageHeaderVisible = true; // PageHeader º¸¿©ÁÙÁö ¿©ºÎ
    
    // °Ë»ö Á¶°Ç ¸ðµç ÆäÀÌÁö¿¡ º¸¿©ÁÙÁö ¿©ºÎ                  
    //PrintPageTitleConditionVisible = true;               
                                                            
    // GridHeaderºÎºÐ ¸ðµç ÆäÀÌÁö¿¡ Ãâ·ÂÇÒÁö ¿©ºÎ             
    //trueÀÏ¶§´Â ¸ðµç ÆäÀÌÁö¿¡ º¸¿©ÁÖ°í falseÀÏ¶§´Â Ã¹ÆäÀÌÁö¸¸
    //PrintRepaintGridHeader = true;                       

    // È¦¼ö¶óÀÎ Â¦¼ö ¶óÀÎ¸¶´Ù »ö±òÀÌ ´Ù¸£¹Ç·Î ¼ÂÆÃÇØÁÝ´Ï´Ù.
    SetStyleProperty(snContentOdd, spColor, RgbColor(239, 235, 239)); // ¾¾Æ¼ÀºÇà
    //SetStyleProperty(snContentOdd, spColor, RgbColor(235, 235, 235)); // hsbc
    //SetStyleProperty(snFooter, spColor, RgbColor(245, 245, 245));
    SetStyleProperty(snFooter, spColor, RgbColor(231, 231, 231));
    SetStyleProperty(snFooter, spFontSize,    9);   //FontSize Á¶Á¤ .. ±âº»Àº 9 

    // [ AStyleType, AProperty, AValue ] ¸ðµç ÆÄ¶ó¸ÞÅÍ ÇÊ¼ö
    if(XTitleBackColor.length = 3)
      eval("SetStyleProperty(snHeader, spColor,     RgbColor(" + XTitleBackColor + "))");
    else
      SetStyleProperty(snHeader, spColor,     RgbColor(235, 235, 235));
    
    SetStyleProperty(snHeader, spFontName,    'Gulim');
    SetStyleProperty(snHeader, spFontSize,    9);    //ÄÃ·³ FontSize Á¶Á¤ .. ±âº»Àº 9                                         
    //SetStyleProperty(snHeader, spFontStyle,   fsBold);
    
    if(XTitleForeColor.length = 3)
      eval("SetStyleProperty(snHeader, spTextColor,   RgbColor(" + XTitleForeColor + "))");
    else
      SetStyleProperty(snHeader, spTextColor,   RgbColor(102, 102, 102));

    SetStyleProperty(snBandHeader, spColor, RgbColor(204, 204, 204));
    //SetStyleProperty(snBandHeader, spFontColor, RgbColor( , , ));
    //SetStyleProperty(snBandHeader, spFontHeight,  -11);                                           
    SetStyleProperty(snBandHeader, spFontName,  '±¼¸²');                                        
    //SetStyleProperty(snBandHeader, spFontSize,  9);                                             
    //SetStyleProperty(snBandHeader, spFontStyle, fsBold); 
    //SetStyleProperty(snBandHeader, spTag,   1);                                             
    SetStyleProperty(snBandHeader, spTextColor, RgbColor(0, 0, 0));

    // Çà¼±ÅÃ½Ã »ö»ó
    SetStyleProperty(snSelection, spColor,  RgbColor(204, 218, 232)); // ¾¾Æ¼ÀºÇà
    //SetStyleProperty(snSelection, spColor,  RgbColor(255, 228, 228)); // HSBC
    //SetStyleProperty(snSelection, spFontColor,  RgbColor( 0, 0, 128));
    //SetStyleProperty(snSelection, spFontHeight, -11);                                           
    //SetStyleProperty(snSelection, spFontName, '±¼¸²');                                        
    //SetStyleProperty(snSelection, spFontSize, 9);                                             
    //SetStyleProperty(snSelection, spFontStyle,  fsBold | fsItalic | fsUnderline | fsStrikeOut); 
    //SetStyleProperty(snSelection, spTag,    1);                                             
    SetStyleProperty(snSelection, spTextColor,  RgbColor(0, 0, 0));

    SetStyleProperty(snInactive, spColor, RgbColor(204, 218, 232)); // ¾¾Æ¼ÀºÇà
    //SetStyleProperty(snInactive, spColor, RgbColor(255, 228, 228)); // hsbc
    //SetStyleProperty(snInactive, spFontColor, RgbColor( , , ));                               
    //SetStyleProperty(snInactive, spFontHeight,  -11);                                           
    //SetStyleProperty(snInactive, spFontName,  '±¼¸²');                                        
    //SetStyleProperty(snInactive, spFontSize,  9);                                             
    //SetStyleProperty(snInactive, spFontStyle, fsBold | fsItalic | fsUnderline | fsStrikeOut); 
    //SetStyleProperty(snInactive, spTag,     1);                                             
    SetStyleProperty(snInactive, spTextColor, RgbColor(0, 0, 0));
    
    SetStyleProperty(snIndicator, spColor,    RgbColor(255, 255, 255));                               
    SetStyleProperty(snIndicator, spFontColor,  RgbColor(102, 102, 102));                               
    //SetStyleProperty(snIndicator, spFontHeight, -11);                                           
    SetStyleProperty(snIndicator, spFontName, '±¼¸²');                                        
    SetStyleProperty(snIndicator, spFontSize, 9);                                             
    //SetStyleProperty(snIndicator, spFontStyle,  fsBold | fsItalic | fsUnderline | fsStrikeOut); 
    //SetStyleProperty(snIndicator, spTag,    1);                                             
    SetStyleProperty(snIndicator, spTextColor,  RgbColor(0, 0, 0));                               

    SetStyleProperty(snIndicator, spColor,    RgbColor(236 ,242 ,249 ));                               
    //SetStyleProperty(snIndicator, spFontColor,  RgbColor( , , ));                               
    //SetStyleProperty(snIndicator, spFontHeight, -11);                                           
    //SetStyleProperty(snIndicator, spFontName, '±¼¸²');                                        
    //SetStyleProperty(snIndicator, spFontSize, 9);                                             
    //SetStyleProperty(snIndicator, spFontStyle,  fsBold | fsItalic | fsUnderline | fsStrikeOut); 
    //SetStyleProperty(snIndicator, spTag,    1);                                             
    SetStyleProperty(snIndicator, spTextColor,  RgbColor(0 ,0 ,0 ));

    //SetStyleProperty(snContent, spFontColor,    RgbColor(255, 0, 0));
    //SetStyleProperty(snContent, spTextColor,    RgbColor(255, 0, 0));
  /*
    SetStyleProperty(snContent, spColor,    RgbColor(0, 255, 0));
    SetStyleProperty(snContent, spFontColor,  RgbColor( , , ));                               
    SetStyleProperty(snContent, spFontHeight, -11);                                           
    SetStyleProperty(snContent, spFontName,   '±¼¸²');                                        
    SetStyleProperty(snContent, spFontSize,   9);                                             
    SetStyleProperty(snContent, spFontStyle,  fsBold | fsItalic | fsUnderline | fsStrikeOut); 
    SetStyleProperty(snContent, spTag,      1);                                             
    SetStyleProperty(snContent, spTextColor,  RgbColor(82, 85, 82));


    SetStyleProperty(snBackground, spColor,   RgbColor(, , ));
    SetStyleProperty(snBackground, spFontColor, RgbColor( , , ));
    SetStyleProperty(snBackground, spFontHeight,-11);
    SetStyleProperty(snBackground, spFontName,  '±¼¸²');
    SetStyleProperty(snBackground, spFontSize,  9);
    SetStyleProperty(snBackground, spFontStyle, fsBold | fsItalic | fsUnderline | fsStrikeOut);
    SetStyleProperty(snBackground, spTag,   1);
    SetStyleProperty(snBackground, spTextColor, RgbColor( , , ));
  */
  
   grid.setIndicatorHeaderFooterText("No","");
   grid.PrintEnvSave = true;   
   grid.CellMergedPrint = true;
  }
}

/**************************************************************************
 * ÄÃ·³ÀÇ ³ÐÀÌ°¡ ±×¸®µå ÀüÃ¼º¸´Ù ÀÛÀ»¶§ ¸¶Áö¸· 
 * ÄÃ·³À» ±×¸®µå ÀüÃ¼ ±æÀÌ±îÁö ¸ÂÃß´Â ÇÔ¼ö
 * xGridObj  : ±×¸®µå °´Ã¼
 **************************************************************************/
 
 function stretchWidth(xGridObj){
 var gridWidth = 0;
    var gridLastColumn = 0;
    for(var i=0; i<xGridObj.ColumnCount;i++){   //±×¸®µå ÀüÃ¼ ÄÃ·³°¹¼ö¸¸Å­ loopÇÑ´Ù.
        if(xGridObj.GetColumn(i).visible==true){        //°¢±×¸®µå ÄÃ·³ÀÇ visible¼Ó¼ºÀÌ true(È­¸é¿¡ º¸ÀÌ´Â ÄÃ·³)ÀÎ °Í¸¸ 
            gridWidth += xGridObj.GetColumn(i).width;   //°¢ ±×¸®µå ÄÃ·³ÀÇ ³ÐÀÌ¸¦ ´õÇÑ´Ù.
            gridLastColumn = i;                         //¸Ç ¸¶Áö¸· ÄÃ·³ÀÇ index°ªÀ» ±¸ÇÑ´Ù.
        }
    }
            
    //ÄÃ·´³ÐÀÌÇÕÀÌ ÀüÃ¼ ŒÀÌº¸´Ù ÀÛÀ»¶§¸¸
    if(xGridObj.clientWidth>gridWidth){
        //¸¶Áö¸· ÄÃ·³ÀÇ ³ÐÀÌ¸¦ ÀÚ½ÅÀÇ ³ÐÀÌ + ±×¸®µå°´Ã¼ÀÇ ÀüÃ¼ ³ÐÀÌ¿¡¼­ À§¿¡¼­ °¢°¢ ´õÇÑ ±×¸®µåÀÇ ³ÐÀÌ¸¦ »« ³ª¸ÓÁö - ¿©¹é20
        //xGridObj.GetColumn(gridLastColumn).width=xGridObj.GetColumn(gridLastColumn).width + (xGridObj.clientWidth-gridWidth)-20;        
        //xGridObj.GetColumn(gridLastColumn).width= xGridObj.clientWidth-gridWidth + 23;        
        
        xGridObj.GetColumn(gridLastColumn).width= xGridObj.clientWidth-gridWidth;        
    }
}
 
function Trim(str)
{
	str = TrimLeft(str);
	str = TrimRight(str);
	return str;
}

function TrimLeft(str)
{
	var i;
	for(i=0;i<str.length;i++)
		if( str.charAt(i) != ' ' ) break;
	return str.substr(i, str.length-i+1);
}

function TrimRight(str)
{
	var i;
	for(i=str.length-1;i>=0;i--)
		if( str.charAt(i) != ' ' )
			break;
	return str.substr(0, i+1);
}

function go_enote_no(obj1,obj2){
    if(obj1.selectedIndex == 0){
        obj2.value = "";
        obj2.disabled = true;
    } else {
        obj2.disabled = false;
    }    
}
