PageSourceSearch

https://www.kookmin.ac.kr/content/pgm/js/syPgmFunction.js

js kookmin.ac.kr collected 2026-09-24 08:46:52 UTC 67,553 bytes, 1,807 lines download raw bytes

1var global = {
2	isMobile : false ,
3	contextPath : ""
4};
5( function ( $ ) {
6	$.ajaxSetup( {
7		method : 'POST' ,
8		contentType : "application/x-www-form-urlencoded; charset=UTF-8" ,
9		// dataType : "json" , 기본값을 사용 안할경우 JSON.parse 를 사용하여 처리
10		timeout : 1 * 60 * 60 * 1000 ,// 2 hours ,
11		beforeSend : function ( xhr ) {
12			xhr.setRequestHeader( "ajax" ,"true" );
13			if ( this.dataType != "script" ) {
14				// showLoding();
15			}
16		} ,
17		error : function ( request ,status ,error ) {
18			removeLoding();
19			console.log( error );
20			$.alert( "서버 요청을 실패하였습니다." );
21			console.log( "서버요청이 실패되었습니다. \n code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error );
22		} ,
23		complete : function () {
24			removeLoding();
25		}
26	} );
27	$.submit = function ( url ,params ) {
28		url = url ? url : location.href;
29		params = params ? params : {};
30		if ( !url ) {
31			$.alert( "URL은 필수값입니다." );
32			return false;
33		}
34		var $form = $( "<form method='post' action='" + url + "'></form>" );
35		$.each( params ,function ( key ,value ) {
36			$form.append( $( "<input type='input'/>" ).attr( {
37				"name" : key ,
38				"value" : value
39			} ) );
40		} );
41		$form.appendTo( "body" ).submit().remove();
42	};
43	$.location = function ( url ,params ) {
44		url = url ? url : location.href;
45		params = params ? params : {};
46		if ( !url ) {
47			$.alert( "URL은 필수값입니다." );
48			return false;
49		}
50		var $form = $( "<form method='get' action='" + url + "'></form>" );
51		$.each( params ,function ( key ,value ) {
52			$form.append( $( "<input type='hidden'/>" ).attr( {
53				"name" : key ,
54				"value" : value
55			} ) );
56		} );
57		$form.appendTo( "body" ).submit().remove();
58	};
59	$.updateDepthList = function ( url ,depth1Name ,depth1Cd ,depth2Name ,depth2Cd ,depth3Name ,depth3Cd ) {
60		var depth1List = null;
61		var depth1Ld = true; // 최초 로딩시에만 자식테이블 selected 해준다.(1뎁스를 다른것으로 바꿨을때 2뎁스의 값이 이전값으로 selected되는 문제발생)
62		var depth2List = null;
63		var depth2Ld = true;
64		var depth3List = null;
65		$( "[name$='" + depth1Name + "']" ).change( function ( e ) {
66			e.preventDefault();
67			if ( depth2List == null ) return;
68			var $this = $( e.target );
69			var $depth2Obj = $( "[name$='" + depth2Name + "']" );
70			$depth2Obj.val( "" ).find( "option" ).not( "[value='']" ).remove();
71			if ( depth3List != null ) $( "[name$='" + depth3Name + "']" ).find( "option" ).not( "[value='']" ).remove();
72			$.each( depth2List ,function ( index ,entry ) {
73				if ( entry.depth1Cd == $this.val() ) {
74					if ( entry.depth2Cd == depth2Cd && depth1Ld ) {
75						$depth2Obj.append( new Option( entry.depth2Nm ,entry.depth2Cd ,null ,true ) );
76						$depth2Obj.change();
77						depth1Ld = false;
78					} else {
79						$depth2Obj.append( new Option( entry.depth2Nm ,entry.depth2Cd ) );
80					}
81				}
82			} );
83			// $dpmtCd.val( $dpmtCd.data( "value" ) ).change();
84		} );
85		$( "[name$='" + depth2Name + "']" ).change( function ( e ) {
86			e.preventDefault();
87			var $this = $( e.target );
88			if ( depth3Name != null && depth3Name != "" ) {
89				var $depth3Obj = $( "[name$='" + depth3Name + "']" );
90				$depth3Obj.val( "" ).find( "option" ).not( "[value='']" ).remove();
91				if ( depth3List == null ) return;
92				$.each( depth3List ,function ( index ,entry ) {
93					if ( entry.depth2Cd == $this.val() && entry.depth1Cd == $( "[name$='" + depth1Name + "']" ).val() ) {
94						if ( entry.depth3Cd == depth3Cd && depth2Ld ) {
95							$depth3Obj.append( new Option( entry.depth3Nm ,entry.depth3Cd ,null ,true ) );
96							depth2Ld = false;
97						} else {
98							$depth3Obj.append( new Option( entry.depth3Nm ,entry.depth3Cd ) );
99						}
100					}
101				} );
102			}
103			// $mjCd.val( $mjCd.data( "value" ) );
104		} );
105		var updateDepth1 = function () {
106			if ( depth1List == null ) return;
107			var $depth1Obj = $( "[name$='" + depth1Name + "']" );
108			$depth1Obj.find( "option" ).not( "[value='']" ).remove();
109			$.each( depth1List ,function ( index ,entry ) {
110				if ( entry.depth1Cd == depth1Cd ) {
111					$depth1Obj.append( new Option( entry.depth1Nm ,entry.depth1Cd ,null ,true ) );
112					$depth1Obj.change();
113				} else {
114					$depth1Obj.append( new Option( entry.depth1Nm ,entry.depth1Cd ) );
115				}
116			} );
117		};
118		if ( depth1List == null ) {
119			$.ajax( {
120				"url" : url ,
121				"dataType" : "json" ,
122				"success" : function ( result ) {
123					depth1List = result.depth1List;
124					depth2List = result.depth2List;
125					depth3List = result.depth3List;
126					updateDepth1();
127				}
128			} );
129		} else {
130			updateDepth1();
131		}
132	};
133	$.rand = function () {
134		var chars = '0123456789abcdef'.split( '' );
135		var uuid = [] ,rnd = Math.random ,r;
136		uuid[ 8 ] = uuid[ 13 ] = uuid[ 18 ] = uuid[ 23 ] = '-';
137		uuid[ 14 ] = '4';
138		for ( var i = 0 ; i < 36 ; i++ ) {
139			if ( !uuid[ i ] ) {
140				r = 0 | rnd() * 16;
141				uuid[ i ] = chars[ ( i == 19 ) ? ( r & 0x3 ) | 0x8 : r & 0xf ];
142			}
143		}
144		return 'uuid' + uuid.join( '' ).replace( /\-/gi ,"" );
145	};
146	$.upload2 = function ( action ) {
147		$.ajax( {
148			"url" : "/comm/cmfileCrop/dialog/uploadFile.do" ,
149			"dataType" : "text" ,
150			"success" : function ( html ) {
151				var $html = $( html );
152				$html.layout( {
153					"title" : "파일업로드" ,
154					"width" : $( window ).width() > 800 ? 800 : 300 ,
155					"create" : function ( $this ) {
156						$( this ).find( '.common_upload' ).change( function () {
157							var $val = $( this ).val();
158							var $valIndexOf = $val.lastIndexOf( '\\' ) + 1;
159							var $valSlice = $val.slice( $valIndexOf ,$val.length );
160							var $val = $valSlice;
161							$( this ).closest( '.common_upload_wrap' ).find( '.input_val' ).text( $val );
162						} );
163					} ,
164					"action" : function ( result ) {
165						console.log( action );
166						$html.dialog( 'destroy' );
167						$html.find( "form" ).ajaxSubmit( {
168							contentType : "application/x-www-form-urlencoded;charset=UTF-8" ,
169							dataType : "json" ,
170							success : action
171						} );
172					}
173				} );
174			}
175		} );
176	};
177} )( jQuery );
178jQuery.fn.extend( {
179	"params" : function () {
180		var params = {};
181		$.each( $( this ).find( ":input" ).serializeArray() ,function ( index ,object ) {
182			if ( params[ object.name ] ) {
183				if ( params[ object.name ] instanceof Array ) {
184					params[ object.name ].push( object.value );
185				} else {
186					var arr = new Array();
187					arr.push( params[ object.name ] );
188					arr.push( object.value );
189					params[ object.name ] = arr;
190				}
191			} else {
192				params[ object.name ] = object.value;
193			}
194		} );
195		return params;
196	} ,
197	"setParams" : function ( params ) {
198		var $this = $( this );
199		$this.find( "input[type='hidden'],input[type='text'],textarea" ).val( "" );
200		$this.find( "select" ).find( "option:first" ).prop( "selected" ,true ).attr( "selected" ,true );
201		$this.find( "input[type='checkbox'],input[type='radio']" ).prop( "checked" ,false ).attr( "checked" ,false );
202		$.each( params ,function ( key ,val ) {
203			var $target = $this.find( "[name='" + key + "']" );
204			if ( $target.is( ":radio" ) ) {
205				$target.filter( "[value='" + val + "']" ).prop( "checked" ,true ).attr( "checked" ,true ).click();
206			} else if ( $target.is( ":checkbox" ) ) {
207				$target.prop( "checked" ,false ).trigger( "checkbox:update" );
208				if ( val instanceof Array ) {
209					$.each( val ,function ( valKey ,valVal ) {
210						$target.filter( "[value='" + valVal + "']" ).prop( "checked" ,true ).attr( "checked" ,true ).trigger( "checkbox:update" );
211					} );
212				} else {
213					$target.filter( "[value='" + val + "']" ).prop( "checked" ,true ).attr( "checked" ,true ).trigger( "checkbox:update" );
214				}
215			} else if ( $target.is( "select" ) ) {
216				if ( val ) {
217					$target.val( val ).data( "value" ,val );
218				}
219			} else {
220				$target.val( val );
221			}
222		} );
223		return $( this );
224	} ,
225	"crop" : function ( cropBoxData ,action ) {
226		if ( cropBoxData == null ) cropBoxData = {};
227		cropBoxData = $.extend( {
228			width : 640 ,
229			height : 480 ,
230			ratio : []
231		} ,cropBoxData );
232		var $this = $( this );
233		var params = $this.data( "params" ) ? $this.data( "params" ) : {};
234		$.ajax( {
235			"url" : global.contextPath + "/comm/cmfile/dialog/uploadFileToCrop.do" ,
236			"dataType" : "text" ,
237			"success" : function ( html ) {
238				var $html = $( html );
239				var origFileNm = params.origFileNm;
240				var fileExtsnNm = params.fileExtsnNm;
241				var fileSz = params.fileSz;
242				var svrFileNm = params.svrFileNm;
243				var encSvrFileNm = ( params.encSvrFileNm ) ? params.encSvrFileNm : "";
244				var data = params.data;
245				var $cropImg = $html.find( '#cropImg' );
246				$cropImg.attr( 'src' ,global.contextPath + "/comm/cmfile/thumbn
246ailCrop.do?width=1000&height=1000&temp=Y&encSvrFileNm=" + encSvrFileNm );
247				$html.layout( {
248					"title" : "이미지 편집" ,
249					"width" : 800 ,
250					buttons : [ {
251						text : "닫기" ,
252						addClass : "di_btn_close" ,
253						click : function () {
254							$html.dialog( 'close' );
255						}
256					} ,{
257						text : "파일업로드" ,
258						addClass : "di_btn_upload" ,
259						click : function () {
260							$.upload( function ( entry ) {
261								origFileNm = entry.result.origFileNm;
262								svrFileNm = entry.result.svrFileNm;
263								encSvrFileNm = entry.result.encSvrFileNm;
264								fileExtsnNm = entry.result.fileExtsnNm;
265								fileSz = entry.result.fileSz;
266								data.canvasData = data.cropBoxData = null;
267								$cropImg.cropper( 'replace' ,global.contextPath + "/comm/cmfile/thumbnailCrop.do?width=1000&height=1000&temp=Y&encSvrFileNm=" + entry.result.encSvrFileNm );
268							} );
269						}
270					} ,{
271						text : "확인" ,
272						addClass : "di_btn_conf" ,
273						click : function () {
274							var result = {
275								"origFileNm" : origFileNm ,
276								"svrFileNm" : svrFileNm ,
277								"encSvrFileNm" : encSvrFileNm ,
278								"fileExtsnNm" : fileExtsnNm ,
279								"fileSz" : fileSz ,
280								"data" : data
281							};
282							$this.attr( "src" ,global.contextPath + "/comm/cmfile/crop.do?width=" + data.position.w + "&height=" + data.position.h + "&x=" + data.position.x + "&y=" + data.position.y + "&encSvrFileNm=" + encSvrFileNm );
283							$this.data( "params" ,result );
284							action( result );
285							$html.dialog( 'close' );
286							ajaxCropEmptyVal();
287						}
288					} ] ,
289					"open" : function ( $this ) {
290						$( 'html' ).addClass( 'popOn' );
291						var cropObj = {
292							viewMode : 0 ,
293							aspectRatio : 4 / 3 ,
294							dragMode : 'move' ,
295							background : true ,
296							restore : true ,
297							guides : true ,
298							highlight : true ,
299							cropBoxMovable : true ,
300							cropBoxResizable : true ,
301							crop : function ( e ) {
302								e.x = (e.x == 21) ? 0 : e.x;
303								data = {
304									"position" : {
305										"w" : Math.floor( e.width ) ,
306										"h" : Math.floor( e.height ) ,
307										"x" : Math.floor( e.x ) ,
308										"y" : Math.floor( e.y )
309									} ,
310									"cropBoxData" : $cropImg.cropper( "getCropBoxData" ) ,
311									"canvasData" : $cropImg.cropper( "getCanvasData" )
312								};
313							} ,
314							built : function () {
315								// 1. setCanvasData 먼저 쌔팅할것
316								if ( data && data.canvasData ) {
317									$cropImg.cropper( "setCanvasData" ,data.canvasData );
318								}
319								// 2.setCanvasData 이후 쌔팅할것
320								$cropImg.cropper( "setCropBoxData" ,data && data.cropBoxData ? data.cropBoxData : cropBoxData );
321							}
322						};
323						var exCropObj = $.extend( true ,cropObj ,cropBoxData );
324						$cropImg.customTags();
325						$cropImg.cropper( exCropObj );
326					}
327				} );
328			}
329		} );
330	}
331} );
332
333$( document ).ready( function () {
334	// 20240802 교류대학 순서 정렬 함수
335	function preDataSort(dataStr) {
336		
337		// 현재 주소가 syExUniversity 일때만 함수 실행
338		if (!(window.location.href.indexOf('syExUniversity') > 0)) {
339			return dataStr;
340		} else {
341			let str = decodeURI(dataStr);
342		
343			// 쿼리 문자열을 객체로 변환
344			let queryParams = new URLSearchParams(str);
345		
346			// lggTagLib 값과 그렇지 않은 값들을 저장할 배열
347			let lggTagLibArray = [];
348			let nonLggTagLibArray = [];
349		
350			// 쿼리 문자열에서 각 항목을 분류
351			for (let [key, value] of queryParams.entries()) {
352			  if (key.startsWith('lggTagLib')) {
353				lggTagLibArray.push(`${key}=${value}`);
354			  } else {
355				nonLggTagLibArray.push(`${key}=${value}`);
356			  }
357			}
358		
359			// lggTagLibArray를 n 값 기준으로 정렬
360			lggTagLibArray.sort((a, b) => {
361			  let aIndex = parseInt(a.match(/\[(\d+)\]/)[1]);
362			  let bIndex = parseInt(b.match(/\[(\d+)\]/)[1]);
363			  return aIndex - bIndex;
364			});
365		
366			// nonLggTagLibArray와 lggTagLibArray를 합침
367			let mergedArray = nonLggTagLibArray.concat(lggTagLibArray);
368		
369			// 배열을 문자열로 변환
370			let resultStr = mergedArray.join('&');
371		
372			// 결과 출력
373			//console.log(encodeURI(resultStr));
374			//console.log(decodeURI(resultStr));
375		
376			return encodeURI(resultStr);
377		}
378	}
379
380	if ( global == null ) global = {};
381	global = $.extend( global ,{
382		// 화면반영함수
383		display : function ( url ,retAction ) {
384			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
385			var $form = $( "[name='currentPageNo']" ).closest( "form" );
386			
387			var okayAction = retAction ? retAction : function () {
388				location.reload();
389			}
390			var okayAction2 = function () {
391				$( "#DIALOG_ALERT" ).dialog( 'close' );
392				okayAction();
393			}
394			
395			$.confirm( {
396				title : '화면반영 확인' ,
397				content : '화면반영 하시겠습니까?' ,
398				buttons : {
399					"확인" : {
400						text : "확인" ,
401						click : function () {
402							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
403							// 항목 공통화 활성화 후, 저장 작업 실행
404							global.commBox.init();
405							$.ajax( {
406								"url" : "./display.do" ,
407								"method" : "POST" ,
408								"dataType" : "json" ,
409								"data" : $form.serialize() ,
410								"success" : function ( data ) {
411									var dataSeq = Number( data[ "result" ] );
412									if ( dataSeq > 0 ) {
413										$.alert( {
414											title : '화면반영' ,
415											content : '화면반영 되었습니다.',
416											buttons : {
417												okay : {
418													text : '닫기' ,
419													click : okayAction2
420												} ,
421											}
422										} );
423									} else {
424										$.alert( "서버요청이 실패하였습니다." );
425									}
426								}
427							} );
428						} ,
429						addClass : "di_btn_conf"
430					} ,
431					"취소" : {
432						text : "취소" ,
433						click : function () {
434							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
435							$.alert( "취소되었습니다." );
436						} ,
437						addClass : "di_btn_close"
438					}
439				}
440			} );
441			
442		} ,
443		// 리스트화면 이동 함수
444		index : function ( currentPageNo ,url ) {
445			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
446			var $form = $( "[name='currentPageNo']" ).closest( "form" );
447			if ( currentPageNo ) $form.find( "[name='currentPageNo']" ).val( currentPageNo );
448			if ( $form.find( "[name='retUrl']" ).length > 0 && url != "" ) {
449				url = $form.find( "[name='retUrl']" ).val();
450			}
451			$form.attr( "action" ,( ( url ) ? url : "./index.do" ) );
452			$form.submit();
453		} ,
454		// 버튼에 data-params를 갖고 이동
455		location : function ( url ,obj ) {
456			var params = $( obj ).data( "params" );
457			url = url ? url : location.href;
458			params = params ? params : {};
459			if ( !url ) {
460				$.alert( "URL은 필수값입니다." );
461				return false;
462			}
463			var $form = $( "<form method='get' action='" + url + "'></form>" );
464			$.each( params ,function ( key ,value ) {
465				$form.append( $( "<input type='hidden'/>" ).attr( {
466					"name" : key ,
467					"value" : value
468				} ) );
469			} );
470			$form.appendTo( "body" ).submit().remove();
471		} ,
472		// 초기화 함수
473		reset : function ( currentPageNo ,url ) {
474			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
475			var $form = $( "[name='currentPageNo']" ).closest( "form" );
476			if ( currentPageNo ) $form.find( "[name='currentPageNo']" ).val( currentPageNo );
477			$form.find( "input:visible, select" ).val( "" );
478			$form.find( "input:radio" ).attr( "checked" ,false );
479			$form.attr( "action" ,( ( url ) ? url : "./index.do" ) );
480			$form.submit();
481		} ,
482		// currentPageNo만 파라메터로보냄
483		// 기존 검색파라메터들을 유지하기위해서는 관련 파라메터들을 다 보내줘야하는데
484		// 공통으로 처리하기때문에 상세에서 원치않는 파라메터값들이 넘어가서면 예외상황이 발생 되므로 submit또는 검색바영역 을 파라메터로 보내는건 문제가된다.
485		// history.back();과 같은 기능은 목록에서 왔다면 괜찮지만 다른곳에서 왔을때 목록으로 가지못하는 예외상황이 있다
486		cancel : function ( currentPageNo ,url ) {
487			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
488			$.location( ( ( url ) ? url : "./index.do" ) ,{
489				"currentPageNo" : ( ( currentPageNo ) ? currentPageNo : $( "[name='currentPageNo']" ).val() )
490			} );
491		} ,
492		// 상세화면 이동 함수
493		write : function ( dataSeq ,url ) {
494			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
495			dataSeq = ( dataSeq ) ? dataSeq : 0;
496			var $form = $( "[name='currentPageNo']" ).closest( "form" );
497			if ( $form.find( "[name='dataSeq']" ).length == 0 ) {
498				$form.append( '<input type="hidden" name="dataSeq" id="dataSeq" value="' + dataSeq + '"/>' );
499			}
500			if ( $form.find( "[name='parentSeq']" ).length == 0 ) {
501				$form.append( '<input type="hidden" name="parentSeq" id="parentSeq" value="' + dataSeq + '"/>' );
502			}
503			if ( dataSeq > 0 ) $form.find( "[name='dataSeq']" ).val( dataSeq );
504			$form.attr( "action" ,( ( url ) ? url : "./write.do" ) );
505			$form.submit();
506		} ,
507		// 출판도서 전용 view
508		writeBook : function(dataSeq, url) {
509			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
510			dataSeq = ( dataSeq ) ? dataSeq : 0;
511			var $form = $( "[name='currentPageNo']" ).closest( "form" );
512			if ( $form.find( "[name='dataSeq']" ).length == 0 ) {
513				$form.append( '<input type="hidden" name="dataSeq" id="dataSeq" value="' + dataSeq + '"/>' );
514			}
515			if ( $form.find( "[name='parentSeq']" ).length == 0 ) {
516				$form.append( '<input type="hidden" name="parentSeq" id="parentSeq" value="' + dataSeq + '"/>' );
517			} else if($form.find( "[name='parentSeq']" ).val() !== dataSeq){
518				$form.find( "[name='parentSeq']" ).val(dataSeq)
519			}
520			//if ( dataSeq > 0 ) $form.find( "[name='dataSeq']" ).val( dataSeq );
521			$form.attr( "action" ,( ( url ) ? url : "./write.do" ) );
522			$form.submit();
523		},
524		// 등록 기능 함수
525		proc : function ( url ,retAction ) {
526			if ( $( "[name='dataSeq']" ).length == 0 ) return;
527			var $form = $( "[name='dataSeq']" ).closest( "form" );
528			var dataSeq = $( "[name='dataSeq']" ).val();
529			var contChk = false;
530			if ( $form.find( "[class*=ime][class*=editor]" ).length ) {
531				$form.find( "[class*=ime][class*=editor]" ).each( function () {
532					var info = $( this ).classData();
533					if ( info.required ) {
534						$( this ).val( eval( "CKEDITOR.instances." + $( this ).attr( "name" ) + ".getData()" ) );
535						if ( $( this ).val() == "" ) {
536							$.alert( "[" + $( this ).attr( "title" ) + "]항목을 입력해주세요." );
537							contChk = true;
538						}
539					}
540				} );
541			}
542			if ( contChk ) return;
543			if ( !$form.validate() ) return;
544			global.confirm( $form ,( ( url ) ? url : "./proc.do" ) ,( ( dataSeq > 0 ) ? '수정' : '등록' ) ,retAction );
545		} ,
546		// 연구성과 추천키워드 등록 기능 함수
547		procKeyword : function ( url ,retAction ) {
548			if ( $( "[name='dataSeq']" ).length == 0 ) return;
549			var $form = $( "[name='dataSeq']" ).closest( "form" );
550			var dataSeq = $( "[name='dataSeq']" ).val();
551			var contChk = false;
552			if ( $form.find( "[class*=ime][class*=editor]" ).length ) {
553				$form.find( "[class*=ime][class*=editor]" ).each( function () {
554					var info = $( this ).classData();
555					if ( info.required ) {
556						$( this ).val( eval( "CKEDITOR.instances." + $( this ).attr( "name" ) + ".getData()" ) );
557						if ( $( this ).val() == "" ) {
558							$.alert( "[" + $( this ).attr( "title" ) + "]항목을 입력해주세요." );
559							contChk = true;
560						}
561					}
562				} );
563			}
564			if ( contChk ) return;
565			if ( !$form.validate() ) return;
566			global.confirmKeyword( $form ,( ( url ) ? url : "./proc.do" ) ,( ( dataSeq > 0 ) ? '등록' : '등록' ) ,retAction );
567		} ,
568		delMsg : "서버요청이 실패하였습니다." ,
569		// 삭제 기능 함수
570		del : function ( url ,retAction ,errorAction ) {
571			if ( $( "[name='dataSeq']" ).length == 0 ) return;
572			var $form = $( "[name='dataSeq']" ).closest( "form" );
573			global.confirm( $form ,( ( url ) ? url : "./delete.do" ) ,"삭제" ,retAction ,errorAction );
574		} ,
575		// 체크 일괄 삭제 기능 함수
576		delChk : function ( url ,retAction ,errorAction ) {
577			if ( $( "[name='dataChkSeq']" ).length == 0 ) return;
578			var $form = $( "[name='dataChkSeq']" ).closest( "form" );
579			var $chkList = $( "[name='dataChkSeq']:checked" );
580			if ( !$chkList.length ) {
581				$.alert( "[대상]항목을 선택해주세요." );
582				return;
583			}
584			global.confirm( $form ,( ( url ) ? url : "./deleteChk.do" ) ,"삭제" ,retAction ,errorAction );
585		} ,
586		// 삭제 자식 체크
587		delCntChk : function () {
588			// th에 있는 체크박스 체크시 모든 체크박스 공통처리
589			$( "table thead input[type='checkbox']" ).closest( "table" ).find( "tbody input[type='checkbox']" ).each( function ( i ) {
590				$( this ).prop( "checked" ,false );
591			} );
592			$.alert( global.delMsg );
593		} ,
594		// 상태 변경 기능 함수
595		updateStaCd : function ( obj ,dataSeq ,url ,retAction ) {
596			var $form = $( obj ).closest( "form" );
597			console.log( "####" + dataSeq );
598			$form.append( '<input type="hidden" name="dataSeq" value="' + dataSeq + '"/>' );
599			$form.append( '<input type="hidden" name="staCd" value="' + $( obj ).val() + '"/>' );
600			$form.append( '<input type="hidden" name="' + $( obj ).attr( "name" ).replace( "rowStaCd" ,"" ) + '" value="' + $( obj ).val() + '"/>' );
601			global.confirm( $form ,( ( url ) ? url : "./updateStaCd.do" ) ,"변경" ,( ( retAction ) ? retAction : function () {
602				global.index();
603			} ) );
604		} ,
605		// 체크 일괄 변경 기능 함수
606		updateStaCdChk : function ( url ,obj ,retAction ) {
607			if ( $( "[name='dataChkSeq']" ).length == 0 ) return;
608			var $form = ( obj ? $( obj ).closest( "form" ) : $( "[name='dataChkSeq']" ).closest( "form" ) );
609			console.log( $form );
610			if ( !$form.validate() ) return;
611			global.confirm( $form ,( ( url ) ? url : "./updateStaCdChk.do" ) ,"변경" ,( ( retAction ) ? retAction : function () {
612				global.index();
613			} ) );
614		} ,
615		confirm : function ( form ,url ,msg ,retAction ,errorAction ) {
616			var $form = form;
617			console.log( $form.serialize() );
618			var okayAction = retAction ? retAction : function () {
619				if ( $form.find( "[name='dataSeq']" ).val() > 0 ) global.cancel();
620				else global.cancel( 1 );
621			}
622			var okayAction2 = function () {
623				$( "#DIALOG_ALERT" ).dialog( 'close' );
624				okayAction();
625			}
626			if ( $form.find( "[class*=ime][class*=editor]" ).length ) {
627				$form.find( "[class*=ime][class*=editor]" ).each( function () {
628					var info = $( this ).classData();
629					/* if(info.required){ */
630					$( this ).val( eval( "CKEDITOR.instances." + $( this ).attr( "name" ) + ".getData()" ) );
631					/* } */
632				} );
633			}
634			$.confirm( {
635				title : msg + ' 확인' ,
636				content : msg + ' 하시겠습니까?' ,
637				buttons : {
638					"확인" : {
639						text : "확인" ,
640						click : function () {
641							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
642							// 항목 공통화 활성화 후, 저장 작업 실행
643							global.commBox.init();
644							$.ajax( {
645								"url" : url ,
646								"method" : "POST" ,
647								"dataType" : "json" ,
648								"data" : preDataSort($form.serialize()) ,
649								//"data" : $form.serialize() ,
650								"success" : function ( data ) {
651									console.log( Number( data[ "result" ] ) );
652									console.log( data[ "result" ] );
653									var dataSeq = Number( data[ "result" ] );
654									if ( dataSeq > 0 ) {
655										$form.find( "[name='dataSeq']" ).val( dataSeq );
656										$.alert( {
657											title : msg ,
658											content : msg + ' 되었습니다.' ,
659											buttons : {
660												okay : {
661													text : '닫기' ,
662													click : okayAction2
663												} ,
664											}
665										} );
666									} else {
667										$.alert( "서버요청이 실패하였습니다." );
668									}
669								}
670							} );
671						} ,
672						addClass : "di_btn_conf"
673					} ,
674					"취소" : {
675						text : "취소" ,
676						click : function () {
677							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
678							$.alert( "취소되었습니다." );
679						} ,
680						addClass : "di_btn_close"
681					}
682				}
683			} );
684		} ,
685		confirmKeyword : function ( form ,url ,msg ,retAction ,errorAction ) {
686			var $form = form;
687			console.log( $form.serialize() );
688			var okayAction = retAction ? retAction : function () {
689				if ( $form.find( "[name='dataSeq']" ).val() > 0 ) global.cancel();
690				else global.cancel( 1 );
691			}
692			var okayAction2 = function () {
693				$( "#DIALOG_ALERT" ).dialog( 'close' );
694				okayAction();
695			}
696			if ( $form.find( "[class*=ime][class*=editor]" ).length ) {
697				$form.find( "[class*=ime][class*=editor]" ).each( function () {
698					var info = $( this ).classData();
699					/* if(info.required){ */
700					$( this ).val( eval( "CKEDITOR.instances." + $( this ).attr( "name" ) + ".getData()" ) );
701					/* } */
702				} );
703			}
704			$.confirm( {
705				title : msg + ' 확인' ,
706				content : msg + ' 하시겠습니까?' ,
707				buttons : {
708					"확인" : {
709						text : "확인" ,
710						click : function () {
711							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
712							// 항목 공통화 활성화 후, 저장 작업 실행
713							global.commBox.init();
714							$.ajax( {
715								"url" : url ,
716								"method" : "POST" ,
717								"dataType" : "json" ,
718								"data" : preDataSort($form.serialize()) ,
719								//"data" : $form.serialize() ,
720								"success" : function ( data ) {
721									console.log( Number( data[ "result" ] ) );
722									console.log( data[ "result" ] );
723									var dataSeq = Number( data[ "result" ] );
724									if ( dataSeq == 0 ) {
725										$form.find( "[name='dataSeq']" ).val( dataSeq );
726										$.alert( {
727											title : msg ,
728											content : msg + ' 되었습니다.' ,
729											buttons : {
730												okay : {
731													text : '닫기' ,
732													click : okayAction2
733												} ,
734											}
735										} );
736									} else {
737										$.alert( "서버요청이 실패하였습니다." );
738									}
739								}
740							} );
741						} ,
742						addClass : "di_btn_conf"
743					} ,
744					"취소" : {
745						text : "취소" ,
746						click : function () {
747							$( "#DIALOG_CONFIRM" ).dialog( 'close' );
748							$.alert( "취소되었습니다." );
749						} ,
750						addClass : "di_btn_close"
751					}
752				}
753			} );
754		} ,
755		keypress : function (currentPageNo ,url) {
756			if ( event.keyCode == 13 ) {
757				global.index(currentPageNo ,url);
758			}
759		} ,
760		comment : {
761			menuSeqInfo : null ,
762			downMenuSeqInfo : 0 ,
763			positionInfo : null ,
764			page : 0 ,
765			rplyByRplyYn : null ,
766			autoSeq : null ,
767			focusSeq : null ,
768			index : function ( menuSeq ,downMenuSeq ,position ,rplyByRplyYn ,page ) {
769				if ( menuSeq ) global.comment.menuSeqInfo = menuSeq;
770				if ( downMenuSeq ) global.comment.downMenuSeqInfo = downMenuSeq;
771				if ( position ) global.comment.positionInfo = position;
772				if ( rplyByRplyYn ) global.comment.rplyByRplyYn = rplyByRplyYn;
773				if ( page ) global.comment.page = page;
774				if ( global.comment.menuSeqInfo ) {
775					console.log( "d" );
776					$.ajax( {
777						"url" : global.contextPath + "/comm/comment/comment.do" ,
778						"dataType" : "text" ,
779						"data" : {
780							"menuSeq" : global.comment.menuSeqInfo ,
781							"downMenuSeq" : global.comment.downMenuSeqInfo ,
782							"rplyByRplyYn" : global.comment.rplyByRplyYn ,
783							"commentPageNo" : page ,
784							"autoSeq" : global.comment.autoSeq ,
785							"focusSeq" : global.comment.focusSeq
786						} ,
787						"success" : function ( html ) {
788							$( "#globalComment" ).remove();
789							$( global.comment.positionInfo ).append( html );
790							if ( global.comment.autoSeq ) replyList( global.comment.autoSeq ); // 저장한 댓글 자동 펼치기
791							if ( global.comment.focusSeq ) $( '.focus' + global.comment.focusSeq ).focus(); // 저장한 글 자동 포커스 이동
792						}
793					} );
794				}
795			}
796		} ,
797		findMemberPop : {
798			userTy : "user" ,
799			form : null ,
800			action : null ,
801			init : function ( action ,params ) {
802				global.findMemberPop.action = action;
803				if ( params.userTy ) global.findMemberPop.userTy = params.userTy;
804				global.findMemberPop.search( null );
805				return false;
806			} ,
807			search : function ( form ) {
808				$.ajax( {
809					"url" : global.contextPath + "/comm/member/dialog/findMember.do" ,
810					"type" : "post" ,
811					"data" : form ? $( form ).serialize() : {
812						userTy : global.findMemberPop.userTy
813					} ,
814					"dataType" : "html" ,
815					"success" : function ( html ) {
816						$html = $( html );
817						global.findMemberPop.form = $html.find( "form" ).get( 0 );
818						$( "#findMemberPop" ).dialog( 'destroy' ).remove();
819						$html.layout( {
820							"title" : "사용자 검색" ,
821							"width" : 700 ,
822							"create" : function () {
823								$html.customTags();
824							}
825						} );
826					}
827				} );
828			} ,
829			index : function ( page ) {
830				var form = global.findMemberPop.form;
831				if ( page ) form.currentPageNo.value = page;
832				global.findMemberPop.search( form );
833				return false;
834			} ,
835			select : function ( params ) {
836				global.findMemberPop.action( params );
837				$( "#findMemberPop" ).dialog( 'destroy' ).remove();
838				return false;
839			} ,
840			keydown : function () {
841				if ( event.keyCode == 13 ) { return global.findMemberPop.index( 1 ); }
842			}
843		} ,
844		popup : function ( params ,url ,id ) {
845			$.openWindow( {
846				"url" : global.contextPath + url ,
847				"width" : "1500" ,
848				"id" : id ,
849				params : params
850			} );
851		} ,
852		imageEdit : function ( name ,status ,fileGrpSeq ,fileSeq ) {
853			$( "#fileEditeImg" ).crop( {
854				width : 640 ,
855				height : 480
856			} ,function ( entry ) {
857				$( '.imageInfo' ).empty();
858				$( '.imageInfo' ).append( '<input type="hidden" name="' + name + '[0].status" value="' + ( status == null ? 2 : status ) + '"/>' + '<input type="hidden" name="' + name + '[0].fileGrpSeq" value="' + ( fileGrpSeq == null ? 0 : fileGrpSeq ) + '"/>' + '<input type="hidden" name="' + name + '[0].fileSeq" value="' + ( fileSeq == null ? 0 : fileSeq ) + '"/>' + '<input type="hidden" name="' + name + '[0].origFileNm" value="' + entry.origFileNm + '"/>' + '<input type="hidden" name="' + name + '[0].svrFileNm" value="' + entry.svrFileNm + '"/>' + '<input type="hidden" name="' + name + '[0].fileExtsnNm" value="' + entry.fileExtsnNm + '"/>' + '<input type="hidden" name="' + name + '[0].fileSz" value="' + entry.fileSz + '"/>' + '<input type="hidden" name="' + name + '[0].repnImgCropValu" value=' + $.JSONDecode( entry.data ) + '></input>' );
859				$( "#imageDel" ).show();
860			} );
861		} ,
862		imageDel : function ( name ) {
863			$( "#imageDel" ).hide();
864			$( "input[name='" + name + "[0].status']" ).val( '8' );
865			$( "#fileEditeImg" ).data( "params" ,{} );
866			$( "#fileEditeImg" ).attr( "src" ,global.contextPath + "/comm/cmfile/thumbn
866ailCrop.do?encSvrFileNm=" );
867		} ,
868		scrap : {
869			on : function ( bbsSeq ) {
870				$.ajax( {
871					url : "/comm/scrap/proc.do" ,
872					type : "post" ,
873					data : {
874						scrapDataSeq : bbsSeq ,
875					} ,
876					dataType : "json" ,
877					success : function ( data ) {
878						if ( data.result > 0 ) {
879							$.alert( {
880								content : "성공했습니다." ,
881								buttons : {
882									okay : {
883										text : '확인' ,
884										click : function () {
885											location.reload();
886										}
887									}
888								}
889							} )
890						} else {
891							$.alert( {
892								content : "실패했습니다."
893							} )
894						}
895					}
896				} )
897			} ,
898			off : function ( bbsSeq ) {
899				$.ajax( {
900					url : "/comm/scrap/delete.do" ,
901					type : "post" ,
902					data : {
903						scrapDataSeq : bbsSeq
904					} ,
905					dataType : "json" ,
906					success : function ( data ) {
907						if ( data.result > 0 ) {
908							$.alert( {
909								content : "성공했습니다." ,
910								buttons : {
911									okay : {
912										text : '확인' ,
913										click : function () {
914											location.reload();
915										}
916									}
917								}
918							} )
919						} else {
920							$.alert( {
921								content : "실패했습니다."
922							} )
923						}
924					}
925				} )
926			}
927		} ,
928		emailSelect : function ( obj ) {
929			var name = $( obj ).attr( "name" );
930			var value = $( obj ).val();
931			var input = $( obj ).parents().find( "input[name='" + name + "']:eq(1)" );
932			input.val( value );
933		} ,
934		daumzipcode : function ( obj ) {
935			daum.postcode.load( function () {
936				new daum.Postcode( {
937					oncomplete : function ( data ) {
938						console.log( data );
939						console.log( $( obj ).parents() );
940						if ( data.userSelectedType == 'R' ) {
941							$( obj ).closest( "td" ).find( "input[type='text']:eq(0)" ).val( data.zonecode );
942							$( obj ).closest( "td" ).find( "input[type='text']:eq(1)" ).val( data.address );
943						} else {
944							$( obj ).closest( "td" ).find( "input[type='text']:eq(0)" ).val( data.postcode );
945							$( obj ).closest( "td" ).find( "input[type='text']:eq(1)" ).val( data.jibunAddress );
946						}
947					}
948				} ).open();
949			} );
950		} ,
951		inputReq : {
952			type : null ,
953			html : null ,
954			textArray : new Array() ,
955			radioArray : new Array() ,
956			selectArray : new Array() ,
957			textareaArray : new Array() ,
958			setType : function ( type ) {
959				global.inputReq.type = type;
960			} ,
961			importJsp : function ( type ) {
962				$.ajax( {
963					url : "/bmw/api/sample/choshsh/" + type + "/getJsp.do" ,
964					dataType : "html" ,
965					success : function ( data ) {
966						var dataSubstr = data.indexOf( "/script>" )
967						var dataSet = null;
968						if ( dataSubstr > 0 ) {
969							dataSet = data.substring( dataSubstr + 8 )
970						} else {
971							dataSet = data
972						}
973						var result = $( dataSet ).find( "div" );
974						global.inputReq.setList( result );
975						global.inputReq.appendBtn( type )
976					}
977				} )
978			} ,
979			setList : function ( html ) {
980				$( html ).find( "input:text" ).each( function () {
981					$this = $( this );
982					global.inputReq.textArray.push( global.inputReq.getArray( $this ) )
983				} )
984				$( html ).find( "input:radio" ).each( function () {
985					$this = $( this );
986					global.inputReq.radioArray.push( global.inputReq.getArray( $this ) )
987				} )
988				$( html ).find( "select" ).each( function () {
989					$this = $( this );
990					global.inputReq.selectArray.push( global.inputReq.getArray( $this ) )
991				} )
992				$( html ).find( "textarea" ).each( function () {
993					$this = $( this );
994					global.inputReq.textareaArray.push( global.inputReq.getArray( $this ) )
995				} )
996			} ,
997			getArray : function ( $this ) {
998				var array = new Object( {
999					"class" : $this.attr( "class" ) ,
1000					"name" : $this.attr( "name" ) ,
1001					"title" : $this.attr( "title" ) ,
1002				} );
1003				return array
1004			} ,
1005			layout : function ( type ) {
1006				if ( type == null ) {
1007					type = global.inputReq.type
1008				}
1009				$.ajax( {
1010					url : "/bmw/api/sample/choshsh/" + type + "/layout/inputReq.do" ,
1011					data : {
1012						"textArray" : global.inputReq.textArray ,
1013						"radioArray" : global.inputReq.radioArray ,
1014						"selectArray" : global.inputReq.selectArray ,
1015						"textareaArray" : global.inputReq.textareaArray
1016					} ,
1017					dataType : "text" ,
1018					success : function ( data ) {
1019						$html = $( data )
1020						$html.layout( {
1021							title : "필수값 설정" ,
1022							width : 800
1023						} );
1024					}
1025				} )
1026			} ,
1027			appendBtn : function ( type ) {
1028				$( "#inputReqBtn" ).remove()
1029				var str = "<tr id='inputReqBtn'>"
1030				str += "<th scope='row'>필수값 설정</th>"
1031				str += "<td colspan='3' class='td_input2 last'><a href='#;' class='btn01 col02' onclick='global.inputReq.layout();'><span>필수값 설정</span></a></td>"
1032				str += "</tr>"
1033				$( "#baseForm" ).find( "tbody" ).eq( 0 ).append( str )
1034			} ,
1035			reset : function () {
1036				global.inputReq.type = null
1037				global.inputReq.html = null
1038				global.inputReq.textArray = new Array()
1039				global.inputReq.radioArray = new Array()
1040				global.inputReq.selectArray = new Array()
1041				global.inputReq.textareaArray = new Array()
1042			} ,
1043			proc : function ( type ) {
1044				$.ajax( {
1045					url : "/bmw/api/sample/choshsh/" + type + "/proc.do" ,
1046					data : $( "#inputReqForm" ).serialize() ,
1047					success : function ( data ) {
1048						console.log( data )
1049					}
1050				} )
1051			} ,
1052			update : function ( param ) {
1053				var reqSeq = param.parent().parent().find( "input[name='reqSeq']" ).val()
1054				var reqYn = param.val()
1055				if ( reqSeq > 0 ) {
1056					$.ajax( {
1057						url : "/bmw/api/sample/choshsh/updateInputReq.do" ,
1058						data : {
1059							reqSeq : reqSeq ,
1060							reqYn : reqYn
1061						} ,
1062						success : function ( data ) {
1063							console.log( data )
1064						}
1065					} )
1066				}
1067			} ,
1068			init : function ( type ) {
1069				if ( type ) {
1070					global.inputReq.reset();
1071					global.inputReq.setType( type );
1072					global.inputReq.importJsp( global.inputReq.type );
1073				}
1074			}
1075		} ,
1076		/*
1077		 * childObj : { init : function (tbId) { $("#"+tbId+"rowTable").find(".hasDatepicker").attr("id", null); $("#"+tbId+"rowTable").find(".hasDatepicker").datepicker("destroy"); }, add : function ( tbId, typeCd , actionStr) { global.childObj.init(tbId); var rowObj = $('#'+tbId+'rowTable').find('tr').clone(); if($("#" + tbId + " tr").find( '[name$="adStatus"]' ).val() == 0) $("#" + tbId + " tbody tr").remove(); var index = $("#" + tbId + " tbody").find( "tr" ).length; $(rowObj).find("[name^='row']").attr( "name" ,function () { return $( this ).attr( "name" ).replace("row[0]" ,tbId + "[" + index + "]" ); } ); $("#" + tbId + " tbody").append($(rowObj)); $("#" + tbId + " tbody").find("tr").last().customTags(); var $tr = $("#" + tbId + " tbody").find( 'tr:visible' ); $tr.each(function(i){$(this).find('#rowNum').html(i + 1)}); global.childObj.cntChg(tbId + typeCd, 1); global.childObj.cntChg(tbId + "Tot", 1); var afterAction = window[actionStr]; if(afterAction) afterAction(); }, del : function ( tbId, typeCd, obj, actionStr) { var $searchType = $( obj ).closest( 'tr' ).hide().find( '[name$="searchType"]' ).val(); $( obj ).closest( 'tr' ).find( '[name$="adStatus"]' ).val( 8 ); var $tr = $( obj ).closest( 'tbody' ).find( 'tr:visible' ); $tr.each(function(i){$(this).find('#rowNum').html(i + 1)}); global.childObj.cntChg(tbId + typeCd, -1); global.childObj.cntChg(tbId + "Tot", -1); var afterAction = window[actionStr]; if(afterAction) afterAction(); }, cntChg : function(cntId, num){ $('#' + cntId + 'Cnt').text(parseInt($('#' + cntId + 'Cnt').text()) + Number(num)); },
1078		 */
1079		childObj : {
1080			init : function ( tbId ) {
1081				$( "#" + tbId + "rowTable" ).find( ".hasDatepicker" ).attr( "id" ,null );
1082				$( "#" + tbId + "rowTable" ).find( ".hasDatepicker" ).datepicker( "destroy" );
1083			} ,
1084			add : function ( tbId ,typeCd ,actionStr ,maxCnt ) {
1085				global.childObj.init( tbId );
1086				if ( maxCnt > 0 && maxCnt <= $( "#" + tbId + " tbody" ).find( "tr:visible" ).length ) {
1087					$.alert( maxCnt + "개 이상 추가할 수 없습니다." );
1088					return;
1089				}
1090				var rowObj = $( '#' + tbId + 'rowTable' ).find( 'tr' ).clone();
1091				if ( $( "#" + tbId + " tr" ).find( '[name$="adStatus"]' ).val() == 0 ) $( "#" + tbId + " tbody tr" ).remove();
1092				var index = $( "#" + tbId + " tbody" ).find( "tr" ).length;
1093				$( rowObj ).find( "[name^='row']" ).attr( "name" ,function () {
1094					return $( this ).attr( "name" ).replace( "row[0]" ,tbId + "[" + index + "]" );
1095				} );
1096				$( rowObj ).find( '[name$="childSeq"]' ).val( index + 1 );
1097				$( "#" + tbId + " tbody" ).append( $( rowObj ) );
1098				$( "#" + tbId + " tbody" ).find( "tr" ).last().customTags();
1099				var $tr = $( "#" + tbId + " tbody" ).find( 'tr' );
1100				var rowNum = 1;
1101				// var sortNum = 1;
1102				$tr.each( function ( i ) {
1103					$( this ).find( "input, textarea, select" ).attr( "name" ,function () {
1104						if ( $( this ).attr( "name" ) != undefined ) { return $( this ).attr( "name" ).replace( /\[[0-9]+\]/ ,"[" + ( i + 1 ) + "]" ); }
1105					} );
1106					if ( $( this ).is( ':visible' ) ) {
1107						// $(this).find('[name$="sortNum"]').val(sortNum++)
1108						if ( $( this ).find( '[name$="upChildSeq"]' ).length == 0 || $( this ).find( '[name$="upChildSeq"]' ).val() == 0 ) {
1109							$( this ).find( '#rowNum' ).html( rowNum++ );
1110						} else {
1111							$( this ).find( '#rowNum' ).removeAttr( 'id' ).addClass( "lower_ic" ).text( "하단" );
1112						}
1113					}
1114				} );
1115				global.childObj.cntChg( tbId + typeCd ,1 );
1116				global.childObj.cntChg( tbId + "Tot" ,1 );
1117				var afterAction = window[ actionStr ];
1118				if ( afterAction ) afterAction();
1119			} ,
1120			addChild : function ( tbId ,obj ,actionStr ) {
1121				global.childObj.init( tbId );
1122				var rowObj = $( '#' + tbId + 'rowTable' ).find( 'tr' ).clone();
1123				if ( $( "#" + tbId + " tr" ).find( '[name$="adStatus"]' ).val() == 0 ) $( "#" + tbId + " tbody tr" ).remove();
1124				var index = $( "#" + tbId + " tbody" ).find( "tr" ).length;
1125				$( rowObj ).find( "[name^='row']" ).attr( "name" ,function () {
1126					return $( this ).attr( "name" ).replace( "row[0]" ,tbId + "[" + index + "]" );
1127				} );
1128				$( rowObj ).find( '[name$="upChildSeq"]' ).val( $( obj ).closest( 'tr' ).find( '[name$="childSeq"]' ).val() )
1129				$( rowObj ).find( '.addChildBtn' ).remove();
1130				$( rowObj ).find( '[name$="childSeq"]' ).val( index + 1 )
1131				if ( $( obj ).closest( 'tr' ).nextAll( ':has(#rowNum):first' ).length > 0 ) {
1132					$( obj ).closest( 'tr' ).nextAll( ':has(#rowNum):first' ).eq( 0 ).before( $( rowObj ) );
1133				} else {
1134					$( obj ).closest( 'tbody' ).find( 'tr' ).last().after( $( rowObj ) );
1135				}
1136				var $tr = $( obj ).closest( 'tbody' ).find( 'tr' );
1137				var rowNum = 1;
1138				// var sortNum = 1;
1139				$tr.each( function ( i ) {
1140					$( this ).find( "input, textarea, select" ).attr( "name" ,function () {
1141						return $( this ).attr( "name" ).replace( /\[[0-9]+\]/ ,"[" + ( i + 1 ) + "]" );
1142					} );
1143					// $(this).find('[name$="sortNum"]').val(sortNum++)
1144					if ( $( this ).is( ':visible' ) ) {
1145						if ( $( this ).find( '[name$="upChildSeq"]' ).length == 0 || $( this ).find( '[name$="upChildSeq"]' ).val() == 0 ) {
1146							$( this ).find( '#rowNum' ).html( rowNum++ );
1147						} else {
1148							$( this ).find( '#rowNum' ).removeAttr( 'id' ).addClass( "lower_ic" ).text( "하단" );
1149						}
1150					}
1151				} );
1152				$( "#" + tbId + " tbody" ).find( "tr" ).last().customTags();
1153				// global.childObj.cntChg(tbId + typeCd, 1);
1154				global.childObj.cntChg( tbId + "Tot" ,1 );
1155				var afterAction = window[ actionStr ];
1156				if ( afterAction ) afterAction();
1157			} ,
1158			addTable : function ( tbId ,obj ,actionStr ) {
1159				global.childObj.init( tbId );
1160				var rowObj = $( '#' + tbId + 'TableDiv' ).find( '.table_wrap' ).clone();
1161				if ( $( "#" + tbId + "TableDataDiv" ).find( "div" ).find( '[name$="adStatus"]' ).val() == 0 ) $( "#" + tbId + "TableDataDiv" ).find( "div" ).remove();
1162				var index = $( "#" + tbId + "TableDataDiv" ).find( ".table_wrap" ).length;
1163				$( rowObj ).find( "[name^='row']" ).attr( "name" ,function () {
1164					return $( this ).attr( "name" ).replace( "row[0]" ,tbId + "[" + index + "]" );
1165				} );
1166				$( rowObj ).find( '[name$="childSeq"]' ).val( index + 1 );
1167				$( "#" + tbId + "TableDataDiv" ).append( $( rowObj ) );
1168				$( "#" + tbId + "TableDataDiv" ).find( ".table_wrap" ).last().customTags();
1169				var $table = $( "#" + tbId + "TableDataDiv" ).find( '.table_wrap' );
1170				var rowNum = 1;
1171				// var sortNum = 1;
1172				$table.each( function ( i ) {
1173					$( this ).find( "input, textarea, select" ).attr( "name" ,function () {
1174						if ( $( this ).attr( "name" ) != undefined ) { return $( this ).attr( "name" ).replace( /\[[0-9]+\]/ ,"[" + ( i + 1 ) + "]" ); }
1175					} );
1176					if ( $( this ).is( ':visible' ) ) {
1177						$( this ).find( '[name$="sortNum"]' ).val( sortNum++ );
1178					}
1179				} );
1180				global.childObj.cntChg( tbId + typeCd ,1 );
1181				global.childObj.cntChg( tbId + "Tot" ,1 );
1182				var afterAction = window[ actionStr ];
1183				if ( afterAction ) afterAction();
1184			} ,
1185			del : function ( tbId ,typeCd ,obj ,actionStr ) {
1186				var $searchType = $( obj ).closest( 'tr' ).hide().find( '[name$="searchType"]' ).val();
1187				$( obj ).closest( 'tr' ).find( '[name$="adStatus"]' ).val( 8 );
1188				var $tr = $( obj ).closest( 'tbody' ).find( 'tr' );
1189				if ( $tr.find( '[name$="upChildSeq"]' ).val() == 0 ) {
1190					var upChildSeq = $( obj ).closest( 'tr' ).find( '[name$="childSeq"]' ).val();
1191					$( obj ).closest( 'tbody' ).find( 'tr' ).each( function ( i ) {
1192						if ( upChildSeq == $( this ).find( '[name$="upChildSeq"]' ).val() ) {
1193							$( this ).hide();
1194							$( this ).find( '[name$="adStatus"]' ).val( 8 );
1195						}
1196					} );
1197				}
1198				var rowNum = 1;
1199				// var sortNum = 1;
1200				$tr.each( function ( i ) {
1201					$( this ).find( "input, textarea, select" ).attr( "name" ,function () {
1202						if ( $( this ).attr( "name" ) ) return $( this ).attr( "name" ).replace( /\[[0-9]+\]/ ,"[" + ( i + 1 ) + "]" );
1203					} );
1204					if ( $( this ).is( ':visible' ) ) {
1205						// $(this).find('[name$="sortNum"]').val(sortNum++)
1206						if ( $( this ).find( '[name$="upChildSeq"]' ).length == 0 || $( this ).find( '[name$="upChildSeq"]' ).val() == 0 ) {
1207							$( this ).find( '#rowNum' ).html( rowNum++ );
1208						} else {
1209							$( this ).find( '#rowNum' ).removeAttr( 'id' ).addClass( "lower_ic" ).text( "하단" );
1210						}
1211					}
1212				} );
1213				global.childObj.cntChg( tbId + typeCd ,-1 );
1214				global.childObj.cntChg( tbId + "Tot" ,-1 );
1215				var afterAction = window[ actionStr ];
1216				if ( afterAction ) afterAction();
1217			} ,
1218			cntChg : function ( cntId ,num ) {
1219				$( '#' + cntId + 'Cnt' ).text( parseInt( $( '#' + cntId + 'Cnt' ).text() ) + Number( num ) );
1220			} ,
1221			// 지출내역관련 (합계, 계산) 스크립트
1222			expnCalc : function ( tbId ,params ,ty ,calc ) {
1223				// params = {"str01" : 수입/지출, "str02" : 승인상태, "num01" : 가격, "num02" : 수량, "num03" : 금액}
1224				var tot01 = 0;
1225				var tot02 = 0;
1226				var tot03 = 0;
1227				$( "#" + tbId + "TagLib" ).find( "tbody" ).find( "tr:visible" ).each( function () {
1228					var str01 = "";
1229					var str02 = "";
1230					var num01 = "";
1231					var num02 = "";
1232					var num03 = "";
1233					if ( ty == "view" ) {
1234						str01 = $( this ).find( "td" ).eq( params.str01 ).text();
1235						str02 = $( this ).find( "td" ).eq( params.str02 ).text();
1236						num01 = $( this ).find( "td" ).eq( params.num01 ).text().replace( /\,/gi ,"" );
1237						num02 = $( this ).find( "td" ).eq( params.num02 ).text().replace( /\,/gi ,"" );
1238						if ( calc == "minus" ) {
1239							$( this ).find( "td" ).eq( params.num03 ).html( $.numberFormat( num01 - num02 ) );
1240						} else {
1241							$( this ).find( "td" ).eq( params.num03 ).html( $.numberFormat( num01 * num02 ) );
1242						}
1243						$( this ).find( "td" ).eq( params.num01 ).text( $.numberFormat( num01 ) );
1244						$( this ).find( "td" ).eq( params.num02 ).text( $.numberFormat( num02 ) );
1245					} else {
1246						str01 = $( this ).find( "td" ).eq( params.str01 ).find( "select :selected" ).text();
1247						str02 = $( this ).find( "td" ).eq( params.str02 ).find( "select :selected" ).text();
1248						if ( $( this ).find( "td" ).eq( params.num01 ).find( ":input" ).val() ) num01 = $( this ).find( "td" ).eq( params.num01 ).find( ":input" ).val().replace( /\,/gi ,"" );
1249						if ( $( this ).find( "td" ).eq( params.num02 ).find( ":input" ).val() ) num02 = $( this ).find( "td" ).eq( params.num02 ).find( ":input" ).val().replace( /\,/gi ,"" );
1250						if ( calc == "minus" ) {
1251							$( this ).find( "td" ).eq( params.num03 ).find( ":input" ).val( $.numberFormat( num01 - num02 ) );
1252						} else {
1253							$( this ).find( "td" ).eq( params.num03 ).find( ":input" ).val( $.numberFormat( num01 * num02 ) );
1254						}
1255						if ( $( this ).find( "td" ).eq( params.num01 ).find( ":input" ).val() ) $( this ).find( "td" ).eq( params.num01 ).find( ":input" ).val( $.numberFormat( num01 ) )
1256					}
1257					if ( params.autoProv == "Y" ) str02 = "승인";
1258					num03 = $.numberFormat( num01 * num02 );
1259					if ( str02 == "승인" ) {
1260						if ( str01 == "수입" ) {
1261							tot01 = tot01 + Number( num03.replace( /\,/gi ,"" ) );
1262						}
1263						if ( str01 == "지출" ) {
1264							tot02 = tot02 + Number( num03.replace( /\,/gi ,"" ) );
1265						}
1266					} else if ( calc == "minus" ) {
1267						tot01 = tot01 + Number( num01.replace( /\,/gi ,"" ) );
1268						tot02 = tot02 + Number( num02.replace( /\,/gi ,"" ) );
1269					}
1270				} );
1271				var $totTr = $( "#expnTot" ).find( "tbody" ).find( "tr" ).eq( 0 );
1272				$totTr.find( "td" ).eq( 0 ).find( "span" ).html( $.numberFormat( tot01 ) );
1273				$totTr.find( "td" ).eq( 1 ).find( "span" ).html( $.numberFormat( tot02 ) );
1274				$totTr.find( "td" ).eq( 2 ).find( "span" ).html( $.numberFormat( tot01 - tot02 ) );
1275			}
1276		} ,
1277		// 설문팝업
1278		survPop : function ( params ,url ) {
1279			if ( !url ) url = global.contextPath + "/comm/surv/popup/" + params.enSspmSeq + "/index.do";
1280			var id = "surnPop";
1281			if ( params != null && params.id ) id = params.id;
1282			console.log( url );
1283			$.openWindow( {
1284				"url" : url ,
1285				"width" : "1500" ,
1286				"id" : id ,
1287				params : params
1288			} );
1289		} ,
1290		// 드래그엔드랍
1291		updateSortNum : function () {
1292			$( ".sortable" ).find( "tbody tr" ).each( function ( i ) {
1293				//console.log( $( this ).html() );
1294				$( this ).find( '#rowNum' ).html( i + 1 );
1295				$( this ).find( "[name$='sortNum']" ).val( i + 1 );
1296			} );
1297			if ( $( "[name='currentPageNo']" ).length == 0 ) return;
1298			var $form = $( "[name='currentPageNo']" ).closest( "form" );
1299			//console.log( $( ".sortable" ).attr( "class" ) );
1300			if ( $( ".sortable" ).attr( "class" ).indexOf( "not" ) == -1 ) {
1301				$.ajax( {
1302					"url" : "./updateSortNum.do" ,
1303					"method" : "POST" ,
1304					"dataType" : "json" ,
1305					"data" : $form.serialize() ,
1306					"success" : function ( data ) {
1307						if ( Number( data[ "result" ] ) > 0 ) {
1308							$.alert( '변경 되었습니다.' );
1309						} else {
1310							$.alert( "서버요청이 실패하였습니다." );
1311						}
1312					}
1313				} );
1314			}
1315		} ,
1316    "cdSetPop" : function( cd ){
1317      $.ajax( {
1318          "url" : "/comm/maCd/dialog/cdSetPop.do" ,
1319          "dataType" : "text" ,
1320          "data" : {
1321            "upCdId" : cd
1322          } ,
1323          "success" : function ( result ) {
1324            var $resultHtml = $( result );
1325            $resultHtml.attr( "id" ,"cdSetup_layout" ).layout( {
1326              "width" : 1000 ,
1327              "title" : "공통코드 설정" ,
1328              buttons : [ {
1329                  text : "닫기" ,
1330                  addClass : "di_btn_close" ,
1331                  click : function () {
1332                    $resultHtml.dialog( 'close' );
1333                  }
1334                } ,{
1335                  text : "수정" ,
1336                  addClass : "di_btn_conf" ,
1337                  click : function () {
1338                    global.confirm($("#cdSetForm"), "/comm/maCd/dialog/cdSetProc.do", "수정", function(){location.reload();});
1339                  }
1340              } ],
1341              "create" : function () {
1342
1343              }
1344            } );
1345          }
1346      } );
1347    },
1348		// global.dialog.list(function(params){console.log(params)}, {"url" : "url", "id" : "id", "title" : "title"});
1349		dialog : {
1350			action : null ,
1351			params : null ,
1352			layoutParams : null ,
1353			page : function ( page ) {
1354				global.dialog.list( global.dialog.action ,$.extend( global.dialog.params ,{
1355					"paginationInfo.currentPageNo" : page
1356				} ) );
1357			} ,
1358			list : function ( action ,params ,layParams ) {
1359				global.dialog.action = action;
1360				global.dialog.params = params;
1361				var url = params.url;
1362				var id = params.id;
1363				var title = params.title;
1364				var width = params.width;
1365				var layout = id + "_layout";
1366				$.ajax( {
1367					"url" : global.contextPath + url ,
1368					"dataType" : "text" ,
1369					"data" : params ,
1370					"success" : function ( result ) {
1371						var $dialogList = $( result );
1372						$dialogList.find( ".page_list a" ).attr( "onclick" ,"" );
1373						$dialogList.find( ".searchBtn" ).attr( "onclick" ,"" );
1374						layoutParams = {
1375							"width" : ( width ) ? width : 1280 ,
1376							"title" : title ,
1377							"create" : function () {
1378								$dialogList.submit( function () {
1379									return false;
1380								} );
1381								$dialogList.find( "[type='text']" ).keypress( function ( e ) {
1382									if ( e.keyCode == 13 ) {
1383										$.extend( params ,$dialogList.find( "form" ).params() );
1384										$.extend( params ,{
1385											"currentPageNo" : 1
1386										} );
1387										global.dialog.list( action ,params ,layoutParams );
1388									}
1389								} );
1390								$dialogList.find( ".searchBtn" ).click( function ( e ) {
1391									e.preventDefault();
1392									$.extend( params ,$dialogList.find( "form" ).params() );
1393									$.extend( params ,{
1394										"currentPageNo" : 1
1395									} );
1396									global.dialog.list( action ,params ,layoutParams );
1397								} );
1398								$dialogList.find( ".resetBtn" ).click( function ( e ) {
1399									e.preventDefault();
1400									$.extend( params ,$dialogList.find( "form" ).params() );
1401									$.extend( params ,{
1402										"currentPageNo" : 1 ,
1403										"searchValue" : ""
1404									} );
1405								} );
1406								$dialogList.find( ".page_list a" ).click( function ( e ) {
1407									e.preventDefault();
1408									var page = $( this ).data( "params" );
1409									$.extend( params ,$dialogList.find( "form" ).params() );
1410									$.extend( params ,{
1411										"currentPageNo" : page
1412									} );
1413									global.dialog.list( action ,params ,layoutParams );
1414								} );
1415								$dialogList.find( ".selectBtn" ).click( function ( e ) {
1416									e.preventDefault();
1417									action( $( this ).data( "params" ) );
1418									$dialogList.dialog( 'destroy' ).remove();
1419								} );
1420								$dialogList.find( ".multiSelectBtn" ).click( function ( e ) {
1421									e.preventDefault();
1422									var $chkList = $dialogList.find( "[name='dataChkSeq']:checked" );
1423									$.each( $chkList ,function () {
1424										action( $( this ).data( "params" ) )
1425									} );
1426									$dialogList.dialog( 'destroy' ).remove();
1427								} );
1428							}
1429						}
1430						layoutParams = $.extend( layParams ,layoutParams );
1431						$dialogList.attr( "id" ,layout ).layout( layoutParams );
1432					}
1433				} );
1434			}
1435		} ,
1436		// 항목 공통화 체크 부분
1437		commBox : {
1438			init : function () {
1439				console.log( "활성화" );
1440				var form = $( "input[name$='Arr']:eq(0)" ).parents( "form" );
1441				var fieldName = {};
1442				var selectName = {};
1443				$( "input[name$='Arr'], select[name$='Arr']" ).each( function ( i ,e ) {
1444					console.log( i )
1445					console.log( e )
1446					fieldName[ $( e ).attr( "name" ) ] = $( e ).attr( "name" );
1447				} );
1448				global.commBox.active( form ,fieldName );
1449			} ,
1450			// 기준
1451			active : function ( form ,fieldName ) {
1452				var param = {};
1453				$.each( fieldName ,function ( index ,entry ) {
1454					console.log( entry )
1455					value = global.commBox.chooise( entry );
1456					param[ entry ] = value;
1457				} );
1458				global.commBox.add( form ,param );
1459			} ,
1460			// 폼삽입
1461			add : function ( form ,param ) {
1462				var htmlTag = "";
1463				$.each( param ,function ( i ,e ) {
1464					htmlTag += '<input type="hidden" name="' + i.replace( "Arr" ,"" ) + '" value="' + e + '">';
1465				} )
1466				$( form ).prepend( htmlTag );
1467			} ,
1468			// 타입별 분류
1469			chooise : function ( entry ) {
1470				// 연락처
1471				if ( entry.indexOf( "Tel" ) > 0 ) return global.commBox.type.tel( entry );
1472				// 이메일
1473				else if ( entry.indexOf( "Email" ) > 0 ) return global.commBox.type.email( entry );
1474				else if ( entry.indexOf( "Fax" ) > 0 ) return global.commBox.type.fax( entry );
1475				else if ( entry.indexOf( "CompNum" ) > 0 ) return global.commBox.type.compnum( entry );
1476				else if ( entry.indexOf( "Sex" ) > 0 ) return global.commBox.type.sex( entry );
1477				else if ( entry.indexOf( "BirthDay" ) > 0 ) return global.commBox.type.birthday( entry );
1478				else if ( entry.indexOf( "Date" ) > 0 ) return global.commBox.type.date( entry );
1479				/* else if(entry.indexOf("Addr") > 0) return commBox.type.addr(entry); */
1480			} ,
1481			// 타입별 처리(core)
1482			type : {
1483				"tel" : function ( entry ) {
1484					var values = "";
1485					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1486						values += $( this ).val();
1487						/*
1488						 * if($("[name='" + entry + "']").length == i+1) values += $(this).val(); else values += $(this).val() + "-";
1489						 */
1490					} );
1491					return values.replace( /-/gi ,"" );
1492				} ,
1493				"fax" : function ( entry ) {
1494					var values = "";
1495					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1496						values += $( this ).val();
1497					} );
1498					return values.replace( /-/gi ,"" );
1499				} ,
1500				"email" : function ( entry ) {
1501					var values = "";
1502					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1503						if ( entry.indexOf( "Email3" ) < 1 ) {
1504							if ( entry.indexOf( "Email1" ) > 0 ) {
1505								if ( i == 0 ) values += $( this ).val() + "@";
1506								else if ( i == 1 ) values += $( this ).val();
1507							} else {
1508								if ( i == 0 ) values += $( this ).val() + "@";
1509								else values += $( this ).val();
1510							}
1511						} else {
1512							values += $( this ).val();
1513						}
1514					} );
1515					return values;
1516				} ,
1517				"compnum" : function ( entry ) {
1518					var values = "";
1519					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1520						var chkVal = $( this ).val().replace( /-/gi ,"" );
1521						values += chkVal;
1522					} );
1523					return values;
1524				} ,
1525				"sex" : function ( entry ) {
1526					var values = "";
1527					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1528						values += $( this ).val();
1529					} );
1530					return values;
1531				} ,
1532				"birthday" : function ( entry ) {
1533					var values = "";
1534					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1535						if ( $( this ).val().indexOf( "-" ) < 1 ) {
1536							if ( entry == "stcBirthDay1Arr" ) {
1537								console.log( i );
1538								console.log( $( this ).val() );
1539							}
1540							if ( i != 2 ) {
1541								if ( $( this ).val().length < 2 ) {
1542									var chk = $( this ).val();
1543									var val = "0" + chk;
1544									values += val + "-";
1545								} else {
1546									values += $( this ).val() + "-";
1547								}
1548							} else {
1549								if ( $( this ).val().length < 2 ) {
1550									var chk = $( this ).val();
1551									var val = "0" + chk;
1552									values += val;
1553								} else {
1554									values += $( this ).val();
1555								}
1556							}
1557						} else {
1558							if ( $( this ).val().length < 2 ) {
1559								var chk = $( this ).val();
1560								var val = "0" + chk;
1561								values += val;
1562							} else {
1563								values += $( this ).val();
1564							}
1565						}
1566					} );
1567					return values;
1568				} ,
1569				"date" : function ( entry ) {
1570					var values = "";
1571					$( "[name='" + entry + "']" ).each( function ( i ,e ) {
1572						if ( entry.indexOf( "Date3" ) > 0 || entry.indexOf( "Date4" ) > 0 ) {
1573							if ( i < 2 ) {
1574								if ( $( this ).val().length < 2 ) {
1575									var chk = $( this ).val();
1576									var val = "0" + chk;
1577									values += val + "-";
1578								} else {
1579									values += $( this ).val() + "-";
1580								}
1581							} else if ( i == 2 ) {
1582								if ( $( this ).val().length < 2 ) {
1583									var chk = $( this ).val();
1584									var val = "0" + chk;
1585									values += val + " ";
1586								} else {
1587									values += $( this ).val() + " ";
1588								}
1589							} else if ( i == 3 ) {
1590								if ( $( this ).val().length < 2 ) {
1591									var chk = $( this ).val();
1592									var val = "0" + chk;
1593									values += val + ":";
1594								} else {
1595									values += $( this ).val() + ":";
1596								}
1597							} else {
1598								if ( $( this ).val().length < 2 ) {
1599									var chk = $( this ).val();
1600									var val = "0" + chk;
1601									values += val;
1602								} else {
1603									values += $( this ).val();
1604								}
1605							}
1606						} else {
1607							values += $( this ).val();
1608						}
1609					} );
1610					return values;
1611				} ,
1612			/*
1613			 * "addr" : function(entry){ var values = ""; $("[name='" + entry + "']").each(function(i,e){ values += $(this).val(); }); return values; },
1614			 */
1615			}
1616		} ,
1617		"cookie" : {
1618			"make" : function ( name ,path ,domain ) {
1619				$.cookie( name ,"Y" ,{
1620					path : path ,
1621					domain : domain
1622				} );
1623				console.log( $.cookie( name ) )
1624			} ,
1625			"del" : function ( name ,path ,domain ) {
1626				$.cookie( name ,"done" ,{
1627					expires : 1 ,
1628					path : path ,
1629					domain : domain
1630				} );
1631				console.log( $.cookie( name ) );
1632			}
1633		} ,
1634		// 공통 팝업
1635		commPopup : {
1636			// 쿠키 관련
1637			"cookie" : {
1638				"make" : function ( name ,path ,domain ) {
1639					console.log( name );
1640					console.log( path );
1641					console.log( domain );
1642					$.cookie( name ,"Y" ,{
1643						expires : 356 ,
1644						path : path ,
1645						/* domain : domain , */
1646						secure : 0
1647					} );
1648					console.log( $.cookie( name ) + "_make" );
1649				} ,
1650				"del" : function ( name ,path ,domain ) {
1651					console.log( name );
1652					console.log( path );
1653					console.log( domain );
1654					$.cookie( name ,"done" ,{
1655						expires : 1 ,
1656						path : path ,
1657						/* domain : domain , */
1658						secure : 0
1659					} );
1660					console.log( $.cookie( name ) + "_del" );
1661				}
1662			} ,
1663			// 팝업 생성
1664			"pop" : function ( url ) {
1665				$.ajax( {
1666					"url" : "/comm/popup/popList.do" ,
1667					"data" : {
1668						"url" : url
1669					} ,
1670					"success" : function ( data ) {
1671						data = $.JSONEncode( data );
1672						// 팝업 구현
1673						for ( var i = 0 ; i < data.length ; i++ ) {
1674							var popKind = data[ i ].popKind;
1675							var url = data[ i ].siteUrl;
1676							var domain = data[ i ].siteDomain;
1677							console.log( $.cookie( "POPUP" + data[ i ].popSeq ) + "_if" );
1678							if ( $.cookie( "POPUP" + data[ i ].popSeq ) != "done" ) {
1679								// 쿠키생성
1680								console.log( data[ i ].popSeq );
1681								console.log( data[ i ].popSeq );
1682								console.log( data[ i ].popSeq );
1683								global.commPopup.cookie.make( "POPUP" + data[ i ].popSeq ,data[ i ].siteUrl ,data[ i ].siteDomain );
1684								// 종류 분기 처리
1685								switch ( popKind ) {
1686									// 레이아웃 팝업
1687									case 'A' :
1688										var $html = $( "<div id='popup_" + data[ i ].popSeq + "' popSeq='" + data[ i ].popSeq + "'></div>" );
1689										$html.html( $.unescapeHTML( data[ i ].popContents ) );
1690										// 팝업 구분 위치 ....
1691										$html.layoutPopup( {
1692											"title" : data[ i ].popTtl ,
1693											"position" : [ parseInt( data[ i ].popX ) ,parseInt( data[ i ].popY ) ] ,
1694											"width" : data[ i ].popSquare ,
1695											"buttons" : [ {
1696												"text" : "오늘 하루 보지 않기" ,
1697												"class" : "di_btn_conf" ,
1698												"click" : function () {
1699													// 쿠키 제한
1700													global.commPopup.cookie.del( "POPUP" + $( this ).attr( "popSeq" ) ,url ,domain );
1701													$( this ).dialog( 'destroy' ).remove();
1702												}
1703											} ,{
1704												text : "닫기" ,
1705												addClass : "di_btn_close ui-button ui-corner-all ui-widget" ,
1706												click : function () {
1707													$( this ).dialog( 'destroy' ).remove();
1708												}
1709											} ]
1710										} );
1711										break;
1712									// 윈도우 팝업
1713									case 'B' :
1714										var url = "/comm/popup/windowPop.do?dataSeq=" + data[ i ].popSeq;
1715										var option = "width=" + data[ i ].popSquare + ",height=" + data[ i ].popHeight + ", top=" + data[ i ].popY + ", left=" + data[ i ].popX + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no";
1716										window.open( url ,"windowPop" ,option );
1717										break;
1718									default :
1719										break;
1720								}
1721							}
1722						}
1723					}
1724				} );
1725				return false;
1726			}
1727		},
1728	} );
1729	if ( global.resultMsg ) {
1730		$.alert( global.resultMsg );
1731	}
1732} );
1733var ajaxCropEmptyVal = function () {
1734	$( '.fileEdite_area img' ).each( function () {
1735		if ( $( this ).attr( 'src' ).indexOf( 'crop.do' ) != -1 ) {
1736			var $this = $( this );
1737			var $thisSrc = $this.attr( 'src' );
1738			var $params = {
1739				width : $.parseInt( $this.data( "params" ).naturalWidth ) ,
1740				height : $.parseInt( $this.data( "params" ).naturalHeight ) ,
1741				encSvrFileNm : new RegExp( '[\?&amp;]encSvrFileNm=([^&amp;#]*)' ).exec( $thisSrc )[ 1 ]
1742			};
1743			if ( $params.encSvrFileNm == '' ) {
1744				$this.css( 'width' ,'81px' );
1745				$this.parent().css( {
1746					'text-align' : 'center' ,
1747					'overflow' : 'hidden'
1748				} );
1749			} else {
1750				$this.css( 'width' ,'auto' );
1751				$this.parent().css( {
1752					'text-align' : 'center' ,
1753					'overflow' : 'hidden'
1754				} );
1755			}
1756		}
1757	} );
1758};
1759
1760/*
1761 * charByteSize(ch) : 한글자에 대한 byte를 계산합니다. getByteLength(s) : 입력된 글자 전체의 byte를 계산해서 알려줍니다. cutByteLength(s) : 원하는 byte 만큼 글자를 잘라서 반환합니다.
1762 */
1763var calByte = {
1764	getByteLength : function ( str ) {
1765		if ( str == null || str.length == 0 ) { return 0; }
1766		var size = 0;
1767		for ( var i = 0 ; i < str.length ; i++ ) {
1768			size += this.charByteSize( str.charAt( i ) );
1769		}
1770		return size;
1771	} ,
1772	cutByteLength : function ( str ,len ) {
1773		if ( str == null || str.length == 0 ) { return 0; }
1774		var size = 0;
1775		var rIndex = str.length;
1776		for ( var i = 0 ; i < str.length ; i++ ) {
1777			size += this.charByteSize( str.charAt( i ) );
1778			if ( size == len ) {
1779				rIndex = i + 1;
1780				break;
1781			} else if ( size > len ) {
1782				rIndex = i;
1783				break;
1784			}
1785		}
1786		return str.substring( 0 ,rIndex );
1787	} ,
1788	charByteSize : function ( ch ) {
1789		if ( ch == null || ch.length == 0 ) { return 0; }
1790		var charCode = ch.charCodeAt( 0 );
1791		if ( charCode <= 0x00007F ) {
1792			return 1;
1793		} else if ( charCode <= 0x0007FF ) {
1794			return 2;
1795		} else if ( charCode <= 0x00FFFF ) {
1796			return 2;
1797		} else {
1798			return 4;
1799		}
1800	}
1801};
1802
1803$( document ).ready( function () {
1804	var url = window.location.pathname;
1805	console.log( url );
1806	global.commPopup.pop( url );
1807} );

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.