PageSourceSearch

https://boxzip.kr/app/javascript/js/goods-display_mobile.js?v=afe0eba294279d50c840

js boxzip.kr collected 2026-10-06 14:04:09 UTC 87,488 bytes, 2,350 lines download raw bytes

1var designDisplaySelector="div.designDisplay, div.designCategoryGoodsDisplay, div.designCategoryRecommendDisplay, div.designSearchGoodsDisplay, div.designMshopGoodsDisplay";
2
3$(function(){
4	/* 어드민 */
5	if(typeof isAdminpage != 'undefined' && isAdminpage == true){
6		$(".goodsDisplayDecorationContainer").each(function(){
7			var goodsDisplayDecorationContainer = this;
8			
9			/* 샘플이미지 : 사이즈변경 */
10			$("select.image_size",goodsDisplayDecorationContainer).change(function(){
11				var image_size = $(this).val();
12				$(".goodsDisplayImageWrap img, .goodsDisplayImageTable",goodsDisplayDecorationContainer).css({"width":$("option:selected",this).attr('width'),"height":$("option:selected",this).attr('height')});
13				goods_image_decoration_data(goodsDisplayDecorationContainer);
14			}).change();
15			
16			/* 이미지꾸미기 - 오버레이 입력폼 show,hide 효과 */
17			$("select.image_overay1, select.image_overay2",goodsDisplayDecorationContainer).change(function(){
18				if($(this).val()=='') $(this).parent().children(".image_overay_text").show();
19				else $(this).parent().children(".image_overay_text").hide();		
20			}).change();
21			
22			/* 이미지꾸미기 - 아이콘 선택창 열기 버튼  */
23			$(".image_icon_select",goodsDisplayDecorationContainer).bind("click",function(){
24				var uniqueKey = "image_icon_select_"+Math.floor(Math.random()*10000000);
25				$(this).attr('uniqueKey',uniqueKey);
26				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
27				$("#displayImageIconPopup input[name='subPath']").val('');
28				set_display_image_icon();
29				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
30			});
31			
32			/* 이미지꾸미기 - 보내기아이콘 선택창 열기 버튼  */
33			$(".image_send_select",goodsDisplayDecorationContainer).bind("click",function(){
34				var uniqueKey = "image_send_select_"+Math.floor(Math.random()*10000000);
35				$(this).attr('uniqueKey',uniqueKey);
36				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
37				$("#displayImageIconPopup input[name='subPath']").val('send');
38				set_display_image_send();
39				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
40			});
41			
42			/* 이미지꾸미기 - 찜 아이콘 선택창 열기 버튼  */
43			$(".image_zzim_select",goodsDisplayDecorationContainer).bind("click",function(){
44				var uniqueKey = "image_zzim_select_"+Math.floor(Math.random()*10000000);
45				$(this).attr('uniqueKey',uniqueKey);
46				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
47				$("#displayImageIconPopup input[name='subPath']").val('zzim');
48				set_display_image_zzim();
49				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
50			});
51			
52			/* 이미지꾸미기 - 찜 아이콘 선택창 열기 버튼  */
53			$(".image_zzim_on_select",goodsDisplayDecorationContainer).bind("click",function(){
54				var uniqueKey = "image_zzim_on_select_"+Math.floor(Math.random()*10000000);
55				$(this).attr('uniqueKey',uniqueKey);
56				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
57				$("#displayImageIconPopup input[name='subPath']").val('zzim_on');
58				set_display_image_zzim_on();
59				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
60			});
61			
62			/* 이미지꾸미기 - 이미지더보기 아이콘 선택창 열기 버튼  */
63			$(".image_slide_select",goodsDisplayDecorationContainer).bind("click",function(){
64				var uniqueKey = "image_slide_select_"+Math.floor(Math.random()*10000000);
65				$(this).attr('uniqueKey',uniqueKey);
66				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
67				$("#displayImageIconPopup input[name='subPath']").val('slide');
68				set_display_image_slide();
69				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
70			});
71			
72			/* 이미지꾸미기 - 퀵바 아이콘 팝업 열기 버튼  */
73			$("table.quick_shopping_container",goodsDisplayDecorationContainer).bind("click",function(){
74				var uniqueKey = "quick_icon_select_"+Math.floor(Math.random()*10000000);
75				$(this).attr('uniqueKey',uniqueKey);
76				$("#displayQuickIconPopup input[name='uniqueKey']").val(uniqueKey);
77				$("#displayQuickIconPopup .quick_shopping_icon_img").each(function(){
78					var randKey = Math.floor(Math.random()*10000000);				
79					$(this).attr('src',$(this).attr('src').split('#')[0]+'#'+randKey);
80				});
81				
82				var quick_shopping = eval("("+$(this).closest('.image_decoration_table').find("input[name='quick_shopping']").val()+")");
83				for(var i=0;i<quick_shopping.length;i++){
84					$("#displayQuickIconPopup input[name='quick_shopping_icon[]'][value='"+quick_shopping[i]+"']").attr('checked',true);
85				}
86				
87				openDialog("빠른 쇼핑 이미지 변경  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayQuickIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
88			});
89			
90			/* 이미지꾸미기 빠른쇼핑 이미지 */
91			$("input[name='quick_shopping']",goodsDisplayDecorationContainer).change(function(){
92				$("table.quick_shopping_container tr",$(this).closest('tr')).empty();
93				var data = eval("("+$(this).val()+")");
94				var randKey = Math.floor(Math.random()*10000000);
95
96				for(var i=0;i<data.length;i++){
97					if(i=='zzim_on') return;
98					if(i=='zzim'){
99						$("table.quick_shopping_container tr",$(this).closest('tr')).append("<td width='16'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+data[i]+".gif#"+randKey+"' /></td>");
100					}else{
101						$("table.quick_shopping_container tr",$(this).closest('tr')).append("<td><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+data[i]+".gif#"+randKey+"' /></td>");
102					}
103				}
104						
105			}).change();
106			
107			/* 이미지꾸미기 - 체크박스값에 따른 disabled 처리 */
108			$(".image_decorate_chk",goodsDisplayDecorationContainer).change(function(){
109				var image_decoration_table = $(this).closest('.image_decoration_table');
110				if($(this).is(":checked") || $(".image_decorate_chk:checked",image_decoration_table).length){
111					$(this).closest(".image_decoration_table").find("*").not(".image_decorate_chk").filter(function(){return $(this).is("select") || $(this).children().length==0;}).css('opacity',1).removeAttr('disabled');
112				}else{
113					$(this).closest(".image_decoration_table").find("*").not(".image_decorate_chk").filter(function(){return $(this).is("select") || $(this).children().length==0;}).css('opacity',0.3).attr('disabled',true);
114				}
115			}).change();
116		
117			/* 이미지꾸미기 선택정보를 샘플이미지에 적용*/
118			$(".image_decoration_table select, .image_decoration_table input",goodsDisplayDecorationContainer).change(function(){
119				goods_image_decoration_data(goodsDisplayDecorationContainer);
120			});
121			
122			/* 상품정보 텍스트정렬을 샘플이미지에 적용 */
123			$("input.text_align",goodsDisplayDecorationContainer).change(function(){
124				if($(this).is(':checked')){
125					$(".goodsDisplayAlign",goodsDisplayDecorationContainer).css("text-align",$(this).val());
126				}
127			}).change();
128			
129			/* 상품정보 항목 값 변경 */
130			$("div.info_item .info_item_selector",goodsDisplayDecorationContainer).live('change',function(){ 
131				change_info_item(this);
132			});
133		
134			/* 상품정보 항목 Sortable */
135			$(".info_item_container",goodsDisplayDecorationContainer).sortable({
136					placeholder: "info_item_holder"
137			});
138			
139			$(".image_slide_type",goodsDisplayDecorationContainer).live("change",function(){
140				$(".image_slide_sample_bottom, .image_slide_sample_right",goodsDisplayDecorationContainer).hide();
141				$(".image_slide_sample_"+$(this).val(),goodsDisplayDecorationContainer).show();
142			}).change();
143			
144			set_info_item_data(goodsDisplayDecorationContainer);
145		});
146	
147		/* 어드민 - 이미지꾸미기 - 아이콘 선택 */
148		$("#displayImageIconPopup img.icon").live("click",function(){
149			var uniqueKey = $("#displayImageIconPopup input[name='uniqueKey']").val();
150			var subPath = $("#displayImageIconPopup input[name='subPath']").val();
151
152			switch(subPath){
153				case "send":
154					$(".image_send_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
155					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/send/","");
156					$(".image_send_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_send').val(selectedIconName).change();
157				break;
158				case "zzim":
159					$(".image_zzim_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
160					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/zzim/","");
161					$(".image_zzim_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_zzim').val(selectedIconName).change();
162				break;
163				case "zzim_on":
164					$(".image_zzim_on_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
165					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/zzim_on/","");
166					$(".image_zzim_on_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_zzim_on').val(selectedIconName).change();
167				break;
168				case "slide":
169					$(".image_slide_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
170					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/slide/","");
171					$(".image_slide_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_slide').val(selectedIconName).change();
172				break;
173				default:
174					$(".image_icon_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
175					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/","");
176					$(".image_icon_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_icon').val(selectedIconName).change();
177				break;
178			}
179			
180			closeDialog("displayImageIconPopup");
181		});	
182	}
183	
184	/* 이미지꾸미기 이미지 설정 */
185	set_goods_display_decoration(".goodsDisplayImageWrap");
186
187	/* 이미지꾸미기 이미지 마우스오버 이벤트 설정 */
188	set_goods_display_decoration_event(".goodsDisplayImageWrap");
189});
190
191/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
192function set_display_image_icon(){	
193	$.getJSON('../design/display_image_icon', function(data) {
194		var tag = '';
195		$("div#displayImageIconPopup ul li").remove();	
196
197		for(var i=0;i<data.length;i++){			
198			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
199			tag += '<img src="/data/icon/goodsdisplay/'+data[i]+'" border="0" class="icon hand hover-select">';					
200			tag += '</li>';
201		}
202		$("div#displayImageIconPopup ul").html(tag);
203	});	
204}
205
206/* 어드민 - 이미지꾸미기 - 빠른쇼핑 아이콘 선택후 콜백 */
207function set_display_quick_icon(quick_shopping_value){
208	var uniqueKey = $("#displayQuickIconPopup input[name='uniqueKey']").val();
209	$("table.quick_shopping_container[uniqueKey='"+uniqueKey+"']").closest('.image_decoration_table').find("input[name='quick_shopping']").val(quick_shopping_value).change();
210	closeDialog('displayQuickIconPopup');
211	
212	$("div#displayQuickIconPopup form input[type='text']").val('');
213}
214
215/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
216function set_display_image_send(){	
217	$.getJSON('../design/display_image_send', function(data) {
218		var tag = '';
219		$("div#displayImageIconPopup ul li").remove();	
220
221		for(var i=0;i<data.length;i++){			
222			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
223			tag += '<img src="/data/icon/goodsdisplay/send/'+data[i]+'" border="0" class="icon hand hover-select">';					
224			tag += '</li>';
225		}
226		$("div#displayImageIconPopup ul").html(tag);
227	});	
228}
229
230/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
231function set_display_image_zzim(){	
232	$.getJSON('../design/display_image_zzim', function(data) {
233		var tag = '';
234		$("div#displayImageIconPopup ul li").remove();	
235
236		for(var i=0;i<data.length;i++){			
237			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
238			tag += '<img src="/data/icon/goodsdisplay/zzim/'+data[i]+'" border="0" class="icon hand hover-select">';					
239			tag += '</li>';
240		}
241		$("div#displayImageIconPopup ul").html(tag);
242	});	
243}
244
245/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
246function set_display_image_zzim_on(){	
247	$.getJSON('../design/display_image_zzim_on', function(data) {
248		var tag = '';
249		$("div#displayImageIconPopup ul li").remove();	
250
251		for(var i=0;i<data.length;i++){			
252			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
253			tag += '<img src="/data/icon/goodsdisplay/zzim_on/'+data[i]+'" border="0" class="icon hand hover-select">';					
254			tag += '</li>';
255		}
256		$("div#displayImageIconPopup ul").html(tag);
257	});	
258}
259
260/* 어드민 - 이미지더보기 - 아이콘 선택후 콜백 */
261function set_display_image_slide(){	
262	$.getJSON('../design/display_image_slide', function(data) {
263		var tag = '';
264		$("div#displayImageIconPopup ul li").remove();	
265
266		for(var i=0;i<data.length;i++){			
267			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
268			tag += '<img src="/data/icon/goodsdisplay/slide/'+data[i]+'" border="0" class="icon hand hover-select">';					
269			tag += '</li>';
270		}
271		$("div#displayImageIconPopup ul").html(tag);
272	});	
273}
274/* 이미지꾸미기 이미지 설정 */
275function set_goods_display_decoration(selector){
276	$(selector)
277	.each(function(){
278		
279		var that = this;
280		var imageObj = $(this);
281		var designDisplayObj = $(that).closest(designDisplaySelector);
282
283		if($(this).data('decorationLoaded') || !$(this).attr("decoration") || $(this).attr("decoration")=="e30="){
284			if(!$(this).data('decorationLoaded')){
285				$(this).css({"border":"0px"});
286				$(".goodsDisplayImageIcon",that).remove();
287				$(".goodsDisplayImageSend",that).remove();
288			}
289			return;
290		}
291
292		$(this).wrap("<div class='relative' />")
293		$(this).css({'position':'relative','display':'inline-block'})
294		
295		// 속도를 위해 상품디스플레이객체에서 이미지꾸미기설정을 가져옴
296		if(designDisplayObj.find(selector).index(that)>0){
297			var decoration = designDisplayObj.data("decoration");
298			$(that).data("decoration",decoration);
299		}
300		else{
301			if($(that).attr("decoration")) $(that).data("decoration",eval("("+Base64.decode($(that).attr("decoration"))+")"));
302			designDisplayObj.data("decoration",$(that).data("decoration"));
303			var decoration = $(that).data("decoration");
304		}
305		
306		if($(that).attr("goodsInfo")) $(that).data("goodsInfo",eval("("+Base64.decode($(that).attr("goodsInfo"))+")"));
307		var goodsInfo = $(that).data("goodsInfo");
308
309		/*
310		if(goodsInfo.goods_status=='runout'){
311			
312			if($(".goodsDisplayImageOveraySoldout",this).length){
313				$(".goodsDisplayImageOveraySoldout",this).remove();
314			}
315
316			var overaySoldoutObj = $("<div class='goodsDisplayImageOveraySoldout'><div class='goodsDisplayImageOveraySoldoutBg'></div><div class='goodsDisplayImageOveraySoldoutText'></div></div>");
317			
318			var overaySoldoutHeight = 75;
319
320			overaySoldoutObj
321			.css({
322				'position'			: 'absolute',
323				'left'				: 0,
324				'top'				: '100%',
325				'margin-top'		: -overaySoldoutHeight,
326				'width'				: $(that).width(),
327				'height'			: overaySoldoutHeight
328			});
329			
330			$(".goodsDisplayImageOveraySoldoutBg",overaySoldoutObj)
331			.css({
332				//'background-color'	: '#ff0000',
333				'color'				: '#fff',
334				'opacity'			: 0.3,
335				'position'			: 'absolute',
336				'left'				: 0,
337				'top'				: 0,
338				'width'				: $(that).width(),
339				'height'			: overaySoldoutHeight
340			});
341
342			$(".goodsDisplayImageOveraySoldoutText",overaySoldoutObj)
343			.css({
344				'background'		: "url('/data/icon/common/soldout_mark.png') no-repeat top right",
345				'width'				: '81px',
346				'height'			: '71px',
347				'position'			: 'absolute',
348				'overflow'			: 'hidden',
349				'white-space'		: 'nowrap',
350				'right'				: 0,
351				'top'				: 0,
352				'width'				: $(that).width()
353			});
354			overaySoldoutObj.show();
355
356			imageObj.after(overaySoldoutObj);
357
358		}
359		*/
360		
361		if(decoration){
362			// 상품디스플레이 속도개선(20141110) 이후 소스
363			if(num($(this).attr('version'))>=20141110){
364				if(decoration['image_send'] || decoration['image_zzim']){
365					var imageSendObj = $(".goodsDisplayImageSend",this);
366
367					$(".goodsSendBtn",imageSendObj).show().click(function(){
368						display_goods_send(this,'top');
369						return false;
370					});
371					
372					$(".goodsZzimBtn",imageSendObj).show().click(function(){
373						display_goods_zzim(this,goodsInfo.goods_seq);
374						return false;
375					});				
376				}
377
378				if(decoration['image_overay1'] || decoration['image_overay1_text']){
379					
380					if($(".goodsDisplayImageOveray1",this).length){
381						$(".goodsDisplayImageOveray1",this).remove();
382					}
383
384					var overay1Obj = $("<div class='goodsDisplayImageOveray1'><div class='goodsDisplayImageOveray1Bg'></div><div class='goodsDisplayImageOveray1Text'></div></div>");
385					
386					var overay1Height = 20;
387
388					switch(decoration['image_overay1']){
389						case "goods_name":
390							var overay1Text = goodsInfo['goods_name'];
391							break;
392						case "price":
393							var overay1Text = '₩' + comma(goodsInfo['price']);
394							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
395							break;
396						case "sale_price":
397							var overay1Text = '₩' + comma(goodsInfo['sale_price']);
398							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
399							break;
400						case "consumer_price":
401							var overay1Text = '₩' + comma(goodsInfo['consumer_price']);
402							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
403							break;
404						case "discount":
405							var overay1Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['price']);
406							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
407							break;
408						case "sale_discount":
409							var overay1Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['sale_price']);
410							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
411							break;
412						case "brand_title":
413							var overay1Text = goodsInfo['brand_title'];
414							break;
415						case "related_goods":
416							var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
417							break;
418						case "":
419						default:
420							var overay1Text = decoration['image_overay1_text'];
421						
422							break;
423					}
424		
425					overay1Obj
426					.css({
427						'position'			: 'absolute',
428						'left'				: 0,
429						'top'				: '100%',
430						'margin-top'		: -overay1Height,
431						'width'				: $(that).width(),
432						'height'			: overay1Height
433					});
434					
435					$(".goodsDisplayImageOveray1Bg",overay1Obj)
436					.css({
437						'background-color'	: '#000000',
438						'color'				: '#fff',
439						'opacity'			: 0.3,
440						'position'			: 'absolute',
441						'left'				: 0,
442						'top'				: 0,
443						'width'				: $(that).width(),
444						'height'			: overay1Height
445					});
446
447					$(".goodsDisplayImageOveray1Text",overay1Obj)
448					.html(overay1Text)
449					.css({
450						'color'				: '#fff',
451						'font-size'			: '11px',
452						'font-weight'		: 'bold',
453						'text-align'		: 'center',
454						'position'			: 'absolute',
455						'overflow'			: 'hidden',
456						'white-space'		: 'nowrap',
457						'line-height'		: overay1Height+'px',
458						'left'				: 0,
459						'top'				: 0,
460						'width'				: $(that).width()
461					});
462					overay1Obj.show();
463
464					imageObj.append(overay1Obj);
465					
466				}else{
467					$(".goodsDisplayImageOveray1",that).remove();
468				}
469
470				if(decoration['image_slide'] && goodsInfo['image_cnt']>1){
471					var imageSlideObj = $(".goodsDisplayImageSlide",this);
472					$(imageSlideObj,imageObj).click(function(){
473						show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']);
474						return false;
475					});
476				}
477
478				if(decoration['quick_shopping']){
479					var quickShoppingObj = $(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping");
480					if(quickShoppingObj.length){
481						if(imageObj.width()){
482							quickShoppingObj.css({'width': $(that).outerWidth()});
483						}else{
484							$(imageObj).bind('load',function(){
485								quickShoppingObj.css({'width': $(that).outerWidth()});
486							});
487						}
488					}
489				}
490
491				if(decoration['use_seconde_image'] && goodsInfo.image2 != null && goodsInfo.image2.length>1){
492					imageObj.attr("imageCut2",goodsInfo.image2);
493				}else{
494					imageObj.removeAttr("imageCut2");
495				}
496
497			// 상품디스플레이 속도개선(20141110) 이후 소스
498			}else{
499				var imgBorderOrg = $(this);
500				if	(decoration['image_border_type']=='all') {
501					imgBorderOrg = imgBorderOrg.closest('.gl_inner_item_wrap');
502				}
503
504				if(decoration['image_border1']){
505					imgBorderOrg.css({"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1'],"margin":"-"+decoration['image_border1_width']+"px"});
506					imgBorderOrg.parent().attr('align','center');
507				}else{
508					imgBorderOrg.css({"border":"0px"});
509				}
510				
511				if(decoration['image_icon'] && decoration['image_icon_type'] != 'condition'){
512					if($(".goodsDisplayImageIcon",this).length){
513						$(".goodsDisplayImageIcon",this).remove();
514					}
515					
516					var imageIconObj = $("<div class='goodsDisplayImageIcon'><img src='/data/icon/goodsdisplay/"+decoration['image_icon']+"' /><span class='goodsDisplayImageIconText'></span></div>");
517					
518					if(decoration['image_icon_location']=='right'){
519						imageIconObj
520						.css({
521							'position'			: 'absolute',
522							'right'				: '0px',
523							'top'				: 2,
524							'text-align'		: 'right'
525						});
526					}else{
527						imageIconObj
528						.css({
529							'position'			: 'absolute',
530							'left'				: '0px',
531							'top'				: 2
532						});
533					}
534					if( decoration['image_icon'].indexOf("icon_best_no")  > -1 ) {
535							var designDisplayObj = $(that).closest(designDisplaySelector);
536							 
537							if(designDisplayObj.length){
538								designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
539								var iconText = designDisplayObj.data('iconIdx');
540							}else{
541								var iconText = 1;
542							}
543							$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
544								'position'		: 'absolute',
545								'font-size'		: '16px',
546								'font-family'	: 'tahoma',
547								'font-weight'	: 'bold',
548								'text-align'	: 'center',
549								'color'			: '#ffffff',
550								'letter-spacing': '-1px',
551								'width'			: 48,
552								'top'			: 25
553							});
554							
555							if(decoration['image_icon_location']=='right'){
556								$(".goodsDisplayImageIconText",imageIconObj).css({
557									'left'			: $(imageObj).width()-48
558								});
559							}else{
560								$(".goodsDisplayImageIconText",imageIconObj).css({
561									'left'			: 0
562								});
563							}
564					}else if( decoration['image_icon'].indexOf("icon_number")  > -1 ) {
565							var designDisplayObj = $(that).closest(designDisplaySelector);
566							if(designDisplayObj.length){
567								designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
568								var iconText = designDisplayObj.data('iconIdx');
569							}else{
570								var iconText = 1;
571							}
572							$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
573								'position'		: 'absolute',
574								'font-size'		: '18px',
575								'font-family'	: 'tahoma',
576								'font-weight'	: 'bold',
577								'text-align'	: 'right',
578								'color'			: '#ffffff',
579								'letter-spacing': '-1px',
580								'width'			: 28,
581								'top'			: 10
582							});
583
584							if(decoration['image_icon_location']=='right'){
585								$(".goodsDisplayImageIconText",imageIconObj).css({
586									'left'			: $(imageObj).width()-46
587								});
588							}else{
589								$(".goodsDisplayImageIconText",imageIconObj).css({
590									'left'			: 0
591								});
592							}
593					}else if( decoration['image_icon'].indexOf("icon_sale")  > -1 ) {
594							var iconText = "";
595							if(goodsInfo.sale_per){
596								iconText = goodsInfo.sale_per;
597								iconText = num(iconText) + "%";
598							}else if(goodsInfo.consumer_price && num(goodsInfo.consumer_price) > num(goodsInfo.price)){
599								iconText = Math.round((num(goodsInfo.consumer_price)-num(goodsInfo.price))/num(goodsInfo.consumer_price)*100);
600								iconText = num(iconText) + "%";
601							}else{
602								imageIconObj.hide();
603							}
604
605							$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
606								'position'		: 'absolute',
607								'font-size'		: '16px',
608								'font-family'	: 'tahoma',
609								'font-weight'	: 'bold',
610								'text-align'	: 'center',
611								'color'			: '#ffffff',
612								'letter-spacing': '-1px',
613								'width'			: 48,
614								'top'			: 0
615							});
616							
617							if(decoration['image_icon_location']=='right'){
618								$(".goodsDisplayImageIconText",imageIconObj).css({
619									'left'			: $(imageObj).width()-48
620								});
621							}else{
622								$(".goodsDisplayImageIconText",imageIconObj).css({
623									'left'			: 0
624								});
625							}
626					}
627					
628					if(decoration['image_icon_over']=='y'){
629						imageIconObj.hide();
630					}else if(typeof iconText != 'undefined' && iconText.length){
631						imageIconObj.show();
632					}
633					
634					imageObj.append(imageIconObj);
635				}else{
636					$(".goodsDisplayImageIcon",that).remove();
637				}
638
639				if(decoration['image_icon'] && decoration['image_icon_type'] == 'condition'){
640
641					var imageIconObj = $("<div class='goodsDisplayImageIcon'><div class='goodsDisplayImageIconWrap'></div></div>");
642										
643					if(decoration['image_icon_location']=='right'){
644						imageIconObj
645						.css({
646							'position'			: 'absolute',
647							'right'				: '0px',
648							'top'				: 0,
649							'text-align'		: 'right'
650						});
651					}else{
652						imageIconObj
653						.css({
654							'position'			: 'absolute',
655							'left'				: '0px',
656							'top'				: 0
657						});
658					}
659
660					if(decoration['image_icon_over']=='y'){
661						imageIconObj.hide();
662					}
663					
664					imageObj.append(imageIconObj);
665
666					icon_condition = decode_base64_json(decoration['image_icon_condition']);
667					icon_use_flag = false;
668
669					var condition = {
670						'{discount}'		: goodsInfo['sale_per'],
671						'{brand}'			: goodsInfo['brand_title'],
672						'{brandeng}'		: goodsInfo['brand_title_eng'],
673						'{bestnum}'			: goodsInfo['goods_index']
674					}
675
676					if	(icon_condition) {
677						for(i=0; i<3; i++){
678							if	(icon_condition[i]['use'] == '1' && !icon_use_flag) {
679								var contents = [];
680								$.each(icon_condition[i]['contents'], function(txt_k, txt_v){
681									if	(txt_v['txt'] && txt_v['use'] == '1') {
682										if	(txt_v['txt_type'] == 'shipping_free') {
683											if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_type'] == 'free')
684												contents.push(txt_v);
685										}else{
686											contents.push(txt_v);
687										}
688									}
689								});
690								switch(icon_condition[i]['key']){
691									case 'discount_per':
692										if	(goodsInfo['sale_per'] >= icon_condition[i]['discount']) {
693											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
694											icon_use_flag = true;
695										}
696									break;
697									case 'solo':
698										if	(goodsInfo['eventEnd']) {
699											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
700											icon_use_flag = true;
701										}
702									break;
703									case 'discount':
704										if	(goodsInfo['event_text']) {
705											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
706											icon_use_flag = true;
707										}								
708									break;
709									case 'gift':
710									break;
711									case 'package':
712										if	(goodsInfo['package_yn'] == 'y') {
713											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
714											icon_use_flag = true;
715										}
716									break;
717									case 'date':
718										if	(icon_condition[i]['date_type'] == 'before') {
719										   var nDate = new Date();
720										   var vDate = new Date(goodsInfo['regist_date'].replace(/-/gi,"/"));
721										   var timeSpan = (nDate - vDate) / 86400000;
722										   var daysApart = Math.abs(Math.round(timeSpan));
723										   if (icon_condition[i]['date'] >=  daysApart) {
724											   set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
725											   icon_use_flag = true;
726										   }
727										}else{
728										
729											var vDate = icon_condition[i]['date'];
730											var yy = parseInt(vDate.substr(0, 4), 10);
731											var mm = parseInt(vDate.substr(5, 2), 10);
732											var dd = parseInt(vDate.substr(8), 10);
733											nDate = new Date(yy, mm - 1, dd + parseInt(icon_condition[i]['date_after'],10));
734											yy = nDate.getFullYear();
735											mm = nDate.getMonth() + 1; mm = (mm < 10) ? '0' + mm : mm;
736											dd = nDate.getDate(); dd = (dd < 10) ? '0' + dd : dd;
737											after_date = yy+'-'+mm+'-'+dd;
738
739											if (after_date <= goodsInfo['regist_date']) {
740												set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
741												icon_use_flag = true;
742											}										
743										}
744									break;
745									case 'empty':
746										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
747										icon_use_flag = true;
748										icon_use_flag = true;
749									break;
750								}
751							}
752						}
753					}
754					if	(!icon_use_flag) 
755						$(".goodsDisplayImageIconWrap",this).remove();
756					else
757						$(".goodsDisplayImageIconWrap",this).show();
758				}
759				
760				if(decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']){
761					if($(".goodsDisplayImageSend",this).length){
762						$(".goodsDisplayImageSend",this).remove();
763					}
764					
765					var btnSend = decoration['image_send'] ? " <img class='goodsSendBtn' src='/data/icon/goodsdisplay/send/"+decoration['image_send']+"' />" : '';
766					var btnZzim = decoration['image_zzim'] ? " <span class='goodsZzimBtn'><img src='/data/icon/goodsdisplay/zzim/"+decoration['image_zzim']+"' class='zzimOffImg' /><img src='/data/icon/goodsdisplay/zzim_on/"+decoration['image_zzim_on']+"' class='zzimOnImg' /></span>" : '';
767					
768					var imageSendObj = $("<div class='goodsDisplayImageSend'>"+btnSend+btnZzim+"</div>");
769
770					if(decoration['image_send_location']=='right'){
771						imageSendObj
772						.css({
773							'position'			: 'absolute',
774							'left'				: '0px',
775							'top'				: 2,
776							'width'				: '100%',
777							'text-align'		: 'right'
778						});
779					}else{
780						imageSendObj
781						.css({
782							'position'			: 'absolute',
783							'left'				: '0px',
784							'top'				: 2
785						});
786					}
787
788					if(decoration['image_send_over']=='y'){
789						imageSendObj.hide();
790					}else{
791						imageSendObj.show();
792					}
793					
794					imageObj.after(imageSendObj);
795					
796					if(goodsInfo.wish=='1'){
797						$(".goodsZzimBtn .zzimOnImg",imageSendObj).show();
798						$(".goodsZzimBtn .zzimOffImg",imageSendObj).hide();
799					}else{
800						$(".goodsZzimBtn .zzimOffImg",imageSendObj).show();
801						$(".goodsZzimBtn .zzimOnImg",imageSendObj).hide();
802					}
803					
804					$(".goodsSendBtn",imageSendObj).click(function(){
805						display_goods_send(this,'top');
806						return false;
807					});
808					
809					$(".goodsZzimBtn",imageSendObj).click(function(){
810						display_goods_zzim(this,goodsInfo.goods_seq);
811						return false;
812					});
813				}else{
814					$(".goodsDisplayImageSend",that).remove();
815				}
816
817				if(decoration['image_overay1'] || decoration['image_overay1_text']){
818					
819					if($(".goodsDisplayImageOveray1",this).length){
820						$(".goodsDisplayImageOveray1",this).remove();
821					}
822
823					var overay1Obj = $("<div class='goodsDisplayImageOveray1'><div class='goodsDisplayImageOveray1Bg'></div><div class='goodsDisplayImageOveray1Text'></div></div>");
824					
825					var overay1Height = 20;
826
827					switch(decoration['image_overay1']){
828						case "goods_name":
829							var overay1Text = goodsInfo['goods_name'];
830							break;
831						case "price":
832							var overay1Text = '₩' + comma(goodsInfo['price']);
833							break;
834						case "sale_price":
835							var overay1Text = '₩' + comma(goodsInfo['sale_price']);
836							break;
837						case "consumer_price":
838							var overay1Text = '₩' + comma(goodsInfo['consumer_price']);
839							break;
840						case "discount":
841							var overay1Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['price']);
842							break;
843						case "sale_discount":
844							var overay1Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['sale_price']);
845							break;
846						case "brand_title":
847							var overay1Text = goodsInfo['brand_title'];
848							break;
849						case "related_goods":
850							var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
851							break;
852						case "":
853						default:
854							var overay1Text = decoration['image_overay1_text'];
855						
856							break;
857					}
858		
859					overay1Obj
860					.css({
861						'position'			: 'absolute',
862						'left'				: 0,
863						'top'				: '100%',
864						'margin-top'		: -overay1Height,
865						'width'				: $(that).width(),
866						'height'			: overay1Height
867					});
868					
869					$(".goodsDisplayImageOveray1Bg",overay1Obj)
870					.css({
871						'background-color'	: '#000000',
872						'color'				: '#fff',
873						'opacity'			: 0.3,
874						'position'			: 'absolute',
875						'left'				: 0,
876						'top'				: 0,
877						'width'				: $(that).width(),
878						'height'			: overay1Height
879					});
880
881					$(".goodsDisplayImageOveray1Text",overay1Obj)
882					.html(overay1Text)
883					.css({
884						'color'				: '#fff',
885						'font-size'			: '11px',
886						'font-weight'		: 'bold',
887						'text-align'		: 'center',
888						'position'			: 'absolute',
889						'overflow'			: 'hidden',
890						'white-space'		: 'nowrap',
891						'line-height'		: overay1Height+'px',
892						'left'				: 0,
893						'top'				: 0,
894						'width'				: $(that).width()
895					});
896					overay1Obj.show();
897
898					imageObj.after(overay1Obj);
899					
900				}else{
901					$(".goodsDisplayImageOveray1",that).remove();
902				}
903				
904				if(decoration['image_slide'] && goodsInfo['image_cnt']>1){
905					if($(".goodsDisplayImageSlide",this).length){
906						$(".goodsDisplayImageSlide",this).remove();
907					}
908
909					var imageSlideObj = $("<div class='goodsDisplayImageSlide'><img src='/data/icon/goodsdisplay/slide/"+decoration['image_slide']+"' /></div>");
910								
911					imageObj.after(imageSlideObj);
912					
913					imageSlideObj
914					.css({
915						'position'			: 'absolute',
916						'right'				: '0px',
917						'top'				: '50%',
918						'margin-top'		: -(imageSlideObj.height()/2)+'px'
919					});
920					
921					$(imageSlideObj,imageObj).click(function(){
922						show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']);
923						return false;
924					});
925				}else{
926					$(".goodsDisplayImageSlide",that).remove();
927				}
928				
929				if(decoration['quick_shopping']){
930					if($(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").length){
931						$(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").remove();
932					}
933					var quick_shopping = eval("("+decoration['quick_shopping']+")");
934					if(quick_shopping.length){
935					
936						var quickShoppingObj = $("<div class='goodsDisplayQuickShopping'><table class='quick_shopping_container' width='100%' border='0' cellpadding='0' cellspacing='0'><tr></tr></table></div>");
937						
938						if(imageObj.width()){
939							quickShoppingObj.css({'width': $(that).outerWidth()});
940						}else{
941							$(imageObj).bind('load',function(){
942								quickShoppingObj.css({'width': $(that).outerWidth()});
943							});
944						}
945						
946						var quickShoppingTableObj = $("table.quick_shopping_container",quickShoppingObj);
947						quickShoppingTableObj.css({
948							'border-collapse':'collapse',
949							'table-layout':'fixed'
950						});
951
952						$(that).after(quickShoppingObj);
953
954						for(var i=0;i<quick_shopping.length;i++){
955							switch(quick_shopping[i]){
956								case 'newwin':
957									$('tr',quickShoppingTableObj).append("<td class='goodsNewwinBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
958									$(".goodsNewwinBtn",quickShoppingTableObj).click(function(){
959										if(goodsInfo.goods_seq) window.open($(imageObj).closest('a').attr('href'));
960									});
961								break;
962								case 'quickview':
963									$('tr',quickShoppingTableObj).append("<td class='goodsQuickviewBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
964									$(".goodsQuickviewBtn",quickShoppingTableObj).click(function(){
965										display_goods_quickview(this,goodsInfo.goods_seq);
966										return false;
967									});
968								break;
969								case 'send':
970									$('tr',quickShoppingTableObj).append("<td class='goodsSendBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
971									$(".goodsSendBtn",quickShoppingTableObj).click(function(){
972										display_goods_send(this,'bottom');
973										return false;
974									});
975								break;
976								case 'zzim':
977									$('tr',quickShoppingTableObj).append("<td class='goodsZzimBtn hand' width='16'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' class='zzimOffImg' /><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+"_on.gif' class='zzimOnImg' /></td>");
978									if(goodsInfo.wish=='1'){
979										$(".goodsZzimBtn .zzimOnImg",quickShoppingTableObj).show();
980										$(".goodsZzimBtn .zzimOffImg",quickShoppingTableObj).hide();
981									}else{
982										$(".goodsZzimBtn .zzimOffImg",quickShoppingTableObj).show();
983										$(".goodsZzimBtn .zzimOnImg",quickShoppingTableObj).hide();
984									}
985									$(".goodsZzimBtn",quickShoppingTableObj).click(function(){
986										display_goods_zzim(this,goodsInfo.goods_seq);
987										return false;
988									});	
989								break;
990							}
991						}
992						
993						$('td',quickShoppingTableObj).css({
994							'height':'14px',
995							'text-align':'center',
996							'border':'1px solid #e5e5e5',
997							'background-color':'#fff',
998							'font-size':'11px',
999							'letter-spacing':'-1px'
1000						});
1001					}
1002				}else{
1003					$(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").remove();
1004				}
1005
1006				if(decoration['use_seconde_image'] && goodsInfo.image2 != null && goodsInfo.image2.length>1){
1007					imageObj.attr("imageCut2",goodsInfo.image2);
1008				}else{
1009					imageObj.removeAttr("imageCut2");
1010				}
1011			}
1012		}
1013
1014		$(that).data('decorationLoaded',true);
1015		/*
1016		$(".quick_shopping_view",$(that).closest('.goodsDisplayItemWrap')).click(function(){
1017			alert(goodsInfo.goods_name + ' 퀵뷰 버튼 클릭');
1018			return false;
1019		});
1020		*/	
1021		if(goodsInfo['image_cnt']>1){
1022			$(".quick_shopping_image",$(that).closest('.goodsDisplayItemWrap')).click(function(){
1023				show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']?decoration['image_slide_type']:'bottom');
1024			});
1025		}else{
1026			$(".quick_shopping_image",$(that).closest('.goodsDisplayItemWrap')).remove();
1027		}
1028		/*
1029		$(".quick_shopping_send",$(that).closest('.goodsDisplayItemWrap')).click(function(){
1030			alert(goodsInfo.goods_name + ' 보내기 버튼 클릭');
1031			return false;
1032		});
1033		*/		
1034	});
1035	
1036}
1037
1038function set_goods_display_decoration_event(selector){
1039	$(selector)
1040	.bind("mouseenter touchstart",function(){
1041		var decoration = $(this).data("decoration");
1042		var goodsInfo = $(this).data("goodsInfo");
1043		var imageObj = $(this);
1044		var imageCut2 = imageObj.attr("imageCut2");
1045
1046		if(imageCut2){
1047			imageObj.attr('oriSrc',imageObj.attr('src'));
1048			imageObj.attr('src',imageCut2);
1049		}
1050		
1051		if(decoration){
1052			if(decoration['image_border']){
1053				$(this).css({"border":decoration['image_border_width'] + "px solid " + decoration['image_border'],"margin":"-"+decoration['image_border_width']+"px"});
1054			}
1055			
1056			if(decoration['image_opacity']){
1057				imageObj.css({"opacity":1-decoration['image_opacity']/100});
1058			}
1059			
1060			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
1061				var imageIconObj = $(".goodsDisplayImageIcon",this);
1062				imageIconObj.show();	
1063			}
1064			
1065			if((decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']) && decoration['image_send_over']=='y'){
1066				var imageSendObj = $(".goodsDisplayImageSend",this);
1067				imageSendObj.show();	
1068			}
1069			
1070			if(decoration['image_overay2'] || decoration['image_overay2_text']){
1071
1072				if($(".goodsDisplayImageOveray2",this).length){
1073					var overay2Obj = $(".goodsDisplayImageOveray2",this);
1074				}else{
1075					var overay2Obj = $("<div class='goodsDisplayImageOveray2'><div class='goodsDisplayImageOveray2Bg'></div><div class='goodsDisplayImageOveray2Text'></div></div>");
1076				}
1077				
1078				var overay2Height = 20;
1079				var overay2Top = $(".goodsDisplayImageOveray1",this).length ? $(this).height() - $(".goodsDisplayImageOveray1",this).height(): $(this).height();
1080
1081				switch(decoration['image_overay2']){
1082					case "goods_name":
1083						var overay2Text = goodsInfo['goods_name'];
1084						
1085						break;
1086					case "price":
1087						var overay2Text = '₩' + comma(goodsInfo['price']);
1088	
1089						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
1090					
1091						break;
1092					case "consumer_price":
1093						var overay2Text = '₩' + comma(goodsInfo['consumer_price']);
1094	
1095						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
1096					
1097						break;
1098					case "sale_price":
1099						var overay2Text = '₩' + comma(goodsInfo['sale_price']);
1100	
1101						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
1102					
1103						break;
1104					case "discount":
1105						var overay2Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['price']);
1106	
1107						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
1108					
1109						break;
1110					case "sale_discount":
1111						var overay2Text = comma(goodsInfo['consumer_price']) + " → " + comma(goodsInfo['sale_price']);
1112	
1113						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
1114					
1115						break;
1116					case "brand_title":
1117						var overay2Text = goodsInfo['brand_title'];
1118						break;
1119					case "related_goods":
1120						var overay2Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block'>관련상품보기</span>";
1121						break;
1122					case "":
1123					default:
1124						var overay2Text = decoration['image_overay2_text'];
1125					
1126						break;
1127				}
1128				
1129				overay2Obj
1130				.css({
1131					'position'			: 'absolute',
1132					'left'				: 0,
1133					'top'				: overay2Top-overay2Height,
1134					'width'				: $(this).width(),
1135					'height'			: overay2Height
1136				});
1137				
1138				$(".goodsDisplayImageOveray2Bg",overay2Obj)
1139				.css({
1140					'background-color'	: '#000000',
1141					'color'				: '#fff',
1142					'opacity'			: 0.3,
1143					'position'			: 'absolute',
1144					'left'				: 0,
1145					'top'				: 0,
1146					'width'				: $(this).width(),
1147					'height'			: overay2Height
1148				});
1149				
1150				$(".goodsDisplayImageOveray2Text",overay2Obj)
1151				.html(overay2Text)
1152				.css({
1153					'color'				: '#fff',
1154					'font-size'			: '11px',
1155					'font-weight'		: 'bold',
1156					'text-align'		: 'center',
1157					'position'			: 'absolute',
1158					'overflow'			: 'hidden',
1159					'white-space'		: 'nowrap',
1160					'line-height'		: overay2Height+'px',
1161					'left'				: 0,
1162					'top'				: 0,
1163					'width'				: $(this).width()
1164				});
1165				imageObj.after(overay2Obj.show());
1166				
1167			}else{
1168				$(".goodsDisplayImageOveray2",this).remove();
1169			}
1170			
1171		}
1172	})
1173	.bind("mouseleave touchend",function(){
1174		var decoration = $(this).data("decoration");
1175		var goodsInfo = $(this).data("goodsInfo");
1176		var imageObj = $(this);
1177		var imageCut2 = imageObj.attr("imageCut2");
1178		
1179		if(imageCut2){
1180			imageObj.attr('src',imageObj.attr('oriSrc'));
1181		}
1182		
1183		if(decoration){
1184			if(decoration['image_border'] && decoration['image_border1']){
1185				decoration['image_border1_width'] = decoration['image_border1_width'] ? decoration['image_border1_width'] : 0;
1186				$(this).css({"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1'],"margin":"-"+decoration['image_border1_width']+"px"});
1187				//$(this).parent().attr('align','center');
1188			}else if(decoration['image_border']){
1189				$(this).css({"border":0,"margin":"0px"});
1190			}
1191			
1192			
1193			if(decoration['image_opacity']){
1194				imageObj.css({"opacity":1}
1194);
1195			}
1196			
1197			if(decoration['image_overay2'] || decoration['image_overay2_text']){
1198				$(".goodsDisplayImageOveray2",this).hide();
1199			}
1200			
1201			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
1202				$(".goodsDisplayImageIcon",this).hide();
1203			}
1204			
1205			if((decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']) && decoration['image_send_over']=='y'){
1206				$(".goodsDisplayImageSend",this).hide();
1207			}
1208
1209		}
1210	});
1211}
1212
1213/* 어드민 : 이미지꾸미기 선택정보를 샘플이미지에 적용*/
1214function goods_image_decoration_data(goodsDisplayDecorationContainer){
1215	var data = {};
1216	
1217	if($("input.use_image_border",goodsDisplayDecorationContainer).is(":checked")){
1218		if($("input.image_border",goodsDisplayDecorationContainer).val().length){
1219			data.image_border1 = $("input.image_border1",goodsDisplayDecorationContainer).val();
1220			data.image_border1_width = $("input.image_border1_width",goodsDisplayDecorationContainer).val();
1221			data.image_border = $("input.image_border",goodsDisplayDecorationContainer).val();
1222			data.image_border_width = $("input.image_border_width",goodsDisplayDecorationContainer).val();
1223			data.image_border_type = $("select.image_border_type",goodsDisplayDecorationContainer).val();
1224		}
1225	}
1226	
1227	if($("input.use_image_opacity",goodsDisplayDecorationContainer).is(":checked")){
1228		if($("input.image_opacity",goodsDisplayDecorationContainer).val().length){
1229			data.image_opacity = $("input.image_opacity",goodsDisplayDecorationContainer).val();
1230		}
1231	}
1232	
1233	if($("input.use_image_icon",goodsDisplayDecorationContainer).is(":checked")){
1234		if($("input.image_icon",goodsDisplayDecorationContainer).val().length){
1235			data.image_icon = $("input.image_icon",goodsDisplayDecorationContainer).val();
1236		}		
1237		if($("select.image_icon_location",goodsDisplayDecorationContainer).val().length){
1238			data.image_icon_location = $("select.image_icon_location",goodsDisplayDecorationContainer).val();
1239		}
1240		if($("select.image_icon_over",goodsDisplayDecorationContainer).val().length){
1241			data.image_icon_over = $("select.image_icon_over",goodsDisplayDecorationContainer).val();
1242		}
1243	}
1244	
1245	if($("input.use_image_send",goodsDisplayDecorationContainer).is(":checked")){
1246		if($("input.image_send",goodsDisplayDecorationContainer).val().length){
1247			data.image_send = $("input.image_send",goodsDisplayDecorationContainer).val();
1248		}
1249		if($("select.image_send_location",goodsDisplayDecorationContainer).val().length){
1250			data.image_send_location = $("select.image_send_location",goodsDisplayDecorationContainer).val();
1251		}
1252		if($("select.image_send_over",goodsDisplayDecorationContainer).val().length){
1253			data.image_send_over = $("select.image_send_over",goodsDisplayDecorationContainer).val();
1254		}
1255	}
1256	
1257	if($("input.use_image_zzim",goodsDisplayDecorationContainer).is(":checked")){
1258		if($("input.image_zzim",goodsDisplayDecorationContainer).val().length){
1259			data.image_zzim = $("input.image_zzim",goodsDisplayDecorationContainer).val();
1260		}
1261		if($("input.image_zzim_on",goodsDisplayDecorationContainer).val().length){
1262			data.image_zzim_on = $("input.image_zzim_on",goodsDisplayDecorationContainer).val();
1263		}
1264		if($("select.image_send_location",goodsDisplayDecorationContainer).val().length){
1265			data.image_send_location = $("select.image_send_location",goodsDisplayDecorationContainer).val();
1266		}
1267		if($("select.image_send_over",goodsDisplayDecorationContainer).val().length){
1268			data.image_send_over = $("select.image_send_over",goodsDisplayDecorationContainer).val();
1269		}
1270	}
1271	
1272	
1273	if($("input.use_image_overay",goodsDisplayDecorationContainer).is(":checked")){
1274		if($("select.image_overay1",goodsDisplayDecorationContainer).val().length){
1275			data.image_overay1 = $("select.image_overay1",goodsDisplayDecorationContainer).val();
1276		}else if($("input.image_overay1_text",goodsDisplayDecorationContainer).val().length){
1277			data.image_overay1 = $("select.image_overay1",goodsDisplayDecorationContainer).val();
1278			data.image_overay1_text = $("input.image_overay1_text",goodsDisplayDecorationContainer).val();
1279		}
1280		
1281		if($("select.image_overay2",goodsDisplayDecorationContainer).val().length){
1282			data.image_overay2 = $("select.image_overay2",goodsDisplayDecorationContainer).val();
1283		}else if($("input.image_overay2_text",goodsDisplayDecorationContainer).val().length){
1284			data.image_overay2 = $("select.image_overay2",goodsDisplayDecorationContainer).val();
1285			data.image_overay2_text = $("input.image_overay2_text",goodsDisplayDecorationContainer).val();
1286		}
1287	}
1288	
1289	if($("input.use_image_slide",goodsDisplayDecorationContainer).is(":checked")){
1290		if($("input.image_slide",goodsDisplayDecorationContainer).val().length){
1291			data.image_slide = $("input.image_slide",goodsDisplayDecorationContainer).val();
1292		}
1293		if($("select.image_slide_type",goodsDisplayDecorationContainer).val().length){
1294			data.image_slide_type = $("select.image_slide_type",goodsDisplayDecorationContainer).val();
1295		}
1296	}
1297	
1298	if($("input.use_quick_shopping",goodsDisplayDecorationContainer).is(":checked")){
1299		if($("input[name='quick_shopping']",goodsDisplayDecorationContainer).val().length){
1300			data.quick_shopping = $("input[name='quick_shopping']",goodsDisplayDecorationContainer).val();
1301		}
1302	}
1303
1304	if($("input.use_seconde_image",goodsDisplayDecorationContainer).is(":checked")){
1305		data.use_seconde_image = "1";
1306	}
1307	
1308	var i,dataCnt = 0;
1309	for(i in data) {
1310		dataCnt++;
1311		data[i] = data[i].replace(/"/g,'\\"');
1312	}
1313
1314	var decoration = Base64.encode(JSONtoString(data));
1315
1316	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decorationLoaded",false);
1317	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).attr("decoration",decoration);
1318	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decoration",data);
1319	$("input.image_decoration",goodsDisplayDecorationContainer).val(decoration);
1320	
1321	/* 이미지꾸미기 이미지 설정 */
1322	set_goods_display_decoration(".goodsDisplayImageWrap");
1323}
1324
1325function set_info_item_data(goodsDisplayDecorationContainer){
1326	
1327	try{
1328		var info_item_settings = eval($(".info_settings",goodsDisplayDecorationContainer).val());
1329	}catch(e){
1330		var info_item_settings = [];
1331	};
1332	
1333	if(typeof info_item_settings == 'object'){
1334		/* 상품정보 항목 저장값 출력 */
1335		for(var i=0;i<info_item_settings.length;i++){
1336			
1337			var new_info_item = add_new_info_item(goodsDisplayDecorationContainer);
1338			var info_item_setting = info_item_settings[i];
1339	
1340			for(var key in info_item_setting){
1341				var cellSelector = ".info_item_cell_" + key;
1342				var selector = ".info_item_" + key;
1343				var selectValue = info_item_setting[key];
1344				
1345				if($(selector,new_info_item).length){
1346					switch($(selector,new_info_item)[0].tagName){
1347						case 'INPUT':
1348							if($(selector,new_info_item).attr('type')=='text'){
1349								$(selector,new_info_item).val(selectValue).change();
1350							}else if($(selector,new_info_item).attr('type')=='radio' ){
1351								$(selector,new_info_item).each(function(idx){ 
1352									if( $(this).val() == selectValue ) {
1353										$(this).attr('checked',true).change();
1354									} 
1355								});
1356							}else{
1357								$(selector,new_info_item).attr('checked',true);
1358							}
1359						break;
1360						case 'SELECT':
1361							$(selector,new_info_item).val(selectValue);
1362						break;
1363					}
1364				}
1365			}
1366			
1367			$(".info_item_kind",new_info_item).change();
1368		}
1369	}else{
1370		var idx=0;
1371		
1372		for(key in info_item_config){
1373			add_new_info_item(goodsDisplayDecorationContainer);
1374			$(".info_item_kind",goodsDisplayDecorationContainer).eq(idx).val(key).change();
1375			idx++;
1376		}
1377	}
1378	
1379	apply_input_style();
1380	
1381}
1382
1383function display_goods_view(seq, target, obj, kind) {
1384	var ban_style = new Array('sizeswipe', 'newswipe');
1385	if (obj != undefined && $(obj).closest('.designDisplay').hasClass('display_style3') && $.inArray($(obj).closest('.designDisplay').attr('displaystyle'), ban_style) < 0) {
1386		if (gl_display_now_page > 2)
1387			document.location.hash = (gl_display_now_page - 2) + 'y' + $(document).scrollTop();
1388	}
1389
1390	// GA4 연동을 위해 호출	
1391	if (kind == 'goods_view') {
1392		ga4_select_item(seq);
1393	}
1394
1395	switch (kind) {
1396		case 'provider':
1397			url = '/mshop/?m=' + seq;
1398			break;
1399		case 'bigdata':
1400			url = '/bigdata/catalog?no=' + seq;
1401			break;
1402		case 'goods_view':
1403		default:
1404			// 페이징 버튼이 있는 경우에만 nowpage 전달하도록 수정
1405			var nowpage = '';
1406			if (typeof $(".goods_display_more_btn").attr('nowpage') !== 'undefined') {
1407				nowpage = $(".goods_display_more_btn").attr('nowpage');
1408			}
1409			document.location.hash = nowpage + 'y' + $(document).scrollTop();
1410			url = '/goods/view?no=' + seq;
1411	}
1412
1413	if (target != '') {
1414		window.open(url);
1415	} else {
1416		/**
1417		 * hash 가 아래 OS 에 따라 history 가 다르게 동작됨
1418		 * andriod, PC vs IOS
1419		 */
1420		if (isMobile.IOS()) {
1421			location.href = url;
1422		} else {
1423			location.replace(url);
1424		}
1425	}
1426}
1427
1428function catalog_goods_view(seq){	
1429	document.location.hash = $(".goods_catalog_more_btn").attr('nowpage') + 'y' + $(document).scrollTop();	
1430	var url = '/goods/view?no='+seq;
1431	location.href = url;
1432    //  GA연동
1433    try {
1434        if  (seq)   {
1435            ga4_select_item(seq);
1436        }
1437    }   catch(e)    {
1438        console.log('GA4 select_item 이벤트 호출 mobile 에러',e);
1439    }
1440}
1441
1442/* 어드민 : 상품정보 항목 추가 */
1443function add_new_info_item(obj){
1444	var goodsDisplayDecorationContainer = $(obj).closest(".goodsDisplayDecorationContainer");
1445	
1446	$(".info_item_default .colorpicker",goodsDisplayDecorationContainer).customColorPicker("destroy");
1447	var new_info_item = $("div.info_item_default",goodsDisplayDecorationContainer).clone();
1448	new_info_item.removeClass("hide").removeClass("info_item_default").show();
1449	new_info_item.find("input.info_setting").removeAttr('disabled');
1450
1451	$("div.info_item_container",goodsDisplayDecorationContainer).append(new_info_item);
1452	
1453	$(".colorpicker",goodsDisplayDecorationContainer).customColorPicker();
1454	
1455	change_info_item(new_info_item);
1456
1457	$(".customFontDecoration",new_info_item).customFontDecoration({"change":function(){
1458		change_info_item(new_info_item);
1459	}});
1460	
1461	$(document).resize();
1462	
1463	return new_info_item;
1464}
1465
1466/* 어드민 : 상품정보 항목 삭제 */
1467function remove_info_item(obj){
1468	$(obj).closest("div.info_item").remove();
1469}
1470
1471/* 어드민 : 상품정보 항목 값 변경 */
1472function change_info_item(obj){
1473
1474	var info_item = $(obj).closest("div.info_item");
1475	var kind = $(".info_item_kind",info_item).val();
1476	var data = {};
1477	var result_string = '';
1478	
1479	if(!info_item_config[kind]) return;
1480	
1481	$(".info_item_cell",info_item).hide();
1482
1483	for(var i=0;i<info_item_config[kind].length;i++){
1484
1485		var key = info_item_config[kind][i];
1486
1487		var cellSelector = ".info_item_cell_" + key;
1488		var selector = ".info_item_" + key;
1489		var selectValue = "";
1490		
1491		$(cellSelector,info_item).show();
1492
1493		if($(selector,info_item).length){
1494			switch($(selector,info_item)[0].tagName){
1495				case 'INPUT':
1496					if($(selector,info_item).attr('type')=='text'){
1497						selectValue = $(selector,info_item).val();
1498					}else if($(selector,info_item).is(':checked')){
1499						selectValue = $(obj).val();
1500					}
1501				break;
1502				case 'SELECT':
1503					selectValue = $(selector,info_item).val();
1504				break;
1505			}
1506		}
1507		
1508		if(key=='font_decoration'){
1509			
1510			data[key] = selectValue.replace(/"/g,'\\"');
1511		}else{
1512			data[key] = selectValue;
1513		}
1514	}
1515
1516	result_string = (JSONtoString(data));	 				
1517
1518	$("input.info_setting",info_item).val(result_string);
1519	
1520
1521}
1522
1523/* 해당 상품의 관련상품 보기 */
1524function show_display_related_goods(obj,goods_seq){
1525	var goodsDisplayImageWrapObj = $(obj).closest('.goodsDisplayImageWrap');
1526	
1527	if($("#displayRelatedGoodsLayer").length){
1528		$("<div id='displayRelatedGoodsLayer'></div>").remove();
1529	}
1530	
1531	var html = "<div class='goodsPopupLayer' id='displayRelatedGoodsLayer'>";
1532	html += "<div class='goodsPopupLayerTitle'>해당 상품의 관련상품 보기</div>";
1533	html += "<div class='goodsPopupLayerClose'></div>";
1534	html += "<div class='goodsPopupLayerBody'>";
1535	html += "</div>";
1536	html += "</div>";
1537	
1538	$(html).hide().appendTo('body');
1539	
1540	$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
1541	
1542	$.ajax({
1543		'url' : '/goods/display_related_goods',
1544		'data' : {'goods_seq':goods_seq},
1545		'success' : function(res){
1546			
1547			$(goodsDisplayImageWrapObj).activity(false);
1548				
1549			$("#displayRelatedGoodsLayer").css({
1550				'top' : $(document).scrollTop()+goodsDisplayImageWrapObj.offset().top-$(document).scrollTop()+goodsDisplayImageWrapObj.outerHeight(),
1551				'left' : goodsDisplayImageWrapObj.offset().left
1552			}).show();
1553		
1554			$("#displayRelatedGoodsLayer .goodsPopupLayerClose").click(function(){
1555				$("#displayRelatedGoodsLayer").remove();
1556			});
1557			
1558			if(!$("#displayRelatedGoodsLayer").length){
1559				$("<div id='displayRelatedGoodsLayer'></div>").appendTo('body');
1560			}
1561	
1562			$("#displayRelatedGoodsLayer .goodsPopupLayerBody").html(res);
1563
1564			if(goodsDisplayImageWrapObj.offset().left+$("#displayRelatedGoodsLayer").outerWidth() > $(window).width()){
1565				$("#displayRelatedGoodsLayer").css('left',goodsDisplayImageWrapObj.offset().left - (goodsDisplayImageWrapObj.offset().left+$("#displayRelatedGoodsLayer").outerWidth()-$(window).width()));
1566			}
1567		}
1568	})
1569
1570	return false;	
1571}
1572
1573
1574/* 해당 상품의 이미지 더 보기 */
1575function show_display_goods_images(goodsDisplayImageWrapObj,goods_seq,image_slide_type){
1576	var imageObj = $(goodsDisplayImageWrapObj);
1577	
1578	if($(goodsDisplayImageWrapObj).find("#displayGoodsImagesLayer").length){
1579		$(document).click();
1580		//$("#displayGoodsImagesLayer").stop(true,true).remove();		
1581	}else{
1582		if(!$("#displayGoodsImagesLayer").length){
1583			$('body').append($("<div id='displayGoodsImagesLayer'></div>"));
1584		}
1585		//$(goodsDisplayImageWrapObj).after($("#displayGoodsImagesLayer"));
1586		
1587		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
1588
1589		$("#displayGoodsImagesLayer").stop(true,true).empty().hide().click(function(){return false;});
1590
1591		$.ajax({
1592			'url' : '/goods/display_goods_images',
1593			'data' : {'goods_seq':goods_seq,'image_slide_type':image_slide_type},
1594			'global' : false,
1595			'success' : function(html){
1596				
1597				$(goodsDisplayImageWrapObj).activity(false);
1598				
1599				$("#displayGoodsImagesLayer").html(html);
1600
1601				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsImagesLayer").width() > $(window).width()){
1602					var left = $(window).width()-$("#displayGoodsImagesLayer").width();
1603				}else{
1604					var left = imageObj.offset().left+imageObj.width();
1605				}
1606				
1607				$("#displayGoodsImagesLayer").css({
1608					'position' : 'absolute',
1609					'z-index' : 1000,
1610					'top' : imageObj.offset().top,
1611					'left' : left
1612				}).fadeIn();
1613				
1614				$("#displayGoodsSendLayer").stop(true,true).remove();
1615				$(document).one('click',function(e){
1616					$("#displayGoodsImagesLayer").stop(true,true).remove();					
1617				});
1618				
1619			}
1620		});
1621		
1622	}
1623	return false;	
1624}
1625
1626/* 상품 찜하기 버튼 클릭 */
1627function display_goods_zzim(btnObj,goods_seq,dozen){
1628	window.event.cancelBubble = true;
1629	window.event.returnValue = false;
1630
1631	var gl_item = $(btnObj).closest(".gl_item");
1632	
1633	$.ajax({
1634		'url' : '/mypage/wish_add_ajax_toggle',
1635		'data' : {'goods_seq':goods_seq},
1636		'dataType' : 'json',
1637		'global' : false,
1638		'success' : function(res){
1639			if(res.result == 'not_login'){
1640				parent.openDialogConfirm(getAlert("gv009"),400,140,function(){
1641					parent.location.replace(res.url);
1642				},function(){});
1643			} else if(res.result == 'add'){
1644				parent.openDialogConfirm(getAlert('mp089'),400,140,function(){
1645					parent.location.replace('/mypage/wish');
1646				},function(){
1647					if(dozen && $(btnObj).prop('class')){
1648						gl_item = $('.'+$(btnObj).prop('class'));
1649						$(gl_item).find(".zzimOnImg").show();
1650						$(gl_item).find(".zzimOffImg").hide();
1651					}else{
1652						$(gl_item).closest('.gl_item').find(".zzimOnImg").show();
1653						$(gl_item).closest('.gl_item').find(".zzimOffImg").hide();
1654					}
1655					cnt = res.cnt > 9999 ? '9,999+' : comma(res.cnt);
1656					if	($(gl_item).find('.goods_list_goods_zzim_count').length > 0) {
1657						$(gl_item).find('.goods_list_goods_zzim_count').html(cnt);
1658						bak_src = $(gl_item).find('.goods_list_goods_zzim_img').attr("src");
1659						bak_src = bak_src.replace(/icon_zzim_off/g,'icon_zzim_on');
1660						$(gl_item).find('.goods_list_goods_zzim_img').attr("src",bak_src+"#" + Math.random());
1661					}
1662				});
1663				
1664                // 채널톡 위시리스트 이벤트
1665                if (typeof ChannelIO != 'undefined') {
1666                    channeltalk_wish_in(goods_seq,'display_goods_zzim',gl_item);
1667				}; 
1668			} else if(res.result == 'del'){
1669				if(dozen && $(btnObj).prop('class')){
1670					gl_item = $('.'+$(btnObj).prop('class'));
1671					$(gl_item).find(".zzimOffImg").show();
1672					$(gl_item).find(".zzimOnImg").hide();
1673				}else{
1674					$(gl_item).closest('.gl_item').find(".zzimOffImg").show();
1675					$(gl_item).closest('.gl_item').find(".zzimOnImg").hide();
1676				}
1677				act = $(gl_item).closest('.gl_item').find('.goodsDisplayBottomFunc div:eq(0)').attr('act') == 'hover' ? 'hover' : '';
1678				$(gl_item).closest('.gl_item').find('.display_like').attr('act',act);
1679				cnt = res.cnt > 9999 ? '9,999+' : comma(res.cnt);
1680				if	($(gl_item).find('.goods_list_goods_zzim_count').length > 0) {
1681					$(gl_item).find('.goods_list_goods_zzim_count').html(cnt);
1682					bak_src = $(gl_item).find('.goods_list_goods_zzim_img').attr("src");
1683					bak_src = bak_src.replace(/icon_zzim_on/g,'icon_zzim_off');
1684					$(gl_item).find('.goods_list_goods_zzim_img').attr("src",bak_src+"#" + Math.random());
1685				}
1686				openDialogAlert(getAlert("gv057"),300,150,function(){});
1687			}
1688		}						
1689	});
1690}
1691
1692/* 상품 퀵뷰 버튼 클릭 */
1693function display_goods_quickview(btnObj,goods_seq){
1694
1695	if(!goods_seq) return;
1696
1697	var basicWidth = 1000;
1698	$.ajax({
1699		'url' : '/common/arrLayoutBasic',
1700		'dataType' : 'json',
1701		'async' : false,
1702		'success' : function(res){
1703			basicWidth = num(res.basic.width);
1704		}
1705	});
1706
1707	if($("#goodsQuickViewLayer").length){
1708		$("<div id='goodsQuickViewLayer'></div>").remove();
1709	}
1710
1711	var html = "<div class='goodsPopupLayer' id='goodsQuickViewLayer'>";
1712	html += "<div class='goodsPopupLayerTitle'>미리보기</div>";
1713	html += "<div class='goodsPopupLayerClose'></div>";
1714	html += "<div class='goodsPopupLayerBody'>";
1715	html += "<div class='goodsPopupLayerBtnWrap'><a href='/goods/view?no="+goods_seq+"'><span class='goodsPopupLayerMoreBtn'></span></a></div>";
1716	html += "</div>";
1717	html += "</div>";
1718
1719	$(html).hide().appendTo('body');
1720
1721	$("#goodsQuickViewLayer").css({
1722		'top' : $(document).scrollTop()+10,
1723		'left' : '50%',
1724		'margin-left' : (basicWidth+40)/2*-1,
1725		'width' : basicWidth+40,
1726		'height' : $(window).height()-100
1727	}).show();
1728
1729	$("#goodsQuickViewLayer .goodsPopupLayerClose").click(function(){
1730		$("#goodsQuickViewLayer").remove();
1731	});
1732	$("<iframe frameborder='0'></iframe>").prependTo($("#goodsQuickViewLayer .goodsPopupLayerBody")).css({
1733		'margin-top' : '10px',
1734		'width' : '100%',
1735		'height' : $(window).height()-100-150
1736	}).attr("src","/goods/view?no="+goods_seq+"&quickview=1");
1737
1738}
1739
1740/* 상품 보내기 버튼 클릭 */
1741function display_goods_send(btnObj,location){
1742	var goodsDisplayImageWrapObj = $(btnObj).closest(".goodsDisplayItemWrap").find(".goodsDisplayImageWrap");
1743	var displaystyle = $(btnObj).closest('.designDisplay').attr('displaystyle');
1744	var goodsInfo = $(goodsDisplayImageWrapObj).data("goodsInfo");
1745	var imageObj = $(goodsDisplayImageWrapObj);
1746	
1747	if($("#displayGoodsSendLayer").length){
1748		$(document).click();
1749	}else{
1750		if(!$("#displayGoodsSendLayer").length){
1751			if(displaystyle != 'rolling_h')
1752				goodsDisplayImageWrapObj.after($("<div id='displayGoodsSendLayer'></div>"));
1753			else
1754				goodsDisplayImageWrapObj.append($("<div id='displayGoodsSendLayer'></div>"));
1755		}
1756		goodsDisplayImageWrapObj.after($("#displayGoodsSendLayer"));
1757
1758		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
1759
1760		$("#displayGoodsSendLayer").css({
1761			'border':'1px solid #e1e1e1',
1762			'padding':'2px 0px 2px 3px',
1763			'background-color':'#fff',
1764			'white-space':'nowrap',
1765			'min-width':'70px'
1766		}).stop(true,true).empty().hide().click(function(){return false;});
1767
1768		$.ajax({
1769			'url' : '/common/snslinkurl_tag',
1770			'data' : {'no':goodsInfo.goods_seq,'goods_name':goodsInfo.goods_name},
1771			'global' : false,
1772			'success' : function(html){
1773				
1774				$(goodsDisplayImageWrapObj).activity(false);
1775				
1776				$("#displayGoodsSendLayer").html(html);
1777
1778				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsSendLayer").outerWidth() > $(window).width()){
1779					var left = $("#displayGoodsSendLayer").outerWidth() * -1;
1780				}else{
1781					var left = goodsDisplayImageWrapObj.position().left+imageObj.width();
1782				}
1783				
1784				if(location=='top'){
1785					var top = imageObj.position().top;
1786				}else{
1787					var goodsDisplayItemWrapObj = goodsDisplayImageWrapObj.closest('.goodsDisplayItemWrap');
1788					var top = imageObj.position().top+imageObj.height()+$(".goodsDisplayQuickShopping",goodsDisplayItemWrapObj).height()-$("#displayGoodsSendLayer").outerHeight();
1789				}
1790				
1791				if(displaystyle != 'rolling_h'){
1792					$("#displayGoodsSendLayer").css({
1793						'position' : 'absolute',
1794						'z-index' : 1000,
1795						'top' : top,
1796						'left' : left
1797					}).fadeIn();
1798				}else{
1799					$("#displayGoodsSendLayer").css({
1800						'position' : 'absolute',
1801						'z-index' : 1000,
1802						'top' : $(btnObj).height()+5,
1803						'right' : 15
1804					}).fadeIn();
1805				}
1806				
1807				$("#displayGoodsImagesLayer").stop(true,true).remove();
1808				$(document).one('click',function(e){
1809					$("#displayGoodsSendLayer").stop(true,true).remove();
1810				});
1811				
1812			}
1813		});
1814		
1815	}
1816	return false;	
1817}
1818
1819// 자동노출조건 설명
1820function setCriteriaDescription(){
1821	$(".displayTabGoodsContainer, .relationGoodsContainer").each(function(){
1822		var descriptions = new Array();
1823		
1824		criteria = $(".displayCriteria",this).val().split(",");
1825		if(criteria=="") return;
1826		for(var i=0;i<criteria.length;i++){
1827			var div = criteria[i].split("=");
1828
1829			if(div[1]){
1830				var name = "";
1831				var value = decodeURIComponent(div[1]);
1832				switch(div[0]){
1833					case "selectGoodsName": name = "검색어"; break;
1834					case "selectGoodsView": name = "상품노출"; break;
1835					case "selectGoodsStatus": name = "상품상태"; break;
1836					case "selectCategory1": name = "카테고리1"; break;
1837					case "selectCategory2": name = "카테고리2"; break;
1838					case "selectCategory3": name = "카테고리3"; break;
1839					case "selectCategory4": name = "카테고리4"; break;
1840					case "selectBrand1": name = "브랜드1"; break;
1841					case "selectBrand2": name = "브랜드2"; break;
1842					case "selectBrand3": name = "브랜드3"; break;
1843					case "selectBrand4": name = "브랜드4"; break;
1844					case "selectLocation1": name = "지역1"; break;
1845					case "selectLocation2": name = "지역2"; break;
1846					case "selectLocation3": name = "지역3"; break;
1847					case "selectLocation4": name = "지역4"; break;
1848					case "selectStartPrice": name = "최소가격"; value = comma(value)+"원"; break;
1849					case "selectEndPrice": name = "최대가격"; value = comma(value)+"원"; break;
1850					case "auto_order": name = "자동노출기준"; break;
1851					case "auto_term_type": name = "자동노출 정렬 기준일"; break;
1852					case "auto_term": name = "자동노출 최근n일"; break;
1853					case "auto_start_date": name = "자동노출 시작일"; break;
1854					case "auto_end_date": name = "자동노출 종료일"; break;
1855					case "selectEvent": name = "이벤트고유번호"; break;
1856					case "selectEventBenefits": name = "이벤트혜택고유번호"; break;
1857					case "selectGoodsRelationCategory": name = "해당 카테고리"; value=""; break;
1858					case "selectGoodsRelationBrand": name = "해당 브랜드"; value=""; break;
1859					case "selectGoodsRelationLocation": name = "해당 지역"; value=""; break;
1860					/*
1861					default:
1862						name = div[0];
1863					break;
1864					*/
1865				}
1866				
1867				switch(div[1]){
1868					case "look": value = "노출"; break;
1869					case "notLook": value = "미노출"; break;
1870					case "normal": value = "정상"; break;
1871					case "runout": value = "미노출"; break;
1872					case "purchasing": value = "재고확보중"; break;
1873					case "unsold": value = "판매중지"; break;
1874					case "relative": value = "최근"; break;
1875					case "absolute": value = "고정"; break;
1876					case "newly": value = "최근등록순"; break;
1877					case "deposit": value = "판매인기순(구매갯수)"; break;
1878					case "deposit_price": value = "판매인기순(구매금액)"; break;
1879					case "review": value = "상품후기많은순"; break;
1880					case "view": value = "상품조회많은순"; break;
1881					case "cart": value = "장바구니"; break;
1882					case "wish": value = "위시리스트"; break;
1883				}
1884
1885				if(div[2]) value = div[2];
1886				
1887				if(name) descriptions.push(name+(value ? "→"+value : ''));
1888			}
1889		}
1890		
1891		if(descriptions && descriptions.length){
1892			$(".displayCriteriaDesc",this).html("<b>[ì¡°ê±´]</b> "+descriptions.join(", "));
1893		}else{
1894			$(".displayCriteriaDesc",this).html("");
1895		}
1896	});
1897	
1898}
1899
1900function decode_base64_json(json){
1901	var ret = '';
1902	if	(json) ret = JSON.parse(Base64.decode(json));
1903	return ret;
1904}
1905
1906function get_icon_replace(txt, set_obj){
1907	var ret = txt;
1908	if	(txt) { 
1909		var rep = {
1910			'{discount}'	: '10',
1911			'{brand}'		: '퍼스트몰',
1912			'{brandeng}'	: 'firstamll',
1913			'{bestnum}'		: '1'
1914		}			
1915		if	(set_obj) rep = set_obj;
1916		$.each(rep,function(k, v){
1917			txt = txt.split(k).join(v);
1918		});
1919		ret = txt;			
1920	}
1921	return ret;
1922}
1923
1924function set_condition_icon(target,obj,condition,background_icon){
1925	var cnt				= obj.length;
1926	var background_icon = decode_base64_json(background_icon);
1927	var icon_class		= 'icon_solo';
1928	var icon_class_arr	= ['icon_top','icon_bottom'];
1929	var icon_discount	= ['icon_top_discount','icon_top_discount_per'];
1930	if	(cnt == 1) icon_class_arr[0] = icon_class;
1931	if	(cnt == 2 && obj[0].key == 'discount_per')
1932		icon_discount	= ['icon_solo_discount','icon_solo_discount_per'];
1933	$(target).html('');
1934	for(i=0; i<cnt; i++){
1935		var txt_obj = $('<span>');
1936		var num_obj = $('<num>');
1937		var txt_css = {
1938			'font-size'		:	'9pt',
1939			'color'			:	'#000000',
1940			'font-weight'	:	''
1941		};
1942
1943		txt_obj.text(get_icon_replace(obj[i].txt, condition));
1944
1945		if	(obj[i].txt_color) 
1946			txt_css['color'] = obj[i].txt_color;
1947		if	(obj[i].txt_size) 
1948			txt_css['font-size'] = parseInt(obj[i].txt_size)+'pt';
1949		if	(obj[i].txt_font) 
1950			txt_css['font-family'] = obj[i].txt_font;
1951		if	(obj[i].txt_weight) 
1952			txt_css['font-weight'] = 'bold';
1953
1954		if	(obj[i].key == 'discount_per') {
1955			txt_obj.addClass(icon_discount[i]);
1956		}else{
1957			txt_obj.addClass(icon_class_arr[i]);
1958		}
1959
1960		$(target).append(txt_obj.css(txt_css));
1961	}
1962
1963	if	(background_icon['type'] == 'image') {
1964		$(target).css({'background':'url("/data/icon/goodsdisplay/background/'+background_icon['img']+'") no-repeat center','width':'60px','height':'60px','opacity':'1'});
1965	}else{
1966		var custom_css = {};
1967		custom_css['background'] = '';
1968		if	(background_icon['width']) {
1969			var width = background_icon['width']+'px';
1970			var left_width = (background_icon['width']*0.6)+'px';
1971			var right_width = background_icon['width']-(background_icon['width']*0.6)+'px';
1972			custom_css['width'] = width;
1973			if	($(target).find('.icon_solo').length > 0 || $(target).find('.icon_top').length > 0) {
1974				$(target).find('.icon_solo').css('width',width);
1975				$(target).find('.icon_top').css('width',width);
1976				$(target).find('.icon_bottom').css('width',width);
1977			}
1978			if	($(target).find('.icon_top_discount').length > 0 || $(target).find('.icon_solo_discount').length > 0) {
1979				$(target).find('.icon_top_discount').css('width',left_width);
1980				$(target).find('.icon_solo_discount').css('width',left_width);
1981				$(target).find('.icon_top_discount_per').css('width',right_width);
1982				$(target).find('.icon_solo_discount_per').css('width',right_width);
1983			}
1984		}
1985			
1986		if	(background_icon['height']) {
1987			var height = background_icon['height']+'px';
1988			var half_height = background_icon['height']/2+'px';
1989			custom_css['height'] = height;
1990			if	($(target).find('.icon_solo').length > 0 || $(target).find('.icon_top').length > 0) {
1991				$(target).find('.icon_solo').css({'height':height,'line-height':height});
1992				$(target).find('.icon_top').css({'height':half_height,'line-height':half_height});
1993				$(target).find('.icon_bottom').css({'height':half_height,'line-height':half_height});
1994			}
1995			if	($(target).find('.icon_top_discount').length > 0 || $(target).find('.icon_solo_discount').length > 0) {
1996				$(target).find('.icon_top_discount').css({'height':half_height,'line-height':half_height});
1997				$(target).find('.icon_solo_discount').css({'height':height,'line-height':height});
1998				$(target).find('.icon_top_discount_per').css({'height':half_height,'line-height':half_height});
1999				$(target).find('.icon_solo_discount_per').css({'height':height,'line-height':height});
2000			}
2001		}
2002
2003		if	(background_icon['color'])
2004			custom_css['background-color'] = background_icon['color'];
2005
2006		if	(background_icon['width'])
2007			custom_css['opacity'] = 1-background_icon['opacity']/100;
2008		$(target).css(custom_css);
2009	}
2010}
2011
2012// 우측하단 옵션보기
2013function display_goods_show_opt(obj,goods_seq){
2014	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
2015		display_goods_show_opt_light(obj,goods_seq);
2016	}else{
2017		display_goods_show_opt_heavy(obj,goods_seq);
2018	}
2019}
2020
2021
2022function display_goods_show_opt_light(obj,goods_seq){
2023	if ( $('.quick_opt_view').lenght > 0 ) {
2024		$('.quick_opt_view').remove();
2025	}
2026
2027	event.cancelBubble	= true;
2028	event.returnValue	= false;
2029
2030	opt_obj				= $(obj);
2031	parent_id			= opt_obj.closest('.designDisplay').prop('id');
2032	parent_img			= opt_obj.closest('.goodsDisplayImageWrap');
2033	quick_opt_id		= 'quick_opt_'+parent_id;
2034	opt_data			= $('.display_opt_bak',opt_obj).html();
2035	x_loc				= parent_img.offset().left;
2036	y_loc				= parent_img.offset().top+parent_img.height();
2037
2038	if($(window).width()-x_loc < 400) x_loc = x_loc-(400-parent_img.width());
2039
2040	opt_html = $('#'+quick_opt_id);
2041
2042	if	($('body').find('#'+quick_opt_id).length == 0) {
2043		opt_html = $("<div>");
2044		opt_html.addClass('quick_opt_view').prop('id',quick_opt_id);
2045		html = [];
2046		x = -1;
2047
2048		html[++x] = '<div class="quick_opt_view_wrap">';
2049		html[++x] = '<div class="quick_opt_view_close" onclick="quick_opt_view_close()">X</div>';
2050		html[++x] = '<div class="quick_option_title">옵션 미리보기</div>';
2051		html[++x] = '<div class="quick_option_area"></div>';
2052		html[++x] = '</div>';
2053	}
2054
2055	$('.quick_option_area', opt_html).html('');
2056
2057	if	(!opt_data) {
2058		$.getJSON('/goods/get_goods_default_option?goods_seq='+goods_seq, function(data) {
2059			html = [];
2060			x = -1;
2061			html[++x] = '<ul>';
2062			$.each(data.result,function(){
2063				option_arr = new Array();
2064				if	(this.option_view == 'Y') {
2065					if	(this.option1) option_arr.push(this.option1);
2066					if	(this.option2) option_arr.push(this.option2);
2067					if	(this.option3) option_arr.push(this.option3);
2068					if	(this.option4) option_arr.push(this.option4);
2069					if	(this.option_title != null)
2070						html[++x] = '<li>'+this.option_title+'-'+option_arr.join('/')+'</li>';
2071					else
2072						html[++x] = '<li>옵션이 없는 상품입니다.</li>';
2073				}
2074			});
2075			html[++x] = '</ul>';
2076			$('.quick_option_area', opt_html).html(html.join(''));
2077			$('.display_opt_bak', opt_obj).html(html.join(''));
2078		}).complete(function() {
2079			parent_img.append(opt_html);
2080			$('.quick_opt_view').show();
2081		});
2082	}else{
2083		$('.quick_option_area', opt_html).html(opt_data);
2084	}
2085
2086	opt_html.append(html.join(''));
2087
2088	/*
2089	opt_html.bind('mouseenter',function(){
2090		parent_img.trigger('mouseenter');
2091	}).bind('mouseleave',function(){
2092		parent_img.trigger('mouseleave');
2093	});
2094	*/
2095
2096	//$('.quick_opt_view').css({'left':x_loc,'top':y_loc,'display':'inline-block','z-index':9000});
2097	opt_obj.attr({'open':true});
2098
2099}
2100
2101/* 우측하단 옵션 미리보기 heavy 용 */
2102function display_goods_show_opt_heavy(obj,goods_seq){
2103	event.cancelBubble	= true;
2104	event.returnValue	= false;
2105
2106	opt_obj				= $(obj);
2107	parent_id			= opt_obj.closest('.designDisplay').prop('id');
2108	parent_wrap			= opt_obj.closest('.goodsDisplayItemWrap');
2109	parent_img			= opt_obj.closest('.goodsDisplayImageWrap');
2110	quick_opt_id		= 'quick_opt_'+parent_id;
2111	opt_data			= $('.display_opt_bak',opt_obj).html();
2112	x_loc				= parent_wrap.offset().left;
2113	y_loc				= parent_img.offset().top+parent_img.height();
2114
2115	if($(window).width()-x_loc < 400) x_loc = x_loc-(400-parent_wrap.width());
2116
2117	opt_html = $('#'+quick_opt_id);
2118
2119	if	($('body').find('#'+quick_opt_id).length == 0) {
2120		opt_html = $("<div>");
2121		opt_html.addClass('quick_opt_view').prop('id',quick_opt_id);
2122		html = [];
2123		x = -1;
2124
2125		html[++x] = '<div class="quick_opt_view_wrap">';
2126		html[++x] = '<div class="quick_opt_view_close" onclick="quick_opt_view_close()">X</div>';
2127		html[++x] = '<div class="quick_option_title">옵션 미리보기</div>';
2128		html[++x] = '<div class="quick_option_area"></div>';
2129		html[++x] = '</div>';
2130
2131		opt_html.append(html.join(''));
2132		$('body').append(opt_html);
2133		opt_html.bind('mouseenter',function(){
2134			parent_img.trigger('mouseenter');
2135		}).bind('mouseleave',function(){
2136			parent_img.trigger('mouseleave');
2137		});
2138	}
2139
2140	$('.quick_option_area', opt_html).html('');
2141
2142	if	(!opt_data) {
2143		$.getJSON('/goods/get_goods_default_option?goods_seq='+goods_seq, function(data) {
2144			html = [];
2145			x = -1;
2146			html[++x] = '<ul>';
2147			$.each(data.result,function(){
2148				option_arr = new Array();
2149				if	(this.option_view == 'Y') {
2150					if	(this.option1) option_arr.push(this.option1);
2151					if	(this.option2) option_arr.push(this.option2);
2152					if	(this.option3) option_arr.push(this.option3);
2153					if	(this.option4) option_arr.push(this.option4);
2154					if	(this.option_title != null)
2155						html[++x] = '<li>'+this.option_title+'-'+option_arr.join('/')+'</li>';
2156					else
2157						html[++x] = '<li>옵션이 없는 상품입니다.</li>';
2158				}
2159			});
2160			html[++x] = '</ul>';
2161			$('.quick_option_area', opt_html).html(html.join(''));
2162			$('.display_opt_bak', opt_obj).html(html.join(''));
2163		});
2164	}else{
2165		$('.quick_option_area', opt_html).html(opt_data);
2166	}
2167
2168	$('.quick_opt_view').css({'left':x_loc,'top':y_loc,'display':'inline-block','z-index':9000});
2169	opt_obj.attr({'open':true});
2170}
2171
2172/* 상품 보내기 버튼 클릭 */
2173function display_goods_send(btnObj,location,goods_seq, goods_name){
2174	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
2175		return display_goods_send_light(btnObj,location,goods_seq, goods_name);
2176	}else{
2177		return display_goods_send_heavy(btnObj,location);
2178	}
2179}
2180
2181/* 상품 공유하기 버튼 클릭 heavy 용 */
2182function display_goods_send_heavy(btnObj,location){
2183	event.cancelBubble = true;
2184	event.returnValue = false;
2185
2186	var goodsDisplayImageWrapObj = $(btnObj).closest(".goodsDisplayItemWrap").find(".goodsDisplayImageWrap");
2187	var displaystyle = $(btnObj).closest('.designDisplay').attr('displaystyle');
2188	var goodsInfo = $(goodsDisplayImageWrapObj).data("goodsInfo");
2189	var imageObj = $(goodsDisplayImageWrapObj).find("img:eq(0)");
2190
2191	if($("#displayGoodsSendLayer").length){
2192		$(document).click();
2193	}else{
2194		if(!$("#displayGoodsSendLayer").length){
2195			if(displaystyle != 'rolling_h')
2196				goodsDisplayImageWrapObj.after($("<div id='displayGoodsSendLayer'></div>"));
2197			else
2198				goodsDisplayImageWrapObj.append($("<div id='displayGoodsSendLayer'></div>"));
2199		}
2200		goodsDisplayImageWrapObj.after($("#displayGoodsSendLayer"));
2201
2202		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
2203
2204		$("#displayGoodsSendLayer").css({
2205			'border':'1px solid #e1e1e1',
2206			'padding':'2px 0px 2px 3px',
2207			'background-color':'#fff',
2208			'white-space':'nowrap',
2209			'min-width':'70px'
2210		}).stop(true,true).empty().hide().click(function(){return false;});
2211
2212		$.ajax({
2213			'url' : '/common/snslinkurl_tag',
2214			'data' : {'no':goodsInfo.goods_seq,'goods_name':goodsInfo.goods_name},
2215			'global' : false,
2216			'success' : function(html){
2217
2218				$(goodsDisplayImageWrapObj).activity(false);
2219
2220				$("#displayGoodsSendLayer").html(html);
2221
2222				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsSendLayer").outerWidth() > $(window).width()){
2223					var left = $("#displayGoodsSendLayer").outerWidth() * -1;
2224				}else{
2225					var left = goodsDisplayImageWrapObj.position().left+imageObj.width();
2226				}
2227
2228				if(location=='top'){
2229					var top = imageObj.position().top;
2230				}else{
2231					var goodsDisplayItemWrapObj = goodsDisplayImageWrapObj.closest('.goodsDisplayItemWrap');
2232					var top = imageObj.position().top+imageObj.height()+$(".goodsDisplayQuickShopping",goodsDisplayItemWrapObj).height()-$("#displayGoodsSendLayer").outerHeight();
2233				}
2234
2235				$("#displayGoodsSendLayer").css({
2236					'position' : 'absolute',
2237					'z-index' : 1000,
2238					'top' : top,
2239					'right' : 0
2240				}).fadeIn();
2241
2242				$("#displayGoodsImagesLayer").stop(true,true).remove();
2243				$(document).one('click',function(e){
2244					$("#displayGoodsSendLayer").stop(true,true).remove();
2245				});
2246
2247			}
2248		});
2249
2250	}
2251	return false;
2252}
2253
2254/* 상품 공유하기 버튼 클릭 light 용 */
2255function display_goods_send_light(btnObj, location, goods_seq, goods_name){
2256
2257	event.cancelBubble = true;
2258	event.returnValue = false;
2259
2260	var goodsDisplayImageWrapObj = $(btnObj).closest(".goodsDisplayImageWrap");
2261	var displaystyle = $(btnObj).closest('.designDisplay').attr('displaystyle');
2262	var imageObj = $(goodsDisplayImageWrapObj).find("img:eq(0)");
2263
2264	if($("#displayGoodsSendLayer").length){
2265		$(document).click();
2266	}else{
2267		if(!$("#displayGoodsSendLayer").length){
2268			if(displaystyle != 'rolling_h')
2269				goodsDisplayImageWrapObj.after($("<div id='displayGoodsSendLayer'></div>"));
2270			else
2271				goodsDisplayImageWrapObj.append($("<div id='displayGoodsSendLayer'></div>"));
2272		}
2273		goodsDisplayImageWrapObj.after($("#displayGoodsSendLayer"));
2274
2275		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
2276
2277		$("#displayGoodsSendLayer").css({
2278			'border':'1px solid #e1e1e1',
2279			'padding':'2px 0px 2px 3px',
2280			'background-color':'#fff',
2281			'white-space':'nowrap',
2282			'min-width':'70px'
2283		}).stop(true,true).empty().hide().click(function(){return false;});
2284
2285		$.ajax({
2286			'url' : '/common/snslinkurl_tag',
2287			'data' : {'no': goods_seq,'goods_name': goods_name},
2288			'global' : false,
2289			'success' : function(html){
2290
2291				$(goodsDisplayImageWrapObj).activity(false);
2292
2293				$("#displayGoodsSendLayer").html(html);
2294
2295				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsSendLayer").outerWidth() > $(window).width()){
2296					var left = $("#displayGoodsSendLayer").outerWidth() * -1;
2297				}else{
2298					var left = goodsDisplayImageWrapObj.position().left+imageObj.width();
2299				}
2300
2301				if(location=='top'){
2302					var top = imageObj.position().top;
2303				}else{
2304					var goodsDisplayItemWrapObj = goodsDisplayImageWrapObj.closest('.goodsDisplayItemWrap');
2305					var top = imageObj.height();
2306				}
2307
2308				$("#displayGoodsSendLayer").css({
2309					'position' : 'absolute',
2310					'z-index' : 1000,
2311					'top' : top,
2312					'right' : 0
2313				}).fadeIn();
2314
2315				$("#displayGoodsImagesLayer").stop(true,true).remove();
2316				$(document).one('click',function(e){
2317					$("#displayGoodsSendLayer").stop(true,true).remove();
2318				});
2319
2320			}
2321		});
2322
2323	}
2324	return false;
2325}
2326
2327function quick_opt_view_close(){
2328	opt_obj.attr({'open':false});
2329	$('.quick_opt_view').remove();
2330}
2331
2332// ga4 select_item 호출
2333function ga4_select_item(seq){
2334    if (seq != '' || seq != null || typeof seq != 'undefined') {
2335        $.ajax({
2336            url: "/goods/now_goods",
2337            data: {'seq' : seq},
2338            dataType: 'json',
2339            type: 'POST',
2340            success: function (res) {
2341                gtag("event", "select_item", {
2342                    items: [res]
2343                  });
2344            },error: function (xhr) {
2345                console.log('GA4 select_item 이벤트 발생 에러 :',xhr.responseText);
2346            } 
2347        });
2348    }
2349
2350}

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.