//##############################################################################
//# ÇÁ·Î±×·¥ID : base.js
//# ÆäÀÌÁö¼³¸í : ¸ðµç »çÀÌÆ® °øÅë ½ºÅ©¸³Æ®
//# ÃÖÃÊÀÛ¼ºÀÚ : ±è¿Õ±â
//# ÃÖÃÊÀÛ¼ºÀÏ : 2007.10.05 (±Ý)
//# ÃÖÁ¾¼öÁ¤ÀÚ : ±è¿Õ±â
//# ÃÖÁ¾¼öÁ¤ÀÏ : 2008.01.26 (Åä)
//#
//#
//# === °ËÁõ °ü·Ã ==============================================================
//# ---> Is_IE()                                       ===> ºê¶ó¿ìÀú CHECK
//# ---> Is_Empty(strText)                             ===> °ø¹é¹®ÀÚ¿­ CHECK
//#      If_Empty(strText, strSub)
//# ---> Is_Digit(strText)                             ===> ¼ýÀÚ CHECK
//#      If_Not_Digit(strText, strSub)
//# ---> Is_English(strText)                           ===> ¿µ¾î CHECK
//#      If_Not_English(strText, strSub)
//# ---> Is_Digit_English(strText)                     ===> ¼ýÀÚ¿µ¾î CHECK
//#      Is_Digit_English_Hangeul(strText, strSub)     ===> ¼ýÀÚ¿µ¾îÇÑ±Û CHECK
//# ---> Is_Hangeul(strText)                           ===> ÇÑ±Û CHECK
//#      If_Not_Hangeul(strText, strSub)
//#
//# ---> Is_Email(strText)                             ===> ÀÌ¸ÞÀÏ ÀüÃ¼ Ã¼Å©
//#      Is_Email1(strText)                            ===> ÀÌ¸ÞÀÏ ¾ÆÀÌµð Ã¼Å©
//#      Is_Email2(strText)                            ===> ÀÌ¸ÞÀÏ µµ¸ÞÀÎ Ã¼Å©
//#
//# ---> Img_Ext_Check(strText)                        ===> ÀÌ¹ÌÁö È®ÀåÀÚ CHECK
//#
//# === ¹®ÀÚ¿­ °ü·Ã ============================================================
//# ---> Trim_String(strText)                          ===> ÁÂ¿ì°ø¹é Á¦°Å
//# ---> Parse_Property(strProps, strToken)            ===> ÇÁ·ÎÆÛÆ¼ ÆÄ½Ì
//#
//#
//# === Æû °ü·Ã ==========================================================
//# ---> Trim_Element(objEle)                          ===> ¿¤¸®¸ÕÆ® °ª ÁÂ¿ì°ø¹é Á¦°Å
//# ---> Trim_Text_Elements(objForm)                   ===> TEXT(TEXTAREA) °ª ÁÂ¿ì°ø¹é Á¦°Å
//# ---> Get_Checked_Values(objEle, strDilim)          ===> CHECKBOX(RADIO)ÀÇ ¼±ÅÃ°ª
//#
//#
//# === ¿¤¸®¸ÕÆ® °ü·Ã ==========================================================
//# ---> Get_Elements_By_Class(strCls, strTag, strPid) ===> Å¬·¡½º¸íÀ¸·Î ¿¤¸®¸ÕÆ® °Ë»ö
//# ---> Ignore_White_Space(objEle)                    ===> ºó ÅØ½ºÆ®³ëµå Á¦°Å
//# ---> Get_PositionX(objEle)                         ===> BODY¸¦ ±âÁØÀ¸·Î ¿¤¸®¸ÕÆ®ÀÇ XÁÂÇ¥ °è»ê
//# ---> Get_PositionY(objEle)                         ===> BODY¸¦ ±âÁØÀ¸·Î ¿¤¸®¸ÕÆ®ÀÇ YÁÂÇ¥ °è»ê
//# ---> Order_Element_Prev(objEle)                    ===> °°Àº ºÎ¸ð³»¿¡¼­ ÀÌÀü ¼ø¼­·Î ÀÌµ¿
//# ---> Order_Element_Next(objEle)                    ===> °°Àº ºÎ¸ð³»¿¡¼­ ´ÙÀ½ ¼ø¼­·Î ÀÌµ¿
//#
//#
//# === ÄÁÅÙÃ÷ °ü·Ã ============================================================
//# ---> jsPopup(strUrl, strName, strProps)            ===> ÆË¾÷
//# ---> jsInsertFlash(strUrl, strProps)               ===> ÇÃ·¡½Ã
//# ---> Create_Layer(strId, strSrc, blnIsFile)        ===> ·¹ÀÌ¾î »ý¼º
//#
//#
//# === ÀÌº¥Æ® °ü·Ã ============================================================
//# ----> Attach_Event(strEvent, objFunc)              ===> À©µµ¿ì ÀÌº¥Æ® Ãß°¡
//#
//#
//# === ÀÌ¸ÞÀÏ Ã¼Å©  ==============================================================
//#
//#
//# === AJAX °ü·Ã ==============================================================
//# ---> Create_XMLHTTP()                              ===> XMLHTTP °´Ã¼ »ý¼º
//# ---> Get_Source(strUrl)                            ===> ÆÄÀÏ ³»¿ë ÃßÃâ
//# ---> Include_File(strUrl, strId)                   ===> ÆÄÀÏ ÀÎÅ¬·çµå
//##############################################################################
//



//==============================================================================
// Á¤±Ô½Ä Á¤ÀÇ
//==============================================================================
var JS_CONST_REGEXP_DIGIT   = /^[0-9]+$/;
var JS_CONST_REGEXP_ENGLISH = /^[a-zA-Z]+$/;
var JS_CONST_REGEXP_HANGEUL = /^[¤¡-¤¾°¡-ÆR]+$/;
var JS_CONST_REGEXP_TRIM    = /(^[\s]*)|([\s]*$)/g;
var JS_CONST_REGEXP_DIGIT_ENGLISH = /^[0-9a-zA-Z]+$/;
var JS_CONST_REGEXP_DIGIT_ENGLISH_HANGEUL = /^[0-9a-zA-Z¤¡-¤¾°¡-ÆR]+$/;
var JS_CONST_REGEXP_EMAIL1 = /^[a-zA-Z0-9\-\.\_]+$/;
var JS_CONST_REGEXP_EMAIL2 = /^[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})+$/;


//==============================================================================
// °ËÁõ °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // ºê¶ó¿ìÀú CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_IE()
     * @return
     *      ºê¶ó¿ìÀú°¡ IEÀÎÁöÀÇ ³í¸®°ª
     * @description
     *      ºÒ¿ÏÀü... ³ªÁß¿¡ ·ÎÁ÷ Ãß°¡...
     */
    function Is_IE() {
        return (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1);
    }


    //--------------------------------------------------------------------------
    // °ø¹é¹®ÀÚ¿­ CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Empty(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      °ø¹é¹®ÀÚ¿­ÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_Empty(strText) {
        if (strText != null) {
            return (strText.toString().replace(JS_CONST_REGEXP_TRIM, "").length == 0);
        }
        else {
            return true;
        }
    }

    /***
     * @function
     *      If_Empty(strText, strSub)
     * @used
     *      Is_Empty(strText)
     * @param
     *      strText °ËÁõ¹®ÀÚ¿­
     *      strSub  ´ëÃ¼¹®ÀÚ¿­
     * @return
     *      °ø¹é¹®ÀÚ¿­ ¿©ºÎ¿¡ µû¸¥ °ËÁõ¹®ÀÚ¿­ ¶Ç´Â ´ëÃ¼¹®ÀÚ¿­
     */
    function If_Empty(strText, strSub) {
        return (Is_Empty(strText) ? strSub : strText);
    }

    //--------------------------------------------------------------------------
    // ¼ýÀÚ CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Digit(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¼ýÀÚÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_Digit(strText) {
        return (strText != null) && (JS_CONST_REGEXP_DIGIT.test(strText));
    }

    /***
     * @function
     *      If_Not_Digit(strText, strSub)
     * @used
     *      Is_Digit(strText)
     * @param
     *      strText °ËÁõ¹®ÀÚ¿­
     *      strSub  ´ëÃ¼¹®ÀÚ¿­
     * @return
     *      ¼ýÀÚÀÎÁöÀÇ ¿©ºÎ¿¡ µû¸¥ °ËÁõ¹®ÀÚ¿­ ¶Ç´Â ´ëÃ¼¹®ÀÚ¿­
     */
    function If_Not_Digit(strText, strSub) {
        return (Is_Digit(strText) ? strText : strSub);
    }

    //--------------------------------------------------------------------------
    // ¿µ¾î CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_English(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¿µ¹®ÀÚÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_English(strText) {
        return (strText != null) && (JS_CONST_REGEXP_ENGLISH.test(strText));
    }

    //--------------------------------------------------------------------------
    // ¼ýÀÚ + ¿µ¾î CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Digit_English(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¿µ¹®ÀÚÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_Digit_English(strText) {
        return (strText != null) && (JS_CONST_REGEXP_DIGIT_ENGLISH.test(strText));
    }

    //--------------------------------------------------------------------------
    // ¼ýÀÚ + ¿µ¾î + ÇÑ±Û CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Digit_English(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¿µ¹®ÀÚÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_Digit_English_Hangeul(strText) {
        return (strText != null) && (JS_CONST_REGEXP_DIGIT_ENGLISH_HANGEUL.test(strText));
    }

    /***
     * @function
     *      If_Not_English(strText, strSub)
     * @used
     *      Is_English(strText)
     * @param
     *      strText °ËÁõ¹®ÀÚ¿­
     *      strSub  ´ëÃ¼¹®ÀÚ¿­
     * @return
     *      ¿µ¹®ÀÚÀÎÁöÀÇ ¿©ºÎ¿¡ µû¸¥ °ËÁõ¹®ÀÚ¿­ ¶Ç´Â ´ëÃ¼¹®ÀÚ¿­
     */
    function If_Not_English(strText, strSub) {
        return (Is_English(strText) ? strText : strSub);
    }

    //--------------------------------------------------------------------------
    // ÇÑ±Û CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Hangeul(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ÇÑ±ÛÀÎÁöÀÇ ³í¸®°ª
     */
    function Is_Hangeul(strText) {
        return (strText != null) && (JS_CONST_REGEXP_HANGEUL.test(strText));
    }

    /***
     * @function
     *      If_Not_Hangeul(strText, strSub)
     * @used
     *      Is_Hangeul(strText)
     * @param
     *      strText °ËÁõ¹®ÀÚ¿­
     *      strSub  ´ëÃ¼¹®ÀÚ¿­
     * @return
     *      ÇÑ±ÛÀÎÁöÀÇ ¿©ºÎ¿¡ µû¸¥ °ËÁõ¹®ÀÚ¿­ ¶Ç´Â ´ëÃ¼¹®ÀÚ¿­
     */
    function If_Not_Hangeul(strText, strSub) {
        return (Is_Hangeul(strText) ? strText : strSub);
    }

    //--------------------------------------------------------------------------
    // ÀÌ¸ÞÀÏ ¾ÆÀÌµð CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Email1(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¿µ¹®¼ýÀÚÇÏÀÌÇÂÀÇ ³í¸®°ª
     */
    function Is_Email1(strText)  {
        return (strText != null) && (JS_CONST_REGEXP_EMAIL1.test(strText));
    }

    //--------------------------------------------------------------------------
    // ÀÌ¸ÞÀÏ µµ¸ÞÀÎ CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Email2(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ¿µ¹®¼ýÀÚÇÏÀÌÇÂÀÇ ³í¸®°ª
     */
    function Is_Email2(strText)  {
        return (strText != null) && (JS_CONST_REGEXP_EMAIL2.test(strText));
    }

    //--------------------------------------------------------------------------
    // ÀÌ¸ÞÀÏ Çü½Ä CHECK
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Is_Email(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ÀÌ¸ÞÀÏ ÇÕ´çÇÑ ³í¸®°ª
     */
    function Is_Email(strText) {
        emailEx1 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z]+/;
        emailEx2 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z]+/;
        emailEx3 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z]+/;

        if(emailEx1.test(strText)) return true;
        if(emailEx2.test(strText)) return true;
        if(emailEx3.test(strText)) return true;

        return false;
    }


//==============================================================================
// ¹®ÀÚ¿­ °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // ÁÂ¿ì°ø¹é Á¦°Å
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Trim_String(strText)
     * @param
     *      strText ¹®ÀÚ¿­
     * @return
     *      ÁÂ¿ì°ø¹éÀÌ Á¦°ÅµÈ ¹®ÀÚ¿­
     */
    function Trim_String(strText) {
        return (strText == null ? null : strText.replace(JS_CONST_REGEXP_TRIM, ""));
    }

    //--------------------------------------------------------------------------
    // ÇÁ·ÎÆÛÆ¼ ÆÄ½Ì
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Parse_Property(strProps, strToken)
     * @used
     *      Is_Empty(strText)
     * @param
     *      strProps ÇÁ·ÎÆÛÆ¼Çü½Ä ¹®ÀÚ¿­
     *      strToken ±¸ºÐÀÚ
     * @return
     *      Å°¿Í °ªÀ¸·Î ÀÌ·ç¾îÁø ´ÙÂ÷¿ø ¹è¿­º¯¼ö
     * @description
     *      strPropsÀÇ Çü½ÄÀº "key=value"¿Í °°ÀÌ ÀÛ¼ºÇÏ¸ç strTokenÀº ","°¡ µðÆúÆ®
     *
     *      ex) test = Parse_Property("width=100&height=200&top=50", "&")
     *          test.get("width",  10)  ==> 100
     *          test.get("height", 30)  ==> 200
     *          test.get("top",    0)   ==> 50
     *          test.get("left",   300) ==> 300
     */
    function Parse_Property(strProps, strToken) {
        var aryList  = new Array();

        if (Is_Empty(strProps) == false) {
            var aryItems = strProps.replace(/[\s]/g, "").split(strToken == null ? "," : strToken);
            var intCnt   = 0;

            for (var i=0; i < aryItems.length; i++) {
                if (aryItems[i].indexOf("=") > 0) {
                    var aryTemp = aryItems[i].split("=");

                    if (Is_Empty(aryTemp[0]) == false) {
                        aryList[intCnt] = new Array(aryTemp[0], aryTemp[1]);
                        intCnt = intCnt + 1;
                    }
                }
            }
        }

        aryList.get = function(strKey, strSub) {
            for (var i=0; i < this.length; i++) {
                if (this[i][0] == strKey) return this[i][1];
            }

            return strSub;
        }

        return aryList;
    }


//==============================================================================
// Æû °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // ¿¤¸®¸ÕÆ® °ª ÁÂ¿ì°ø¹é Á¦°Å
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Trim_Element(objEle)
     * @used
     *      Trim_String(strText)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     * @return
     *      ÁÂ¿ì°ø¹éÀÌ Á¦°ÅµÈ ¿¤¸®¸ÕÆ®ÀÇ °ª
     */

    function Trim_Element(objEle) {
        objEle.value = Trim_String(objEle.value);
        return objEle.value;
    }

    //--------------------------------------------------------------------------
    // TEXT(TEXTAREA) ¿¤¸®¸ÕÆ® °ª ÁÂ¿ì°ø¹é Á¦°Å
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Trim_Text_Elements(objForm)
     * @used
     *      Trim_Element(objEle)
     * @param
     *      objForm ¿¤¸®¸ÕÆ®ÀÇ ºÎ¸ðÆû
     */
    function Trim_Text_Elements(objForm) {
        for (var i=0; i < objForm.elements.length; i++) {
            if ((objForm.elements[i].type == "text") || (objForm.elements[i].type == "textarea")) {
                Trim_Element(objForm.elements[i]);
            }
        }
    }

    //--------------------------------------------------------------------------
    // CHECKBOX(RADIO)ÀÇ ¼±ÅÃ°ª
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Get_Checked_Values(objEle, strDilim)
     * @param
     *      objEle   ¿¤¸®¸ÕÆ®
     *      strDilim ±¸ºÐÀÚ
     */
    function Get_Checked_Values(objEle, strDilim) {
        var strValues = "";

        if (strDilim == null) strDilim = ",";

        if (objEle.length) {
            for (var i=0; i < objEle.length; i++) {
                if (objEle[i].checked) strValues = strValues + strDilim + objEle[i].value;
            }
        }
        else {
            if (objEle.checked) strValues = objEle.value;
        }

        return strValues.replace(new RegExp("^[" + strDilim + "]"), "");
    }


//==============================================================================
// ¿¤¸®¸ÕÆ® °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // Å¬·¡½º¸íÀ¸·Î ¿¤¸®¸ÕÆ® °Ë»ö
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Get_Elements_By_Class(strCls, strTag, strPid)
     * @param
     *      strCls Å¬·¡½º¸í
     *      strTag ÅÂ±×¸í
     *      strPid ºÎ¸ðID
     * @return
     *      °Ë»öµÈ ¿¤¸®¸ÕÆ®°¡ ÀúÀåµÈ ¹è¿­º¯¼ö
     */
    function Get_Elements_By_Class(strCls, strTag, strPid) {
        var aryList   = new Array();
        var objParent = document.getElementById(strPid);
        var aryEles   = (objParent == null ? document : objParent).getElementsByTagName(strTag == null ? "*" : strTag);
        var intCnt    = 0;

        for (var i=0; i < aryEles.length; i++) {
            if (aryEles[i].className.match(strCls)) {
                aryList[intCnt] = aryEles[i];
                intCnt = intCnt + 1;
            }
        }
        return aryList;
    }

    //--------------------------------------------------------------------------
    // ºó ÅØ½ºÆ®³ëµå Á¦°Å
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Ignore_White_Space(objEle)
     * @used
     *      Is_Empty(strText)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     */
    function Ignore_White_Space(objEle) {
        for (var i=0; i < objEle.childNodes.length; i++) {
            var objNode = objEle.childNodes[i];

            if ((objNode.nodeType == 3) && (Is_Empty(objNode.nodeValue))) {
                objEle.removeChild(objNode);
                i = i - 1;
            }
            else {
                Ignore_White_Space(objNode);
            }
        }
    }

    //--------------------------------------------------------------------------
    // BODY¸¦ ±âÁØÀ¸·Î ¿¤¸®¸ÕÆ®ÀÇ XÁÂÇ¥ °è»ê
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Get_PositionX(objEle)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     * @return
     *      ¿¤¸®¸ÕÆ®ÀÇ XÁÂÇ¥
     */
    function Get_PositionX(objEle) {
        var intX = 0;

        do {
            intX += objEle.offsetLeft;
            objEle = objEle.offsetParent;
        }
        while (objEle != document.body);

        return intX;
    }

    //--------------------------------------------------------------------------
    // BODY¸¦ ±âÁØÀ¸·Î ¿¤¸®¸ÕÆ®ÀÇ YÁÂÇ¥ °è»ê
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Get_PositionY(objEle)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     * @return
     *      ¿¤¸®¸ÕÆ®ÀÇ YÁÂÇ¥
     */
    function Get_PositionY(objEle) {
        var intY = 0;

        do {
            intY += objEle.offsetTop;
            objEle = objEle.offsetParent;
        }
        while (objEle != document.body);

        return intY;
    }

    //--------------------------------------------------------------------------
    // °°Àº ºÎ¸ð³»¿¡¼­ ÀÌÀü ¼ø¼­·Î ÀÌµ¿
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Order_Element_Prev(objEle)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     * @description
     *      ºÎ¸ð¿¤¸®¸ÕÆ®°¡ °°Àº ¿¤¸®¸ÕÆ®°£ÀÇ ¼ø¼­ Á¶Á¤
     */
    function Order_Element_Prev(objEle) {
        var objParent = objEle.parentNode;
        var objPrev   = objEle.previousSibling;

        while (objPrev != null) {
            if ((objPrev.nodeType == 1) && (objPrev.style.display != "none")) {
                break;
            }
            else {
                objPrev = objPrev.previousSibling;
            }
        }

        if (objPrev != null) {
            objParent.removeChild(objEle);
            objParent.insertBefore(objEle, objPrev);
        }
    }

    //--------------------------------------------------------------------------
    // °°Àº ºÎ¸ð³»¿¡¼­ ´ÙÀ½ ¼ø¼­·Î ÀÌµ¿
    //--------------------------------------------------------------------------
    /***
     * @function
     *      Order_Element_Next(objEle)
     * @used
     *      jsIsObject(objEle)
     * @param
     *      objEle ¿¤¸®¸ÕÆ®
     * @description
     *      ºÎ¸ð¿¤¸®¸ÕÆ®°¡ °°Àº ¿¤¸®¸ÕÆ®°£ÀÇ ¼ø¼­ Á¶Á¤
     */
    function Order_Element_Next(objEle) {
        var objParent = objEle.parentNode;
        var objNext   = objEle.nextSibling;

        while (objNext != null) {
            if ((objNext.nodeType == 1) && (objNext.style.display != "none")) {
                break;
            }
            else {
                objNext = objNext.nextSibling;
            }
        }

        if (objNext != null) {
            objParent.removeChild(objEle);

            if (objNext.nextSibling == null) {
                objParent.appendChild(objEle);
            }
            else {
                objParent.insertBefore(objEle, objNext.nextSibling);
            }
        }
    }


//==============================================================================
// ÄÁÅÙÃ÷ °ü·Ã
//==============================================================================
    //------------------------------------------------------------------------------
    // ÆË¾÷
    //------------------------------------------------------------------------------
    /***
     * @function
     *     jsPopup(strUrl, strName, strProps)
     * @use
     *     jsParseProperty(strProps, strToken)
     * @param
     *     strUrl   ÆÄÀÏ°æ·Î
     *     strName  À©µµ¿ì ÀÌ¸§
     *     strProps ÇÁ·ÎÆÛÆ¼Çü½Ä ¹®ÀÚ¿­
     * @description
     *     strPropsÀÇ ÇüÅÂ´Â "width=100, height=100" °ú °°ÀÌ ÀÛ¼ºÇÑ´Ù.
     *     - top         À§Ä¡ Y          (0)
     *     - left        À§Ä¡ X          (200)
     *     - width       ³ÐÀÌ            (0)
     *     - height      ³ôÀÌ            (0)
     *     - titlebar    Å¸ÀÌÆ²¹Ù À¯¹«   (no)
     *     - toolbar     Åø¹Ù À¯¹«       (no)
     *     - menubar     ¸Þ´º¹Ù À¯¹«     (no)
     *     - location    ÁÖ¼ÒÃ¢ À¯¹«     (no)
     *     - status      »óÅÂÃ¢ À¯¹«     (no)
     *     - resizable   »çÀÌÁîÁ¶Á¤ À¯¹« (no)
     *     - scrollbars  ½ºÅ©·Ñ¹Ù À¯¹«   (yes)
     *     - copthistory È÷½ºÅä¸® ÀúÀå   (no)
     */
    function jsPopup(strUrl, strName, strProps) {
        var aryPropList = jsParseProperty(strProps, ",");
        var strParam    = "";

        strParam += "top="         + aryPropList.get("top",         "0")   + ", ";
        strParam += "left="        + aryPropList.get("left",        "200") + ", ";
        strParam += "width="       + aryPropList.get("width",       "0")   + ", ";
        strParam += "height="      + aryPropList.get("height",      "0")   + ", ";
        strParam += "titlebar="    + aryPropList.get("titlebar",    "no")  + ", ";
        strParam += "toolbar="     + aryPropList.get("toolbar",     "no")  + ", ";
        strParam += "menubar="     + aryPropList.get("menubar",     "no")  + ", ";
        strParam += "location="    + aryPropList.get("location",    "no")  + ", ";
        strParam += "status="      + aryPropList.get("status",      "no")  + ", ";
        strParam += "resizable="   + aryPropList.get("resizable",   "no")  + ", ";
        strParam += "scrollbars="  + aryPropList.get("scrollbars",  "no")  + ", ";
        strParam += "copyhistory=" + aryPropList.get("copyhistory", "no")  + "  ";

        window.open(strUrl, strName, strParam);

        return strName;
    }

    //--------------------------------------------------------------------------
    // ÇÃ·¡½Ã
    //--------------------------------------------------------------------------
    /***
     * @function
     *     jsInsertFlash(strUrl, strProps)
     * @use
     *     Is_IE()
     *     Parse_Property(strProps, strToken)
     * @param
     *     strUrl   ÆÄÀÏ°æ·Î
     *     strProps ÇÁ·ÎÆÛÆ¼Çü½Ä ¹®ÀÚ¿­
     * @description
     *     strPropsÀÇ ÇüÅÂ´Â "width=100, height=100, align=middle" °ú °°ÀÌ ÀÛ¼ºÇÑ´Ù.
     *     - width   ³ÐÀÌ       (100%)
     *     - height  ³ôÀÌ       (100%)
     *     - align   Á¤·Ä       (middle)
     *     - quality È­Áú       (high)
     *     - bgcolor ¹é±×¶ó¿îµå (#FFFFFF)
     *     - wmode   Åõ¸íµµ     (window)
     */
    function jsInsertFlash(strUrl, strProps) {
        var aryPropList = Parse_Property(strProps, ",");
        var strHtml     = "";
        var strType     = "";

        if (Is_IE()) {
             strType = "classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'";
        }
        else {
             strType = "type='application/x-shockwave-flash'";
        }

        strHtml += "<object " + strType + " data='" + strUrl + "' width='" + aryPropList.get("width", "100%") + "' height='" + aryPropList.get("height", "100%") + "' align='" + aryPropList.get("align", "middle") + "'>" + "\n";
        strHtml += "    <param name='movie'             value='" + strUrl                                + "'>" + "\n";
        strHtml += "    <param name='quality'           value='" + aryPropList.get("quality", "high")    + "'>" + "\n";
        strHtml += "    <param name='bgcolor'           value='" + aryPropList.get("bgcolor", "#FFFFFF") + "'>" + "\n";
        strHtml += "    <param name='wmode'             value='" + aryPropList.get("wmode"  , "window")  + "'>" + "\n";
        strHtml += "    <param name='allowScriptAccess' value='always'>                                       " + "\n";
        strHtml += "</object>                                                                                 " + "\n";

        document.write(strHtml);
    }

    //--------------------------------------------------------------------------
    // ·¹ÀÌ¾î »ý¼º
    //--------------------------------------------------------------------------
    /***
     * @function
     *     Create_Layer(strID, strSrc, blnIsFile)
     * @param
     *     strId     ¿¤¸®¸ÕÆ® ID
     *     strSrc    ÄÁÅÙÃ÷ ¼Ò½º
     *     blnIsFile ÄÁÅÙÃ÷(ÆÄÀÏ/ÅØ½ºÆ®) ÆÇ´Ü ³í¸®°ª
     * @return
     *     ·¹ÀÌ¾î(IFrame) ¿¤¸®¸ÕÆ®
     * @description
     *     select¿Í °ãÄ¡´Â ¹®Á¦¶§¹®¿¡ IFrameÀ¸·Î ·¹ÀÌ¾î¸¦ ±¸¼º
     */
    function Create_Layer(strId, strSrc, blnIsFile) {
        var objLayer = document.getElementById(strId);

        if (objLayer == null) {
            objLayer = document.createElement("iframe");

            objLayer.id             = strId;
            objLayer.frameBorder    = 0;
            objLayer.style.display  = "none";
            objLayer.style.position = "absolute";

            document.body.appendChild(objLayer);

            if (blnIsFile) {
                objLayer.src = strSrc;
            }
            else {
                objLayer.contentWindow.document.open();
                objLayer.contentWindow.document.write(strSrc);
                objLayer.contentWindow.document.close();
            }
        }

        return objLayer;
    }


//==============================================================================
// ÀÌº¥Æ® °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // À©µµ¿ì ÀÌº¥Æ® Ãß°¡
    //--------------------------------------------------------------------------
    /***
     * @function
     *     Attach_Event(strEvent, objFunc)
     * @param
     *     strEvent ÀÌº¥Æ®¸í
     *     objFunc  ½ÇÇàÇÔ¼ö
     */
    function Attach_Event(strEvent, objFunc) {
        if (/^on/i.test(strEvent)) strEvent = strEvent.substring(2);

        if (window.addEventListener) {
            window.addEventListener(strEvent, objFunc, false);
        }
        else {
            window.attachEvent("on" + strEvent, objFunc);
        }
    }


//==============================================================================
// AJAX °ü·Ã
//==============================================================================
    //--------------------------------------------------------------------------
    // XMLHTTP °´Ã¼ »ý¼º
    //--------------------------------------------------------------------------
    /***
     * @function
     *     Create_XMLHTTP()
     * @return
     *     XMLHTTP °´Ã¼
     * @description
     *     Å×½ºÆ®¿ëÀ¸·Î¸¸ »ç¿ëÇÏ°í, ½Ç »õ¹ß½Ã¿¡´Â »ç¿ëÇÏÁö ¾Ê´Â´Ù.
     */
    function Create_XMLHTTP() {
        var objReq = false;

        if (window.XMLHttpRequest) {
            try {
                objReq = new XMLHttpRequest();
            }
            catch (e) {
                objReq = false;
            }
        }
        else if (window.ActiveXObject) {
            try {
                objReq = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    objReq = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    objReq = false;
                }
            }
        }

        return objReq;
    }

    //--------------------------------------------------------------------------
    // ÆÄÀÏ ³»¿ë ÃßÃâ
    //--------------------------------------------------------------------------
    /***
     * @function
     *     Get_Source(strUrl)
     * @use
     *     Is_IE()
     *     Create_XMLHTTP()
     * @param
     *     i_url ÆÄÀÏ°æ·Î
     * @return
     *     XML°´Ã¼ ¶Ç´Â ÆÄÀÏÀÇ ³»¿ë
     * @description
     *     ´ë»ó ÆÄÀÏÀÇ Çü½ÄÀÌ UTF-8 Çü½ÄÀÌ¾î¾ß Á¤»óÀûÀ¸·Î ÀÛµ¿
     *     Å×½ºÆ®¿ëÀ¸·Î¸¸ »ç¿ëÇÏ°í, ½Ç °³¹ß½Ã¿¡´Â »ç¿ëÇÏÁö ¾Ê´Â´Ù.
     * @TODO
     *     onreadystatechange ±¸Çö
     */
    function Get_Source(strUrl) {
        var objSrc = null;
        var objReq = Create_XMLHTTP();
        var strExt = strUrl.substring(strUrl.lastIndexOf(".") + 1).toLowerCase();

        try {
            objReq.open("Get", strUrl, false);
            objReq.send(null);

            switch (strExt) {
                case "xml":
                    objSrc = objReq.responseXML;

                    if ((objSrc.hasChildNodes == false) && Is_IE()) {
                        objSrc = new ActiveXObject("Microsoft.XMLDOM");
                        objSrc.load(strUrl);
                    }
                    break;

                default:
                    objSrc = objReq.responseText;
            }
        }
        catch (e) {
            objSrc = "<strong style='color:#FF0000;'>Get_Source::" + e.message + "</strong>";
        }

        return objSrc;
    }

    //--------------------------------------------------------------------------
    // ÆÄÀÏ ÀÎÅ¬·çµå
    //--------------------------------------------------------------------------
    /***
     * @function
     *     Include_File(strUrl, strId)
     * @use
     *     Get_Source(strUrl)
     * @param
     *     strUrl ÆÄÀÏ°æ·Î
     *     strId  ¿¤¸®¸ÕÆ® ID
     * @description
     *     ´ë»ó ÆÄÀÏÀÇ Çü½ÄÀÌ UTF-8 Çü½ÄÀÌ¾î¾ß Á¤»óÀûÀ¸·Î ÀÛµ¿
     *     Å×½ºÆ®¿ëÀ¸·Î¸¸ »ç¿ëÇÏ°í, ½Ç °³¹ß½Ã¿¡´Â »ç¿ëÇÏÁö ¾Ê´Â´Ù.
     */
    function Include_File(strUrl, strId) {
        var strSrc = Get_Source(strUrl);
        var objEle = document.getElementById(strId);

        if (objEle) {
            objEle.innerHTML = strSrc;
        }
        else {
            document.write(strSrc);
        }
    }

    function File_Check(obj) {

        // ¼±ÅÃÆÄÀÏÀÇ °æ·Î¸¦ ºÐ¸®ÇÏ¿© È®ÀåÀÚ¸¦ ±¸ÇÕ´Ï´Ù.
        PathPoint = obj.lastIndexOf('.');
        FilePoint = obj.substring(PathPoint+1,obj.length);
        ext = FilePoint.toLowerCase();

        // È®ÀåÀÚ°¡ ÀÌ¹ÌÁö ÆÄÀÏÀÌ¸é photo¿¡ º¸¿©ÁÝ´Ï´Ù.
        if((ext == 'zip') || (ext == 'jpg') || (ext == 'gif') || (ext == 'txt') || (ext == 'doc') || (ext == 'pdf') || (ext == 'hwp') || (ext == 'xls') || (ext == 'ppt') || (ext == 'pptx') || (ext == 'xlsx'))
            return true;
        else
        {
            alert("¹®¼­ ¹× ÀÌ¹ÌÁö ÆÄÀÏ¸¸ ¾÷·Îµå °¡´ÉÇÕ´Ï´Ù.");
            return false;
        }
    }

    function Img_Ext_Check(strText) {
        // ¼±ÅÃÆÄÀÏÀÇ °æ·Î¸¦ ºÐ¸®ÇÏ¿© È®ÀåÀÚ¸¦ ±¸ÇÕ´Ï´Ù.
        PathPoint = strText.lastIndexOf('.');
        FilePoint = strText.substring(PathPoint+1,strText.length);
        ext = FilePoint.toLowerCase();

        // È®ÀåÀÚ°¡ ÀÌ¹ÌÁö ÆÄÀÏÀÌ¸é photo¿¡ º¸¿©ÁÝ´Ï´Ù.
        if((ext == 'jpg') || (ext == 'gif'))
            return true;
        else
            return false;
    }


//------------------------------------------------------------------------------
// ÇÁ·ÎÆÛÆ¼ ÆÄ½Ì
//------------------------------------------------------------------------------
/***
 * @function
 *      jsParseProperty(strProps, strToken)
 * @used
 *      jsIsEmpty(strText)
 * @param
 *      strProps ÇÁ·ÎÆÛÆ¼Çü½Ä ¹®ÀÚ¿­
 *      strToken ±¸ºÐÀÚ
 * @return
 *      Å°¿Í °ªÀ¸·Î ÀÌ·ç¾îÁø ´ÙÂ÷¿ø ¹è¿­º¯¼ö
 * @description
 *      strPropsÀÇ Çü½ÄÀº "key=value"¿Í °°ÀÌ ÀÛ¼ºÇÏ¸ç strTokenÀº ","°¡ µðÆúÆ®
 *
 *      ex) test = jsParseProperty("width=100&height=200&top=50", "&")
 *          test.get("width",  10)  ==> 100
 *          test.get("height", 30)  ==> 200
 *          test.get("top",    0)   ==> 50
 *          test.get("left",   300) ==> 300
 */
function jsParseProperty(strProps, strToken) {
    var aryList  = new Array();

    if (jsIsEmpty(strProps) == false) {
        var aryItems = strProps.replace(/[\s]/g, "").split(strToken == null ? "," : strToken);
        var intCnt   = 0;

        for (var i=0; i < aryItems.length; i++) {
            if (aryItems[i].indexOf("=") > 0) {
                var aryTemp = aryItems[i].split("=");

                if (jsIsEmpty(aryTemp[0]) == false) {
                    aryList[intCnt] = new Array(aryTemp[0], aryTemp[1]);
                    intCnt = intCnt + 1;
                }
            }
        }
    }

    aryList.get = function(strKey, strSub) {
        for (var i=0; i < this.length; i++) {
            if (this[i][0] == strKey) return this[i][1];
        }

        return strSub;
    }

    return aryList;
}




//==============================================================================
// Æû °ü·Ã
//==============================================================================
//------------------------------------------------------------------------------
// ¿¤¸®¸ÕÆ® °ª ÁÂ¿ì°ø¹é Á¦°Å
//------------------------------------------------------------------------------
/***
 * @function
 *      jsTrimElement(objEle)
 * @used
 *      jsTrimString(strText)
 * @param
 *      objEle ¿¤¸®¸ÕÆ®
 * @return
 *      ÁÂ¿ì°ø¹éÀÌ Á¦°ÅµÈ ¿¤¸®¸ÕÆ®ÀÇ °ª
 */

function jsTrimElement(objEle) {
    objEle.value = jsTrimString(objEle.value);
    return objEle.value;

}

//==============================================================================
// ¹®ÀÚ¿­ °ü·Ã
//==============================================================================
//------------------------------------------------------------------------------
// ÁÂ¿ì°ø¹é Á¦°Å
//------------------------------------------------------------------------------
/***
 * @function
 *      jsTrimString(strText)
 * @param
 *      strText ¹®ÀÚ¿­
 * @return
 *      ÁÂ¿ì°ø¹éÀÌ Á¦°ÅµÈ ¹®ÀÚ¿­
 */
function jsTrimString(strText) {
    return (strText == null ? null : strText.replace(JS_CONST_REGEXP_TRIM, ""));
}


//------------------------------------------------------------------------------
// °ø¹é¹®ÀÚ¿­ CHECK -ÀÌ°Å¶û ¾Æ·¡ ºó °ø¹é ¹®ÀÚ¿­ CHECK¶û ´Ù¸¥ °ÅÀÓ?
//------------------------------------------------------------------------------
/***
 * @function
 *      jsIsEmpty(strText)
 * @param
 *      strText ¹®ÀÚ¿­
 * @return
 *      °ø¹é¹®ÀÚ¿­ÀÎÁöÀÇ ³í¸®°ª
 */
function jsIsEmpty(strText) {
    if (strText != null) {
        return (strText.toString().replace(JS_CONST_REGEXP_TRIM, "").length == 0);
    }
    else {
        return true;
    }
}
