PageSourceSearch

https://sk7mobiledirect.com/html/cmmn/js/common.js?1770627639000

js sk7mobiledirect.com collected 2026-10-06 04:01:12 UTC 45,717 bytes, 1,529 lines download raw bytes

1var UI = {},compareUI;
2
3//아이폰 백버튼 오류수정
4$(window).bind("pageshow", function(event) {
5	if (event.originalEvent.persisted) {window.location.reload();}
6});
7
8/* 입력폼 스킨 */
9UI.inpSkin = function(){
10	/* radio Skin */
11	$(document).on('click','input[type=radio]',function(){
12		if($(this).parent().is('.radio-skin')){
13			$('input[name="'+this.name+'"]').each(function(){
14				$(this).parent().removeClass('checked');
15				$(this).attr('checked',false);
16			})
17			$(this).parent().addClass('checked');
18			$(this).attr('checked',true);
19		}
20	})
21	/* checkBox skin */
22	$(document).on('click','input[type=checkbox]',function(){
23		var _label = $(this).parent();
24		if(_label.is('.chk-skin')){
25			if(_label.is('.checked')){
26				_label.removeClass('checked')
27				$(this).attr('checked',false);
28			}else{
29				_label.addClass('checked');
30				$(this).attr('checked',true);
31			}
32		}
33	})
34}
35/* 비교하기 */
36UI.compareChk = function(){
37	var me = {
38		arrItem : [],
39		_init : function(){
40			var viewport = $(".goods-compare > span");
41			/* list hover */
42			var _listItem = $('a.prd-wrap');
43			_listItem.each(function(){
44				$(this).parent().bind({
45					'mouseenter':function(){
46						$(this).addClass('hover')
47					},
48					'mouseleave':function(){
49						$(this).removeClass('hover')
50					}
51				})
52			})
53
54			//compare checkbox event
55			_listItem.parent().find('.chk-skin input').click(function(){
56					var arrCopy = [];
57					var _listel = $(this).parents('li');
58					var modelId = _listel.attr('id'); /* DB에서 모델을 구분할수있는 index값 */
59					var modelName = _listel.find('.model-name').text();
60
61					/* 데이터 객체 생성 */
62					var tmpObj = {};
63					var overlap = false;
64					tmpObj[modelId] = modelName;
65
66					/* 중복데이터 검사 */
67					for(var c=0; c<me.arrItem.length; c++){
68						for(var key in me.arrItem[c]){
69							if(key != modelId){
70								arrCopy.push(me.arrItem[c]);
71							}else{
72								overlap = true;
73							}
74						}
75					}
76					if(!overlap){
77						if(me.arrItem.length > 2){
78							alert('휴대폰은 3개까지만 비교가 가능합니다');
79							return false;
80						}
81						arrCopy.push(tmpObj);
82					}
83
84					/* dom 객체에 적용 */
85					var arrInnerHtml = [];
86					for(var i=0; i<arrCopy.length; i++){
87						for(var key in arrCopy[i]){
88							arrInnerHtml.push("<span data-id='"+key+"'>"+ arrCopy[i][key] +"<a href='#' class='compare-delect'>삭제</a></span>");
89						}
90					}
91					viewport.html(arrInnerHtml.join(''))
92					me.arrItem = arrCopy;
93			});
94			viewport.on('click','.compare-delect',function(){
95				var testrset = $(this).parent().attr('data-id');
96
97				$('#'+testrset).find('input[type=checkbox]').click();
98				return false;
99			});
100		}
101	}
102	return me;
103}
104
105/* layer popup */
106UI.modal = function(target){
107	var _this = $(target);
108
109	return {
110		open: function(options){
111			$('#dimm').show();
112			$('#popWrap1').show();
113			_this.show();
114			this.bind(options);
115		},
116		close: function(){
117			$('#dimm').hide();
118			$('#popWrap1').hide();
119			_this.hide();
120		},
121		bind: function(options){
122			_this.find('.d_ok').unbind();
123			_this.find('.d_close').unbind();
124
125			_this.find('.d_ok').click(function(){
126				options.OK.call();
127			})
128			_this.find('.d_close').click(function(){
129				options.CANCEL.call();
130				return false;
131			})
132		}
133	}
134}
135
136/* basket popup */
137UI.basketPopup = function(thisE) {
138	var _this = $(thisE);
139
140	if ($('.simple-menu .simple-join').hasClass('join-popup-open')){
141		$('.simple-menu .simple-join').removeClass('join-popup-open');
142	}
143
144	if (_this.parent().hasClass('active')){
145		_this.parent().removeClass('active');
146	} else {
147		_this.parent().addClass('active');
148		$('.simple-join-popup').css('display', 'none');
149	}
150}
151
152/* simple join popup */
153UI.simpleJoinPopup = function(thisE) {
154	var _this = $(thisE);
155
156	if ($('.simple-menu .basket > li').eq(0).hasClass('active')){
157		$('.simple-menu .basket > li').eq(0).removeClass('active');
158	}
159	if (_this.parent().hasClass('join-popup-open')){
160		_this.parent().removeClass('join-popup-open');
161		$('.simple-join-popup').slideUp();
162	} else {
163		_this.parent().addClass('join-popup-open');
164		$('.simple-join-popup').slideDown();
165	}
166}
167
168/* phon detail img */
169UI.detailImg = function() {
170	var me = {
171		_init : function(){
172			var viewport = $(".thumb-view"),
173				viewCont = viewport.find('.img > ul'),
174				viewList = viewCont.find('> li'),
175				indexActive = viewport.find('.simg li'),
176				nextBtn = viewport.find('.bimg .next'),
177				prevBtn = viewport.find('.bimg .prev'),
178				index = 0;
179
180			nextBtn.click(function(){
181				if (index < indexActive.length){
182					index = index + 1;
183				}
184				indexActive.removeClass('active').eq(index).addClass('active');
185				viewCont.css('margin-left', viewList.width() * -index);
186				if (index == (indexActive.length - 1)){
187					nextBtn.css('display','none');
188				}
189				prevBtn.css('display','');
190			});
191
192			prevBtn.click(function(){
193				if (index > 0){
194					index = index - 1;
195				}
196				indexActive.removeClass('active').eq(index).addClass('active');
197				viewCont.css('margin-left', viewList.width() * -index);
198				if (index == 0){
199					prevBtn.css('display','none');
200				}
201				nextBtn.css('display','');
202			});
203
204			indexActive.click(function(){
205				index = $(this).index();
206				indexActive.removeClass('active');
207				$(this).addClass('active');
208				viewCont.css('margin-left', viewList.width() * -index);
209				if (index == (indexActive.length - 1)){
210					nextBtn.css('display','none');
211					prevBtn.css('display','');
212				} else if (index == 0){
213					nextBtn.css('display','');
214					prevBtn.css('display','none');
215				} else {
216					nextBtn.css('display','');
217					prevBtn.css('display','');
218				}
219			});
220		}
221	}
222	return me;
223}
224
225UI.mainBanner = function() {
226	var me = {
227		_init : function(){
228			var bodyW = $(window).width();
229			if(bodyW < 1196){
230				$('.quici_btn').css('display','');
231			} else {
232				$('.quici_btn').css('display','none');
233			}if(bodyW > 1196){
234				$('.spread_type').css('display','');
235			}else{
236				$('.spread_type').css('display','none');
237			}return false;
238		}
239	}
240	return me;
241}
242
243$(document).ready(function(){
244	UI.inpSkin();
245	compareUI = UI.compareChk();
246	compareUI._init();
247	$('.simple-menu .basket-icon').click(function(){
248		UI.basketPopup(this);
249	});
250	$('.simple-menu .simple-join-icon').click(function(){
251		UI.simpleJoinPopup(this);
252	});
253
254	if ($('.basket-list .basket-item > li').length > 0){
255		var basketList = $('.basket-list .basket-item > li');
256		basketList.each(function(index){
257			if (((index+1)%3) == '0'){
258				basketList.eq(index).addClass('list-three');
259			}
260		});
261	}
262
263	if ($('.top-banner')){
264		$('.top-banner .top-banner-close').click(function() {
265			$('.top-banner').css('display','none');
266		});
267	}
268
269	if ($('.product-info .thumb-view')){
270		UI.detailImg()._init();
271	}
272	if ($('.main_wrap .spread_type')){
273		UI.mainBanner()._init();
274		$(window).resize(function(){
275			UI.mainBanner()._init();
276		});
277	}
278
279/*	$('#header .gnb > li').hover(function(){
280		$(this).css('height','152px').find('.sub-gnb').css('display', 'block');
281	}, function(){
282		$(this).css('height','48px').find('.sub-gnb').css('display', '');
283	})
284*/
285	
286	// 배송조회 
287	 $('#headership').click(function(event) {
288	        event.preventDefault();
289	      //  var url = location.href;
290	        $.popupWindow_edited({
291	            windowURL : "/telink/inquiry",
292	            windowName : "ShareDialog",
293	            width : 626,
294	            height : 436,
295	            centerBrowser: 1
296	        });
297	    });
298	 
299	 //숫자만 입력가능하게하기
300	 $(".datepicker").siblings('input').keyup(function(){
301		 $(this).val($(this).val().replace(/[^0-9]/g,""));
302	 })
303	 
304	 $(".datepicker").siblings('input').blur(function(){
305		var obj = $(this).val();
306		var len = obj.length;
307		var tmp = "";
308		
309		if(len == 8){
310			tmp += obj.substr(0,4);
311			tmp += "-";
312			tmp += obj.substr(4,2);
313			tmp += "-";
314			tmp += obj.substr(6,2);			
315			
316			if(fn_dateCheck(tmp)){
317				$(this).val(tmp);	
318			}					
319		}	
320	 })
321});
322
323function fn_dateCheck(strValue){			
324	var chk1 = /^(19|20)\d{2}-([0][1-9]|1[012])-([0][1-9]|[12][0-9]|3[01])$/;
325
326    if (chk1.test(strValue) == false){ // 유효성 검사에 성공하지 못했다면      	
327    	return false;
328    }
329    
330  //-------------------------------------------------------------------------------
331    // 존재하는 날자(유효한 날자) 인지 체크
332    //-------------------------------------------------------------------------------
333    var bDateCheck = true;
334    var arrDate = strValue.split("-");
335    var nYear = Number(arrDate[0]);
336    var nMonth = Number(arrDate[1]);
337    var nDay = Number(arrDate[2]);
338
339    // 사용가능 하지 않은 년도 체크
340    if (nYear < 1900 || nYear > 2400){         
341    	bDateCheck = false;
342    }
343    
344    // 사용가능 하지 않은 달 체크
345    if (nMonth < 1 || nMonth > 12){     	
346    	bDateCheck = false;
347    }
348    
349    // 해당달의 마지막 일자 구하기
350    var nMaxDay = new Date(new Date(nYear, nMonth, 1) - 86400000).getDate();
351    if (nDay < 1 || nDay > nMaxDay){     	
352    	bDateCheck = false;
353    }
354
355    if(bDateCheck == false) {     
356       return false;
357    }else{
358       return true;
359    }
360}
361
362/*
363function onlyNumber(event) {
364    var key = window.event ? event.keyCode : event.which;
365    if ((event.shiftKey == false) && ((key  > 47 && key  < 58) || (key  > 95 && key  < 106)
366	    || key  == 35 || key  == 36 || key  == 37 || key  == 39  // 방향키 좌우,home,end
367	    || key  == 8  || key  == 46 || key == 9) // del, back space, tab
368    ) {
369        return true;
370    } else if((event.shiftKey == true) && key == 9){
371    	return true;
372    } else {
373        return false;
374    }
375}
376*/
377function onlyNumber(event) {
378	var key = window.event ? event.keyCode : event.which;
379	if(
380		event.shiftKey == false && (
381			(48 <= key && key <= 57)  ||/* 키보드 숫자 키 */
382			(96 <= key && key <= 105) ||/* 숫자패드 숫자 키 */
383			(37 <= key && key <= 40)  ||/* 좌(37), 상(38), 우(39), 하(40) 화살포 */
384			key == 8                  ||/* back space 키 */
385			key == 46                 ||/* delete 키 */
386			key == 9                    /* tab 키 */
387		)
388	) {
389		return true;
390	} else if((event.shiftKey == true) && key == 9) {
391		return true;
392	} else {
393		return false;
394	}
395}
396
397//위에 키이벤트 함수를 사용할 경우 익스플로러에서 한글이 입력가능하다.
398function onlyNumber2(obj) {
399	var str = obj.value;
400	var reg_patt = /[^0-9]*$/g;
401	obj.value = str.replace(reg_patt,"");
402}
403
404function onlyNumberInputEvent(obj, event) {
405	var data = event.data;
406	var pattern = /[^0-9]/g;
407	if(data && data.length == 1 && data.match(pattern)) {
408		obj.value = obj.value.replace(data, "");
409	}
410}
411
412function onlyDateInputEvent(obj, event) {
413	var data = event.data;
414	var pattern = /[^0-9\-]/g;
415	if(data && data.length == 1 && data.match(pattern)) {
416		obj.value = obj.value.replace(data, "");
417	}
418	
419}
420
421function onlyNumberMobile(selector) {
422	var filter = "win16|win32|win64|mac|macintel";
423	if(navigator.platform) {
424		if(filter.indexOf(navigator.platform.toLowerCase()) < 0) { // Mobile로 접속했을 경우
425			$(selector)
426				.attr("type", "number")
427				.attr("max", "9999")
428				.attr("pattern", "[0-9]*")
429				.attr("inputmode", "numeric")
430				.attr("oninput", "maxLengthCheck(this)")
431			;
432		} else { // PC로 접속했을 경우
433		}
434	}
435}
436
437function onlyNumberMobileMask(selector) {
438	var filter = "win16|win32|win64|mac|macintel";
439	if(navigator.platform) {
440		if(filter.indexOf(navigator.platform.toLowerCase()) < 0) { // Mobile로 접속했을 경우
441			$(selector).css("-webkit-text-security", "disc");
442		} else { // PC로 접속했을 경우
443		}
444	}
445}
446
447function maxLengthCheck(object) {
448	if(object.value.length > object.maxLength){
449		object.value = object.value.slice(0, object.maxLength);
450	}
451}
452
453function onlyEngNumber(event) {
454    var key = window.event ? event.keyCode : event.which;
455    if ((event.shiftKey == false) && ((key  > 47 && key  < 58) || (key  > 95 && key  < 106)
456	    || key  == 35 || key  == 36 || key  == 37 || key  == 39  // 방향키 좌우,home,end
457	    || key  == 8  || key  == 46 || key == 9) // del, back space, tab
458	    && (key > 64 && key < 91) // alphabet
459    ) {
460        return true;
461    } else if((event.shiftKey == true) && key == 9){
462    	return true;
463    } else {
464        return false;
465    }
466}
467
468function onlyEngNumber2(obj) {
469	var str = obj.value;
470	var reg_patt = /[^A-Za-z0-9]/g;
471	obj.value = str.replace(reg_patt,"");	
472}
473
474function onlyPhoneNumber(event) {
475    var key = window.event ? event.keyCode : event.which;
476    if ((event.shiftKey == false) && ((key  > 47 && key  < 58) || (key  > 95 && key  < 106)
477	    || key  == 35 || key  == 36 || key  == 37 || key  == 39  // 방향키 좌우,home,end
478	    || key  == 8  || key  == 46 || key == 9 || key == 109 || key == 189) // del, back space, tab
479    ) {
480        return true;
481    } else if((event.shiftKey == true) && key == 9){
482    	return true;
483    } else {
484        return false;
485    }
486}
487
488function fnLink(url) {
489	loadingModal("");
490	window.location.href = url;
491}
492
493function fnAjaxGetJson({url, data, successCallback, failCallback, isFollowup}) {
494	fnAjaxJson({type: 'get', url, data, successCallback, failCallback, isFollowup});
495}
496function fnAjaxPostJson({url, data, successCallback, failCallback, isFollowup=false}) {
497	fnAjaxJson({type: 'post', url, data, successCallback, failCallback, isFollowup});
498}
499function fnAjaxJson({type, url, data, successCallback, failCallback, isFollowup=false}) {
500	data = JSON.stringify(data);
501	$.ajax({
502		type,
503		url,
504		data,
505		dataType: 'json',
506		contentType: 'application/json; charset=utf-8',
507		beforeSend(xhr) {
508			loadingModal();
509			xhr.setRequestHeader('AJAX', true);
510		},
511		success: function(result) {
512			if (typeof successCallback != 'function') return;
513			successCallback(result);
514		},
515		error: function (xhr, status, error) {
516			unloadingModal();
517			if (typeof failCallback != 'function') return;
518			failCallback(error);
519		},
520		complete(xhr) {
521			if (!isFollowup) {
522				unloadingModal();
523			}
524		}
525	});
526}
527
528// 비동기 ajax
529function fnAjaxSubmit(url, type, data, dataType, callbackFunction, loadingMessage, proc, isFollowup) {
530	if(!proc) {
531		setTimeout(function(){
532			loadingModal(loadingMessage);
533		}, 1);
534	}
535	jQuery.ajax({
536		url : url,
537		type : type,
538		data : data,
539		dataType: dataType,
540		async : true,
541		beforeSend : function(xhr) {
542			xhr.setRequestHeader("AJAX", true);
543		},
544		success : callbackFunction,
545		error:function(xhr, status, error) {
546			unloadingModal();
547		},
548		complete:function(xhr) {
549			if(!proc && !isFollowup) {
550				unloadingModal();
551			}
552		}
553	});
554}
555
556//비동기 ajax
557function fnAjaxSubmitNoLoadingModal(url, type, data, dataType, callbackFunction, loadingMessage, proc) {
558	jQuery.ajax({
559		url : url,
560		type : type,
561		data : data,
562		dataType: dataType,
563		async : true,
564		beforeSend : function(xhr) {
565			xhr.setRequestHeader("AJAX", true);
566		},
567		success : callbackFunction,
568		error:function(xhr, status, error) {
569		},
570		complete:function(xhr) {
571		}
572	});
573}
574
575function loadingModal(loadingMessage) {
576	if(loadingMessage != undefined && $.trim(loadingMessage) != "") {
577		$("#area-modal-loading").find(".loading-alert").text(loadingMessage);
578	}
579	$("#area-modal-loading").modal("show");
580}
581
582function unloadingModal() {
583	setTimeout(function(){
584		$("#area-modal-loading").modal("hide");
585	}, 500);
586}
587
588// 동기화 ajax
589function fnAsyncAjaxSubmit(url, type, data, dataType, callbackFunction, viewLoading, proc) {
590	if( (navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ) { // IE 일 경우
591		//loadingModal(viewLoading);
592	} else {
593		if(proc == undefined) {
594			loadingModal(viewLoading);
595		}
596	}
597	jQuery.ajax({
598		url : url,
599		type : type,
600		data : data,
601		dataType: dataType,
602		async : false,
603		beforeSend : function(xhr) {
604			xhr.setRequestHeader("AJAX", true);
605		},
606		success : callbackFunction,
607		error:function(xhr, status, error) {
608			unloadingModal();
609		},
610		complete:function(xhr) {
611			if(proc == undefined) {
612				unloadingModal();
613			}
614		}
615	});
616}
617
618// 동기화 ajax
619function fnSyncAjax(option) {
620	url, type, data, dataType, callbackFunction, viewLoading, proc
621	if( (navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (navigator.userAgent.toLowerCase().indexOf("msie") != -1) ) { // IE 일 경우
622		//loadingModal(viewLoading);
623	} else {
624		if(proc == undefined) {
625			loadingModal(viewLoading);
626		}
627	}
628	jQuery.ajax({
629		url : url,
630		type : type,
631		data : data,
632		dataType: dataType,
633		async : false,
634		beforeSend : function(xhr) {
635			xhr.setRequestHeader("AJAX", true);
636		},
637		success : callbackFunction,
638		error:function(xhr, status, error) {
639			unloadingModal();
640		},
641		complete:function(xhr) {
642			if(proc == undefined) {
643				unloadingModal();
644			}
645		}
646	});
647}
648
649/**
650* @desc 동기ajax요청 - 동기라서 loadingModal은 사용 안함
651* @desc return response
652* @param Object option
653* @param String url
654* @param String type
655* @param Object data
656* @param String dataType
657* @return Object
658*/
659function fnSyncAjax(option) {
660	const url = option.url;
661	const type = option.type;
662	const data = option.data;
663	const dataType = option.dataType;
664	const isFollowup = !!option.isFollowup; // 후속 api요청 있는지 여부
665	
666	let result;
667
668	jQuery.ajax({
669		url : url,
670		type : type,
671		data : data,
672		dataType: dataType,
673		async : false,
674		beforeSend : function(xhr) {
675			xhr.setRequestHeader("AJAX", true);
676			loadingModal();
677		},
678		success : function (response, status, xhr) {
679			result = response;
680		},
681		error:function(xhr, status, error) {
682			unloadingModal();
683			result = error;
684		},
685		complete:function(xhr) {
686			if (!isFollowup) { // 후속 api요청 없으면 모달 끄기
687				unloadingModal();
688			}
689		}
690	});
691
692	return result;
693}
694
695function fnSyncPostAjax(option) {
696	option.type = 'post';
697	return fnSyncAjax(option);
698}
699
700function fnSyncGetAjax(option) {
701	option.type = 'get';
702	return fnSyncAjax(option);
703}
704
705function fnFormSubmit(formobj, viewLoading) {
706	if(viewLoading == undefined || viewLoading) {
707		loadingModal();
708	}
709	formobj.submit();
710}
711
712$.dateInput = function(showId){
713	$(showId).datepicker({
714		inline: true, 
715		dateFormat: "yy-MM-dd",    /* 날짜 포맷 */ 
716		prevText: '이전 달', 
717		nextText: '다음 달', 
718		defaultDate:new Date(),
719		showButtonPanel: true,    /* 버튼 패널 사용 */ 
720		changeMonth: true,        /* 월 선택박스 사용 */ 
721		changeYear: true,        /* 년 선택박스 사용 */ 
722		showOtherMonths: true,    /* 이전/다음 달 일수 보이기 */ 
723		selectOtherMonths: true,    /* 이전/다음 달 일 선택하기 */         
724		yearRange:'2010:+5',
725		closeText: '닫기', 
726		currentText: '오늘', 
727		showMonthAfterYear: true,        /* 년과 달의 위치 바꾸기 */ 
728		minDate: '-20y',
729		/* 한글화 */ 
730		monthNames : ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 
731		monthNamesShort : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
732		dayNames : ['일', '월', '화', '수', '목', '금', '토'],
733		dayNamesShort : ['일', '월', '화', '수', '목', '금', '토'],
734		dayNamesMin : ['일', '월', '화', '수', '목', '금', '토'],
735		/* 날짜 유효성 체크 */ 
736		onClose: function(selectedDate) { 		
737			$(showId).val(selectedDate);
738		}
739	});
740};
741
742$.birthDateInput = function(showId){
743	$(showId).datepicker({
744		inline: true, 
745		dateFormat: "yy-MM-dd",    /* 날짜 포맷 */ 
746		prevText: '이전 달', 
747		nextText: '다음 달', 
748		defaultDate:new Date(),
749		showButtonPanel: true,    /* 버튼 패널 사용 */ 
750		changeMonth: true,        /* 월 선택박스 사용 */ 
751		changeYear: true,        /* 년 선택박스 사용 */ 
752		showOtherMonths: true,    /* 이전/다음 달 일수 보이기 */ 
753		selectOtherMonths: true,    /* 이전/다음 달 일 선택하기 */
754		yearRange:'-150:+0', 
755		closeText: '닫기', 
756		currentText: '오늘', 
757		showMonthAfterYear: true,        /* 년과 달의 위치 바꾸기 */ 
758		minDate: '-150y',
759		/* 한글화 */ 
760		monthNames : ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 
761		monthNamesShort : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
762		dayNames : ['일', '월', '화', '수', '목', '금', '토'],
763		dayNamesShort : ['일', '월', '화', '수', '목', '금', '토'],
764		dayNamesMin : ['일', '월', '화', '수', '목', '금', '토'],
765		/* 날짜 유효성 체크 */ 
766		onClose: function(selectedDate) { 		
767			$(showId).val(selectedDate);
768		}
769	});
770};
771
772
773var holidays = {
774        "0101":{type:0, title:"신정"},
775        "0301":{type:0, title:"삼일절"},
776        "0505":{type:0, title:"어린이날"},
777        "0606":{type:0, title:"현충일"},
778        "0815":{type:0, title:"광복절"},
779        "1003":{type:0, title:"개천절"},
780        "1225":{type:0, title:"크리스마스"}
781};
782
783$.dateInput2 = function(showId){
784	
785	$(showId).datepicker({
786	  dateFormat: "yymmdd", 	 
787	  changeYear: true, //년도 변경 가능
788	  changeMonth: true, //월 변경 가능
789	  showOn: "button", //버튼 클릭시 달려 표시
790	  buttonImage: "/html/images/btn/btn_calendar.gif", //달력 표시 버튼 이미지
791	  buttonImageOnly: true, //버튼을 클릭해야만 달력 표시
792	  /* 한글화 */ 
793	  closeText : '닫기',
794	  prevText : '이전달',
795	  nextText : '다음달',
796	  currentText : '오늘',
797	  monthNames : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
798	  monthNamesShort : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
799	  dayNames : ['일', '월', '화', '수', '목', '금', '토'],
800	  dayNamesShort : ['일', '월', '화', '수', '목', '금', '토'],
801	  dayNamesMin : ['일', '월', '화', '수', '목', '금', '토'],
802	  maxDate : $.datepicker.formatDate('yymmdd', new Date()), //오늘 이후 날짜 선택 못함.
803	  beforeShowDay: function(day) {
804        var result;
805        // 포맷에 대해선 다음 참조(http://docs.jquery.com/UI/Datepicker/formatDate)
806        var holiday = holidays[$.datepicker.formatDate("mmdd",day )]; //표시날이 휴일인지 체크
807        
808        if (holiday) {
809          result =  [true, "date-holiday"+holiday.type, holiday.title];
810        } else {
811          switch (day.getDay()) {
812            case 0: // 일요일?
813              result = [true, "date-sunday"];
814              break;
815            case 6: // 토요일?
816              result = [true, "date-saturday"];
817              break;
818            default:
819              result = [true, ""];
820              break;
821          }
822        }
823        return result;
824      },
825		  onSelect: function(date) { //달력에서 날짜를 선택시 호출되는 메소드
826			   try{
827				   var dateArr = date;
828				    $(showId).val(dateArr); //일
829			   }catch (e) {return;}
830		   }
831	 });
832	 //달력 UI를 한글로 변경
833	 $(showId).datepicker( "option", $.datepicker.regional[ "ko" ] );
834	
835}
836
837
838
839function phoneTabSession(tabGubun , successYn){
840	$.ajax({
841	    type     : "POST",
842	    url      : "/rate/tabSession",
843	    dataType : "html",
844	    data     : { "sessionTabGubun":tabGubun },
845	    success  : function(data)
846	    {	
847	    	if(successYn == "Y"){
848		    	if(data == ""){
849		    		TAB_GUBUN = "lte";
850		    	}else{
851			    	TAB_GUBUN = data;
852		    	}
853		    	tabPhoneChange(TAB_GUBUN);
854	    	}
855	    }, 	
856	    complete: function(){
857			
858	    },
859	    error    : function(data)
860	    {
861	     	alert( "Ajax Error : Error 다시 시도해 주세요.");
862	    } 
863	});
864	
865}
866
867
868/***********************************************************************************/
869/** Captcha start ******************************************************************/
870/***********************************************************************************/
871function fnPreventRefresh(el) {
872	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
873	let uint32Array = new Uint32Array(1);
874	window.crypto.getRandomValues(uint32Array);
875	const randomNumber = uint32Array[0] / (Math.pow(2, 32));
876	//el.attr("src", "/cmmn/captcha.do?q="+el.attr("q")+"&r="+Math.random());
877	el.attr("src", "/cmmn/captcha.do?q="+el.attr("q")+"&r="+randomNumber);
878}
879function playCaptcha(el) {
880	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
881	let uint32Array = new Uint32Array(1);
882	window.crypto.getRandomValues(uint32Array);
883	const randomNumber = uint32Array[0] / (Math.pow(2, 32));
884	//var soundUrl = "/cmmn/audioCaptcha.do?q="+el.attr("q")+"&r="+Math.random();
885	var soundUrl = "/cmmn/audioCaptcha.do?q="+el.attr("q")+"&r="+randomNumber;
886	var uAgent = navigator.userAgent;	
887	if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) {
888		winPlayer(soundUrl+'&agent=msie');
889	} else if (!!document.createElement('audio').canPlayType) {
890		try { new Audio(soundUrl).play(); } catch(e) { winPlayer(soundUrl); }
891	} else {
892		//window.open(soundUrl, '', 'width=1,height=1');
893	}
894}
895function winPlayer(objUrl) {	
896	$('<div id="audiocaptcha" style="display:none;"></div>').appendTo('body');
897	$('#audiocaptcha').html(' <bgsound src="' + objUrl + '">');		
898}
899
900function fnCaptchaLoading(el) {
901	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
902	var uint32Array = new Uint32Array(1);
903	window.crypto.getRandomValues(uint32Array);
904	var randomNumber = uint32Array[0] / (Math.pow(2, 32));
905	//var q = Math.random();
906	var q = randomNumber;
907	el.attr("q", q);
908	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
909	//el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+Math.random());
910	window.crypto.getRandomValues(uint32Array);
911	randomNumber = uint32Array[0] / (Math.pow(2, 32));
912	el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+randomNumber);
913	$("input[name='q']").val(el.attr("q"));
914}
915function fnCaptchaRefresh(el) {
916	//el.attr("src", "/captcha.do?q="+el.attr("q")+"&r="+Math.random());
917	$("#captchaText").prop("readonly",false);
918	$('#captchaText').val('');
919	fnCaptchaLoading(el);
920}
921function fnCaptchaAudio(el) {
922	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
923	let uint32Array = new Uint32Array(1);
924	window.crypto.getRandomValues(uint32Array);
925	const randomNumber = uint32Array[0] / (Math.pow(2, 32));
926	//var soundUrl = "/captchaAudio.do?q="+el.attr("q")+"&r="+Math.random();
927	var soundUrl = "/captchaAudio.do?q="+el.attr("q")+"&r="+randomNumber;
928	var uAgent = navigator.userAgent;	
929	if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) {
930		winPlayer(soundUrl+'&agent=msie');
931	} else if (!!document.createElement('audio').canPlayType) {
932		try { new Audio(soundUrl).play(); } catch(e) { winPlayer(soundUrl); }
933	} else {
934		//window.open(soundUrl, '', 'width=1,height=1');
935	}
936}
937
938function fnNewCaptchaLoading(containerId, imageId, qId, captchaTextId) {
939	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
940	var uint32Array = new Uint32Array(1);
941	window.crypto.getRandomValues(uint32Array);
942	var randomNumber = uint32Array[0] / (Math.pow(2, 32));
943	//var q = Math.random();
944	var q = randomNumber;
945	$("#"+containerId).find("#"+captchaTextId).val("").focus();
946	$("#"+containerId).find("#"+imageId).attr("q", q);
947	//2025.01.21 24년 취약점 점검 code-ray [높음]CWE-330 불충분한 랜덤값 사용 수정
948	//$("#"+containerId).find("#"+imageId).attr("src", "/captcha.do?q=" + q +"&r=" + Math.random());
949	window.crypto.getRandomValues(uint32Array);
950	randomNumber = uint32Array[0] / (Math.pow(2, 32));
951	$("#"+containerId).find("#"+imageId).attr("src", "/captcha.do?q=" + q +"&r=" + randomNumber);
952	$("#"+containerId).find("#"+qId).val(q);
953}
954/***********************************************************************************/
955/** Captcha end ********************************************************************/
956/***********************************************************************************/
957
958
959function setComma(num){
960    var pattern = /(^[+-]?\d+)(\d{3})/;
961    num += '';
962    while (pattern.test(num)){
963        num = num.replace(pattern, '$1' + ',' + '$2');
964    }
965    return num == '0.0' ? '0' : num;
966}
967
968/**
969 * 추천인 체크
970 * @param tp
971 */
972function fnRcmdrCheck(tp, obj) {
973	switch(tp) {
974		case "Y01"://유베이스인 경우 처리 로직
975			var msg = "정확한 추천인 정보를 확인하신 후 다시 입력해 주세요.";
976			if($.trim(obj.val()) == "") {
977				alert(msg);
978				obj.focus();
979				return false;
980			} else {
981				var numberCheck = /^[0-9]*$/;
982				if($.trim(obj.val()).length == 8 && numberCheck.test(obj.val())) {
983					return true;
984				} else if($.trim(obj.val()).length == 9) {
985					if($.trim(obj.val()).substring(0,1).toUpperCase() == "U" && numberCheck.test($.trim(obj.val()).substring(1))) {
986						return true;
987					}
988				}
989				alert(msg);
990				obj.focus();
991				return false;
992			}
993			break;
994		case "Y02"://1+1 코어이벤트 인 경우 처리 로직
995			var msg = "정확한 추천인 정보를 확인하신 후 다시 입력해 주세요.";
996			if($.trim(obj.val()) == "") {
997				alert(msg);
998				obj.focus();
999				return false;
1000			} else {
1001				var spNext = obj.val().split("/");
1002				var e_pattern =  /[ㄱ-ㅎ|가-힣]{2,}\/[0-9]{2,11}$/i;
1003				if(!e_pattern.test(obj.val())) {
1004					alert("예시) 홍길동/01012341234 형식과 같이 입력하시기 바랍니다.");
1005					obj.focus();
1006					return false;
1007				}
1008				if(spNext[1].length < 10){
1009					alert("휴대폰번호는 최소 10자리이상 입력해주시기 바랍니다.");
1010					obj.focus();
1011					return false;
1012				}
1013				if(spNext[1].length >= 12){
1014					alert("휴대폰번호는 11자리 이하로 입력해주시기 바랍니다.");
1015					obj.focus();
1016					return false;
1017				}
1018				return true;
1019			}
1020			break;	
1021	}
1022}
1023
1024
1025
1026
1027
1028/************************************************************************************************
1029 * 기능 : 끝자리만  마스킹 처리
1030 ************************************************************************************************/
1031function maskingName(val) {
1032    if(strName === undefined || strName === '') {
1033        return '';
1034    }
1035    var pattern = /.$/; 
1036    return strName.replace(pattern, "*"); 
1037}
1038
1039/************************************************************************************************
1040 * 기능 : 뒤에서 부터 3글자를 * 처리한다. (ex. 12가3456 → 12가3***)
1041 ************************************************************************************************/
1042function maskingCar(val) {
1043    if (strCar == undefined || strCar === '') {
1044        return '';
1045    }
1046
1047    var pattern = /.{3}$/; // 정규식
1048    return strCar.replace(pattern, "***");
1049}
1050
1051
1052/************************************************************************************************
1053 * 기능 : html 특수문자 없앰
1054 ************************************************************************************************/
1055function strip_tag (str){
1056    return str.replace(/(<([^>]+)>)/ig,"");
1057}
1058
1059/************************************************************************************************
1060 * 기능 : 이메일체크
1061 ************************************************************************************************/
1062function fnCheckEmail(emailValue) {
1063	var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
1064	if(filter.test(emailValue)) {
1065		return true;
1066	} else {
1067		return false;
1068	}
1069}
1070
1071function fnCheckEmail2(title, emailIdNm, emailDoNm) {
1072	//var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
1073//	var re1 = /^([\w-]+(?:\.[\w-]+)*)/i;
1074	var re1 =  /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*$/i;
1075	var re2 = /((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
1076	//var email = fnNmVal(emailIdNm) +'@'+ fnNmVal(emailDoNm);
1077	
1078	
1079	if(re1.test(fnNmVal(emailIdNm)) === false) {
1080		alert(title + fnJosa.c(title,'을/를') + " 확인해 주세요.");
1081		$('#' + emailIdNm).focus();
1082		return false;
1083	}
1084	
1085	if(re2.test(fnNmVal(emailDoNm)) === false) {
1086		alert(title + fnJosa.c(title,'을/를') + " 확인해 주세요.");
1087		$('#' + emailDoNm).focus();
1088		return false;
1089	}
1090	/*
1091	if(re.test(email) === false) {
1092		alert(title + fnJosa.c(title,'을/를') + " 확인해 주세요.");
1093		$('#' + emailIdNm).focus();
1094		return false;
1095	} 
1096	*/
1097	return true;
1098}
1099
1100function fnNmVal(nm) {
1101	return $.trim($('#' + nm).val())||''; 
1102}
1103
1104;var fnJosa = (function(){
1105	var	_f = [
1106		   	      function(string) { //을/를 구분
1107		   	    	  return _hasJong(string) ? '을' : '를';
1108	    
1109		   	      },
1110		   	      function(string){ //은/는 구분
1111		   	    	  return _hasJong(string) ? '은' : '는';
1112		   	      },
1113		   	      function(string){ //이/가 구분
1114		   	    	  return _hasJong(string) ? '이' : '가';
1115		   	      }
1116		   	      ],
1117	   	      
1118		   	      _formats = {
1119								'을/를' : _f[0],
1120								'을' : _f[0],
1121								'를' : _f[0],
1122								'을를' : _f[0],
1123								'은/는' : _f[1],
1124								'은' : _f[1],
1125								'는' : _f[1],
1126								'은는' : _f[1],
1127								'이/가' : _f[2],
1128								'이' : _f[2],
1129								'가' : _f[2],
1130								'이가' : _f[2]
1131					};
1132
1133  
1134	function _hasJong(string){ //string의 마지막 글자가 받침을 가지는지 확인
1135		string = string.charCodeAt(string.length - 1);
1136		return (string - 0xac00) % 28 > 0;
1137  
1138	}
1139	
1140	return {
1141		c: function(word, format){
1142			if (typeof _formats[format] === 'undefined') throw 'Invalid format!';
1143			return _formats[format](word);
1144			
1145		}
1146	};
1147
1148})();
1149
1150function fncfileChK(id,files,mbSize,fixType){
1151	id = $("#"+id);
1152	var fixList = fixTypeList(fixType);
1153	if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) {
1154		var f = files;
1155		if(f!=undefined){
1156			if(f.size < mbSize){
1157				flag2 = true;
1158		  	}else {
1159				customAlert("업로드제한 " + byteCalculation(mbSize) + " 입니다.");
1160				$(id).val('');
1161				$('.upload-name').val('이미지를 등록해주세요.');
1162		  	}
1163		}
1164	}
1165	var pix = $(id).val().split(".")[1].toLowerCase();
1166	if(pix != null){
1167		if(fixList.indexOf(pix) == -1){
1168			customAlert("허용된 확장자 파일이 아닙니다. <br>(jpg, jpeg, gif, png, pdf, heic 등의 이미지 파일로 업로드 해 주세요)");
1169			$(id).val('');
1170			$('.upload-name').val('이미지를 등록해주세요.');
1171		}else{
1172 		flag1 = true;
1173		}
1174	}		  	
1175}
1176
1177function fixTypeList(type){
1178	var result = '';
1179	if(type == 1){
1180		result = "jpg, gif, png, pdf, jpeg, heic";
1181	}else if(type == 2){
1182		result = "pptx, hwp, doc, pdf, xlxs";
1183	}else if(type == 3){
1184		result = "jpg, gif, png, pdf, bmp, pptx, hwp, doc, pdf, xlxs";
1185	}else{
1186		result = type;
1187	}
1188	return result;
1189}
1190
1191function byteCalculation(bytes) {
1192        var bytes = parseInt(bytes);
1193        var s = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
1194        var e = Math.floor(Math.log(bytes)/Math.log(1024));
1195       
1196        if(e == "-Infinity") return "0 "+s[0]; 
1197        else 
1198        return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e];
1199}
1200
1201/**
1202 * 매장 찾기
1203 */
1204function fnDispatcherHtml(url, obj, pType, pData) {
1205	var type = pType == undefined ? "post" : pType;
1206	var data = pData == undefined ? "{}" : pData;
1207	var dataType = "html";
1208	fnAjaxSubmit(url, type, data, dataType, function(data) {
1209		$("#footerPop").html(data);
1210		$("#"+obj)
1211			.modal()
1212			.on('shown.bs.modal', function (e) {
1213				var $this = $(this);
1214				focusControl($this.find('.modal-content'));
1215			})
1216		;
1217	});
1218}
1219
1220/**
1221 * Mobile Device 체크
1222 */
1223function isMobileDevice() {
1224	var pc_device = "win16|win32|win64|mac|macintel";
1225	var this_device = navigator.platform;
1226	var isDevide;
1227	if(this_device) {
1228		if(pc_device.indexOf(navigator.platform.toLowerCase()) == -1) {
1229			isDevide = true;// MOBILE
1230		} else {
1231			isDevide = false;// PC
1232		}
1233	}
1234	return isDevide;
1235}
1236
1237/**
1238 * App function
1239 */
1240function onBackPressed() {
1241	var cur_href = window.location.pathname;
1242	if(cur_href == "/cust/post/myServiceApp.do" || cur_href == "/mmbr/login/login.do" || cur_href == "/mmbr/login/appAutoLogin.do"){
1243		customConfirm("앱을 종료하시겠습니까?", "", function() {finishApp();});
1244		return;
1245	}
1246	
1247	window.history.back();
1248
1249}
1250
1251function finishApp() {
1252    if (window.SK7App) {
1253        window.SK7App.finishApp();
1254    } else if (window.webkit
1255        && window.webkit.messageHandlers
1256        && window.webkit.messageHandlers.SK7App) {
1257        var message = {
1258                command: 'finishApp'
1259            };
1260        window.webkit.messageHandlers.SK7App.postMessage(message);
1261    } 
1262//    else {
1263//		24년 취약점 점검 CWE-489 활성 디버그 코드 제거
1264//      console.log("No native APIs found.");
1265//    }
1266}
1267// 공기계 결제하기 함수
1268function fnPhonePayment(prodCd, refer) {
1269
1270    var form = document.createElement("form");
1271    form.setAttribute("charset", "UTF-8");
1272    form.setAttribute("method", "Post");  //Post 방식
1273    form.setAttribute("action", "/shop/mobile/phonePayment.do"); //요청 보낼 주소
1274    form.setAttribute("id", "createForm"); //폼 Id 
1275    
1276    var hiddenField = document.createElement("input");
1277    hiddenField.setAttribute("type", "hidden");
1278    hiddenField.setAttribute("name", "prodCd");
1279    hiddenField.setAttribute("value", prodCd);
1280    
1281    form.appendChild(hiddenField);
1282
1283    if(refer != undefined) {
1284        form.setAttribute("action", "/shop/mobile/phonePayment.do?refer="+refer); //요청 보낼 주소
1285    }
1286
1287    document.body.appendChild(form);
1288
1289	fnFormSubmit($("#createForm"));
1290}
1291
1292// datepicker
1293function setDateOfDatepicker(el, date) {
1294	$(el).datepicker("setDate", date);
1295}
1296
1297function fnSelAuthTp(type){
1298	$("[id^='dv_auth_']").hide();
1299	$("#dv_auth_"+type).show();
1300	
1301 	if(type.indexOf('Rep') >= 0){
1302 		if(type == "RepX"){
1303	 		$(".certInputRep").show();
1304	 	}else{
1305	 		$(".certInputRep").hide();
1306	 	}
1307 	}else{
1308 		if(type == "X"){
1309	 		$(".certInput").show();
1310	 	}else{
1311	 		$(".certInput").hide();
1312	 	}
1313 	}
1314}
1315
1316function authFail(errMsg){
1317	
1318	if(errMsg == "NOSESSION"){
1319		
1320		if( typeof(fnNoSeSSION) == 'function' ) {
1321			fnNoSeSSION();
1322		} else {
1323			customAlert("장시간 진행이 없어 개인정보보호를 위하여 종료하였습니다.<br> 다시 시도하시기 바랍니다.", '', function() {location.reload();});
1324		}
1325		
1326	}else{
1327		customAlert(errMsg);
1328	}
1329}
1330
1331function XSS_Check(str){
1332	if(!str == "" || !str == undefined){
1333		str = str.replace(/\</g, "&lt;");
1334		str = str.replace(/\</g, "&gt;");
1335	}
1336	return str;
1337}
1338
1339/**
1340 * 2023.08.22 앱 업그레이드(네비게이션 추가, 팝업, 푸시)
1341 * */
1342
1343//1. 메뉴 클릭 시 호출되는 function
1344//* AOS 의 onBackPressed() 호출과 유사합니다.
1345function onMenuClicked() {
1346	// 메뉴 화면 활성화 여부 상태를 앱이 관리하기 어려우므로 웹으로 전달하는 데이터는 없이 호출됩니다.
1347	// 이 function 이 호출되면 웹에서 상태를 확인해 hide/show 처리가 되면 될 듯 합니다.
1348	if(!window.sk7mobile 
1349			|| window.sk7mobile.isOpenMenu == undefined){
1350		window.sk7mobile = {
1351				isOpenMenu:false
1352		};
1353	}
1354	if(!window.sk7mobile.isOpenMenu){
1355		setGtag('모바일GNB','햄버거버튼','메인');
1356		gnbFocus();
1357	}else{
1358		gnbClose();
1359	}
1360};
1361
1362function setCheckMenuItem(isChecked) {
1363var message = {
1364    command: 'setCheckMenuItem',
1365    isChecked: isChecked // true: 메뉴 화면 ON, false: 메뉴 화면 OFF
1366};
1367if (window.SK7App) {
1368    window.SK7App.setCheckMenuItem(JSON.stringify(message));
1369} else if (window.webkit
1370    && window.webkit.messageHandlers
1371    && window.webkit.messageHandlers.SK7App) {
1372    window.webkit.messageHandlers.SK7App.postMessage(message);
1373} 
1374//else {
1375//	24년 취약점 점검 CWE-489 활성 디버그 코드 제거
1376//  console.log("No native APIs found.");
1377//}
1378} 
1379
1380
1381//2. 디바이스 정보 가져오기
1382function getDeviceInfo() {
1383	var message = {
1384	    command: 'getDeviceInfo',
1385	    callback: onDeviceInfoReceived.name
1386	};
1387	if (window.SK7App) {
1388	    window.SK7App.getDeviceInfo(JSON.stringify(message));
1389	} else if (window.webkit
1390	    && window.webkit.messageHandlers
1391	    && window.webkit.messageHandlers.SK7App) {
1392	    window.webkit.messageHandlers.SK7App.postMessage(message);
1393	} 
1394//	else {
1395//		24년 취약점 점검 CWE-489 활성 디버그 코드 제거
1396//	    console.log("No native APIs found.");
1397//	}
1398}
1399
1400//디바이스 정보 Callback function
1401function onDeviceInfoReceived(deviceInfo) {
1402	/* ex:
1403	    {
1404	        "carrier": "T-Mobile", // 통신사 정보
1405	        "deviceModel": "sdk_gphone64_arm64", // 단말 모델명
1406	        "os": "android",
1407	        "osVersion": 34,
1408	        "pushToken": "d8SQmdFmRBKrj..."
1409	    }
1410	*/
1411}
1412
1413//3. PUSH 토큰 가져오기
1414function getPushToken() {
1415	var message = {
1416	    command: 'getPushToken',
1417	    callback: onPushTokenReceived.name
1418	};
1419	if (window.SK7App) {
1420	    window.SK7App.getPushToken(JSON.stringify(message));
1421	} else if (window.webkit
1422	    && window.webkit.messageHandlers
1423	    && window.webkit.messageHandlers.SK7App) {
1424	    window.webkit.messageHandlers.SK7App.postMessage(message);
1425	} 
1426//	else {
1427//		24년 취약점 점검 CWE-489 활성 디버그 코드 제거
1428//	    console.log("No native APIs found.");
1429//	}
1430}
1431
1432//PUSH 토큰 callback function
1433function onPushTokenReceived(result) {
1434//	24년 취약점 점검 CWE-489 활성 디버그 코드 제거
1435//	console.log(JSON.stringify(result));
1436	/* ex:
1437	    {
1438	       "code": 0, // 0: SUCCESS, -1: FAULED
1439	       "fcm_token": "d8SQmdFmRBKrjitBK..."
1440	    }
1441	*/
1442}
1443
1444//PUSH data callback function
1445function onPushDataReceived(pushData) {
1446	var form = document.createElement('form');
1447	form.setAttribute('method','POST');
1448	form.setAttribute('action','/push/readPush.do');
1449	
1450	var pushDataInput = document.createElement('input');
1451	pushDataInput.setAttribute('type','hidden');
1452	pushDataInput.setAttribute('name','readSeq');
1453	pushDataInput.setAttribute('value',pushData.readSeq);
1454	form.appendChild(pushDataInput);
1455	
1456	document.body.appendChild(form);
1457	form.submit();
1458	/*
1459    console.log("data payload: " + JSON.stringify(data));
1460     ex: {
1461        "image": "https://www.sk7mobile.com/telink/upload/banner/1784/2307181823513393160.jpg",
1462        "message": "Body SK 세븐모바일 제휴처, 어디서 가입해도 혜택은 항상 최대치!, SK 세븐모바일 제휴처, 어디서 가입해도 혜택은 항상 최대치!",
1463        "readSeq": "ylD1R1w7/SkWiF6RaKRJnw==",
1464        "title": "Title SK 세븐모바일 제휴처, 어디서 가입해도 혜택은 항상 최대치!",
1465        "view": "https://www-stg.sk7mobile.com:38889/bnef/event/eventIngView.do?cntId=001012fb780a258336607b7751ef04dc&refer=main"
1466    }
1467    */
1468}
1469
1470/*
1471function formatInputDate(dateInput) { // 날짜 형식 key-in 기능 개선
1472	
1473	if(event && event.keyCode == 8) { // backspace인 경우는 그대로 진행 
1474		return true;
1475	}
1476	
1477	if(!onlyNumber(event) && event.key != '-') {
1478		dateInput.value = dateInput.value.replace(/[^0-9\-]/g, "");
1479		return false;
1480	}
1481
1482	var dateValue = dateInput.value.replace(/[^0-9]/g, "");
1483	console.log('formatInputDate!! = ' + JSON.stringify(dateValue));
1484	if(dateValue) {
1485		var formatted = "";
1486		if(dateValue.length < 4) {
1487			return dateValue;
1488		} else if(dateValue.length < 6) {
1489			formatted = dateValue.substr(0, 4);
1490			formatted += "-";
1491			formatted += dateValue.substr(4);
1492		} else {
1493			formatted = dateValue.substr(0, 4);
1494			formatted += "-";
1495			formatted += dateValue.substr(4, 2);
1496			formatted += "-";
1497			formatted += dateValue.substr(6);
1498		}
1499		dateInput.value = formatted;
1500	}
1501}
1502*/
1503function formatDate(input) {
1504    var cursorPosition = input.selectionStart;
1505    var oldValue = input.value;
1506    var value = oldValue.replace(/[^0-9]/g, '');
1507    
1508    var formatted = '';
1509    if (value.length > 0) {
1510        formatted = value.substring(0, 4);
1511    }
1512    if (value.length >= 5) {
1513        formatted += '-' + value.substring(4, 6);
1514    }
1515    if (value.length >= 7) {
1516        formatted += '-' + value.substring(6, 8);
1517    }
1518    
1519    if (formatted !== oldValue) {
1520        input.value = formatted;
1521        
1522        // 커서 위치 재조정
1523        var dashesBeforeCursor = (oldValue.substring(0, cursorPosition).match(/-/g) || []).length;
1524        var dashesAfterFormat = (formatted.substring(0, cursorPosition).match(/-/g) || []).length;
1525        var newCursorPosition = cursorPosition + (dashesAfterFormat - dashesBeforeCursor);
1526        
1527        input.setSelectionRange(newCursorPosition, newCursorPosition);
1528    }
1529}

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.