PageSourceSearch

https://imssam.me/js/common.js?2026-10-08%2012:10:20

js imssam.me collected 2026-10-08 03:10:52 UTC 44,399 bytes, 1,583 lines download raw bytes

1// 전역 변수
2var errmsg = "";
3var errfld = null;
4
5// 필드 검사
6function check_field(fld, msg)
7{
8    if ((fld.value = trim(fld.value)) == "")
9        error_field(fld, msg);
10    else
11        clear_field(fld);
12    return;
13}
14
15// 필드 오류 표시
16function error_field(fld, msg)
17{
18    if (msg != "")
19        errmsg += msg + "\n";
20    if (!errfld) errfld = fld;
21    fld.style.background = "#FFE4E1";
22}
23
24// 필드를 깨끗하게
25function clear_field(fld)
26{
27    fld.style.background = "#FFFFFF";
28}
29
30// 팝업 중앙에 띄우기
31var pwin = null;
32function win_open(url, name, w, h, scroll){
33	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
34	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
35	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
36	pwin = window.open(url, name, settings)
37}
38
39// 5자리 우편번호 도로명 우편번호 창
40function win_zip(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_jibeon)
41{
42	var url = "/bbs/zip.php?frm_name="+frm_name+"&frm_zip="+frm_zip+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2+"&frm_addr3="+frm_addr3+"&frm_jibeon="+frm_jibeon;
43	win_open(url, "winZip", "483", "600", "yes");
44}
45
46// 쿠키 입력
47function set_cookie(name, value, expirehours, domain)
48{
49    var today = new Date();
50    today.setTime(today.getTime() + (60*60*1000*expirehours));
51    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
52    if (domain) {
53        document.cookie += "domain=" + domain + ";";
54    }
55}
56
57// 쿠키 얻음
58function get_cookie(name)
59{
60    var find_sw = false;
61    var start, end;
62    var i = 0;
63
64    for (i=0; i<= document.cookie.length; i++)
65    {
66        start = i;
67        end = start + name.length;
68
69        if(document.cookie.substring(start, end) == name)
70        {
71            find_sw = true
72            break
73        }
74    }
75
76    if (find_sw == true)
77    {
78        start = end + 1;
79        end = document.cookie.indexOf(";", start);
80
81        if(end < start)
82            end = document.cookie.length;
83
84        return unescape(document.cookie.substring(start, end));
85    }
86    return "";
87}
88
89function fsearch_post(val)
90{
91	var f = document.fsearch;
92
93	f.ss_tx.value = val;
94	f.action = gw_shop_url+'/search_update.php';
95	f.submit();
96}
97
98/*Left menu구현*/
99var old='';
100function menu(name)
101{
102	submenu=eval("submenu_"+name+".style");
103	if(old!=submenu)
104	{
105		if(old!='')
106		{
107			old.display='none';
108		}
109		submenu.display='block';
110		old=submenu;
111	}
112	else
113	{
114		submenu.display='none';
115		old='';
116	}
117}
118
119function MM_swapImgRestore() { //v3.0
120	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
121}
122
123function MM_preloadImages() { //v3.0
124	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
125    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
126    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
127}
128
129function MM_swapImage() { //v3.0
130	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
131	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
132}
133
134function MM_reloadPage(init) {  //reloads the window if Nav4 resized
135  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
136    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
137  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
138}
139MM_reloadPage(true);
140
141
142function MM_findObj(n, d) { //v4.01
143  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
144    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
145  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
146  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
147  if(!x && d.getElementById) x=d.getElementById(n); return x;
148}
149
150function MM_showHideLayers() { //v6.0
151  var i,p,v,obj,args=MM_showHideLayers.arguments;
152  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
153    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
154    obj.visibility=v; }
155}
156
157var jumin_field_length=0;
158function TabNext(obj,event,len,next_field) {
159	if (event == "down") {
160		jumin_field_length=obj.value.length;
161	}
162	else if (event == "up") {
163		if (obj.value.length != jumin_field_length) {
164			jumin_field_length=obj.value.length;
165			if (jumin_field_length == len) {
166				next_field.focus();
167			}
168		}
169	}
170}
171
172String.prototype.trim = function() {
173    return this.replace(/(^\s*)|(\s*$)/g, "");
174}
175
176String.prototype.stripspace = function() {
177	return this.replace(/ /g, "");
178}
179
180String.prototype.replaceAll = function(a, b) {
181	var s = this;
182	var n1, n2, s1, s2;
183
184	while (true) {
185		if ( s=="" || a=="" ) break;
186		n1 = s.indexOf(a);
187		if ( n1 < 0 ) break;
188		n2 = n1 + a.length;
189		if ( n1==0 ) {
190			s1 = b;
191		}
192		else {
193			s1 = s.substring(0, n1) + b;
194		}
195		if ( n2 >= s.length ) {
196			s2 = "";
197		}
198		else {
199			s2 = s.substring(n2, s.length);
200		}
201		s = s1 + s2;
202	}
203	return s;
204}
205
206// Event 추가 ##################################################
207function addEvent(obj, evt, exec) {
208	if (window.attachEvent) obj.attachEvent('on'+evt, exec);
209	else if (window.addEventListener) obj.addEventListener(evt, exec, false);
210	else obj['on'+evt] = exec;
211}
212
213// 팝업 ##################################################
214function openPopup(theURL, winName, width, height, remFeatures) {
215	var features = "";
216	if (typeof winName == "undefined") winName = "";
217	if (typeof width != "undefined") features += ((features) ? "," : "")+"width="+width;
218	if (typeof height != "undefined") features += ((features) ? "," : "")+"height="+height;
219	if (typeof remFeatures != "undefined") features += ((features) ? "," : "")+remFeatures;
220	if (features.indexOf("status") < 0) features += ",status=yes";
221
222	var popup = window.open(theURL, winName, features);
223	popup.focus();
224
225	return popup;
226}
227
228// 팝업 - 팝업창 화면중앙 오픈 ##################################################
229function openPopupCenter(theURL, winName, width, height, remFeatures) {
230	var left = (screen.width/2) - (width/2);
231	var top = (screen.availHeight/2) - (height/2);
232	var features = "left="+left+",top="+top+",width="+width+",height="+height;
233	if (typeof winName == "undefined") winName = "";
234	if (typeof remFeatures != "undefined") features += ","+remFeatures;
235	if (features.indexOf("status") < 0) features += ",status=yes";
236
237	var popup = window.open(theURL, winName, features);
238	popup.focus();
239
240	return popup;
241}
242
243// 팝업 - 팝업창 사이즈 조정 ##################################################
244function resizePopupWindow(width, height) {
245	var strAgent = navigator.userAgent.toLowerCase();
246	var isIE7 = (strAgent.indexOf('msie 7.0') != -1);
247	var isMoz = (strAgent.indexOf('gecko') != -1);
248	window.resizeTo(width+10, height+(isIE7?71:(isMoz?81:49)));
249}
250
251// 팝업 - 팝업창 위치 조정 ##################################################
252function movePopupWindow(left, top) {
253	window.moveTo(left, top);
254}
255
256// 모달 ##################################################
257function MM_openModal(theURL, obj, features) {
258	window.showModalDialog(theURL, obj, features);
259}
260
261// 키 관련 함수 ##################################################
262function blockKey(e) {
263	var e = window.event || e;
264	if (window.event) {
265		e.returnValue = false;
266	}
267	else {
268		if (e.which != 8) e.preventDefault(); // 8 : Back Space
269	}
270}
271
272function blockEnter(e) {
273	var e = window.event || e;
274	if (window.event) {
275		if (e.keyCode == 13) e.returnValue = false;
276	}
277	else {
278		if (e.which == 13) e.preventDefault();
279	}
280}
281
282function blockNotNumber(e) {
283	var e = window.event || e;
284	if (window.event) {
285		if (e.keyCode < 48 || e.keyCode > 57) e.returnValue = false;
286	}
287	else {
288		if (e.which != 8 && (e.which < 48 || e.which > 57)) e.preventDefault(); // 8 : Back Space
289	}
290}
291
292function onEnter(e, exec) {
293	var e = window.event || e;
294	var keyCode = (window.event) ? e.keyCode : e.which;
295	if (keyCode == 13) eval(exec);
296}
297
298// 즐겨찾기 추가
299function addFavorites(title, url) {
300	// Google Chrome
301	if(window.chrome){
302		alert("Ctrl+D키를 누르시면 즐겨찾기에 추가하실 수 있습니다.");
303	}
304	// Firefox
305	else if(window.sidebar) {
306		window.sidebar.addPanel(title, url, "");
307	}
308	// Opera
309	else if(window.opera && window.print) {
310		var elem = document.createElement('a');
311		elem.setAttribute('href',url);
312		elem.setAttribute('title',title);
313		elem.setAttribute('rel','sidebar');
314		elem.click();
315	}
316	// Internet Explorer
317	else if (window.external && ('AddFavorite' in window.external)) {
318		window.external.AddFavorite(url, title);
319	}
320}
321
322// 시작페이지 설정 ##################################################
323// 예) <a href="javascript:;" onClick="setStartPage(this, 'http://www.homepage.com');">시작페이지로</a>
324function setStartPage(obj, url) {
325	if (document.all && window.external) { // IE
326		obj.style.behavior = "url(#default#homepage)";
327		obj.setHomePage(url);
328	}
329	else { // Firefox, Opera, Safari ...
330		alert("현재 브라우져에서는 이용할 수 없습니다.");
331		return;
332    }
333}
334
335// 페이지 이동 ##################################################
336function gotoUrl(url) {
337	if (url.stripspace() != "") {
338		location.href = url;
339	}
340}
341
342// 페이지 최상단으로 ##################################################
343function goTop() {
344	window.scrollTo(0, 0);
345}
346
347// 이미지 미리보기 ##################################################
348function previewImage(obj, imgId) {
349	var objImg = document.getElementById(imgId);
350
351	if (obj.value.stripspace() == "") return;
352
353	var ext = getFileExt(obj.value).toUpperCase();
354
355	if (ext == 'JPG' || ext == 'GIF' || ext == 'BMP' || ext == 'PNG') objImg.src = obj.value;
356}
357
358// 이미지 사이즈 줄이기 ##################################################
359function resizeImage(objImg, limitId) {
360	if (typeof (objImg) != "object") objImg = document.getElementById(objImg);
361	var objParent = objImg.parentNode;
362	var imgWidth = parseInt(objImg.width, 10);
363	var fixWidth = imgWidth;
364
365	if (typeof limitId == 'undefined') return;
366
367	while (objParent) {
368		if (objParent && objParent.id == limitId) {
369			fixWidth = objParent.clientWidth;
370			break;
371		}
372		objParent = objParent.offsetParent;
373	}
374
375	if (imgWidth > fixWidth) {
376		objImg.width = fixWidth;
377	}
378}
379
380function resizeImageAll(limitId) {
381	var objLimit = document.getElementById(limitId);
382	if (objLimit) {
383		var fixWidth = objLimit.clientWidth;
384		var arrImgs = objLimit.getElementsByTagName("IMG");
385		for (var i=0, len=arrImgs.length; i<len; i++) {
386			if (parseInt(arrImgs[i].width, 10) > fixWidth) {
387				arrImgs[i].width = fixWidth;
388			}
389		}
390	}
391}
392
393// IFRAME RESIZE 함수 ##################################################
394function resizeFrame(iframeWindow, minWidth, minHeight, fixWidth, fixHeight) {
395	if (!iframeWindow.name) return false;
396
397	var iframeElement = document.getElementById(iframeWindow.name);
398	var resizeWidth = 0;
399	var resizeHeight = 0;
400
401	minWidth = (typeof minWidth != 'undefined') ? parseInt(minWidth, 10) : 0;
402	minHeight = (typeof minHeight != 'undefined') ? parseInt(minHeight, 10) : 0;
403	fixWidth = (typeof fixWidth != 'undefined') ? parseInt(fixWidth, 10) : 0;
404	fixHeight = (typeof fixHeight != 'undefined') ? parseInt(fixHeight, 10) : 0;
405
406	if (document.all) { // ie
407		if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {
408			resizeWidth = iframeWindow.document.documentElement.scrollWidth;
409			resizeHeight = iframeWindow.document.documentElement.scrollHeight;
410		}
411		else {
412			resizeWidth = iframeWindow.document.body.scrollWidth;
413			resizeHeight = iframeWindow.document.body.scrollHeight;
414		}
415	}
416	else {
417		resizeWidth = iframeWindow.document.body.scrollWidth;
418		resizeHeight = iframeWindow.document.body.scrollHeight;
419	}
420
421	if (minWidth > 0 && resizeWidth < minWidth) resizeWidth = minWidth;			// 최소 폭
422	if (minHeight > 0 && resizeHeight < minHeight) resizeHeight = minHeight;		// 최소 높이
423
424	if (fixWidth > 0) resizeWidth = fixWidth;		// 고정 폭
425	if (fixHeight > 0) resizeHeight = fixHeight;	// 고정 높이
426
427	if (fixWidth > -1) iframeElement.style.width = resizeWidth + 'px';
428	if (fixHeight > -1) iframeElement.style.height = resizeHeight + 'px';
429}
430
431// 현재 이벤트객체 Index 가져오기 ##################################################
432function getDisObjIdx(obj) {
433	var i = 0;
434	var result = 0;
435
436	var arrTag = document.getElementsByTagName('*');
437
438	if (obj.sourceIndex) {
439		while (arrTag[i].sourceIndex < obj.sourceIndex) {
440			if (arrTag[i].id == obj.id) ++result;
441			++i;
442		}
443	}
444	else if (obj.compareDocumentPosition) {
445		while ((arrTag[i].compareDocumentPosition(obj) & 6) - 3 > 0) {
446			if (arrTag[i].id == obj.id) ++result;
447			++i;
448		}
449	}
450
451	return result;
452}
453
454// 체크박스 전체선택 ##################################################
455function checkCbAll(cbList, isChecked) {
456	if (cbList) {
457		if (typeof(cbList.length) == "undefined") {
458			if (!cbList.disabled) cbList.checked = isChecked;
459		}
460		else {
461			for (var i=0; i<cbList.length; i++) {
462				if (cbList[i].type.toUpperCase() == 'CHECKBOX') {
463					if (cbList[i].value.stripspace() != "" && !cbList[i].disabled) {
464						cbList[i].checked = isChecked;
465					}
466				}
467			}
468		}
469	}
470}
471
472// 텍스트 길이 확인 (일반) ##################################################
473function checkTextLen(obj, mLen) {
474	if (obj.value.length > mLen){
475		alert("1~"+mLen+"자까지 입력이 가능합니다.");
476		obj.value = obj.value.substring(0, mLen);
477		obj.focus();
478		return false;
479	}
480
481	return true;
482}
483
484// 텍스트 길이 확인 (Byte) ##################################################
485function checkTextLenByte(obj, mLen) {
486	var i, len;
487	var byteLen = 0;
488	var value = obj.value;
489
490	for (i=0, len=value.length; i<len; i++) {
491		++byteLen;
492
493		if ((value.charCodeAt(i) < 0) || (value.charCodeAt(i) > 127)) ++byteLen;
494
495		if (byteLen > mLen) {
496			alert("1~"+(mLen / 2)+"자의 한글, 또는 2~"+mLen+"자의 영문, 숫자, 문장기호로 입력이 가능합니다.");
497			obj.value = value.substring(0, i);
498			obj.focus();
499			return false;
500		}
501	}
502
503	return true;
504}
505
506// 객체 Offset 가져오기 ##################################################
507function getOffset(obj) {
508	var objOffset = { left : 0, top : 0 };
509	var objOffsetParent = obj.offsetParent;
510
511	objOffset.left = parseInt(obj.offsetLeft, 10);
512	objOffset.top = parseInt(obj.offsetTop, 10);
513
514	while (objOffsetParent) {
515		objOffset.left += parseInt(objOffsetParent.offsetLeft, 10);
516		objOffset.top += parseInt(objOffsetParent.offsetTop, 10);
517
518		objOffsetParent = objOffsetParent.offsetParent;
519	}
520
521	return objOffset;
522}
523
524// 텍스트 Byte 길이 가져오기 ##################################################
525function getTextByte(value) {
526	var i, len;
527	var byteLen = 0;
528
529	for (i=0, len=value.length; i<len; i++) {
530		if (escape(value.charAt(i)).length >= 4) {
531			byteLen += 2;
532		}
533		else if (escape(value.charAt(i)) != "%0D") {
534			++byteLen;
535		}
536	}
537
538	return byteLen;
539}
540
541// 입력 문자길이 확인후 다음항목으로 포커스 옮기기 ##################################################
542function goNextFocus(obj, len, next_item) {
543	if (obj.value.stripspace().length == len){
544		next_item.focus();
545	}
546}
547
548// 영문 문자열 확인 ##################################################
549function strEngCheck(value){
550	var i;
551
552	for(i=0;i<value.length-1;i++){
553		// 한글 체크 (한글 ASCII코드 : 12593부터)
554		if (value.charCodeAt(i) > 12592) return false;
555		// 공백 체크
556		if (value.charAt(i) == " ") return false;
557	}
558	return true;
559}
560
561// 파일명 확인 ##################################################
562function checkFileName(obj) {
563	var result = false;
564
565	if (obj.value.stripspace() != "") {
566		var fidx = obj.value.lastIndexOf("\\")+1;
567		var filename = obj.value.substr(fidx, obj.value.length);
568		result = strEngCheck(filename);
569	}
570
571	if (!result) {
572		alert("파일명을 반드시 영문 또는 숫자로 해주세요.");
573		obj.focus();
574		return false;
575	}
576	return true;
577}
578
579// 파일 확장자 ##################################################
580function getFileExt(value) {
581	if (value != "") {
582		var fidx = value.lastIndexOf("\\")+1;
583		var filename = value.substr(fidx, value.length);
584		var eidx = filename.lastIndexOf(".")+1;
585
586		return filename.substr(eidx, filename.length);
587	}
588}
589
590// 파일확장자 확인 ##################################################
591function checkFileExt(obj, exts, errMsg) {
592	var arrExt = exts.toLowerCase().split(",");
593	var result = false;
594
595	if (obj.value.stripspace() != "") {
596		var ext = getFileExt(obj.value).toLowerCase();
597
598		for (var i=0; i<arrExt.length; i++) {
599			if (arrExt[i].trim() == ext) result = true;
600		}
601	}
602
603	if (!result) {
604		alert(errMsg);
605		obj.focus();
606		return false;
607	}
608	return true;
609}
610
611// 영문/숫자 혼용 확인 ##################################################
612function checkEngNum(str) {
613	var RegExpE = /[a-zA-Z]/i;
614	var RegExpN = /[0-9]/;
615
616	return (RegExpE.test(str) && RegExpN.test(str)) ? true : false;
617}
618
619// 특수문자 확인 ##################################################
620function checkSpecialChar(value) {
621	var specialChar = "`~!@#$%^&*_+=|\\[]{}:;,<.>/?'\"";
622	for (var i=0, len=specialChar.length; i<len; i++) {
623		if (value.indexOf(specialChar.substr(i, 1)) != -1) return true;
624	}
625	return false;
626}
627
628// 아이디 확인 ##################################################
629function checkID(value, min, max) {
630	var RegExp = /^[a-zA-Z0-9_]*$/i;
631	var returnVal = RegExp.test(value) ? true : false;
632	if (typeof(min) != "undefined" && value.length < min) returnVal = false;
633	if (typeof(max) != "undefined" && value.length > max) returnVal = false;
634	return returnVal;
635}
636
637// 비밀번호 확인 ##################################################
638function checkPass(value, min, max) {
639	var RegExp = /^[a-zA-Z0-9]*$/i;
640	var returnVal = RegExp.test(value) ? true : false;
641	if (typeof(min) != "undefined" && value.length < min) returnVal = false;
642	if (typeof(max) != "undefined" && value.length > max) returnVal = false;
643	return returnVal;
644}
645
646// 숫자 확인 ##################################################
647function checkNum(value, isDec) {
648	var RegExp;
649
650	if (!isDec) isDec = false;
651	RegExp = (isDec) ? /^-?[\d\.]*$/ : /^-?[\d]*$/;
652
653	return RegExp.test(value)? true : false;
654}
655
656// 이메일 확인 ##################################################
657function checkEmail(email) {
658	if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
659		return true;
660	}
661	else {
662		return false;
663	}
664}
665
666// URL 확인 ##################################################
667function checkUrl(url) {
668	var exp = new RegExp("^(http|https)\:\/\/");
669	if (exp.test(url.toLowerCase())) {
670		return true;
671	}
672	else {
673		return false;
674	}
675}
676
677// 공백 확인 ##################################################
678function checkEmpty(obj) {
679	if (obj.value.stripspace() == "") {
680		return true;
681	}
682	else {
683		return false;
684	}
685}
686
687// Radio(CheckBox) 설정값 가져오기 ##################################################
688function getRadioVal(obj) {
689	var i, value = "";
690
691	if (obj) {
692		if (typeof(obj.length) == "undefined") {
693			if (obj.checked) {
694				value = obj.value;
695			}
696		}
697		else {
698			for (i=0; i<obj.length; i++) {
699				if (obj[i].checked) {
700					value = obj[i].value;
701					break;
702				}
703			}
704		}
705	}
706	return value;
707}
708
709// Radio 설정하기 ##################################################
710function setRadioVal(obj, value) {
711	var i;
712
713	if (obj) {
714		if (typeof(obj.length) == "undefined") {
715			if (obj.value == value) {
716				obj.checked = true;
717			}
718		}
719		else {
720			for(i=0; i<obj.length; i++) {
721				if (obj[i].value == value) {
722					obj[i].checked = true;
723					break;
724				}
725			}
726		}
727	}
728}
729
730// Radio Disabled 설정하기 ##################################################
731function setRadioDisabled(obj, value, disabled) {
732	var i;
733
734	if (obj) {
735		if (typeof(obj.length) == "undefined") {
736			if (obj.value == value) {
737				obj.disabled = disabled;
738			}
739		}
740		else {
741			for(i=0; i<obj.length; i++) {
742				if (obj[i].value == value) {
743					obj[i].disabled = disabled;
744					break;
745				}
746			}
747		}
748	}
749}
750
751// Form Disabled 전체 설정하기 ##################################################
752function setRadioDisabledAll(obj, disabled) {
753	var i;
754
755	if (obj) {
756		if (typeof(obj.length) == "undefined") {
757			obj.disabled = disabled;
758		}
759		else {
760			for(i=0; i<obj.length; i++) {
761				obj[i].disabled = disabled;
762			}
763		}
764	}
765}
766
767// Select 설정값 가져오기 ##################################################
768function getSelectVal(obj) {
769	var value = "";
770	var idx = obj.selectedIndex;
771
772	if (idx >= 0){
773		value = obj.options[idx].value;
774	}
775
776	return value;
777}
778
779// Select Option 추가 ##################################################
780function selectAddList(obj, text, value) {
781	var newOpt = document.createElement("OPTION");
782	newOpt.text = text;
783	newOpt.value = value;
784	obj.options.add(newOpt);
785}
786
787// Select Option 전체삭제 ##################################################
788function selectRemoveAll(obj) {
789	for (var i=obj.length-1; i>=0; i--) {
790		selectRemoveList(obj, i);
791	}
792}
793
794// Select Option 삭제 ##################################################
795function selectRemoveList(obj, i) {
796	obj.remove(i);
797}
798
799// Hidden 추가 ##################################################
800function addHidden(f, name, value) {
801	var input = document.createElement('INPUT');
802	input.type = 'HIDDEN';
803	input.name = name;
804	input.value = value;
805	f.appendChild(input);
806}
807
808// 숫자 문자열에서 문자열 제거 ##################################################
809function stripCharFromNum(value, isDec) {
810	var i;
811	var minus = "-";
812	var nums = "1234567890"+((isDec) ? "." : "");
813	var result = "";
814
815	for(i=0; i<value.length; i++) {
816		numChk = value.charAt(i);
817		if (i == 0 && numChk == minus) {
818			result += minus;
819		}
820		else {
821			for(j=0; j<nums.length; j++) {
822				if(numChk == nums.charAt(j)) {
823					result += nums.charAt(j);
824					break;
825				}
826			}
827		}
828	}
829	return result;
830}
831
832// 콤마(,) 제거 ##################################################
833function stripComma(str) {
834    var re = /,/g;
835    return str.replace(re, "");
836}
837
838// 숫자 3자리수마다 콤마(,) 찍기 ##################################################
839function formatComma(num, pos) {
840	if (!pos) pos = 0;  //소숫점 이하 자리수
841	var re = /(-?\d+)(\d{3}[,.])/;
842
843	var strNum = stripComma(num.toString());
844	var arrNum = strNum.split(".");
845
846	arrNum[0] += ".";
847
848    while (re.test(arrNum[0])) {
849        arrNum[0] = arrNum[0].replace(re, "$1,$2");
850    }
851
852	if (arrNum.length > 1) {
853		if (arrNum[1].length > pos) {
854			arrNum[1] = arrNum[1].substr(0, pos);
855		}
856		return arrNum.join("");
857	}
858	else {
859		return arrNum[0].split(".")[0];
860	}
861}
862
863// 강제 소수점 이하 0채우기 ##################################################
864// num: 대상숫자, pos: 출력을 원하는 소수점자리수
865function setRoundZero(num, pos) {
866	var strNum = stripComma(num.toString());
867	var arrNum = strNum.split(".");
868
869	if (arrNum.length <= 1) {
870		num = arrNum[0]+".";
871		for (var i=0; i<pos; i++) {
872			num += "0";
873		}
874	}
875	else {
876		num = setRound(num, pos);
877	}
878	return num;
879}
880
881// 소수점 이하 반올림 ##################################################
882// num: 대상숫자, pos:출력을 원하는 소수점자리수
883function setRound(num, pos) {
884	if(!pos) pos = 0;
885	return Math.round(num*Math.pow(10,pos)) / Math.pow(10, pos);
886}
887
888// 소수점 이하 자름
889// num: 대상숫자, pos:출력을 원하는 소수점자리수
890function setFloor(num, pos)
891{
892	if(!pos) pos = 0;
893	return Math.floor(num*Math.pow(10,pos)) / Math.pow(10, pos);
894}
895
896// 금액 절사
897// num: 대상숫자, pos:절사 자릿수 (Default 10원단위 절사)
898function setCutting(num, pos)
899{
900	if(!pos) pos = 10;
901	return Math.floor(num/pos) * pos;
902}
903
904// 소수점 이하 자리수 확인 ##################################################
905// num: 대상숫자, pos: 희망 소수점 이하자리수
906function checkRound(num, len) {
907	var strNum = stripComma(num.toString());
908	var arrNum = strNum.split(".");
909
910	if (arrNum.length > 1 && arrNum[1].length > len) return false;
911	else return true;
912}
913
914// 통화형태로 변환 ##################################################
915function toCurrency(obj) {
916	if (obj.disabled) return false;
917
918	var num = obj.value.stripspace();
919	if (num == "") return false;
920
921	if (!checkNum(stripComma(num))) {
922		//alert ("숫자만 입력해주세요.");
923		num = stripCharFromNum(num, false);
924		obj.blur(); obj.focus();
925	}
926	num = stripCharFromNum(stripComma(num), false);
927	num = removePreZero(num);
928	obj.value = formatComma(num);
929}
930
931// 숫자입력 확인 ##################################################
932function numberOnly(obj, isDec) {
933	if (!isDec) isDec = false;
934	if (obj.disabled) return false;
935
936	var num = obj.value.stripspace();
937	if (num == "") return false;
938
939	if (!checkNum(num, isDec)) {
940		alert ("숫자만 입력해주세요.");
941		num = stripCharFromNum(num, isDec);
942		obj.blur(); obj.focus();
943	}
944	num = stripCharFromNum(stripComma(num), isDec);
945
946	var arrNum = num.split(".");
947	if (arrNum.length > 1) {
948		obj.value = arrNum[0]+"."+arrNum[1];
949	}
950	else {
951		obj.value = arrNum[0];
952	}
953}
954
955// 숫자 증감 처리 ##################################################
956function controllNum(obj, mode, isminus) {
957	var num = obj.value;
958	if (!isminus) isminus = 0;
959
960	num = (num.stripspace() == "") ? 0 : num;
961	num = (isNaN(num)) ? 0 : parseInt(num, 10);
962
963	if (mode == '+') ++num;
964	else --num;
965
966	if (isminus != 1 && num < 0) num = 0;
967
968	obj.value = num;
969}
970
971// 팝업 중앙에 띄우기 ##################################################
972var win = null;
973function openwindow(mypage,myname,w,h,scroll){
974	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
975	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
976	settings =
977	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+''
978	win = window.open(mypage,myname,settings)
979}
980
981// 자바스크립트로 PHP의 number_format 흉내를 냄
982// 숫자에 , 를 출력
983function number_format(num, pos) {
984	if (!pos) pos = 0;  //소숫점 이하 자리수
985	var re = /(-?\d+)(\d{3}[,.])/;
986
987	var strNum = no_comma(num.toString());
988	var arrNum = strNum.split(".");
989
990	arrNum[0] += ".";
991
992    while (re.test(arrNum[0])) {
993        arrNum[0] = arrNum[0].replace(re, "$1,$2");
994    }
995
996	if (arrNum.length > 1) {
997		if (arrNum[1].length > pos) {
998			arrNum[1] = arrNum[1].substr(0, pos);
999		}
1000		return arrNum.join("");
1001	}
1002	else {
1003		return arrNum[0].split(".")[0];
1004	}
1005}
1006
1007// , 를 없앤다.
1008function no_comma(data)
1009{
1010    var tmp = '';
1011    var comma = ',';
1012    var i;
1013
1014    for (i=0; i<data.length; i++)
1015    {
1016        if (data.charAt(i) != comma)
1017            tmp += data.charAt(i);
1018    }
1019    return tmp;
1020}
1021
1022function getPosition(e)
1023{
1024	try
1025	{
1026		var mouseX = e.pageX ? e.pageX : document.documentElement.scrollLeft + event.clientX;
1027		var mouseY = e.pageX ? e.pageX : document.documentElement.scrollLeft + event.clientY;
1028	}
1029	catch (e)
1030	{
1031		var mouseX = document.body.offsetWidth - 350;
1032		var mouseY = document.body.offsetHeight - 400;
1033	}
1034
1035    return {x: mouseX, y: mouseY};
1036}
1037
1038/**
1039 * 필드 자동 포커스이동
1040 * obj 체크할 필드, toID 이동할 필드의 ID, maxLen 이동될 문자열길이
1041 */
1042function fieldLengthFocus(obj, toID, maxLen)
1043{
1044    if(toID == null || maxLen == null)
1045    {
1046        return false;
1047    }
1048
1049    if(obj.value.length >= maxLen)
1050    {
1051        document.getElementById(toID).focus();
1052    }
1053}
1054
1055// 양쪽 공백 없애기
1056function trim(sVal)
1057{
1058    var pattern = /(^\s*)|(\s*$)/g; // \s 문자열 시작부분과 문자열 끝나는 부분의 공백, 탭을 모두 찾는다.
1059    sReturnVal = sVal.replace(pattern, "");
1060    return sReturnVal;
1061}
1062
1063// Sub ID		: getRadioValue
1064// Description	: 체크된 라디오버튼 값
1065// Param		: obj	- RadioButton object
1066// Return		: 체크된 라디오버튼 값
1067function getRadioValue(obj){
1068	if(obj){
1069		if(obj.length){
1070			for(i=0;i<obj.length;i++){
1071				if(obj[i].checked == true){
1072					return obj[i].value;
1073				}
1074			}
1075
1076		}else{
1077			return obj.value;
1078		}
1079	} else { return false; }
1080}
1081
1082function getCheckboxValue(obj) {
1083	if (obj) {
1084		if (obj.checked) {
1085			return obj.value
1086		}
1087	}
1088
1089	return null;
1090}
1091
1092// 이미지맵 위치로 이동
1093function pg_anchor(uid) {
1094	location.hash = uid;
1095}
1096
1097// 신용카드 전표출력
1098function show_receipt( send_no, tpg, send_dt, approve, sRetailer_id ,pg_provider)
1099{
1100	var win; 
1101	var kcpPgUrl = "https://admin8.kcp.co.kr/assist/bill.BillAction.do?cmd=card_bill&tno="; // KCP URL
1102	var tossPgeUrl = "https://pgweb.tosspayments.com:9091/MpFlowCtrl?eventDiv1=search&eventDiv2=getReceipt&authResultParam=Y&TRANSACTIONID="; // 토스 URL
1103	
1104	switch(tpg){
1105		case 'kcp':
1106			win = kcpPgUrl + send_no;
1107			window.open(win, "", "width=455, height=815");
1108		break;
1109
1110		case 'inicis':
1111			win = "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + send_no + "&noMethod=1";
1112			window.open(win,"receipt","width=430,height=700");
1113		break;
1114
1115		case 'allthegate':
1116			url  ="http://www.allthegate.com/customer/receiptLast3.jsp"
1117			url += "?sRetailer_id="+sRetailer_id;
1118			url += "&approve="+approve;
1119			url += "&send_no="+send_no;
1120			url += "&send_dt="+send_dt.substring(0,8);
1121
1122			window.open(url, "window","toolbar=no,location=no,directories=no,status=,menubar=no,scrollbars=no,resizable=no,width=420,height=700,top=0,left=150");
1123		break;
1124		case 'iamport' :
1125        // iamport인 경우 내부에서 kcp 여부를 확인 
1126		// tpg 값은 모두 iamport 이다. 
1127		// 신규 거래건은 리턴 값에 pg구분값을 db에 저장하여 kcp로 넘어오지만 기존 값은 확인이 안되므로 send_no 값에서 im_ 문자열로 확인하여 토스결제인지 구분한다.)
1128			if (pg_provider !== 'kcp' && send_no.substring(0, 3) === "im_") {
1129				win = tossPgeUrl + send_no;
1130			}
1131			else {
1132				win = kcpPgUrl + send_no;
1133			}
1134			window.open(win, "", "width=455, height=815");
1135			//https://pgweb.tosspayments.com:9091/MpFlowCtrl?eventDiv1=search&eventDiv2=getReceiptTestAdmin&TRANSACTIONID=tlgda2022022412010590183&SYSTEM=NEW&authResultParam=Y
1136		break;
1137	}
1138}
1139
1140// 숫자 3자리 마다 콤마를 삽입
1141function commaStr(n)
1142{
1143    var reg = /(^[+-]?\d+)(\d{3})/;
1144    n += "";
1145
1146    while (reg.test(n))
1147        n = n.replace(reg, "$1" + "," + "$2");
1148    return n;
1149}
1150
1151// 콤마제거
1152function deCommaStr(obj)
1153{
1154    num = obj.value+"";
1155    if (obj.value!="") {
1156        obj.value = obj.value.replace(/,/g, "");
1157    }
1158}
1159
1160// 입력폼에 숫자 3자리 마다 콤마를 삽입
1161function addComma(obj,fLen)
1162{
1163	if(event.keyCode == 37 || event.keyCode == 39 )
1164	{
1165		return;
1166	}
1167
1168	var fLen = fLen || 2;
1169	var strValue = obj.value.replace(/,|\s+/g,'');
1170	var strBeforeValue = (strValue.indexOf('.') != -1)? strValue.substring(0,strValue.indexOf('.')) :strValue ;
1171	var strAfterValue = (strValue.indexOf('.') != -1)? strValue.substr(strValue.indexOf('.'),fLen+1) : '' ;
1172
1173	if(isNaN(strValue))
1174	{
1175		alert(strValue.concat(' -> 특수문자/영문/한글은 입력할 수 없습니다.'));
1176		return false;
1177	}
1178
1179	var intLast = strBeforeValue.length-1;
1180	var arrValue = new Array;
1181	var strComma = '';
1182
1183	for(var i=intLast,j=0; i >= 0; i--,j++)
1184	{
1185		if( j !=0 && j%3 == 0)
1186		{
1187			strComma = ',';
1188		}
1189		else
1190		{
1191			strComma = '';
1192		}
1193
1194		arrValue[arrValue.length] = strBeforeValue.charAt(i) + strComma ;
1195	}
1196
1197	obj.value= arrValue.reverse().join('') + strAfterValue;
1198}
1199
1200// 날짜검색
1201function search_date(fr_date, to_date, today)
1202{
1203	if(today == "오늘") {
1204		var obj1 = document.getElementById(fr_date);
1205		var obj2 = document.getElementById(to_date);
1206		var mydate = new Date();
1207		mydate.setDate(mydate.getDate());
1208
1209		obj1.value = formatDate(mydate);
1210		if(obj2 != null) {
1211			obj2.value = obj1.value;
1212		}
1213	} else if(today == "어제") {
1214		var obj1 = document.getElementById(fr_date);
1215		var obj2 = document.getElementById(to_date);
1216		var mydate = new Date();
1217		mydate.setDate(mydate.getDate() - 1);
1218
1219		obj1.value = formatDate(mydate);
1220		if(obj2 != null) {
1221			obj2.value = obj1.value;
1222		}
1223	} else if(today == "이번주") {
1224		var obj1 = document.getElementById(fr_date);
1225		var obj2 = document.getElementById(to_date);
1226
1227		var now = new Date();
1228		var nowDayOfWeek = now.getDay();
1229		var nowDay = now.getDate();
1230		var nowMonth = now.getMonth();
1231		var nowYear = now.getYear();
1232		nowYear += (nowYear < 2000) ? 1900 : 0;
1233		var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
1234		var weekEndDate = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
1235
1236		obj1.value = formatDate(weekStartDate);
1237		obj2.value = formatDate(weekEndDate);
1238	} else if(today == "일주일") {
1239		var obj1 = document.getElementById(fr_date);
1240		var obj2 = document.getElementById(to_date);
1241		var mydate = new Date();
1242
1243		mydate.setDate(mydate.getDate() - 7);
1244		obj1.value = formatDate(mydate);
1245		obj2.value = formatDate(new Date());
1246	} else if(today == "1개월") {
1247		var obj1 = document.getElementById(fr_date);
1248		var obj2 = document.getElementById(to_date);
1249		var mydate = new Date();
1250		mydate.setDate(mydate.getDate() - 30);
1251
1252		obj1.value = formatDate(mydate);
1253		obj2.value = formatDate(new Date());
1254	} else if(today == "2개월") {
1255		var obj1 = document.getElementById(fr_date);
1256		var obj2 = document.getElementById(to_date);
1257		var mydate = new Date();
1258		mydate.setDate(mydate.getDate() - 60);
1259
1260		obj1.value = formatDate(mydate);
1261		obj2.value = formatDate(new Date());
1262	} else if(today == "3개월") {
1263		var obj1 = document.getElementById(fr_date);
1264		var obj2 = document.getElementById(to_date);
1265
1266		var mydate = new Date();
1267		mydate.setDate(mydate.getDate() - 90);
1268
1269		obj1.value = formatDate(mydate);
1270		obj2.value = formatDate(new Date());
1271	} else if(today == "이번달") {
1272		var obj1 = document.getElementById(fr_date);
1273		var obj2 = document.getElementById(to_date);
1274
1275		var d2, d3;
1276		var now = new Date();
1277		var nowYear = now.getYear();
1278		nowYear += (nowYear < 2000) ? 1900 : 0;
1279
1280		d2 = new Date(nowYear, now.getMonth());
1281		d3 = new Date(nowYear, now.getMonth() + 1, "");
1282
1283		obj1.value = formatDate(d2);
1284		obj2.value = formatDate(d3);
1285	} else if(today == "지난달") {
1286		var obj1 = document.getElementById(fr_date);
1287		var obj2 = document.getElementById(to_date);
1288
1289		var d2, d3;
1290		var now = new Date();
1291		var nowYear = now.getYear();
1292		nowYear += (nowYear < 2000) ? 1900 : 0;
1293
1294		d2 = new Date(nowYear, now.getMonth() -1);
1295		d3 = new Date(nowYear, now.getMonth(), "");
1296
1297		obj1.value = formatDate(d2);
1298		obj2.value = formatDate(d3);
1299	} else if(today == "전체") {
1300		var obj1 = document.getElementById(fr_date);
1301		var obj2 = document.getElementById(to_date);
1302		obj1.value = obj2.value = "";
1303	} else if(today == "기본지정일") {
1304		var obj1 = document.getElementById(fr_date);
1305		var obj2 = document.getElementById(to_date);
1306		var appReservedUserDate2099 = "2099-12-31"
1307
1308		obj1.value = appReservedUserDate2099;
1309		obj2.value = appReservedUserDate2099;
1310	}
1311}
1312
1313// 날짜계산
1314function formatDate(date)
1315{
1316	var mymonth = date.getMonth() + 1;
1317    var myweekday = date.getDate();
1318    return (date.getFullYear() + "-" + ((mymonth < 10) ? "0" : "") + mymonth + "-" + ((myweekday < 10) ? "0" : "") + myweekday);
1319}
1320
1321// SNS
1322function share_sns(id, url) {
1323	switch(id) {
1324		case 'facebook' :
1325			window.open(url, "win_facebook", "menubar=0,resizable=1,width=600,height=400");
1326			break;
1327		case 'twitter' :
1328			window.open(url, "win_twitter", "menubar=0,resizable=1,width=600,height=400");
1329			break;
1330		case 'googleplus' :
1331			window.open(url, "win_googleplus", "menubar=0,resizable=1,width=600,height=600");
1332			break;
1333		case 'naverband' :
1334			window.open(url, "win_naverband", "menubar=0,resizable=1,width=410,height=540");
1335			break;
1336		case 'naver' :
1337			window.open(url, "win_naver", "menubar=0,resizable=1,width=450,height=540");
1338			break;
1339		case 'kakaostory' :
1340			window.open(url, "win_kakaostory", "menubar=0,resizable=1,width=500,height=500");
1341			break;
1342		case 'pinterest' :
1343			window.open(url, "win_tumblr", "menubar=0,resizable=1,width=600,height=400");
1344			break;
1345		case 'tumblr' :
1346			window.open(url, "win_tumblr", "menubar=0,resizable=1,width=540,height=600");
1347			break;
1348	}
1349    return false;
1350}
1351
1352function itemlistwish(gs_id) {
1353	$.post(
1354        gw_shop_url+"/ajax.wishupdate.php",
1355        { gs_id: gs_id },
1356        function(data) {
1357			if(data == 'INSERT') {
1358				$("."+gs_id).attr('class',gs_id+' zzim on');
1359			} else if(data == 'DELETE') {
1360				$("."+gs_id).attr('class',gs_id+' zzim');
1361			} else {
1362				alert(data);
1363			}
1364        }
1365    );
1366}
1367function itemlistwish1(gs_id) {
1368	$.post(
1369        gw_shop_url+"/ajax.wishupdate.php",
1370        { gs_id: gs_id },
1371        function(data) {
1372			if(data == 'INSERT') {
1373				$("."+gs_id).attr('class',gs_id+' zzim1 on');
1374				$("."+gs_id).src = "/m/img/renew/main_title_023.png";
1375				document.getElementById(gs_id).src = "/m/img/renew/main_title_023.png";
1376			} else if(data == 'DELETE') {
1377				$("."+gs_id).attr('class',gs_id+' zzim1');
1378				$("."+gs_id).src = "/m/img/renew/main_title_022.png";
1379				document.getElementById(gs_id).src = "/m/img/renew/main_title_022.png";
1380			} else {
1381				alert(data);
1382			}
1383        }
1384    );
1385}
1386
1387function saupjaonopen(saupjano) {
1388	var url = "http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no="+saupjano;
1389	window.open(url, "communicationViewPopup", "width=750, height=700;");
1390}
1391
1392$(function(){
1393	// 최상단 큰배너
1394	$("#hd_close").click(function(){
1395		$("#hd_banner").slideUp('fast');
1396		$.post(gw_bbs_url+"/ajax.hd_banner.php", { type: "close" });
1397	});
1398});
1399
1400function updateIFrame( height ) {
1401	var iframe = document.getElementById('unse_frame');
1402	iframe.setAttribute( 'height', height ); 
1403}
1404
1405function ajaxFrom(formId, callback)
1406{
1407	//alert($('form')[0].id);
1408	var frm = $("#"+formId);
1409	var method = frm.attr("method");
1410	//var params = frm.serialize();
1411	var params = new FormData(document.getElementById(formId));
1412	var url = frm.attr("action");
1413	var result;
1414	
1415	$.ajax({      
1416        headers : {
1417			accept: "text/plain; charset=utf-8"
1418		},
1419		type: method,  
1420        url:url,      
1421        data:params,
1422        processData: false,
1423		contentType: false,
1424		scriptCharset : "UTF-8",
1425		success:function(args){   
1426        	callback(args);
1427        },
1428        beforeSend:function() {
1429			
1430		},
1431		done : function() {
1432			
1433		},  
1434        error:function(e){  
1435            console.log(e);  
1436        }  
1437    });
1438}
1439
1440function trade_select(no, target)
1441{
1442	$.get("/shop/ajax.school-select.php?no=" +no , function(res) {
1443		$("#"+target).html(res);
1444		$("#"+target).removeClass('dn');
1445		// select2 초기화
1446		if ($.fn.select2) {
1447			$("#"+target).find('.select2-school').select2({
1448				placeholder: '학교를 검색하세요',
1449				allowClear: true,
1450				width: '250px',
1451				language: {
1452					noResults: function() {
1453						return '검색 결과가 없습니다';
1454					},
1455					searching: function() {
1456						return '검색중...';
1457					}
1458				}
1459			});
1460		}
1461	});
1462}
1463
1464function IsJsonString(str) {
1465  try {
1466    var json = JSON.parse(str);
1467    return (typeof json === 'object');
1468  } catch (e) {
1469    return false;
1470  }
1471}
1472
1473//셀렉트 제어 함수
1474function toggleSelects(triggerSelector, targetSelector, enableValue) {
1475    var triggerSelect = document.querySelector(triggerSelector);
1476    var targetSelect = document.querySelector(targetSelector);
1477
1478    if (!triggerSelect || !targetSelect) {
1479        console.log('Select element not found.');
1480        return;
1481    }
1482
1483    function toggleTargetSelect() {
1484        var isEnabled = triggerSelect.value === enableValue;
1485        targetSelect.disabled = !isEnabled;
1486        if (!isEnabled) targetSelect.value = '0';
1487    }
1488
1489    triggerSelect.addEventListener('change', toggleTargetSelect);
1490    toggleTargetSelect(); 
1491}
1492
1493function getPossibleVisitDate()
1494{
1495	// 방문 가능한 날짜를 구한다.
1496	let possibleStartDate = 'today';
1497
1498	// 시작 날짜는 지금 시간이 16시 30분 이후라면 다음날로 설정, 다음날이 주말이라면 그 다음주 월요일로 설정
1499	if(moment().isAfter(moment().set('hour', 16).set('minute', 30))) {
1500			possibleStartDate = moment().add(1, 'days').format('YYYY-MM-DD');
1501	}
1502	
1503	if(possibleStartDate != 'today' && new Date().getDay() === 5) {
1504			possibleStartDate = moment().add(3, 'days').format('YYYY-MM-DD');
1505	}
1506
1507	return possibleStartDate;
1508}
1509
1510//iframe 사이즈 조절 함수
1511function makeIframeResponsive() {
1512    var iframes = document.querySelectorAll("iframe");
1513
1514    iframes.forEach(function(iframe) {
1515        // iframe의 설정된 사이즈를 가져온다.
1516        var originalWidth = parseInt(iframe.getAttribute('width'), 10);
1517        var originalHeight = parseInt(iframe.getAttribute('height'), 10);
1518        
1519        var aspectRatio = (originalHeight / originalWidth) * 100;
1520
1521        // iframe 크기 조절을 위해 부모 컨테이너를 설정
1522        var wrapper = document.createElement('div');
1523        wrapper.className = 'video-wrapper';
1524        wrapper.style.position = 'relative';
1525        wrapper.style.width = originalWidth + 'px';
1526        wrapper.style.height = originalHeight + 'px';
1527        wrapper.style.maxWidth = '100%';
1528        wrapper.style.margin = '0 auto';
1529        wrapper.style.overflow = 'hidden';
1530
1531        // iframe의 스타일을 설정
1532        iframe.style.position = "absolute";
1533        iframe.style.top = "0";
1534        iframe.style.left = "0";
1535        iframe.style.width = "100%";
1536        iframe.style.height = "100%";
1537        iframe.style.border = "0";
1538
1539        // 사이즈 조절을 위해 iframe을 부모 컨테이너로 감싸준다.
1540        iframe.parentNode.insertBefore(wrapper, iframe);
1541        wrapper.appendChild(iframe);
1542
1543        // 창 크기가 원래 설정된 사이즈보다 작아지면 크기를 조절
1544        function resizeIframe() {
1545            if (wrapper.offsetWidth < originalWidth) {
1546                wrapper.style.width = '100%';
1547                wrapper.style.height = (wrapper.offsetWidth * originalHeight / originalWidth) + 'px';
1548            } else {
1549                wrapper.style.width = originalWidth + 'px';
1550                wrapper.style.height = originalHeight + 'px';
1551            }
1552        }
1553
1554        resizeIframe();
1555        window.addEventListener('resize', resizeIframe);
1556    });
1557}
1558
1559function openRepairReceipt(id, title = '수리 내역서') {
1560	if(!id) {
1561		alert('수리내역서를 열 수 없습니다.');
1562		return;
1563	}
1564	window.open(`/mydata/as_repair_receipt.php?id=${id}&title=${title}`, '_blank', 'width=1080, height=800');
1565	return;
1566}
1567
1568function checkAccess(memberGrade, rowGrade, memberId, rowId) {
1569    if (memberGrade == 1) {
1570        return true;
1571    } else if (memberGrade == 2) {
1572        if (memberId == rowId) {
1573            return true;
1574        } else if (rowGrade == 2) {
1575            alert("일반 관리자 계정은 타 관리자 계정으로 로그인할 수 없습니다.");
1576            return false;
1577        } else if (rowGrade > 2) {
1578            return true;
1579        }
1580    }
1581    alert("로그인 권한이 없습니다.");
1582    return false;
1583}

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.