PageSourceSearch

https://kosakamall.com/app/javascript/js/front-layout.js?dummy=20261005164913

js kosakamall.com collected 2026-10-05 07:49:52 UTC 56,349 bytes, 1,421 lines download raw bytes

1$(function(){
2
3	/* 스크롤바 커스터마이징 */
4	$(".customScrolling").each(function(){
5		$(this).wrapInner("<div class='customScrollingContent' />");
6		$(this).children(".customScrollingContent")
7		.css({
8			overflow : 'hidden',
9			height : $(this).height()
10		})
11		.jScrollPane({
12			scrollbarMargin:	15	// spacing between text and scrollbar
13		,	scrollbarWidth:		15
14		,	arrowSize:			0
15		,	showArrows:			true
16		});
17	});
18
19	/* 사이드 날개 배너 무빙 처리 */
20	$("#leftScrollLayer,#rightScrollLayer").each(function(){
21		var scrollLayerTopMargin = 10;
22		var scrollLayerObj = $(this);
23		var defaultScrollLayerTop = parseInt(scrollLayerObj.offset().top);
24		var defaultMarginLeft = parseInt($(this).css('margin-left'));
25		var divisionHiddenLayer = $("<div></div>").css({
26			'position':'absolute',
27			'margin-top':$(this).css('margin-top'),
28			'margin-left':$(this).css('margin-left'),
29			'margin-bottom':$(this).css('margin-bottom'),
30			'margin-right':$(this).css('margin-right'),
31			'padding-top':$(this).css('padding-top'),
32			'padding-left':$(this).css('padding-left'),
33			'padding-bottom':$(this).css('padding-bottom'),
34			'padding-right':$(this).css('padding-right'),
35			'padding':$(this).css('padding'),
36			'width':$(this).width(),
37			'height':$(this).height(),
38			'z-index':1
39		});
40
41		$(window).scroll(function(){
42			var scrollTop = parseInt($(document).scrollTop());
43
44			if(scrollTop>defaultScrollLayerTop-scrollLayerTopMargin)
45			{
46				if((typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light')){
47					marginleftdefault = defaultMarginLeft;
48				}else{
49					var scrollLeft = parseInt($(document).scrollLeft());
50					var marginleftdefault = (defaultMarginLeft-scrollLeft);
51				}
52				scrollLayerObj.after(divisionHiddenLayer.show());
53				scrollLayerObj.css({
54					'position' : 'fixed',
55					'z-index' : 6,
56					'margin-top' : scrollLayerTopMargin,
57					'margin-left' : marginleftdefault+'px'
58				});
59			}
60			else
61			{
62				scrollLayerObj.css({
63					'position' : 'absolute',
64					'margin-top' : '0px',
65					'margin-left' : defaultMarginLeft+'px'
66				});
67				divisionHiddenLayer.hide();
68			}
69		});
70	});
71
72	/* 디자인팝업 쿠키처리 */
73	$(".designPopup").each(function(){
74		var popup = this;
75		var popupStyle = $(popup).attr('popupStyle');
76		var popupSeq = $(popup).attr('popupSeq');
77		var popupKey = "designPopup"+popupSeq;
78
79		if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
80			$("#designPopupModalBack").remove();
81			$("<div id='designPopupModalBack'></div>").css({'background':'#000000','position':'fixed','left':'0px','top':'0px','width':'100%','height':'100%','opacity':'0.5','z-index':'99'}).appendTo($('#layout_wrap'));
82		}else if(typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0){
83			$(this).css({
84				'left' : 'calc(50% - '+($(this).width()/2)+'px)'
85			});
86			if(num($(this).css('left'))==0){
87				$(this).css({
88				'left' : '50%',
89				'margin-left' : '-' + ($(this).width()/2) + 'px'
90				});
91			}
92			$("#designPopupModalBack").remove();
93			$("<div id='designPopupModalBack'></div>").css({'background':'#000000','position':'fixed','left':'0px','top':'0px','width':'100%','height':'100%','opacity':'0.5','z-index':'99'}).appendTo($('#layout_wrap'));
94		}
95
96		$(".designPopupClose",popup).click(function(){
97			if(popupStyle=='layer')		{$(popup).fadeOut();popupModalRemove();}
98			if(popupStyle=='window')	window.close();
99		});
100		$(".designPopupTodaymsg",popup).click(function(){
101			var timestamp = parseInt(new Date().getTime().toString().substring(0, 10));
102			$.cookie(popupKey,timestamp,{expires:1,path:'/'}); // expires : 日단위
103			if(popupStyle=='layer')		{$(popup).fadeOut();popupModalRemove();}
104			if(popupStyle=='window')	window.close();
105		});
106		if(popupStyle=='layer' && (!(typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'))){
107			$(".designPopupBar",popup).css("cursor","move");
108			$(this).draggable({handle: $(".designPopupBar",popup)});
109		}
110	});
111
112	/* 디자인팝업 띠배너 */
113	$(".designPopupBand").each(function(i){
114		// 첫번째를 제회한 나머지는 제거
115		if(i) {
116			$(this).remove();
117			return;
118		}
119
120		var popup = this;
121		var popupStyle = $(popup).attr('popupStyle');
122		var popupSeq = $(popup).attr('popupSeq');
123		var popupKey = "designPopup"+popupSeq;
124		var popup_cookie = $.cookie(popupKey);
125
126		if(popup_cookie){
127			$(popup).prependTo('body');
128			$(".designPopupBandBtn").eq(i).prependTo('body').fadeIn();
129		}else{
130			$(popup).prependTo('body').slideDown();
131		}
132		resp_loc_top = $(".designPopupBand .designPopupBody").outerHeight(); // 반응형 모바일 크기에서 로고바 플라잉을 위한 값 연동
133
134		$(".designPopupClose",popup).click(function(){
135			var timestamp = parseInt(new Date().getTime().toString().substring(0, 10));
136			$.cookie(popupKey,timestamp,{expires:1,path:'/'}); // expires : 日단위
137			$(popup).slideUp(function(){
138				$(".designPopupBandBtn").eq(i).prependTo('body').fadeIn();
139			});
140		});
141	});
142	$(".designPopupBandBtn").each(function(i){
143		// 첫번째를 제회한 나머지는 제거
144		if(i) {
145			$(this).remove();
146			return;
147		}
148
149		var btn = this;
150
151		$(this).click(function(){
152			$(btn).hide();
153			$(".designPopupBand").eq(i).slideDown();
154		});
155	});
156
157	/* 디자인팝업 모바일띠배너 */
158	$(".designPopupBandMobile").each(function(i){
159		// 첫번째를 제회한 나머지는 제거
160		if(i) {
161			$(this).remove();
162			return;
163		}
164
165		var popup = this;
166		var popupStyle = $(popup).attr('popupStyle');
167		var popupSeq = $(popup).attr('popupSeq');
168		var popupKey = "designPopup"+popupSeq;
169
170		$(popup).prependTo('body').show();
171		$(".designPopupClose",popup).click(function(){
172			var timestamp = parseInt(new Date().getTime().toString().substring(0, 10));
173			$.cookie(popupKey,timestamp,{expires:1,path:'/'}); // expires : 日단위
174			$(popup).slideUp();
175		});
176	});
177
178	/* 오늘본상품 스크롤 : 바인드 */
179	if ($(".scrollItemContainer").length > 0) {
180		setTodayGoodsScroll();
181	} else if($(".rightQuickMenu").length > 0) {
182		/* 우측퀵메뉴 기능개선 leewh 2014-06-03 */
183		$(window).load(function () {
184			setRightMenu();
185		});
186	}
187
188	/* 상품디스플레이 탭 스크립트 */
189	$(".displayTabContainer").each(function(){
190		var tabContainerObj = $(this);
191		var displayObj = tabContainerObj.closest('.designDisplay, .designCategoryRecommendDisplay, .designBrandRecommendDisplay, .designLocationRecommendDisplay');
192		var displaySeq = displayObj.attr('displaySeq');
193		var page = displayObj.attr('page');
194		var perpage = displayObj.attr('perpage');
195		var bindEvent = 'mouseover click';
196		if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light') bindEvent = 'click';
197
198		$(".displayTabContentsContainer",displayObj).wrap("<div class='displayTabContentsContainerWrap' />");
199
200		displayObj.addClass('slide-wrap'); // for swipe
201
202		tabContainerObj.children('li').bind(bindEvent,function(){
203			var tabIdx = tabContainerObj.children('li').index(this);
204			try{
205				$(displayObj).data('slide_current', tabIdx);//for swipe
206			}catch(e){};
207
208			var prevContentsHeight = displayObj.find('.displayTabContentsContainer:visible').height();
209
210			displayObj.find('.displayTabContentsContainerWrap').removeClass('active').hide().eq(tabIdx).addClass('active').show();
211			displayObj.find('.displayTabContentsContainer').hide().eq(tabIdx).show();
212
213			displayObj.find('.displayTabContainer>li').find("img.displayTabItemImageOff").show();
214			displayObj.find('.displayTabContainer>li').find("img.displayTabItemImageOn").hide();
215			displayObj.find('.displayTabContainer>li').eq(tabIdx).find("img.displayTabItemImageOff").hide();
216			displayObj.find('.displayTabContainer>li').eq(tabIdx).find("img.displayTabItemImageOn").show();
217
218			if(tabIdx==0) return;
219
220			var displayTabContentsContainerWrap = displayObj.find('.displayTabContentsContainerWrap').eq(tabIdx);
221
222			if(!displayTabContentsContainerWrap.attr('ajaxLoaded')){
223				displayTabContentsContainerWrap.attr('ajaxLoaded',true);
224				displayTabContentsContainerWrap.children(".displayTabContentsContainer").height(prevContentsHeight);
225				displayTabContentsContainerWrap.children(".displayTabContentsContainer").attr("id","displayTabLoading_"+displaySeq+"_"+tabIdx).css('min-height','100px').height(prevContentsHeight);
226				loadingStart("#displayTabLoading_"+displaySeq+"_"+tabIdx,{'color':'#000000'});
227				var params = {'display_seq':displaySeq,'tab_index':tabIdx, 'page':page, 'perpage':perpage, 'display_ajax_call' : true};
228				if(displayObj.hasClass('designCategoryRecommendDisplay'))	params['category'] = displayObj.attr('category');
229				if(displayObj.hasClass('designLocationRecommendDisplay'))	params['location'] = displayObj.attr('location');
230				if(displayObj.hasClass('designBrandRecommendDisplay'))		params['brand'] = displayObj.attr('brand');
231				$.ajax({
232					'global' : false,
233					'url' : '/goods/design_display_tab',
234					'type' : 'post',
235					'data' : params,
236					'success' : function(res){
237						loadingStop("#displayTabLoading_"+displaySeq+"_"+tabIdx);
238						displayTabContentsContainerWrap.html(res);
239						displayTabContentsContainerWrap.children().not(".displayTabContentsContainer").remove();
240						displayTabContentsContainerWrap.find(".displayTabContentsContainer").addClass('displayTabContentsContainerBox');
241						if(displayTabContentsContainerWrap.is(":visible")) {
242							try{
243								set_goods_display_decoration($(".goodsDisplayImageWrap",displayTabContentsContainerWrap));
244								set_goods_display_decoration_event($(".goodsDisplayImageWrap",displayTabContentsContainerWrap));
245							}catch(e){};
246						}
247						try{
248							FB.XFBML.parse($(tabContainerObj).get(1));
249						}catch(ex){}
250						echo.init({
251							offset: 100,
252							throttle: 250,
253							unload: false
254						});
255					},
256					'complete' : function() {
257						displayObj.find('.displayTabContentsContainer').hide().eq(tabIdx).show();
258						// 탭 상품 콘텐츠에 컬러코드가 사용된 경우 디자인 스크립트 추가 190219 - sjg
259						if ( $('.displayTabContentsContainerWrap .displaY_color_option').length > 0 ) {
260							$('.displayTabContentsContainerWrap .displaY_color_option .areA').filter(function() {
261								return ( $(this).css('background-color') == 'rgb(255, 255, 255)' );
262							}).addClass('border');
263						}
264					}
265				});
266			}else{
267				try{set_goods_display_decoration($(".goodsDisplayImageWrap",displayTabContentsContainerWrap));}catch(e){};
268			}
269		});
270	});
271
272	/* 상품디스플레이 newswipe형 탭 스크립트 */
273	$(".displaySwipeTabContainer").each(function(){
274		var tabContainerObj = $(this);
275		var displayObj = tabContainerObj.closest('.designDisplay, .designCategoryRecommendDisplay, .designBrandRecommendDisplay, .designLocationRecommendDisplay, .designGoodsRelationDisplay, .designGoodsBigdataDisplay');
276		var displaySeq = displayObj.attr('displaySeq');
277		$(".displaySwipeTabContentsContainer",displayObj).each(function(){
278			$(this).wrap("<div class='displaySwipeTabContentsContainerWrap slide' tabIdx='"+$(this).attr("tabIdx")+"' />");
279		});
280
281		displayObj.addClass('slide-wrap'); // for swipe
282
283		$(".custom_mobile_pagination",displayObj).customMobilePagination({
284			'style' : $(".custom_mobile_pagination",displayObj).attr('pagingStyle'),
285			'max_page' : displayObj.find('.displaySwipeTabContentsContainerWrap').length-1,
286			'now_page' : 1,
287			'on_prev' : function(){
288				var currentTabContentsIdx = $(displayObj).data('currentTabContentsIdx') ? $(displayObj).data('currentTabContentsIdx') : 0;
289				var maxTabContentdIdx = displayObj.find('.displaySwipeTabContentsContainerWrap').length-1;
290				chgSlideNewSwipe(currentTabContentsIdx==0?maxTabContentdIdx:currentTabContentsIdx-1,displayObj);
291			},
292			'on_next' : function(){
293				var currentTabContentsIdx = $(displayObj).data('currentTabContentsIdx') ? $(displayObj).data('currentTabContentsIdx') : 0;
294				var maxTabContentdIdx = displayObj.find('.displaySwipeTabContentsContainerWrap').length-1;
295				chgSlideNewSwipe(currentTabContentsIdx==maxTabContentdIdx?0:currentTabContentsIdx+1,displayObj);
296
297			},
298			'on_page' : function(page){
299				var tabIdx = $(displayObj).find(".displaySwipeTabContainer>li").index($(displayObj).find(".displaySwipeTabContainer>li.current"));
300				var newTabContentsIdx = $(displayObj).find(".displaySwipeTabContentsContainer").index($(displayObj).find(".displaySwipeTabContentsContainerWrap[tabIdx='"+tabIdx+"'] .displaySwipeTabContentsContainer").eq(page-1));
301				chgSlideNewSwipe(newTabContentsIdx,displayObj);
302			}
303		});
304
305		tabContainerObj.children('li').bind('mouseover click',function(){
306			var currentTabIdx = $(displayObj).data('currentTabIdx') ? $(displayObj).data('currentTabIdx') : 0;
307			var currentTabContentsIdx = $(displayObj).data('currentTabContentsIdx') ? $(displayObj).data('currentTabContentsIdx') : 0;
308			var tabIdx = tabContainerObj.children('li').index(this);
309			try{
310				$(displayObj).data('currentTabIdx', tabIdx);//for swipe
311			}catch(e){};
312
313			if($(displayObj).data('newTabContentsIdx') != 'undefined'){
314				if(displayObj.find('.displaySwipeTabContentsContainerWrap').eq($(displayObj).data('newTabContentsIdx')).attr("tabIdx")==tabIdx){
315					var newTabContentsIdx = $(displayObj).data('newTabContentsIdx');
316				}else{
317					var newTabContentsIdx = displayObj.find(".displaySwipeTabContentsContainer").index(displayObj.find(".displaySwipeTabContentsContainerWrap[tabIdx='"+tabIdx+"'] .displaySwipeTabContentsContainer:first-child"));
318				}
319			}else{
320				var newTabContentsIdx = displayObj.find(".displaySwipeTabContentsContainer").index(displayObj.find(".displaySwipeTabContentsContainerWrap[tabIdx='"+tabIdx+"'] .displaySwipeTabContentsContainer:first-child"));
321			}
322
323			$(displayObj).data('slide_current',newTabContentsIdx);
324
325			var prevContentsHeight = displayObj.find('.displaySwipeTabContentsContainerWrap:visible .displaySwipeTabContentsContainer').height();
326
327			displayObj.find('.displaySwipeTabContentsContainerWrap').removeClass('active').hide().eq(newTabContentsIdx).addClass('active').show();
328			displayObj.find('.displaySwipeTabContentsContainer').hide().eq(newTabContentsIdx).show();
329
330			displayObj.find('.displaySwipeTabContainer>li').find("img.displaySwipeTabItemImageOff").show();
331			displayObj.find('.displaySwipeTabContainer>li').find("img.displaySwipeTabItemImageOn").hide();
332			displayObj.find('.displaySwipeTabContainer>li').eq(tabIdx).find("img.displaySwipeTabItemImageOff").hide();
333			displayObj.find('.displaySwipeTabContainer>li').eq(tabIdx).find("img.displaySwipeTabItemImageOn").show();
334
335			// 페이징 숫자 변경
336			var max_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+tabIdx+"']").length;
337			var now_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+tabIdx+"']").index($(displayObj).find(".displaySwipeTabContentsContainer").eq(newTabContentsIdx))+1;
338			$(".custom_mobile_pagination",displayObj).customMobilePagination("set_page",{
339				'max_page' : max_page,
340				'now_page' : now_page
341			});
342
343			if(tabIdx==0) return;
344
345			var displaySwipeTabContentsContainerWrap = displayObj.find('.displaySwipeTabContentsContainerWrap').eq(newTabContentsIdx);
346
347			if(!displaySwipeTabContentsContainerWrap.attr('ajaxLoaded')){
348				displaySwipeTabContentsContainerWrap.attr('ajaxLoaded',true);
349				displaySwipeTabContentsContainerWrap.children(".displaySwipeTabContentsContainer").height(prevContentsHeight);
350				displaySwipeTabContentsContainerWrap.children(".displaySwipeTabContentsContainer").attr("id","displaySwipeTabLoading_"+displaySeq+"_"+newTabContentsIdx).css('min-height','100px').height(prevContentsHeight);
351				loadingStart("#displaySwipeTabLoading_"+displaySeq+"_"+newTabContentsIdx,{'color':'#000000'});
352				var params = {'display_seq':displaySeq,'tab_index':tabIdx, 'display_ajax_call' : true};
353				if(displayObj.hasClass('designCategoryRecommendDisplay'))	params['category'] = displayObj.attr('category');
354				if(displayObj.hasClass('designLocationRecommendDisplay'))	params['location'] = displayObj.attr('location');
355				if(displayObj.hasClass('designBrandRecommendDisplay'))		params['brand'] = displayObj.attr('brand');
356				$.ajax({
357					'global' : false,
358					'url' : '/goods/design_display_tab',
359					'async' : false,
360					'type' : 'post',
361					'data' : params,
362					'success' : function(res){
363						loadingStop("#displaySwipeTabLoading_"+displaySeq+"_"+newTabContentsIdx);
364
365						displaySwipeTabContentsContainerWrap.html(res);
366						displaySwipeTabContentsContainerWrap.children().not(".displaySwipeTabContentsContainer").remove();
367						$(".displaySwipeTabContentsContainer:gt(0)",displaySwipeTabContentsContainerWrap).each(function(){
368							$(this).wrap("<div class='displaySwipeTabContentsContainerWrap slide' ajaxLoaded='true' tabIdx='"+$(this).attr("tabIdx")+"' />");
369						});
370						displaySwipeTabContentsContainerWrap.after(displaySwipeTabContentsContainerWrap.children(".displaySwipeTabContentsContainerWrap"));
371
372						setSlideSwipe(displayObj, '.displaySwipeTabContentsContainerWrap','chgSlideNewSwipe');
373
374						// 페이징 숫자 변경
375						var max_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+tabIdx+"']").length;
376						var now_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+tabIdx+"']").index($(displayObj).find(".displaySwipeTabContentsContainer").eq(newTabContentsIdx))+1;
377						$(".custom_mobile_pagination",displayObj).customMobilePagination("set_page",{
378							'max_page' : max_page,
379							'now_page' : now_page
380						});
381
382						try{
383							set_goods_display_decoration($(".goodsDisplayImageWrap",displayObj));
384							FB.XFBML.parse($(tabContainerObj).get(1));
385						}catch(ex){}
386
387						echo.init({
388							offset: 100,
389							throttle: 250,
390							unload: false
391						});
392					}
393				});
394			}else{
395				try{set_goods_display_decoration($(".goodsDisplayImageWrap",displaySwipeTabContentsContainerWrap));}catch(e){};
396			}
397		});
398	});
399
400	// 자동 로그인 설정 시간대로 로그아웃
401	if (Firstmall.Config.Security.MemberLogoutLimit !== false && Firstmall.Config.Environment.isUser === true) {
402		var initDate = new Date();
403		var resetTime = new Array();
404		var timerchecker = null;
405	
406		resetTime.minutes = Firstmall.Config.Security.MemberLogoutLimit;	// 관리자 설정 시간
407		resetTime.seconds = resetTime.minutes * 60;							// ex) 60분 > 3600초
408		initTimer=function(){
409			//이벤트 발생 체크
410			if(window.event){
411				initDate = new Date();
412				clearTimeout(timerchecker);
413			}
414	
415			remainTime = new Date() - initDate;				// 남은 시간 (현재 시간 - 초기 시간)
416			remainTime = parseInt(remainTime/1000);			// seconds
417	
418			// 움직임 없는 시간이 resetTime.seconds 보다 큰 경우 로그아웃
419			if( remainTime < resetTime.seconds) {
420				timerchecker = setTimeout("initTimer()", 5000);
421			} else {
422				clearTimeout(timerchecker);
423				actionFrame.location.href = "/login_process/logout"; // 로그아웃 처리
424			}
425		}
426		onload = initTimer;///현재 페이지 대기시간
427		document.onclick = initTimer; /// 현재 페이지의 사용자 마우스 클릭이벤트 캡춰
428		document.onkeydown = initTimer;/// 현재 페이지의 키보트 입력이벤트 캡춰
429	}
430
431	try{
432		if((typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'))
433		$(".designDisplay, .designCategoryRecommendDisplay, .designBrandRecommendDisplay, .designLocationRecommendDisplay, .designGoodsRelationDisplay, .designGoodsBigdataDisplay").each(function(){
434			if($(this).attr("displayStyle")=="newswipe"){
435				setSlideSwipe(this, '.displaySwipeTabContentsContainerWrap','chgSlideNewSwipe');
436			}else{
437				setSlideSwipe(this, '.displayTabContentsContainerWrap','chgSlideSwipe');
438			}
439		});
440	}catch(e){};
441
442	/* 비교통화 마우스 오버/아웃 */
443	$(".price_cell").on("mouseover",function(){
444		$(".currency_list",this).show();
445	});
446
447	$(".price_cell").on("mouseout",function(){
448		$(".currency_list",this).hide();
449	});
450
451	$(".calendar_list").find("li:eq(3) > a").trigger('click');
452
453	// 앱 설치 권장 팝업 - 하루동안 열지 않기 버튼 이벤트
454	$(".popup_style_close_day").on("click", function(e) {
455		var timestamp = parseInt(new Date().getTime().toString().substring(0, 10));
456		$.cookie('appsettingpopup',timestamp,{expires:1,path:'/'});
457		$('.appPopupBody').fadeOut();
458		$('#appPopupModalBack').remove();
459	});
460	// 앱 설치 권장 팝업 - 기본 닫기 버튼 이벤트
461	$(".popup_style_close").on("click", function(e) {
462		$('.appPopupBody').fadeOut();
463		$('#appPopupModalBack').remove();
464	});
465	// 앱 설치 권장 팝업 - 앱 설치 영역 클릭 이벤트
466	$(".appPopupBody").find(".cont, .m_btn1, .popWrap > img").on("click", function(e) {
467		var storeUrl = $(this).closest(".appPopupBody").attr("data-app-store-url");
468		// 팝업 차단 등으로 새 창을 열지 못하면 현재 창에서 이동
469		if (storeUrl && !window.open(storeUrl, "_blank")) {
470			location.href = storeUrl;
471		}
472	});
473});
474
475function popupModalRemove() {
476	var popupShow = 0;
477	var popupDisplay = '';
478
479	$(".designPopup").each(function(i){
480		// fadeOut 0.4초 소요되어 바로 none 처리 안됨 따라서 하나만 display block 일때 remove 처리 2017-12-18
481		popupDisplay = $(this).css('display');
482		if ( popupDisplay == 'block') {
483			popupShow++;
484		}
485	});
486	if ( popupShow == 1) {
487		$("#designPopupModalBack").remove();
488	}
489}
490
491function chgSlideSwipe(i,wrap_name){
492	var slide_current = $(wrap_name).data('slide_current');
493	var currentTabContentsObj = $(wrap_name).find(".displayTabContentsContainer").eq(i);
494	var currentTabContentsIdx = currentTabContentsObj.closest(wrap_name).find(".displayTabContentsContainer").index(currentTabContentsObj);
495
496	var displayObj = $(wrap_name).find(".displayTabContentsContainer").eq(currentTabContentsIdx).closest(wrap_name);
497	$("ul.displayTabContainer>li",displayObj).eq(currentTabContentsIdx).click();
498	$("ul.displayTabContainer>li",displayObj).eq(slide_current).removeClass('slide_current').eq(currentTabContentsIdx).addClass('slide_current');
499	$(".displayTabContentsContainer.active",displayObj).removeClass('active').eq(currentTabContentsIdx).addClass('slide_current');
500
501	$(wrap_name).data('slide_current',i);
502}
503
504function chgSlideNewSwipe(i,wrap_name){
505	var currentTabIdx = $(wrap_name).data('currentTabIdx');
506	var newTabContentsObj = $(wrap_name).find(".displaySwipeTabContentsContainer").eq(i);
507	var newTabContentsIdx = newTabContentsObj.closest(wrap_name).find(".displaySwipeTabContentsContainer").index(newTabContentsObj);
508	var newTabIdx = newTabContentsObj.attr("tabIdx");
509
510	$(wrap_name).data('slide_current',i)
511
512	var displayObj = $(wrap_name).find(".displaySwipeTabContentsContainer").eq(newTabContentsIdx).closest(wrap_name);
513	if(currentTabIdx != newTabIdx){
514		$(displayObj).data('newTabContentsIdx',newTabContentsIdx);
515		$("ul.displaySwipeTabContainer>li",displayObj).eq(newTabIdx).click();
516		$("ul.displaySwipeTabContainer>li",displayObj).eq(currentTabIdx).removeClass('currentTabIdx').eq(newTabIdx).addClass('currentTabIdx');
517	}else{
518		displayObj.find('.displaySwipeTabContentsContainerWrap').removeClass('active').hide().eq(newTabContentsIdx).addClass('active').show();
519		displayObj.find('.displaySwipeTabContentsContainer').hide().eq(newTabContentsIdx).show();
520	}
521	$(".displaySwipeTabContentsContainer.active",displayObj).removeClass('active').eq(newTabContentsIdx).addClass('currentTabIdx');
522
523	$(wrap_name).data('currentTabIdx',newTabIdx).data('currentTabContentsIdx',newTabContentsIdx);
524
525	// 페이징 숫자 변경
526	var max_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+newTabIdx+"']").length;
527	var now_page = $(displayObj).find(".displaySwipeTabContentsContainer[tabIdx='"+newTabIdx+"']").index($(displayObj).find(".displaySwipeTabContentsContainer").eq(newTabContentsIdx))+1;
528	$(".custom_mobile_pagination",displayObj).customMobilePagination("set_page",{
529		'max_page' : max_page,
530		'now_page' : now_page
531	});
532
533}
534
535/* 즐겨찾기 마일리지추가여부 */
536function bookmarksitelay(url,title, return_url) {
537	$.ajax({
538		type: "post",
539		url: "/common/bookmark",
540		async:false,
541		dataType: 'json',
542		success: function(result){
543			if(result.result == false){
544				if(result.type == 'login'){
545					openDialogConfirm(result.msg,'400','160',function(){document.location.href=return_url},function(){bookmarksite(url,title);});
546				}else{
547					openDialogAlert(result.msg,'400','160',function(){bookmarksite(url,title);});
548				}
549			}else{
550				openDialogAlert(result.msg,'400','160',function(){bookmarksite(url,title);});
551			}
552		}
553	});
554}
555
556/* 즐겨찾기 추가 스크립트 */
557function bookmarksite(url,title) { 
558	// Internet Explorer
559	if(window.external && ('AddFavorite' in window.external)){
560		window.external.AddFavorite(url, title); 
561	}
562	// Google Chrome, Fire Fox, Opera, Safari
563	else
564	{
565		//Ctrl+D키를 누르시면 즐겨찾기에 추가하실 수 있습니다.
566		alert(getAlert('et118'));
567		return false;
568	}
569}
570
571
572
573/* 오늘본상품 스크롤 : 바인드 */
574function setTodayGoodsScroll(){
575	var scrollItemViewCnt = 4;		// 한번에 보일 상품개수
576	var scrollItemImageMaxWidth = 40;	// 상품이미지 최대가로크기
577	var scrollItemImageMaxHeight = 60;	// 상품이미지 최대세로크기
578	var scrollItemImageGap = 5;		// 사품이미지 간격
579
580	$(".scrollItemContainer").each(function(){
581		if($(this).data('scrollSetted')){
582			unsetTodayGoodsScroll(this);
583		}
584
585		var scrollItemContainerObj = this;
586		var goodsCnt = $(".scrollItemGoods",this).length;
587		var firstGoodsIdx = 0;
588
589		// 상품이미지 사이즈맞춤
590		var scrollItemImageWidth = $(".scrollItemGoodsImg",this).width();
591		var scrollItemImageHeight = $(".scrollItemGoodsImg",this).height();
592		if(scrollItemImageWidth) scrollItemImageMaxWidth = scrollItemImageWidth;
593		if(scrollItemImageHeight) scrollItemImageMaxHeight = scrollItemImageHeight;
594		$(".scrollItemGoodsImg",this).css({'max-width':scrollItemImageMaxWidth,'max-height':scrollItemImageMaxHeight});
595		$(".scrollItemGoodsImg",this).css({'width':scrollItemImageWidth});
596		$(".scrollItemGoodsImg",this).css('margin-top',scrollItemImageGap);
597		$(".scrollItemGoods",this).css({"height":scrollItemImageHeight+scrollItemImageGap,"overflow":"hidden"});
598
599		$(".scrollItemGoodsImg",this).each(function(){
600			if($(this).height()<scrollItemImageHeight){
601				var mrgn = (scrollItemImageHeight-$(this).height())/2;
602				$(this).css({'margin-top':'+='+mrgn,'margin-bottom':'+='+mrgn});
603			}
604		});
605
606		// 전체높이
607		var scrollItemListHeight = (scrollItemImageHeight+scrollItemImageGap)*(goodsCnt<scrollItemViewCnt ? goodsCnt : scrollItemViewCnt);
608
609		$(".scrollItemList",this).css({'overflow':'hidden','height':scrollItemListHeight});
610
611		if(goodsCnt<scrollItemViewCnt) scrollItemViewCnt = goodsCnt;
612		if(goodsCnt>scrollItemViewCnt){
613			$(".scrollItemList",this).append($(".scrollItemGoods",this).clone());
614			var scrollItemListCnt = goodsCnt*2;
615
616			$(".scrollItemArrowUp",this).bind("click",function(){
617				firstGoodsIdx -= scrollItemViewCnt;
618				if(firstGoodsIdx<scrollItemViewCnt-1) {
619					firstGoodsIdx+=goodsCnt;
620					$(".scrollItemList",scrollItemContainerObj).scrollTop((scrollItemImageHeight+scrollItemImageGap)*firstGoodsIdx);
621				}else{
622					$(".scrollItemList",scrollItemContainerObj).scrollTop($(".scrollItemList",scrollItemContainerObj).scrollTop()-scrollItemListHeight);
623				}
624			});
625
626			$(".scrollItemArrowDown",this).bind("click",function(){
627
628				firstGoodsIdx += scrollItemViewCnt;
629				if(firstGoodsIdx>goodsCnt) {
630					firstGoodsIdx=(firstGoodsIdx-goodsCnt);
631					$(".scrollItemList",scrollItemContainerObj).scrollTop((scrollItemImageHeight+scrollItemImageGap)*firstGoodsIdx);
632				}else{
633					$(".scrollItemList",scrollItemContainerObj).scrollTop($(".scrollItemList",scrollItemContainerObj).scrollTop()+scrollItemListHeight);
634				}
635
636			});
637		}
638
639	});
640
641	$(".scrollItemContainer").data('scrollSetted',true);
642}
643
644/* 오늘본상품 스크롤 : 언바인드 */
645function unsetTodayGoodsScroll(scrollItemContainerObj){
646	$(scrollItemContainerObj).each(function(){
647		var scrollItemListCnt = $(".scrollItemGoods",this).length;
648		var goodsCnt = scrollItemListCnt/3;
649		$(".scrollItemGoods:gt("+goodsCnt/3-1+")",this).remove();
650
651		$(".scrollItemArrowUp",this).unbind("click");
652		$(".scrollItemArrowDown",this).unbind("click");
653		$(".scrollItemList",this).hide();
654	});
655
656}
657
658//출석체크 팝업
659function jc_view_btn(url,sz1,sz2){
660	var str= url;
661	popup(str,sz1,sz2);
662
663}
664
665function openMobileDialog(title, layerId, customOptions){
666	if((typeof layerId) != 'string') var layerSelector = layerId;
667	else if(layerId.substring(0,1)=='#' || layerId.substring(0,1)=='.' || (typeof layerId) != 'string') var layerSelector = layerId;
668	else var layerSelector = "#"+layerId;
669
670	$(layerSelector).css({
671		"padding":"10px",
672		"background-color":"#fff",
673		"position":"absolute",
674		"top":"0px",
675		"left":"0px",
676		"z-index":"220",
677		"width":"1000px",
678		"border":"2px solid #000"
679	}).prepend("<strong>"+title+"</strong><br /><br />").show();
680
681	var layerBackgroundId = "mobileDialogBackground";
682	if($("#"+layerBackgroundId).length==0){
683		var layerBackgroundSelector = $("<div id='"+layerBackgroundId+"' style='background-color:#fff;position:fixed;width:100%;height:100%;top:0px;left:0px;z-index:200;'></div>").appendTo('body');
684		$(layerBackgroundSelector).height($(document).height());
685	}
686	$(layerBackgroundSelector).show();
687}
688
689function closeMobileDialog(layerId){
690	if((typeof layerId) != 'string') var layerSelector = layerId;
691	else if(layerId.substring(0,1)=='#' || layerId.substring(0,1)=='.' || (typeof layerId) != 'string') var layerSelector = layerId;
692	else var layerSelector = "#"+layerId;
693
694	$(layerSelector).hide();
695	$("#mobileDialogBackground").hide();
696}
697
698function autocomplete(keyword) {
699	var mobilemode = (typeof(gl_mobile_mode)!=='undefined') ? gl_mobile_mode : 0;
700	var setmode = (typeof(gl_set_mode)!=='undefined') ? gl_set_mode : '';
701
702	if($.cookie('autocomplete') == "none"){
703		var offset = $('input[name=search_text]').offset();
704		if( offset && $('#autocomplete').length == 0) {
705			$('<div id="autocomplete" style="display:none; position:absolute;"></div>').prependTo(document.body);
706			$('#autocomplete').css({
707				'position' : 'absolute',
708				'z-index' : 999,
709				'box-sizing' : 'border-box',
710				'left' : offset.left,
711				'top' : offset.top+$('input[name=search_text]').height(),
712				'width' : $('input[name=search_text]').width()
713			});
714		}
715		$('#autocomplete').html("<div style=\"border-collapse:collapse; background:#ffffff; border:1px solid #e0e0e0; padding:7px 7px 7px 0px;\" align='center'><a href=\"javascript:autocomplete_use();\" style=\"font-size:11px; font-family:dotum; color:#95959f;\">"+getAlert("gv105")+"</a></div>");	// 기능켜기
716		$('#autocomplete').show();
717
718	}else{
719
720	  $.post("/common/autocomplete",{
721		key : keyword
722	  },function(data){
723			var offset = $('input[name=search_text]').offset();
724
725			if( offset && $('#autocomplete').length == 0) {
726				if( (mobilemode > 0 || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light')) && !setmode ){
727				$('<div id="autocomplete" style="display:none; position:absolute;"></div>').prependTo(document.body);
728				$('#autocomplete').css({
729					'position' : 'absolute',
730					'z-index' : 999,
731					'box-sizing' : 'border-box',
732					'width' : '100%',
733					'top' : offset.top+$('input[name=search_text]').height()
734				});
735					$('#autocomplete').css({'box-sizing':'content-box'});
736				}else{
737					$('<div id="autocomplete" style="display:none; position:absolute;"></div>').prependTo(document.body);
738					$('#autocomplete').css({
739						'position' : 'absolute',
740						'z-index' : 999,
741						'box-sizing' : 'border-box',
742						'width' : '100%',
743						'left' : offset.left,
744						'top' : offset.top+$('input[name=search_text]').height(),
745						//'background' : '#FFFFFF'
746					});
747				}
748			}
749			if(data){
750				$('#autocomplete').show();
751				$('#autocomplete').html(data);
752			}else{
753				$('#autocomplete').hide();
754			}
755
756	  });
757	}
758}
759
760function autocomplete_nouse(){
761	$("#autocomplete").hide();
762	$.cookie('autocomplete', 'none');
763	autocomplete($('input[name=search_text]').val());
764}
765
766function autocomplete_use(){
767	$("#autocomplete").hide();
768	$.cookie('autocomplete', 'block');
769	autocomplete($('input[name=search_text]').val());
770}
771
772
773function openDialogAll(layerid,title,url,contents_layer){
774	if (document.body.scrollTop == 0) {
775		var top = document.documentElement.scrollTop;
776	} else {
777		var top = document.body.scrollTop;
778	}
779
780	var pop = $("<div id='"+layerid+"' style='position:absolute;top:"+top+"px;background:#fff;width:100%;z-index:2;'></div>");
781	var pop_title = $('<div class="sub_division_title">'+title+'<div class="sub_division_arw" onclick="javascript:closeDialogAll(\''+layerid+'\')"></div></div>');
782	var pop_contents = "";
783
784	if(url){
785		$.get(url, function(data) {
786			$("#"+contents_layer).html(data);
787			pop_contents = $("#"+contents_layer).html();
788			pop.append(pop_title);
789			pop.append(pop_contents);
790			$("body").append(pop);
791		});
792	}else{
793		pop_contents = $("#"+contents_layer).html();
794		pop.append(pop_title);
795		pop.append(pop_contents);
796		$("body").append(pop);
797	}
798}
799
800function openDialogModal(layerid,title,url,contents_layer){
801	if( typeof gl_mobile_mode != 'undefined' && contents_layer == "displayGoodsSelect"  ) {
802		openDialog(title, contents_layer, {"show" : "fade","hide" : "fade"});
803	}else{
804		var top = document.body.scrollTop == 0 ? document.documentElement.scrollTop : document.body.scrollTop;
805		$('#wrap').hide();
806		$("body").append("<div id='"+layerid+"' style='position:absolute;top:0px;background:#fff;width:100%;height:100%;z-index:102'></div>");
807		var pop_title = $('<div class="sub_division_title">'+title+'<div class="sub_division_arw sub_division_arw_x" onclick="javascript:closeDialogAll(\''+layerid+'\')"></div></div>');
808
809		if(url){
810			$.get(url, function(data) {
811				$("#"+contents_layer).html(data);
812				$("#"+layerid).append(pop_title,$("#"+contents_layer).html());
813			});
814		}else{
815			$("#"+layerid).append(pop_title,$("#"+contents_layer).html());
816		}
817	}
818	$(window).scrollTop(0);
819}
820
821function closeDialogAll(layerid)
822{
823	if( typeof gl_mobile_mode != 'undefined' &&  layerid == "displayGoodsSelectDialog")  closeDialog('displayGoodsSelect');
824	$("#"+layerid).remove();
825	$('#restock').find("select[name='viewOptionsReStock[]']").die();
826	$('#wrap').show();
827}
828
829// 우편번호 다이얼로그 박스
830function openDialogZipcode(zipcodeFlag,idx,ziptype,page){
831
832	var sheight = $('body').prop("scrollHeight");
833	var idxtag = "";
834	$("body").append("<div id='"+zipcodeFlag+"BgId' style='position:absolute;top:0px;background:#000;width:100%;height:"+sheight+"px;z-index:10005;visibility:visible;filter:alpha(opacity=30); opacity:0.3; -moz-opacity:0.3;'></div>");
835	$("body").append("<div id='"+zipcodeFlag+"Id' style='position:absolute;top:0px;background:#fff;width:100%;height:100%;z-index:10006'></div>");
836	if(!ziptype) ziptype = 'street';
837	if(idx) idxtag = "&multiIdx"+idx;
838	var iframe = '<div class="sub_division_title">주소찾기<div class="sub_division_arw sub_division_arw_x" onclick="javascript:closeDialogZipcode(\''+zipcodeFlag+'\')"></div></div>';
839	iframe += '<div style="height:100%;">';
840	iframe += '<iframe id="'+zipcodeFlag+'contents_frame" name="'+zipcodeFlag+'contents_frame" src="../popup/zipcode?zipcodeFlag='+zipcodeFlag+'&zipcode_type='+ziptype+'&page='+page+'&popup=1'+idxtag+'" width="100%" height="93%" frameborder="0" allowTransparency="true"></iframe>';
841	iframe += '</div>';
842	$("#"+zipcodeFlag+"Id").html(iframe);
843	$(window).scrollTop(0);
844
845}
846function closeDialogZipcode(zipcodeFlag)
847{
848	$("#"+zipcodeFlag+"Id").remove();
849	$("#"+zipcodeFlag+"BgId").remove();
850}
851/* ++++++++++++++++++++++++ 우편번호 레이어 - 반응형 ++++++++++++++++++++++++++++++ */
852function openDialogZipcode_resp( zipcodeFlag, idx, ziptype, page ){
853	
854	var idxtag = "";
855
856	if(typeof idx == 'undefined') var idx = '';
857	if(typeof page == 'undefined') var page = 1; 
858	if(typeof ziptype == 'undefined') var ziptype = '';
859
860	if(!ziptype) ziptype = 'street';
861	if(idx) idxtag = "&multiIdx"+idx;
862
863	$("body").append("<div id='"+zipcodeFlag+"zipId' class='resp_layer_pop maxHeight'></div>");
864
865	//var sheight = $('body').prop("scrollHeight");
866	//$("body").append("<div id='"+zipcodeFlag+"BgId' style='position:absolute;top:0px;background:#000;width:100%;height:"+sheight+"px;z-index:10005;visibility:visible;filter:alpha(opacity=30); opacity:0.3; -moz-opacity:0.3;'></div>");
867	//$("body").append("<div id='"+zipcodeFlag+"Id' style='position:absolute;top:0px;background:#fff;width:100%;height:100%;z-index:10006'></div>");
868
869	var iframe = '<h4 class="title">주소찾기</h4>';
870	iframe += '<div class="y_scroll_auto">';
871	iframe += '<iframe id="'+zipcodeFlag+'contents_frame" name="'+zipcodeFlag+'contents_frame" class="zipcode_iframe" src="../popup/zipcode?zipcodeFlag='+zipcodeFlag+'&zipcode_type='+ziptype+'&page='+page+'&popup=1'+idxtag+'"  frameborder="0" allowTransparency="true"></iframe>';
872	iframe += '</div>';
873	iframe += '<a href="javascript:void(0)" class="btn_pop_close" onclick="removeCenterLayer(\'#'+ zipcodeFlag +'zipId\')"></a>';
874
875	$("#"+zipcodeFlag+"zipId").html(iframe);
876	showCenterLayer( '#'+zipcodeFlag+'zipId' );
877}
878/* ++++++++++++++++++++++++ //우편번호 레이어 - 반응형 ++++++++++++++++++++++++++++++ */
879
880function check_chnage_shipping_method(obj)
881{
882	var opt_val = '';
883	var act_obj = $(obj);
884	act_obj.css("background-color","#ffffff");
885
886	var act_val = act_obj.val();
887	var provider = act_obj.attr('class');
888	var sel_obj = $("select[class='"+provider+"']");
889
890	sel_obj.each(function(){
891		var sobj = $(this);
892		if(act_obj.attr('name') != sobj.attr('name')){
893			sobj.children("option[value='"+act_val+"']").attr("selected",true);
894			sobj.css("background-color","#efefef");
895		}
896	});
897}
898
899/* 우측 퀵메뉴 기능개선 leewh 2014-06-03 */
900function setRightMenu() {
901	setRightClickBtn("right_item_recent",1);
902
903	$(".rightTitleMenu")	.on("click", function(){
904		if ($(this).next(".right_itemList").css("display")=="none") {
905			$(".right_itemList").hide();
906			setRightClickBtn($(this).parent().attr('class'),1);
907		} else {
908			$(this).next(".right_itemList").hide();
909		}
910	});
911
912	$(".right_quick_btn_prev").on("click", function(){
913		type = $(this).parent().parent().parent().attr('class');
914		current_page = parseInt($("."+type+" #right_page_div .right_quick_current_page").text())-1;
915		setRightClickBtn(type,current_page,'move');
916		return false;
917	});
918
919	$(".right_quick_btn_next").on("click", function(){
920		type = $(this).parent().parent().parent().attr('class');
921		current_page = parseInt($("."+type+" #right_page_div .right_quick_current_page").text())+1;
922		setRightClickBtn(type,current_page,'move');
923		return false;
924	});
925
926	$("#right_cart_total").on("click", function(){
927		location.href="../order/cart";
928		return false;
929	});
930
931	$("#right_wish_total").on("click", function(){
932		location.href="../mypage/wish";
933		return false;
934	});
935
936	setRightMenuCss();
937}
938
939/* 우측 퀵메뉴 기능개선 각 메뉴 변수 설정 */
940function setRightClickBtn(type, page, act){
941	// 우측 스크롤 페이지 로딩시 설정한 전역변수 사용
942	var right_recent = (typeof($set_right_recent)!=='undefined') ? $set_right_recent : 5;
943	var right_recomm = (typeof($set_right_recomm)!=='undefined') ? $set_right_recomm : 5;
944	var right_cart = (typeof($set_right_cart)!=='undefined') ? $set_right_cart : 5;
945	var right_wish = (typeof($set_right_wish)!=='undefined') ? $set_right_wish : 5;
946	var limit,tot_item,tot_page;
947	var act = (typeof(act)!=='undefined') ? act : '';
948
949	if (type=="right_item_recent") {
950		limit = right_recent;
951		tot_item = $("#right_recent_total").text();
952	} else if (type=="right_item_recomm") {
953		limit = right_recomm;
954		tot_item = $("#right_recomm_total").text();
955	} else if (type=="right_item_cart") {
956		limit = right_cart;
957		tot_item = $("#right_cart_total").text();
958	} else if (type=="right_item_wish") {
959		limit = right_wish;
960		tot_item = $("#right_wish_total").text();
961	}
962
963	tot_page = (tot_item) ? Math.ceil(tot_item/limit) : 0;
964
965	if (tot_page) {
966		current_page = $("."+type+" #right_page_div .right_quick_current_page").text();
967		if (tot_page) {
968			if (page > tot_page) {
969				page = tot_page;
970			} else if (page < 1) {
971				page = 1;
972			}
973		}
974
975		if (act=="move" && page==current_page) {
976		} else {
977			getRightItemList(type,page,limit);
978		}
979
980		$("."+type+" #right_page_div .right_quick_total_page").text(tot_page);
981		$("."+type+" #right_page_div .right_quick_current_page").text(page);
982		$(".right_itemList").hide();
983		$("."+type+" .right_itemList").show();
984		$("."+type+" .right_itemList").children().show();
985	} else {
986		$(".right_itemList").hide();
987	}
988}
989
990/* 우측 퀵메뉴 기능개선 각 메뉴 리스트 호출 */
991function getRightItemList(type,page,limit) {
992	$.ajax({
993		'async' : false,
994		'url' : '/common/get_right_display',
995		'type' : 'GET',
996		'data' : "type="+type+"&page="+page+"&limit="+limit,
997		'success' : function(html){
998			if (html) {
999				$("."+type+" .right_itemList ul").html(html);
1000				if (type=="right_item_recent") {
1001					getRightItemTotal(type);
1002				}
1003				setRightBoxDetail(type);
1004			}
1005		}
1006	});
1007}
1008
1009/* 우측 퀵메뉴 기능개선 장바구니,위시리스트 카운트 호출 */
1010function getRightItemTotal(type) {
1011	if (type=="right_item_cart") {
1012		objCnt = $("#right_cart_total, .right_cart_total"); //#20287 ycg 2018-08-23 장바구니 숫자 갱신 개선
1013	} else if (type=="right_item_wish") {
1014		objCnt = $("#right_wish_total");
1015	} else if (type=="right_item_recent") {
1016		objCnt = $("#right_recent_total");
1017	}
1018
1019	$.ajax({
1020		'async' : false,
1021		'url' : '/common/get_right_total',
1022		'type' : 'GET',
1023		'data' : "type="+type,
1024		'success' : function(total){
1025			if (objCnt.length) {
1026				objCnt.text(total);
1027			}
1028		}
1029	});
1030}
1031
1032/* 우측 퀵메뉴 기능개선 각 메뉴 선택 삭제(추천상품제외) */
1033function rightDeleteItem(type, seq, obj){
1034	var url,param,objCnt,page;
1035	var page = $("."+type+" #right_page_div .right_quick_current_page").text();
1036
1037	if (type=="right_item_recent" || type=="mobile_left_item_recent" || type=="mobile_bottom_item_recent" ) {
1038		url = "/goods/goods_recent_del";
1039		objCnt = $("#right_recent_total");
1040		param = "goods_seq="+seq;
1041	} else if (type=="right_item_cart") {
1042		url = "/order/quickCartDel";
1043		objCnt = $("#right_cart_total");
1044		param = "cart_option_seq="+seq;
1045	} else if (type=="right_item_wish") {
1046		url = "/mypage/quickWishDel";
1047		objCnt = $("#right_wish_total");
1048		param = "wish_seq="+seq;
1049	}
1050
1051	if ( url == "/goods/goods_recent_del" ) {
1052		$.ajax({
1053			'async' : false,
1054			'url' : url,
1055			'type' : 'post',
1056			'data' : param,
1057			'dataType': 'json',
1058			'success' : function(res){
1059				if ( res.msg=="ok") {
1060					if( ((typeof gl_mobile_mode != 'undefined' && gl_mobile_mode == 3) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light')) && (type=="mobile_left_item_recent" || type=="mobile_bottom_item_recent") ){
1061						if(type=="mobile_bottom_item_recent") {
1062							getfloatingrecentlydata(type,'recently_slide_bottom', 'del',res.totalcnt);
1063						}else{
1064							getfloatingrecentlydata(type,'recently_slide_left', 'del',res.totalcnt);
1065						}
1066					}else{
1067						obj.closest("li").remove();
1068						objCnt.text(objCnt.text()-1);
1069						setRightClickBtn(type,page,'del');
1070					}
1071				}
1072			}
1073		});
1074	}else{
1075		$.ajax({
1076			'async' : false,
1077			'url' : url,
1078			'type' : 'post',
1079			'data' : param,
1080			'success' : function(msg){
1081				if (msg=="ok") {
1082					obj.closest("li").remove();
1083					objCnt.text(objCnt.text()-1);
1084					setRightClickBtn(type,page,'del');
1085				}
1086			}
1087		});
1088	}
1089}
1090
1091/* 우측 퀵메뉴 기능개선 삭제버튼과 상세내용박스 */
1092function setRightMenuCss(){
1093	$('.rightQuickitemLi a').live("mouseenter", function(e) {
1094		objGood = $(this).parent().find('.right_quick_goods img');
1095		objDel = $(this).parent().find('.right_quick_btn_delete');
1096		objDetail = $(this).parent().parent().find('.rightQuickitemDetail');
1097
1098		objGood.css("border","2px solid #acacac");
1099		objDetail.css({"visibility":"visible"});
1100		objDetail.addClass("rightQuickitemDetailCss");
1101		if (objDel.length) {
1102			objDel.css({"visibility":"visible"});
1103		}
1104	}).live("mouseleave", function(e) {
1105		objGood = $(this).parent().find('.right_quick_goods img');
1106		objDel = $(this).parent().find('.right_quick_btn_delete');
1107		objDetail = $(this).parent().parent().find('.rightQuickitemDetail');
1108		if (objDel.length) {
1109			objDel.css({"visibility":"hidden"});
1110		}
1111
1112		objDetail.css({"visibility":"hidden"});
1113		objGood.css("border","2px solid #fff");
1114	});
1115}
1116
1117/* 우측 퀵메뉴 기능개선 상품이미지 css 설정 */
1118function setRightBoxDetail(type){
1119	imgGoods = $("."+type+" .right_itemList ul li .right_quick_goods img");
1120
1121	if (imgGoods.length) {
1122		if (window.sidebar) { //파이어폭스
1123			$.each(imgGoods, function(idx, item) {
1124				$(this).attr("src", $(this).attr("src")).load(function() {
1125					setRightCommonCSS($(this));
1126				});
1127			});
1128		} else {
1129			imgGoods.bind('load', function(){
1130				setRightCommonCSS($(this));
1131			});
1132		}
1133	}
1134}
1135
1136function setRightCommonCSS(obj) {
1137	objGood = obj;
1138	objDetail = objGood.parent().parent().parent().find('.rightQuickitemDetail');
1139	objGood.css("border","2px solid #fff");
1140	objDetail.css({"border":"2px solid #acacac"});
1141
1142	// 삭제버튼 위치 계산
1143	objDel = objGood.parent().parent().find('.right_quick_btn_delete');
1144	if (objDel.length) { // 추천상품 없음.
1145		objDelImgWidth = objDel.outerWidth();
1146		objDelImgPst = objDel.position().left-objDelImgWidth;
1147		objDel.css({"top":"0px","left":objDelImgPst+"px"});
1148	}
1149
1150	// 상품 상세 레이어 크기와 위치 계산
1151	imgWidth = objGood.outerWidth();
1152	objDetailPst = objGood.position().left+imgWidth;
1153	imgHeight = objGood.height();
1154	detailHeight = objDetail.height();
1155
1156	tempImgHeight = imgHeight;
1157	if (detailHeight > imgHeight) {
1158		tempImgHeight = detailHeight;
1159	}
1160
1161	objDetail.css({"right":objDetailPst+"px","height":tempImgHeight+"px"});
1162}
1163
1164// 배송지 등록: 사용성을 위해 skin-order-settle.js->front-layout.js로 이동
1165function address_insert() {
1166	$("#inAddress").find("input[name='insert_mode']").val('insert');
1167	// 배송지 정보 초기화
1168	$("#inAddress").find("input[name='address_description']").val('');
1169	$("#inAddress").find("input[name='recipient_zipcode[]']").eq(0).val("");
1170	$("#inAddress").find("input[name='recipient_zipcode[]']").eq(1).val("");
1171	$("#inAddress").find("input[name='recipient_new_zipcode']").val("");
1172	$("#inAddress").find("input[name='recipient_address_type']").val("");
1173	$("#inAddress").find("input[name='recipient_address']").val("");
1174	$("#inAddress").find("input[name='recipient_address_street']").val("");
1175	$("#inAddress").find("input[name='recipient_address_detail']").val("");
1176	$("#inAddress").find("input[name='recipient_user_name']").val("");
1177	$("#inAddress").find("input[name='recipient_phone[]']").each(function (idx) {
1178		$("#inAddress").find("input[name='recipient_phone[]']").eq(idx).val("");
1179	});
1180	$("#inAddress").find("input[name='recipient_cellphone[]']").each(function (idx) {
1181		$("#inAddress").find("input[name='recipient_cellphone[]']").eq(idx).val("");
1182	});
1183	//배송지 등록시 도로명 주소와 지번 주소 모두 뜨도록 수정 @nsg 2017-01-26
1184	$("#inAddress").find("input[name='recipient_address']").show();
1185	$("#inAddress").find("input[name='recipient_address_street']").show();
1186
1187	// 국가 초기화 :: 2017-04-07 lwh
1188	$("#inAddress select[name='nation_select'] option[value='" + $("span.international_nation").html() + "']").attr('selected', true);
1189	$("#inAddress input[name='international_address']").val("");
1190	$("#inAddress input[name='international_town_city']").val("");
1191	$("#inAddress input[name='international_county']").val("");
1192	$("#inAddress input[name='international_postcode']").val("");
1193	chg_address_nation($("#inAddress").find("select[name='nation_select']"));
1194
1195	// 추가 연락처 초기화 :: 2017-05-15 lwh
1196	add_phone($("#btn_delivery_add_phone"), 'close');
1197
1198	//배송지 등록 하기
1199	openDialog(getAlert('os155'), "inAddress", { "width": 600, "height": 640 });
1200}
1201
1202// 배송지 수정 등록 용 국가변경 :: 2016-08-03 lwh
1203//address_insert() 이동하면서 order-settle.js -> front-layout.js로 이동
1204function chg_address_nation(obj) {
1205	var sel_nation = $(obj).val();
1206	if (sel_nation == 'KOREA') {
1207		$("#inAddress").find(".domestic").show();
1208		$("#inAddress").find(".international").hide();
1209	} else {
1210		$("#inAddress").find(".domestic").hide();
1211		$("#inAddress").find(".international").show();
1212	}
1213}
1214
1215// 추가연락처: address_insert() 이동하면서 order-settle.js -> front-layout.js로 이동
1216function add_phone(obj, type) {
1217	if (type == 'open') {
1218		$(obj).closest('li').next('.add_phone').show();
1219		$(obj).attr('onclick', "add_phone(this,'close')");
1220		$(obj).html('' + getAlert("os248") + ' ▲'); // 추가연락처 닫기
1221	} else if (type == 'close') {
1222		$(obj).closest('li').next('.add_phone').hide();
1223		$(obj).attr('onclick', "add_phone(this,'open')");
1224		$(obj).html('' + getAlert("os249") + ' ▼'); // 추가연락처 열기
1225	} else { // 체크하여 값이 있으면 열기
1226		var add_phone_flag = true;
1227		$(obj).closest('li').next('.add_phone').find('input.add_phone_input').each(function () {
1228			if (!$(this).val()) add_phone_flag = false;
1229		});
1230
1231		if (add_phone_flag) {
1232			$(obj).closest('li').next('.add_phone').show();
1233			$(obj).attr('onclick', "add_phone(this,'close')");
1234			$(obj).html('' + getAlert("os248") + ' ▲'); // 추가연락처 닫기
1235		}
1236	}
1237}
1238
1239// 주소록 페이징
1240function popDeliverypage(params){
1241	$.ajax({
1242		'url'	: '/order/pop_delivery_address',
1243		'data'	: {'page':params},
1244		'type'	: 'get',
1245		'dataType': 'text',
1246		'success': function(html) {
1247			if(html){
1248				$("div#delivery_address_dialog").html(html);
1249			}else{
1250				alert(getAlert('os152')); //주소록을 로드하지 못했습니다.
1251				document.location.reload();
1252			}
1253		}
1254	});
1255}
1256
1257// 배송지 수정
1258function delivery_modify(seq){
1259	$.ajax({
1260		url: '/mypage/delivery_address_ajax',
1261		data : {'address_seq':seq},
1262		dataType : 'json',
1263		success: function(data) {
1264
1265			// input box 초기화
1266			$("#inAddress").find("input").val('');
1267
1268			$("#inAddress").find("input[name='address_group']").val(data.address_group);
1269
1270			$("#inAddress").find("input[name='save_delivery_address']").val('1');
1271			if(data.defaults=='Y'){
1272				$("#inAddress").find("input[name='save_delivery_address']").attr('checked',true);
1273			}else{
1274				$("#inAddress").find("input[name='save_delivery_address']").removeAttr('checked');
1275			}
1276
1277			if(data.nation == 'KOREA' || data.international == 'domestic'){
1278				$("#inAddress").find("select[name='nation_select']").val('KOREA');
1279				$("#inAddress").find("input[name='address_description']").val(data.address_description);
1280				$("#inAddress").find("input[name='recipient_user_name']").val(data.recipient_user_name);
1281				$("#inAddress").find("input[name='recipient_address_type']").val(data.recipient_address_type);
1282				$("#inAddress").find("input[name='recipient_address']").val(data.recipient_address);
1283				$("#inAddress").find("input[name='recipient_address_street']").val(data.recipient_address_street);
1284				$("#inAddress").find("input[name='recipient_address_detail']").val(data.recipient_address_detail);
1285				$("#inAddress").find("input[name='recipient_new_zipcode']").eq(0).val(data.recipient_new_zipcode);
1286
1287
1288				phone = new Array();
1289				phone = data.recipient_phone.split('-');
1290				$("#inAddress").find("input[name='recipient_phone[]']").each(function(idx){
1291					$("#inAddress").find("input[name='recipient_phone[]']").eq(idx).val(phone[idx]);
1292				});
1293
1294				cellphone = new Array();
1295				cellphone = data.recipient_cellphone.split('-');
1296				$("#inAddress").find("input[name='recipient_cellphone[]']").each(function(idx){
1297					$("#inAddress").find("input[name='recipient_cellphone[]']").eq(idx).val(cellphone[idx]);
1298				});
1299			}else{
1300				$("#inAddress").find("select[name='nation_select']").val(data.nation);
1301				$("#inAddress").find("input[name='address_description']").val(data.address_description);
1302				$("#inAddress").find("input[name='recipient_user_name']").val(data.recipient_user_name);
1303				$("#inAddress").find("select[name='region']").val(data.region);
1304				$("#inAddress").find("input[name='international_county']").val(data.international_county);
1305				$("#inAddress").find("input[name='international_address']").val(data.international_address);
1306				$("#inAddress").find("input[name='international_town_city']").val(data.international_town_city);
1307				$("#inAddress").find("input[name='international_postcode']").val(data.international_postcode);
1308				$("#inAddress").find("input[name='international_country']").val(data.international_country);
1309
1310				phone = new Array();
1311				phone = data.recipient_phone.split('-');
1312				$("#inAddress").find("input[name='recipient_phone[]']").each(function(idx){
1313					$("#inAddress").find("input[name='recipient_phone[]']").eq(idx).val(phone[idx]);
1314				});
1315
1316				cellphone = new Array();
1317				cellphone = data.recipient_cellphone.split('-');
1318				$("#inAddress").find("input[name='recipient_cellphone[]']").each(function(idx){
1319					$("#inAddress").find("input[name='recipient_cellphone[]']").eq(idx).val(cellphone[idx]);
1320				});
1321			}
1322
1323			chg_address_nation($("#inAddress").find("select[name='nation_select']"));
1324
1325			$("#inAddress").find("input[name='insert_mode']").val('update');
1326			$("#inAddress").find("input[name='address_seq']").val(seq);
1327
1328			$("#infoAddress").html($("#inAddress").clone());
1329
1330			// 추가 연락처 체크 :: 2017-05-15 lwh
1331			add_phone($("#btn_inAddress_add_phone"),'check');
1332
1333			//배송지 수정 하기
1334			openDialog(getAlert('os153'), "inAddress", {"width":550,"height":420});
1335		}
1336	});
1337}
1338
1339// 배송지 삭제
1340function delivery_delete(seq){
1341	//정말 삭제하시겠습니까?
1342	var chk = confirm(getAlert('os154'));
1343	if(chk == true){
1344		var str="../mypage_process/delete_address?address_seq=" + seq + "&page_type=order";
1345		$("iframe[name='actionFrame']").attr('src',str);
1346	}
1347}
1348
1349
1350if(!$.isFunction("facebookopendialog")){
1351	function facebookopendialog(url) {
1352
1353		if( (typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light') ) {
1354			var width = "350";
1355		}else{
1356			var width = "400";
1357		}
1358		var height = "250";
1359
1360		var iframe = $('<iframe frameborder="0" width="0" height="0"  marginwidth="0"marginheight="0" scrolling="no" ></iframe>');
1361		var dialog = $("<div id='facebookoglikeId' class='facebookoglikeId' style='text-align:center'><br/><!img src='/admin/skin/default/images/design/img_progress_bar.gif'' align='absmiddle'></div>").append(iframe).appendTo("body").dialog({//
1362			autoOpen: false,
1363			modal: true,
1364			resizable: false,
1365			width: width,
1366			height: height,
1367			close: function () {
1368				iframe.attr("src", "");
1369			}
1370		});
1371		iframe.attr({
1372			src: url
1373		});
1374		dialog.dialog("option", "title", title).dialog("open");
1375		loadingStart($(".facebookoglikeId"),{segments: 12, width: 15.5, space: 6, length: 13, color: '#000000', speed: 1.5});
1376	}
1377}
1378
1379if(!$.isFunction("facebooklay")){
1380	function facebooklay(mode){
1381
1382		if( (typeof gl_mobile_mode != 'undefined' && gl_mobile_mode > 0) || (typeof gl_operation_type != 'undefined' && gl_operation_type == 'light') ){
1383			var width = "350";
1384		}else{
1385			var width = "400";
1386		}
1387		var height = "160";
1388		loadingStop($(".facebookoglikeId").find("body"),true);
1389		$('.facebookoglikeId').dialog("close");
1390		if( mode == 'unlike' ){
1391			//페이스북 좋아요.<br/> 취소
1392			openDialogAlerttitle(title,getAlert('mb241'),width,height);
1393		}else if( mode == 'like' ){
1394			//페이스북 좋아요.<br/> 성공
1395			openDialogAlerttitle(title,getAlert('mb242'),width,height);
1396		}else{
1397			//페이스북 좋아요.<br/> 다시 시도해 주세요.
1398			openDialogAlerttitle(title,getAlert('mb243'),width,height);
1399		}
1400	}
1401}
1402
1403document.addEventListener("DOMContentLoaded", () => {
1404	// 목록화면 새로고침 시, 스크롤 최상단으로 이동
1405	const list = document.querySelector("#searchedItemDisplay");
1406	const nowLocation = window.location.href;
1407	// 새로고침시 이벤트 페이지에 경우만 최상단으로 가도록 조건 추가
1408	if (nowLocation.includes('promotion/event')) {
1409		const mutationObserver = new MutationObserver(() => {
1410			window.scrollTo({top:0, left:0, behavior:'instant'});
1411		})
1412		list && mutationObserver.observe(list, {
1413			childList: true,
1414			attributes: true,
1415		});
1416	}
1417
1418
1419})
1420
1421$.getScript('/app/javascript/js/echo.js');

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.