    /*
     * Filename     : DateTime.js
     * Function     : java script function to get Date or DateTime
     * Comment      :
     * History      : 2001/08/01, v1.0
     * Version      : 1.1
     * Author       : Copyright (c) 1999 by KCC Corp, All Right Reserved.
     */
    function getDateTime( obj, field, other, othertype )
    {
        var IE = (document.all ? true : false);    // Internet Explorer or not

        var ws = "";
        if(IE)
        {
            ws = "status:no; help:no; dialogWidth:310px; dialogHeight:300px; scroll:no;";
        }
        else
        {
            ws = "width=308,height=275,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no";
            ws += ",alwaysRaised=yes,dependent=yes";
        }

        var state = "datetime";
        var initial = obj[field].value                // ³â
                        + obj[field + "2"].value    // ¿ù
                        + obj[field + "3"].value     // ÀÏ
                        + obj[field + "4"].value    // ½Ã
                        + obj[field + "5"].value;    // ºÐ
        var url = "/com/DateTime.jsp?state=" + state + "&initial=" + initial;
        if(!IE) url += "&obj=" + obj.name + "&field=" + field;

        if ( obj[other] != null && obj[other].value != "" ) {
            url = url + "&other=" + obj[other].value            // ³â
                                    + obj[other + "2"].value    // ¿ù
                                    + obj[other + "3"].value    // ÀÏ
                                    + obj[other + "4"].value    // ½Ã
                                    + obj[other + "5"].value    // ºÐ
                                    + "&otherType=" + othertype;    // 'start' || 'end'
        }

        if(IE)
        {
            var dt = showModalDialog(url, window, ws);
            if (dt != null)
            {
                obj[field].value = dt.year;
                obj[field + "2"].value = dt.month;
                obj[field + "3"].value = dt.date;
                obj[field + "4"].value = dt.hour;
                obj[field + "5"].value = dt.minute;
            }
        }
        else
        {
            var dtWin = window.open(url, "dateTimeWindow", ws);
        }
    }

    function getDate( obj, field, other, othertype )
    {
        var IE = (document.all ? true : false);    // Internet Explorer or not

        var ws = "";
        if(IE)
        {
            //ws = "status:no; help:no; dialogWidth:222px; dialogHeight:263px;";
            //ws = "status:no; help:no; dialogWidth:231px; dialogHeight:269px;";
			ws = "status:no; help:no; dialogWidth:235px; dialogHeight:285px; scroll:no;";
        }
        else
        {
            ws = "width=458,height=288,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no";
            ws += ",alwaysRaised=yes,dependent=yes";
        }

        var state = "date";
        var initial = obj[field].value + obj[field + "2"].value + obj[field + "3"].value + "0000";
        var url = "/com/DateTime.jsp?state=" + state + "&initial=" + initial;

        if(!IE) url += "&obj=" + obj.name + "&field=" + field;

        if ( obj[other] != null && obj[other].value != "" )
        {
            url = url + "&other=" + obj[other].value            // ³â
                                    + obj[other + "2"].value    // ¿ù
                                    + obj[other + "3"].value     // ÀÏ
                                    + "0000"
                                    + "&otherType=" + othertype;    // 'start' || 'end'
        }

        if(IE)
        {
            var dt = showModalDialog(url, window, ws);
            if (dt != null)
            {
                obj[field].value = dt.year;
                obj[field + "2"].value = dt.month;
                obj[field + "3"].value = dt.date;
                obj[field + "8"].value = dt.year+dt.month+dt.date;
                obj[field + "9"].value = dt.year+"/"+dt.month+"/"+dt.date;
            }
        }
        else
        {
            var dtWin = window.open(url, "dateTimeWindow", ws);
        }
    }

    function getDate( obj, f, ff )
    {
        var IE = (document.all ? true : false);    // Internet Explorer or not

        var ws = "";
        if(IE)
        {
            ws = "status:no; help:no; dialogWidth:235px; dialogHeight:285px; scroll:no;";
        }
        else
        {
            ws = "width=458,height=288,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no";
            ws += ",alwaysRaised=yes,dependent=yes";
        }

        var state = "date";
        var initial = obj[f].value + obj[f + "2"].value + obj[f + "3"].value + "0000";
        var url = "/com/DateTime.jsp?state=" + state + "&initial=" + initial;

        if(!IE) url += "&obj=" + obj.name + "&field=" + f;

        if(IE)
        {
            var dt = showModalDialog(url, window, ws);
            if (dt != null)
            {
                obj[f].value = dt.year;
                obj[f + "2"].value = dt.month;
                obj[f + "3"].value = dt.date;
                obj[f + "9"].value = dt.year + "/" + dt.month + "/" + dt.date;
                obj[ff].value = dt.year + dt.month + dt.date;
            }
        }
        else
        {
            var dtWin = window.open(url, "dateTimeWindow", ws);
        }
    }

    function getDate( obj, ff ) {
        var IE = (document.all ? true : false);    // Internet Explorer or not
        var ws = "status:no; help:no; dialogWidth:235px; dialogHeight:285px; scroll:no;";
        var state = "date";
        var initial = document.getElementById(ff).value + "0000";
        var url = "/com/DateTime.jsp?state=" + state + "&initial=" + initial;
        if(!IE) url += "&obj=" + obj + "&field=" + ff;

        if(IE) {
            var dt = showModalDialog(url, window, ws);
            if (dt != null) {
                document.getElementById(ff).value = dt.year + dt.month + dt.date;
            }
        } else {
            var dt = showModalDialog(url, window, ws);
        }
    }

    function getMonth( obj, ff, f )
    {
        var IE = (document.all ? true : false);    // Internet Explorer or not

        var ws = "";
        if(IE)
        {
            ws = "status:no; help:no; dialogWidth:235px; dialogHeight:285px; scroll:no;";
        }
        else
        {
            ws = "width=458,height=288,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no";
            ws += ",alwaysRaised=yes,dependent=yes";
        }

        var state = "date";
        var initial = obj[ff].value + "0000";
        var url = "/com/DateTime.jsp?state=" + state + "&initial=" + initial;

        if(!IE) url += "&obj=" + obj.name + "&field=" + f;

        if(IE)
        {
            var dt = showModalDialog(url, window, ws);
            if (dt != null)
            {
                obj[ff].value = dt.year + dt.month + dt.date;
                obj[f].value = dt.year + dt.month;
            }
        }
        else
        {
            var dtWin = window.open(url, "dateTimeWindow", ws);
        }
    }

function GoodsPOPUP(){
    var url = "../common/GoodsCode.jsp";
    window.open(url,"GoodsPopup","width=400,height=500,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}
function ComGoodsPOPUP(){
    var url = "../common/ComGoodsCode.jsp";
    window.open(url,"GoodsPopup","width=400,height=500,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}
