PageSourceSearch

https://www.woorisavingsbank.com/resources/common/js/common-util.js?v=1790305923435

js woorisavingsbank.com collected 2026-09-25 03:12:49 UTC 61,636 bytes, 1,763 lines download raw bytes

1/**
2 * Supported Browser : MSIE, Chrome, FireFox, Safari
3 * 
4 * Object       : common-util.js
5 * Description  : 공통 Util용 스크립트 
6 * Author       : LaheeDad
7 * Since        : 2013.9.23.
8 * Version      : 1.0
9 * 
10 * Modification Information
11 *     since          author              description
12 *  ===========    =============    ===========================
13 *  2013.9.23.     LaheeDad         최초 생성
14 */
15
16var $$MENU_ID;
17
18/**
19 * 앞뒤 공백 제거
20 * @returns 공백이 제거된 문자열
21 */
22String.prototype.trim = function(){
23    return this.replace(/(^\s*)|(\s*$)/gi, '');
24};
25
26/**
27 * Java StartWith 구현
28 * @param   시작문자(문자열)
29 * @returns Boolean : 시작문자유무(true:시작문자)
30 */
31if ( typeof String.prototype.startsWith != 'function' ) {
32    String.prototype.startsWith = function( str ) {
33        return str.length > 0 && this.substring(0, str.length) === str;
34    };
35};
36
37/**
38 * Java EndWith 구현
39 * @param   마지막문자(문자열)
40 * @returns Boolean : 마지막문자유무(true:마지막문자)
41 */
42if ( typeof String.prototype.endsWith != 'function' ) {
43    String.prototype.endsWith = function( str ) {
44        return str.length > 0 && this.substring(this.length - str.length, this.length) === str;
45    };
46};
47
48
49/**
50 * 페이지 로딩시 bind 되어야 할 이벤트 등록 
51 */
52$(function() {  
53    
54   // $('img').error( function(){$(this).attr('src', '/resources/admin/images/error_img.jpg'); });
55    
56    $(window).resize(function(){
57        //modalComUtil.resize();
58    });
59    
60    $('#header ul.menu').ready(function(){
61        if ($$MENU_ID != undefined && $$MENU_ID != ''){
62            var depth = $$MENU_ID.split('|');    
63            $('li.'+depth[0]).addClass('on');        
64        }
65    });
66
67    $('#left').ready(function(){
68        if ($$MENU_ID != undefined && $$MENU_ID != ''){
69            var depth = $$MENU_ID.split('|');        
70            
71            for(var i = 1; i < depth.length; i++){
72                $('.'+depth[i]).addClass('on');
73            }                
74        }
75    });
76    
77    /**
78     * A태그중 .submit은 Form객체 전송시 사용
79     */
80    $('a.submit').on({
81        click : function(event){    
82            event.preventDefault();   
83            if(!$(this).prop('disabled')){
84                submitUtil.disabled();
85                $(this).parents('form').eq(0).submit();   
86            }
87        }
88    });
89    
90    /**
91     * Submit버튼 클릭시 disabled 시키기
92     */
93    $('button[type=submit]').on({
94        click : function(event){    
95        	event.preventDefault();   
96            if(!$(this).prop('disabled')){
97                submitUtil.disabled();
98                $(this).parents('form').eq(0).submit();   
99            }
100        }
101    });
102    
103    /**
104     * A태그중 .reset은 Form객체 초기화
105     * - hidden은 초기화 되지 않음.
106     */
107    $("a.reset").on({
108        click : function(event){ 
109            event.preventDefault();  
110            if(!$(this).prop('disabled')){
111                if('새로 입력한 모든 내용을 초기화 하시겠습니까?\n저장하지 않는 정보는 삭제 됩니다.'){
112                    $('form[name=mainForm]')[0].reset();
113                    $('input[type=text]').eq(0).focus();
114                }
115            }
116        }
117    });
118    
119    /**
120     * A태그중 .searchSubmit .reportSubmit은 엑셀다운로드 Form객체 전송시 사용
121     */
122    $('a.searchSubmit, a.reportSubmit').on({
123        click : function(event){    
124            event.preventDefault();  
125            
126            if(!$(this).prop('disabled')){
127                submitUtil.disabled();
128                
129                var form = $(this).parents('form').eq(0);
130                $(form).attr('action', $(this).attr('href'));
131                $(form).submit(); 
132            }
133        }
134    });
135
136    /**
137     * input태그중 .submit은 Form객체 전송시 사용
138     */
139    $('input.submit').on({
140        keypress :function(event){
141            if(!$(this).prop('disabled')){
142                if(event.which == '13'){
143                    submitUtil.disabled();
144                    $(this).parents('form').eq(0).submit();
145                }
146            }
147        }
148    });
149    
150    /**
151     * 입력글자 대문자로 변환
152     * enter submit금지
153     * space 금지
154     *
155     * 1 .enter key / space key 무시
156     * 2. 영문 소문자는 대문자로 치환 (a = 65, z = 90)
157     *    - enter = 13
158     *    - space = 32    
159     */
160    $('.txtUpperNoSubmit').on({
161        keypress :function(event){
162            if(event.which == '13' || event.which == '32'){
163                event.preventDefault();
164            }
165        },
166        keyup : function(event){
167            if(event.which >= 65 && event.which <= 90){
168                $(this).val($(this).val().toUpperCase());
169            }
170        }
171    });
172    
173    /**
174     * space 금지
175     */     
176    $(".noSpace").on({
177        keypress : function(event){
178            if(event.which == '32'){
179                event.preventDefault();
180            }
181        }
182    });    
183    
184    /**
185     *  숫자만 입력
186     *  0~9 : 48~57  
187     *  BAKC SPACE : 8
188     *  ENTER : 13
189     *  SPACE : 32    
190     */
191    $('.numOnly').css('imeMode', 'disabled').on({
192        keypress : function(event){   
193            if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8)) {
194//            	alert('숫자만 입력해 주세요.');
195                event.preventDefault();
196            }
197        },
198        keyup : function(event){
199            var str = $(this).val();
200            var len = str.length;
201            var replaceStr = new String;
202
203            for(var i=0; i < len; i++){
204                if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58){
205                    replaceStr += str.charAt(i);
206                }
207            }
208
209            if($(this).attr('numType') !== undefined){
210                if($(this).attr('numType') === 'money'){
211                    $(this).val( numUtil.createComma(replaceStr));
212                }
213            }else{
214                $(this).val(replaceStr);
215            }
216        }
217    });
218    
219    /**
220     *  숫자, 소숫점만 입력
221     *  0~9 : 48~57  
222     *  BAKC SPACE : 8
223     *  ENTER : 13
224     *  SPACE : 32  
225     *  소숫점 : 46
226     */
227    $('.numOnly2').css('imeMode', 'disabled').on({
228        keypress : function(event){   
229            
230            if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '46' )) {
231            	alert('숫자만 입력해 주세요.');
232                event.preventDefault();
233            }
234        },
235        keyup : function(event){
236            var str = $(this).val();
237            var len = str.length;
238            var replaceStr = new String;
239
240            for(var i=0; i < len; i++){
241                if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58 || str.charCodeAt(i) == 46){
242                    replaceStr += str.charAt(i);
243                }
244            }
245
246            $(this).val(replaceStr);
247        }
248    });
249    
250    /**
251     *  숫자, 콤마만 입력
252     *  0~9 : 48~57  
253     *  BAKC SPACE : 8
254     *  ENTER : 13
255     *  SPACE : 32  
256     *  콤마 : 44
257     */
258    $('.numOnly3').css('imeMode', 'disabled').on({
259        keypress : function(event){   
260            
261            if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '44' )) {
262            	alert('숫자만 입력해 주세요.');
263                event.preventDefault();
264            }
265        },
266        keyup : function(event){
267            var str = $(this).val();
268            var len = str.length;
269            var replaceStr = new String;
270
271            for(var i=0; i < len; i++){
272                if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58 || str.charCodeAt(i) == 44){
273                    replaceStr += str.charAt(i);
274                }
275            }
276
277            $(this).val(replaceStr);
278        }
279    });
280    
281    /**
282     *  숫자, 소숫점만 입력 1자리, 3자리
283     *  0~9 : 48~57  
284     *  BAKC SPACE : 8
285     *  ENTER : 13
286     *  SPACE : 32  
287     *  소숫점 : 46
288     */
289    $('.numOnly21').css('imeMode', 'disabled').on({
290        keypress : function(event){   
291            
292            if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '46' )) {
293            	alert('숫자만 입력해 주세요.');
294                event.preventDefault();
295            }
296            
297            returnStr = $(this).val();
298        },
299        keyup : function(event){
300            var strArr = new Array();
301            var str = $(this).val();
302            var count = 0;
303            
304            strArr = str.split('.');
305                    
306            //소수점 갯수 체크
307            if(strArr.length > 2){
308                alert('소수점 1자리만 입력해 주세요.');
309                $(this).val(returnStr);
310            }
311            
312            //소수점 체크
313            if (strArr.length > 1) {
314                if (strArr[0].length > 3) {
315                    alert('3자리 숫자만 입력해 주세요.');
316                    $(this).val(returnStr);
317                }
318                if (strArr[1].length > 1) {
319                    alert('소수점 한자리만 입력해 주세요.');
320                    $(this).val(returnStr);
321                }
322            } else {
323                if (str.length > 3) {
324                    alert('3자리 숫자만 입력해 주세요.');
325                    $(this).val(returnStr);
326                }
327            }
328            
329            var str = $(this).val();
330            var len = str.length;
331            var replaceStr = new String;
332
333            for(var i=0; i < len; i++){
334                if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58 || str.charCodeAt(i) == 46){
335                    replaceStr += str.charAt(i);
336                }
337            }
338
339            $(this).val(replaceStr);
340        }
341    });
342    
343    
344    /**
345     *  전화번호 : 숫자와 -만 입력
346     *  0~9 : 48~57  
347     *  BAKC SPACE : 8
348     *  - : 45 
349     */
350    $('.telNumOnly').css('imeMode', 'disabled').on({
351        keypress : function(event){   
352            if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '45' )) {
353                event.preventDefault();
354            }
355        },
356        keyup : function(event){
357            var str = $(this).val();
358            var len = str.length;
359            var replaceStr = new String;
360
361            for(var i=0; i < len; i++){
362                if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58 || str.charCodeAt(i) == 45){
363                    replaceStr += str.charAt(i);
364                }
365            }
366
367            $(this).val(replaceStr);
368        }
369    });
370
371    /**
372     * 기본으로 영문을 입력받아햐 할때 사용(IE만 가능)
373     */
374    $('.engMode').css('imeMode', 'disabled');
375    
376    /**
377     *  대소문자만 입력
378     *  0~9 : 48~57  
379     *  대문자문자 : 65~90
380     *  소문자: 97~122
381     */
382    $('.engOnly').css('imeMode', 'disabled').on({
383        keypress : function(event){   
384            if (!(event.which && (event.which  > 64 && event.which  < 91 || event.which == 8) || (event.which  > 96 && event.which  < 123 || event.which == 8))) {
385                alert('대소문자만 입력해 주세요.');
386                event.preventDefault();
387            }
388        },
389        keyup : function(event){
390            var str = $(this).val();
391            var len = str.length;
392            var replaceStr = new String;
393
394            for(var i=0; i < len; i++){
395                if((str.charCodeAt(i) > 64 && str.charCodeAt(i) < 91) || (str.charCodeAt(i) > 96 && str.charCodeAt(i) < 123)){
396                    replaceStr += str.charAt(i);
397                }
398            }
399
400            $(this).val(replaceStr);
401        }
402    });
403    
404    
405    /**
406     *  아이디에 영문/숫자만 가능
407     *  0~9 : 48~57  
408     *  대문자문자 : 65~90
409     *  소문자: 97~122
410     */
411    $('.idPattern').css('imeMode', 'disabled').on({
412        keypress : function(event){   
413            if (!(event.which && (event.which > 47 && event.which  < 58 || event.which == 8) || (event.which  > 64 && event.which  < 91 || event.which == 8) 
414                    || (event.which  > 96 && event.which  < 123 || event.which == 8) )) {
415                event.preventDefault();
416            }
417        },
418        keyup : function(event){
419            var str = $(this).val();
420            var len = str.length;
421            var replaceStr = new String;
422
423            for(var i=0; i < len; i++){
424                if( (str.charCodeAt(i) > 47  && str.charCodeAt(i) < 58) || (str.charCodeAt(i) > 64 && str.charCodeAt(i) < 91) 
425                        || (str.charCodeAt(i) > 96 && str.charCodeAt(i) < 123)){
426                    replaceStr += str.charAt(i);
427                }
428            }
429
430            $(this).val(replaceStr);
431        }
432    });
433    
434    /**
435     * 아이디에 특문입력금지
436    **/
437    /*$(".idPattern").on({
438        keypress : function(event){
439            if (!((event.which && (event.which  > 64 && event.which  < 91 || event.which == 8) || 
440                    (event.which  > 96 && event.which  < 123 || event.which == 8) || 
441                    (event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '32') || 
442                    (event.which == '45' || event.which == '95' || event.which == '46')))) {
443                event.preventDefault();
444            }
445        }
446    });  */
447    
448    /**
449     * 모달 화면 열기
450     */
451    $('.btn_modal_open').on({
452        click : function(event){
453            event.preventDefault();
454            modalUtil.open($(this));
455        } 
456    });
457    
458    /**
459     * 모달 화면 닫기
460     */
461    $('.modal_wrap a.btn_pop_close, .modal_wrap a.btn_cancle').on({
462        click : function(event){
463            event.preventDefault();
464            modalUtil.close($(this));
465        } 
466    });   
467    
468    var today =  new Date();
469    /**
470     * 달력
471     */
472    try{
473        $('.datepicker').datepicker({
474        	 dateFormat: "yy-mm-dd"
475            //,showOn: "both" //"button"
476            //,buttonImage: "/resources/admin/images/ico_calender.gif"
477            ,buttonImageOnly: false
478            ,showMonthAfterYear: true
479            ,changeMonth : true
480            ,changeYear : true
481            ,yearRange : 'c-30:c+60'
482            ,beforeShow: function() {
483                $('#ifr3').css({'width':$(window).width(),'height':$(document).height()});
484                $('#ifr3').show();  
485                $('#ui-datepicker-div, .ui-datepicker').css({'z-index' : 999999}); //ui.js에서 수정해줘야함.
486            }
487            ,onClose : function(dateText, inst){
488                $('#ifr3').hide();
489            }        
490        }).on({
491            keypress : function(event){   
492                if(event.which && !(event.which  > 47 && event.which  < 58 || event.which == 8 || event.which == '13' || event.which == '32')) {
493                    alert('숫자만 입력해 주세요.');
494                    event.preventDefault();
495                }
496            },
497            keyup : function(event){
498                var obj = $(this);
499                var strDate = $(this).val().replace(/[\.]/gi,"");
500                
501                if( isNaN(strDate) || strDate==null ){
502                    return;
503                }
504    
505                var maxSize = 8;
506                var size = strDate.length;
507    
508                if(size == maxSize || size > maxSize){
509                    if(!dateUtil.isDateFormat(strDate)){
510                        $(this).select();
511                        alert("날짜가 잘못 입력되었습니다.\n\n 다시 입력해주세요..");
512                        return;
513                    }
514                }
515    
516                if(size > 6 ){
517                    $(this).val(strDate.substring(0,4) + dateUtil.delimiter + strDate.substring(4,6) + dateUtil.delimiter + strDate.substring(6));
518                }else if(size >= 4 ){
519                    $(this).val(strDate.substring(0,4) + dateUtil.delimiter + strDate.substring(4));
520                }
521            }
522        });
523    }catch(e){ 
524        //alert('[ERROR DATEPICKER] message : ' + e.message); 
525    }
526    
527    /* 텍스트 박스 글자수 체크 */
528    $('.textLengthCheck').on({
529        keyup : function (event) {
530            var obj = $(this);
531            
532            var maxLength = parseInt($(this).attr("maxlength"));
533            if ($(this).val().length > maxLength) {
534                alert('글자수가 ' + ($(this).val().length-1) + '자 이내로 제한됩니다');
535                $(this).val($(this).val().substring(0, maxLength));
536            }
537        }
538    });
539
540    
541    //파일 다운로드
542    //fileUtil.downloadEvent();
543    $(document).on('click', '.btn_file_download', function(event){
544    	event.preventDefault();
545    	var fileSn = $(this).attr('fileSn');
546        var prdSn = $(this).attr('prdSn');
547        var cotnSn = $(this).attr('cotnSn');
548        if($(this).attr('fileSn') != undefined){
549        	//console.log(loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + $(this).attr('fileSn'));
550        	if($(this).attr('prdSn') != undefined){
551                location.href = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn + "&prdSn=" + prdSn;
552            }else if(cotnSn != undefined){
553                 location.href = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn + "&cotnSn=" + cotnSn;
554            }else{
555                location.href = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn;
556            }
557        }
558    })
559    $(document).on('click', '.btn_file_download_pdf', function(event){
560    	event.preventDefault();
561    	var fileSn = $(this).attr('fileSn');
562        var prdSn = $(this).attr('prdSn');
563        var cotnSn = $(this).attr('cotnSn');
564        if($(this).attr('fileSn') != undefined){
565            if($(this).attr('prdSn') != undefined){
566                var url = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn + "&prdSn=" + prdSn;
567            }else if(cotnSn != undefined){
568                location.href = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn + "&cotnSn=" + cotnSn;
569            }else{
570                location.href = loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + fileSn;
571            }
572        	//windowUtil.open(loginObj.contextPath + "/cm/fileDownMan.do?attcFilSn=" + $(this).attr('fileSn'),  "popPdfViewer", "", "") ;
573            windowUtil.open(url, "popPdfViewer", "", "");
574        }
575    })
576    
577    //파일 삭제
578    fileUtil.deleteEvent();
579    
580    eventObj.disabledEvent();
581    
582    //목록에서 전체 ROW선택
583    eventObj.checkboxSelectAll();
584    
585    //게시물 로그 보기
586    //eventObj.popupLogViewer();
587});
588
589
590var eventObj = {
591    iframeClickEvent : function(){
592        document.getElementById('ifr3').contentWindow.document.body.onclick = function(){
593            $('.datepicker').datepicker('hide');
594            $('#ifr3').hide();        
595        };
596    },
597    /**
598     * 파일첨부를 변경시 해당 파일정보는 input.text에 보여준다.
599     * 
600     * eventObj.inputFileChangeEvent();
601     */    
602    inputFileChangeEvent : function(){        
603        $('input[type=file]').on({            
604            change : function(){
605                var txtName = $(this).attr('name');
606                
607                try{
608                    $('#txt_'+ txtName).val($(this).val());
609                    $('.desc_'+ txtName).prop('disabled', false);
610                    
611                    if(loginObj.isDevice == 'N'){
612                        $('.desc_'+ txtName).css({'background-color' : '#FFF'});
613                    }
614                }catch(e){
615                    //ignore
616                }
617            }
618        });   
619    },
620    /**
621     * .disabled 일때 배경색 설정하기
622     */
623    disabledEvent : function(){
624        $('.disabled').prop('disabled', true); //.css({'background-color' : '#F5F5F5'});
625    },
626    /**
627     * 주소 찾기
628     * - 사용하는 페이지에서 이벤트 적용해 줄것.
629     * @use eventObj.searchAddress();
630     
631    searchAddress : function(){
632        $('.btn_find_address').on({
633            click : function(event){
634                event.preventDefault();  
635                commonUtil.searchAddress();
636            }
637        });
638    },*/
639    /**
640     * 목록에서 전체 ROW선택을 위한 이벤트
641     */
642    checkboxSelectAll : function(){
643        $('input.checkbox-selectAll').on({
644            change : function(event){
645                $(this).parents('table').find('input.checkbox-select').prop('checked', $(this).is(':checked'));
646            }
647        });
648        
649        $('.btnInfoCancle').on({
650            click : function(event){
651                $('input.checkbox-select, input.checkbox-selectAll').prop('checked', false);
652            }
653        });
654    },
655    /**
656     * 주소 찾기
657     * - 사용하는 페이지에서 이벤트 적용해 줄것.111
658     * @use eventObj.searchAddress();
659     */
660    searchAddress : function(){
661//        $(".find-address").click(function(){
662//            window.open("/common/pop/addressPList.do", 'popAddress', 'width=740,height=724,scrollbars=yes,resizable=no');
663//        }); 
664    },
665    /**
666     * 게시물 로그 보기
667     */
668    popupLogViewer : function(){
669        $('.popup-logViewer').click(function(event){
670            event.preventDefault();
671            windowUtil.open($(this).attr('href'),  "popLogViewer", 600, 400, 0) ;
672        });
673    }
674};
675
676
677
678/**
679 * 공통 코드 조회
680 */
681var comCodeUtil = {        
682    /**
683     * 출력할 영역의 elementID(#id)
684     */
685    docuemntElementID : '',
686    
687    /**
688     *  출력한 select element의 name값
689     */
690    selectElementName : '',
691    
692    searchUrl : loginObj.contextPath + '/cm/caList.do',
693    searchHUrl : loginObj.contextPath + '/cm/caHList.do',
694    
695    /**
696     * 공통 코드 조회
697     * ref : comCodeUtil.getCode('검색코드', '출력 Element Name(ID아님)', 'code,code');
698     * @param code 조회 코드
699     * @param callBack 리턴되는 Call Back 함수명, TEXT로 넘기면 안됨.
700     */
701    getCode : function(code, callBack){
702        var data = { comCd : code };
703        ajaxUtil.postDisableAsync(loginObj.contextPath + '/cm/caDet.do', data, callBack);
704    },
705    /**
706     * 공통 코드 조회후 화면 출력 :: 커스텀용으로 추가
707     * ref : comCodeUtil.getCodeNPrintByCustomt('Url', '검색코드', '출력 Element Name(ID아님)', 'select||checkbox||radio');
708     * @param code 조회 부모 코드
709     * @param selectElementName 출력한 select element의 name값
710     * @param type 화면 표시 방법 (select / checkbox / radio)
711     */
712    getCodeNPrintByCustom : function(url, code, selectElementName, type, notSelectCode){
713        comCodeUtil.selectElementName = selectElementName;
714        
715        var data = { searchKey : code };
716       
717        if(type == undefined || type === 'select'){
718            ajaxUtil.postDisableAsync(url, data, comCodeUtil.getCodeNSelectPrintResult);
719        }else if(type === 'checkbox'){
720            ajaxUtil.postDisableAsync(url, data, comCodeUtil.getCodeNCheckPrintResult);
721        }else if(type === 'radio'){
722            ajaxUtil.postDisableAsync(url, data, comCodeUtil.getCodeNRadioPrintResult);
723        }
724    },
725    /**
726     * 공통 코드 조회후 화면 출력
727     * ref : comCodeUtil.getCodeNPrint('검색코드', '출력 Element Name(ID아님)', 'select||checkbox||radio', 'code,code');
728     * @param code 조회 부모 코드
729     * @param selectElementName 출력한 select element의 name값
730     * @param type 화면 표시 방법 (select / checkbox / radio)
731     * @param langCode 표시언어 (KR-default / EN / ZH)
732     * @param selectCode 검색 예외/포함 자식코드, 구분자는 "," 
733     *          ref : 'aa,ab'            
734     * @pram type A(포함), B(제외)  selectCode를 조회 조건에서 제외할것인지 포함 할것인지 확인
735     */
736    getCodeNPrint : function(code, selectElementName, type, langCode, selectCode, searchType){
737        comCodeUtil.selectElementName = selectElementName;
738        
739        if(langCode == undefined){
740            langCode = "KR";
741        }
742        
743        if(searchType == undefined){
744            searchType = "B";
745        }
746        
747        var data = { prenComCd : code, siteCd : langCode, selectCd : selectCode, searchType : searchType };
748        
749        if(type == undefined || type === 'select'){
750            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNSelectPrintResult);
751        }else if(type === 'checkbox'){
752            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNCheckPrintResult);
753        }else if(type === 'radio'){
754            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNRadioPrintResult);
755        }
756    },
757    getCodePrdCatePrint : function(code, selectElementName, type, langCode, selectCode, searchType){
758        comCodeUtil.selectElementName = selectElementName;        
759       
760        var data = { prenComCd : code };
761        
762        if(type == undefined || type === 'select'){
763            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNSelectPrintResult2);
764        }else if(type === 'checkbox'){
765            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNCheckPrintResult);
766        }else if(type === 'radio'){
767            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNRadioPrintResult);
768        }
769    },
770    /**
771     * 공통 코드 CTE 조회후 화면 출력
772     * ref : comCodeUtil.getHCodeNPrint('검색코드', '출력 Element Name(ID아님)', 'select||checkbox||radio', 'code,code');
773     * @param code 조회 부모 코드
774     * @param selectElementName 출력한 select element의 name값
775     * @param type 화면 표시 방법 (select / checkbox / radio)
776     * @param langCode 표시언어 (KR-default / EN / ZH)
777     * @param selectCode 검색 예외/포함 자식코드, 구분자는 "," 
778     *          ref : 'aa,ab'            
779     * @pram type A(포함), B(제외)  selectCode를 조회 조건에서 제외할것인지 포함 할것인지 확인
780     */
781    getHCodeNPrint : function(code, selectElementName, type, langCode, selectCode, searchType){
782        comCodeUtil.selectElementName = selectElementName;
783        
784        if(langCode == undefined){
785            langCode = "KR";
786        }
787        
788        if(searchType == undefined){
789            searchType = "B";
790        }
791        
792        var data = { prenComCd : code, siteCd : langCode, selectCd : selectCode, searchType : searchType };
793        
794        if(type == undefined || type === 'select'){
795            ajaxUtil.postDisableAsync(comCodeUtil.searchHUrl, data, comCodeUtil.getCodeNSelectPrintResult);
796        }else if(type === 'checkbox'){
797            ajaxUtil.postDisableAsync(comCodeUtil.searchHUrl, data, comCodeUtil.getCodeNCheckPrintResult);
798        }else if(type === 'radio'){
799            ajaxUtil.postDisableAsync(comCodeUtil.searchHUrl, data, comCodeUtil.getCodeNRadioPrintResult);
800        }
801    },
802    /**
803     * 공통 코드 조회후 화면 출력
804     * ref : comCodeUtil.getCodeNPrint('검색코드', '출력 Element Name(ID아님)', 'select||checkbox||radio', 'code,code');
805     * @param code 조회 부모 코드
806     * @param selectElementName 출력한 select element의 name값
807     * @param selectCode 검색 예외/포함 자식코드, 구분자는 "," 
808     *          ref : 'aa,ab'            
809     * @pram type A(포함), B(제외)  selectCode를 조회 조건에서 제외할것인지 포함 할것인지 확인
810     */
811    getCodeNPrint2 : function(code, selectElementName, selectCode, searchType){
812        comCodeUtil.selectElementName = selectElementName;
813        
814        var preVal = '0';
815        var tr = $('select[name='+comCodeUtil.selectElementName+']').parents('tr');
816        
817        $('.btn-edit').hide();
818        $('form[name=subForm1]').hide();
819        
820        if(code != ''){
821            if(searchType == undefined){
822                searchType = "B";
823            }
824            
825            $('form[name=subForm1]').find('input[name=prenComCd]').val(code);
826            
827            var data = { prenComCd : code, selectCd : selectCode, searchType : searchType };
828            ajaxUtil.postDisableAsync(comCodeUtil.searchUrl, data, comCodeUtil.getCodeNSelectPrintResult2);
829        }else{
830            $(tr).hide().parents('tbody').find('tr').eq($(tr).index()-1).find('.btn-edit').show();
831            
832            
833            if($(tr).index() - 2 >= 0){
834                preVal = $(tr).hide().parents('tbody').find('tr').eq($(tr).index()-2).find('select').val();
835            }
836            
837            $('form[name=subForm1]').find('input[name=prenComCd]').val(preVal);
838        }
839        
840    },
841    /**
842     * 공통 코드 SELECTE로 화면 출력
843     * - 기존 Default는 유지하고 option을 추가 하도록 수정
844     * @param json json
845     */
846    getCodeNSelectPrintResult : function(json){
847        try{
848            json = JSON.parse(json);
849        }catch(e){}
850        
851        //alert(JSON.stringify(json));
852        if(json.bindingStatus == undefined && json.result.status){
853            var codeList = json.result.list;
854            var codeSize = codeList.length;
855            var oSelect = $('select[name='+comCodeUtil.selectElementName+']');
856            
857            oSelect.next('select').children().not(':eq(0)').remove();
858            oSelect.next('select').prop('disabled', true);
859            
860//            if(json.result.searchInfo.prenComCd.startsWith('Z')){
861//                //코드값을 사용하지 않는 코드
862//                for(var i = 0; i < codeSize ; i++){
863//                    $(oSelect).append('<option value="'+codeList[i].comCdNm+'">'+codeList[i].comCdNm+'</option>');
864//                }
865//            }else if(json.result.searchInfo.prenComCd.startsWith('C')){
866//                //제품 코드
867//                for(var i = 0; i < codeSize ; i++){
868//                    $(oSelect).append('<option value="'+codeList[i].comCd+'">'+codeList[i].comCdNm+' ['+ codeList[i].comCd +']</option>');
869//                }
870//            }else{
871            for(var i = 0; i < codeSize ; i++){
872                $(oSelect).append('<option value="'+codeList[i].comCdNm+'">'+codeList[i].comCdNm+'</option>');
873            }
874            
875            oSelect.show().prop('disabled', false);
876        }else{
877            //ajaxUtil.error(json);
878        }
879    },
880    /**
881     * 공통 코드 SELECTE로 화면 출력
882     * - 기존 Default는 유지하고 option을 추가 하도록 수정
883     * @param json json
884     */
885    getCodeNSelectPrintResult2 : function(json){
886        try{
887            json = JSON.parse(json);
888        }catch(e){}
889        
890        if(json.bindingStatus == undefined && json.result.status){
891            
892            var oSelect = $('select[name='+comCodeUtil.selectElementName+']');
893            
894            if(json.result.list != undefined){
895                var codeList = json.result.list;
896                var codeSize = codeList.length;
897                
898                if(codeSize > 0){
899                    oSelect.children().not(':eq(0)').remove();
900                    
901                    for(var i = 0; i < codeSize ; i++){
902                        $(oSelect).append('<option data-id="'+codeList[i].comCd+'" value="'+codeList[i].comCdExpl+'">'+codeList[i].comCdNm+'</option>');
903                    }
904                }
905            }else{
906                oSelect.children().not(':eq(0)').remove();
907                $(oSelect).append('<option value="">입력된 코드가 없습니다.</option>');
908            }
909            
910            oSelect.parents('tr').show().find('.btn-edit').show();
911            
912        }else{
913            ajaxUtil.error(json);
914        }
915    },
916    /**
917     * 공통 코드 CHECK로 화면 출력
918     * @param json json
919     */
920    getCodeNCheckPrintResult : function(json){
921        try{
922            json = JSON.parse(json);
923        }catch(e){}
924        
925        if(json.bindingStatus == undefined && json.result.status){
926            var codeList = json.result.list;
927            var codeSize = codeList.length;
928            var text = '';
929            
930            for(var i = 0; i < codeSize ; i++){
931                text += '<input type="checkbox" name="'+comCodeUtil.selectElementName+'" id="'+codeList[i].comCd+'" value="'+codeList[i].comCdNm+'" /><label for="'+codeList[i].comCd+'">'+codeList[i].comCdExpl+'</label>';
932            }
933            
934            $('#'+comCodeUtil.selectElementName).append(text);
935            
936        }else{
937            ajaxUtil.error(json);
938        }
939    },
940    /**
941     * 공통 코드 RADIO로 화면 출력
942     * - 기존 Default는 유지하고 option을 추가 하도록 수정
943     * @param json json
944     */
945    getCodeNRadioPrintResult : function(json){
946        try{
947            json = JSON.parse(json);
948        }catch(e){}
949        
950        //alert(JSON.stringify(json));
951        if(json.bindingStatus == undefined && json.result.status){
952            var codeList = json.result.list;
953            var codeSize = codeList.length;
954            var text = '';
955            
956            for(var i = 0; i < codeSize ; i++){
957                text += '<input type="radio" name="'+comCodeUtil.selectElementName+'" id="'+codeList[i].comCd+'" value="'+codeList[i].comCdNm+'" />' + '<label class="input_radio" for="'+codeList[i].comCd+'"><span>'+codeList[i].comCdExpl+'</span></label>';
958            }
959            
960            $('#'+comCodeUtil.selectElementName).append(text);
961            
962        }else{
963            ajaxUtil.error(json);
964        }
965    }
966};
967
968/**
969 * AJAX 페이징 처리(admin)
970 */
971var ajaxPagging = {  
972    /**
973     * 현재 페이지 번호
974     */
975    currentPageNo : 1,
976    /**
977     * AJAX 페이징 처리
978     * 
979     * @use ajaxPagging.create(pUrl, pElementClass, pTotalRow, pPage, pRowLimit, pPageLimit)
980     * @param pUrl              페이지 url
981     * @param pElementClass     Dom ID
982     * @param pTotalRow         전체 갯수
983     * @param pPage             현재 페이지
984     * @param pRowLimit         페이지 노출 Row갯수
985     * @param pPageLimit        한번에 보여주는 페이지수
986     */
987    create : function(pUrl, pElementClass, pTotalRow, pPage, pRowLimit, pPageLimit){
988        var btFirst = '';           //첫페이지 번호
989        var btPrev = '';            //이전 페이지 번호
990        var btPage = '';            //현재 페이지 번호
991        var btNext = '';            //다음 페이지 번호
992        var btLast = '';            //마지막 페이지 번호
993        
994        if(pTotalRow > 0){
995            currentPageNo = pPage > 0 ? pPage : 1;
996            
997            var totalPage = parseInt(pTotalRow / pRowLimit + (pTotalRow % pRowLimit == 0 ? 0 : 1));       //전체 페이지 수
998            var startPage =  parseInt( parseInt((currentPageNo-1)/pPageLimit) * pPageLimit  + 1);           //시작페이지 번호
999            
1000            //첫페이지로
1001            if(currentPageNo > 1){
1002                btFirst = '<li class="pag_first"><a href="'+ pUrl + 1 +'" class="first" title="첫 페이지로 이동">&lt;&lt;</a></li>&nbsp;';
1003            }
1004            //이전 페이지
1005            if(currentPageNo > pPageLimit){
1006                btPrev = '<li><a href="' + pUrl + (startPage-1) + '" class="prev" title="이전 페이지로 이동">&lt;</a></li>&nbsp;';
1007            }
1008            //다음 페이지
1009            if((startPage + pPageLimit) <= totalPage){
1010                btNext = '<li><a href="' + pUrl + (startPage+pPageLimit) + '" class="next" title="다음 페이지로 이동">&gt;</a></li>&nbsp;';
1011            }  
1012            //마지막 페이지로
1013            if(currentPageNo < totalPage){
1014                btLast = '<li class="pag_last"><a href="' + pUrl + totalPage + '" class="end" title="마지막 페이지로 이동">&gt;&gt;</a></li>';
1015            }
1016            
1017            for(var i=0; i < pPageLimit; i++){
1018                var pageNo = startPage + i;       
1019                if(pageNo > totalPage){  break;  }        
1020                if(pageNo == currentPageNo){
1021                    btPage += '<li class="active"><a href="#" onclick="return false;">'+ pageNo +'</a></li>&nbsp;';
1022                }else{
1023                    btPage += '<li><a href="'+ pUrl + pageNo +'">'+ pageNo +'</a></li>&nbsp;';
1024                }
1025            }
1026        }
1027          
1028        $('.'+pElementClass).html(btFirst + btPrev + btPage + btNext + btLast);
1029    }
1030};
1031
1032/**
1033 * AJAX 페이징 처리(user-normal)
1034 */
1035var ajaxPaggingUserNormal = {  
1036    /**
1037     * 현재 페이지 번호
1038     */
1039    currentPageNo : 1,
1040    /**
1041     * AJAX 페이징 처리
1042     * 
1043     * @use ajaxPaggingUserNormal.create(pUrl, pElementClass, pTotalRow, pPage, pRowLimit, pPageLimit)
1044     * @param pUrl              페이지 url
1045     * @param pElementClass     Dom ID
1046     * @param pTotalRow         전체 갯수
1047     * @param pPage             현재 페이지
1048     * @param pRowLimit         페이지 노출 Row갯수
1049     * @param pPageLimit        한번에 보여주는 페이지수
1050     */
1051    create : function(pUrl, pElementClass, pTotalRow, pPage, pRowLimit, pPageLimit){
1052        var btFirst = '';           //첫페이지 번호
1053        var btPrev = '';            //이전 페이지 번호
1054        var btPage = '';            //현재 페이지 번호
1055        var btNext = '';            //다음 페이지 번호
1056        var btLast = '';            //마지막 페이지 번호
1057        
1058        if(pTotalRow > 0){
1059            currentPageNo = pPage > 0 ? pPage : 1;
1060            
1061            var totalPage = parseInt(pTotalRow / pRowLimit + (pTotalRow % pRowLimit == 0 ? 0 : 1));       //전체 페이지 수
1062            var startPage =  parseInt( parseInt((currentPageNo-1)/pPageLimit) * pPageLimit  + 1);           //시작페이지 번호
1063            
1064            //첫페이지로
1065            if(currentPageNo > 1){
1066                btFirst = '<a href="'+ pUrl + 1 +'" class="board__pagination-btn first" title="처음">처음</a>';
1067            }
1068            //이전 페이지
1069            if(currentPageNo > pPageLimit){
1070                btPrev = '<a href="' + pUrl + (startPage-1) + '" class="board__pagination-btn prev" title="이전">이전</a>';
1071            }
1072            //다음 페이지
1073            if((startPage + pPageLimit) <= totalPage){
1074                btNext = '<a href="' + pUrl + (startPage+pPageLimit) + '" class="board__pagination-btn next" title="다음">다음</a>';
1075            }  
1076            //마지막 페이지로
1077            if(currentPageNo < totalPage){
1078                btLast = '<a href="' + pUrl + totalPage + '" class="board__pagination-btn last" title="마지막">마지막</a>';
1079            }
1080            
1081            for(var i=0; i < pPageLimit; i++){
1082                var pageNo = startPage + i;       
1083                if(pageNo > totalPage){  break;  }        
1084                if(pageNo == currentPageNo){
1085                    btPage += '<a href="#" onclick="return false;" class="board__pagination-btn num on">'+ pageNo +'</a>';
1086                }else{
1087                    btPage += '<a href="'+ pUrl + pageNo +'" class="board__pagination-btn num">'+ pageNo +'</a>';
1088                }
1089            }
1090        }
1091        
1092        console.log('.'+pElementClass);
1093        console.log($('.'+pElementClass));
1094        
1095        $('.'+pElementClass).html(btFirst + btPrev + btPage + btNext + btLast);
1096    }
1097};
1098
1099/**
1100 * 윈도우 팝업 처리
1101 */
1102var windowUtil = {
1103    /**
1104     * 팝업 열기
1105     * 
1106     * - 기본 팝업 열기 : windowUtil.open(uri,  "poptitle", 430, 190, 0) ;
1107     * - 팝업사이즈 변경 필요할 경우 : windowUtil.open(uri,  "poptitle1", 430, 190, 0,1);
1108     *  
1109     * @param url           경로
1110     * @param windowName    팝업명
1111     * @param width         가로크기
1112     * @param height        세로크기
1113     * @param strScroll     스크롤 여부
1114     * @param strResize     크기변경 여부
1115     */
1116    open: function(url,  windowName, width, height, strScroll, strResize) {
1117        var popupWindow = "" ;
1118        
1119        if(!(width == '' && height == '')){
1120            windowX = Math.ceil( (window.screen.width  - width) / 2 );
1121            windowY = Math.ceil( (window.screen.height - height) / 2 );
1122        }
1123        
1124        if(strResize == undefined || strResize == '') {
1125            strResize = 0 ;
1126        }
1127        
1128        if(!(width == '' && height == '')){
1129            popupWindow = window.open(url, windowName, "width=" + width + ", height=" + height + ", top="+ windowY +", left="+ windowX +", scrollbars="+ strScroll+", resizable="+ strResize);
1130        }else{
1131            popupWindow = window.open(url, windowName, '', '');
1132        }
1133
1134        if(!popupWindow){
1135            // @TODO  팝업 해제 방법  메뉴얼 필요.
1136//            alert("팝업을 해제해 주세요.");
1137            alert("※ 윈도우 XP SP2 또는 인터넷 익스플로러 7 사용자일 경우에는\n화면 상단에 있는 팝업 차단 알림줄을 클릭하여 팝업을 허용해 주시기 바랍니다.\n\n※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주시기 바랍니다.");
1138        }else{
1139            try {popupWindow.focus(); } catch(e){}
1140        }
1141        
1142        return popupWindow;
1143    },
1144    /**
1145     * 팝업창을 닫는다. 
1146     * - 팝업창에서 사용.  
1147     * 
1148     * @use windowUtil.close();
1149     * @returns {Boolean}
1150     */
1151    close : function() {
1152        window.open('', '_self', '');
1153        window.close();
1154        return false;
1155    }        
1156};
1157
1158/**
1159 * 문자열 관련
1160 */
1161var stringUtil = {
1162    /**
1163     * NULL인지 체크
1164     * @param str
1165     * @returns {Boolean} true : null
1166     */
1167    isNull : function(str)    {
1168        var bRtn = false;
1169        if (str == undefined || str == null || str == 'null' || str.toString().replace(/ /g,"") == ""){
1170            bRtn =  true;
1171        }
1172        return bRtn;
1173    },
1174    /**
1175     * MessageResource문자열에서 개행 문자 제거 
1176     * @param str   문자열
1177     * @returns
1178     */
1179    replaceNewLine : function(str){
1180        return str.replace(/\\n/g,'\n');
1181    },
1182    replaceNewLineBrTag : function(str){
1183        return str.replace(/\n/g,'<br/>');
1184    },
1185    /**
1186     * 
1187     * 날자 형식으로 리턴
1188     * ref) var param = stringUtil.makeDateFormat(20140101);  // 2014.01.01
1189     * @param YYYYMMDD
1190     * @returns YYYY.MM.DD
1191     */
1192    makeDateFormat : function(strDate){
1193        
1194        var delimiter = "-";    //날짜 형식 구분자
1195        
1196        if( isNaN(strDate) || strDate == null ){
1197            strDate = "";
1198        }
1199        
1200        var size = strDate.length;
1201        if(size >= 6 ){
1202            strDate = strDate.substring(0,4) + delimiter + strDate.substring(4,6) + delimiter + strDate.substring(6);
1203        }else if(size >= 4 ){
1204            strDate = strDate.substring(0,4) + delimiter + strDate.substring(4);
1205        }
1206        
1207        return strDate;
1208    }
1209};
1210
1211
1212/**
1213 * 숫자 관련 처리 
1214 */
1215var numUtil = {
1216    /**
1217     * 콤마 제거
1218     * 
1219     * @use numUtil.removeComma(num);
1220     * @param num
1221     * @returns
1222     */
1223    removeComma : function(num) {
1224        num = new String(num);
1225        return num.replace(/,/gi,"");
1226    },
1227    /**
1228     * 숫자에 자릿수 표시
1229     * 
1230     * @use numUtil.createComma(num);
1231     * @param num
1232     * @returns
1233     */
1234    createComma : function(num) {
1235        num = numUtil.removeComma(num);
1236
1237        if (isNaN(num) || num == 0){
1238            return 0;
1239        }
1240    
1241        var sign = "";
1242    
1243        if (num < 0) {
1244            num = num * (-1);
1245            sign = "-";
1246        } else {
1247            num = num * 1;
1248        }
1249    
1250        var reg = /(^[+-]?\d+)(\d{3})/;
1251        num += '';
1252    
1253        while (reg.test(num))
1254            num = num.replace(reg, '$1' + ',' + '$2');
1255    
1256        return sign + num ;
1257    }        
1258};
1259
1260
1261var dateUtil = {
1262    /**
1263     * 날짜 형식 구분자
1264     */
1265    delimiter : "-",
1266    formatDate : function(strDate){
1267    	return strDate.substring(0,4) + dateUtil.delimiter + strDate.substring(4,6) + dateUtil.delimiter + strDate.substring(6);
1268    },
1269    /**
1270     * 요청에 따른 날짜리턴
1271     * 아무값이 없으면 오늘 날짜
1272     * @param sdate 특정 날자를 넘길 경우.
1273     * @param dateFormat 요청 데이터 형식
1274     * @param split
1275     * @returns
1276     */
1277    getDate : function( sdate, dateFormat) {
1278        var date;
1279        
1280        if( sdate == undefined || sdate == "" || sdate == null){
1281            date = new Date();
1282        }else{
1283            date = new Date(sdate);
1284        }
1285        
1286        var year = date.getFullYear();
1287        var month = date.getMonth() + 1;
1288        var day = date.getDate();
1289
1290        if (("" + month).length == 1) { month = "0" + month; }
1291        if (("" + day).length  == 1) { day  = "0" + day;  }
1292
1293        if(dateFormat=="yyyy"){
1294            return year;
1295        }else if(dateFormat=="mm"){
1296            return month ;
1297        }else if(dateFormat=="dd"){
1298            return day;
1299        }else if(dateFormat=="yyyymm"){
1300            return year + this.delimiter + month;
1301        }else if(dateFormat=="mmdd"){
1302            return month + this.delimiter + day;
1303        }else{
1304            return  year + this.delimiter + month + this.delimiter + day;
1305        }
1306    },
1307    /**
1308     * 월의 마지막 날짜 구하기
1309     * @param year 년도
1310     * @param month 월
1311     * @returns
1312     */
1313    getMonthLastDay : function(year, month) {
1314        // 월별 마지막 날짜
1315        var arrLastDay = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1316
1317		debugger;
1318        // 윤년인 경우 2월의 마지막은 29일
1319        if((0 == year%4 && 0 != year%100) || 0 == year%400) {
1320            arrLastDay[1]=29;
1321        }
1322        
1323        return arrLastDay[month-1];
1324    },
1325    /**
1326     * 년월일(YYYYMMDD)의 유효성을 체크    
1327     * ref : dateUtil.isDateFormat(yyyymmdd)
1328     * @param ymd
1329     * @returns {Boolean} ture : OK
1330     */
1331    isDateFormat : function(ymd) {
1332        ymd = ymd.replace(/[\-]/gi,"");
1333        
1334        if( isNaN(ymd) || ymd==null ){
1335            return false;
1336        }else{
1337            var year = ymd.substring(0, 4);
1338            var month = parseInt(ymd.substring(4, 6), 10) -1;
1339            var day = parseInt(ymd.substring(6), 10);
1340            var endDay = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1341
1342            if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0){
1343                endDay[1] = 29;
1344            }
1345            
1346            return (day >= 1 && day <= endDay[month]);
1347        }
1348    },
1349    /**
1350     * 입력시간의 유효성을 체크
1351     * ref : dateUtil.isTimeFormat('HHMM')
1352     * @param hhmm  시간
1353     * @returns {Boolean}
1354     */
1355    isTimeFormat : function(hhmm){
1356        var bRtn = true;
1357       
1358        hhmm = hhmm.replace(/[-:]/gi,"");
1359        
1360        if( isNaN(hhmm) || hhmm == null ||  hhmm.length != 4){
1361            bRtn = false;
1362        }else{
1363            if(parseInt(hhmm.substr(0, 2)) > 23){
1364                bRtn = false;
1365            }
1366            
1367            if(parseInt(hhmm.substr(2, 2)) > 59){
1368                bRtn = false;
1369            }            
1370        }
1371        
1372        if(!bRtn){
1373            alert('시간범위가 아닙니다. 최대 23시 59분까지 입니다.');
1374        }
1375        
1376        return bRtn;
1377    },
1378   /**
1379    * 입력시간의 유효성을 체크
1380    * - 시작시간과 종료시간의 범위검사 추가
1381    * ref : dateUtil.isTimeFormat('HHMM', 'HHMM')
1382    * @param hhmm   시작시간
1383    * @param hhmm2  종료시간
1384    * @returns {Boolean}
1385    */
1386    isTimeFormat2 : function(hhmm, hhmm2){
1387        var bRtn = true;
1388        
1389        hhmm = hhmm.replace(/[-:]/gi,"");
1390        hhmm2 = hhmm2.replace(/[-:]/gi,"");
1391        
1392        if(dateUtil.isTimeFormat(hhmm) && dateUtil.isTimeFormat(hhmm2)){
1393            if(parseInt(hhmm) > parseInt(hhmm2)){
1394                bRtn = false;
1395                alert('시작시간이 종료시간보다 늦습니다. 다시 확인해 주세요.');
1396            }
1397        }else{
1398            bRtn = false;
1399        }
1400        
1401        return bRtn;
1402    },
1403    /**
1404     * 날짜 차이를 일로계산 한다    
1405     * ref : dateUtil.diffDate('2002/02/01','2003/03/01')
1406     * @param fromDate
1407     * @param toDate
1408     * @returns
1409     */
1410    diffDate : function( fromDate, toDate) {
1411        // 값이 없는 경우 0일을 리턴한다.(조회 최소기간:하루)
1412        if(stringUtil.isNull(fromDate) || stringUtil.isNull(toDate)){
1413            return "0";
1414        }
1415
1416        var MinMilli = 1000 * 60;
1417        var HrMilli = MinMilli * 60;
1418        var DyMilli = HrMilli * 24;
1419
1420        //var d1 = new Date(stringUtil.replaceAll(fromDate, ".", "/"));
1421        //var d2 = new Date(stringUtil.replaceAll(toDate, ".", "/"));
1422        // 날자 표현형식 통일 : yyyy/mm/dd
1423        var d1 = new Date(fromDate);
1424        var d2 = new Date(toDate);
1425
1426        var d3 = d2-d1;
1427        var str = d3 /DyMilli ;
1428
1429        return str;
1430    },
1431    /**
1432     * 특정 날짜에 대해 지정한 값만큼 가감(+-)한 날짜를 반환
1433     * ref : dateUtil.addDate(aType, aDay, aDate, split)
1434     *       20130304 로부터 2달뒤 ==> dateUtil.addDate("m", 2, "20130304", "/");
1435     * @param aType 가감타입 : y(연도), m(월),  d(일), md(월가감 날짜까지 표현)
1436     * @param aDay 가감일
1437     * @param aDate 가감기준일
1438     * @returns {String}
1439     */
1440    addDate : function (aType, aDay, aDate){
1441        var yyyy;
1442        var mm;
1443        var dd;
1444        var cDate;
1445        var cYear, cMonth, cDay;
1446        
1447        if(aDate == undefined){
1448            aDate = dateUtil.getDate();
1449        }
1450
1451        aDate = aDate.replace(/[\-]/gi,"");
1452
1453        yyyy = aDate.substr(0, 4);
1454        mm  = aDate.substr(4, 2);
1455        dd  = aDate.substr(6, 2);
1456
1457        if (aType == "y") {
1458            yyyy = (yyyy * 1) + (aDay * 1);
1459        } else if (aType == "m" || aType == "md") {
1460            mm  = (mm * 1) + (aDay * 1);
1461        } else if (aType == "d") {
1462            dd  = (dd * 1) + (aDay * 1);
1463            if (aDay < 0) dd++;
1464            else  dd--;
1465        }
1466
1467        cDate = new Date(yyyy, mm - 1, dd); // 12월, 31일을 초과하는 입력값에 대해 자동으로 계산된 날짜가 만들어짐.
1468        cYear = cDate.getFullYear();
1469        cMonth = cDate.getMonth() + 1;
1470        cDay = cDate.getDate();
1471
1472        cMonth = cMonth < 10 ? "0" + cMonth : cMonth;
1473        cDay = cDay < 10 ? "0" + cDay : cDay;
1474
1475
1476        if (aType == "m"){
1477            return cYear + this.delimiter + cMonth;
1478        }else{
1479            return cYear + this.delimiter + cMonth + this.delimiter + cDay;
1480        }
1481    }    
1482};
1483
1484/**
1485 * 모달 팝업 처리
1486 * 
1487 * 공통으로 모달을 열고 닫을때 사용한다.
1488 * 모달의 상세한 설정은 각 페이지 에 modalUtil을 생성해서 사용한다.
1489 * ref.) /glovis-support-system-user/src/main/webapp/WEB-INF/jsp/sq/qsg/qsgaMan.jsp
1490 *
1491 * 
1492 * ***주의사항
1493 * 팝업과 모달의 코딩을 같이 하고 있기 때문에 Modal사용시 Class에 'modal_wrap'을 추가 표기해줄것.
1494 * 하나의 페이지에서 여러개의 모달을 싸용해야 한다면 class명을 modal_wrap과 modal-{식별아이이}을 선언해줄것.
1495 * ref.) 퍼블리싱 : <div id="pop_wrap" class="pop_wrap">
1496 *       모달적용 : <div class="modal_wrap modal-{식별아이이}">
1497 * 
1498 * //이벤트를 등록해준다.
1499 * //.btn_modal_open 공통으로 적용을 해두었음.
1500 * //기본적으로 하나의 모달을 사용한다면 모달 오픈 버튼 이름을 아래로 변경해 줄것.
1501 * //여러개의 모달을 사용한다면 각 모달 버튼에 대한 이벤트를 별도로 주어서 처리해야한다.(공통모듈 참고할것.)
1502 * $('.btn_modal_open').on({
1503 *     click : function(event){
1504 *         event.preventDefault();
1505 *         modalUtil.open($(this));
1506 *     } 
1507 * });
1508 * 
1509 * //모달 열고 닫기위한 페이지별 함수를 아래와 같이 공통으로 생성한다.
1510 * //모달 열고 닫기 전에 처리해야하는 로직을 아래에 추가한다.
1511 * var modalUtil = {
1512 *     open : function(object){
1513 *          //모달 오픈전 처리해야할 로직 추가
1514 *          
1515 *          //모달 열기         
1516 *          모달이 하나일때 : modalComUtil.open();  *          
1517 *          모달리 여러개일때 : modalComUtil.open('cont'); //modal-cont로 선언시
1518 *     },    
1519 *     close : function(object){
1520 *          //모달 닫기전 처리해야할 로직 추가
1521 *          
1522 *          //모달 닫기
1523 *          modalComUtil.close();
1524 *     }
1525 * };
1526 */
1527var modalComUtil = {
1528    /**
1529     * 모달 팝업 열기
1530     * 
1531     * @use modalComUtil.open();
1532     *      -> modal_box의 콘텐츠 영역이 하나뿐일때 사용 
1533     *      modalComUtil.open('new_cont');
1534     *      -> modal_box의 콘텐츠 영역이 여러개 일때 보여줄 영역의 Class명을 입력한다. 
1535     * @param 모달 팝업 열기
1536     */
1537    open : function(pContentClassName){
1538        
1539        if(pContentClassName == undefined){
1540            pContentClassName = '_wrap';
1541        }else{
1542            pContentClassName = '-' + pContentClassName;
1543        }
1544        
1545        $('.modal_wrap').hide();
1546        $('#mask').show();  
1547        
1548        //글 갯수에 따른 높이값 계산 후 화면 중앙 위치
1549        //this.resize();
1550
1551        $('#ifr').show();
1552        $('#mask').fadeTo("slow", 0.5);    
1553        $('.modal'+pContentClassName).show();
1554    },    
1555    /**
1556     * 모달 팝업 닫기 
1557     * @use modalUtil.close();
1558     */
1559    close : function(){
1560        $('#ifr, #mask, .modal_wrap').hide();
1561    },
1562    /**
1563     * 윈도우 크기변환시 실행
1564     */
1565    resize : function(){
1566        var left = ( $(window).scrollLeft() + ($(window).width() - $('.modal_wrap').width()) / 2 );
1567        var top =  ((document.documentElement.clientHeight / 2) - ( $('.modal_wrap').height() / 2)) - 20;
1568        $('.modal_wrap').css({'top': top+'px', 'left':left + 'px', 'position':'fixed'});
1569        $('#ifr, #mask').css({'width':$(window).width(),'height':$(document).height()}); 
1570    }
1571};
1572
1573
1574/**
1575 * 공통 함수 :: 이벤트 아님
1576 */
1577var comUtil = {
1578    
1579};
1580
1581/**
1582 * 쿠키관련 함수
1583 */
1584var cookieUtil = {
1585    /**
1586     * 쿠키 확인 
1587     * @param name  cookie name
1588     * @returns
1589     */    
1590    getCookie : function(name){
1591        var nameOfCookie = name+"=";
1592        var x = 0;
1593        while ( x <= document.cookie.length )
1594        {
1595                var y = (x+nameOfCookie.length);
1596                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
1597                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
1598                                endOfCookie = document.cookie.length;
1599                        return unescape( document.cookie.substring( y, endOfCookie ) );
1600                }
1601                x = document.cookie.indexOf( " ", x ) + 1;
1602                if ( x == 0 )
1603                        break;
1604        }
1605        return null;
1606    },
1607    /**
1608     * 쿠키 설정
1609     * - day가 0이거나 undefined면 해당 쿠키가 삭제된다.
1610     * @param name cookie name
1611     * @param value cookie value
1612     * @param day   expires day
1613     */
1614    setCookie : function(name, value, day){
1615        if(typeof day == 'undefined'){
1616            day = 0;
1617        }        
1618        var expire = new Date();
1619        expire.setDate(expire.getDate() + day);
1620        document.cookie = name + '=' + escape(value) + '; path=/ ' + ';expires=' + expire.toGMTString() + ';';
1621    }
1622};
1623
1624/**
1625*
1626*  Base64 encode / decode
1627*  http://www.webtoolkit.info/
1628*
1629**/
1630var Base64 = {
1631 
1632    // private property
1633    _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
1634 
1635    // public method for encoding
1636    encode : function (input) {
1637        var output = "";
1638        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
1639        var i = 0;
1640 
1641        input = Base64._utf8_encode(input);
1642 
1643        while (i < input.length) {
1644 
1645            chr1 = input.charCodeAt(i++);
1646            chr2 = input.charCodeAt(i++);
1647            chr3 = input.charCodeAt(i++);
1648 
1649            enc1 = chr1 >> 2;
1650            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
1651            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
1652            enc4 = chr3 & 63;
1653 
1654            if (isNaN(chr2)) {
1655                enc3 = enc4 = 64;
1656            } else if (isNaN(chr3)) {
1657                enc4 = 64;
1658            }
1659 
1660            output = output +
1661            this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
1662            this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
1663 
1664        }
1665 
1666        return output;
1667    },
1668 
1669    // public method for decoding
1670    decode : function (input) {
1671        var output = "";
1672        var chr1, chr2, chr3;
1673        var enc1, enc2, enc3, enc4;
1674        var i = 0;
1675 
1676        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
1677 
1678        while (i < input.length) {
1679 
1680            enc1 = this._keyStr.indexOf(input.charAt(i++));
1681            enc2 = this._keyStr.indexOf(input.charAt(i++));
1682            enc3 = this._keyStr.indexOf(input.charAt(i++));
1683            enc4 = this._keyStr.indexOf(input.charAt(i++));
1684 
1685            chr1 = (enc1 << 2) | (enc2 >> 4);
1686            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
1687            chr3 = ((enc3 & 3) << 6) | enc4;
1688 
1689            output = output + String.fromCharCode(chr1);
1690 
1691            if (enc3 != 64) {
1692                output = output + String.fromCharCode(chr2);
1693            }
1694            if (enc4 != 64) {
1695                output = output + String.fromCharCode(chr3);
1696            }
1697 
1698        }
1699 
1700        output = Base64._utf8_decode(output);
1701 
1702        return output;
1703 
1704    },
1705 
1706    // private method for UTF-8 encoding
1707    _utf8_encode : function (string) {
1708        string = string.replace(/\r\n/g,"\n");
1709        var utftext = "";
1710 
1711        for (var n = 0; n < string.length; n++) {
1712 
1713            var c = string.charCodeAt(n);
1714 
1715            if (c < 128) {
1716                utftext += String.fromCharCode(c);
1717            }
1718            else if((c > 127) && (c < 2048)) {
1719                utftext += String.fromCharCode((c >> 6) | 192);
1720                utftext += String.fromCharCode((c & 63) | 128);
1721            }
1722            else {
1723                utftext += String.fromCharCode((c >> 12) | 224);
1724                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
1725                utftext += String.fromCharCode((c & 63) | 128);
1726            }
1727 
1728        }
1729 
1730        return utftext;
1731    },
1732 
1733    // private method for UTF-8 decoding
1734    _utf8_decode : function (utftext) {
1735        var string = "";
1736        var i = 0;
1737        var c = c1 = c2 = 0;
1738 
1739        while ( i < utftext.length ) {
1740 
1741            c = utftext.charCodeAt(i);
1742 
1743            if (c < 128) {
1744                string += String.fromCharCode(c);
1745                i++;
1746            }
1747            else if((c > 191) && (c < 224)) {
1748                c2 = utftext.charCodeAt(i+1);
1749                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
1750                i += 2;
1751            }
1752            else {
1753                c2 = utftext.charCodeAt(i+1);
1754                c3 = utftext.charCodeAt(i+2);
1755                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
1756                i += 3;
1757            }
1758 
1759        }
1760 
1761        return string;
1762    }
1763};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.