PageSourceSearch

https://dream10.org/resources/frontoffice/common/js/function.js?ver=20260924223618

js dream10.org collected 2026-09-24 13:36:36 UTC 74,204 bytes, 2,968 lines download raw bytes

1
2//datepicker 설정
3var datepickerOption = {
4	"dateFormat" : "yy-mm-dd"
5	,"dayNames" : ["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]
6	,"dayNamesMin" : ["일","월","화","수","목","금","토"]
7	,"dayNamesShort" : ["일","월","화","수","목","금","토"]
8	,"monthNames" : ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]
9	,"showMonthAfterYear" : true
10	,"yearSuffix" : "년"
11};
12
13
14// 특정 object(movObj)를 기준 object(stdObj)의 원하는 위치로 이동시킨다.
15// posDirect(기본값 : D)		: 상,하,좌,우 (U,D,L,R) movObj를 stdObj의 어느 자리에 위치 시킬지 결정
16// posVert						: movObj와 stdObj의 위를 맞출지 아래를 맞출지 결정(U, D)
17// posHori(기본값 : L)			: movObj와 stdObj의 왼쪽을 맞출지 오른쪽을 맞출지 결정(L, R)
18// adjLeft, adjTop (기본값 : 0)	: 위치조정용 변수
19// movObj의 position을 absolute으로, display를 block으로 변경 시킨다
20///////////// chkNan() 필요(값이 nan인지 체크)
21function setObjByObj(stdObj, movObj, posDirect, posVert, posHori, adjLeft, adjTop)
22{
23	if(!posDirect)
24		posDirect = "D";
25	if(!posHori)
26		posHori = "L";
27
28	if(!adjLeft || isNaN(adjLeft))
29		adjLeft = 0;
30	if(!adjTop || isNaN(adjTop))
31		adjTop = 0;
32
33	// 기준객체의 위치
34	var left		= $(stdObj).offset().left;
35	var top			= $(stdObj).offset().top;
36
37	// 기준객체 크기
38	var stdWidth	= $(stdObj).width();
39	var stdHeight	= $(stdObj).height();
40
41	// 기준객체 border 값
42	var stdBorderTop	= chkNan(parseInt($(stdObj).css("border-top-width")), 0);
43	var stdBorderBottom	= chkNan(parseInt($(stdObj).css("border-bottom-width")), 0);
44	var stdBorderLeft	= chkNan(parseInt($(stdObj).css("border-left-width")), 0);
45	var stdBorderRight	= chkNan(parseInt($(stdObj).css("border-right-width")), 0);
46
47	// 기준객체 padding값
48	var stdPaddingTop	= chkNan(parseInt($(stdObj).css("padding-top")), 0);
49	var stdPaddingBottom= chkNan(parseInt($(stdObj).css("padding-bottom")), 0);
50	var stdPaddingLeft	= chkNan(parseInt($(stdObj).css("padding-left")), 0);
51	var stdPaddingRight	= chkNan(parseInt($(stdObj).css("padding-right")), 0);
52
53
54
55	// 이동객체 크기
56	var movWidth	= $(movObj).width();
57	var movHeight	= $(movObj).height();
58
59	// 이동객체 border 값
60	var movBorderTop	= chkNan(parseInt($(movObj).css("border-top-width")), 0);
61	var movBorderBottom	= chkNan(parseInt($(movObj).css("border-bottom-width")), 0);
62	var movBorderLeft	= chkNan(parseInt($(movObj).css("border-left-width")), 0);
63	var movBorderRight	= chkNan(parseInt($(movObj).css("border-right-width")), 0);
64
65	// 이동객체 margin값
66	var movMarginTop	= chkNan(parseInt($(movObj).css("margin-top")), 0);
67	var movMarginBottom	= chkNan(parseInt($(movObj).css("margin-bottom")), 0);
68	var movMarginLeft	= chkNan(parseInt($(movObj).css("margin-left")), 0);
69	var movMarginRight	= chkNan(parseInt($(movObj).css("margin-right")), 0);
70	
71	// 이동객체 padding값
72	var movPaddingTop	= chkNan(parseInt($(movObj).css("padding-top")), 0);
73	var movPaddingBottom= chkNan(parseInt($(movObj).css("padding-bottom")), 0);
74	var movPaddingLeft	= chkNan(parseInt($(movObj).css("padding-left")), 0);
75	var movPaddingRight	= chkNan(parseInt($(movObj).css("padding-right")), 0);
76	
77	stdWidth	+= stdBorderLeft + stdBorderRight;
78	stdHeight	+= stdBorderTop + stdBorderBottom;
79
80	movWidth	+= movBorderLeft + movBorderRight;
81	movHeight	+= movBorderTop + movBorderBottom;
82
83	if(posDirect == "U")		//위쪽에 위치
84	{
85		top -= movHeight + movPaddingTop + movPaddingBottom;
86		if(posHori == "R")
87			left += stdWidth - movWidth - movPaddingLeft - movPaddingRight + stdPaddingLeft + stdPaddingRight;
88
89	}else if(posDirect == "D")	//아래쪽에 위치
90	{
91		top += stdHeight + stdPaddingTop + stdPaddingBottom;
92		if(posHori == "R")
93			left += stdWidth - movWidth - movPaddingLeft - movPaddingRight + stdPaddingLeft + stdPaddingRight;
94
95	}else if(posDirect == "L")	//왼쪽에 위치
96	{
97		left -= movWidth + movPaddingLeft + movPaddingRight;
98		if(posVert == "D")
99			top -= movHeight - stdHeight + movPaddingTop + movPaddingBottom - stdPaddingTop 
99- stdPaddingBottom;
100
101	}else if(posDirect == "R")	//오른쪽에 위치
102	{
103		left += stdWidth + stdPaddingLeft + stdPaddingRight;
104		if(posVert == "D")
105			top -= movHeight - stdHeight + movPaddingTop + movPaddingBottom - stdPaddingTop - stdPaddingBottom;
106	}
107
108	top -= movMarginTop;
109	left -= movMarginLeft;
110
111	left += adjLeft;
112	top += adjTop;
113
114	$(movObj).css({
115		"display"	: "block",
116		"position"	:"absolute",
117		"left"		: left,
118		"top"		: top
119	});
120}
121
122function chkNan(obj, newVal)
123{
124	if(isNaN(obj))
125		return newVal;
126	else
127		return obj;	
128}
129
130
131
132// 반투명 레이어를 화면 전체에 덮는다.
133// 모든 인자 생략 가능(기본 설정된 투명도의 회색 배경)
134// depth(0~100) : 투명도. 높을 수록 진함
135// zIndex : z-index값이 필요할 때 사용
136// bgColor : 배경 색(000000 : 검정)
137// n : 여러개를 사용할 때(사용할일 없을듯..)
138// 
139function setGrayBg(depth, zIndex, bgColor, n)
140{
141	var docWidth	= $(window).width();
142	var docHeight	= $(window).height();
143	var opacity		= 40;
144	
145	if(depth)
146		opacity = depth;
147	if(!bgColor)
148		bgColor = "000000";
149
150	var divHtml = "<div id='idGrayBg"+n+"' ";
151	divHtml += "style='position:absolute; left:0px; top:0px; display:block; width:"+docWidth+"px; height:"+docHeight+"px; ";
152	divHtml += "filter:alpha(opacity="+opacity+");opacity:"+(opacity/100)+";-moz-opacity:"+(opacity/100)+"; ";
153	if(zIndex)
154		divHtml += "z-index:"+zIndex+";";
155
156	divHtml += "background-color:#"+bgColor+";";
157	divHtml += "'></div>"
158
159	$("#idGrayBg"+n).remove();
160	$(document.body).append(divHtml);
161}
162
163
164
165
166/******************************** 폼관련 시작 ********************************/
167/*
168Name : check_chr
169Parameter : input 오브젝트, 메시지, 글자수값(ex> 5)
170Description : 입력값 폼체크
171*/
172function check_chr(tar2, str2, max2)
173{
174	if(tar2.value.length < max2) {
175		alert(str2+(chkJongsung(str2)>0?"을":"를")+' '+ max2 +'자 이상 입력해주세요.'); 
176		if (tar2.style.display != "none")
177		{
178			tar2.focus(); 
179		}
180		return true; 
181	}
182	return false;
183}
184
185function check_chr_e(tar2, str2, max2)
186{
187	if(tar2.value.length < max2) {
188		alert("Please enter at least "+max2+" letter(s) for "+str2); 
189		if (tar2.style.display != "none")
190		{
191			tar2.focus(); 
192		}
193		return true; 
194	}
195	return false;
196}
197
198/*
199Name : length
200Parameter : 글자
201Description : 해당글자수 구하기
202*/
203function length(str) {
204	return (str.length + (escape(str) + "%u").match(/%u/g).length-1);
205}
206
207/*
208Name : length
209Parameter : 글자
210Description : 해당글자수 구하기
211*/
212function checkMaxLength(e, obj, len, viewMsg) {
213	if(viewMsg)
214		window.status = "";
215		
216	// backspace(8), tab(9), delete(46), home(35), end(36), left(37), right(39)
217	if(e.keyCode == 8 || e.keyCode == 9 || e.keyCode == 46
218		|| e.keyCode == 35 || e.keyCode == 36
219		|| e.keyCode == 37 || e.keyCode == 39) {
220		e.returnValue = true;
221		return;
222	}
223
224	
225
226	if(length(obj.value) >= len) {
227		if(viewMsg) {
228			window.status = e.keyCode + "overflow length : " + length(obj.value);
229		}
230		alert("글자수가 " + len + "자 이하로 입력해주세요.(한글 : " + Math.floor(len/2) + "자, 영문 : " + len + "자)");
231		obj.value = countString(obj.value, len-1);
232		return;
233	}
234	e.returnValue = true;
235}
236
237/*
238Name : length
239Parameter : 글자
240Description : 해당글자수 구하기
241*/
242function onBlurCheckLength(obj, len, isAlert) {
243	if(length(obj.value) > len) {
244		var msg = "글자수가 " + len + "자 이하로 입력해주세요.(한글 : " + Math.floor(len/2) + "자, 영문 : " + len + "자)";
245		if(isAlert)
246			alert(msg);
247		else
248			window.status = msg;
249		obj.value = countString(obj.value, len);
250		obj.focus();
251	}
252}
253
254/*
255Name : length
256Parameter : 글자
257Description : 해당글자수 구하기
258*/
259function countString(str, len) {
260	if(length(str) < len)
261		return str;
262	var cnt = 0;
263	var ret = "";
264
265	for(i = 0; i < len && cnt < len; i++) {
266		var ch_i = str.charAt(i);
267		var ch = escape(ch_i);
268		if(length(ch) == 1 || ch_i == "%") {
269			cnt++;
270			ret += str.charAt(i);
271		} else {
272			cnt += 2;
273			if(i + 1 < len) // 지정길에에 한글이 걸리면 통과
274				ret += str.charAt(i);
275		}		
276	}	
277	return ret;
278}
279
280/*
281Name : radio_check_write
282Parameter : 객체, 값
283Description : input 라디오 관련 값 체크
284*/
285function radio_check_write(item01, item02)
286{
287	if(typeof(item01.length) == ""){
288		if(item01.value == item02){
289			item01.checked = true;
290		}
291		else{
292			item01.checked = false;
293		}
294	}
295	else{
296		for (i = 0; i < item01.length; i++ )
297		{
298			if(item01[i].value == item02){
299				item01[i].checked = true;
300			}
301			else{
302				item01[i].checked = false;
303			}
304		}
305	}
306}
307
308/*
309Name : num_check
310Parameter : 객체
311Description : 숫자입력체크(ex > num_check(this))
312*/
313function num_check(e, item)
314{
315	if(!e) var e = window.event;
316	if(e.which) eventObj = e.which;
317	else if(e.keyCode) eventObj = e.keyCode;
318
319	if(eventObj == 48 || eventObj == 49 || eventObj == 50  || eventObj == 51  || eventObj == 52  || eventObj == 53  || eventObj == 54  || eventObj == 55  || eventObj == 56  || eventObj == 57 || eventObj == 17 || eventObj == 67 || eventObj == 43 || eventObj == 86 || eventObj == 56 || eventObj == 9 || eventObj == 56 || eventObj == 8 || eventObj == 46 || eventObj == 37 || eventObj == 38 || eventObj == 39 || eventObj == 40 || eventObj == 45 || eventObj == 13){
320	}
321	else{
322		alert("숫자만 입력해주세요.");
323		if(e.preventDefault){
324			e.preventDefault();
325		}
326		else{
327			e.returnValue=false;
328		}
329		item.focus();
330	}
331}
332
333/*
334Name : new_chkDate
335Parameter : 객체
336Description : 날짜 형식체크(ex > new_chkDate(this))
337*/
338function new_chkDate(obj)
339{
340	var str = obj.value;
341	if(str == "") return;
342	var exp = /[0-9]{4}-[0-9]{2}-[0-9]{2}/
343	if(!exp.test(str))
344	{
345		alert("날짜형식에 맞게 입력하세요.\n\n예)2007-05-05")
346		obj.value = "";
347		obj.focus();
348		return
349	}
350	var Year = Number(str.substring(0,4));
351	var Month = Number(str.substring(5,7));
352	var Day = Number(str.substring(8,10));
353
354	var february = ((0 == Year % 4) && (0 != (Year % 100))) || 
355	(0 == Year % 400) ? 29 : 28;    
356	var arrLastDate = new Array(31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);//해당월의 마지막일
357	if((Month < 1 || Month > 12) || (Day < 1 || Day > arrLastDate[Month-1]))
358	{
359		alert("잘못된 날짜 값을 입력하셨습니다.\n올바른 잘짜 값을 입력하세요.");
360		obj.value="";
361		obj.focus();
362		return;
363	}
364
365	return;
366}
367/********************************폼관련 끝 ********************************/
368
369
370/******************************** 로그인관련 시작 ********************************/
371/*
372Name : check_chr
373Parameter : 로그인 구분(0:관리자,1:유저)
374Description : 입력값 폼체크
375*/
376function goLogin(item)
377{
378	var f = document.frmInfo;
379	if(item == 0){
380		if(check_chr(f.login_id, "아이디",2) != false) return false;
381		if(check_chr(f.login_pwd, "비밀번호",2) != false) return false;
382		f.action = "/mg/login/login_ok.asp";
383	}
384	else{
385		if(check_chr(f.u_id, "아이디",2) != false) return false;
386		if(check_chr(f.u_pwd, "비밀번호",2) != false) return false;
387		f.action = "/mem/login_ok.asp";
388	}
389
390	return true;
391}
392
393/*
394Name : goLoginFocus
395Description : 화면 출력시 아이디로 포커스
396*/
397function goLoginFocus()
398{
399	var f = document.frmInfo;
400	f.login_id.focus();
401}
402
403/*
404Name : goLoginEnter
405Parameter : event, 로그인구분(0:관리자,1:유저)
406Description : 엔터 입력시 로그인처리
407*/
408function goLoginEnter(e, item)
409{
410	if(!e) var e = window.event;
411	if(e.which) eventObj = e.which;
412	else if(e.keyCode) eventObj = e.keyCode;
413
414	if(eventObj == 13){
415		goLogin(item);
416	}
417}
418
419/*
420Name : goLoginOut
421Parameter : 로그아웃 구분(0:관리자,1:유저)
422Description : 로그아웃
423*/
424function goLoginOut(item)
425{
426	if(item == 0){
427		location.href = "/mg/login/logout.asp";
428	}
429	else{
430		location.href = WEB_ROOT+"/mem/log_out.asp";
431	}
432}
433
434
435/*
436Name : goMemeberModiLink
437Parameter : 회원 구분(1:일반회원, 2:기업회원)
438Description : 회원구분에 따른 정보수정페이지 이동
439*/
440function goMemeberModiLink(item)
441{
442	location.href = (item == "1") ? WEB_ROOT+"/mem/mem_form.asp?scrID=0000000064&pageNum=8&subNum=1&ssubNum=1"
443									: "/mem/business_form.asp?scrID=0000000065&pageNum=9&subNum=1&ssubNum=1";
444}
445
446/*
447Name : goFindIDCheck
448Parameter : 구분(1:아이디찾기, 2:비밀번호찾기)
449Description : 아이디/비밀번호찾기 체크
450*/
451function goFindIDCheck(item)
452{
453	if(item == "1"){
454		var f = document.actFormID;
455		if(check_chr(f.u_name, "이름",1) != false) return false;
456		if(check_chr(f.u_email, "이메일",5) != false) return false;
457		f.act.value = "findID";
458
459	}
460	else{
461		var f = document.actFormPWD;
462
463		if(check_chr(f.u_id, "아이디",2) != false) return false;
464		if(check_chr(f.u_name, "이름",1) != false) return false;
465		if(check_chr(f.u_email, "이메일",5) != false) return false;
466		f.act.value = "findPWD";
467
468		var result = true;
469
470		$.ajax({
471			type : "POST",
472			url  : "/mem/login_id_pw_chk.asp",
473			async : false,
474			dataType : "json",
475			data:{
476				"u_id" : f.u_id.value
477				,"u_name" : f.u_name.value
478				,"u_email" : f.u_email.value
479			},
480			error  : function(jqXHR, textStatus, errorThrown){
481				console.log(jqXHR);
482	//			alert(jqXHR.responseText +"\n\n"+textStatus+"\n\n"+errorThrown);
483			},
484			success  : function(msg){
485				if(msg.result == 1)
486				{
487					if(!confirm("회원정보가 확인되었습니다.\n\n비밀번호를 초기화 시키시겠습니까?"))
488						result = false;
489				}else
490				{
491					alert("입력하신 내용과 일치하는 회원정보가 없습니다.");
492					result = false;
493				}
494			}
495		});
496
497		if(!result)
498			return result;
499	}
500
501	f.action = "login_id_find_ok.asp";
502}
503/******************************** 로그인관련 끝 ********************************/
504
505/******************************** 기타관련 시작 ********************************/
506/*
507Name : onLoadHeightSize
508Description : 관리자 화면 가로세로 리사이즈(카피라이트 부분 및 탑메뉴 때문에 어쩔수 없었음) - 동적이라서??
509*/
510function onLoadHeightSize()
511{
512	var mainContFrameHeight;
513	if(navigator.userAgent.toUpperCase().indexOf('MSIE')>=0)
514	{
515		mainContFrameHeight = document.body.clientHeight;
516
517		mainContFrameHeight = mainContFrameHeight - document.getElementById('mainTopFrame').offsetHeight - document.getElementById('mainBottomFrame').offsetHeight;
518
519		if(mainContFrameHeight < document.getElementById("mainContFrame").offsetHeight){
520			mainContFrameHeight = document.getElementById("mainContFrame").offsetHeight;
521		}
522
523		if(Number(document.getElementById("mainLeftFrame").offsetWidth + document.getElementById("mainContFrame").offsetWidth) > document.body.clientWidth){
524			document.getElementById("mainFrame").style.width = document.getElementById("mainLeftFrame").offsetWidth + document.getElementById("mainContFrame").offsetWidth + 30 + "px";
525		}
526
527		if(Number(document.getElementById("mainTopFrameMenu").offsetWidth) > Number(document.body.clientWidth)){
528			document.getElementById("mainFrame").style.width = document.getElementById("mainTopFrameMenu").offsetWidth + "px";
529		}
530
531		if(Number(document.getElementById("mainFrame").offsetWidth) <= Number(document.body.clientWidth)){
532			document.getElementById("mainFrame").style.width = document.body.clientWidth + "px";
533		}
534
535		document.getElementById("mainLeftFrame").style.height = mainContFrameHeight + "px";
536	}
537	else{
538		mainContFrameHeight = window.innerHeight - document.getElementById('mainBottomFrame').offsetHeight;
539		if(mainContFrameHeight < document.getElementById("mainContFrame").offsetHeight){
540			mainContFrameHeight = document.getElementById("mainContFrame").offsetHeight;
541		}
542
543		if(Number(document.getElementById("mainLeftFrame").offsetWidth + document.getElementById("mainContFrame").offsetWidth) > window.innerWidth){
544			document.getElementById("mainFrame").style.width = document.getElementById("mainLeftFrame").offsetWidth + document.getElementById("mainContFrame").offsetWidth + 30 + "px";
545		}
546
547		if(Number(document.getElementById("mainTopFrameMenu").offsetWidth) > Number(window.innerWidth)){
548			document.getElementById("mainFrame").style.width = document.getElementById("mainTopFrameMenu").offsetWidth + "px";
549		}
550
551		if(Number(document.getElementById("mainFrame").offsetWidth) < Number(window.innerWidth)){
552			document.getElementById("mainFrame").style.width = window.innerWidth-20 + "px";
553		}
554
555		document.getElementById("mainLeftFrame").style.height = mainContFrameHeight-55 + "px";
556	}
557}
558
559/*
560Name : getTopPosType
561Parameter : 해당 객체
562Description : 세로위치 구하기
563*/
564function getTopPosType(inputObj)
565{
566	
567  var returnValue = inputObj.offsetTop + inputObj.offsetHeight;
568  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetTop;
569  return returnValue + 0;
570}
571
572/*
573Name : getLeftPosType
574Parameter : 해당 객체
575Description : 가로위치 구하기
576*/
577function getLeftPosType(inputObj)
578{
579  var returnValue = inputObj.offsetLeft;
580  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
581  return returnValue + 0;
582}
583
584/*
585Name : goImageChange
586Parameter : 해당 객체, 보여줄DIV ID
587Description : 첨부파일 이미지 미리보기
588*/
589function goImageChange(thisObj, preViewer)
590{
591	if(!/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i.test(thisObj.value)) {
592		// 이미지형식이 아닌 파일일 경우 폼 초기화
593//		$(thisObj).clone().insertBefore(thisObj);
594//		$(thisObj).remove();
595
596		alert("이미지 형식의 파일을 선택하십시오");
597		return;
598	}
599
600	if($("[name=nameTmpFileUpload]").length<1)
601	{
602		var tmpHtml = "<iframe width='300' height='100' frameborder='1' style='display:none; z-index:100;' src='' name='nameTmpFileUpload'></iframe>";
603		$(document.body).append(tmpHtml);
604	}
605	if($("[name=nameTmpFileIndex]").length<1)
606	{
607		var tmpHtml = "<input type='hidden' name='nameTmpFileIndex'>";
608		$("[name=frmInfo]").append(tmpHtml);
609	}
610	if($("[name=namePreviewId]").length<1)
611	{
612		var tmpHtml = "<input type='hidden' name='namePreviewId'>";
613		$("[name=frmInfo]").append(tmpHtml);
614	}
615
616	
617	var $objIframe	= $("[name=nameTmpFileUpload]");
618	
619	var obj			= document.frmInfo;
620	var prevAction	= obj.action;
621	var prevTarget	= obj.target;
622	var prevEncoding= obj.encoding;
623	var index		= $("[name=file_img]").index($(thisObj));
624	$("[name=nameTmpFileIndex]").val(index+1);
625	$("[name=namePreviewId]").val(preViewer);
626
627	obj.action = "/include/prevImageUpload.asp";
628	obj.target = "nameTmpFileUpload";
629	obj.encoding = "multipart/form-data";
630	obj.submit();
631	
632	obj.action = prevAction;
633	obj.target = prevTarget;
634	obj.encoding = prevEncoding;
635
636}
637
638/*
639Name : goPhotoView
640Parameter : 보여줄DIV ID, 파일경로(절대주소)
641Description : 업로드된 이미지 보기
642*/
643function goPhotoView(item01, item02)
644{
645	var ua = window.navigator.userAgent;
646
647//	if (ua.indexOf("MSIE") > -1) {
648//		document.getElementById(item01).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + item02 + "', sizingMethod='scale')";
649//	}
650//	else{
651		var tmpImage = new Image();
652		tmpImage.src = item02;
653		var tmpPreview = document.getElementById(item01);
654		var tmpPreviewWidth = tmpPreview.offsetWidth;
655		var tmpPreviewHeight = tmpPreview.offsetHeight;
656
657		tmpPreview.innerHTML = "<img src='" + item02 + "' width='" + tmpPreviewWidth + "' height='" + tmpPreviewHeight + "' alt='작은이미지' title='작은 이미지' />";
658//	}
659	//document.getElementById(item01).style.backgroundImage = "url(" + item02 + ")";
660}
661/******************************** 기타관련 시작 ********************************/
662
663/******************************** 게시판 관련 시작 *****************************/
664
665
666/*
667Name : goAllCheckDis
668Description : 게시판 전체선택 및 전체취소 이미지 교체
669*/
670function goAllCheckDis()
671{
672	var f = document.frmInfo;
673	if(typeof(f.bd_all.length) == "undefined"){
674		document.getElementById("allOk").style.display = (f.bd_all.checked == true) ? "none" : "block";
675		document.getElementById("allCancel").style.display = (f.bd_all.checked == true) ? "block" : "none";
676	}
677	else{
678		var allCnt = 0
679		for(i = 0; i < f.bd_all.length; i++){
680			if(f.bd_all[i].checked == true){
681				allCnt++;
682			}
683		}
684
685		document.getElementById("allOk").style.display = (allCnt == f.bd_all.length) ? "none" : "block";
686		document.getElementById("allCancel").style.display = (allCnt == f.bd_all.length) ? "block" : "none";
687	}
688}
689
690/*
691Name : goSearchDis
692Parameter : 검색항목 배열 인덱스값
693Description : 검색관련 폼변경(일자 검색)
694*/
695function goSearchDis(item)
696{
697	document.getElementById("s_string_dis").style.display = (item != "3") ? "block" : "none";
698	document.getElementById("s_date_dis").style.display = (item == "3") ? "block" : "none";
699}
700
701/*
702Name : goSearchReset
703Parameter : 초기화 필요한 Parameter 값
704Description : 해당 페이지 초기화 페이지로 이동
705*/
706function goSearchReset( )
707{
708	var searchLinkURL = "";
709	if(arguments.length == 1){
710		searchLinkURL = dev_list_name + "?scrID=" + arguments[0];
711	}
712	else{
713		searchLinkURL = dev_list_name + "?scrID=" + arguments[0];
714		for (i = 1; i < arguments.length; i++ )
715		{
716			if(i == 1 && arguments[i] != ""){
717				searchLinkURL += "&pageNum=" + arguments[i];
718			}
719			else if(i == 2 && arguments[i] != ""){
720				searchLinkURL += "&subNum=" + arguments[i];
721			}
722			else if(i == 3 && arguments[i] != ""){
723				searchLinkURL += "&ssubNum=" + arguments[i];
724			}
725			else if(i == 4 && arguments[i] != ""){
726				searchLinkURL += "&sssubNum=" + arguments[i];
727			}
728		}
729	}
730
731	location.href = WEB_ROOT+searchLinkURL;
732}
733
734/*
735Name : goForm
736Parameter : 인덱스값, 인덱스 필드명
737Description : 해당 페이지 초기화 페이지로 이동
738*/
739function goForm(item01, item02)
740{
741	var f = document.frmInfo;
742	var idxObj = eval("document.frmInfo." + item02);
743	idxObj.value = item01;
744//	f.act.value = (item01 == "") ? "form" : "edit";
745	f.target = "_self";
746	f.action = dev_form_name;
747	f.submit();
748}
749
750/*
751Name : goList
752Description : 리스트 페이지로 이동
753*/
754function goList()
755{
756	var f = document.frmInfo;
757//	f.act.value = "list";
758	f.target = "_self";
759	f.action = dev_list_name;
760	f.submit();
761}
762
763/*
764Name : goDetail
765Parameter : 인덱스값, 인덱스 필드명
766Description : 해당 View 화면으로 이동
767*/
768function goDetail(item01, item02)
769{
770	var f = document.frmInfo;
771	var idxObj = eval("document.frmInfo." + item02);
772	idxObj.value = item01;
773//	f.act.value = "view";
774	f.target = "_self";
775	f.action = dev_detail_name;
776	f.submit();
777}
778
779/*
780Name : goReply
781Description : 답글 폼으로 이동
782*/
783function goReply()
784{
785	var f = document.frmInfo;
786	f.bd_level.value = Number(f.bd_level.value) + 1;
787//	f.act.value = "form";
788	f.targe = "_self";
789	f.action = dev_form_name;
790	f.submit();
791}
792
793/*
794Name : goSearch
795Description : 리스트 검색하기
796*/
797function goSearch()
798{
799	var f = document.frmInfo;
800	f.currentPage.value = "1";
801//	f.act.value = "list";
802	f.target = "_self";
803	f.action = dev_list_name;
804	f.submit();
805}
806
807/*
808Name : goPage
809Parameter : 페이지넘버
810Description : 해당 Page로가기
811*/
812function goPage(item)
813{
814	var f = document.frmInfo;
815	f.currentPage.value = item;
816//	f.act.value = "list";
817	f.target = "_self";
818	f.action = dev_list_name;
819	f.submit();	
820}
821
822/*
823Name : goCommentPage
824Parameter : 페이지넘버
825Description : 해당 Page 댓글 목록으로가기
826*/
827function goCommentPage(item)
828{
829	var f = document.frmInfo;
830	f.page2.value = item;
831//	f.act.value = "view";
832	f.target = "_self";
833	f.action = dev_detail_name;
834	f.submit();	
835}
836
837/*
838Name : goAllDelete
839Description : 리스트 화면에서 체크된 항목 삭제
840*/
841function goAllDelete(item)
842{
843	var f = document.frmInfo;
844	var cnt = 0;
845	if(typeof(f.bd_all.length) == "undefined"){
846		if(f.bd_all.checked){
847			cnt++;
848		}
849	}
850	else{
851		for(i = 0; i < f.bd_all.length; i++){
852			if(f.bd_all[i].checked){
853				cnt++;
854			}
855		}
856	}
857
858	if(cnt == 0){
859		alert("체크된 항목이 없습니다.");
860		return;
861	}
862
863	if(confirm("체크한 항목을 삭제 하시겠습니까?")){
864//		f.act.value = "alldel";
865		if(location.href.indexOf("/mem_list.asp") < 0)
866			f.encoding	= "multipart/form-data";
867		f.target = "_self";
868		f.action = dev_proc_name;
869		f.submit();
870	}
871}
872
873/*
874Name : goInsert
875Parameter : 등록,수정 여부(add, modi)
876Description : 게시판 등록,수정 체크
877*/
878function goInsert(item)
879{
880	var f = document.frmInfo;
881
882	if(!checkFileSize(f.file_name))	return ;
883
884//	var oEditor = null;
885	if(check_chr(f.bd_title, "제목",1) != false) return;
886	if(document.getElementsByName("bd_name").length>0)
887		if(check_chr(f.bd_name, "작성자",1) != false) return;
888
889/*
890	if(oEditor != null)
891	{
892		if (oEditor.GetXHTML(true).replace(/ /g,"") == '') {
893			alert('내용을 입력하세요');
894			oEditor.Focus();
895			return;
896		}
897	}
898*/
899
900//	f.act.value = item;
901	f.encoding	= "multipart/form-data";
902	f.targe		= "_self";
903	f.action	= dev_proc_name;
904	f.submit();
905}
906
907function goInsertReq(item)
908{
909	var f = document.frmInfo;
910	var oEditor = null;
911	//if(document.getElementsByName("bd_content01").length>0)
912		//oEditor = FCKeditorAPI.GetInstance('bd_content01');
913	if(check_chr(f.bd_title, "제목",1) != false) return;
914	if(document.getElementsByName("bd_name").length>0)
915		if(check_chr(f.bd_name, "작성자",1) != false) return;
916
917	//if(check_chr(f.bd_pass, "비밀번호",1) != false) return;
918	/*
919	if(oEditor != null){
920		if (oEditor.GetXHTML(true).replace(/ /g,"") == '') {
921			alert('내용을 입력하세요');
922			oEditor.Focus();
923			return;
924		}
925	}
926	*/
927	
928	if(f.bd_name.value.length == 0){
929		alert("작성자를 입력해주십시오.");
930		return false;
931	}
932/*
933	if(f.bd_email.value.length == 0){
934		alert("이메일을 입력해주십시오.");
935		return false;
936	}
937*/
938	if(f.bd_pass.value.length == 0){
939		alert("비밀번호를 입력해주십시오.");
940		return false;
941	}
942
943//	f.act.value = item;
944	f.encoding	= "multipart/form-data";
945	f.targe		= "_self";
946	f.action	= dev_proc_name;
947	//f.submit();
948	try
949	{
950		Editor.save();		
951	}
952	catch (e)
953	{
954		f.submit();
955	}
956
957
958}
959
960/*
961Name : goDelete
962Description : 자료 삭제하기
963*/
964function goDelete()
965{
966	var f = document.frmInfo;
967	if(confirm("해당 자료을 삭제 하시겠습니까?")){
968//		f.act.value = "del";
969//		f.encoding	= "multipart/form-data";
970		f.targe		= "_self";
971		f.action	= dev_proc_name;
972		f.submit();
973	}
974}
975
976/*
977Name : goSubFileDel
978Parameter : 삭제할 파일명
979Description : 첨부파일 삭제하기
980*/
981function goSubFileDel(item)
982{
983	var f = document.frmInfo;
984	if(confirm("해당 파일을 삭제 하시겠습니까?")){
985		f.file_del.value = item;
986//		f.act.value = "filedel";
987		f.encoding	= "multipart/form-data";
988		f.targe		= "_self";
989		f.action	= dev_proc_name;
990		f.submit();
991	}
992}
993
994/*
995Name : mg_flashWrite
996Parameter : ID, 플래시 주소, 가로, 세로, wmode
997Description : 플래시 출력
998*/
999function mg_flashWrite( id, flashUri, vWidth, vHeight, winMode ) {
1000	var _obj_ = "";
1001
1002	_obj_ = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" align="middle">';
1003	_obj_ += '<param name="movie" value="' + flashUri + '" />';
1004	_obj_ += '<param name="quality" value="high" />';
1005	_obj_ += '<param name="wmode" value="' + winMode + '" />    ';
1006	_obj_ += '<param name="bgcolor" value="#ffffff" />        ';
1007	_obj_ += '<embed src="' + flashUri + '" quality="high" wmode="' + winMode + '" bgcolor="#ffffff" width="' + vWidth +'" height="' + vHeight + '" id="' + id + '" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>    ';
1008	_obj_ += '</object>';
1009	document.writeln( _obj_ );
1010}
1011
1012/*
1013Name : popupView
1014Parameter : 팝업명(타이틀아님), 팝업인덱스, 가로, 세로
1015Description : 관리자팝업관리에 미리보기팝업
1016*/
1017function popupView(item01, item02, item03, item04)
1018{
1019	win = window.open("/include/popup_view.asp?popup_num=" + item02+"&wid="+item03+"&hei="+item04,item01,"width=" + (item03+1) + ",height=" + (item04+1) + ",top=0,left=0,marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
1020	win.focus();
1021}
1022
1023/*
1024Name : fnPhotoDetail
1025Parameter : 이미지주소, 이미지설명
1026Description : 포토갤러리 상세보기에서 큰이미지 보기
1027*/
1028function fnPhotoDetail(item01, item02)
1029{
1030	document.getElementById("photoDetailBox").src = item01;
1031	document.getElementById("dev_photo_detail_box_txt").innerHTML = item02;
1032}
1033
1034/*
1035Name : fnPhotoDeatilOriginally
1036Parameter : 이미지주소, 팝업여부(0:레이어,1:팝업)
1037Description : 포토갤러리 상세보기에서 원본이미지 보기
1038*/
1039function fnPhotoDeatilOriginally(item01, item02)
1040{
1041	var imgWidth, imgHeight, tmpImg;
1042	tmpImg = new Image();
1043	tmpImg.src = item01.src;
1044	imgWidth = tmpImg.width;
1045	imgHeight = tmpImg.height;
1046
1047	if(item02 == "0"){
1048//		document.getElementById("dev_imgOriCont").style.top = "100px";
1049//		document.getElementById("dev_imgOriCont").style.left = "100px";
1050		document.getElementById("dev_imgOriCont").style.display = "block";
1051		document.getElementById("dev_imgOriCont").style.width = Number(tmpImg.width) + "px";
1052		document.getElementById("dev_imgOriContSrc").src = item01.src;
1053
1054		setCenter($("#dev_imgOriCont"));
1055	}
1056	else{
1057		win = window.open(item01, "PhotoOriginally", "width=" + imgWidth + ",height=" + imgHeight + ",top=0,left=0,marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
1058		win.focus();
1059	}
1060}
1061
1062/*
1063Name : fnPhotoDeatilOriginallyClose
1064Parameter :
1065Description : 포토갤러리 상세보기에서 원본이미지 보기
1066*/
1067function fnPhotoDeatilOriginallyClose(item)
1068{
1069	document.getElementById("dev_imgOriCont").style.display = "none";
1070}
1071
1072/*
1073Name : fnPhotoDeatilOriginallyClose
1074Parameter : id값, 게시판 인덱스값, 내용 글자수 제한
1075Description : 컨텐츠 텍스트 추출
1076*/
1077function fnContentText(item01, item02, item03)
1078{
1079	if (navigator.userAgent.indexOf("Firefox")>-1){
1080		var tmpStr = document.getElementById("cont" + item01).textContent;
1081	}
1082	else{
1083		var tmpStr = document.getElementById("cont" + item01).innerText;
1084	}
1085
1086	if(tmpStr.length > item03){
1087		tmpStr = tmpStr.substring(0,item03) + "...";
1088	}
1089	document.getElementById("cont" + item01).innerHTML = "<a href=javascript:goDetail('" + item02 + "','bd_num');>" + tmpStr  + "</a>";
1090}
1091
1092/******************************** 게시판 관련 끝 *******************************/
1093
1094/******************************** 회원 관련 시작 *******************************/
1095
1096//Email 직접입력?
1097function goEmailValue(item01, item02)
1098{
1099	var f_eval = document.getElementsByName(item02)[0];
1100	if(item01=="")
1101	{
1102		f_eval.value = "";
1103		f_eval.readOnly = false;
1104		f_eval.focus();
1105	}else
1106	{
1107		f_eval.value = item01;
1108		f_eval.readOnly = true;
1109	}
1110}
1111
1112//입력 Reset
1113function goFormRest()
1114{
1115	document.frmInfo.reset();
1116}
1117
1118
1119function goDown(type, org, save)
1120{
1121	location.href = "/download?type="+type+"&org="+org+"&save="+save;
1122}
1123
1124function goDownEtc(item01, item02)
1125{
1126	item01 = item01.replace(/&/g,"★")
1127	item02 = item02.replace(/&/g,"★")
1128	location.href=WEB_ROOT+"/include/download_etcpath.asp?file_name=" + item01 + "&file_full_name=" + item02;
1129}
1130
1131function goLink(item)
1132{
1133	if(item == ""){
1134		alert("설정된 링크가 없습니다.");
1135	}
1136	else{
1137		if (location.href.indexOf("/board/") > 0)
1138		{
1139			location.href = (location.href.indexOf("/mg/") > 0) ? "/mg/" + item : WEB_ROOT+item;
1140		}
1141		else{
1142			location.href = item;
1143		}
1144	}
1145}
1146
1147//컨설팅 가능분야 선택 팝업창 띄움
1148//conList : 이미 선택된 분야코드
1149function popConsultList(conList)
1150{
1151	window.popConsult = window.open("/include/popConsultList.asp?conList="+conList, "ConsultList", "width=800px, height=500px");
1152}
1153
1154/******************************** 회원 관련 끝 *********************************/
1155
1156
1157function dev_dayList_searchCheck(objStartName, objEndName, item01, item02){
1158	document.getElementsByName(objStartName)[0].value	= item01;
1159	document.getElementsByName(objEndName)[0].value		= item02;
1160}
1161
1162//체크박스 전체 선택/해제
1163var chkStatus = true;
1164function chkAll(objName, bCheck)
1165{
1166	if(typeof(bCheck)!="undefined")
1167		$(":checkbox[name="+objName+"]").prop("checked", bCheck);
1168	else
1169	{
1170		$(":checkbox[name="+objName+"]").prop("checked", chkStatus);
1171		chkStatus = !chkStatus;
1172	}
1173}
1174
1175var dir = -1;
1176var gap = 10;
1177function chDir(n)
1178{
1179	dir = n;
1180}
1181
1182function slideBanner()
1183{
1184	var $obj1 = $(".banner_ul").eq(0);
1185	var $obj2 = $(".banner_ul").eq(1);
1186	var $obj3 = $(".banner_ul").eq(2);
1187	
1188	$obj1.css({"width" : $obj1.width(), "left" : parseInt($obj1.css("left")) + dir});
1189	$obj2.css("width", $obj2.width());	//"left", parseInt($obj2.css("left")) + dir);
1190	$obj3.css("width", $obj3.width());	//"left", parseInt($obj3.css("left")) + dir);
1191
1192	if(dir<0)
1193	{
1194		if(parseInt($obj2.css("left")) < 1)
1195			$obj1.css("left", 0);
1196	}else
1197	{
1198		if(parseInt($obj1.css("left")) > -1)
1199			$obj1.css("left", parseInt($obj1.width()) * (-1));
1200	}
1201
1202	$obj2.css("left", parseInt($obj1.css("left"))+$obj1.width());
1203	$obj3.css("left", parseInt($obj1.css("left"))+$obj1.width()+$obj2.width());
1204
1205	setTimeout("slideBanner()", gap);
1206}
1207
1208// obj객체를 화면 정 중앙에 위치
1209function setCenter(obj)
1210{
1211	var top = ($(window).height()/2)-($(obj).height()/2)-10;
1212	var left = ($(window).width()/2)-($(obj).width()/2);
1213
1214	var adjTop = $(document).scrollTop();
1215	var adjLeft = $(document).scrollLeft();
1216	
1217	top += adjTop;
1218	left += adjLeft;
1219
1220	if(top<0)
1221		top = 0;
1222	if(left<0)
1223		left = 0;
1224	$(obj).css({"top":top+10, "left":left});
1225}
1226
1227
1228var g_chkPasswordIdx;
1229var g_chkPasswordAct;
1230function viewPasswordForm(idx, act)
1231{
1232	$(".pass_pop").show().animate({
1233		"margin-top" : (parseInt(document.body.clientHeight)/2)-125
1234	}, 500, function(){
1235		$("[name=pwdObj]").focus();
1236	});
1237	
1238	$('.gray_bg').fadeTo("slow",0.8).css({
1239		"width" : $("body").width()+20,
1240		"height" : $("body").height()
1241	});
1242
1243	g_chkPasswordIdx = idx;	
1244	g_chkPasswordAct = act;
1245}
1246
1247function hidePasswordForm()
1248{
1249	$(".pass_pop").animate({"margin-top" : "-250px"}, 500);
1250	$('.gray_bg').animate({"opacity": 0}, "slow", function(){
1251		$(this).hide();
1252	});
1253}
1254
1255function chkPassword()
1256{
1257	if($.trim($("[name=pwdObj]").val())=="")
1258	{
1259		alert("비밀번호를 입력하세요.");
1260	}else
1261	{
1262		$.post("/include/chkPassword.asp", {
1263			"idx"	: g_chkPasswordIdx,
1264			"pass"	: $("[name=pwdObj]").val()
1265		}, function(data)
1266		{
1267			if(data+"" == "1")
1268			{
1269				if(g_chkPasswordAct == "view")
1270					goDetail(g_chkPasswordIdx, "bd_num");
1271				else if(g_chkPasswordAct == "modi")
1272					goForm(g_chkPasswordIdx, "bd_num");
1273				else
1274					goDelete();
1275			}else
1276				alert("비밀번호가 틀렸습니다.");
1277		});
1278	}
1279}
1280
1281//홈엑션 관련변수들 변경되지 않는값
1282var dev_list_name	= "board_list.asp";
1283var dev_detail_name	= "board_detail.asp";
1284var dev_form_name	= "board_form.asp";
1285var dev_proc_name	= "board_proc.asp";
1286var dev_excel_name	= "board_excel.asp";
1287var dev_pop_name	= "board_pop.asp";
1288
1289//이미지 리사이트함수
1290function imgResize(img){ 
1291  img1= new Image();
1292  img1.src=(img); 
1293  imgControll(img); 
1294} 
1295
1296//이미지 컨트롤 함수
1297function imgControll(img){ 
1298  if((img1.width!=0)&&(img1.height!=0)){ 
1299    viewImage(img); 
1300  } 
1301  else{ 
1302    controller="imgControll('"+img+"')"; 
1303    intervalID=setTimeout(controller,20); 
1304  } 
1305} 
1306
1307//이미지 보기 함수
1308function viewImage(img){ 
1309        W=img1.width; 
1310        H=img1.height;
1311		if (W>800){
1312			H *= (800/W);
1313			W = 800;
1314		}
1315		if (H>800){
1316			W *= (800/H);
1317			H = 800;
1318		}
1319        O="left=100,top=150, width="+W+",height="+H; 
1320        imgWin=window.open("","",O); 
1321        imgWin.document.write("<html><head><title>이미지 확대보기</title></head>");
1322        imgWin.document.write("<body topmargin=0 leftmargin=0>");
1323        imgWin.document.write("<img src="+img+" width="+W+" height="+H+" onclick='self.close()'>");
1324        imgWin.document.close();
1325}
1326
1327function addDbg()
1328{
1329	$(document.body).html("<div id='dbg' style='position:absolute; left:0px; top:0px; width:100px; height:30px; border:1px solid #000000;'></div>"+$(document.body).html());
1330}
1331
1332$(document).ready(function(){
1333	$("caption").hide();
1334});
1335
1336/* $obj를 순서대로 fadeIn 시켜줌 */
1337function fadeObject($obj)
1338{
1339	var cntVisible = 0;	//$obj.find(":visible").length;
1340
1341	$obj.each(function(){
1342		if($(this).is(":visible"))
1343			cntVisible++;
1344	});
1345
1346	if(cntVisible < $obj.length)
1347	{
1348		$obj.eq(cntVisible).fadeIn(1000, function(){ fadeObject($obj); });
1349	}
1350
1351}
1352
1353/* $obj를 initLeft, initTop 위치로 설정 후 term밀리초 후 destLeft, destTop 위치로 speed 속도로 animate시킴*/
1354/* animate 후 func 실행 */
1355function moveImg($obj, initLeft, initTop, term, destLeft, destTop, speed, func)
1356{
1357	$obj.css({"left" : initLeft, "top" : initTop, "display" : "block"});
1358
1359	setTimeout(function(){
1360		$obj.animate({"left" : destLeft, "top" : destTop}, speed, function(){
1361			func;
1362		});
1363	}, term);
1364
1365}
1366
1367
1368function adjWidth($obj)
1369{
1370	var result = 0;
1371	if(!isNaN(parseInt($obj.css("margin-left"))))
1372		result += parseInt($obj.css("margin-left"));
1373	if(!isNaN(parseInt($obj.css("margin-right"))))
1374		result += parseInt($obj.css("margin-right"));
1375	if(!isNaN(parseInt($obj.css("padding-left"))))
1376		result += parseInt($obj.css("padding-left"));
1377	if(!isNaN(parseInt($obj.css("padding-right"))))
1378		result += parseInt($obj.css("padding-right"));
1379	return result;
1380}
1381
1382/*********************
1383idOut		: 가장 바깥쪽 레이어 ID (string)
1384viewWidth	: 보이는 영역 가로 사이즈 (number)
1385viewHeight	: 보이는 영역 세로 사이즈 (number)
1386speed		: 이동 속도 (number : ms)
1387bAuto		: 자동 롤링 여부 (bool)
1388term		: 멈춰있는 시간 (number : ms)
1389dir			: 방향(1, -1)
1390countPerPage: 페이지당 보여질 갯수 (number)
1391moveUnit	: 한번에 이동할 갯수 (number)
1392func		: 슬라이딩이 종료된 후 호출될 함수
1393********************/
1394function SlidingObject(idOut, viewWidth, viewHeight, speed, bAuto, term, dir, countPerPage, moveUnit, func)
1395{
1396	var $objOut = $("#"+idOut);
1397	var $obj = $("#"+idOut+">div:eq(0)");
1398	var $objSub = $("#"+idOut+">div:eq(0)>div");
1399	var width = 0;
1400	var gTick;
1401	var curPosition = 0;
1402	var pageWidth = 0;
1403	var count = 0;
1404	var direction;
1405	var moveCount = 0;
1406	var pageCount = 0;
1407
1408	if(isNaN(parseInt(dir)))
1409		direction = 1;
1410	else
1411		direction = dir;
1412
1413	$objSub.each(function(){
1414		count++;
1415		width += viewWidth;
1416		width += adjWidth($(this));
1417		if(pageWidth==0)
1418			pageWidth = width;
1419	});
1420	
1421
1422	if(isNaN(parseInt(countPerPage)))
1423		countPerPage = 1;
1424
1425	if( (count % countPerPage) > 0)
1426		pageCount = parseInt(count / countPerPage)+1;
1427	else
1428		pageCount = parseInt(count / countPerPage);
1429
1430	if(isNaN(parseInt(moveUnit)) && moveUnit == "P")
1431		moveUnit = countPerPage;
1432	else if(isNaN(parseInt(moveUnit)) && moveUnit != "P")
1433		moveUnit = 1;
1434
1435	$objOut.css({
1436		"width"		: viewWidth*countPerPage,
1437		"height"	: viewHeight,
1438		"overflow"	: "hidden",
1439		"position"	: "relative"
1440	});
1441
1442	$objSub.css({
1443		"float" : "left",
1444		"width"	: viewWidth,
1445		"height": viewHeight
1446	});
1447
1448	$obj.css({
1449		"width"		: width,
1450		"height"	: viewHeight,
1451		"overflow-x": "hidden",
1452		"position"	: "relative"
1453	});
1454
1455	var gObj = this;
1456	this.moveSliding = function()
1457	{
1458		if(gTick)
1459			clearTimeout(gTick);
1460		$obj.stop();
1461
1462		if(curPosition>count-1)
1463			curPosition = 0;
1464		else if(curPosition<0)
1465			curPosition = count-1;
1466
1467		if(direction>0)
1468		{
1469
1470			$obj.animate({"left" : pageWidth*curPosition * (-1)}, speed, function(){
1471				if(typeof(func) == "function")
1472					func();
1473				if(bAuto)
1474				{
1475//					curPosition += moveUnit;
1476					gTick = setTimeout(function(){gObj.move1Step(1);}, term);
1477				}
1478			});
1479		}else
1480		{
1481			$obj.animate({"left" : pageWidth*curPosition}, speed, function(){
1482				if(typeof(func) == "function")
1483					func();
1484				if(bAuto)
1485				{
1486//					curPosition -= moveUnit;
1487					gTick = setTimeout(function(){gObj.move1Step(-1);}, term);
1488				}
1489			});
1490		}		
1491	}
1492
1493	this.move1Step = function(n)
1494	{
1495		if(curPosition+n>count-1)
1496			curPosition = 0;
1497		else if(curPosition+n<0)
1498			curPosition = count-1;
1499		else
1500			curPosition += n;
1501
1502		gObj.moveSliding();
1503	}
1504
1505	this.moveDirect = function(n)
1506	{
1507		curPosition = n;
1508		gObj.moveSliding();
1509	}
1510
1511	this.slidingPause = function()
1512	{
1513		clearTimeout(gTick);
1514	}
1515
1516	this.slidingResume = function()
1517	{
1518		clearTimeout(gTick);
1519		gTick = setTimeout(function(){gObj.move1Step(direction);}, term);
1520	}
1521
1522	if(bAuto)
1523		gTick = setTimeout(function(){gObj.move1Step(1);}, term);
1524		
1525	
1526	this.getCurPosition = function()
1527	{
1528		return curPosition;
1529	}
1530
1531	this.setCurPosition = function(cPosition)
1532	{
1533		curPosition = cPosition;
1534	}
1535}
1536
1537
1538//이미지를 원본 이미지 비율에 맞게 축소
1539//imgObj : 이미지 경로
1540//widLimit, heiLimit : 가로, 세로 사이즈 상한값
1541function fitImageSize(imgObj, widLimit, heiLimit, destObj)
1542{
1543
1544	if(typeof(imgObj)=="undefined" || imgObj==null || $(imgObj).attr("src")=="")
1545		return ;
1546
1547	if($("#tempImageObject").length<1)
1548		$(document.body).append("<img id='tempImageObject' style='display:none;' />");
1549	$("#tempImageObject").attr("src", $(imgObj).attr("src"));
1550
1551
1552	var wid = parseInt($("#tempImageObject").css("width"));
1553	var hei = parseInt($("#tempImageObject").css("height"));
1554	var ratio = 1.0;
1555
1556	if(wid > widLimit)
1557		ratio = widLimit / wid;
1558
1559	if(hei > heiLimit && ratio > (heiLimit / hei))
1560		ratio = heiLimit / hei;
1561
1562	wid *= ratio;
1563	hei *= ratio;
1564
1565	if(destObj==null || typeof(destObj)=="undefined")
1566	{
1567		$(imgObj)
1568			.css({"width" : wid, "height" : hei})
1569			.show();
1570	}else
1571	{
1572		$(destObj)
1573			.css({"width" : wid, "height" : hei})
1574			.show();
1575	}
1576}
1577
1578var oEditors = new Array();
1579
1580function setEditorJs(val, objId, w, h)
1581{
1582	document.write("<textarea name='"+objId+"' style='height:"+h+";width:"+w+";'>"+val+"</textarea>");
1583	setEditor(objId, w, h);
1584}
1585
1586function setEditor(objId, w, h)
1587{
1588	var $obj;
1589
1590	if(objId.indexOf("#")>-1 || objId.indexOf("[")>-1)
1591		$obj = $(objId);
1592	else
1593	{
1594		if($("#"+objId).length>0)
1595			$obj = $("#"+objId);
1596		else if($("[name="+objId+"]").length>0)
1597			$obj = $("[name="+objId+"]");
1598	}
1599
1600	if(typeof(w)=="undefined" || w=="")
1601	{
1602		if(typeof($obj.css("width"))=="undefined" || $obj.css("width")=="")
1603			w = "100%";
1604	}
1605	if(typeof(h)=="undefined" || h=="")
1606	{
1607		if(typeof($obj.css("height"))=="undefined" || $obj.css("height")=="")
1608			h = 300;
1609	}
1610	h = Number(h);
1611
1612	$obj.froalaEditor({
1613		key: 'yB5E5E4H3jC10D7A5A5B2A3F3E2A2A5B-16MFIZJNKLDXIREJI==',
1614		language: 'ko',
1615		width: w,
1616//		height: h,
1617		heightMin: h,
1618		heightMax: 1000,
1619		dragInline: false,
1620
1621		fontFamily: {
1622			'NanumGothic': '나눔고딕',
1623			'NanumBarunGothic': '나눔바른고딕',
1624			'NanumSquare': '나눔스퀘어',
1625			'Malgun Gothic': '맑은고딕',
1626			'굴림': '굴림',
1627			'돋움': '돋움',
1628			'명조': '명조',
1629			'궁서': '궁서'
1630		},
1631		fontFamilySelection: true,
1632
1633		fontSizeSelection: true,
1634
1635		linkAlwaysBlank : true,
1636//		enter: $.FroalaEditor.ENTER_BR,
1637		lineHeights: {
1638			"150%": "150%",
1639			"160%": "160%",
1640			"170%": "170%",
1641			"180%": "180%",
1642			"190%": "190%",
1643			"200%": "200%",
1644			"210%": "210%"
1645		},
1646
1647
1648
1649//		toolbarInline: true,
1650//		toolbarVisibleWithoutSelection: true,
1651		zIndex: 100,
1652
1653		//이미지 업로드 옵션
1654		imageDefaultWidth: 0,
1655		imageUploadURL: "/common/fileUploadProc",
1656		imageUploadParam: 'image_param',
1657		imageUploadParams: {'filetype': 'img'},
1658		imageUploadMethod: 'POST',
1659		imageMaxSize: 5 * 1024 * 1024,
1660		imageAllowedTypes: ['jpeg', 'jpg', 'png', 'gif', 'bmp'],
1661
1662		//첨부파일 업로드 옵션
1663		fileUploadURL: "/common/fileUploadProc",
1664		fileUploadParam: 'file_param',
1665		fileUploadParams: {'filetype': 'file'},
1666		fileUploadMethod: 'POST',
1667		fileMaxSize: 10 * 1024 * 1024,
1668		fileAllowedTypes: ['application/x-zip-compressed', 'application/xls', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/unknown', 'image/jpeg', 'image/png', 'image/gif', 'image/bmp']
1669
1670	})
1671	.on('froalaEditor.file.uploaded', function (e, editor, response) {
1672		// File was uploaded to the server.
1673	})
1674	.on('froalaEditor.file.inserted', function (e, editor, $file, response) {
1675		eval("var res = "+response+";");
1676		console.log(res);
1677		$file.attr("href", "/download?type=pl&org="+res.result.orgFileName+"&save="+res.result.saveFileName);
1678		// File was inserted in the editor.
1679	})
1680	.on('froalaEditor.file.error', function (e, editor, error, response) {
1681		console.log("file error");
1682		getErrCode(error.code);
1683	})
1684	.on('froalaEditor.image.inserted', function(e, editor, $img, response){
1685		console.log(e);
1686		console.log($img);
1687		console.log(response);
1688//		console.log($img.context.naturalWidth);
1689//		console.log(editor.context.clientidth);
1690
1691//		$img.css({
1692//			"width": $img.context.naturalWidth>1100? 1100 : $img.context.naturalWidth
1693//		});
1694		
1695		$img.attr("src", $img.attr("src").split(location.origin).join(""));
1696	})
1697	.on('froalaEditor.image.error', function (e, editor, error, response) {
1698		console.log(e);
1699		console.log(response);
1700		getErrCode(error.code);
1701	});
1702}
1703
1704
1705function getErrCode(n)
1706	{
1707	//https://www.froala.com/wysiwyg-editor/docs/events#image.error
1708	var bAlert = false;
1709
1710	switch(n)
1711	{
1712		case 1:
1713			console.log("Bad link");
1714			break;
1715
1716		case 2:
1717			console.log("No link in upload response");
1718			break;
1719
1720		case 3:
1721			console.log("Error during file upload");
1722			break;
1723
1724		case 4:
1725			console.log("Parsing response failed");
1726			break;
1727
1728		case 5:
1729			alert("파일이 너무 큽니다.")
1730			bAlert = true;
1731//			console.log("Image too text-large");
1732			break;
1733
1734		case 6:
1735			alert("업로드 가능한 파일 형식이 아닙니다.");
1736			bAlert = true;
1737//			console.log("Invalid image type");
1738			break;
1739
1740		case 7:
1741			console.log("File can be uploaded only to same domain in IE 8 and IE 9");
1742			break;
1743	}
1744
1745	if(!bAlert)
1746		alert("파일 업로드 중 오류가 발생하였습니다.");
1747}
1748
1749var whiteList = ["jpg", "bmp", "png", "gif"];
1750function chkIsImage(obj)
1751{
1752	var result = true;
1753	
1754	for(var j=0; j<$(obj).length && result; j++)
1755	{
1756		if($(obj).eq(j).val()!="")
1757		{
1758			var chk = false;
1759			var ext = $(obj).eq(j).val();
1760			ext = ext.substring(ext.lastIndexOf(".")+1, ext.length).toLowerCase();
1761
1762			for(var i=0; i<whiteList.length; i++)
1763			{
1764				if(ext == whiteList[i])
1765				{
1766					chk = true;
1767					break;
1768				}			
1769			}
1770
1771			if(!chk)
1772				result = chk;
1773		}
1774	}
1775
1776	if(!result)
1777		alert("업로드 불가능한 파일이 포함되어 있습니다.\n\n업로드 가능한 형식 : "+whiteList.join(", "));
1778
1779	return result;
1780}
1781
1782var last_scr_id = "";
1783function getCategory(scr_id)
1784{
1785	if(last_scr_id=="")
1786		last_scr_id = scr_id;
1787
1788	var result = "";
1789	scr_id = typeof(scr_id)=="undefined" ? "" : scr_id;
1790
1791	$.ajax({
1792		type : "POST",
1793		url  : "/include/getCategory.asp",
1794		async : false,
1795		dataType : "json",
1796		data:{
1797			"scr_id" : scr_id
1798		},
1799		error  : function(jqXHR, textStatus, errorThrown){
1800			console.log(jqXHR);
1801//			alert(jqXHR.responseText +"\n\n"+textStatus+"\n\n"+errorThrown);
1802		},
1803		success  : function(msg){
1804			var d = msg.data;
1805			var html = "";
1806//			console.log(msg);
1807
1808			for(var i=0; i<d.length; i++)
1809			{
1810				html += "<li><a href='"+d[i].scr_link+"' data='"+d[i].scr_id+"' scr_fid='"+msg.scr_fid+"'>"+d[i].scr_desc+"</a></li>";
1811			}
1812
1813			if(html!="")
1814			{
1815				result = "<div class='tmpDropdownClass1'>";
1816				result += "<span class='tmpDropdownClass2'></span>";
1817				result += "<input type='hidden' name='cd-dropdown'>";
1818				result += "<ul class='tmpDropdownClass3'>";
1819				result += html;
1820				result += "</ul></div>";
1821			}
1822
1823
1824			$(result).insertAfter(".lnb_home");
1825			if(msg.scr_fid!="" && msg.scr_fid!="0000000000")
1826				getCategory(msg.scr_fid);
1827			else
1828			{
1829				//서브메뉴 출력 후 클래스 변경
1830				$(".tmpDropdownClass1").each(function(idx){
1831					var depth = idx+1;
1832					$(this).addClass("dropdown_depth"+depth);
1833					$(this).find(".tmpDropdownClass2").addClass("select_label_depth"+depth);
1834					$(this).find(".tmpDropdownClass3").addClass("dropdown_list_depth"+depth);
1835				});
1836
1837				$(".tmpDropdownClass1").removeClass("tmpDropdownClass1");
1838				$(".tmpDropdownClass2").removeClass("tmpDropdownClass2");
1839				$(".tmpDropdownClass3").removeClass("tmpDropdownClass3");
1840
1841
1842				//서브메뉴 현재 위치 선택
1843				selectCategory()
1844
1845			}
1846
1847			return ;
1848
1849
1850			selectCategory($(".dropdown_list_depth"+className), scrID);
1851
1852			if(msg.scr_fid != "")
1853				selectCategory($(".dropdown_list_depth1"), msg.scr_fid);
1854
1855			if(scrID=="0000000104" && className=="2")
1856			{
1857				if($(".dropdown_depth3 a.on").length>0)
1858					$(".select_label_depth3").text($(".dropdown_depth3 a.on").text());
1859				else
1860					$(".select_label_depth3").text($(".dropdown_depth3 a:first").text());
1861			}
1862
1863		}
1864	});
1865
1866//	return result;
1867}
1868
1869function selectCategory()
1870{
1871	var scr_fid = "";
1872
1873	if($(".dropdown_depth3").length>0)
1874	{
1875		scr_fid = $(".dropdown_depth3").find("a:first").attr("scr_fid");
1876		$(".dropdown_depth3").find("a[data="+last_scr_id+"]").addClass("on");
1877		$(".select_label_depth3").text($(".dropdown_depth3").find(".on").text());
1878	}
1879	
1880	if($(".dropdown_depth2").length>0)
1881	{
1882		if(scr_fid != "")
1883			last_scr_id = scr_fid;
1884
1885		scr_fid = $(".dropdown_depth2").find("a:first").attr("scr_fid");
1886		$(".dropdown_depth2").find("a[data="+last_scr_id+"]").addClass("on");
1887		$(".select_label_depth2").text($(".dropdown_depth2").find(".on").text());
1888	}
1889
1890	if($(".dropdown_depth1").length>0)
1891	{
1892		if(scr_fid != "")
1893			last_scr_id = scr_fid;
1894
1895		scr_fid = $(".dropdown_depth1").find("a:first").attr("scr_fid");
1896		$(".dropdown_depth1").find("a[data="+last_scr_id+"]").addClass("on");
1897		$(".select_label_depth1").text($(".dropdown_depth1").find(".on").text());
1898	}
1899
1900}
1901
1902function isMobile()
1903{
1904	var m_userAgent_All = navigator.userAgent.toLowerCase();
1905	var m_userAgent = '';
1906	var m_mobile = new Array('iphone', 'ipod', 'ipad', 'android', 'blackberry', 'windows ce', 'nokia', 'webos', 'opera mini', 's
1906onyericsson', 'opera mobi', 'iemobile', 'mot');
1907	var m_mobileCheck = 0;
1908
1909
1910	for(var m_count=0; m_count<m_mobile.length; m_count++) {
1911		if(m_userAgent_All.indexOf(m_mobile[m_count]) != -1) {
1912			m_mobileCheck++;
1913			m_userAgent = m_mobile[m_count];
1914		}
1915	}
1916
1917
1918	var m_platform = navigator.platform.toLowerCase();
1919	var m_platform_filter = new Array('win16', 'win32', 'win64', 'mac', 'macintel');
1920
1921	for(var m_count=0; m_count<m_platform_filter.length; m_count++) {
1922		if(m_platform.indexOf(m_platform_filter[m_count]) != -1) {
1923			m_mobileCheck = 0;
1924		}
1925	}
1926
1927	return m_mobileCheck>0;
1928}
1929
1930function chkJongsung(txt)
1931{
1932	var cd = txt.charCodeAt(txt.length-1);
1933	var result = (cd-44032)%28;
1934
1935	//result > 0 : 받침 있음
1936	//result == 0 : 받침 없음
1937	//result < 0 : 한글 아님
1938
1939	return result;
1940}
1941
1942function findZip(zipId, addr1Id, addr2Id) {
1943	new kakao.Postcode({
1944		oncomplete: function(data) {
1945			// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
1946
1947			// 각 주소의 노출 규칙에 따라 주소를 조합한다.
1948			// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
1949			var fullAddr = ''; // 최종 주소 변수
1950			var extraAddr = ''; // 조합형 주소 변수
1951
1952			// 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
1953			if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
1954				fullAddr = data.roadAddress;
1955
1956			} else { // 사용자가 지번 주소를 선택했을 경우(J)
1957				fullAddr = data.jibunAddress;
1958			}
1959
1960			// 사용자가 선택한 주소가 도로명 타입일때 조합한다.
1961			if(data.userSelectedType === 'R'){
1962				//법정동명이 있을 경우 추가한다.
1963				if(data.bname !== ''){
1964					extraAddr += data.bname;
1965				}
1966				// 건물명이 있을 경우 추가한다.
1967				if(data.buildingName !== ''){
1968					extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
1969				}
1970				// 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다.
1971				fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
1972			}
1973
1974			// 우편번호와 주소 정보를 해당 필드에 넣는다.
1975			document.getElementById(zipId).value = data.zonecode; //5자리 새우편번호 사용
1976			document.getElementById(addr1Id).value = fullAddr;
1977
1978			// 커서를 상세주소 필드로 이동한다.
1979			document.getElementById(addr2Id).focus();
1980		}
1981	}).open();
1982}
1983
1984function addComment(idx)
1985{
1986	var f = document.frmInfo;
1987	var orgEncoding = "";
1988	var bd_com_content = "";
1989
1990	if(f.bd_com_id.value=="")
1991	{
1992		alert("로그인 후에 등록 가능합니다.");
1993		return ;
1994	}
1995
1996	if(typeof(idx)=="undefined" || idx==null || idx=="")
1997	{
1998//		f.act.value = "comment_add";
1999		bd_com_content = f.bd_com_content;
2000	}else
2001	{
2002//		f.act.value = "comment_reply_add";
2003		f.comment_idx.value = idx;
2004		bd_com_content = f["bd_com_content_"+idx];
2005	}
2006
2007	if(bd_com_content.value=="")
2008	{
2009		alert("댓글 내용을 입력해 주세요.");
2010		bd_com_content.focus();
2011		return ;
2012	}
2013
2014
2015	f.action = "board_proc.asp";
2016	orgEncoding = f.encoding;
2017	f.encoding = "multipart/form-data";
2018
2019	f.submit();
2020
2021	f.encoding = orgEncoding;
2022}
2023
2024function delComment(idx)
2025{
2026	var f = document.frmInfo;
2027	var orgEncoding = "";
2028
2029	if(typeof(idx)=="undefined" || idx==null || idx=="")
2030	{
2031		alert("삭제하실 댓글이 선택되지 않았습니다.");
2032		return ;
2033	}
2034	if(!confirm("댓글을 삭제 하시겠습니까?"))
2035		return ;
2036
2037	f.comment_idx.value = idx;
2038//	f.act.value = "comment_del";
2039	f.action = "board_proc.asp";
2040	orgEncoding = f.encoding;
2041	f.encoding = "multipart/form-data";
2042
2043	f.submit();
2044
2045	f.encoding = orgEncoding;
2046}
2047
2048function viewCommentReply(idx)
2049{
2050	if(!$("#bd_com_reply_"+idx).parent().is(":visible"))
2051		$("#bd_com_reply_"+idx).parent().show();
2052	if(!$("#bd_com_reply_"+idx).is(":visible"))
2053		$("#bd_com_reply_"+idx).show();
2054	$("[name=bd_com_content_"+idx+"]").focus();
2055
2056}
2057
2058function viewCommentEdit(idx)
2059{
2060	$("#p_bd_com_content_"+idx).hide();
2061	$("#p_bd_com_content_edit_"+idx).show();
2062	$("[name=bd_com_content_edit_"+idx+"]").focus();
2063}
2064
2065function editComment(idx)
2066{
2067	var f = document.frmInfo;
2068	var orgEncoding = "";
2069	var bd_com_content = f["bd_com_content_edit_"+idx];
2070
2071	if(f.bd_com_id.value=="")
2072	{
2073		alert("로그인 후에 등록 가능합니다.");
2074		return ;
2075	}
2076
2077	if(bd_com_content.value=="")
2078	{
2079		alert("댓글 내용을 입력해 주세요.");
2080		bd_com_content.focus();
2081		return ;
2082	}
2083
2084	f.comment_idx.value = idx;
2085//	f.act.value = "comment_edit";
2086	f.action = "board_proc.asp";
2087	orgEncoding = f.encoding;
2088	f.encoding = "multipart/form-data";
2089
2090	f.submit();
2091
2092	f.encoding = orgEncoding;
2093}
2094
2095
2096function copyLink(obj)
2097{
2098	var tmpObj = $("<input>");
2099	$(document.body).append(tmpObj);
2100	$(tmpObj).val($(obj).attr("data")).select();
2101	document.execCommand("copy");
2102	$(tmpObj).remove();
2103
2104	alert("게시물의 URL을 클립보드에 복사 하였습니다.");
2105}
2106
2107function goMemLink(n, memType)
2108{
2109	switch (n)
2110	{
2111		case 1 :	//로그인
2112			location.href = WEB_ROOT+"/mem/login.asp?scrID=0000000178";
2113			break;	
2114		case 2 :	//id/pwd찾기
2115			location.href = WEB_ROOT+"/mem/login_id_find.asp?scrID=0000000179";
2116			break;	
2117		case 3 :	//회원가입
2118			location.href = WEB_ROOT+"/mem/join_type01/mem_join.asp?scrID=0000000180";
2119			break;	
2120		case 4 :	//마이페이지
2121			location.href = WEB_ROOT+"/mem/join_type01/mem_form.asp?scrID=0000000186";
2122			break;	
2123		case 5 :	//SNS회원가입
2124			location.href = WEB_ROOT+"/mem/join_type01/mem_join.asp?scrID=0000000180&u_sns_type="+memType;
2125			break;	
2126	}
2127}
2128
2129function addFavorite(obj, e)
2130{
2131        var bookmarkURL = window.location.href;
2132        var bookmarkTitle = document.title;
2133
2134
2135        if (window.sidebar && window.sidebar.addPanel) {
2136            // Firefox version < 23
2137            window.sidebar.addPanel(bookmarkTitle, bookmarkURL, '');
2138        } else if ((window.sidebar && (navigator.userAgent.toLowerCase().indexOf('firefox') > -1)) || (window.opera && window.print)) {
2139            // Firefox version >= 23 and Opera Hotlist
2140            var $this = $(obj);
2141            $this.attr('href', bookmarkURL);
2142            $this.attr('title', bookmarkTitle);
2143            $this.attr('rel', 'sidebar');
2144            $this.off(e);
2145        } else if (window.external && ('AddFavorite' in window.external)) {
2146            // IE Favorite
2147            window.external.AddFavorite(bookmarkURL, bookmarkTitle);
2148        } else {
2149            // WebKit - Safari/Chrome
2150            alert((navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Cmd' : 'Ctrl') + '+D 키를 눌러 즐겨찾기에 등록하실 수 있습니다.');
2151        }
2152
2153}
2154
2155function cvtCurrent(obj)
2156{
2157	var result = val;
2158
2159	if(val!="" && !isNaN(parseInt(val)))
2160	{
2161		result = parseInt(val);
2162		result = result.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2163	}
2164
2165	return result;
2166
2167}
2168
2169function setComma(x) {
2170  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2171}
2172
2173
2174function isValidFormat(input,format) {
2175	if ($.trim($(input).val()).search(format) != -1) {
2176		return true; //올바른 포맷 형식
2177	}
2178	return false;
2179}
2180
2181/**
2182 * 입력값이 이메일 형식인지 체크
2183 * ex) if (!isValidEmail(form.email)) {
2184 *         alert("올바른 이메일 주소가 아닙니다.");
2185 *     }
2186 */
2187function isValidEmail(input) {
2188//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
2189	var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
2190	return isValidFormat(input,format);
2191}
2192
2193function isValidId(input){
2194	var format = /^[A-za-z0-9-_]{5,15}/g
2195	return isValidFormat(input,format);
2196}
2197
2198function isValidDate(input){
2199	var format = /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/;
2200	return isValidFormat(input, format);
2201}
2202
2203function setFilename(obj, dest)
2204{
2205	var filename = $(obj).val().substring($(obj).val().lastIndexOf("\\")+1, $(obj).val().length);
2206	$("#"+dest).val(filename);
2207}
2208
2209function setMemo(opt)
2210{
2211	var style = isnull(opt.style, "");
2212	var bgColor = isnull(opt.bgColor, "#d9e60c");
2213	var bdStyle = isnull(opt.bdStyle, "solid 1px #000");
2214	var left = isnull(opt.left, 0);
2215	var top = isnull(opt.top, 0);
2216	var width = isnull(opt.width, "");
2217	var height = isnull(opt.height, "");
2218	var padding = isnull(opt.padding, "");
2219	var margin = isnull(opt.margin, "");
2220
2221	var html = "<div style='";
2222	if(style!="")
2223	{
2224		html += style;
2225	}else
2226	{
2227		html += "position:absolute; z-index:99999999;";
2228		html += "background-color:"+bgColor+";";
2229		html += "border:"+bdStyle+";";
2230		html += "left:"+left+";";
2231		html += "top:"+top+";";
2232		html += "width:"+width+";";
2233		html += "height:"+height+";";
2234		html += "padding:"+padding+";";
2235		html += "margin:"+margin+";";
2236	}
2237	html += "'>"+isnull(opt.html, "")+"</div>";
2238
2239	$("body").append(html);
2240}
2241
2242function isnull(oldObj, newObj)
2243{
2244	return typeof(oldObj)=="undefined" || oldObj==null ? newObj : oldObj;
2245}
2246
2247
2248function dateDiff(gubun, _date1, _date2) {
2249    var diffDate_1 = _date1 instanceof Date ? _date1 :new Date(_date1);
2250    var diffDate_2 = _date2 instanceof Date ? _date2 :new Date(_date2);
2251
2252//	diffDate_1 =new Date(diffDate_1.getFullYear(), diffDate_1.getMonth(), diffDate_1.getDate());
2253//	diffDate_2 =new Date(diffDate_2.getFullYear(), diffDate_2.getMonth(), diffDate_2.getDate());
2254 
2255    var diff = Math.abs(diffDate_2.getTime() - diffDate_1.getTime());
2256
2257	gubun = typeof(gubun)=="undefined" || gubun=="" ? "D" : gubun.toUpperCase();
2258
2259	switch(gubun)
2260	{
2261		case "H" :
2262			diff /= 1000*3600;
2263			break;
2264
2265		case "M" :
2266			diff /= 1000*60;
2267			break;
2268		
2269		case "S" :
2270			diff /= 1000;
2271			break;
2272		
2273		default :
2274			diff /= 1000*3600*24;
2275			break;
2276
2277	}
2278    diff = Math.ceil(diff);
2279 
2280    return diff;
2281}
2282 
2283function cvtTime(sec)
2284{
2285	var result="", s="", m="", h="";
2286
2287	if(sec>=60)
2288	{
2289		s = sec % 60;
2290		m = Math.floor(sec/60);
2291
2292		if(m>=60)
2293		{
2294			h = Math.floor(m/60);
2295			m = m % 60;
2296		}
2297	}else
2298		s = sec;
2299
2300	if(h!="")
2301		result = h+"시간 ";
2302	if(m!="")
2303		result += m+"분 ";
2304	if(s!="")
2305		result += s+"초";
2306
2307	return result;
2308}
2309
2310function clickCategory(s_cat)
2311{
2312	var f = document.frmInfo;
2313
2314	if($(f.sCate01).length<1)
2315		$(f).append("<input type='hidden' name='sCate01' />");
2316
2317	f.sCate01.value = s_cat;
2318
2319	goSearch();
2320}
2321
2322function getWeekdayName(wd)
2323{
2324	switch(wd)
2325	{
2326		case 0:
2327			return "일";
2328		case 1:
2329			return "월";
2330		case 2:
2331			return "화";
2332		case 3:
2333			return "수";
2334		case 4:
2335			return "목";
2336		case 5:
2337			return "금";
2338		case 6:
2339			return "토";
2340	}
2341}
2342
2343
2344(function ($) {
2345
2346    window.addRule = function (selector, styles, sheet) {
2347
2348        if (typeof styles !== "string") {
2349            var clone = "";
2350            for (var style in styles) {
2351                var val = styles[style];
2352
2353                style = style.replace(/([A-Z])/g, "-$1").toLowerCase(); // convert to dash-case
2354                clone += style + ":" + (style === "content" ? '"' + val + '"' : val) + "; ";
2355            }
2356            styles = clone;
2357        }
2358
2359        sheet = sheet || document.styleSheets[0];
2360
2361        if (sheet.insertRule) sheet.insertRule(selector + " {" + styles + "}", sheet.cssRules.length);
2362        else if (sheet.addRule) sheet.addRule(selector, styles);
2363
2364        return this;
2365
2366    };
2367
2368    if ($) {
2369        $.fn.addRule = function (styles, sheet) {
2370            addRule(this.selector, styles, sheet);
2371            return this;
2372        };
2373    }
2374
2375}(window.jQuery));
2376
2377
2378function ajaxBoardMore()
2379{
2380	var f = document.frmInfo;
2381
2382	var scrID = $(f.scrID).val();
2383	var page = parseInt($(f.page).val())+1;
2384	var s_string = isnull($(f.s_string).val(), "");
2385	var s_cat = isnull($(f.s_cat).val(), "");
2386	
2387	$(f.page).val(page);
2388
2389	$.ajax({
2390		type : "POST",
2391		url  : "/include/ajaxBoardMore.asp",
2392		async : false,
2393		dataType : "json",
2394		data:{
2395			"scrID" : scrID
2396			,"page" : page
2397			,"s_string" : s_string
2398			,"s_cat" : s_cat
2399		},
2400		error  : function(jqXHR, textStatus, errorThrown){
2401			console.log(jqXHR);
2402//			alert(jqXHR.responseText +"\n\n"+textStatus+"\n\n"+errorThrown);
2403		},
2404		success  : function(msg){
2405			var totalPage = msg.totalPage;
2406			var imgCount = msg.imgCount;
2407			
2408			if(totalPage<=page)
2409				$(".page_nv_type04").remove();
2410
2411			var data = msg.data;
2412			var html = "";
2413			for(var i=0; i<data.length; i++)
2414			{
2415				html += '<div class="board_gallery_img_type05_item">';
2416				html += '<div onclick="goDetail(\''+data[i].bd_num+'\',\'bd_num\')">';
2417				html += data[i].thumb;
2418				html += '<div class="txt">';
2419				html += '<p>'+data[i].bd_title+'</p>';
2420				html += '<span>'+data[i].bd_date+'</span>';
2421				html += '</div>';
2422				html += '</div>';
2423				html += '</div>';
2424			}
2425
2426			var imgLoad = 0;
2427			if($(html).find("img").length>0)
2428			{
2429				$(html).find("img").load(function(){
2430					imgLoad++;
2431					if(imgLoad>=imgCount)
2432						SetGridItemHeight();
2433				});
2434			}else
2435			{
2436				SetGridItemHeight();
2437			}
2438
2439			$(".dev_list_more").append(html);
2440
2441		}
2442	});
2443
2444}
2445
2446function adjImage(wrapObj, imgObj, maxWidth)
2447{
2448	if(typeof(maxWidth)!="undefined" && maxWidth!="")
2449		$(imgObj).css("max-width", maxWidth);
2450	else
2451		$(imgObj).css("max-width", "95%");
2452
2453	var wrapWidth = $(wrapObj).width();
2454
2455	$(imgObj).each(function(){
2456		if($(this)[0].width > wrapWidth)
2457			$(this).css("width", "95%");
2458	});
2459}
2460
2461var whiteList = ["jpg", "png", "gif", "bmp", "xls", "xlsx", "ppt", "pptx", "pdf", "zip"];
2462function checkFile(obj)
2463{
2464	var result = true;
2465	var dispSize = 10;
2466	var maxSize = dispSize * 1024*1024;
2467
2468	
2469	for(var j=0; j<$(obj).length && result; j++)
2470	{
2471		if($(obj).eq(j).val()!="")
2472		{
2473			var chk = false;
2474			var ext = $(obj).eq(j).val();
2475			ext = ext.substring(ext.lastIndexOf(".")+1, ext.length).toLowerCase();
2476
2477			for(var i=0; i<whiteList.length; i++)
2478			{
2479				if(ext == whiteList[i])
2480				{
2481					chk = true;
2482					break;
2483				}			
2484			}
2485
2486			if(!chk)
2487				result = chk;
2488		}
2489	}
2490
2491	if(!result)
2492		alert("업로드 불가능한 파일이 포함되어 있습니다.\n\n업로드 가능한 형식 : "+whiteList.join(", "));
2493	else
2494	{
2495
2496		var browser=navigator.appName;
2497		var fileSize = 0;
2498		
2499		// 익스플로러일 경우
2500		if (browser=="Microsoft Internet Explorer")
2501		{
2502			var oas = new ActiveXObject("Scripting.FileSystemObject");
2503			fileSize = oas.getFile( obj.value ).size;
2504		}
2505		// 익스플로러가 아닐경우
2506		else
2507		{
2508			fileSize = obj.files[0].size;
2509		}
2510
2511		if(maxSize<fileSize)
2512		{
2513			result = false;
2514			alert("첨부파일은 "+dispSize+"MB까지 등록 가능합니다.");
2515		}
2516	}
2517
2518	return result;
2519}
2520
2521function blockKor(obj)
2522{
2523	obj.value = obj.value.replace(/[\ㄱ-ㅎㅏ-ㅣ가-힣]/g, "");
2524}
2525function onlyNum(obj)
2526{
2527	obj.value = obj.value.replace(/[^0-9-.]/g, "");
2528}
2529
2530
2531function checkFileSize(obj)
2532{
2533	if(typeof(obj)=="undefined")
2534		return true;
2535
2536	var result = true;
2537	var dispSize = 30;
2538	var maxSize = dispSize * 1024*1024;
2539
2540	var browser=navigator.appName;
2541	var fileSize = 0;
2542
2543	for(var i=0; i<obj.length; i++)
2544	{
2545		if(obj[i].value!="")
2546		{
2547			// 익스플로러일 경우
2548			if (browser=="Microsoft Internet Explorer")
2549			{
2550				var oas = new ActiveXObject("Scripting.FileSystemObject");
2551				fileSize += oas.getFile( obj[i].value ).size;
2552			}
2553			// 익스플로러가 아닐경우
2554			else
2555			{
2556				fileSize += obj[i].files[0].size;
2557			}
2558		}
2559	}
2560	if(maxSize<fileSize)
2561	{
2562		result = false;
2563		alert("모든 첨부파일 용량의 합이 "+dispSize+"MB를 초과 합니다.");
2564	}
2565
2566	return result;
2567}
2568
2569function RefreshImage(valImageId) {
2570	var objImage = document.getElementById(valImageId)
2571	if (objImage == undefined) {
2572		return;
2573	}
2574	var now = new Date();
2575	objImage.src = objImage.src.split('?')[0] + '?x=' + now.getTime();
2576}
2577function checkAll(thisObj, strName)
2578{
2579	$("[name="+strName+"]").prop("checked", $(thisObj).prop("checked"));
2580}
2581
2582function makeArg()
2583{	
2584	var arg = "";
2585	var f = arguments[0];
2586	
2587	var s = arguments.length>2 ? arguments[1] : 0;
2588	var e = arguments.length>2 ? arguments[2] : arguments[1];
2589	
2590	for(var i=s; i<e; i++)
2591	{
2592		if($(f[i]).val()!="")
2593		{
2594			if(arg!="")
2595				arg += "&";
2596
2597			arg += $(f[i]).attr("name")+"="+$(f[i]).val();
2598		}
2599	}
2600	
2601	return arg;
2602}
2603
2604function limitLength(obj, limit)
2605{
2606	$(obj).keydown(function(){
2607		checkMaxLength(event, this, limit);
2608	});
2609	
2610	$(obj).blur(function(){
2611		checkMaxLength(event, this, limit);
2612	});
2613}
2614
2615function setCookie( name, value, expiredays )
2616{
2617	var today = new Date();
2618	//24시간
2619	today.setTime(today.getTime() + 1000*60*60*24);
2620	
2621	//var today = new Date();
2622	//today.setDate( today.getDate() + expiredays );
2623	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
2624}
2625
2626function linkDatepicker(obj1, obj2)
2627{
2628	$(obj1).on("change", function(){
2629		$(obj2).datepicker("option", "minDate", $(obj1).val());
2630	});
2631
2632	$(obj2).on("change", function(){
2633		$(obj1).datepicker("option", "maxDate", $(obj2).val());
2634	});
2635}
2636
2637
2638
2639
2640
2641//////////////일정 관련
2642
2643var schDatas;
2644var schBdId = "";
2645//등록된 스케줄 조회
2646function getScheduleList(sDate1)
2647{
2648	var sDate2;
2649	
2650	if(isnull(sDate1, "")=="")
2651	{
2652		sDate1 = new Date();
2653		sDate1 = sDate1.getFullYear() +"-"+ String(sDate1.getMonth()+1).padStart(2, "0") +"-01";
2654	}
2655
2656	sDate2 = new Date(new Date(sDate1).getFullYear(), new Date(sDate1).getMonth()+1, 0);
2657	sDate2 = sDate2.getFullYear() +"-"+ String(sDate2.getMonth()+1).padStart(2, "0") +"-"+ String(sDate2.getDate()).padStart(2, "0");
2658	
2659	
2660	$.ajax({
2661		type : "POST",
2662		url  : "/board/schedule_list",
2663		async : false,
2664		dataType : "json",
2665		data:{
2666			"sDate1" : sDate1,
2667			"sDate2" : sDate2,
2668			"bd_id" : schBdId			
2669		},
2670		error  : function(jqXHR, textStatus, errorThrown){
2671			console.log(jqXHR);
2672//			alert(jqXHR.responseText +"\n\n"+textStatus+"\n\n"+errorThrown);
2673		},
2674		success  : function(msg){
2675			if(msg.resultCode=="1000")
2676			{
2677				schDatas = msg.data;
2678			}else
2679			{
2680				alert(msg.resultCode +" : "+msg.resultMsg);
2681			}
2682		}
2683	});
2684	
2685}
2686
2687function getCalendar(pType, destObj, thisYear, thisMonth)
2688{
2689	var today = new Date();
2690	
2691	thisYear = isnull(thisYear, today.getFullYear());
2692	thisMonth = isnull(thisMonth, today.getMonth()+1);
2693
2694	today = today.getFullYear() +"-"+ String(today.getMonth()+1).padStart(2, "0") +"-"+ String(today.getDate()).padStart(2, "0");
2695	
2696	var sWd = new Date(thisYear, thisMonth-1, 1).getDay();
2697	var eDate = new Date(thisYear, thisMonth, 0);
2698	
2699	eDate = eDate.getDate();
2700
2701	var html = "";
2702	var schDestObj = pType=="main" ? ".schedule-list" : ".board-list-1";
2703	
2704
2705	
2706	for(var i=1; i<=eDate+sWd; i++)
2707	{
2708		var date = i-sWd;
2709
2710		if((i-1)%7==0)
2711			html += "<tr>\n";
2712
2713
2714		if(date>0)
2715		{
2716			thisDate = thisYear +"-"+ String(thisMonth).padStart(2, "0") +"-"+ String(date).padStart(2, "0");
2717			
2718					
2719			html += "	<td onclick='getCurDateSchedule(\""+ pType +"\", \""+thisDate+"\", \""+schDestObj+"\")' class='cal_td' data-date='"+date+"'>\n";
2720			
2721			if(pType=="main" || pType=="subMain")
2722			{
2723				html += "		<div class='";
2724				if(thisDate==today)
2725					html += "today ";
2726				if(hasSchedule(thisDate, schDatas))	//일정이 있을 때
2727					html += "plan ";
2728				html += "'>"+date+"</div>\n";
2729			}else if(pType=="sub")
2730			{
2731				html += "		<div class='";
2732				if(thisDate==today)
2733					html += "today ";
2734				html += "'><span class='date'>"+date+"</span>";
2735				html += getSchedule(thisDate, schDatas);		//일정 목록 html
2736				html += "		</div>\n";
2737			}
2738			html += "	</td>\n";
2739		}else
2740		{
2741			html += "	<td><div></div></td>\n";
2742		}
2743
2744		if(i%7==0)
2745			html += "</tr>\n";
2746		
2747		
2748		if(i==eDate+sWd)
2749		{
2750			for(var j=0; j<(7-(i%7)); j++)
2751				html += "<td><div></div></td>";
2752		}
2753	}
2754	html += "</tr>";
2755	
2756	$(destObj).html(html);
2757}
2758
2759function hasSchedule(thisDate)
2760{
2761	var result = false;
2762	
2763	thisDate = thisDate.replaceAll("-", ".");
2764
2765	for(var i=0; i<schDatas.length; i++)
2766	{
2767		if(schDatas[i].item01.substr(0, 10)<=thisDate && schDatas[i].item02.substr(0, 10)>=thisDate)
2768		{
2769			result = true;
2770			break;
2771		}
2772	}
2773
2774	return result;
2775}
2776
2777function getCurDateSchedule(pType, thisDate, destObj)
2778{
2779	var result = "";
2780
2781	$("#sch_date").val(thisDate.split("-")[2])
2782	thisDate = thisDate.replaceAll("-", ".");
2783
2784	setDateText(thisDate);
2785	
2786	var schCount = 0;
2787	for(var i=0; i<schDatas.length; i++)
2788	{
2789
2790		if(schDatas[i].item01.substr(0, 10)<=thisDate && schDatas[i].item02.substr(0, 10)>=thisDate)
2791		{
2792			schCount++;
2793			
2794			if(pType=="main")
2795			{
2796				result += "<li>";
2797				result += "	<a href='/board/board_detail?bd_type=APPLICATION&sitemap_code=K0401&bd_id="+ schDatas[i].bd_id +"&idx="+ schDatas[i].idx +"'>";
2798				result += "		<div class='left'>";
2799				result += "			<p class='cat'>"+ getScheduleName(schDatas[i].bd_id) +"</p>";
2800				result += "			<h3 class='title'>"+ schDatas[i].title +"</h3>";
2801				result += "			<div class='date'>";
2802				result += "				<p class='tit'>일시</p>";
2803				result += "				<span>"+ schDatas[i].item01 +" ~ "+ schDatas[i].item02 +"</span>";
2804				result += "				<span>"+ schDatas[i].item03 +"~"+ schDatas[i].item04 +"</span>";
2805				result += "			</div>";
2806				result += "		</div>";
2807				result += "		<span class='schedule-status "+schDatas[i].status +"'>"+ getScheduleStatus(schDatas[i].bd_id, schDatas[i].status) +"</span>";
2808				result += "	</a>";
2809				result += "</li>";
2810	
2811			}else if(pType=="sub" || pType=="subMain")
2812			{
2813				result += "<li>";
2814				result += "	<a href='/board/board_detail?bd_type=APPLICATION&sitemap_code=K0401&bd_id="+ schDatas[i].bd_id +"&idx="+ schDatas[i].idx +"'>";
2815				result += "		<div class='head'>";
2816				result += "			<h3 class='title'>"+ schDatas[i].title +"</h3>";
2817				result += "			<div class='status-area'>";
2818				result += "				<div class='capacity'>";
2819				result += "					<span class='current'>"+ schDatas[i].app_count +"</span>";
2820				result += "					/";
2821				result += "					<span class='total'>"+ schDatas[i].item08 +"</span>";
2822				result += "				</div>";
2823				result += "				<span class='schedule-status "+schDatas[i].status +"'>"+ getScheduleStatus(schDatas[i].bd_id, schDatas[i].status) +"</span>";
2824				result += "			</div>";
2825				result += "		</div>";
2826				result += "		<ul class='info'>";
2827				result += "			<li>";
2828				result += "				<p class='tit'>대상</p>";
2829				result += "				<p class='txt'>";
2830				result += "				<span>"+ schDatas[i].item09 +"</span>";
2831				result += "				</p>";
2832				result += "			</li>";
2833				result += "			<li>";
2834				result += "				<p class='tit'>장소</p>";
2835				result += "				<p class='txt'>";
2836				result += "					<span>"+ schDatas[i].item05 +"</span>";
2837				result += "				</p>";
2838				result += "			</li>";
2839				result += "			<li>";
2840				result += "				<p class='tit'>교육일시</p>";
2841				result += "				<p class='txt'>";
2842				result += "					<span>"+ schDatas[i].item01 +" ~ "+ schDatas[i].item02 +"</span>";
2843				result += "					<span>"+ schDatas[i].item03 +"~"+ schDatas[i].item04 +"</span>";
2844				result += "				</p>";
2845				result += "			</li>";
2846				result += "			<li>";
2847				result += "				<p class='tit'>신청기간</p>";
2848				result += "				<p class='txt'>";
2849				result += "					<span>"+ schDatas[i].item06 +" ~ "+ schDatas[i].item07 +"</span>";
2850				result += "				</p>";
2851				result += "			</li>";
2852				result += "		</ul>";
2853				result += "	</a>";
2854				result += "</li>";
2855			}			
2856		}
2857	}
2858
2859	if(result=="")
2860	{
2861		result += "	<li class='no-data'>";
2862		result += "		일정이 없습니다.";
2863		result += "	</li>";
2864	}
2865	
2866	$(".total strong").html(schCount);
2867	$(destObj).html(result);
2868}
2869
2870function getScheduleName(bd_id)
2871{
2872	switch(bd_id)
2873	{
2874		case "EDUCATE":
2875			return "교육신청";
2876		case "WORKSHOP":
2877			return "워크샵신청";
2878		case "WELLFARE":
2879			return "복지지원신청";
2880	}
2881}
2882
2883function getScheduleStatus(bd_id, status)
2884{
2885	var result = "";
2886	
2887	switch(status)
2888	{
2889	case "mint":
2890		result = "신청가능";
2891		break;
2892	case "pink":
2893		result = "신청대기";
2894		break;
2895	case "gray":
2896		result = "신청마감";
2897		break;
2898	case "white":
2899		switch(bd_id)
2900		{
2901		case "WELLFARE":
2902			result = "지원사업완료";
2903			break;
2904		case "EDUCATE":
2905			result = "교육완료";
2906			break;
2907		case "WORKSHOP":
2908			result = "워크샵완료";
2909			break;
2910		}
2911		break;			
2912	}
2913	
2914	return result;
2915}
2916
2917function setDateText(thisDate)
2918{
2919	var year = thisDate.substr(0, 4)
2920	var month = thisDate.substr(5, 2);
2921	var date = thisDate.substr(8, 2);
2922	
2923	$("#schedule_date").html(year +"년 "+ month +"월 <span class='day'>"+ date +"일</span>");
2924}
2925
2926function getSchedule()
2927{
2928	var result = "";
2929	var cnt = 0;
2930	
2931	thisDate = thisDate.replaceAll("-", ".");
2932
2933	for(var i=0; i<schDatas.length; i++)
2934	{
2935		if(schDatas[i].item01.substr(0, 10)<=thisDate && schDatas[i].item02.substr(0, 10)>=thisDate)
2936		{
2937			cnt++;
2938			result += "<li data-idx='"+ schDatas[i].idx +"'>"+ schDatas[i].title +"</li>";
2939		}
2940	}
2941	
2942	if(result!="")
2943	{
2944		result = "<ul class='plan'>"+ result +"</ul>"; 
2945		if(cnt>2)
2946			result = "<span class='remainder'>+"+ (cnt-2) +"</span>"+ result;
2947	}
2948	
2949	
2950	return result;
2951}
2952
2953function getDateText(objDate, delim)
2954{
2955	var result = "";
2956
2957	result = objDate.getFullYear() + delim + String(objDate.getMonth()+1).padStart(2, "0") + delim + String(objDate.getDate()).padStart(2, "0");
2958	
2959	return result;
2960}
2961
2962function loadScript(url) {
2963	var script = document.createElement("script");
2964	script.src = url;
2965	script.type = "text/javascript";
2966	
2967	document.head.appendChild(script);
2968}

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.