PageSourceSearch

https://skoolooks.com/app/javascript/js/goods-display.js?dummy=20261007133138

js skoolooks.com collected 2026-10-07 04:32:26 UTC 230,589 bytes, 5,815 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
7		/* 샘플이미지 : 사이즈변경 */
8		$('.display_set_wrap').each(function(){
9			var goodsDisplayDecorationContainer = this;
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
17		$(".goodsDisplayDecorationContainer").each(function(){
18			var goodsDisplayDecorationContainer = this;
19
20			/* 이미지꾸미기 - 아이콘 선택창 열기 버튼  */
21			$(".image_icon_select",goodsDisplayDecorationContainer).bind("click",function(){
22				var uniqueKey = "image_icon_select_"+Math.floor(Math.random()*10000000);
23				$(this).attr('uniqueKey',uniqueKey);
24				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
25				$("#displayImageIconPopup input[name='subPath']").val('');
26				set_display_image_icon();
27				$('.icon_set_live').removeClass('icon_set_live');
28				$(this).closest('.display_set_wrap').addClass('icon_set_live');
29				show_icon_setting();
30				$('.icon_tab_title').show();
31				if	($('.image_icon_type', $('.icon_set_live')).val() != 'condition')
32					$('.icon_title_1').click().addClass('use');
33				else
34					$('.icon_title_2').click().addClass('use');
35				$('#displayImageIconPopup').removeClass('limit_func_list');
36				if	($(this).closest('.display_set_wrap').find('.displayImageIconPopupLimit').hasClass('limit_func_list')) {
37					$('#displayImageIconPopup').addClass('limit_func_list');
38				}
39				openDialog("아이콘 <span class='desc'>조건 없이 노출 또는 조건 만족 시 노출로 설정하세요.</span>", "#displayImageIconPopup", {"width":"930","height":"820","show" : "fade","hide" : "fade"});
40			});
41
42			/* 이미지꾸미기 - 보내기아이콘 선택창 열기 버튼  */
43			$(".image_send_select",goodsDisplayDecorationContainer).bind("click",function(){
44				var uniqueKey = "image_send_select_"+Math.floor(Math.random()*10000000);
45				$(this).attr('uniqueKey',uniqueKey);
46				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
47				$("#displayImageIconPopup input[name='subPath']").val('send');
48				set_display_image_send();
49				$('.icon_tab_title').hide();
50				$('.icon_tab1').show();
51				$('.icon_tab2').hide();
52				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
53			});
54
55			/* 이미지꾸미기 - 찜 아이콘 선택창 열기 버튼  */
56			$(".image_zzim_select",goodsDisplayDecorationContainer).bind("click",function(){
57				var uniqueKey = "image_zzim_select_"+Math.floor(Math.random()*10000000);
58				$(this).attr('uniqueKey',uniqueKey);
59				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
60				$("#displayImageIconPopup input[name='subPath']").val('zzim');
61				set_display_image_zzim();
62				$('.icon_tab_title').hide();
63				$('.icon_tab1').show();
64				$('.icon_tab2').hide();
65				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
66			});
67
68			/* 이미지꾸미기 - 찜 아이콘 선택창 열기 버튼  */
69			$(".image_zzim_on_select",goodsDisplayDecorationContainer).bind("click",function(){
70				var uniqueKey = "image_zzim_on_select_"+Math.floor(Math.random()*10000000);
71				$(this).attr('uniqueKey',uniqueKey);
72				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
73				$("#displayImageIconPopup input[name='subPath']").val('zzim_on');
74				set_display_image_zzim_on();
75				$('.icon_tab_title').hide();
76				$('.icon_tab1').show();
77				$('.icon_tab2').hide();
78				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
79			});
80
81			/* 이미지꾸미기 - 이미지더보기 아이콘 선택창 열기 버튼  */
82			$(".image_slide_select",goodsDisplayDecorationContainer).bind("click",function(){
83				var uniqueKey = "image_slide_select_"+Math.floor(Math.random()*10000000);
84				$(this).attr('uniqueKey',uniqueKey);
85				$("#displayImageIconPopup input[name='uniqueKey']").val(uniqueKey);
86				$("#displayImageIconPopup input[name='subPath']").val('slide');
87				set_display_image_slide();
88				$('.icon_tab_title').hide();
89				$('.icon_tab1').show();
90				$('.icon_tab2').hide();
91				openDialog("아이콘 선택  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayImageIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
92			});
93
94			/* 이미지꾸미기 - 퀵바 아이콘 팝업 열기 버튼  */
95			$("table.quick_shopping_container",goodsDisplayDecorationContainer).bind("click",function(){
96				var uniqueKey = "quick_icon_select_"+Math.floor(Math.random()*10000000);
97				$(this).attr('uniqueKey',uniqueKey);
98				$("#displayQuickIconPopup input[name='uniqueKey']").val(uniqueKey);
99				$("#displayQuickIconPopup .quick_shopping_icon_img").each(function(){
100					var randKey = Math.floor(Math.random()*10000000);
101					$(this).attr('src',$(this).attr('src').split('#')[0]+'#'+randKey);
102				});
103
104				var quick_shopping = eval("("+$(this).closest('.image_decoration_table').find("input[name='quick_shopping']").val()+")");
105				for(var i=0;i<quick_shopping.length;i++){
106					$("#displayQuickIconPopup input[name='quick_shopping_icon[]'][value='"+quick_shopping[i]+"']").attr('checked',true);
107				}
108
109				openDialog("빠른 쇼핑 이미지 변경  <span class='desc'>아이콘으로 사용할 이미지를 클릭하여 주세요.</span>", "#displayQuickIconPopup", {"width":"570","height":"300","show" : "fade","hide" : "fade"});
110			});
111
112			/* 이미지꾸미기 빠른쇼핑 이미지 */
113			$("input[name='quick_shopping']",goodsDisplayDecorationContainer).change(function(){
114				$("table.quick_shopping_container tr",$(this).closest('tr')).empty();
115				var data = eval("("+$(this).val()+")");
116				var randKey = Math.floor(Math.random()*10000000);
117
118				for(var i=0;i<data.length;i++){
119					if(i=='zzim_on') return;
120					if(i=='zzim'){
121						$("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>");
122					}else{
123						$("table.quick_shopping_container tr",$(this).closest('tr')).append("<td><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+data[i]+".gif#"+randKey+"' /></td>");
124					}
125				}
126
127			}).change();
128
129			/* 이미지꾸미기 - 체크박스값에 따른 disabled 처리 */
130			$(".image_decorate_chk",goodsDisplayDecorationContainer).change(function(){
131				var image_decoration_table = $(this).closest('.image_decoration_table');
132				if($(this).is(":checked") || $(".image_decorate_chk:checked",image_decoration_table).length){
133					$(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');
134				}else{
135					$(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);
136				}
137			}).change();
138
139			/* 이미지꾸미기 선택정보를 샘플이미지에 적용*/
140			$(".image_decoration_table select, .image_decoration_table input",goodsDisplayDecorationContainer).change(function(){
141				goods_image_decoration_data(goodsDisplayDecorationContainer);
142			});
143
144			/* 상품정보 텍스트정렬을 샘플이미지에 적용 */
145			$("input.text_align",goodsDisplayDecorationContainer).change(function(){
146				if($(this).is(':checked')){
147					$(".goodsDisplayAlign",goodsDisplayDecorationContainer).css("text-align",$(this).val());
148				}
149			}).change();
150
151			/* 상품정보 항목 값 변경 */
152			$("div.info_item .info_item_selector",goodsDisplayDecorationContainer).live('change',function(){
153				change_info_item(this);
154			});
155
156			/* 상품정보 항목 Sortable */
157			$(".info_item_container",goodsDisplayDecorationContainer).sortable({
158					placeholder: "info_item_holder"
159			});
160
161			$(".image_slide_type",goodsDisplayDecorationContainer).live("change",function(){
162				$(".image_slide_sample_bottom, .image_slide_sample_right",goodsDisplayDecorationContainer).hide();
163				$(".image_slide_sample_"+$(this).val(),goodsDisplayDecorationContainer).show();
164			}).change();
165
166			/* 이미지 하단, 전체 */
167			$(".image_overay_type",goodsDisplayDecorationContainer).click(function(){
168				if	($(this).val() == 'all') {
169					if	($('.image_overay_plus2_main').val()) {
170						$('.image_overay_plus2').val('');
171						$('.image_overay_plus2_main').val('');
172						$('.image_overay_plus2_title').next().find('li').remove();
173					}
174					$('.overay_bottom').css('visibility','hidden');
175					$('.overay_all').css('visibility','');
176					$('.img_effect_rollover[attr="all"]').show();
177					$('.img_effect_rollover[attr="bottom"]').hide();
178				}else{
179					$('.overay_bottom').css('visibility','');
180					$('.img_effect_rollover[attr="all"]').hide();
181					$('.img_effect_rollover[attr="bottom"]').show();
182				}
183			});
184
185			/* 이미지 꾸미기 아이콘 조건 선택시 */
186			if	($('.image_decoration_icon_type', goodsDisplayDecorationContainer).val() == 'condition') {
187				sample_icon = $('.goodsDisplayImageTable', goodsDisplayDecorationContainer).find('.goodsDisplayImageIcon').clone();
188				sample_icon.css({'position':'relative','display':'inline'});
189				$('.image_icon_select_condition', goodsDisplayDecorationContainer).html(sample_icon);
190			}
191
192			set_info_item_data(goodsDisplayDecorationContainer);
193		});
194
195		/* 어드민 - 이미지꾸미기 - 아이콘 선택 */
196		$("#displayImageIconPopup img.icon").live("click",function(){
197			var uniqueKey = $("#displayImageIconPopup input[name='uniqueKey']").val();
198			var subPath = $("#displayImageIconPopup input[name='subPath']").val();
199
200			switch(subPath){
201				case "send":
202					$(".image_send_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
203					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/send/","");
204					$(".image_send_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_send').val(selectedIconName).change();
205				break;
206				case "zzim":
207					$(".image_zzim_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
208					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/zzim/","");
209					$(".image_zzim_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_zzim').val(selectedIconName).change();
210				break;
211				case "zzim_on":
212					$(".image_zzim_on_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
213					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/zzim_on/","");
214					$(".image_zzim_on_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_zzim_on').val(selectedIconName).change();
215				break;
216				case "slide":
217					$(".image_slide_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
218					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/slide/","");
219					$(".image_slide_select[uniqueKey='"+uniqueKey+"']").closest('table').find('input.image_slide').val(selectedIconName).change();
220				break;
221				default:
222					if	($(".image_icon_select[uniqueKey='"+uniqueKey+"']").hasClass('image_icon_select_condition')) {
223						$(".image_icon_select[uniqueKey='"+uniqueKey+"']").closest('div').find('.image_icon_select:eq(0)').attr("src",$(this).attr('src'));
224					}else{
225						$(".image_icon_select[uniqueKey='"+uniqueKey+"']").attr("src",$(this).attr('src'));
226					}
227					var selectedIconName = $(this).attr("src").replace("/data/icon/goodsdisplay/","");
228					var target_obj = $('.icon_set_live');
229					$(".image_icon_select[uniqueKey='"+uniqueKey+"']", target_obj).closest('table').find('input.image_icon').val(selectedIconName).change();
230					$('.icon_type_txt[attr="no"]', target_obj).show();
231					$('.icon_type_txt[attr="condition"]', target_obj).hide();
232					$('.image_icon_select', target_obj).show();
233					$('.image_icon_select_condition', target_obj).hide();
234				break;
235			}
236
237			closeDialog("displayImageIconPopup");
238		});
239
240		$('.icon_title_1,.icon_title_2', '.icon_tab_title').click(function(){
241			$('.use', '.icon_tab_title').removeClass('use');
242			$(this).addClass('use');
243			if	($(this).hasClass('icon_title_1')) {
244				$('.icon_tab1').show();
245				$('.icon_tab2').hide();
246				$('.image_icon_type').val('');
247			}else{
248				$('.icon_tab2').show();
249				$('.icon_tab1').hide();
250				$('.image_icon_type').val('condition');
251			}
252		});
253
254		/* 자주쓰는 상품정보 */
255		set_decoration_favorite();
256		/* 꾸미기, 상품정보 초기화 */
257		init_decoration_favorite();
258
259	}
260
261	/* 이미지꾸미기 이미지 설정 */
262	set_goods_display_decoration(".goodsDisplayImageWrap");
263
264	/* 이미지꾸미기 이미지 마우스오버 이벤트 설정 */
265	set_goods_display_decoration_event(".goodsDisplayImageWrap");
266});
267
268function init_decoration_favorite(){
269	var type = ['image_', 'goods_', 'm_image_', 'm_goods_'];
270	for(var i=0;i<type.length;i++){
271		var decoration_type = $('input[name="'+type[i]+'decoration_type"]:checked').val();
272		if(decoration_type == 'quality'){
273			$('.'+type[i]+'decoration_favorite').hide();
274		}
275		(function(id)	{
276			$('input[name="'+type[id]+'decoration_type"]').bind('click',function(){
277				if($(this).val() == 'quality'){
278					$('.'+type[id]+'decoration_favorite').hide();
279					$('.'+type[id]+'decoration_quality').show();
280				}else {
281					$('.'+type[id]+'decoration_favorite').show();
282					$('.'+type[id]+'decoration_quality').hide();
283					$('.'+type[id]+'decoration_favorite').each(function(){
284						eleId = $('.favorite_ul', this).data("objBxSlider");
285						if(typeof(eleId)!="undefined")
286						{
287							eleId.redrawSlider();
288							eleId.reloadSlider();
289						}
290					});
291				}
292			});
293		})(i);
294	}
295}
296
297/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
298function set_display_image_icon(){
299	$.getJSON('../design/display_image_icon', function(data) {
300		var tag = '';
301		$("div#displayImageIconPopup ul.icon_ul li").remove();
302
303		for(var i=0;i<data.length;i++){
304			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
305			tag += '<img src="/data/icon/goodsdisplay/'+data[i]+'" border="0" class="icon hand hover-select">';
306			tag += '</li>';
307		}
308		$("div#displayImageIconPopup ul.icon_ul").html(tag);
309	});
310}
311
312/* 어드민 - 이미지꾸미기 - 고급설정 배경 이미지 */
313function set_display_image_background(){
314	$.getJSON('../design/display_image_icon_background', function(data) {
315		var tag = '';
316		$("div#displayImageIconBackground ul.icon_ul li").remove();
317
318		for(var i=0;i<data.length;i++){
319			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
320			tag += '<img src="/data/icon/goodsdisplay/background/'+data[i]+'" border="0" class="icon hand background_img" onclick="$(\'.background_select\').removeClass(\'background_select\');$(this).addClass(\'background_select\')" img="'+data[i]+'">';
321			tag += '</li>';
322		}
323		$("div#displayImageIconBackground ul.icon_ul").html(tag);
324	});
325}
326
327function change_icon_background(e){
328	var parent_obj	= $('#displayImageIconBackground');
329	$('.icon_background_ing').removeClass('icon_background_ing');
330	$(e).addClass('icon_background_ing');
331	var icon_obj = $(e).closest('.items_li_5').find('.background_icon').val();
332	var set_obj = decode_base64_json(icon_obj);
333
334	$(".colorpicker", parent_obj).customColorPicker("destroy");
335
336	$('.background_select').removeClass('background_select');
337
338	$('input[name="icon_background_type"][value="'+set_obj['type']+'"]', parent_obj).prop('checked',true);
339	if	(set_obj['type'] == 'image') {
340		$('.background_img[img="'+set_obj['img']+'"]', parent_obj).addClass('background_select');
341		$('input[name="width"]', parent_obj).val('');
342		$('input[name="height"]', parent_obj).val('');
343		$('input[name="color"]', parent_obj).val('');
344		$('input[name="opacity"]', parent_obj).val('');
345	}else{
346		$('input[name="width"]', parent_obj).val(set_obj['width']);
347		$('input[name="height"]', parent_obj).val(set_obj['height']);
348		$('input[name="color"]', parent_obj).val(set_obj['color']);
349		$('input[name="opacity"]', parent_obj).val(set_obj['opacity']);
350	}
351
352	$(".colorpicker", parent_obj).customColorPicker();
353
354	openDialog('배경 변경','#displayImageIconBackground', {'width':'650','height':'420','show' : 'fade','hide' : 'fade'});
355}
356
357function apply_image_icon_background(e){
358	var parent_obj	= $('#displayImageIconBackground');
359	var type = $('input[name="icon_background_type"]:checked').val();
360	var ret = {};
361	ret.type = type;
362	if	(type == 'image') {
363		ret.img		= $('.background_select' ,parent_obj).attr('img');
364	}else{
365		ret.width	= $('input[name="width"]' ,parent_obj).val();
366		ret.height	= $('input[name="height"]' ,parent_obj).val();
367		ret.color	= $('input[name="color"]' ,parent_obj).val();
368		ret.opacity	= $('input[name="opacity"]' ,parent_obj).val();
369	}
370
371	$('.icon_background_ing').closest('.items_li_5').find('.background_icon').val(Base64.encode(JSON.stringify(ret)));
372	icon_condition_set_all();
373	closeDialog('displayImageIconBackground');
374}
375
376/* 어드민 - 이미지꾸미기 - 빠른쇼핑 아이콘 선택후 콜백 */
377function set_display_quick_icon(quick_shopping_value){
378	var uniqueKey = $("#displayQuickIconPopup input[name='uniqueKey']").val();
379	$("table.quick_shopping_container[uniqueKey='"+uniqueKey+"']").closest('.image_decoration_table').find("input[name='quick_shopping']").val(quick_shopping_value).change();
380	closeDialog('displayQuickIconPopup');
381
382	$("div#displayQuickIconPopup form input[type='text']").val('');
383}
384
385/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
386function set_display_image_send(){
387	$.getJSON('../design/display_image_send', function(data) {
388		var tag = '';
389		$("div#displayImageIconPopup ul.icon_ul li").remove();
390
391		for(var i=0;i<data.length;i++){
392			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
393			tag += '<img src="/data/icon/goodsdisplay/send/'+data[i]+'" border="0" class="icon hand hover-select">';
394			tag += '</li>';
395		}
396		$("div#displayImageIconPopup ul.icon_ul").html(tag);
397	});
398}
399
400/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
401function set_display_image_zzim(){
402	$.getJSON('../design/display_image_zzim', function(data) {
403		var tag = '';
404		$("div#displayImageIconPopup ul.icon_ul li").remove();
405
406		for(var i=0;i<data.length;i++){
407			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
408			tag += '<img src="/data/icon/goodsdisplay/zzim/'+data[i]+'" border="0" class="icon hand hover-select">';
409			tag += '</li>';
410		}
411		$("div#displayImageIconPopup ul.icon_ul").html(tag);
412	});
413}
414
415/* 어드민 - 이미지꾸미기 - 아이콘 선택후 콜백 */
416function set_display_image_zzim_on(){
417	$.getJSON('../design/display_image_zzim_on', function(data) {
418		var tag = '';
419		$("div#displayImageIconPopup ul.icon_ul li").remove();
420
421		for(var i=0;i<data.length;i++){
422			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
423			tag += '<img src="/data/icon/goodsdisplay/zzim_on/'+data[i]+'" border="0" class="icon hand hover-select">';
424			tag += '</li>';
425		}
426		$("div#displayImageIconPopup ul.icon_ul").html(tag);
427	});
428}
429
430/* 어드민 - 이미지더보기 - 아이콘 선택후 콜백 */
431function set_display_image_slide(){
432	$.getJSON('../design/display_image_slide', function(data) {
433		var tag = '';
434		$("div#displayImageIconPopup ul.icon_ul li").remove();
435
436		for(var i=0;i<data.length;i++){
437			tag += '<li style="float:left;width:100px;height:80px;text-align:center">';
438			tag += '<img src="/data/icon/goodsdisplay/slide/'+data[i]+'" border="0" class="icon hand hover-select">';
439			tag += '</li>';
440		}
441		$("div#displayImageIconPopup ul.icon_ul").html(tag);
442	});
443}
444
445/* 이미지 꾸미기 복사 */
446function goods_display_decoration_reset(selector, platform){
447	var parent_obj = $(selector);
448	var decoration = $('.goodsDisplayImageWrap', parent_obj).data("decoration");
449	if (!decoration) return;
450	if	(platform == 'pc') {
451		var arr = {
452			'use_image_border' :		['image_border1','image_border1_width','image_border','image_border_width','image_border_type','image_border_mobile'],
453			'use_image_opacity':		['image_opacity'],
454			'use_image_icon':			['image_icon','image_icon_location','image_icon_over','image_icon_type','image_icon_condition','image_icon_condition_cnt'],
455			'use_image_send':			['image_send','image_send_location','image_send_over'],
456			'use_image_zzim':			['image_zzim','image_zzim_on','image_send_location','image_send_over'],
457			'use_image_overay':			['image_overay1','image_overay1_text','image_overay2','image_overay2_text','image_overay_type','image_overay_plus1','image_overay_plus1_main','image_overay_plus1_title','image_overay_plus2','image_overay_plus2_main','image_overay_plus2_title'],
458			'use_image_slide':			['image_slide','image_slide_type'],
459			'use_quick_shopping':		['quick_shopping'],
460			'use_image_zoom':			['use_image_zoom'],
461			'use_image_3d':				['use_image_3d'],
462			'use_seconde_image':		['use_seconde_image'],
463			'use_review_option_like':	['use_review_option_like']
464		}
465	}else{
466		var arr = {
467			'use_image_border' :		['image_border1','image_border1_width'],
468			'use_image_zzim':			['image_zzim','image_zzim_on','image_send_location','image_send_over'],
469			'use_image_icon':			['image_icon','image_icon_location','image_icon_over','image_icon_type','image_icon_condition','image_icon_condition_cnt']
470		}
471	}
472
473	$.each(arr, function(key,val){
474		$('.'+key, parent_obj).prop('checked', false).change();
475		$.each(val,function(){
476			if	($('.'+this, parent_obj).val() != undefined) {
477				switch($('.'+this, parent_obj)[0].tagName){
478					case 'INPUT':
479						if($('.'+this, parent_obj).attr('type')=='text' || $('.'+this, parent_obj).attr('type')=='hidden'){
480							$('.'+this, parent_obj).val('').change();
481						}else{
482							$('.'+this, parent_obj).attr('checked',false).change();
483						}
484					break;
485					case 'SELECT':
486						$('.'+this+' > option:eq(0)', parent_obj).prop('selected',true).change();
487					break;
488				}
489			}
490		});
491		if	(key == 'use_image_border') {
492			$('.icon_type_txt[attr="no"]', parent_obj).show();
493			$('.icon_type_txt[attr="condition"]', parent_obj).hide();
494			$('.icon_type_txt[attr="condition"]', parent_obj).find('.icon_condition_cnt').html('');
495			$('.overay_all ul', parent_obj).html('');
496			$('.overay_bottom ul', parent_obj).html('');;
497		}
498	});
499
500	$(".colorpicker", parent_obj).customColorPicker("destroy");
501
502	$.each(decoration,function(set_key, set_val){
503		$.each(arr,function(key,val){
504			if	($.inArray(set_key,val) > -1 && $.inArray(key,['use_image_send','use_image_zzim']) == -1 ) {
505				$('.'+key, parent_obj).prop('checked',true).change();
506			}
507		});
508		if	($('.'+set_key, parent_obj).val() != undefined && set_val) {
509			switch($('.'+set_key, parent_obj)[0].tagName){
510				case 'INPUT':
511					if($('.'+set_key, parent_obj).attr('type')=='text' || $('.'+set_key, parent_obj).attr('type')=='hidden'){
512						$('.'+set_key, parent_obj).val(set_val).change();
513					}else if($('.'+set_key, parent_obj).attr('type')=='radio') {
514						$('.'+set_key+'[value="'+set_val+'"]', parent_obj).attr('checked',true).change();
515					}
516				break;
517				case 'SELECT':
518						$('.'+set_key, parent_obj).val(set_val).change();
519				break;
520			}
521		}
522		if	($.inArray(set_key, ['image_overay_plus1_title','image_overay_plus2_title']) > -1) {
523			$('.'+set_key, parent_obj).closest('div').find('ul').html(Base64.decode(set_val));
524		}
525	});
526
527	if	(platform == 'pc') {
528		if	($('.image_send', parent_obj).val().length > 0)
529			$('.use_image_send', parent_obj).prop('checked', true).change();
530
531		if	($('.image_zzim', parent_obj).val().length > 0)
532			$('.use_image_zzim', parent_obj).prop('checked', true).change();
533	}else{
534		if	($('.image_zzim', parent_obj).val().length > 0)
535			$('.use_image_zzim', parent_obj).prop('checked', true).change();
536	}
537
538	if	($('.image_icon_type', parent_obj).val() == 'condition') {
539		$('.icon_condition_cnt', parent_obj).text($('.image_icon_condition_cnt', parent_obj).val())
540		$('.icon_type_txt[attr="no"]', parent_obj).hide();
541		$('.icon_type_txt[attr="condition"]', parent_obj).show();
542		$('.image_icon_select').hide();
543		$('.image_icon_select_condition').show();
544
545		sample_icon = $('.goodsDisplayImageTable', parent_obj).find('.goodsDisplayImageIcon').clone();
546		sample_icon.css({'position':'relative','display':'inline'});
547		$('.image_icon_select_condition', parent_obj).html(sample_icon).show();
548	}else{
549		if	($('.image_icon', parent_obj).val())
550			$('.image_icon_select').prop('src','/data/icon/goodsdisplay/'+$('.image_icon', parent_obj).val()+"#" + Math.random());
551		$('.image_icon_select').show();
552		$('.image_icon_select_condition').hide();
553	}
554
555	$(".colorpicker", parent_obj).customColorPicker();
556}
557
558/* 이미지꾸미기 이미지 설정 */
559function set_goods_display_decoration(selector){
560
561	$(selector)
562	.each(function(){
563
564		var that				= this;
565		var imageObj			= $(this).find("img:eq(0)");
566		var designDisplayObj	= $(that).closest(designDisplaySelector);
567		var version				= $(this).attr('version');
568		var is_display_edit		= false;
569		var image_optimize		= $(this).attr('img_opt');
570		var is_image_optimize	= false;
571		var displaystyle		= $(imageObj).closest('.designDisplay').attr('displaystyle');
572
573		if	(version == 'display_edit')	is_display_edit		= true; //디스플레이 수정 여부 확인
574		if	(image_optimize == 1)		is_image_optimize	= true; //이미지 최적화는 이미지의 길이가 불규칙해서 정의함
575
576		if($(this).data('decorationLoaded') || !$(this).attr("decoration") || $(this).attr("decoration")=="e30="){
577			if(!$(this).data('decorationLoaded')){
578				$(this).css({"border":"0px"});
579				$(".goodsDisplayImageIcon",that).remove();
580				$(".goodsDisplayImageSend",that).remove();
581			}
582			return;
583		}
584
585		$(this).wrap("<div class='relative' />")
586		$(this).css({'position':'relative','display':'inline-block'})
587
588		// 속도를 위해 상품디스플레이객체에서 이미지꾸미기설정을 가져옴
589		if(designDisplayObj.find(selector).index(that)>0){
590			var decoration = designDisplayObj.data("decoration");
591			$(that).data("decoration",decoration);
592		}
593		else{
594			if($(that).attr("decoration")) $(that).data("decoration",eval("("+Base64.decode($(that).attr("decoration"))+")"));
595			designDisplayObj.data("decoration",$(that).data("decoration"));
596			var decoration = $(that).data("decoration");
597		}
598
599		if($(that).attr("goodsInfo")) $(that).data("goodsInfo",eval("("+Base64.decode($(that).attr("goodsInfo"))+")"));
600		var goodsInfo = $(that).data("goodsInfo");
601
602		/*
603		if(goodsInfo.goods_status=='runout'){
604
605			if($(".goodsDisplayImageOveraySoldout",this).length){
606				$(".goodsDisplayImageOveraySoldout",this).remove();
607			}
608
609			var overaySoldoutObj = $("<div class='goodsDisplayImageOveraySoldout'><div class='goodsDisplayImageOveraySoldoutBg'></div><div class='goodsDisplayImageOveraySoldoutText'></div></div>");
610
611			var overaySoldoutHeight = 75;
612
613			overaySoldoutObj
614			.css({
615				'position'			: 'absolute',
616				'left'				: 0,
617				'top'				: '100%',
618				'margin-top'		: -overaySoldoutHeight,
619				'width'				: $(that).width(),
620				'height'			: overaySoldoutHeight
621			});
622
623			$(".goodsDisplayImageOveraySoldoutBg",overaySoldoutObj)
624			.css({
625				//'background-color'	: '#ff0000',
626				'color'				: '#fff',
627				'opacity'			: 0.3,
628				'position'			: 'absolute',
629				'left'				: 0,
630				'top'				: 0,
631				'width'				: $(that).width(),
632				'height'			: overaySoldoutHeight
633			});
634
635			$(".goodsDisplayImageOveraySoldoutText",overaySoldoutObj)
636			.css({
637				'background'		: "url('/data/icon/common/etc/soldout_mark.png') no-repeat top right",
638				'width'				: '81px',
639				'height'			: '71px',
640				'position'			: 'absolute',
641				'overflow'			: 'hidden',
642				'white-space'		: 'nowrap',
643				'right'				: 0,
644				'top'				: 0,
645				'width'				: $(that).width()
646			});
647			overaySoldoutObj.show();
648
649			imageObj.after(overaySoldoutObj);
650
651		}
652		*/
653		if(decoration){
654			// 상품디스플레이 속도개선(20141110) 이후 소스
655			if(num($(this).attr('version'))>=20141110){
656
657				if(decoration['image_send'] || decoration['image_zzim']){
658					var imageSendObj = $(".goodsDisplayImageSend",this);
659
660					$(".goodsSendBtn",imageSendObj).show().click(function(){
661						display_goods_send(this,'top');
662						return false;
663					});
664
665					$(".goodsZzimBtn",imageSendObj).show().click(function(){
666						display_goods_zzim(this,goodsInfo.goods_seq);
667						return false;
668					});
669				}
670
671				if(decoration['image_overay1'] || decoration['image_overay1_text']){
672
673					var overay1Obj = $("<div class='goodsDisplayImageOveray1'><div class='goodsDisplayImageOveray1Bg'></div><div class='goodsDisplayImageOveray1Text'></div></div>");
674
675					var overay1Height = 20;
676
677					switch(decoration['image_overay1']){
678						case "goods_name":
679							var overay1Text = goodsInfo['goods_name'];
680							break;
681						case "price":
682							var overay1Text = get_currency_price(goodsInfo['price'],2);
683							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
684							break;
685						case "sale_price":
686							var overay1Text = get_currency_price(goodsInfo['sale_price'],2);
687							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
688							break;
689						case "consumer_price":
690							var overay1Text = get_currency_price(goodsInfo['consumer_price'],2);
691							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
692							break;
693						case "discount":
694							var overay1Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['price']);
695							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
696							break;
697						case "sale_discount":
698							var overay1Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['sale_price']);
699							if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
700							break;
701						case "brand_title":
702							var overay1Text = goodsInfo['brand_title'];
703							break;
704						case "related_goods":
705							var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
706							break;
707						case "":
708						default:
709							var overay1Text = decoration['image_overay1_text'];
710
711							break;
712					}
713
714					overay1Obj
715					.css({
716						'position'			: 'absolute',
717						'left'				: 0,
718						'top'				: '100%',
719						'margin-top'		: -overay1Height,
720						'width'				: $(that).width(),
721						'height'			: overay1Height
722					});
723
724					$(".goodsDisplayImageOveray1Bg",overay1Obj)
725					.css({
726						'background-color'	: '#000000',
727						'color'				: '#fff',
728						'opacity'			: 0.3,
729						'position'			: 'absolute',
730						'left'				: 0,
731						'top'				: 0,
732						'width'				: $(that).width(),
733						'height'			: overay1Height
734					});
735
736					$(".goodsDisplayImageOveray1Text",overay1Obj)
737					.html(overay1Text)
738					.css({
739						'color'				: '#fff',
740						'font-size'			: '11pt',
741						'font-weight'		: 'bold',
742						'text-align'		: 'center',
743						'position'			: 'absolute',
744						'overflow'			: 'hidden',
745						'white-space'		: 'nowrap',
746						'line-height'		: overay1Height+'px',
747						'left'				: 0,
748						'top'				: 0,
749						'width'				: $(that).width()
750					});
751					overay1Obj.show();
752
753					imageObj.after(overay1Obj);
754
755				}else{
756					$(".goodsDisplayImageOveray1",that).remove();
757				}
758
759				//향상된 오버레이 기능
760				if(decoration['image_overay_plus1'] && decoration['image_overay_type'] != 'all'){
761					//이미지 최적화를 사용 하고 이미지가 링크로 되어 있는 것 들은 이미지 로드가 늦어져 격차를 둔다
762					var overay_set_sec = '0';
763					if	(is_image_optimize) overay_set_sec = '500';
764					setTimeout(function(){
765						var overay1Obj = $("<div class='goodsDisplayImageOverayPlus1'><div class='goodsDisplayImageOverayPlus1Iwrap'><div class='goodsDisplayImageOveray1BgPlus'></div><div class='goodsDisplayImageOverayPlus1Text'></div></div></div>");
766						var image_overay_plus1		= decode_base64_json(decoration['image_overay_plus1']);
767						var image_overay_plus1_main = decode_base64_json(decoration['image_overay_plus1_main']);
768						var dscount_percent_use		= false;
769						var dscount_percent_left	= false;
770						var dscount_percent_right	= false;
771
772						var overay1TextObjWrap = $('<ul>');
773						var overay1TextPer = $('<div class="goodsDisplayImageOveray1PerWrap"><div class="goodsDisplayImageOveray1PerBg"></div><div class="goodsDisplayImageOveray1PerTxt"></div></div>');
774
775						var discount_per_css = {
776							'position'			: 'absolute',
777							'top'				: 0,
778							'text-align'		: 'center',
779							'width'				: '45px',
780						};
781						var discount_per_bg_css = {
782							'position'			: 'absolute',
783							'background-color'	: '',
784							'opacity'			: 1,
785							'width'				: '45px'
786						}
787						var overayBgCss = {
788							'opacity'			: 1,
789							'background-color'	: '#000000',
790							'color'				: '#fff',
791							'position'			: 'absolute',
792							'top'				: 0,
793							'left'				: 0,
794							'width'				: 0
795						};
796
797						var default_height = 16;
798						var default_right_per = 45;
799						var event_key = '';
800
801						$.each(image_overay_plus1, function(key,option){
802							var overay_flag = false;
803							var discount_use= false;
804
805							switch(option['key']){
806								case "goods_name":
807									var overay1Text = goodsInfo['goods_name'];
808									break;
809								case "price":
810									var overay1Text = get_currency_price(goodsInfo['price'],3);
811									if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
812									break;
813								case "sale_price":
814									var overay1Text = get_currency_price(goodsInfo['sale_price'],3);
815									if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
816									break;
817								case "consumer_price":
818									var overay1Text = get_currency_price(goodsInfo['consumer_price'],3);
819									if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
820									break;
821								case "discount":
822									var overay1Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+get_currency_price(goodsInfo['price'], 3)+'</span>';
823									if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
824									discount_use = true;
825									break;
826								case "sale_discount":
827									var overay1Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+ get_currency_price(goodsInfo['sale_price'], 3)+'</span>';
828									if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
829									discount_use = true;
830									break;
831								case "brand_title":
832									var overay1Text = goodsInfo['brand_title'];
833									break;
834								case "summary":
835									var overay1Text = goodsInfo['summary'];
836									break;
837								case "related_goods":
838									var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
839									break;
840								case "provider_name":
841									var overay1Text = goodsInfo['provider_name'];
842									break;
843								case "brand_title_eng":
844									var overay1Text = goodsInfo['brand_title_eng'];
845									break;
846								case "line":
847									var overay1Text = '';
848									for(i=0;i<100;i++){
849										overay1Text += '─' ;
850									}
851									break;
852								case "shpping_free":
853									if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_t
853ype'] == 'free')
854										var overay1Text = '무료배송';
855									else
856										overay_flag							= true;
857									break;
858								case "discount_per":
859									if	(option.overay_discount_per <= goodsInfo['sale_per']) {
860										if	(option.overay_discount_bg_color == 1) {
861 											discount_per_bg_css['background-color'] = option.overay_discount_per_color;
862											discount_per_bg_css['opacity']			= 1-option.overay_discount_opacity/100;
863
864											if	(option.overay_discount_position == 'left') {
865												discount_per_css['left']	= 0;
866												dscount_percent_left		= true;
867												overayBgCss['right']		= 0;
868												overayBgCss['left']			= '';
869											}else{
870												discount_per_css['right']	= 0;
871												dscount_percent_right		= true;
872												overayBgCss['left']			= 0;
873												overayBgCss['right']		= '';
874											}
875											$('.goodsDisplayImageOveray1PerTxt', overay1TextPer).text(goodsInfo['sale_per']+'%');
876											dscount_percent_use				= true;
877										}else{
878											var overay1Text					= '할인 '+goodsInfo['sale_per']+'%';
879										}
880									}else{
881										overay_flag							= true;
882									}
883									break;
884								case "event_time":
885									if	(goodsInfo['eventEnd']) {
886										event_key	= $(that).closest('.designDisplay').prop('id');
887										var overay1Text	= '<span class="time_count soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"> 남은시간 <span id="soloday_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>일 <span id="solohour_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solomin_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span></span>';
888									}else{
889										overay_flag							= true;
890									}
891									break;
892								case "event_cnt":
893									if	(goodsInfo['eventEnd']) {
894										var overay1Text						= '현재 '+goodsInfo['event_order_ea']+'개 구매';
895									}else{
896										overay_flag							= true;
897									}
898									break;
899								case "direct":
900								default:
901									var overay1Text = option.overay_text;
902									break;
903							}
904
905							if	(!overay_flag) {
906								var overay1TextObj	= $('<li>');
907								var default_css		= {
908									'color'				: '#fff',
909									'font-size'			: '11pt',
910									'font-weight'		: '',
911									'text-decoration'	: '',
912									'min-height'		: default_height+'px',
913									'line-height'		: default_height+'px'
914								}
915
916								if (option.overay_font_color != undefined && option.overay_font_color)
917									default_css['color']			= option.overay_font_color;
918
919								if (option.overay_font_size != undefined && option.overay_font_size)
920									default_css['font-size']		= option.overay_font_size+'pt';
921
922								if (option.overay_font_weight != undefined && option.overay_font_weight > 0)
923									default_css['font-weight']		= 'bold';
924
925								if (!discount_use && option.overay_line_through != undefined && option.overay_line_through > 0)
926									default_css['text-decoration']	= 'line-through';
927
928								if (option.overay_bracket != undefined && option.overay_bracket) {
929									overay1Text						= option.overay_bracket.substring(0,1)+overay1Text+option.overay_bracket.substring(1,2);
930								}
931
932								if	(dscount_percent_use) {
933									$('.goodsDisplayImageOveray1PerTxt', overay1TextPer).css(default_css);
934									dscount_percent_use				= false;
935								}else{
936									overay1TextObj.html(overay1Text).css(default_css);
937									overay1TextObjWrap.append(overay1TextObj);
938								}
939
940								if	(discount_use) {
941
942									if (option.overay_line_through != undefined && option.overay_line_through > 0)
943										overay1TextObj.find('.left_dc').css({'text-decoration':'line-through'});
944
945									var sub_css = {
946										'color'				: '#fff',
947										'font-size'			: '11pt',
948										'font-weight'		: 'normal'
949									};
950									if	(option.overay_discount_color != undefined)
951										sub_css['color']			= option.overay_discount_color;
952
953									if	(option.overay_discount_font_size != undefined)
954										sub_css['font-size']		= option.overay_discount_font_size+'pt';
955
956									if	(option.overay_discount_font_weight != undefined && option.overay_discount_font_weight > 0)
957										sub_css['font-weight']		= 'bold';
958
959									overay1TextObj.find('.right_dc').css(sub_css);
960								}
961							}
962						});
963
964						var text_css = {
965							'position'				: 'relative',
966							'text-align'			: 'center',
967							'overflow'				: 'hidden',
968							'white-space'			: 'nowrap',
969							'left'					: 0,
970							'top'					: 0,
971							'margin'				: 0,
972							'padding'				: 0
973						}
974
975						if	(image_overay_plus1_main['overay_h_orderby'] != undefined && image_overay_plus1_main['overay_h_orderby'])
976							text_css['text-align']	= image_overay_plus1_main['overay_h_orderby'];
977
978						$(".goodsDisplayImageOverayPlus1Text",overay1Obj)
979						.html(overay1TextObjWrap).css(text_css);
980
981						imageObj.after(overay1Obj);
982						var this_width				= $(that).closest('.goodsDisplayImageWrap').width();
983						if	(is_display_edit || is_image_optimize)
984							this_width				= $(that).closest('.goodsDisplayItemWrap').width();
985						var textbox_width			= this_width;
986						var box_height				= overay1Obj.outerHeight();
987
988						var obj_css = {
989							'position'				: 'absolute',
990							'left'					: 0,
991							'top'					: '100%',
992							'width'					: this_width,
993							'padding-top'			: 0,
994							'padding-bottom'		: 0,
995							'padding-left'			: 0,
996							'padding-right'			: 0
997						}
998
999						var padding_left = 0;
1000						var padding_right = 0;
1001
1002						if	(dscount_percent_left || dscount_percent_right)
1003							textbox_width -= default_right_per;
1004
1005						if	(image_overay_plus1_main['overay_left'] != undefined && image_overay_plus1_main['overay_left']) {
1006							padding_left = parseInt(image_overay_plus1_main['overay_left']);
1007							textbox_width -= padding_left;
1008						}
1009						if (dscount_percent_left)
1010							padding_left += parseInt(default_right_per);
1011
1012						if	(image_overay_plus1_main['overay_right'] != undefined && image_overay_plus1_main['overay_right']) {
1013							padding_right = parseInt(image_overay_plus1_main['overay_right']);
1014							textbox_width -= padding_right;
1015						}
1016
1017						if	(dscount_percent_right)
1018							padding_right += parseInt(default_right_per);
1019
1020						if	(image_overay_plus1_main['overay_top'] != undefined && image_overay_plus1_main['overay_top']) {
1021							obj_css['padding-top']		= image_overay_plus1_main['overay_top']+'px';
1022							box_height					+= parseInt(image_overay_plus1_main['overay_top']);
1023						}
1024
1025						if	(image_overay_plus1_main['overay_bottom'] != undefined && image_overay_plus1_main['overay_bottom']) {
1026							obj_css['padding-bottom']	= image_overay_plus1_main['overay_bottom']+'px';
1027							box_height					+= parseInt(image_overay_plus1_main['overay_bottom']);
1028						}
1029
1030						if	(padding_left > 0)	obj_css['padding-left']		= padding_left+'px';
1031						if	(padding_right > 0)	obj_css['padding-right']	= padding_right+'px';
1032
1033						obj_css['width']				= textbox_width+'px';
1034						obj_css['margin-top']			= -box_height;
1035
1036						overayBgCss['width']			= this_width+'px';
1037
1038						if	($('.goodsDisplayImageOveray1PerTxt', overay1TextPer).html().length > 0) {
1039							$('.goodsDisplayImageOverayPlus1Iwrap', overay1Obj).append(overay1TextPer);
1040
1041							$('.goodsDisplayImageOveray1PerTxt', overay1TextPer)
1042							.css({
1043								'height'				: box_height+'px',
1044								'line-height'			: box_height+'px',
1045								'position'				: 'absolute',
1046								'text-align'			: 'center',
1047								'width'					: default_right_per+'px'
1048							});
1049
1050							discount_per_bg_css['height']	= box_height+'px';
1051							$('.goodsDisplayImageOveray1PerBg', overay1TextPer).css(discount_per_bg_css);
1052							discount_per_css['height']		= box_height+'px';
1053							discount_per_css['line-height'] = box_height+'px';
1054							$('.goodsDisplayImageOveray1PerWrap', overay1Obj).css(discount_per_css);
1055							overayBgCss['width']			= (this_width-default_right_per)+'px';
1056						}
1057
1058						overayBgCss['height']				= box_height+'px';
1059
1060						if	(image_overay_plus1_main['overay_opacity'] != undefined && image_overay_plus1_main['overay_opacity'])
1061							overayBgCss['opacity']			= 1-image_overay_plus1_main['overay_opacity']/100;
1062
1063						if	(image_overay_plus1_main['overay_bg_color'] != undefined && image_overay_plus1_main['overay_bg_color'])
1064							overayBgCss['background-color'] = image_overay_plus1_main['overay_bg_color'];
1065
1066						$(".goodsDisplayImageOveray1BgPlus",overay1Obj)
1067						.css(overayBgCss);
1068
1069						//이벤트 상품일 경우 함수 실행
1070						if	(event_key) {
1071							timeInterval = [];
1072							timeInterval[event_key+'_'+goodsInfo['goods_seq']] = setInterval(function(){
1073								var time = [];
1074								time[event_key+'_'+goodsInfo['goods_seq']] = showClockTime('text' ,goodsInfo['eventEnd']['year'], goodsInfo['eventEnd']['month'], goodsInfo['eventEnd']['day'], goodsInfo['eventEnd']['hour'], goodsInfo['eventEnd']['min'], goodsInfo['eventEnd']['second'], 'soloday_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solohour_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solomin_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq'], '_'+event_key+'_'+goodsInfo['goods_seq']);
1075								if(time[event_key+'_'+goodsInfo['goods_seq']] == 0){
1076								clearInterval(timeInterval[event_key+'_'+goodsInfo['goods_seq']]);
1077								$('.soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']).html("단독 이벤트 종료");
1078								}
1079							},1000);
1080						}
1081
1082						overay1Obj
1083						.css(obj_css).show();
1084					},overay_set_sec);
1085				}else{
1086					$(".goodsDisplayImageOverayPlus1",that).remove();
1087				}
1088
1089				if(decoration['image_slide'] && goodsInfo['image_cnt']>1){
1090					var imageSlideObj = $(".goodsDisplayImageSlide",this);
1091					$(imageSlideObj,imageObj).click(function(){
1092						show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']);
1093						return false;
1094					});
1095				}
1096
1097				if(decoration['quick_shopping']){
1098					var quickShoppingObj = $(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping");
1099					if(quickShoppingObj.length){
1100						if(imageObj.width()){
1101							quickShoppingObj.css({'width': $(that).outerWidth()});
1102						}else{
1103							$(imageObj).bind('load',function(){
1104								quickShoppingObj.css({'width': $(this).outerWidth()});
1105							});
1106						}
1107						if	(displaystyle == 'lattice_b') quickShoppingObj.css({'margin':0});
1108					}
1109				}
1110
1111				if(decoration['use_seconde_image'] && goodsInfo.image2 != null && goodsInfo.image2.length>1){
1112					imageObj.attr("imageCut2",goodsInfo.image2);
1113				}else{
1114					imageObj.removeAttr("imageCut2");
1115				}
1116
1117				if	(decoration['use_image_zoom']) {
1118					$(this).addClass('goodsDisplayImageZoom').css('overflow','hidden');
1119				}
1120
1121				if	(decoration['use_image_3d']) {
1122					$(this).closest('.goodsDisplayItemWrap').addClass('goodsDisplayimageBox3d');
1123				}
1124
1125				if	(decoration['image_icon'] && decoration['image_icon_type'] == 'condition') {
1126					icon_condition = decode_base64_json(decoration['image_icon_condition']);
1127					icon_use_flag = false;
1128
1129					var condition = {
1130						'{discount}'		: goodsInfo['sale_per'],
1131						'{brand}'			: goodsInfo['brand_title'],
1132						'{brandeng}'		: goodsInfo['brand_title_eng'],
1133						'{bestnum}'			: goodsInfo['goods_index']
1134					}
1135
1136					if	(icon_condition) {
1137						for(i=0; i<3; i++){
1138							if	(icon_condition[i]['use'] == '1' && !icon_use_flag) {
1139								var contents = [];
1140								$.each(icon_condition[i]['contents'], function(txt_k, txt_v){
1141									if	(txt_v['txt'] && txt_v['use'] == '1') {
1142										if	(txt_v['txt_type'] == 'shipping_free') {
1143											if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_type'] == 'free')
1144												contents.push(txt_v);
1145										}else{
1146											contents.push(txt_v);
1147										}
1148									}
1149								});
1150								switch(icon_condition[i]['key']){
1151									case 'discount_per':
1152										if	(goodsInfo['sale_per'] >= icon_condition[i]['discount']) {
1153											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1154											icon_use_flag = true;
1155										}
1156									break;
1157									case 'solo':
1158										if	(goodsInfo['eventEnd']) {
1159											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1160											icon_use_flag = true;
1161										}
1162									break;
1163									case 'discount':
1164										if	(goodsInfo['event_text']) {
1165											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1166											icon_use_flag = true;
1167										}
1168									break;
1169									case 'gift':
1170									break;
1171									case 'package':
1172										if	(goodsInfo['package_yn'] == 'y') {
1173											set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1174											icon_use_flag = true;
1175										}
1176									break;
1177									case 'date':
1178										if	(icon_condition[i]['date_type'] == 'before') {
1179										   var nDate = new Date();
1180										   var vDate = new Date(goodsInfo['regist_date'].replace(/-/gi,"/"));
1181										   var timeSpan = (nDate - vDate) / 86400000;
1182										   
1183										   var daysApart = Math.abs(Math.round(timeSpan));
1184										   if	(icon_condition[i]['date'] >=  daysApart) {
1185											   set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1186											   icon_use_flag = true;
1187										   }
1188										}else{
1189											var vDate = icon_condition[i]['date'];
1190											var yy = parseInt(vDate.substr(0, 4), 10);
1191											var mm = parseInt(vDate.substr(5, 2), 10);
1192											var dd = parseInt(vDate.substr(8), 10);
1193											nDate = new Date(yy, mm - 1, dd + parseInt(icon_condition[i]['date_after'],10));
1194											yy = nDate.getFullYear();
1195											mm = nDate.getMonth() + 1; mm = (mm < 10) ? '0' + mm : mm;
1196											dd = nDate.getDate(); dd = (dd < 10) ? '0' + dd : dd;
1197											after_date = yy+'-'+mm+'-'+dd;
1198
1199											if (after_date <= goodsInfo['regist_date']) {
1200												set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1201												icon_use_flag = true;
1202											}
1203										}
1204									break;
1205									case 'empty':
1206										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
1207										icon_use_flag = true;
1208									break;
1209								}
1210							}
1211						}
1212					}
1213					if	(!icon_use_flag)
1214						$(".goodsDisplayImageIconWrap",this).remove();
1215					else
1216						$(".goodsDisplayImageIconWrap",this).show();
1217				}
1218
1219			// 상품디스플레이 속도개선(20141110) 이후 소스
1220			}else{
1221				if(decoration['image_border1']){
1222					if	(decoration['image_border_type'] == 'all') {
1223						$(this).css({"border":"0px","margin":"0px"});
1224						$(this).closest('.goodsDisplayItemWrap').css({"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1'],"margin":"-"+decoration['image_border1_width']+"px"});
1225					}else{
1226						$(this).closest('.goodsDisplayItemWrap').css({"border":"0px","margin":"0px"});
1227						$(this).css({"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1'],"margin":"-"+decoration['image_border1_width']+"px"});
1228					}
1229					$(this).parent().attr('align','center');
1230				}else{
1231					if	(decoration['image_border_type'] == 'all')
1232						$(this).closest('.goodsDisplayItemWrap').css({"border":"0px"});
1233					else
1234						$(this).css({"border":"0px"});
1235				}
1236
1237				if	(decoration['image_icon_type'] == undefined || decoration['image_icon_type'] != 'condition') {
1238					if	(decoration['image_icon']) {
1239						if($(".goodsDisplayImageIcon",this).length){
1240							$(".goodsDisplayImageIcon",this).remove();
1241						}
1242
1243						var imageIconObj = $("<div class='goodsDisplayImageIcon'><img src='/data/icon/goodsdisplay/"+decoration['image_icon']+"' /><span class='goodsDisplayImageIconText'></span></div>");
1244
1245						if(decoration['image_icon_location']=='right'){
1246							imageIconObj
1247							.css({
1248								'position'			: 'absolute',
1249								'right'				: '0px',
1250								'top'				: imageObj.position().top,
1251								'text-align'		: 'right'
1252							});
1253						}else{
1254							imageIconObj
1255							.css({
1256								'position'			: 'absolute',
1257								'left'				: imageObj.position().left,
1258								'top'				: imageObj.position().top
1259							});
1260						}
1261						if( decoration['image_icon'].indexOf("icon_best_no")  > -1 ) {
1262								var designDisplayObj = $(that).closest(designDisplaySelector);
1263
1264								if(designDisplayObj.length){
1265									designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
1266									var iconText = designDisplayObj.data('iconIdx');
1267								}else{
1268									var iconText = 1;
1269								}
1270								$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
1271									'position'		: 'absolute',
1272									'font-size'		: '16px',
1273									//'font-family'	: 'tahoma',
1274									'font-weight'	: 'bold',
1275									'text-align'	: 'center',
1276									'color'			: '#ffffff',
1277									'letter-spacing': '-1px',
1278									'width'			: 48,
1279									'top'			: $(imageObj).position().top+22
1280								});
1281
1282								if(decoration['image_icon_location']=='right'){
1283									$(".goodsDisplayImageIconText",imageIconObj).css({
1284										'left'			: $(imageObj).width()-48
1285									});
1286								}else{
1287									$(".goodsDisplayImageIconText",imageIconObj).css({
1288										'left'			: 0
1289									});
1290								}
1291						}else if( decoration['image_icon'].indexOf("icon_number")  > -1 ) {
1292								var designDisplayObj = $(that).closest(designDisplaySelector);
1293								if(designDisplayObj.length){
1294									designDisplayObj.data('iconIdx',num(designDisplayObj.data('iconIdx'))+1);
1295									var iconText = designDisplayObj.data('iconIdx');
1296								}else{
1297									var iconText = 1;
1298								}
1299								$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
1300									'position'		: 'absolute',
1301									'font-size'		: '30px',
1302									//'font-family'	: 'tahoma',
1303									'font-weight'	: 'bold',
1304									'text-align'	: 'right',
1305									'color'			: '#ffffff',
1306									'letter-spacing': '-1px',
1307									'width'			: 28,
1308									'top'			: $(imageObj).position().top+14
1309								});
1310
1311								if(decoration['image_icon_location']=='right'){
1312									$(".goodsDisplayImageIconText",imageIconObj).css({
1313										'left'			: $(imageObj).width()-46
1314									});
1315								}else{
1316									$(".goodsDisplayImageIconText",imageIconObj).css({
1317										'left'			: 0
1318									});
1319								}
1320						}else if( decoration['image_icon'].indexOf("icon_sale")  > -1 ) {
1321								var iconText = "";
1322								if(goodsInfo.sale_per){
1323									iconText = goodsInfo.sale_per;
1324									iconText = num(iconText) + "%";
1325								}else if(goodsInfo.consumer_price && num(goodsInfo.consumer_price) > num(goodsInfo.price)){
1326									iconText = Math.round((num(goodsInfo.consumer_price)-num(goodsInfo.price))/num(goodsInfo.consumer_price)*100);
1327									iconText = num(iconText) + "%";
1328								}else{
1329									imageIconObj.hide();
1330								}
1331
1332								$(".goodsDisplayImageIconText",imageIconObj).html(iconText).css({
1333									'position'		: 'absolute',
1334									'font-size'		: '16px',
1335									//'font-family'	: 'tahoma',
1336									'font-weight'	: 'bold',
1337									'text-align'	: 'center',
1338									'color'			: '#ffffff',
1339									'letter-spacing': '-1px',
1340									'width'			: 48,
1341									'top'			: $(imageObj).position().top+5
1342								});
1343
1344								if(decoration['image_icon_location']=='right'){
1345									$(".goodsDisplayImageIconText",imageIconObj).css({
1346										'left'			: $(imageObj).width()-48
1347									});
1348								}else{
1349									$(".goodsDisplayImageIconText",imageIconObj).css({
1350										'left'			: 0
1351									});
1352								}
1353						}
1354
1355						if(decoration['image_icon_over']=='y'){
1356							imageIconObj.hide();
1357						}else if(typeof iconText != 'undefined' && iconText.length){
1358							imageIconObj.show();
1359						}
1360
1361						imageObj.after(imageIconObj);
1362					}else{
1363						$(".goodsDisplayImageIcon",that).remove();
1364					}
1365				}
1366
1367				if(decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']){
1368					if($(".goodsDisplayImageSend",this).length){
1369						$(".goodsDisplayImageSend",this).remove();
1370					}
1371
1372					var btnSend = decoration['image_send'] ? " <img class='goodsSendBtn' src='/data/icon/goodsdisplay/send/"+decoration['image_send']+"' />" : '';
1373					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>" : '';
1374
1375					var imageSendObj = $("<div class='goodsDisplayImageSend'>"+btnSend+btnZzim+"</div>");
1376
1377					if(decoration['image_send_location']=='right'){
1378						imageSendObj
1379						.css({
1380							'position'			: 'absolute',
1381							'left'				: imageObj.position().left-2,
1382							'top'				: imageObj.position().top+2,
1383							'width'				: '100%',
1384							'text-align'		: 'right'
1385						});
1386					}else{
1387						imageSendObj
1388						.css({
1389							'position'			: 'absolute',
1390							'left'				: imageObj.position().left-2,
1391							'top'				: imageObj.position().top+2
1392						});
1393					}
1394
1395					if(decoration['image_send_over']=='y'){
1396						imageSendObj.hide();
1397					}else{
1398						imageSendObj.show();
1399					}
1400
1401					imageObj.after(imageSendObj);
1402
1403					if(goodsInfo.wish=='1'){
1404						$(".goodsZzimBtn .zzimOnImg",imageSendObj).show();
1405						$(".goodsZzimBtn .zzimOffImg",imageSendObj).hide();
1406					}else{
1407						$(".goodsZzimBtn .zzimOffImg",imageSendObj).show();
1408						$(".goodsZzimBtn .zzimOnImg",imageSendObj).hide();
1409					}
1410
1411					$(".goodsSendBtn",imageSendObj).click(function(){
1412						display_goods_send(this,'top');
1413						return false;
1414					});
1415
1416					$(".goodsZzimBtn",imageSendObj).click(function(){
1417						display_goods_zzim(this,goodsInfo.goods_seq);
1418						return false;
1419					});
1420				}else{
1421					$(".goodsDisplayImageSend",that).remove();
1422				}
1423
1424				if(decoration['image_overay1'] || decoration['image_overay1_text']){
1425
1426					if($(".goodsDisplayImageOveray1",this).length){
1427						$(".goodsDisplayImageOveray1",this).remove();
1428					}
1429
1430					var overay1Obj = $("<div class='goodsDisplayImageOveray1'><div class='goodsDisplayImageOveray1Bg'></div><div class='goodsDisplayImageOveray1Text'></div></div>");
1431
1432					var overay1Height = 20;
1433
1434					switch(decoration['image_overay1']){
1435						case "goods_name":
1436							var overay1Text = goodsInfo['goods_name'];
1437							break;
1438						case "price":
1439							var overay1Text = get_currency_price(goodsInfo['price'],2);
1440							break;
1441						case "sale_price":
1442							var overay1Text = get_currency_price(goodsInfo['sale_price'],2);
1443							break;
1444						case "consumer_price":
1445							var overay1Text = get_currency_price(goodsInfo['consumer_price'],2);
1446							break;
1447						case "discount":
1448							var overay1Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['price']);
1449							break;
1450						case "sale_discount":
1451							var overay1Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['sale_price']);
1452							break;
1453						case "brand_title":
1454							var overay1Text = goodsInfo['brand_title'];
1455							break;
1456						case "related_goods":
1457							var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
1458							break;
1459						case "":
1460						default:
1461							var overay1Text = decoration['image_overay1_text'];
1462
1463							break;
1464					}
1465
1466					overay1Obj
1467					.css({
1468						'position'			: 'absolute',
1469						'left'				: 0,
1470						'top'				: '100%',
1471						'margin-top'		: -overay1Height,
1472						'width'				: $(that).width(),
1473						'height'			: overay1Height
1474					});
1475
1476					$(".goodsDisplayImageOveray1Bg",overay1Obj)
1477					.css({
1478						'background-color'	: '#000000',
1479						'color'				: '#fff',
1480						'opacity'			: 0.3,
1481						'position'			: 'absolute',
1482						'left'				: 0,
1483						'top'				: 0,
1484						'width'				: $(that).width(),
1485						'height'			: overay1Height
1486					});
1487
1488					$(".goodsDisplayImageOveray1Text",overay1Obj)
1489					.html(overay1Text)
1490					.css({
1491						'color'				: '#fff',
1492						'font-size'			: '11px',
1493						'font-weight'		: 'bold',
1494						'text-align'		: 'center',
1495						'position'			: 'absolute',
1496						'overflow'			: 'hidden',
1497						'white-space'		: 'nowrap',
1498						'line-height'		: overay1Height+'px',
1499						'left'				: 0,
1500						'top'				: 0,
1501						'width'				: $(that).width()
1502					});
1503					overay1Obj.show();
1504
1505					imageObj.after(overay1Obj);
1506
1507				}else{
1508					$(".goodsDisplayImageOveray1",that).remove();
1509				}
1510
1511				if(decoration['image_slide'] && goodsInfo['image_cnt']>1){
1512					if($(".goodsDisplayImageSlide",this).length){
1513						$(".goodsDisplayImageSlide",this).remove();
1514					}
1515
1516					var imageSlideObj = $("<div class='goodsDisplayImageSlide'><img src='/data/icon/goodsdisplay/slide/"+decoration['image_slide']+"' /></div>");
1517
1518					imageObj.after(imageSlideObj);
1519
1520					imageSlideObj
1521					.css({
1522						'position'			: 'absolute',
1523						'right'				: '0px',
1524						'top'				: '50%',
1525						'margin-top'		: -(imageSlideObj.height()/2)+'px'
1526					});
1527
1528					$(imageSlideObj,imageObj).click(function(){
1529						show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']);
1530						return false;
1531					});
1532				}else{
1533					$(".goodsDisplayImageSlide",that).remove();
1534				}
1535
1536				if(decoration['quick_shopping']){
1537					if($(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").length){
1538						$(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").remove();
1539					}
1540					var quick_shopping = eval("("+decoration['quick_shopping']+")");
1541					if(quick_shopping.length){
1542
1543						var quickShoppingObj = $("<div class='goodsDisplayQuickShopping'><table class='quick_shopping_container' width='100%' border='0' cellpadding='0' cellspacing='0'><tr></tr></table></div>");
1544
1545						if(imageObj.width()){
1546							quickShoppingObj.css({'width': $(that).outerWidth()});
1547						}else{
1548							$(imageObj).bind('load',function(){
1549								quickShoppingObj.css({'width': $(this).outerWidth()});
1550							});
1551						}
1552
1553						var quickShoppingTableObj = $("table.quick_shopping_container",quickShoppingObj);
1554						quickShoppingTableObj.css({
1555							'border-collapse':'collapse',
1556							'table-layout':'fixed'
1557						});
1558
1559						$(that).after(quickShoppingObj);
1560
1561						for(var i=0;i<quick_shopping.length;i++){
1562							switch(quick_shopping[i]){
1563								case 'newwin':
1564									$('tr',quickShoppingTableObj).append("<td class='goodsNewwinBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
1565									$(".goodsNewwinBtn",quickShoppingTableObj).click(function(){
1566										if(goodsInfo.goods_seq) window.open($(imageObj).closest('a').attr('href'));
1567									});
1568								break;
1569								case 'quickview':
1570									$('tr',quickShoppingTableObj).append("<td class='goodsQuickviewBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
1571									$(".goodsQuickviewBtn",quickShoppingTableObj).click(function(){
1572										display_goods_quickview(this,goodsInfo.goods_seq);
1573										return false;
1574									});
1575								break;
1576								case 'send':
1577									$('tr',quickShoppingTableObj).append("<td class='goodsSendBtn hand'><img src='/data/icon/goodsdisplay/quick_shopping/thumb_"+quick_shopping[i]+".gif' /></td>");
1578									$(".goodsSendBtn",quickShoppingTableObj).click(function(){
1579										display_goods_send(this,'bottom');
1580										return false;
1581									});
1582								break;
1583								case 'zzim':
1584									$('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>");
1585									if(goodsInfo.wish=='1'){
1586										$(".goodsZzimBtn .zzimOnImg",quickShoppingTableObj).show();
1587										$(".goodsZzimBtn .zzimOffImg",quickShoppingTableObj).hide();
1588									}else{
1589										$(".goodsZzimBtn .zzimOffImg",quickShoppingTableObj).show();
1590										$(".goodsZzimBtn .zzimOnImg",quickShoppingTableObj).hide();
1591									}
1592									$(".goodsZzimBtn",quickShoppingTableObj).click(function(){
1593										display_goods_zzim(this,goodsInfo.goods_seq);
1594										return false;
1595									});
1596								break;
1597							}
1598						}
1599
1600						$('td',quickShoppingTableObj).css({
1601							'height':'14px',
1602							'text-align':'center',
1603							'border':'1px solid #e5e5e5',
1604							'background-color':'#fff',
1605							'font-size':'11px',
1606							'letter-spacing':'-1px'
1607						});
1608					}
1609				}else{
1610					$(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping").remove();
1611				}
1612
1613				if(decoration['use_seconde_image'] && goodsInfo.image2 != null && goodsInfo.image2.length>1){
1614					imageObj.attr("imageCut2",goodsInfo.image2);
1615				}else{
1616					imageObj.removeAttr("imageCut2");
1617				}
1618
1619				//향상된 오버레이 기능
1620				if(decoration['image_overay_plus1'] && decoration['image_overay_type'] != 'all'){
1621					if($(".goodsDisplayImageOverayPlus1",this).length){
1622						$(".goodsDisplayImageOverayPlus1",this).remove();
1623					}
1624
1625					var overay1Obj = $("<div class='goodsDisplayImageOverayPlus1'><div class='goodsDisplayImageOverayPlus1Iwrap'><div class='goodsDisplayImageOveray1BgPlus'></div><div class='goodsDisplayImageOverayPlus1Text'></div></div></div>");
1626					var image_overay_plus1		= decode_base64_json(decoration['image_overay_plus1']);
1627					var image_overay_plus1_main = decode_base64_json(decoration['image_overay_plus1_main']);
1628					var dscount_percent_use		= false;
1629					var dscount_percent_left	= false;
1630					var dscount_percent_right	= false;
1631
1632					var overay1TextObjWrap = $('<ul>');
1633					var overay1TextPer = $('<div class="goodsDisplayImageOveray1PerWrap"><div class="goodsDisplayImageOveray1PerBg"></div><div class="goodsDisplayImageOveray1PerTxt"></div></div>');
1634
1635					var discount_per_css = {
1636						'position'			: 'absolute',
1637						'top'				: 0,
1638						'text-align'		: 'center',
1639						'width'				: '45px',
1640					};
1641					var discount_per_bg_css = {
1642						'position'			: 'absolute',
1643						'background-color'	: '',
1644						'opacity'			: 1,
1645						'width'				: '45px'
1646					}
1647					var overayBgCss = {
1648						'opacity'			: 1,
1649						'background-color'	: '#000000',
1650						'color'				: '#fff',
1651						'position'			: 'absolute',
1652						'top'				: 0,
1653						'left'				: 0,
1654						'width'				: 0
1655					};
1656
1657					var default_height = 16;
1658					var default_right_per = 45;
1659					var event_key = '';
1660
1661					$.each(image_overay_plus1, function(key,option){
1662						var overay_flag = false;
1663						var discount_use= false;
1664
1665						switch(option['key']){
1666							case "goods_name":
1667								var overay1Text = goodsInfo['goods_name'];
1668								break;
1669							case "price":
1670								var overay1Text = get_currency_price(goodsInfo['price'],3);
1671								if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
1672								break;
1673							case "sale_price":
1674								var overay1Text = get_currency_price(goodsInfo['sale_price'],3);
1675								if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
1676								break;
1677							case "consumer_price":
1678								var overay1Text = get_currency_price(goodsInfo['consumer_price'],3);
1679								if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
1680								break;
1681							case "discount":
1682								var overay1Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+get_currency_price(goodsInfo['price'], 3)+'</span>';
1683								if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
1684								discount_use = true;
1685								break;
1686							case "sale_discount":
1687								var overay1Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+ get_currency_price(goodsInfo['sale_price'], 3)+'</span>';
1688								if(goodsInfo['string_price_use']=='1') overay1Text = goodsInfo['string_price'];
1689								discount_use = true;
1690								break;
1691							case "brand_title":
1692								var overay1Text = goodsInfo['brand_title'];
1693								break;
1694							case "summary":
1695								var overay1Text = goodsInfo['summary'];
1696								break;
1697							case "related_goods":
1698								var overay1Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
1699								break;
1700							case "provider_name":
1701								var overay1Text = goodsInfo['provider_name'];
1702								break;
1703							case "brand_title_eng":
1704								var overay1Text = goodsInfo['brand_title_eng'];
1705								break;
1706							case "line":
1707								var overay1Text = '';
1708								for(i=0;i<100;i++){
1709									overay1Text += '─' ;
1710								}
1711								break;
1712							case "shpping_free":
1713								if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_t
1713ype'] == 'free')
1714									var overay1Text = '무료배송';
1715								else
1716									overay_flag							= true;
1717								break;
1718							case "discount_per":
1719								if	(option.overay_discount_per <= goodsInfo['sale_per']) {
1720									if	(option.overay_discount_bg_color == 1) {
1721										discount_per_bg_css['background-color'] = option.overay_discount_per_color;
1722										discount_per_bg_css['opacity']			= 1-option.overay_discount_opacity/100;
1723
1724										if	(option.overay_discount_position == 'left') {
1725											discount_per_css['left']	= 0;
1726											dscount_percent_left		= true;
1727											overayBgCss['right']		= 0;
1728											overayBgCss['left']			= '';
1729										}else{
1730											discount_per_css['right']	= 0;
1731											dscount_percent_right		= true;
1732											overayBgCss['left']			= 0;
1733											overayBgCss['right']		= '';
1734										}
1735										$('.goodsDisplayImageOveray1PerTxt', overay1TextPer).text(goodsInfo['sale_per']+'%');
1736										dscount_percent_use				= true;
1737									}else{
1738										var overay1Text					= '할인 '+goodsInfo['sale_per']+'%';
1739									}
1740								}else{
1741									overay_flag							= true;
1742								}
1743								break;
1744							case "event_time":
1745								if	(goodsInfo['eventEnd']) {
1746									event_key	= $(that).closest('.designDisplay').prop('id');
1747									var overay1Text	= '<span class="time_count soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"> 남은시간 <span id="soloday_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>일 <span id="solohour_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solomin_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span></span>';
1748								}else{
1749									overay_flag							= true;
1750								}
1751								break;
1752							case "event_cnt":
1753								if	(goodsInfo['eventEnd']) {
1754									var overay1Text						= '현재 '+goodsInfo['event_order_ea']+'개 구매';
1755								}else{
1756									overay_flag							= true;
1757								}
1758								break;
1759							case "direct":
1760							default:
1761								var overay1Text = option.overay_text;
1762								break;
1763						}
1764
1765						if	(!overay_flag) {
1766							var overay1TextObj	= $('<li>');
1767							var default_css		= {
1768								'color'				: '#fff',
1769								'font-size'			: '11pt',
1770								'font-weight'		: '',
1771								'text-decoration'	: '',
1772								'min-height'		: default_height+'px',
1773								'line-height'		: default_height+'px'
1774							}
1775
1776							if (option.overay_font_color != undefined && option.overay_font_color)
1777								default_css['color']			= option.overay_font_color;
1778
1779							if (option.overay_font_size != undefined && option.overay_font_size)
1780								default_css['font-size']		= option.overay_font_size+'pt';
1781
1782							if (option.overay_font_weight != undefined && option.overay_font_weight > 0)
1783								default_css['font-weight']		= 'bold';
1784
1785							if (!discount_use && option.overay_line_through != undefined && option.overay_line_through > 0)
1786								default_css['text-decoration']	= option.overay_line_through;
1787
1788							if (option.overay_bracket != undefined && option.overay_bracket) {
1789								overay1Text						= option.overay_bracket.substring(0,1)+overay1Text+option.overay_bracket.substring(1,2);
1790							}
1791
1792							if	(dscount_percent_use) {
1793								$('.goodsDisplayImageOveray1PerTxt', overay1TextPer).css(default_css);
1794								dscount_percent_use				= false;
1795							}else{
1796								overay1TextObj.html(overay1Text).css(default_css);
1797								overay1TextObjWrap.append(overay1TextObj);
1798							}
1799
1800							if	(discount_use) {
1801
1802								if (option.overay_line_through != undefined && option.overay_line_through > 0)
1803									overay1TextObj.find('.left_dc').css({'text-decoration':'line-through'});
1804
1805								var sub_css = {
1806									'color'				: '#fff',
1807									'font-size'			: '11pt',
1808									'font-weight'		: 'normal'
1809								};
1810								if	(option.overay_discount_color != undefined)
1811									sub_css['color']			= option.overay_discount_color;
1812
1813								if	(option.overay_discount_font_size != undefined)
1814									sub_css['font-size']		= option.overay_discount_font_size+'pt';
1815
1816								if	(option.overay_discount_font_weight != undefined && option.overay_discount_font_weight > 0)
1817									sub_css['font-weight']		= 'bold';
1818
1819								overay1TextObj.find('.right_dc').css(sub_css);
1820							}
1821						}
1822					});
1823
1824					var text_css = {
1825						'position'				: 'relative',
1826						'text-align'			: 'center',
1827						'overflow'				: 'hidden',
1828						'white-space'			: 'nowrap',
1829						'left'					: 0,
1830						'top'					: 0,
1831						'margin'				: 0,
1832						'padding'				: 0
1833					}
1834
1835					if	(image_overay_plus1_main['overay_h_orderby'] != undefined && image_overay_plus1_main['overay_h_orderby'])
1836						text_css['text-align']	= image_overay_plus1_main['overay_h_orderby'];
1837
1838					$(".goodsDisplayImageOverayPlus1Text",overay1Obj)
1839					.html(overay1TextObjWrap).css(text_css);
1840
1841					imageObj.after(overay1Obj);
1842
1843					var this_width				= $(that).closest('.goodsDisplayImageWrap').width();
1844					if	(is_display_edit || is_image_optimize)
1845						this_width				= $(that).closest('.goodsDisplayItemWrap').width();
1846
1847					var textbox_width			= this_width;
1848					var box_height				= overay1Obj.outerHeight();
1849
1850					var obj_css = {
1851						'position'				: 'absolute',
1852						'left'					: 0,
1853						'top'					: '100%',
1854						'width'					: textbox_width,
1855						'padding-top'			: 0,
1856						'padding-bottom'		: 0,
1857						'padding-left'			: 0,
1858						'padding-right'			: 0
1859					}
1860
1861					var padding_left = 0;
1862					var padding_right = 0;
1863
1864					if	(dscount_percent_left || dscount_percent_right)
1865						textbox_width -= default_right_per;
1866
1867					if	(image_overay_plus1_main['overay_left'] != undefined && image_overay_plus1_main['overay_left']) {
1868						padding_left = parseInt(image_overay_plus1_main['overay_left']);
1869						textbox_width -= padding_left;
1870					}
1871					if (dscount_percent_left)
1872						padding_left += parseInt(default_right_per);
1873
1874					if	(image_overay_plus1_main['overay_right'] != undefined && image_overay_plus1_main['overay_right']) {
1875						padding_right = parseInt(image_overay_plus1_main['overay_right']);
1876						textbox_width -= padding_right;
1877					}
1878
1879					if	(dscount_percent_right)
1880						padding_right += parseInt(default_right_per);
1881
1882					if	(image_overay_plus1_main['overay_top'] != undefined && image_overay_plus1_main['overay_top']) {
1883						obj_css['padding-top']		= image_overay_plus1_main['overay_top']+'px';
1884						box_height					+= parseInt(image_overay_plus1_main['overay_top']);
1885					}
1886
1887					if	(image_overay_plus1_main['overay_bottom'] != undefined && image_overay_plus1_main['overay_bottom']) {
1888						obj_css['padding-bottom']	= image_overay_plus1_main['overay_bottom']+'px';
1889						box_height					+= parseInt(image_overay_plus1_main['overay_bottom']);
1890					}
1891
1892					if	(padding_left > 0)	obj_css['padding-left']		= padding_left+'px';
1893					if	(padding_right > 0)	obj_css['padding-right']	= padding_right+'px';
1894
1895					obj_css['width']				= textbox_width+'px';
1896					obj_css['margin-top']			= -box_height;
1897
1898					overayBgCss['width']			= this_width+'px';
1899
1900					if	($('.goodsDisplayImageOveray1PerTxt', overay1TextPer).html().length > 0) {
1901						$('.goodsDisplayImageOverayPlus1Iwrap', overay1Obj).append(overay1TextPer);
1902
1903						$('.goodsDisplayImageOveray1PerTxt', overay1TextPer)
1904						.css({
1905							'height'				: box_height+'px',
1906							'line-height'			: box_height+'px',
1907							'position'				: 'absolute',
1908							'text-align'			: 'center',
1909							'width'					: default_right_per+'px'
1910						});
1911
1912						discount_per_bg_css['height']	= box_height+'px';
1913						$('.goodsDisplayImageOveray1PerBg', overay1TextPer).css(discount_per_bg_css);
1914						discount_per_css['height']		= box_height+'px';
1915						discount_per_css['line-height'] = box_height+'px';
1916						$('.goodsDisplayImageOveray1PerWrap', overay1Obj).css(discount_per_css);
1917						overayBgCss['width']			= (this_width-default_right_per)+'px';
1918					}
1919
1920					overayBgCss['height']				= box_height+'px';
1921
1922					if	(image_overay_plus1_main['overay_opacity'] != undefined && image_overay_plus1_main['overay_opacity'])
1923						overayBgCss['opacity']			= 1-image_overay_plus1_main['overay_opacity']/100;
1924
1925					if	(image_overay_plus1_main['overay_bg_color'] != undefined && image_overay_plus1_main['overay_bg_color'])
1926						overayBgCss['background-color'] = image_overay_plus1_main['overay_bg_color'];
1927
1928					$(".goodsDisplayImageOveray1BgPlus",overay1Obj)
1929					.css(overayBgCss);
1930
1931					//이벤트 상품일 경우 함수 실행
1932					if	(event_key) {
1933						timeInterval = [];
1934						timeInterval[event_key+'_'+goodsInfo['goods_seq']] = setInterval(function(){
1935							var time = [];
1936							time[event_key+'_'+goodsInfo['goods_seq']] = showClockTime('text' ,goodsInfo['eventEnd']['year'], goodsInfo['eventEnd']['month'], goodsInfo['eventEnd']['day'], goodsInfo['eventEnd']['hour'], goodsInfo['eventEnd']['min'], goodsInfo['eventEnd']['second'], 'soloday_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solohour_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solomin_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq'], '_'+event_key+'_'+goodsInfo['goods_seq']);
1937							if(time[event_key+'_'+goodsInfo['goods_seq']] == 0){
1938							clearInterval(timeInterval[event_key+'_'+goodsInfo['goods_seq']]);
1939							$('.soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']).html("단독 이벤트 종료");
1940							}
1941						},1000);
1942					}
1943
1944					overay1Obj
1945					.css(obj_css).show();
1946				}else{
1947					$(".goodsDisplayImageOverayPlus1",that).remove();
1948				}
1949
1950				if(decoration['image_slide'] && goodsInfo['image_cnt']>1){
1951					var imageSlideObj = $(".goodsDisplayImageSlide",this);
1952					$(imageSlideObj,imageObj).click(function(){
1953						show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']);
1954						return false;
1955					});
1956				}
1957
1958				if(decoration['quick_shopping']){
1959					var quickShoppingObj = $(that).closest('.goodsDisplayItemWrap').find(".goodsDisplayQuickShopping");
1960					if(quickShoppingObj.length){
1961						if(imageObj.width()){
1962							quickShoppingObj.css({'width': $(that).outerWidth()});
1963						}else{
1964							$(imageObj).bind('load',function(){
1965								quickShoppingObj.css({'width': $(this).outerWidth()});
1966							});
1967						}
1968					}
1969				}
1970
1971				if(decoration['use_seconde_image'] && goodsInfo.image2 != null && goodsInfo.image2.length>1){
1972					imageObj.attr("imageCut2",goodsInfo.image2);
1973				}else{
1974					imageObj.removeAttr("imageCut2");
1975				}
1976
1977				if	(decoration['use_image_zoom']) {
1978					$(this).addClass('goodsDisplayImageZoom').css('overflow','hidden');
1979				}else{
1980					$(this).removeClass('goodsDisplayImageZoom').css('overflow','');
1981				}
1982
1983				if	(decoration['use_image_3d']) {
1984					$(this).closest('.goodsDisplayItemWrap').addClass('goodsDisplayimageBox3d');
1985				}else{
1986					$(this).closest('.goodsDisplayItemWrap').removeClass('goodsDisplayimageBox3d');
1987				}
1988
1989				if	(decoration['image_icon'] && decoration['image_icon_type'] == 'condition') {
1990					icon_condition = decode_base64_json(decoration['image_icon_condition']);
1991					icon_use_flag = false;
1992
1993					if($(".goodsDisplayImageIcon",this).length){
1994						$(".goodsDisplayImageIcon",this).remove();
1995					}
1996
1997					var imageIconObj = $("<div class='goodsDisplayImageIcon'><div class='goodsDisplayImageIconWrap'></div></div>");
1998
1999					if(decoration['image_icon_location']=='right'){
2000						imageIconObj
2001						.css({
2002							'position'			: 'absolute',
2003							'right'				: '0px',
2004							'top'				: imageObj.position().top,
2005						});
2006					}else{
2007						imageIconObj
2008						.css({
2009							'position'			: 'absolute',
2010							'left'				: imageObj.position().left,
2011							'top'				: imageObj.position().top
2012						});
2013					}
2014
2015					if(decoration['image_icon_over']=='y'){
2016						imageIconObj.hide();
2017					}else if(typeof iconText != 'undefined' && iconText.length){
2018						imageIconObj.show();
2019					}
2020
2021					imageObj.after(imageIconObj);
2022
2023					var condition = {
2024						'{discount}'		: 99,
2025						'{brand}'			: '퍼스트몰',
2026						'{brandeng}'		: 'firstmall',
2027						'{bestnum}'			: goodsInfo['goods_index']
2028					}
2029
2030					if	(icon_condition) {
2031						for(i=0; i<3; i++){
2032							if	(icon_condition[i]['use'] == '1' && !icon_use_flag) {
2033								var contents = [];
2034								$.each(icon_condition[i]['contents'], function(txt_k, txt_v){
2035									if	(txt_v['txt'] && txt_v['use'] == '1') {
2036										if	(txt_v['txt_type'] == 'shipping_free') {
2037											if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_type'] == 'free')
2038												contents.push(txt_v);
2039										}else{
2040											contents.push(txt_v);
2041										}
2042									}
2043								});
2044								switch(icon_condition[i]['key']){
2045									case 'discount_per':
2046										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2047										icon_use_flag = true;
2048									break;
2049									case 'solo':
2050										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2051										icon_use_flag = true;
2052									break;
2053									case 'discount':
2054										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2055										icon_use_flag = true;
2056									break;
2057									case 'gift':
2058									break;
2059									case 'package':
2060										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2061										icon_use_flag = true;
2062									break;
2063									case 'date':
2064										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2065										icon_use_flag = true;
2066									break;
2067									case 'empty':
2068										set_condition_icon($(".goodsDisplayImageIconWrap",this),contents,condition,icon_condition[i]['background']);
2069										icon_use_flag = true;
2070									break;
2071								}
2072							}
2073						}
2074					}
2075					if	(!icon_use_flag)
2076						$(".goodsDisplayImageIconWrap",this).remove();
2077					else
2078						$(".goodsDisplayImageIconWrap",this).show();
2079				}
2080			}
2081		}
2082
2083		$(that).data('decorationLoaded',true);
2084		/*
2085		$(".quick_shopping_view",$(that).closest('.goodsDisplayItemWrap')).click(function(){
2086			alert(goodsInfo.goods_name + ' 퀵뷰 버튼 클릭');
2087			return false;
2088		});
2089		*/
2090		if(goodsInfo['image_cnt']>1){
2091			$(".quick_shopping_image",$(that).closest('.goodsDisplayItemWrap')).click(function(){
2092				show_display_goods_images(that,goodsInfo['goods_seq'],decoration['image_slide_type']?decoration['image_slide_type']:'bottom');
2093			});
2094		}else{
2095			$(".quick_shopping_image",$(that).closest('.goodsDisplayItemWrap')).remove();
2096		}
2097
2098		//상품 정보 확인
2099		goodsTextWrap = $(that).closest('.goodsDisplayItemWrap').find('.goodsDisplayTextWrap');
2100		if	(goodsTextWrap.html() && goodsTextWrap.html().length < 10) {
2101			goodsTextWrap.remove();
2102		}
2103		/*
2104		$(".quick_shopping_send",$(that).closest('.goodsDisplayItemWrap')).click(function(){
2105			alert(goodsInfo.goods_name + ' 보내기 버튼 클릭');
2106			return false;
2107		});
2108		*/
2109	});
2110
2111}
2112
2113function set_goods_display_decoration_event(selector){
2114	$(selector)
2115	.bind("mouseenter",function(){
2116		var decoration = $(this).data("decoration");
2117		var goodsInfo = $(this).data("goodsInfo");
2118		var imageObj = $(this).find("img:eq(0)");
2119		var imageCut2 = imageObj.attr("imageCut2");
2120		var imgBorderOrg = $(this);
2121		var version = $(this).attr('version');
2122		var is_display_edit = false;
2123
2124		if	(version == 'display_edit') is_display_edit = true;
2125
2126		if(imageCut2){
2127			imageObj.attr('oriSrc',imageObj.attr('src'));
2128			imageObj.attr('src',imageCut2);
2129		}
2130
2131		if(decoration){
2132			if	(decoration['image_border_type'] && decoration['image_border_type']=='all') {
2133				imgBorderOrg = imgBorderOrg.closest('.goodsDisplayItemWrap');
2134			}
2135
2136			if(decoration['image_border'] && decoration['image_border_mobile'] != 'mobile' && decoration['image_border_type'] != 'all'){
2137				imgBorderOrg.css({"border":decoration['image_border_width'] + "px solid " + decoration['image_border'],"margin":"-"+decoration['image_border_width']+"px"});
2138			}
2139
2140			if(decoration['image_opacity']){
2141				imageObj.css({"opacity":1-decoration['image_opacity']/100});
2142			}
2143
2144			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
2145				var imageIconObj = $(".goodsDisplayImageIcon",this);
2146				imageIconObj.show();
2147			}
2148
2149			if((decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']) && decoration['image_send_over']=='y'){
2150				var imageSendObj = $(".goodsDisplayImageSend",this);
2151				imageSendObj.show();
2152			}
2153
2154			if	(decoration['use_review_option_like']) {
2155				var reviewObj = $(".goodsDisplayBottomFunc div",this).not('[act="stay"]');
2156				reviewObj.attr('act','hover');
2157				chk_display_goods_show_opt(this,true);
2158			}
2159
2160			if(decoration['image_overay2'] || decoration['image_overay2_text']){
2161
2162				if($(".goodsDisplayImageOveray2",this).length){
2163					var overay2Obj = $(".goodsDisplayImageOveray2",this);
2164				}else{
2165					var overay2Obj = $("<div class='goodsDisplayImageOveray2'><div class='goodsDisplayImageOveray2Bg'></div><div class='goodsDisplayImageOveray2Text'></div></div>");
2166				}
2167
2168				var overay2Height = 20;
2169				var overay2Top = $(".goodsDisplayImageOveray1",this).length ? $(this).height() - $(".goodsDisplayImageOveray1",this).height(): $(this).height();
2170
2171				switch(decoration['image_overay2']){
2172					case "goods_name":
2173						var overay2Text = goodsInfo['goods_name'];
2174
2175						break;
2176					case "price":
2177						var overay2Text = get_currency_price(goodsInfo['price'],2);
2178
2179						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2180
2181						break;
2182					case "consumer_price":
2183						var overay2Text = get_currency_price(goodsInfo['consumer_price'],2);
2184
2185						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2186
2187						break;
2188					case "sale_price":
2189						var overay2Text = get_currency_price(goodsInfo['sale_price'],2);
2190
2191						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2192
2193						break;
2194					case "discount":
2195						var overay2Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['price']);
2196
2197						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2198
2199						break;
2200					case "sale_discount":
2201						var overay2Text = get_currency_price(goodsInfo['consumer_price']) + " → " + get_currency_price(goodsInfo['sale_price']);
2202
2203						if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2204
2205						break;
2206					case "brand_title":
2207						var overay2Text = goodsInfo['brand_title'];
2208						break;
2209					case "related_goods":
2210						var overay2Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block'>관련상품보기</span>";
2211						break;
2212					case "":
2213					default:
2214						var overay2Text = decoration['image_overay2_text'];
2215
2216						break;
2217				}
2218
2219				overay2Obj
2220				.css({
2221					'position'			: 'absolute',
2222					'left'				: 0,
2223					'top'				: overay2Top-overay2Height,
2224					'width'				: $(this).width(),
2225					'height'			: overay2Height
2226				});
2227
2228				$(".goodsDisplayImageOveray2Bg",overay2Obj)
2229				.css({
2230					'background-color'	: '#000000',
2231					'color'				: '#fff',
2232					'opacity'			: 0.3,
2233					'position'			: 'absolute',
2234					'left'				: 0,
2235					'top'				: 0,
2236					'width'				: $(this).width(),
2237					'height'			: overay2Height
2238				});
2239
2240				$(".goodsDisplayImageOveray2Text",overay2Obj)
2241				.html(overay2Text)
2242				.css({
2243					'color'				: '#fff',
2244					'font-size'			: '11px',
2245					'font-weight'		: 'bold',
2246					'text-align'		: 'center',
2247					'position'			: 'absolute',
2248					'overflow'			: 'hidden',
2249					'white-space'		: 'nowrap',
2250					'line-height'		: overay2Height+'px',
2251					'left'				: 0,
2252					'top'				: 0,
2253					'width'				: $(this).width()
2254				});
2255				imageObj.after(overay2Obj.show());
2256
2257			}else{
2258				$(".goodsDisplayImageOveray2",this).remove();
2259			}
2260
2261			//향상된 오버레이 기능
2262			if(decoration['image_overay_plus2'] && decoration['image_overay_type'] != 'all'){
2263				if	(is_display_edit) $(".goodsDisplayImageOverayPlus2",this).remove();
2264
2265				if($(".goodsDisplayImageOverayPlus2",this).length){
2266					$(".goodsDisplayImageOverayPlus2",this).show();
2267					$(".goodsDisplayImageOveray2PerWrap",this).show();
2268				}else{
2269					var overay2Obj = $("<div class='goodsDisplayImageOverayPlus2'><div class='goodsDisplayImageOverayPlus2Iwrap'><div class='goodsDisplayImageOveray2BgPlus'></div><div class='goodsDisplayImageOverayPlus2Text'></div></div></div>");
2270					var overay2TextPer = $('<div class="goodsDisplayImageOveray2PerWrap"><div class="goodsDisplayImageOveray2PerBg"></div><div class="goodsDisplayImageOveray2PerTxt"></div></div>');
2271					var image_overay_plus2		= decode_base64_json(decoration['image_overay_plus2']);
2272					var image_overay_plus2_main = decode_base64_json(decoration['image_overay_plus2_main']);
2273					var dscount_percent_use		= false;
2274					var dscount_percent_left	= false;
2275					var dscount_percent_right	= false;
2276
2277					var overay2TextObjWrap = $('<ul>');
2278
2279					var discount_per_css = {
2280						'position'			: 'absolute',
2281						'top'				: 0,
2282						'text-align'		: 'center',
2283						'width'				: '45px',
2284					};
2285					var discount_per_bg_css = {
2286						'position'			: 'absolute',
2287						'background-color'	: '',
2288						'opacity'			: 1,
2289						'width'				: '45px'
2290					}
2291					var overayBgCss = {
2292						'opacity'			: 1,
2293						'background-color'	: '#000000',
2294						'color'				: '#fff',
2295						'position'			: 'absolute',
2296						'top'				: 0,
2297						'left'				: 0,
2298						'width'				: 0
2299					};
2300
2301					var default_height = 16;
2302					var default_right_per = 45;
2303					var event_key = '';
2304					var overay2Top = $(".goodsDisplayImageOverayPlus1",this).length ? $(".goodsDisplayImageOverayPlus1",this).outerHeight(): 0;
2305					//image_overay_plus1은 이미지 최적화 여부에 따라 늦게 설정 되기때문에 비동기 페이징의 경우를 위해 한번 더 확인 한다
2306					if	(decoration['image_overay_plus1'] && decoration['image_overay_type'] != 'all' && overay2Top == 0) return;
2307
2308					$.each(image_overay_plus2, function(key,option){
2309						var overay_flag = false;
2310						var discount_use = false;
2311
2312						switch(option['key']){
2313							case "goods_name":
2314								var overay2Text = goodsInfo['goods_name'];
2315								break;
2316							case "price":
2317								var overay2Text = get_currency_price(goodsInfo['price'],3);
2318								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2319								break;
2320							case "sale_price":
2321								var overay2Text = get_currency_price(goodsInfo['sale_price'],3);
2322								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2323								break;
2324							case "consumer_price":
2325								var overay2Text = get_currency_price(goodsInfo['consumer_price'],3);
2326								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2327								break;
2328							case "discount":
2329								var overay2Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+get_currency_price(goodsInfo['price'], 3)+'</span>';
2330								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2331								discount_use = true;
2332								break;
2333							case "sale_discount":
2334								var overay2Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+ get_currency_price(goodsInfo['sale_price'], 3)+'</span>';
2335								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2336								discount_use = true;
2337								break;
2338							case "brand_title":
2339								var overay2Text = goodsInfo['brand_title'];
2340								break;
2341							case "summary":
2342								var overay2Text = goodsInfo['summary'];
2343								break;
2344							case "related_goods":
2345								var overay2Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
2346								break;
2347							case "provider_name":
2348								var overay2Text = goodsInfo['provider_name'];
2349								break;
2350							case "brand_title_eng":
2351								var overay2Text = goodsInfo['brand_title_eng'];
2352								break;
2353							case "line":
2354								var overay2Text = '';
2355								for(i=0;i<100;i++){
2356									overay2Text += '─' ;
2357								}
2358								break;
2359							case "shpping_free":
2360								if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_type'] == 'free')
2361									var overay2Text = '무료배송';
2362								else
2363									overay_flag							= true;
2364								break;
2365							case "discount_per":
2366								if	(option.overay_discount_per <= goodsInfo['sale_per']) {
2367									if	(option.overay_discount_bg_color == 1) {
2368										discount_per_bg_css['background-color'] = option.overay_discount_per_color;
2369										discount_per_bg_css['opacity']			= 1-option.overay_discount_opacity/100;
2370
2371										if	(option.overay_discount_position == 'left') {
2372											discount_per_css['left']	= 0;
2373											dscount_percent_left		= true;
2374											overayBgCss['right']		= 0;
2375											overayBgCss['left']			= '';
2376										}else{
2377											discount_per_css['right']	= 0;
2378											dscount_percent_right		= true;
2379											overayBgCss['left']			= 0;
2380											overayBgCss['right']		= '';
2381										}
2382										$('.goodsDisplayImageOveray2PerTxt', overay2TextPer).text(goodsInfo['sale_per']+'%');
2383										dscount_percent_use				= true;
2384									}else{
2385										var overay2Text					= '할인 '+goodsInfo['sale_per']+'%';
2386									}
2387								}else{
2388									overay_flag							= true;
2389								}
2390								break;
2391							case "event_time":
2392								if	(goodsInfo['eventEnd']) {
2393									event_key	= $(this).closest('.designDisplay').prop('id')+'_overay_2';
2394									var overay2Text	= '<span class="time_count soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"> 남은시간 <span id="soloday_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>일 <span id="solohour_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solomin_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span></span>';
2395								}else{
2396									overay_flag							= true;
2397								}
2398								break;
2399							case "event_cnt":
2400								if	(goodsInfo['eventEnd']) {
2401									var overay2Text						= '현재 '+goodsInfo['event_order_ea']+'개 구매';
2402								}else{
2403									overay_flag							= true;
2404								}
2405								break;
2406							case "direct":
2407							default:
2408								var overay2Text = option.overay_text;
2409								break;
2410						}
2411
2412						if	(!overay_flag) {
2413							var overay2TextObj	= $('<li>');
2414							var default_css		= {
2415								'color'				: '#fff',
2416								'font-size'			: '11pt',
2417								'font-weight'		: '',
2418								'text-decoration'	: '',
2419								'min-height'		: default_height+'px',
2420								'line-height'		: default_height+'px'
2421							}
2422
2423							if (option.overay_font_color != undefined && option.overay_font_color)
2424								default_css['color']			= option.overay_font_color;
2425
2426							if (option.overay_font_size != undefined && option.overay_font_size)
2427								default_css['font-size']		= option.overay_font_size+'pt';
2428
2429							if (option.overay_font_weight != undefined && option.overay_font_weight > 0)
2430								default_css['font-weight']		= 'bold';
2431
2432							if (!discount_use && option.overay_line_through != undefined && option.overay_line_through > 0)
2433								default_css['text-decoration']	= 'line-through';
2434
2435							if (option.overay_bracket != undefined && option.overay_bracket) {
2436								overay2Text						= option.overay_bracket.substring(0,1)+overay2Text+option.overay_bracket.substring(1,2);
2437							}
2438
2439							if	(dscount_percent_use) {
2440								$('.goodsDisplayImageOveray2PerTxt', overay2TextPer).css(default_css);
2441								dscount_percent_use				= false;
2442							}else{
2443								overay2TextObj.html(overay2Text).css(default_css);
2444								overay2TextObjWrap.append(overay2TextObj);
2445							}
2446
2447							if	(discount_use) {
2448
2449								if (option.overay_line_through != undefined && option.overay_line_through > 0)
2450									overay2TextObj.find('.left_dc').css({'text-decoration':'line-through'});
2451
2452								var sub_css = {
2453									'color'				: '#fff',
2454									'font-size'			: '11pt',
2455									'font-weight'		: 'normal'
2456								};
2457								if	(option.overay_discount_color != undefined)
2458									sub_css['color']			= option.overay_discount_color;
2459
2460								if	(option.overay_discount_font_size != undefined)
2461									sub_css['font-size']		= option.overay_discount_font_size+'pt';
2462
2463								if	(option.overay_discount_font_weight != undefined && option.overay_discount_font_weight > 0)
2464									sub_css['font-weight']		= 'bold';
2465
2466								overay2TextObj.find('.right_dc').css(sub_css);
2467							}
2468						}
2469					});
2470
2471
2472					var this_width	= $(this).closest('.goodsDisplayImageWrap').width();
2473					if	(is_display_edit) this_width = $(this).closest('.goodsDisplayItemWrap').width();
2474					var text_css = {
2475						'position'				: 'relative',
2476						'text-align'			: 'center',
2477						'overflow'				: 'hidden',
2478						'white-space'			: 'nowrap',
2479						'left'					: 0,
2480						'top'					: 0,
2481						'margin'				: 0,
2482						'padding'				: 0
2483					}
2484
2485					if	(image_overay_plus2_main['overay_h_orderby'] != undefined && image_overay_plus2_main['overay_h_orderby'])
2486						text_css['text-align']	= image_overay_plus2_main['overay_h_orderby'];
2487
2488					$(".goodsDisplayImageOverayPlus2Text",overay2Obj)
2489					.html(overay2TextObjWrap).css(text_css);
2490
2491					imageObj.after(overay2Obj);
2492
2493					var textbox_width			= this_width;
2494					var box_height				= overay2Obj.outerHeight();
2495					var obj_css = {
2496						'position'				: 'absolute',
2497						'left'					: 0,
2498						'top'					: '100%',
2499						'width'					: this_width,
2500						'padding-top'			: 0,
2501						'padding-bottom'		: 0,
2502						'padding-left'			: 0,
2503						'padding-right'			: 0
2504					}
2505
2506					var padding_left = 0;
2507					var padding_right = 0;
2508
2509					if	(dscount_percent_left || dscount_percent_right)
2510						textbox_width -= default_right_per;
2511
2512					if	(image_overay_plus2_main['overay_left'] != undefined && image_overay_plus2_main['overay_left']) {
2513						padding_left = parseInt(image_overay_plus2_main['overay_left']);
2514						textbox_width -= padding_left;
2515					}
2516					if (dscount_percent_left)
2517						padding_left += parseInt(default_right_per);
2518
2519					if	(image_overay_plus2_main['overay_right'] != undefined && image_overay_plus2_main['overay_right']) {
2520						padding_right = parseInt(image_overay_plus2_main['overay_right']);
2521						textbox_width -= padding_right;
2522					}
2523
2524					if	(dscount_percent_right)
2525						padding_right += parseInt(default_right_per);
2526
2527					if	(image_overay_plus2_main['overay_top'] != undefined && image_overay_plus2_main['overay_top']) {
2528						obj_css['padding-top']		= image_overay_plus2_main['overay_top']+'px';
2529						box_height					+= parseInt(image_overay_plus2_main['overay_top']);
2530					}
2531
2532					if	(image_overay_plus2_main['overay_bottom'] != undefined && image_overay_plus2_main['overay_bottom']) {
2533						obj_css['padding-bottom']	= image_overay_plus2_main['overay_bottom']+'px';
2534						box_height					+= parseInt(image_overay_plus2_main['overay_bottom']);
2535					}
2536
2537					if	(padding_left > 0)	obj_css['padding-left']		= padding_left+'px';
2538					if	(padding_right > 0)	obj_css['padding-right']	= padding_right+'px';
2539
2540					obj_css['width']				= textbox_width+'px';
2541					obj_css['margin-top']			= -(overay2Top+box_height);
2542
2543					overayBgCss['width']			= this_width+'px';
2544
2545					if	($('.goodsDisplayImageOveray2PerTxt', overay2TextPer).html().length > 0) {
2546						$('.goodsDisplayImageOverayPlus2Iwrap', overay2Obj).append(overay2TextPer);
2547
2548						$('.goodsDisplayImageOveray2PerTxt', overay2TextPer)
2549						.css({
2550							'height'				: box_height+'px',
2551							'line-height'			: box_height+'px',
2552							'position'				: 'absolute',
2553							'text-align'			: 'center',
2554							'width'					: default_right_per+'px'
2555						});
2556
2557						discount_per_bg_css['height']	= box_height+'px';
2558						$('.goodsDisplayImageOveray2PerBg', overay2TextPer).css(discount_per_bg_css);
2559						discount_per_css['height']		= box_height+'px';
2560						discount_per_css['line-height'] = box_height+'px';
2561						$('.goodsDisplayImageOveray2PerWrap', overay2Obj).css(discount_per_css);
2562						overayBgCss['width']			= (this_width-default_right_per)+'px';
2563					}
2564
2565					overayBgCss['height']				= box_height+'px';
2566
2567					if	(image_overay_plus2_main['overay_opacity'] != undefined && image_overay_plus2_main['overay_opacity'])
2568						overayBgCss['opacity']			= 1-image_overay_plus2_main['overay_opacity']/100;
2569
2570					if	(image_overay_plus2_main['overay_bg_color'] != undefined && image_overay_plus2_main['overay_bg_color'])
2571						overayBgCss['background-color'] = image_overay_plus2_main['overay_bg_color'];
2572
2573					$(".goodsDisplayImageOveray2BgPlus",overay2Obj)
2574					.css(overayBgCss);
2575
2576					//이벤트 상품일 경우 함수 실행
2577					if	(event_key) {
2578						timeInterval = [];
2579						timeInterval[event_key+'_'+goodsInfo['goods_seq']] = setInterval(function(){
2580							var time = [];
2581							time[event_key+'_'+goodsInfo['goods_seq']] = showClockTime('text' ,goodsInfo['eventEnd']['year'], goodsInfo['eventEnd']['month'], goodsInfo['eventEnd']['day'], goodsInfo['eventEnd']['hour'], goodsInfo['eventEnd']['min'], goodsInfo['eventEnd']['second'], 'soloday_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solohour_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solomin_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq'], '_'+event_key+'_'+goodsInfo['goods_seq']);
2582							if(time[event_key+'_'+goodsInfo['goods_seq']] == 0){
2583							clearInterval(timeInterval[event_key+'_'+goodsInfo['goods_seq']]);
2584							$('.soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']).html("단독 이벤트 종료");
2585							}
2586						},1000);
2587					}
2588
2589					overay2Obj
2590					.css(obj_css).show();
2591				}
2592			}
2593
2594			if	(decoration['image_overay_plus2'] && decoration['image_overay_type'] == 'all') {
2595				if	(is_display_edit) $(".goodsDisplayImageOverayPlus2",this).remove();
2596
2597				if($(".goodsDisplayImageOverayPlus2",this).length){
2598					$(".goodsDisplayImageOverayPlus2",this).show();
2599					$(".goodsDisplayImageOveray2PerWrap",this).show();
2600				}else{
2601					var overay2Obj = $("<div class='goodsDisplayImageOverayPlus2'><div class='goodsDisplayImageOverayPlus2Iwrap'><div class='goodsDisplayImageOveray2BgPlus'></div><div class='goodsDisplayImageOverayPlus2Text'></div></div></div>");
2602
2603					var image_overay_plus2		= decode_base64_json(decoration['image_overay_plus2']);
2604					var image_overay_plus2_main = decode_base64_json(decoration['image_overay_plus2_main']);
2605					var img_height = $(this).find('.goodsDisplayImage').height();
2606					var overay2TextObjWrap = $('<ul>');
2607					var default_height = 16;
2608					var seq = 0;
2609
2610					$.each(image_overay_plus2, function(key,option){
2611						var overay_flag = false;
2612						var discount_use = false;
2613
2614						switch(option['key']){
2615							case "goods_name":
2616								var overay2Text = goodsInfo['goods_name'];
2617								break;
2618							case "price":
2619								var overay2Text = get_currency_price(goodsInfo['price'],3);
2620								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2621								break;
2622							case "sale_price":
2623								var overay2Text = get_currency_price(goodsInfo['sale_price'],3);
2624								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2625								break;
2626							case "consumer_price":
2627								var overay2Text = get_currency_price(goodsInfo['consumer_price'],3);
2628								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2629								break;
2630							case "discount":
2631								var overay2Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+get_currency_price(goodsInfo['price'], 3)+'</span>';
2632								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2633								discount_use = true;
2634								break;
2635							case "sale_discount":
2636								var overay2Text = '<span class="left_dc">'+get_currency_price(goodsInfo['consumer_price'], 3) + '</span>' + ' → ' + '<span class="right_dc">'+ get_currency_price(goodsInfo['sale_price'], 3)+'</span>';
2637								if(goodsInfo['string_price_use']=='1') overay2Text = goodsInfo['string_price'];
2638								discount_use = true;
2639								break;
2640							case "brand_title":
2641								var overay2Text = goodsInfo['brand_title'];
2642								break;
2643							case "summary":
2644								var overay2Text = goodsInfo['summary'];
2645								break;
2646							case "related_goods":
2647								var overay2Text = "<span class='hand' onclick=\"return show_display_related_goods(this,'"+goodsInfo['goods_seq']+"')\" style='display:block;'>관련상품보기</span>";
2648								break;
2649							case "provider_name":
2650								var overay2Text = goodsInfo['provider_name'];
2651								break;
2652							case "brand_title_eng":
2653								var overay2Text = goodsInfo['brand_title_eng'];
2654								break;
2655							case "line":
2656								var overay2Text = '';
2657								for(i=0;i<100;i++){
2658									overay2Text += '─' ;
2659								}
2660								break;
2661							case "shpping_free":
2662								if	(goodsInfo['shipping_group'] && goodsInfo['shipping_group']['default_t
2662ype'] == 'free')
2663									var overay2Text = '무료배송';
2664								else
2665									overay_flag							= true;
2666								break;
2667							case "discount_per":
2668								if	(option.overay_discount_per <= goodsInfo['sale_per'])
2669										var overay2Text					= '할인 '+goodsInfo['sale_per']+'%';
2670								else
2671									overay_flag							= true;
2672								break;
2673							case "event_time":
2674								if	(goodsInfo['eventEnd']) {
2675									event_key	= $(this).closest('.designDisplay').prop('id')+'_overay_2';
2676									var overay2Text	= '<span class="time_count soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"> 남은시간 <span id="soloday_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>일 <span id="solohour_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solomin_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span>:<span id="solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq']+'"></span></span>';
2677								}else{
2678									overay_flag							= true;
2679								}
2680								break;
2681							case "event_cnt":
2682								if	(goodsInfo['eventEnd']) {
2683									var overay2Text						= '현재 '+goodsInfo['event_order_ea']+'개 구매';
2684								}else{
2685									overay_flag							= true;
2686								}
2687								break;
2688							case "direct":
2689							default:
2690								var overay2Text = option.overay_text;
2691								break;
2692						}
2693
2694						if	(!overay_flag) {
2695							var overay2TextObj	= $('<li>');
2696							overay2TextObj.addClass('overay_txt_line_'+seq);
2697							var default_css		= {
2698								'color'				: '#fff',
2699								'font-size'			: '11pt',
2700								'font-weight'		: '',
2701								'text-decoration'	: '',
2702								'min-height'		: default_height+'px',
2703								'line-height'		: default_height+'px'
2704							}
2705
2706							if (option.overay_font_color != undefined && option.overay_font_color)
2707								default_css['color']			= option.overay_font_color;
2708
2709							if (option.overay_font_size != undefined && option.overay_font_size)
2710								default_css['font-size']		= option.overay_font_size+'pt';
2711
2712							if (option.overay_font_weight != undefined && option.overay_font_weight > 0)
2713								default_css['font-weight']		= 'bold';
2714
2715							if (!discount_use && option.overay_line_through != undefined && option.overay_line_through > 0)
2716								default_css['text-decoration']	= 'line-through';
2717
2718							if (option.overay_bracket != undefined && option.overay_bracket) {
2719								overay2Text						= option.overay_bracket.substring(0,1)+overay2Text+option.overay_bracket.substring(1,2);
2720							}
2721
2722							overay2TextObj.html(overay2Text).css(default_css);
2723							overay2TextObjWrap.append(overay2TextObj);
2724
2725							if	(discount_use) {
2726
2727								if (option.overay_line_through != undefined && option.overay_line_through > 0)
2728									overay2TextObj.find('.left_dc').css({'text-decoration':'line-through'});
2729
2730								var sub_css = {
2731									'color'				: '#fff',
2732									'font-size'			: '11pt',
2733									'font-weight'		: 'normal'
2734								};
2735								if	(option.overay_discount_color != undefined)
2736									sub_css['color']			= option.overay_discount_color;
2737
2738								if	(option.overay_discount_font_size != undefined)
2739									sub_css['font-size']		= option.overay_discount_font_size+'pt';
2740
2741								if	(option.overay_discount_font_weight != undefined && option.overay_discount_font_weight > 0)
2742									sub_css['font-weight']		= 'bold';
2743
2744								overay2TextObj.find('.right_dc').css(sub_css);
2745							}
2746						}
2747
2748						seq++;
2749					});
2750
2751					var overayBgCss = {
2752						'opacity'			: 1,
2753						'background-color'	: '#000000',
2754						'color'				: '#fff',
2755						'position'			: 'absolute',
2756						'top'				: 0,
2757						'left'				: 0,
2758						'width'				: $(this).width(),
2759						'height'			: img_height
2760					};
2761
2762					if	(image_overay_plus2_main['overay_opacity'] != undefined && image_overay_plus2_main['overay_opacity'])
2763						overayBgCss['opacity']			= 1-image_overay_plus2_main['overay_opacity']/100;
2764
2765					if	(image_overay_plus2_main['overay_bg_color'] != undefined && image_overay_plus2_main['overay_bg_color'])
2766						overayBgCss['background-color'] = image_overay_plus2_main['overay_bg_color'];
2767
2768					$(".goodsDisplayImageOveray2BgPlus",overay2Obj)
2769					.css(overayBgCss);
2770
2771					var text_css = {
2772						'position'				: 'relative',
2773						'text-align'			: 'center',
2774						'overflow'				: 'hidden',
2775						'left'					: 0,
2776						'top'					: 0,
2777						'margin'				: 0,
2778						'padding'				: 0
2779					}
2780
2781					if	(image_overay_plus2_main['overay_h_orderby'] != undefined && image_overay_plus2_main['overay_h_orderby'])
2782						text_css['text-align']	= image_overay_plus2_main['overay_h_orderby'];
2783
2784					$(".goodsDisplayImageOverayPlus2Text",overay2Obj)
2785					.html(overay2TextObjWrap).css(text_css);
2786
2787					imageObj.after(overay2Obj);
2788
2789					//이벤트 상품일 경우 함수 실행
2790					if	(event_key) {
2791						timeInterval = [];
2792						timeInterval[event_key+'_'+goodsInfo['goods_seq']] = setInterval(function(){
2793							var time = [];
2794							time[event_key+'_'+goodsInfo['goods_seq']] = showClockTime('text' ,goodsInfo['eventEnd']['year'], goodsInfo['eventEnd']['month'], goodsInfo['eventEnd']['day'], goodsInfo['eventEnd']['hour'], goodsInfo['eventEnd']['min'], goodsInfo['eventEnd']['second'], 'soloday_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solohour_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solomin_overay_'+event_key+'_'+goodsInfo['goods_seq'], 'solosecond_overay_'+event_key+'_'+goodsInfo['goods_seq'], '_'+event_key+'_'+goodsInfo['goods_seq']);
2795							if(time[event_key+'_'+goodsInfo['goods_seq']] == 0){
2796							clearInterval(timeInterval[event_key+'_'+goodsInfo['goods_seq']]);
2797							$('.soloEventTd_overay_'+event_key+'_'+goodsInfo['goods_seq']).html("단독 이벤트 종료");
2798							}
2799						},1000);
2800					}
2801
2802					var this_width				= $(this).closest('.goodsDisplayImageWrap').width();
2803					if	(is_display_edit) this_width = $(this).closest('.goodsDisplayItemWrap').width();
2804					var textbox_width			= this_width;
2805					var box_height				= img_height;
2806					var box_padding_top			= 0;
2807					var box_padding_bottom		= 0;
2808					var obj_css = {
2809						'position'				: 'absolute',
2810						'left'					: 0,
2811						'top'					: '100%',
2812						'width'					: this_width,
2813						'height'				: img_height,
2814						'padding-top'			: 0,
2815						'padding-bottom'		: 0,
2816						'padding-left'			: 0,
2817						'padding-right'			: 0
2818					}
2819
2820					if	(image_overay_plus2_main['overay_left'] != undefined && image_overay_plus2_main['overay_left']) {
2821						obj_css['padding-left'] = image_overay_plus2_main['overay_left']+'px';
2822						textbox_width -= parseInt(image_overay_plus2_main['overay_left']);
2823					}
2824
2825					if	(image_overay_plus2_main['overay_right'] != undefined && image_overay_plus2_main['overay_right']) {
2826						obj_css['padding-right']	= image_overay_plus2_main['overay_right']+'px';
2827						textbox_width				-= parseInt(image_overay_plus2_main['overay_right']);
2828					}
2829
2830					if	(image_overay_plus2_main['overay_top'] != undefined && image_overay_plus2_main['overay_top']) {
2831						obj_css['padding-top']		= image_overay_plus2_main['overay_top']+'px';
2832						box_padding_top				= parseInt(image_overay_plus2_main['overay_top']);
2833					}
2834
2835					if	(image_overay_plus2_main['overay_bottom'] != undefined && image_overay_plus2_main['overay_bottom']) {
2836						obj_css['padding-bottom']	= image_overay_plus2_main['overay_bottom']+'px';
2837						box_padding_bottom			= parseInt(image_overay_plus2_main['overay_bottom']);
2838					}
2839
2840					if	(image_overay_plus2_main['overay_v_orderby'] != undefined && image_overay_plus2_main['overay_v_orderby']) {
2841						if	(image_overay_plus2_main['overay_v_orderby'] == 'middle') {
2842							padding = (box_height-$(".goodsDisplayImageOverayPlus2Text",overay2Obj).height()) / 2;
2843							obj_css['padding-top'] = padding+box_padding_top+'px';
2844							//padding-top 만 있어도 가운데 노출됨, 하단에 padding 있는 경우 이미지사이즈보다 크게 잡힘 2018-05-02
2845							//obj_css['padding-bottom'] = padding+box_padding_bottom+'px';
2846						}else if(image_overay_plus2_main['overay_v_orderby'] == 'bottom'){
2847							padding = box_height-$(".goodsDisplayImageOverayPlus2Text",overay2Obj).height()-box_padding_top-box_padding_bottom;
2848							obj_css['padding-top'] = padding+box_padding_top+'px';
2849						}
2850					}
2851
2852					obj_css['width']				= textbox_width+'px';
2853					obj_css['margin-top']			= -img_height;
2854
2855					overay2Obj
2856					.css(obj_css).show();
2857				}
2858			}
2859		}
2860	})
2861	.bind("mouseleave",function(){
2862		var decoration = $(this).data("decoration");
2863		var goodsInfo = $(this).data("goodsInfo");
2864		var imageObj = $(this).find("img:eq(0)");
2865		var imageCut2 = imageObj.attr("imageCut2");
2866
2867		if(imageCut2){
2868			imageObj.attr('src',imageObj.attr('oriSrc'));
2869		}
2870
2871		if(decoration){
2872			if	(decoration['image_border_type'] != 'all') {
2873				if(decoration['image_border'] && decoration['image_border1']){
2874					decoration['image_border1_width'] = decoration['image_border1_width'] ? decoration['image_border1_width'] : 0;
2875					$(this).css({"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1'],"margin":"-"+decoration['image_border1_width']+"px"});
2876				}else if(decoration['image_border']){
2877					$(this).css({"border":0,"margin":"0px"});
2878				}
2879			}
2880
2881			if(decoration['image_opacity']){
2882				imageObj.css({"opacity":1}
2882);
2883			}
2884
2885			if(decoration['image_overay2'] || decoration['image_overay2_text']){
2886				$(".goodsDisplayImageOveray2",this).hide();
2887			}
2888
2889			if(decoration['image_overay_plus2']){
2890				$(".goodsDisplayImageOverayPlus2",this).hide();
2891				$(".goodsDisplayImageOveray2PerWrap",this).hide();
2892			}
2893
2894			if(decoration['image_icon'] && decoration['image_icon_over']=='y'){
2895				$(".goodsDisplayImageIcon",this).hide();
2896			}
2897
2898			if((decoration['image_send'] || decoration['image_zzim'] || decoration['image_zzim_on']) && decoration['image_send_over']=='y'){
2899				$(".goodsDisplayImageSend",this).hide();
2900			}
2901
2902			if	(decoration['use_review_option_like']) {
2903				var reviewObj = $(".goodsDisplayBottomFunc div",this).not('[act="stay"]');
2904				reviewObj.attr('act','');
2905				chk_display_goods_show_opt(this,false);
2906			}
2907		}
2908	});
2909
2910	border_except = false;
2911	display_style = $(selector).closest('.designDisplay').attr('displaystyle');
2912	if	($.inArray(display_style, ['list','rolling_h','rolling_v']) < 0)
2913		border_except = true;
2914
2915	$(selector).closest('.goodsDisplayItemWrap').bind("mouseenter",function(){
2916		var decoration = $(this).find('.goodsDisplayImageWrap').data("decoration");
2917		if(decoration && decoration['image_border'] && decoration['image_border_type'] == 'all' && decoration['image_border_mobile'] == undefined){
2918			border_opt = {"border":decoration['image_border_width'] + "px solid " + decoration['image_border']};
2919			$(this).css(border_opt);
2920		}
2921	}).bind("mouseleave",function(){
2922		var decoration = $(this).find('.goodsDisplayImageWrap').data("decoration");
2923
2924		if	(decoration && decoration['image_border_type'] == 'all') {
2925			if(decoration['image_border'] && decoration['image_border1']){
2926				decoration['image_border1_width'] = decoration['image_border1_width'] ? decoration['image_border1_width'] : 0;
2927				border_opt = {"border":decoration['image_border1_width'] + "px solid " + decoration['image_border1']};
2928			}else if(decoration['image_border']){
2929				if	(border_except) {
2930					border_opt = {"border":0,"margin":"0px"};
2931				}else{
2932					border_opt = {"border":0};
2933				}
2934			}
2935			$(this).css(border_opt);
2936		}
2937	});
2938}
2939
2940/* 어드민 : 이미지꾸미기 선택정보를 샘플이미지에 적용*/
2941function goods_image_decoration_data(goodsDisplayDecorationContainer){
2942	var data = {};
2943
2944	if($("input.use_image_border",goodsDisplayDecorationContainer).is(":checked")){
2945		isMobile = $("input.image_border1",goodsDisplayDecorationContainer).hasClass('isMobile') ? 'mobile' : 'pc';
2946		if(isMobile != 'mobile'){
2947			if($("input.image_border",goodsDisplayDecorationContainer).val().length){
2948				data.image_border1 = $("input.image_border1",goodsDisplayDecorationContainer).val();
2949				data.image_border1_width = $("input.image_border1_width",goodsDisplayDecorationContainer).val();
2950				data.image_border = $("input.image_border",goodsDisplayDecorationContainer).val();
2951				data.image_border_width = $("input.image_border_width",goodsDisplayDecorationContainer).val();
2952				data.image_border_type = $("select.image_border_type",goodsDisplayDecorationContainer).val();
2953			}
2954		}else{
2955			if($("input.image_border1",goodsDisplayDecorationContainer).val().length){
2956				data.image_border1 = $("input.image_border1",goodsDisplayDecorationContainer).val();
2957				data.image_border1_width = $("input.image_border1_width",goodsDisplayDecorationContainer).val();
2958				data.image_border_mobile = isMobile;
2959				data.image_border_type = $("select.image_border_type",goodsDisplayDecorationContainer).val();
2960			}
2961		}
2962	}
2963
2964	if($("input.use_image_opacity",goodsDisplayDecorationContainer).is(":checked")){
2965		if($("input.image_opacity",goodsDisplayDecorationContainer).val().length){
2966			data.image_opacity = $("input.image_opacity",goodsDisplayDecorationContainer).val();
2967		}
2968	}
2969
2970	if($("input.use_image_icon",goodsDisplayDecorationContainer).is(":checked")){
2971		data.use_image_icon = '1';
2972		if($("input.image_icon",goodsDisplayDecorationContainer).val().length){
2973			data.image_icon = $("input.image_icon",goodsDisplayDecorationContainer).val();
2974		}
2975		if($("select.image_icon_location",goodsDisplayDecorationContainer).val().length){
2976			data.image_icon_location = $("select.image_icon_location",goodsDisplayDecorationContainer).val();
2977		}
2978		if($("select.image_icon_over",goodsDisplayDecorationContainer).val().length){
2979			data.image_icon_over = $("select.image_icon_over",goodsDisplayDecorationContainer).val();
2980		}
2981		if($("input.image_icon_type",goodsDisplayDecorationContainer).val().length){
2982			data.image_icon_type = $("input.image_icon_type",goodsDisplayDecorationContainer).val();
2983		}
2984		if($("input.image_icon_condition",goodsDisplayDecorationContainer).val().length){
2985			data.image_icon_condition = $("input.image_icon_condition",goodsDisplayDecorationContainer).val();
2986		}
2987		if($("input.image_icon_condition_cnt",goodsDisplayDecorationContainer).val().length){
2988			data.image_icon_condition_cnt = $("input.image_icon_condition_cnt",goodsDisplayDecorationContainer).val();
2989		}
2990	}
2991
2992	if($("input.use_image_send",goodsDisplayDecorationContainer).is(":checked")){
2993		if($("input.image_send",goodsDisplayDecorationContainer).val().length){
2994			data.image_send = $("input.image_send",goodsDisplayDecorationContainer).val();
2995		}
2996		if($("select.image_send_location",goodsDisplayDecorationContainer).val().length){
2997			data.image_send_location = $("select.image_send_location",goodsDisplayDecorationContainer).val();
2998		}
2999		if($("select.image_send_over",goodsDisplayDecorationContainer).val().length){
3000			data.image_send_over = $("select.image_send_over",goodsDisplayDecorationContainer).val();
3001		}
3002	}
3003
3004	if($("input.use_image_zzim",goodsDisplayDecorationContainer).is(":checked")){
3005		data.use_image_zzim = '1';
3006		if($("input.image_zzim",goodsDisplayDecorationContainer).val().length){
3007			data.image_zzim = $("input.image_zzim",goodsDisplayDecorationContainer).val();
3008		}
3009		if($("input.image_zzim_on",goodsDisplayDecorationContainer).val().length){
3010			data.image_zzim_on = $("input.image_zzim_on",goodsDisplayDecorationContainer).val();
3011		}
3012		if($("input.use_image_send",goodsDisplayDecorationContainer).is(":checked")){
3013			if($("select.image_send_location",goodsDisplayDecorationContainer).val().length){
3014				data.image_send_location = $("select.image_send_location",goodsDisplayDecorationContainer).val();
3015			}
3016			if($("select.image_send_over",goodsDisplayDecorationContainer).val().length){
3017				data.image_send_over = $("select.image_send_over",goodsDisplayDecorationContainer).val();
3018			}
3019		}else{
3020			data.image_send_location = 'right';
3021		}
3022	}
3023
3024
3025	if($("input.use_image_overay",goodsDisplayDecorationContainer).is(":checked")){
3026
3027		if($("input.image_overay1",goodsDisplayDecorationContainer).val().length){
3028			new_value = overay_before_change('type', $("input.image_overay1",goodsDisplayDecorationContainer).val());
3029			$("input.image_overay_plus1",goodsDisplayDecorationContainer).val(new_value['items']);
3030			$("input.image_overay_plus1_title",goodsDisplayDecorationContainer).val(new_value['title']);
3031			$("input.image_overay1",goodsDisplayDecorationContainer).val('');
3032		}else if($("input.image_overay1_text",goodsDisplayDecorationContainer).val().length){
3033			new_value = overay_before_change('text', $("input.image_overay1_text",goodsDisplayDecorationContainer).val());
3034			$("input.image_overay_plus1",goodsDisplayDecorationContainer).val(new_value['items']);
3035			$("input.image_overay_plus1_title",goodsDisplayDecorationContainer).val(new_value['title']);
3036			$("input.image_overay1",goodsDisplayDecorationContainer).val('');
3037			$("input.image_overay1_text",goodsDisplayDecorationContainer).val('');
3038		}
3039
3040		if($("input.image_overay2",goodsDisplayDecorationContainer).val().length){
3041			new_value = overay_before_change('type', $("input.image_overay2",goodsDisplayDecorationContainer).val());
3042			$("input.image_overay_plus2",goodsDisplayDecorationContainer).val(new_value['items']);
3043			$("input.image_overay_plus2_title",goodsDisplayDecorationContainer).val(new_value['title']);
3044			$("input.image_overay2",goodsDisplayDecorationContainer).val('');
3045		}else if($("input.image_overay2_text",goodsDisplayDecorationContainer).val().length){
3046			new_value = overay_before_change('text', $("input.image_overay2_text",goodsDisplayDecorationContainer).val());
3047			$("input.image_overay_plus2",goodsDisplayDecorationContainer).val(new_value['items']);
3048			$("input.image_overay_plus2_title",goodsDisplayDecorationContainer).val(new_value['title']);
3049			$("input.image_overay2",goodsDisplayDecorationContainer).val('');
3050			$("input.image_overay2_text",goodsDisplayDecorationContainer).val('');
3051		}
3052
3053		if(!$("input.image_overay_type",goodsDisplayDecorationContainer).is(":checked")){
3054			$("input.image_overay_type:eq(0)",goodsDisplayDecorationContainer).prop('checked',true);
3055		}
3056
3057		data.image_overay_type = $("input.image_overay_type:checked",goodsDisplayDecorationContainer).val();
3058
3059		if	(data.image_overay_type == 'all')
3060			$('.overay_bottom').css('visibility','hidden');
3061		else
3062			$('.overay_bottom').css('visibility','');
3063
3064		if($("input.image_overay_plus1",goodsDisplayDecorationContainer).val().length){
3065			data.image_overay_plus1 = $("input.image_overay_plus1",goodsDisplayDecorationContainer).val();
3066			data.image_overay_plus1_main = $("input.image_overay_plus1_main",goodsDisplayDecorationContainer).val();
3067			data.image_overay_plus1_title = $("input.image_overay_plus1_title",goodsDisplayDecorationContainer).val();
3068		}
3069
3070		if($("input.image_overay_plus2",goodsDisplayDecorationContainer).val().length){
3071			data.image_overay_plus2 = $("input.image_overay_plus2",goodsDisplayDecorationContainer).val();
3072			data.image_overay_plus2_main = $("input.image_overay_plus2_main",goodsDisplayDecorationContainer).val();
3073			data.image_overay_plus2_title = $("input.image_overay_plus2_title",goodsDisplayDecorationContainer).val();
3074		}
3075	}
3076
3077	if($("input.use_image_slide",goodsDisplayDecorationContainer).is(":checked")){
3078		if($("input.image_slide",goodsDisplayDecorationContainer).val().length){
3079			data.image_slide = $("input.image_slide",goodsDisplayDecorationContainer).val();
3080		}
3081		if($("select.image_slide_type",goodsDisplayDecorationContainer).val().length){
3082			data.image_slide_type = $("select.image_slide_type",goodsDisplayDecorationContainer).val();
3083		}
3084	}
3085
3086	if($("input.use_quick_shopping",goodsDisplayDecorationContainer).is(":checked")){
3087		if($("input[name='quick_shopping']",goodsDisplayDecorationContainer).val().length){
3088			data.quick_shopping = $("input[name='quick_shopping']",goodsDisplayDecorationContainer).val();
3089		}
3090	}
3091
3092	if($("input.use_image_zoom",goodsDisplayDecorationContainer).is(":checked")){
3093		data.use_image_zoom = "1";
3094	}
3095
3096	if($("input.use_image_3d",goodsDisplayDecorationContainer).is(":checked")){
3097		data.use_image_3d = "1";
3098	}
3099
3100	if($("input.use_seconde_image",goodsDisplayDecorationContainer).is(":checked")){
3101		data.use_seconde_image = "1";
3102	}
3103
3104	if($("input.use_review_option_like",goodsDisplayDecorationContainer).is(":checked")){
3105		data.use_review_option_like = "1";
3106	}
3107
3108	var i,dataCnt = 0;
3109	for(i in data) {
3110		dataCnt++;
3111		data[i] = data[i].replace(/"/g,'\\"');
3112	}
3113
3114	var decoration = Base64.encode(JSONtoString(data));
3115
3116	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decorationLoaded",false);
3117	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).attr("decoration",decoration);
3118	$(".goodsDisplayImageWrap",goodsDisplayDecorationContainer).data("decoration",data);
3119	$("input.image_decoration",goodsDisplayDecorationContainer).val(decoration);
3120
3121	/* 이미지꾸미기 이미지 설정 */
3122	set_goods_display_decoration(".goodsDisplayImageWrap");
3123}
3124
3125function set_info_item_data(goodsDisplayDecorationContainer){
3126
3127	try{
3128		var info_item_settings = eval($(".info_settings",goodsDisplayDecorationContainer).val());
3129		//var info_item_settings = $(".info_settings",goodsDisplayDecorationContainer).val();
3130	}catch(e){
3131		var info_item_settings = [];
3132	};
3133
3134	if(typeof info_item_settings == 'object'){
3135		/* 상품정보 항목 저장값 출력 */
3136		for(var i=0;i<info_item_settings.length;i++){
3137
3138			var new_info_item		= add_new_info_item(goodsDisplayDecorationContainer);
3139			var info_item_setting	= info_item_settings[i];
3140
3141			for(var key in info_item_setting){
3142				var cellSelector	= ".info_item_cell_" + key;
3143				var selector		= ".info_item_" + key;
3144
3145				if(typeof info_item_setting[key] == 'object'){
3146
3147					for(var key2 in info_item_setting[key]){
3148						if(typeof info_item_setting[key][key2] == 'object'){
3149							for(var key3 in info_item_setting[key][key2]){
3150								if(typeof info_item_setting[key][key2][key3] == 'object'){
3151
3152									for(var key4 in info_item_setting[key][key2][key3]){
3153										if(typeof info_item_setting[key][key2][key3][key4] == 'object'){
3154											info_item_setting[key][key2][key3][key4] = JSONtoString(info_item_setting[key][key2][key3][key4]);
3155										}
3156									}
3157
3158									info_item_setting[key][key2][key3] = JSONtoString(info_item_setting[key][key2][key3]);
3159								}
3160							}
3161							info_item_setting[key][key2]	= JSONtoString(info_item_setting[key][key2]);
3162						}
3163					}
3164				}
3165
3166				var selectValue		= '';
3167				if(typeof info_item_setting[key] == 'object'){
3168					selectValue		= JSONtoString(info_item_setting[key]);
3169				}else{
3170					selectValue		= info_item_setting[key];
3171				}
3172
3173				if($(selector,new_info_item).length){
3174					switch($(selector,new_info_item)[0].tagName){
3175						case 'INPUT':
3176							if($(selector,new_info_item).attr('type')=='text'){
3177
3178								//$(selector,new_info_item).attr("style","display:block;width:100%;background-color:yellow;");
3179								$(selector,new_info_item).val(selectValue).change();
3180
3181							}else if($(selector,new_info_item).attr('type')=='radio' ){
3182								$(selector,new_info_item).each(function(idx){
3183									if( $(this).val() == selectValue ) {
3184										$(this).attr('checked',true).change();
3185									}
3186								});
3187							}else{
3188								$(selector,new_info_item).attr('checked',true);
3189							}
3190						break;
3191						case 'SELECT':
3192							$(selector,new_info_item).val(selectValue);
3193						break;
3194					}
3195				}
3196			}
3197
3198			$(".info_item_kind",new_info_item).change();
3199		}
3200	}else{
3201		var idx=0;
3202
3203		for(key in info_item_config){
3204			add_new_info_item(goodsDisplayDecorationContainer);
3205			$(".info_item_kind",goodsDisplayDecorationContainer).eq(idx).val(key).change();
3206			idx++;
3207		}
3208	}
3209
3210	apply_input_style();
3211
3212}
3213
3214function display_goods_view(seq,target,obj,kind){
3215	var ban_style = new Array('rolling_h','rolling_v');
3216	if	(obj != undefined && $(obj).closest('.designDisplay').hasClass('display_style3') && $.inArray($(obj).closest('.designDisplay').attr('displaystyle'),ban_style) < 0) {
3217		if	(gl_display_now_page > 2)
3218			document.location.hash = (gl_display_now_page-2)+'y'+$(document).scrollTop();
3219	}
3220
3221    // GA4 연동을 위해 호출	
3222    try {
3223        if (kind == 'goods_view') {
3224            ga4_select_item(seq);
3225        }    
3226    } catch(e) {
3227        console.log('GA4 select_item 이벤트 에러',e);
3228    }
3229
3230	switch(kind){
3231		case 'provider':
3232			url = '/mshop/?m='+seq;
3233			break;
3234		case 'bigdata':
3235			url = '/bigdata/catalog?no='+seq;
3236			break;
3237		case 'goods_view':
3238		default:
3239			url = '/goods/view?no='+seq;
3240	}
3241
3242	if	(target != '')
3243		window.open(url);
3244	else
3245		location.href = url;
3246}
3247
3248/* 어드민 : 상품정보 항목 추가 */
3249function add_new_info_item(obj){
3250	var goodsDisplayDecorationContainer = $(obj).closest(".goodsDisplayDecorationContainer");
3251
3252	$(".info_item_default .colorpicker",goodsDisplayDecorationContainer).customColorPicker("destroy");
3253	var new_info_item = $("div.info_item_default",goodsDisplayDecorationContainer).clone();
3254	new_info_item.removeClass("hide").removeClass("info_item_default").show();
3255	new_info_item.find("input.info_setting").removeAttr('disabled');
3256
3257	$("div.info_item_container",goodsDisplayDecorationContainer).append(new_info_item);
3258	$("div.info_item_container",goodsDisplayDecorationContainer).find("div.info_item_container_sub").sortable({
3259		placeholder: "info_item_sub_holder"
3260	});
3261
3262	$(".colorpicker",goodsDisplayDecorationContainer).customColorPicker();
3263
3264	change_info_item(new_info_item);
3265
3266	//폰트꾸미기 호출
3267	$(".customFontDecoration",new_info_item).customFontDecoration({
3268		"returnFunc":function(obj){testFunc(obj);},
3269		"change":function(){ change_info_item(new_info_item);}
3270	});
3271
3272	//비교통화 설정 호출
3273	$(".customCompare",new_info_item).customCompare({
3274		"change":function(){ change_info_item(new_info_item);}
3275	});
3276
3277	$(document).resize();
3278
3279	return new_info_item;
3280}
3281
3282function testFunc(obj){
3283	//obj.find('span.info_item_cell_exchange_font').hide();
3284}
3285
3286/* 어드민 : 상품정보 항목 삭제 */
3287function remove_info_item(obj){
3288	var data = '[]';
3289	$("input.info_settings").val(data);
3290	$(obj).closest("div.info_item").remove();
3291}
3292
3293/* 어드민 : 상품정보 항목 값 변경 */
3294function change_info_item(obj){
3295
3296	var info_item		= $(obj).closest("div.info_item");
3297	var kind			= $(".info_item_kind",info_item).val();
3298	var data			= {};
3299	var result_string	= '';
3300
3301	if(!info_item_config[kind]) return;
3302
3303	$(".info_item_cell",info_item).hide();
3304
3305	for(var i=0;i<info_item_config[kind].length;i++){
3306
3307		var key = info_item_config[kind][i];
3308
3309		var cellSelector	= ".info_item_cell_" + key;
3310		var selector		= ".info_item_" + key;
3311		var exchange_font	= "span.info_item_cell_exchange_font";
3312		var selectValue		= "";
3313
3314		$(cellSelector,info_item).show();
3315
3316		if($(selector,info_item).length){
3317			switch($(selector,info_item)[0].tagName){
3318				case 'INPUT':
3319					if($(selector,info_item).attr('type')=='text'){
3320						selectValue = $(selector,info_item).val();
3321					}else if($(selector,info_item).is(':checked')){
3322						selectValue = $(obj).val();
3323					}
3324				break;
3325				case 'SELECT':
3326					selectValue = $(selector,info_item).val();
3327				break;
3328			}
3329			// 비교통화 폰트설정시에는 제외.(각 통화별로 설정함)
3330			if(key == "compare"){
3331				/* 정가,판매가, (혜택적용)판매가의 해당 비교통화만 노출*/
3332				var compare_kind_obj = $(".info_item_cell_compare .compare_kind option",info_item);
3333				for(var compare_i=0; compare_i < compare_kind_obj.length; compare_i++){
3334					if(compare_kind_obj.eq(compare_i).val() != "compare_"+kind){
3335						compare_kind_obj.eq(compare_i).remove();
3336					}
3337				}
3338				for(var view_i=0; view_i < $(".info_item_cell_compare .compare_symbol_view",info_item).length; view_i++){
3339					if($(".info_item_cell_compare .compare_symbol_view:eq("+view_i+")",info_item).val() == ""){
3340						if(kind == "sale_price"){
3341							$(".info_item_cell_compare .compare_symbol_view:eq("+view_i+") option[value='view']",info_item).attr("selected",true);
3342						}else{
3343							$(".info_item_cell_compare .compare_symbol_view:eq("+view_i+") option[value='none']",info_item).attr("selected",true);
3344						}
3345					}
3346				}
3347				//$(".info_item_cell_compare .compare_kind",info_item).attr("selected",fal
3347se);
3348				//$(".info_item_cell_compare .compare_kind option[value='compare_"+kind+"']",info_item).attr("selected",true);
3349			}
3350		}
3351
3352		//if(key=='font_decoration'){
3353		//	data[key] = selectValue.replace(/"/g,'\\"');
3354		//}else{
3355			data[key] = selectValue;
3356		//}
3357	}
3358
3359	result_string = (JSONtoString(data));
3360
3361	$("input.info_setting",info_item).val(result_string);
3362
3363
3364}
3365
3366/* 해당 상품의 관련상품 보기 */
3367function show_display_related_goods(obj,goods_seq){
3368	event.cancelBubble	= true;
3369	event.returnValue	= false;
3370	//설정페이지에선 미리보기를 지원하지 않는다
3371	if	(typeof isAdminpage != 'undefined' && isAdminpage == true) return;
3372	var goodsDisplayImageWrapObj = $(obj).closest('.goodsDisplayImageWrap');
3373
3374	if($("#displayRelatedGoodsLayer").length){
3375		$("<div id='displayRelatedGoodsLayer'></div>").remove();
3376	}
3377
3378	var html = "<div class='goodsPopupLayer' id='displayRelatedGoodsLayer'>";
3379	html += "<div class='goodsPopupLayerTitle'>해당 상품의 관련상품 보기</div>";
3380	html += "<div class='goodsPopupLayerClose'></div>";
3381	html += "<div class='goodsPopupLayerBody'>";
3382	html += "</div>";
3383	html += "</div>";
3384
3385	$(html).hide().appendTo('body');
3386
3387	$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
3388
3389	$.ajax({
3390		'url' : '/goods/display_related_goods',
3391		'data' : {'goods_seq':goods_seq},
3392		'success' : function(res){
3393
3394			$(goodsDisplayImageWrapObj).activity(false);
3395
3396			$("#displayRelatedGoodsLayer").css({
3397				'top' : $(document).scrollTop()+goodsDisplayImageWrapObj.offset().top-$(document).scrollTop()+goodsDisplayImageWrapObj.outerHeight(),
3398				'left' : goodsDisplayImageWrapObj.offset().left
3399			}).show();
3400
3401			$("#displayRelatedGoodsLayer .goodsPopupLayerClose").click(function(){
3402				$("#displayRelatedGoodsLayer").remove();
3403			});
3404
3405			if(!$("#displayRelatedGoodsLayer").length){
3406				$("<div id='displayRelatedGoodsLayer'></div>").appendTo('body');
3407			}
3408
3409			$("#displayRelatedGoodsLayer .goodsPopupLayerBody").html(res);
3410
3411			if(goodsDisplayImageWrapObj.offset().left+$("#displayRelatedGoodsLayer").outerWidth() > $(window).width()){
3412				$("#displayRelatedGoodsLayer").css('left',goodsDisplayImageWrapObj.offset().left - (goodsDisplayImageWrapObj.offset().left+$("#displayRelatedGoodsLayer").outerWidth()-$(window).width()));
3413			}
3414		}
3415	})
3416
3417	return false;
3418}
3419
3420
3421/* 해당 상품의 이미지 더 보기 */
3422function show_display_goods_images(goodsDisplayImageWrapObj,goods_seq,image_slide_type){
3423	var imageObj = $(goodsDisplayImageWrapObj).find("img:eq(0)");
3424
3425	if($(goodsDisplayImageWrapObj).find("#displayGoodsImagesLayer").length){
3426		$(document).click();
3427		//$("#displayGoodsImagesLayer").stop(true,true).remove();
3428	}else{
3429		if(!$("#displayGoodsImagesLayer").length){
3430			$('body').append($("<div id='displayGoodsImagesLayer'></div>"));
3431		}
3432		//$(goodsDisplayImageWrapObj).after($("#displayGoodsImagesLayer"));
3433
3434		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
3435
3436		$("#displayGoodsImagesLayer").stop(true,true).empty().hide().click(function(){return false;});
3437
3438		$.ajax({
3439			'url' : '/goods/display_goods_images',
3440			'data' : {'goods_seq':goods_seq,'image_slide_type':image_slide_type},
3441			'global' : false,
3442			'success' : function(html){
3443
3444				$(goodsDisplayImageWrapObj).activity(false);
3445
3446				$("#displayGoodsImagesLayer").html(html);
3447
3448				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsImagesLayer").width() > $(window).width()){
3449					var left = $(window).width()-$("#displayGoodsImagesLayer").width();
3450				}else{
3451					var left = imageObj.offset().left+imageObj.width();
3452				}
3453
3454				$("#displayGoodsImagesLayer").css({
3455					'position' : 'absolute',
3456					'z-index' : 1000,
3457					'top' : imageObj.offset().top,
3458					'left' : left
3459				}).fadeIn();
3460
3461				$("#displayGoodsSendLayer").stop(true,true).remove();
3462				$(document).one('click',function(e){
3463					$("#displayGoodsImagesLayer").stop(true,true).remove();
3464				});
3465
3466			}
3467		});
3468
3469	}
3470	return false;
3471}
3472
3473/* 상품 찜하기 버튼 클릭 */
3474function display_goods_zzim(btnObj,goods_seq,dozen){
3475	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
3476		display_goods_zzim_light(btnObj,goods_seq);
3477	}else{
3478		display_goods_zzim_heavy(btnObj,goods_seq,dozen);
3479	}
3480}
3481
3482/* 상품 찜하기 버튼 클릭 heavy용 */
3483function display_goods_zzim_heavy(btnObj,goods_seq,dozen){
3484	window.event.cancelBubble = true;
3485	window.event.returnValue = false;
3486
3487	var goodsDisplayItemWrap = $(btnObj).closest(".goodsDisplayItemWrap");
3488
3489	$.ajax({
3490		'url' : '/mypage/wish_add_ajax_toggle',
3491		'data' : {'goods_seq':goods_seq},
3492		'dataType' : 'json',
3493		'global' : false,
3494		'success' : function(res){
3495			if(res.result == 'not_login'){
3496				parent.openDialogConfirm(getAlert("gv009"),400,140,function(){
3497					parent.location.replace(res.url);
3498				},function(){});
3499			} else if(res.result == 'add'){
3500				parent.openDialogConfirm(getAlert('mp089'),400,140,function(){
3501					parent.location.replace('/mypage/wish');
3502				},function(){
3503					if(dozen && $(btnObj).prop('class')){
3504						goodsDisplayItemWrap = $('.'+$(btnObj).prop('class'));
3505						$(goodsDisplayItemWrap).find(".zzimOnImg").show();
3506						$(goodsDisplayItemWrap).find(".zzimOffImg").hide();
3507					}else{
3508						$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find(".zzimOnImg").show();
3509						$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find(".zzimOffImg").hide();
3510					}
3511					$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find('.display_zzim').attr('act','stay');
3512					cnt = res.cnt > 9999 ? '9,999+' : comma(res.cnt);
3513					if	($(goodsDisplayItemWrap).find('.goods_list_goods_zzim_count').length > 0) {
3514						$(goodsDisplayItemWrap).find('.goods_list_goods_zzim_count').html(cnt);
3515						bak_src = $(goodsDisplayItemWrap).find('.goods_list_goods_zzim_img').attr("src");
3516						bak_src = bak_src.replace(/icon_zzim_off/g,'icon_zzim_on');
3517						$(goodsDisplayItemWrap).find('.goods_list_goods_zzim_img').attr("src",bak_src+"#" + Math.random());
3518					}
3519				});
3520                // 채널톡 위시리스트 이벤트
3521				if (typeof ChannelIO != 'undefined') {
3522					channeltalk_wish_in(goods_seq,'display_goods_zzim_heavy',goodsDisplayItemWrap);
3523				}
3524			} else if(res.result == 'del'){
3525				if(dozen && $(btnObj).prop('class')){
3526					goodsDisplayItemWrap = $('.'+$(btnObj).prop('class'));
3527					$(goodsDisplayItemWrap).find(".zzimOffImg").show();
3528					$(goodsDisplayItemWrap).find(".zzimOnImg").hide();
3529				}else{
3530					$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find(".zzimOffImg").show();
3531					$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find(".zzimOnImg").hide();
3532				}
3533				act = $(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find('.goodsDisplayBottomFunc div:eq(0)').attr('act') == 'hover' ? 'hover' : '';
3534				$(goodsDisplayItemWrap).closest('.goodsDisplayItemWrap').find('.display_zzim').attr('act',act);
3535				cnt = res.cnt > 9999 ? '9,999+' : comma(res.cnt);
3536				if	($(goodsDisplayItemWrap).find('.goods_list_goods_zzim_count').length > 0) {
3537					$(goodsDisplayItemWrap).find('.goods_list_goods_zzim_count').html(cnt);
3538					bak_src = $(goodsDisplayItemWrap).find('.goods_list_goods_zzim_img').attr("src");
3539					bak_src = bak_src.replace(/icon_zzim_on/g,'icon_zzim_off');
3540					$(goodsDisplayItemWrap).find('.goods_list_goods_zzim_img').attr("src",bak_src+"#" + Math.random());
3541				}
3542				openDialogAlert(getAlert("gv057"),300,150,function(){});
3543			}
3544		}
3545	});
3546}
3547
3548/* 상품 찜하기 버튼 클릭 Light 형 */
3549function display_goods_zzim_light(btnObj,goods_seq){
3550	window.event.cancelBubble = true;
3551	window.event.returnValue = false;
3552
3553	$.ajax({
3554		'url' : '/mypage/wish_add_ajax_toggle',
3555		'data' : {'goods_seq':goods_seq},
3556		'dataType' : 'json',
3557		'global' : false,
3558		'success' : function(res){
3559			if(res.result == 'not_login'){
3560				parent.openDialogConfirm(getAlert("gv009"),400,140,function(){
3561					parent.location.replace(res.url);
3562				},function(){});
3563			} else if(res.result == 'add'){
3564				$(btnObj).find('.zzimImage.normal').addClass('hide');
3565				$(btnObj).find('.zzimImage.active').removeClass('hide');
3566				parent.openDialogConfirm(getAlert('mp089'),400,140,function(){
3567					parent.location.replace('/mypage/wish');
3568				},function(){});
3569
3570                // 채널톡 위시리스트 이벤트
3571				if (typeof ChannelIO != 'undefined') {
3572                    channeltalk_wish_in(goods_seq);
3573				}
3574			} else if(res.result == 'del'){
3575				$(btnObj).find('.zzimImage.normal').removeClass('hide');
3576				$(btnObj).find('.zzimImage.active').addClass('hide');
3577				openDialogAlert(getAlert("gv057"),300,150,function(){});
3578			}
3579		}
3580	});
3581}
3582
3583/* 상품 퀵뷰 버튼 클릭 */
3584function display_goods_quickview(btnObj,goods_seq){
3585
3586	if(!goods_seq) return;
3587
3588	event.cancelBubble = true;
3589	event.returnValue = false;
3590
3591	var basicWidth = 900;
3592	$.ajax({
3593		'url' : '/common/arrLayoutBasic',
3594		'dataType' : 'json',
3595		'async' : false,
3596		'success' : function(res){
3597			basicWidth = num(res.basic.width);
3598			if( res.basic.width_sign != 'px' ) basicWidth = 900;
3599		}
3600	});
3601
3602	if($("#goodsQuickViewLayer").length){
3603		$("<div id='goodsQuickViewLayer'></div>").remove();
3604	}
3605
3606	var html = "<div class='goodsPopupLayer' id='goodsQuickViewLayer'>";
3607	html += "<div class='goodsPopupLayerTitle'>"+getAlert("et405")+"</div>";
3608	html += "<div class='goodsPopupLayerClose'></div>";
3609	html += "<div class='goodsPopupLayerBody'>";
3610	html += "<div class='goodsPopupLayerBtnWrap'><a href='/goods/view?no="+goods_seq+"'><span class='goodsPopupLayerMoreBtn'></span></a></div>";
3611	html += "</div>";
3612	html += "</div>";
3613
3614	$(html).hide().appendTo('body');
3615
3616	$("#goodsQuickViewLayer").css({
3617		'top' : $(document).scrollTop()+20,
3618		'left' : '50%',
3619		'margin-left' : (basicWidth+48)/2*-1,
3620		'width' : basicWidth,
3621		'height' : $(window).height()-40
3622	}).show();
3623
3624	$("#goodsQuickViewLayer .goodsPopupLayerClose").click(function(){
3625		$("#goodsQuickViewLayer").remove();
3626	});
3627	$("<iframe frameborder='0'></iframe>").prependTo($("#goodsQuickViewLayer .goodsPopupLayerBody")).css({
3628		'margin-top' : '10px',
3629		'width' : '100%',
3630		'height' : $(window).height()-200
3631	}).attr("src","/goods/view?no="+goods_seq+"&quickview=1");
3632
3633}
3634
3635/* 상품 보내기 버튼 클릭 */
3636function display_goods_send(btnObj,location,goods_seq, goods_name){
3637	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
3638		return display_goods_send_light(btnObj,location,goods_seq, goods_name);
3639	}else{
3640		return display_goods_send_heavy(btnObj,location);
3641	}
3642}
3643
3644/* 상품 공유하기 버튼 클릭 heavy 용 */
3645function display_goods_send_heavy(btnObj,location){
3646	event.cancelBubble = true;
3647	event.returnValue = false;
3648
3649	var goodsDisplayImageWrapObj = $(btnObj).closest(".goodsDisplayItemWrap").find(".goodsDisplayImageWrap");
3650	var displaystyle = $(btnObj).closest('.designDisplay').attr('displaystyle');
3651	var goodsInfo = $(goodsDisplayImageWrapObj).data("goodsInfo");
3652	var imageObj = $(goodsDisplayImageWrapObj).find("img:eq(0)");
3653
3654	if($("#displayGoodsSendLayer").length){
3655		$(document).click();
3656	}else{
3657		if(!$("#displayGoodsSendLayer").length){
3658			if(displaystyle != 'rolling_h')
3659				goodsDisplayImageWrapObj.after($("<div id='displayGoodsSendLayer'></div>"));
3660			else
3661				goodsDisplayImageWrapObj.append($("<div id='displayGoodsSendLayer'></div>"));
3662		}
3663		goodsDisplayImageWrapObj.after($("#displayGoodsSendLayer"));
3664
3665		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
3666
3667		$("#displayGoodsSendLayer").css({
3668			'border':'1px solid #e1e1e1',
3669			'padding':'2px 0px 2px 3px',
3670			'background-color':'#fff',
3671			'white-space':'nowrap',
3672			'min-width':'70px'
3673		}).stop(true,true).empty().hide().click(function(){return false;});
3674
3675		$.ajax({
3676			'url' : '/common/snslinkurl_tag',
3677			'data' : {'no':goodsInfo.goods_seq,'goods_name':goodsInfo.goods_name},
3678			'global' : false,
3679			'success' : function(html){
3680
3681				$(goodsDisplayImageWrapObj).activity(false);
3682
3683				$("#displayGoodsSendLayer").html(html);
3684
3685				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsSendLayer").outerWidth() > $(window).width()){
3686					var left = $("#displayGoodsSendLayer").outerWidth() * -1;
3687				}else{
3688					var left = goodsDisplayImageWrapObj.position().left+imageObj.width();
3689				}
3690
3691				if(location=='top'){
3692					var top = imageObj.position().top;
3693				}else{
3694					var goodsDisplayItemWrapObj = goodsDisplayImageWrapObj.closest('.goodsDisplayItemWrap');
3695					var top = imageObj.position().top+imageObj.height()+$(".goodsDisplayQuickShopping",goodsDisplayItemWrapObj).height()-$("#displayGoodsSendLayer").outerHeight();
3696				}
3697
3698				$("#displayGoodsSendLayer").css({
3699					'position' : 'absolute',
3700					'z-index' : 1000,
3701					'top' : top,
3702					'right' : 0
3703				}).fadeIn();
3704
3705				$("#displayGoodsImagesLayer").stop(true,true).remove();
3706				$(document).one('click',function(e){
3707					$("#displayGoodsSendLayer").stop(true,true).remove();
3708				});
3709
3710			}
3711		});
3712
3713	}
3714	return false;
3715}
3716
3717/* 상품 공유하기 버튼 클릭 light 용 */
3718function display_goods_send_light(btnObj, location, goods_seq, goods_name){
3719
3720	event.cancelBubble = true;
3721	event.returnValue = false;
3722
3723	var goodsDisplayImageWrapObj = $(btnObj).closest(".goodsDisplayImageWrap");
3724	var displaystyle = $(btnObj).closest('.designDisplay').attr('displaystyle');
3725	var imageObj = $(goodsDisplayImageWrapObj).find("img:eq(0)");
3726
3727	if($("#displayGoodsSendLayer").length){
3728		$(document).click();
3729	}else{
3730		if(!$("#displayGoodsSendLayer").length){
3731			if(displaystyle != 'rolling_h')
3732				goodsDisplayImageWrapObj.after($("<div id='displayGoodsSendLayer'></div>"));
3733			else
3734				goodsDisplayImageWrapObj.append($("<div id='displayGoodsSendLayer'></div>"));
3735		}
3736		goodsDisplayImageWrapObj.after($("#displayGoodsSendLayer"));
3737
3738		$(goodsDisplayImageWrapObj).activity({segments: 12, width: 5.5, space: 6, length: 13, color: '#fff', speed: 1.5});
3739
3740		$("#displayGoodsSendLayer").css({
3741			'border':'1px solid #e1e1e1',
3742			'padding':'2px 0px 2px 3px',
3743			'background-color':'#fff',
3744			'white-space':'nowrap',
3745			'min-width':'70px'
3746		}).stop(true,true).empty().hide().click(function(){return false;});
3747
3748		$.ajax({
3749			'url' : '/common/snslinkurl_tag',
3750			'data' : {'no': goods_seq,'goods_name': goods_name},
3751			'global' : false,
3752			'success' : function(html){
3753
3754				$(goodsDisplayImageWrapObj).activity(false);
3755
3756				$("#displayGoodsSendLayer").html(html);
3757
3758				if(imageObj.offset().left+imageObj.width()+$("#displayGoodsSendLayer").outerWidth() > $(window).width()){
3759					var left = $("#displayGoodsSendLayer").outerWidth() * -1;
3760				}else{
3761					var left = goodsDisplayImageWrapObj.position().left+imageObj.width();
3762				}
3763
3764				if(location=='top'){
3765					var top = imageObj.position().top;
3766				}else{
3767					var goodsDisplayItemWrapObj = goodsDisplayImageWrapObj.closest('.goodsDisplayItemWrap');
3768					var top = imageObj.height();
3769				}
3770
3771				$("#displayGoodsSendLayer").css({
3772					'position' : 'absolute',
3773					'z-index' : 1000,
3774					'top' : top,
3775					'right' : 0
3776				}).fadeIn();
3777
3778				$("#displayGoodsImagesLayer").stop(true,true).remove();
3779				$(document).one('click',function(e){
3780					$("#displayGoodsSendLayer").stop(true,true).remove();
3781				});
3782
3783			}
3784		});
3785
3786	}
3787	return false;
3788}
3789
3790// 자동노출조건 설명(해비스킨일 떄 관련상품, 판매자 인기상품)
3791function setCriteriaDescription(){
3792
3793	$(".displayTabGoodsContainer, .relationGoodsContainer, .relationSellerGoodsContainer").each(function(){
3794		var descriptions = new Array();
3795
3796		criteria = $(".displayCriteria",this).val().split(",");
3797		if(criteria=="") return;
3798		for(var i=0;i<criteria.length;i++){
3799			var div = criteria[i].split("=");
3800
3801			if(div[1]){
3802				var name = "";
3803				var value = decodeURIComponent(div[1]);
3804				switch(div[0]){
3805					case "selectGoodsName": name = "검색어"; break;
3806					case "selectGoodsView": name = "상품노출"; break;
3807					case "selectGoodsStatus": name = "상품상태"; break;
3808					case "selectCategory1": name = "카테고리1"; break;
3809					case "selectCategory2": name = "카테고리2"; break;
3810					case "selectCategory3": name = "카테고리3"; break;
3811					case "selectCategory4": name = "카테고리4"; break;
3812					case "selectBrand1": name = "브랜드1"; break;
3813					case "selectBrand2": name = "브랜드2"; break;
3814					case "selectBrand3": name = "브랜드3"; break;
3815					case "selectBrand4": name = "브랜드4"; break;
3816					case "selectLocation1": name = "지역1"; break;
3817					case "selectLocation2": name = "지역2"; break;
3818					case "selectLocation3": name = "지역3"; break;
3819					case "selectLocation4": name = "지역4"; break;
3820					case "selectStartPrice": name = "최소가격"; value = get_currency_price(value,2,'basic'); break;
3821					case "selectEndPrice": name = "최대가격"; value = get_currency_price(value,2,'basic'); break;
3822					case "auto_order": name = "자동노출기준"; break;
3823					case "auto_term_type": name = "자동노출 정렬 기준일"; break;
3824					case "auto_term": name = "자동노출 최근n일"; break;
3825					case "auto_start_date": name = "자동노출 시작일"; break;
3826					case "auto_end_date": name = "자동노출 종료일"; break;
3827					case "selectEvent": name = "이벤트고유번호"; break;
3828					case "selectEventBenefits": name = "이벤트혜택고유번호"; break;
3829					case "selectGoodsRelationCategory": name = "해당 카테고리"; value=""; break;
3830					case "selectGoodsRelationBrand": name = "해당 브랜드"; value=""; break;
3831					case "selectGoodsRelationLocation": name = "해당 지역"; value=""; break;
3832					/*
3833					default:
3834						name = div[0];
3835					break;
3836					*/
3837				}
3838
3839				switch(div[1]){
3840					case "look": value = "노출"; break;
3841					case "notLook": value = "미노출"; break;
3842					case "normal": value = "정상"; break;
3843					case "runout": value = "미노출"; break;
3844					case "purchasing": value = "재고확보중"; break;
3845					case "unsold": value = "판매중지"; break;
3846					case "relative": value = "최근"; break;
3847					case "absolute": value = "고정"; break;
3848					case "newly": value = "최근등록순"; break;
3849					case "deposit": value = "판매인기순(구매갯수)"; break;
3850					case "deposit_price": value = "판매인기순(구매금액)"; break;
3851					case "review": value = "상품후기많은순"; break;
3852					case "view": value = "상품조회많은순"; break;
3853					case "cart": value = "장바구니"; break;
3854					case "wish": value = "위시리스트"; break;
3855				}
3856
3857				if(div[2]) value = div[2];
3858
3859				if(name) descriptions.push(name+(value ? "→"+value : ''));
3860			}
3861		}
3862
3863		if(descriptions && descriptions.length){
3864			$(".displayCriteriaDesc",this).html("<b>[ì¡°ê±´]</b> "+descriptions.join(", "));
3865		}else{
3866			$(".displayCriteriaDesc",this).html("");
3867		}
3868	});
3869
3870}
3871
3872// 개선된 자동노출조건 개별 상세 설명
3873function setCriteriaDescription_upgrade(pmode, load, goodsSeq){
3874	var target = 'body';
3875	var tmp2 = new Array();
3876	if(typeof batchModify == 'undefined') {
3877		batchModify = false;
3878	}
3879
3880	if(batchModify === true && load !== true) target='.batch_table';
3881
3882	if(pmode == "batchlist"){
3883		target = ".goods"+goodsSeq;
3884	}
3885	$(".displayTabGoodsContainer, .relationGoodsContainer, .relationSellerGoodsContainer, .bigdataTextContainer, .relationGoodsContainerBatch, .relationSellerGoodsAutoContainer", target).each(function(){
3886		type			= $(this).find('.displayCriteriaType').attr('auto_type');
3887		subDisplayKind	= $(this).find('.displayCriteriaType').attr('kind');
3888
3889		if	(pmode != "setting" && (type == 'auto' || type == 'AUTO')){
3890			var descriptions = new Array();
3891			criteria		= $(".displayCriteria",this).val();
3892			isBigdataTest	= $(".isBigdataTest",this).val();
3893			no				= $(".displayCriteria",this).attr('goods_seq');
3894			batchFlag		= $(this).hasClass('relationGoodsContainerBatch');
3895			bigdataFlag		= isBigdataTest == 1 ? true : false;
3896			displayKind		= $('.display_kind').val() != undefined ? $('.display_kind').val() : subDisplayKind;
3897			
3898			if(gl_operation_type != 'light'){
3899				if(typeof gl_adminSessionType  == "undefined") var gl_adminSessionType  = "";
3900				var title_arr		= setCriteriaDescription_bigdataTitle(type,gl_adminSessionType);
3901			}
3902			
3903			var displayLayout = 'full';
3904			if($(".displayLayout", this).length>0) {
3905				displayLayout = $(".displayLayout", this).val();
3906			}
3907
3908			if(criteria.indexOf('∀') > -1){
3909				div = criteria.split('Φ');
3910				total_len = div.length;
3911				i = 0;
3912				
3913				$.each(div,function(k,v){
3914					detail 			= v.split('∀');
3915					condition_arr 	= setAutoCondition(detail[1].split(','),detail[0],displayKind);
3916					condition_str 	= condition_arr[0];
3917					rate 			= img = '';
3918
3919					condition = detail[0];
3920					criteria_str = v;
3921					
3922					if(!bigdataFlag){
3923						rate = '<div><strong>['+(++i)+'순위]</strong></div>';
3924//						img = '<td width="50px" height="60px"><img src="/admin/skin/default/images/design/display/icon_relation_customer.png" /></td>';
3925						if(batchFlag || (typeof pinfo_seq != 'undefined') ){
3926							descriptions.push('<table width="100%"><col /><tr><td>'+rate+condition_str+'</td></tr></table>');
3927						}else{
3928//							descriptions.push('<table width="100%"><col width="100px"/><col /><col width="100px"/><tr>'+img+'<td>'+rate+condition_str+'</td><td><span class="btn small"><button  type="button" onclick="bigdata_test_show(\''+condition+'\',\''+criteria_str+'\',\''+no+'\');">결과테스트</button></span></td></tr></table>');
3929							descriptions.push('<table width="100%"><tr><td>'+rate+condition_str+'</td><td><span class="btn small"><button  type="button" onclick="bigdata_test_show(\''+condition+'\',\''+criteria_str+'\',\''+no+'\');">결과테스트</button></span></td></tr></table>');
3930						}
3931					}else{
3932						if(pmode == "goodsview" || pmode == 'batchlist'){
3933							$(".displayCriteria",this).find(".nothing").closest("tr").remove();
3934							
3935							if(gl_operation_type == 'light'){
3936								descriptions.push('<tr><td class="left">'+condition_str+'</td></tr>');
3937							}else{
3938
3939								if(typeof title_arr != "undefined" && typeof title_arr[condition] != "undefined"){
3940								var title = title_arr[condition];
3941								}else{
3942									var title = "";
3943								}
3944								descriptions.push('<tr>');
3945								descriptions.push('<td class="center">'+(k+1)+'</td>');
3946								descriptions.push('<td class="left">'+title+'</td>');
3947								descriptions.push('</tr>');
3948							}
3949							if(displayLayout == "summary") {
3950								descriptions = new Array();
3951								descriptions.push("설정됨");
3952							}
3953							
3954						}else{
3955							descriptions.push('<table><tr><td>'+condition_str+'</td></tr></table>');
3956						}
3957					}
3958
3959					if(i > 0 && i < total_len) descriptions.push('<div style="width:98%;border-top:1px solid #dadada;margin-top:5px;margin-bottom:5px;"></div>');
3960
3961				});
3962				
3963				tmp2 = descriptions;
3964				if(descriptions && descriptions.length){
3965					$(".displayCriteriaDesc",this).html(descriptions.join(''));
3966				}else if(pmode == "goodsview" || pmode == "batchlist"){
3967					$(".displayCriteriaDesc .nothing", this).html("설정된 조건이 없습니다.");
3968				}else{
3969					$(".displayCriteriaDesc",this).html("설정된 조건이 없습니다. 설정하세요.");
3970
3971				}
3972			}else{
3973				if(!criteria){
3974					if(pmode == "goodsview" || pmode == "batchlist"){
3975						$(".displayCriteriaDesc .nothing", this).html("설정된 조건이 없습니다.");
3976					}else{
3977						$(".displayCriteriaDesc",this).html("설정된 조건이 없습니다. 설정하세요.");
3978					}
3979				}
3980			}
3981		}
3982	});
3983	if (gl_operation_type == 'light') {
3984		$("input[name='relation_criteria']").val(tmp2.join(''));
3985	}
3986}	
3987var bigdataTitle = new Array();
3988function setCriteriaDescription_bigdataTitle(displayKind,gl_adminSessionType){
3989
3990	if(typeof gl_adminSessionType  == "undefined") var gl_adminSessionType  = "";
3991	var url = '/admin/goods/select_auto_condition_title';
3992	if(gl_adminSessionType == "provider"){
3993		url = '/selleradmin/goods/select_auto_condition_title';
3994	}
3995
3996	if(typeof bigdataTitle[displayKind] == "undefined") {
3997		var params 			= {'displayKind':displayKind,'mode':'json'};
3998		$.ajax({
3999			'url' : url,
4000			'data' : params,
4001			'dataType' 	: 'json',
4002			'global' 	: false,
4003			'async'		:false,
4004			'success' : function(res){
4005				bigdataTitle[displayKind] = res;
4006			},
4007			'fail'	: function(e){
4008			}
4009		});
4010	}
4011
4012	return bigdataTitle[displayKind];
4013}
4014
4015function setCriteriaDescription_bigdata(pkind, load){
4016
4017	var target = 'body';
4018	if(typeof batchModify == 'undefined') {
4019		batchModify = false;
4020	}
4021	if(batchModify === true && load !== true) target='.batch_table';
4022
4023	$(".displayTabGoodsContainer, .bigdataGoodsContainer, .bigdataGoodsContainerBatch, .relationGoodsContainer, .relationGoodsContainerBatch, .bigdataGoodsAutoContainer, .relationSellerGoodsAutoContainer", target).each(function(){
4024		type = $(this).find('.displayCriteriaType').attr('auto_type');
4025
4026		if(typeof type == "undefined") type = "";
4027		if	(type == 'bigdata' || type == 'auto_sub'){
4028			var descriptions 	= new Array();
4029			var isAutoSub 		= false;
4030			var batchFlag 		= false;
4031			batchFlag 			= $(this).hasClass('relationGoodsContainerBatch');
4032			
4033			if(typeof gl_adminSessionType  == "undefined") var gl_adminSessionType  = "";
4034			var title_arr		= setCriteriaDescription_bigdataTitle(type,gl_adminSessionType);
4035
4036			if	(!batchFlag)
4037				batchFlag = $(this).hasClass('bigdataGoodsContainerBatch');
4038
4039			if	(type == 'auto_sub'){
4040				criteria = $(".displayCriteria",this).val();
4041				no = $(".displayCriteria",this).attr('goods_seq');
4042				isAutoSub = true;
4043			}else{
4044				criteria = $(".displayCriteriaBigdata", this).val();
4045				no = $(".displayCriteriaBigdata", this).attr('goods_seq');
4046			}
4047
4048			var displayLayout = 'full';
4049			if($(".displayLayout", this).length>0) {
4050				displayLayout = $(".displayLayout", this).val();
4051			}
4052
4053			if(criteria.indexOf('∀') > -1){
4054				div = criteria.split('Φ');
4055				i = 1;
4056				if(pkind == 'catalog'){
4057
4058					descriptions.push('<table class="table_basic v7">');
4059					descriptions.push('<col width="100"/><col/><col width="100"/>');
4060					$.each(div,function(k,v){
4061						detail 				= v.split('∀');
4062						condition_arr 		= setAutoCondition(detail[1].split(','),detail[0],'bigdata');
4063						condition_str 		= condition_arr[0];
4064						//condition_title 	= condition_arr[1] ? condition_arr[1] : '';
4065
4066						condition 			= detail[0];
4067						criteria_str 		= v;
4068						title 				= title_arr[condition];
4069
4070						descriptions.push('<tr>');
4071						descriptions.push('<td class="center">'+i+'</td>');
4072						descriptions.push('<td class="left">'+title+'</td>');
4073						descriptions.push('</tr>');
4074						i++;
4075					});
4076					descriptions.push('</table>');
4077				}else if(pkind == 'goodsview'){
4078					$.each(div,function(k,v){
4079
4080						var title 		= "";
4081						detail 			= v.split('∀');
4082						condition_arr 	= setAutoCondition(detail[1].split(','),detail[0],'bigdata');
4083						condition_str 	= condition_arr[0];
4084						condition_title = condition_arr[1] ? condition_arr[1] : '';
4085
4086						condition 		= detail[0];
4087						criteria_str 	= v;
4088						title 			= title_arr[condition];
4089						
4090						descriptions.push('<tr>');
4091						descriptions.push('<td class="center">'+i);
4092						descriptions.push('<span class="condition'+i+' hide">'+condition+'</span>');
4093						descriptions.push('<span class="criteria_str'+i+' hide">'+criteria_str+'</span>');
4094						descriptions.push('</td>');
4095						descriptions.push('<td class="left">'+title+'</td>');
4096						if(displayLayout == "full") {
4097							descriptions.push('<td class="center">');
4098							descriptions.push('<button type="button" class="resp_btn" onClick="open_bigdata_quide()">자세히</button>');
4099							descriptions.push('<div class="condition_str hide">'+condition_str+'</div>');
4100							descriptions.push('</td>');
4101							descriptions.push('<td class="center"><button  type="button" class="resp_btn" onclick="bigdata_test_show(\'bigdata_'+condition+'\',\''+criteria_str+'\',\''+no+'\');">테스트</button></td>');
4102						} else if(displayLayout=="list") {
4103							descriptions.push('<td class="center">');
4104							descriptions.push('<button type="button" class="resp_btn" onClick="open_bigdata_quide()">자세히</button>');
4105							descriptions.push('<div class="condition_str hide">'+condition_str+'</div>');
4106							descriptions.push('</td>');
4107						}
4108						descriptions.push('</tr>');
4109
4110						if( displayLayout == "summary") {
4111							descriptions 	= new Array();
4112							descriptions.push('설정됨');
4113						}
4114						i++;
4115					});
4116				}else{
4117					total_len = div.length;
4118					that = this;
4119					$.each(div,function(k,v){
4120						rate	= '<div><strong>['+(i)+'순위]</strong></div>';
4121						rate	= rate+'<div>추천상품 노출 페이지별 ‘○○○고객이 보고 있는 상품’ 기준 <span class="hand" style="color:#f63 !important;" onclick="open_bigdata_quide()">자세히 ></span></div>';
4122						detail	= v.split('∀');
4123
4124						if	(detail[0] == 'admin'){
4125							if	(total_len != 1) return;
4126							
4127							nodata = "<div class='left'>설정된 조건이 없습니다. 설정하세요.</div>";
4128							$(".displayCriteriaDesc",that).html(nodata);
4129							return;
4130						}
4131						condition_arr = setAutoCondition(detail[1].split(','),detail[0],'bigdata');
4132						condition_str = condition_arr[0];
4133						condition_title = condition_arr[1];
4134
4135						condition = detail[0];
4136						criteria_str = v;
4137
4138//						img = '<td width="50px" height="60px"><img src="/admin/skin/default/images/design/display/icon_relation_customer.png" /></td>';
4139						
4140						if(batchFlag){
4141							descriptions.push('<table width="100%"><col /><tr><td style="border-bottom:none;">'+rate+condition_str+'</td></tr></table>');
4142						}else{
4143//							descriptions.push('<table width="100%"><col width="100px"/><col /><col width="100px"/><tr>'+img+'<td>'+rate+condition_str+'</td><td><span class="btn small"><button  type="button" onclick="bigdata_test_show(\'bigdata_'+condition+'\',\''+criteria_str+'\',\''+no+'\');">결과테스트</button></span></td></tr></table>');
4144							descriptions.push('<table width="100%"><tr><td>'+rate+condition_str+'</td><td><button  type="button" onclick="bigdata_test_show(\'bigdata_'+condition+'\',\''+criteria_str+'\',\''+no+'\');">결과테스트</button></td></tr></table>');
4145						}
4146						
4147						if(i > 0 && i < total_len) descriptions.push('<div style="width:98%;border-top:1px solid #dadada;margin-top:5px;margin-bottom:5px;"></div>');
4148
4149						i++;
4150					});
4151				}
4152
4153				if(descriptions && descriptions.length){
4154					if	(isAutoSub){
4155						$(".displayCriteriaDesc",this).html(descriptions.join(''));
4156					}else{
4157						$(".displayCriteriaBigdataDesc", this).html(descriptions.join(''));
4158					}
4159				}
4160			}else{
4161				if	(pkind == 'catalog')
4162					nodata = "<div class='center'>추천상품 전용페이지가 설정되지 않았습니다. 설정하세요.</div>";
4163				else if(pkind == 'goodsview')
4164					nodata = "설정된 조건이 없습니다.";
4165				else
4166					nodata = "<div class='left'>설정된 조건이 없습니다. 설정하세요.</div>";
4167
4168				if	(isAutoSub){
4169					$(".displayCriteriaDesc",this).html(nodata);
4170				}else{
4171					if(typeof $(".displayCriteriaBigdataDesc .nothing", this) != "undefined"){
4172						$(".displayCriteriaBigdataDesc .nothing", this).html(nodata);
4173					}else{
4174						$(".displayCriteriaBigdataDesc", this).html(nodata);
4175					}
4176				}
4177			}
4178		}
4179	});
4180}
4181
4182function bigdata_test_show(condition,criteria,goods_seq,design){
4183	var html = '';
4184	$.ajax({
4185		type: "post",
4186		url: "../bigdata/get_goods",
4187		data: {'goods_seq':goods_seq,'condition':condition,'displayCriteria':criteria},
4188		dataType: 'json',
4189		success: function(result){
4190			height = 580;
4191			if(design == 'tab') height = 620;
4192			openDialog('결과테스트','bigdata_test',  {"width":"700", "height":height,"show" : "fade","hide" : "fade"});
4193			if	(result.record.length > 0){
4194				$.each(result.record,function(){
4195					html += '<tr>';
4196					if(window.Firstmall.Config.Environment.serviceLimit.H_AD) {
4197						html += '<td class="center">'+this.provider_name+'</td>';
4198					}
4199					html += '<td class="left">';
4200					html += '<div class="image fl"><img src="'+this.jsimage+'" style="width:50px;height:50px"></div>';
4201					html += '<div class="fl">';
4202					if(this.goods_code) {
4203						html += '<div>[상품코드:'+this.goods_code+']</div>';
4204					}
4205					html += '	<div class="goodsname">';
4206					html += '	['+this.goods_seq+'] '+this.jsgoods_name;
4207					html += '	</div>';
4208					html += '</div>';
4209					html += '</td>';
4210					html += '<td class="right">'+this.jsprice+'</td>';
4211					html += '</tr>';
4212				});				
4213			}else{
4214				html += '<tr>';
4215				if(window.Firstmall.Config.Environment.serviceLimit.H_AD) {
4216					html += '<td colspan="3" class="center" style="border-bottom:0px;border-left:0px;" height="300">';
4217				} else {
4218					html += '<td colspan="2" class="center" style="border-bottom:0px;border-left:0px;" height="300">';
4219				}
4220				html += '조건에 따른 빅데이터 결과 상품이 없습니다.</td>';
4221				html += '</tr>';
4222			}
4223			$("#bigdata_test > .content > .goods_list > .table_basic > tbody").html(html);
4224		}
4225	});
4226}
4227
4228function setAutoCondition(criteria,kind,displayKind){
4229	// isFirst 인 경우 블락
4230	if	(criteria == 'isFirst=1') return;
4231
4232	// 변수 선언
4233	var arr				= new Array();
4234	var descriptions	= new Array();
4235	var admin_arr		= new Array();
4236	var same_arr		= new Array();
4237	var etc_arr			= new Array();
4238	var isRecently		= false;
4239
4240	// 순위 항목 텍스트 정의
4241	var condition = {
4242		'admin':'지정한',
4243		'view':'본',
4244		'cart':'장바구니에 담은',
4245		'wish':'위시리스트에 찜한',
4246		'fblike':'좋아요한',
4247		'order':'구매한',
4248		'review':'리뷰를 쓴',
4249		'search':'검색한 결과 최상위',
4250		'restock':'재입고알림 요청한',
4251		'none':''
4252	};
4253	
4254	// 행동 항목 텍스트 정의
4255	var act = {
4256		'order_cnt'	:	'구매(횟수)량이 높은',
4257		'order_ea'	:	'구매(수량)량이 높은',
4258		'cart'		:	'많이 장바구니에 담음',
4259		'wish'		:	'많이 위시리스트에 찜한',
4260		'view'		:	'많이 본',
4261		'review'	:	'상품후기가 많이 작성된',
4262		'review_sum':	'베스트 상품 후기가 많은 상품',
4263		'fblike'	:	'‘좋아요’가 많은 상품',
4264		'recently'	:	'최근에 등록한 상품'
4265	};
4266
4267	// 자동 조건 displayKind 텍스트 정의
4268	var kind_standard = {
4269		'relation'					: '상품과',
4270		'relation_seller'			: '상품과',
4271		'category'					: '카테고리',
4272		'brand'						: '브랜드',
4273		'location'					: '지역',
4274		'mshop'						: '판매자' 
4275	};
4276
4277	// 초기 데이터 세팅
4278	for	(var i=0;i<criteria.length;i++){
4279		var div = criteria[i].split("=");
4280		if	(!arr[div[0]]) arr[div[0]] = new Array();
4281
4282		if	(div[0].indexOf('each_age_') > -1){
4283			if	(!arr['each_age']) arr['each_age'] = new Array();
4284			arr['each_age'].push(div[1]+'대');
4285		}else if(div[0].indexOf('each_sex_') > -1){
4286			if	(!arr['each_sex']) arr['each_sex'] = new Array();
4287			sex = '성별 모름';
4288			if	(div[1] == 'male'){
4289				sex = '남성'
4290			}else if(div[1] == 'female'){
4291				sex = '여성';
4292			}
4293			arr['each_sex'].push(sex);
4294		}else if(div[0].indexOf('each_agent_') > -1){
4295			if	(!arr['each_agent']) arr['each_agent'] = new Array();
4296			arr['each_agent'].push(div[1]);
4297		}else{
4298			if	(div[0] == 'act'){
4299				if	(!arr['act']) arr['act'] = new Array();
4300
4301				if	((displayKind == 'bigdata' || displayKind == 'bigdata_catalog') && div[1] == 'recently'){
4302					div[1] = 'order_cnt';
4303				}
4304				if	(div[1] == 'recently'){
4305					isRecently = true;
4306				}
4307
4308				arr['act']  = div[1];
4309			}else{
4310				arr[div[0]] = div[2] ? div[2] : decodeURIComponent(div[1]);
4311			}
4312		}
4313	}
4314
4315	// ######################## 노출 기준 #############################
4316	// 기준 노출 설정
4317	var txt_standard = '';
4318	if(kind == 'none'){
4319		txt_standard += '해당 ' + kind_standard[displayKind];
4320
4321	}else if(kind == 'admin'){
4322		txt_standard += '관리자가 지정한 기준';
4323
4324	}else{
4325		txt_standard += '○○○고객이 최근 본 상품과';
4326
4327	}
4328
4329	descriptions.push(txt_standard);
4330	
4331	// 동일 항목 체크
4332	var txt_same	= '';
4333	if	(kind != 'admin' && (kind != 'none' || displayKind == 'relation' || displayKind == 'relation_seller')){
4334		if	(arr['same_category'])		txt_same += '동일한 카테고리 ';
4335		if	(arr['same_brand'])			txt_same += '동일한 브랜드 ';
4336		if	(arr['same_location'])		txt_same += '동일한 지역 ';
4337		if	(arr['same_seller'])		txt_same += '동일한 판매자 ';
4338	}
4339	descriptions.push(txt_same);
4340	
4341	if	(arr['selectCategory1'] || arr['selectCategory2'] || arr['selectCategory3'] || arr['selectCategory4']){
4342		cartegory_str = '';
4343		if	(arr['selectCategory1'])
4344			cartegory_str = arr['selectCategory1'];
4345		if	(arr['selectCategory2'])
4346			cartegory_str = arr['selectCategory2'];
4347		if	(arr['selectCategory3'])
4348			cartegory_str = arr['selectCategory3'];
4349		if	(arr['selectCategory4'])
4350			cartegory_str = arr['selectCategory4'];
4351		admin_arr.push(cartegory_str+' 카테고리');
4352	}
4353
4354	if	(arr['selectBrand1'] || arr['selectBrand2'] || arr['selectBrand3'] || arr['selectBrand4']){
4355		brand_str = '';
4356		if	(arr['selectBrand1'])
4357			brand_str = arr['selectBrand1'];
4358		if	(arr['selectBrand2'])
4359			brand_str = arr['selectBrand2'];
4360		if	(arr['selectBrand3'])
4361			brand_str = arr['selectBrand3'];
4362		if	(arr['selectBrand4'])
4363			brand_str = arr['selectBrand4'];
4364		admin_arr.push(brand_str+' 브랜드');
4365	}
4366
4367	if	(arr['selectLocation1'] || arr['selectLocation2'] || arr['selectLocation3'] || arr['selectLocation4']){
4368		location_str = '';
4369		if	(arr['selectLocation1'])
4370			location_str = arr['selectLocation1'];
4371		if	(arr['selectLocation2'])
4372			location_str = arr['selectLocation1'];
4373		if	(arr['selectLocation3'])
4374			location_str = arr['selectLocation1'];
4375		if	(arr['selectLocation4'])
4376			location_str = arr['selectLocation1'];
4377		admin_arr.push(location_str+' 지역');
4378	}
4379
4380	if	(arr['provider'] == 'all'){
4381		admin_arr.push('전체 판매자');
4382	}else if(arr['provider'] == '1'){
4383		admin_arr.push('본사');
4384	}else if(arr['provider'] == 'seller'){
4385		admin_arr.push(arr['provider_name']+' 판매자');
4386	}
4387
4388	if	(admin_arr.length > 0) descriptions.push(admin_arr.join(', '));
4389
4390	descriptions.push('상품 중에서<br/>');
4391	
4392	// 빅데이터 설정인 경우
4393	if	(displayKind == 'bigdata' || displayKind == 'bigdata_catalog'){
4394		if (arr['bigdata_month'] == undefined) arr['bigdata_month'] = '1';
4395		descriptions.push('해당 상품을 최근 '+arr['bigdata_month']+'개월 안에 <font class="act_title" color="#ff0000">'+condition[kind]+'</font> 다른 고객이</font>');
4396	}else{
4397		if	(isRecently) descriptions.push('관리자가<br/>');
4398		else descriptions.push('다른 고객이<br/>');
4399	}
4400	// ######################## 노출 기준 #############################
4401	
4402
4403	// ######################## 통계대상기간 #############################
4404	var txt_date_sub = arr['act'] != null && arr['act'] == 'review_sum' ? '누적 기간동안' : '최근 '+arr['month']+'개월 동안';
4405	descriptions.push(txt_date_sub);
4406	// ######################## 통계대상기간 #############################
4407	
4408	
4409	// ######################## 통계대상연령,성별,환경 #############################
4410	if	( gl_operation_type != 'light' && !isRecently){
4411		if	(arr['age'] == 'all'){
4412			etc_arr.push('전체 연령');
4413		}else if(arr['age'] == 'each'){
4414			if	(arr['each_age'] != undefined) etc_arr.push(arr['each_age']);
4415		}else{
4416			etc_arr.push('같은 연령');
4417		}
4418
4419		if	(arr['sex'] == 'all'){
4420			etc_arr.push('전체 성별');
4421		}else if(arr['sex'] == 'each'){
4422			if	(arr['each_sex'] != undefined) etc_arr.push(arr['each_sex']+'이');
4423		}else{
4424			etc_arr.push('같은 성별');
4425		}
4426
4427		if	(arr['agent'] == 'all'){
4428			etc_arr.push('전체 환경에서');
4429		}else if(arr['agent'] == 'each'){
4430			if	(arr['each_agent'] != undefined) etc_arr.push(arr['each_agent']+'환경에서');
4431		}else{
4432			etc_arr.push('같은 환경에서');
4433		}
4434		if	(etc_arr.length > 0) descriptions.push(etc_arr.join(', '));
4435	}
4436	descriptions.push('<br />');
4437	// ######################## 통계대상연령,성별,환경 #############################
4438
4439
4440
4441	// ######################## 통계대상행동 #############################
4442	descriptions.push(act[arr['act']] + '<br />');
4443	// ######################## 통계대상행동 #############################
4444	
4445
4446
4447	descriptions.push('승인, 노출, 정상 상태의 상품이 ì
4447µœì†Œ '+arr['min_ea']+'종 이상일 때 추천상품 노출');
4448	descriptions = descriptions.join(' ');
4449
4450	return Array(descriptions,arr['display_title']);
4451}
4452
4453// 개선된 자동노출조건 개별 상세 설명
4454function setAutoConditionDescription(displayKind){
4455
4456	$("#goodsSelectorAuto tr").each(function(){
4457		var condition 	= $("input[name='condition[]']",this).val();
4458		var criteria 	= $("input[name='auto_condition[]']",this).val();
4459
4460		if (criteria=='' || criteria == undefined) return;
4461		criteria = criteria.split(',');
4462
4463		condition_arr = setAutoCondition(criteria,condition,displayKind);
4464
4465		if (condition_arr){
4466			$(".condition_desc",this).html(condition_arr[0]);
4467			$(".condition_detail",this).show();
4468		}else{
4469			$(".condition_desc",this).html('');
4470			$(".condition_detail",this).hide();
4471		}
4472	});
4473}
4474
4475// 우측하단 옵션보기
4476function display_goods_show_opt(obj,goods_seq){
4477	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
4478		display_goods_show_opt_light(obj,goods_seq);
4479	}else{
4480		display_goods_show_opt_heavy(obj,goods_seq);
4481	}
4482}
4483
4484function display_goods_show_opt_light(obj,goods_seq){
4485	if ( $('.quick_opt_view').lenght > 0 ) {
4486		$('.quick_opt_view').remove();
4487	}
4488
4489	event.cancelBubble	= true;
4490	event.returnValue	= false;
4491
4492	opt_obj				= $(obj);
4493	parent_id			= opt_obj.closest('.designDisplay').prop('id');
4494	parent_img			= opt_obj.closest('.goodsDisplayImageWrap');
4495	quick_opt_id		= 'quick_opt_'+parent_id;
4496	opt_data			= $('.display_opt_bak',opt_obj).html();
4497	x_loc				= parent_img.offset().left;
4498	y_loc				= parent_img.offset().top+parent_img.height();
4499
4500	if($(window).width()-x_loc < 400) x_loc = x_loc-(400-parent_img.width());
4501
4502	opt_html = $('#'+quick_opt_id);
4503
4504	if	($('body').find('#'+quick_opt_id).length == 0) {
4505		opt_html = $("<div>");
4506		opt_html.addClass('quick_opt_view').prop('id',quick_opt_id);
4507		html = [];
4508		x = -1;
4509
4510		html[++x] = '<div class="quick_opt_view_wrap">';
4511		html[++x] = '<div class="quick_opt_view_close" onclick="quick_opt_view_close()">X</div>';
4512		html[++x] = '<div class="quick_option_title">'+getAlert('et403')+'</div>';		// 옵션 미리보기
4513		html[++x] = '<div class="quick_option_area"></div>';
4514		html[++x] = '</div>';
4515	}
4516
4517	$('.quick_option_area', opt_html).html('');
4518
4519	if	(!opt_data) {
4520		$.getJSON('/goods/get_goods_default_option?goods_seq='+goods_seq, function(data) {
4521			html = [];
4522			x = -1;
4523			html[++x] = '<ul>';
4524			$.each(data.result,function(){
4525				option_arr = new Array();
4526				if	(this.option_view == 'Y') {
4527					if	(this.option1) option_arr.push(this.option1);
4528					if	(this.option2) option_arr.push(this.option2);
4529					if	(this.option3) option_arr.push(this.option3);
4530					if	(this.option4) option_arr.push(this.option4);
4531					if	(this.option_title != null)
4532						html[++x] = '<li>'+this.option_title+'-'+option_arr.join('/')+'</li>';
4533					else
4534						//옵션이 없는 상품입니다.
4535						html[++x] = '<li>'+getAlert('et404')+'</li>';
4536				}
4537			});
4538			html[++x] = '</ul>';
4539			$('.quick_option_area', opt_html).html(html.join(''));
4540			$('.display_opt_bak', opt_obj).html(html.join(''));
4541		}).complete(function() {
4542			parent_img.append(opt_html);
4543			$('.quick_opt_view').show();
4544		});
4545	}else{
4546		$('.quick_option_area', opt_html).html(opt_data);
4547	}
4548
4549	opt_html.append(html.join(''));
4550
4551	/*
4552	opt_html.bind('mouseenter',function(){
4553		parent_img.trigger('mouseenter');
4554	}).bind('mouseleave',function(){
4555		parent_img.trigger('mouseleave');
4556	});
4557	*/
4558
4559	//$('.quick_opt_view').css({'left':x_loc,'top':y_loc,'display':'inline-block','z-index':9000});
4560	opt_obj.attr({'open':true});
4561
4562}
4563
4564/* 우측하단 옵션 미리보기 heavy 용 */
4565function display_goods_show_opt_heavy(obj,goods_seq){
4566	event.cancelBubble	= true;
4567	event.returnValue	= false;
4568
4569	opt_obj				= $(obj);
4570	parent_id			= opt_obj.closest('.designDisplay').prop('id');
4571	parent_wrap			= opt_obj.closest('.goodsDisplayItemWrap');
4572	parent_img			= opt_obj.closest('.goodsDisplayImageWrap');
4573	quick_opt_id		= 'quick_opt_'+parent_id;
4574	opt_data			= $('.display_opt_bak',opt_obj).html();
4575	x_loc				= parent_wrap.offset().left;
4576	y_loc				= parent_img.offset().top+parent_img.height();
4577
4578	if($(window).width()-x_loc < 400) x_loc = x_loc-(400-parent_wrap.width());
4579
4580	opt_html = $('#'+quick_opt_id);
4581
4582	if	($('body').find('#'+quick_opt_id).length == 0) {
4583		opt_html = $("<div>");
4584		opt_html.addClass('quick_opt_view').prop('id',quick_opt_id);
4585		html = [];
4586		x = -1;
4587
4588		html[++x] = '<div class="quick_opt_view_wrap">';
4589		html[++x] = '<div class="quick_opt_view_close" onclick="quick_opt_view_close()">X</div>';
4590		html[++x] = '<div class="quick_option_title">'+getAlert('et403')+'</div>';
4591		html[++x] = '<div class="quick_option_area"></div>';
4592		html[++x] = '</div>';
4593
4594		opt_html.append(html.join(''));
4595		$('body').append(opt_html);
4596		opt_html.bind('mouseenter',function(){
4597			parent_img.trigger('mouseenter');
4598		}).bind('mouseleave',function(){
4599			parent_img.trigger('mouseleave');
4600		});
4601	}
4602
4603	$('.quick_option_area', opt_html).html('');
4604
4605	if	(!opt_data) {
4606		$.getJSON('/goods/get_goods_default_option?goods_seq='+goods_seq, function(data) {
4607			html = [];
4608			x = -1;
4609			html[++x] = '<ul>';
4610			$.each(data.result,function(){
4611				option_arr = new Array();
4612				if	(this.option_view == 'Y') {
4613					if	(this.option1) option_arr.push(this.option1);
4614					if	(this.option2) option_arr.push(this.option2);
4615					if	(this.option3) option_arr.push(this.option3);
4616					if	(this.option4) option_arr.push(this.option4);
4617					if	(this.option_title != null)
4618						html[++x] = '<li>'+this.option_title+'-'+option_arr.join('/')+'</li>';
4619					else
4620						html[++x] = '<li>'+getAlert('et404')+'</li>';
4621				}
4622			});
4623			html[++x] = '</ul>';
4624			$('.quick_option_area', opt_html).html(html.join(''));
4625			$('.display_opt_bak', opt_obj).html(html.join(''));
4626		});
4627	}else{
4628		$('.quick_option_area', opt_html).html(opt_data);
4629	}
4630
4631	$('.quick_opt_view').css({'left':x_loc,'top':y_loc,'display':'inline-block','z-index':9000});
4632	opt_obj.attr({'open':true});
4633}
4634
4635function quick_opt_view_close(){
4636	opt_obj.attr({'open':false});
4637	$('.quick_opt_view').remove();
4638}
4639
4640// 우측하단 옵션 오픈 여부
4641function chk_display_goods_show_opt(obj, flag){
4642	parent_id	= $(obj).closest('.designDisplay').prop('id');
4643	opt_obj		= $(obj).find('.display_option');
4644	isOpen		= opt_obj.attr('open');
4645	goods_seq	= opt_obj.attr('goods_seq');
4646	if	(opt_obj.length > 0) {
4647		if	(flag && isOpen)
4648			display_goods_show_opt(opt_obj,goods_seq);
4649		else
4650			$('.quick_opt_view').hide();
4651	}
4652}
4653
4654//default_gl 기준 상단 flying 으로 인해 좌표값이 변경 되는 것에 대비
4655function display_goods_show_opt_fix(){
4656	$('.designDisplay .display_option[open="open"][act="hover"]').each(function(){
4657		goods_seq = $(this).attr('goods_seq');
4658		display_goods_show_opt($(this),goods_seq);
4659	});
4660}
4661
4662function overay_set_open(name){
4663	if	(!$('.use_image_overay').is(':checked')) return;
4664	var parent					= $('#overay_setting_dialog');
4665	var that					= $('.'+name);
4666	var data					= [];
4667	var image_overay1			= $('.image_overay1').attr('before_value');
4668	var image_overay1_text		= $('.image_overay1_text').attr('before_value');
4669	var image_overay2			= $('.image_overay2').attr('before_value');
4670	var image_overay2_text		= $('.image_overay2_text').attr('before_value');
4671
4672	$('.overay_set_on').removeClass('overay_set_on');
4673	that.addClass('overay_set_on');
4674	$(".colorpicker", parent).customColorPicker("destroy");
4675	$('#overay_main_setting input, #overay_main_setting select', parent).val('');
4676	$('.overay_container').html('');
4677
4678	if	(name == 'image_overay_plus1') {
4679		if	((image_overay1 || image_overay1_text)) {
4680			if	(image_overay1_text)
4681				data[0] = {'key':'direct','overay_text':image_overay1_text};
4682			else
4683				data[0] = {'key':image_overay1};
4684		}
4685		main = $('.image_overay_plus1_main').val();
4686	}
4687
4688	if	(name == 'image_overay_plus2') {
4689		if	(image_overay2 || image_overay2_text) {
4690			if	(image_overay2_text)
4691				data[0] = {'key':'direct','overay_text':image_overay2_text};
4692			else
4693				data[0] = {'key':image_overay2};
4694		}
4695		main = $('.image_overay_plus2_main').val();
4696	}
4697
4698
4699	if	(main.length > 0) {
4700		main = decode_base64_json(main);
4701		$.each(main,function(k, v){
4702			if	(v)	$("[name='"+k+"']",parent).val(v);
4703		});
4704	}
4705
4706	if	(!$('input[name="overay_bg_color"]').val()) $('input[name="overay_bg_color"]').val('#000000');
4707
4708	if	(that.val()) data = decode_base64_json(that.val());
4709
4710	overay_add_func(data);
4711
4712	$(".colorpicker", parent).customColorPicker();
4713
4714	openDialog('이미지 위 정보 설정','#overay_setting_dialog', {'width':'1000','height':'520','show' : 'fade','hide' : 'fade'});
4715}
4716
4717function overay_apply(){
4718	var overay_obj = $('#overay_setting_dialog');
4719	overay_percent_able();
4720	obj = $('.overay_container', overay_obj);
4721	items = obj.find('.overay_items');
4722	if(items.length > 3){
4723		alert('최대 3개까지 설정 가능합니다.');
4724	}else{
4725		var data = [];
4726		var main_data = {};
4727		var item_key_html = [];
4728		var idx = -1;
4729
4730		$('.overay_main').each(function(){
4731			main_data[$(this).attr('name')] = $(this).val();
4732		});
4733
4734		items.each(function(){
4735			var sub_data = {};
4736			sub_data.key = $(this).find('.overay_info_cell_type').val();
4737			item_key_html.push('<li>'+$(this).find('.overay_info_cell_type > option:selected').text()+'</li>');
4738
4739			$(this).find('.opt_use').each(function(){
4740				if	($(this).hasClass('opt9')) {
4741					sub_data.overay_discount_per		= $('.overay_discount_per', $(this)).val();
4742					sub_data.overay_discount_bg_color	= $('.overay_discount_bg_color', $(this)).val();
4743					sub_data.overay_discount_position	= $('.overay_discount_position', $(this)).val();
4744					sub_data.overay_discount_per_color	= $('.overay_discount_per_color', $(this)).val();
4745					sub_data.overay_discount_opacity	= $('.overay_discount_opacity', $(this)).val();
4746				}else{
4747					if	($(this).prop('tagName') == 'INPUT' || $(this).prop('tagName') == 'SELECT')
4748						sub_data[$(this).attr('name')] = $(this).val();
4749					else
4750						sub_data[$(this).attr('name')] = $(this).hasClass('use');
4751				}
4752			});
4753
4754			data[++idx] = sub_data;
4755		});
4756
4757		decoration = Base64.encode(JSON.stringify(data));
4758		main_data = Base64.encode(JSON.stringify(main_data));
4759		overay_title = Base64.encode(item_key_html.join(''));
4760
4761		$('.overay_set_on').val(decoration);
4762		$('.overay_set_on').closest('div').find('ul').html(item_key_html.join(''));
4763
4764		//기존 기능 유지를 위한 값 초기화 시킴
4765		if	($('.overay_set_on').hasClass('image_overay_plus1')) {
4766			$('.image_overay1').val('');
4767			$('.image_overay1_text').val('');
4768			$('.image_overay_plus1_main').val(main_data);
4769			$('.image_overay_plus1_title').val(overay_title);
4770		}else{
4771			$('.image_overay2').val('');
4772			$('.image_overay2_text').val('');
4773			$('.image_overay_plus2_main').val(main_data);
4774			$('.image_overay_plus2_title').val(overay_title);
4775		}
4776
4777		$('.use_image_overay').change();
4778		closeDialog('overay_setting_dialog');
4779	}
4780}
4781
4782function decode_base64_json(json){
4783	var ret = '';
4784	if	(json) ret = JSON.parse(Base64.decode(json));
4785	return ret;
4786}
4787
4788function overay_add_func(obj){
4789	var overay_obj = $('#overay_setting_dialog');
4790	var items = $('.overay_container', overay_obj).find('.overay_items');
4791	if	(items.length >= 3) {
4792		alert('최대 3개까지 설정 가능합니다.');
4793	}else{
4794		if	(obj) {
4795			$.each(obj, function(k, v){
4796				var overayContainer = overay_obj.find(".overay_info_bak");
4797				var new_info_item = $("div.overay_items",overayContainer).clone();
4798
4799				$.each(v, function(item_key, item_val){
4800					if	(item_key != 'key') {
4801						item_obj = new_info_item.find('[name="'+item_key+'"]');
4802						if	(item_obj.prop('tagName') == 'INPUT' || item_obj.prop('tagName') == 'SELECT')
4803							item_obj.val(item_val);
4804						else
4805							if	(item_val == true) item_obj.addClass('use');
4806					}
4807				});
4808
4809				new_info_item.find('.overay_info_cell_type').val(v.key).change();
4810				$('.overay_container').append(new_info_item);
4811			});
4812		}else{
4813			var overayContainer = overay_obj.find(".overay_info_bak");
4814			var new_info_item = $("div.overay_items",overayContainer).clone();
4815
4816			if	($('input[name="image_overay_type"]:checked').val() == 'all') {
4817				new_info_item.find('.overay_info_cell_type>option[value="direct"]').remove();
4818				new_info_item.find('.overay_info_cell_type>option[value="related_goods"]').remove();
4819			}
4820
4821			new_info_item.find('.overay_info_cell_type').change();
4822			$('.overay_container').append(new_info_item);
4823		}
4824
4825		$('.overay_container',overay_obj).sortable({
4826			opacity: 0.5
4827		});
4828	}
4829	overay_percent_able();
4830}
4831
4832function overay_remove_func(e){
4833	$(e).closest('.overay_items').remove();
4834	overay_percent_able();
4835}
4836
4837//opt는 해당 select box의 상세옵션(000000000) 순차적으로 해당 숫자순서대로 옵션들을 show,hide 함
4838function overay_set_event(e){
4839	var obj = $(e);
4840	var obj_wrap = obj.closest('ul');
4841	var opt = obj.find('option:selected').attr('opt');
4842	var len = opt.length;
4843	$('.colorpicker', obj_wrap).customColorPicker('destroy').removeClass('colorpicker');
4844
4845	if	(obj.val() == 'discount_per') {
4846		limit = 0;
4847		obj.closest('.overay_container').find('.overay_info_cell_type').each(function(){
4848			if	($(this).val() == 'discount_per') limit++;
4849		});
4850		if	(limit > 1) {
4851			alert('할인율은 한개만 선택 가능합니다');
4852			obj.val('goods_name').change();
4853			return;
4854		}
4855	}else if(obj.val() == 'event_time') {
4856		limit = 0;
4857		obj.closest('.overay_container').find('.overay_info_cell_type').each(function(){
4858			if	($(this).val() == 'event_time') limit++;
4859		});
4860		if	(limit > 1) {
4861			alert('단독이벤트 남은시간은 한개만 선택 가능합니다');
4862			obj.val('goods_name').change();
4863			return;
4864		}
4865	}
4866
4867	for(i=0; i<len; i++){
4868		if	(opt.charAt(i) == 1) {
4869			open_obj = $('.opt'+i, obj_wrap);
4870			if	(open_obj.hasClass('colorpicker_ready')) {
4871				open_obj.addClass('colorpicker');
4872			}else if(open_obj.find('.colorpicker_ready').length > 0){
4873				open_obj.find('.colorpicker_ready').addClass('colorpicker');
4874			}
4875			open_obj.show().addClass('opt_use');
4876			$('.colorpicker', obj_wrap).customColorPicker();
4877		}else{
4878			$('.opt'+i, obj_wrap).hide().removeClass('opt_use');
4879		}
4880	}
4881
4882	$('.overay_desc', obj_wrap).hide();
4883
4884	switch(obj.val()){
4885		case 'discount_per':
4886			$('.desc_discount_per', obj_wrap).show();
4887			break;
4888		case 'shpping_free':
4889			$('.desc_shipping', obj_wrap).show();
4890			break;
4891		case 'event_time':
4892		case 'event_cnt':
4893			$('.desc_event', obj_wrap).show();
4894	}
4895
4896	obj = $('.overay_discount_bg_color', obj_wrap);
4897	obj.next().show();
4898	obj.prop('disabled',false);
4899
4900	if	($('.image_overay_type:checked').val() == 'all') {
4901		obj.next().hide();
4902		obj.prop('disabled',true);
4903	}
4904
4905	overay_percent_able();
4906}
4907
4908//할인율은 옵션이 다른 옵션이 한개 이상일 경우 사용 가능
4909function overay_percent_able(){
4910	var obj = $('.overay_container');
4911	var items = obj.find('.overay_items');
4912	var cnt = items.length;
4913	items.each(function(){
4914		if	($(this).find('.overay_info_cell_type').val() == 'discount_per') {
4915			if	(cnt == 1 || $('.image_overay_type:checked').val() == 'all') {
4916				$(this).find('.overay_discount_bg_color').prop('disabled',true);
4917				$(this).find('.overay_discount_bg_color').next().hide();
4918			}else{
4919				$(this).find('.overay_discount_bg_color').prop('disabled',false);
4920				$(this).find('.overay_discount_bg_color').next().show();
4921			}
4922		}
4923	});
4924}
4925
4926function font_weight_use_chk(e){
4927	var obj = $(e);
4928	if	(obj.hasClass('use'))
4929		obj.removeClass('use');
4930	else
4931		obj.addClass('use');
4932}
4933
4934function overay_before_change(type,val){
4935	var obj		= {};
4936	var ret		= {};
4937	var title	= [];
4938	if	(type == 'type') {
4939		obj[val] = [];
4940		title.push('<li>'+$('.overay_info_bak .overay_info_cell_type > option[value="'+val+'"]').text()+'</li>');
4941	}else{
4942		obj['direct'] = {'overay_text':val};
4943		title.push('<li>직접입력</li>');
4944	}
4945	ret.title = Base64.encode(title.join(''));
4946	ret.items = Base64.encode(JSON.stringify(obj));
4947	return ret;
4948}
4949
4950function show_icon_setting(){
4951	var parent_obj		= $('#image_icon_wrap');
4952	var default_icon	= Base64.encode(JSON.stringify({"type":"image","img":"icon_bg6.png"}));
4953	var default_style	= Base64.encode(JSON.stringify({"type":"style","width":"60","height":"60","color":"#ffa500","opacity":"10"}));
4954
4955	// light 일 경우 default 이미지 설정은 없음
4956	if(typeof gl_operation_type != 'undefined' && gl_operation_type == 'light'){
4957		default_style	= Base64.encode(JSON.stringify({"type":"style","width":"60","height":"60","color":"#333","opacity":"10"}));
4958		default_icon	= default_style;
4959	}
4960
4961	var image_icon_default_arr = {
4962		'discount_per'	: {
4963			'condition'	:
4964				'<div class="mt15"><p>(혜택적용)판매가 기준으로</p><p>할인율<span class="helpicon" title="이벤트,회원등급,모바일/태블릿,유입경로의 할인이 있을 경우 이를 적용한 판매가를 기준으로 합니다." options="{alignX: \'right\'}"></span> <input type="text" class="discount" size="3"> % 이상인 상품</p></div>',
4965			'txt_use'	: ['1','1','0'],
4966			'text_arr'	:
4967				['{discount}','%','무료배송'],
4968			'use'		: false,
4969			'discount'	: '',
4970			'decoration': [],
4971			'background': default_icon
4972		},
4973		'solo' : {
4974			'condition'	:
4975				'단독이벤트 진행중인 상품<span class="helpicon" title="단독이벤트란 할인이벤트 메뉴에서 진행중인 단독 이벤트를 말합니다." options="{alignX: \'right\'}">',
4976			'txt_use'	: ['1','0','0'],
4977			'text_arr'	:
4978				['파워딜','반값할인','무료배송'],
4979			'use'		: false,
4980			'decoration': [],
4981			'background': default_style
4982		},
4983		'discount' : {
4984			'condition'	:
4985				'할인이벤트 진행중인 상품<span class="helpicon" title="할인이벤트란 할인이벤트 메뉴에서 진행중인 할인 이벤트를 말합니다." options="{alignX: \'right\'}">',
4986			'txt_use'	: ['1','0','0'],
4987			'text_arr'	:
4988				['주말','특가','무료배송'],
4989			'use'		: false,
4990			'decoration': [],
4991			'background': default_icon
4992		},
4993//			'gift' : {
4994//				'condition'	:
4995//					'사은품 이벤트 진행 중인 상품',
4996//				'txt_use'	: ['1','0','0'],
4997//				'text_arr'	:
4998//					['사은품','선착순','무료배송'],
4999//				'use'		: false,
5000//				'decoration':[]
5001//			},
5002		'package' : {
5003			'condition' :
5004				'패키지 상품<span class="helpicon" title="패키지 상품이란 패키지/복합 상품에 등록된 상품을 말합니다." options="{alignX: \'right\'}">',
5005			'txt_use'	: ['1','0','0'],
5006			'text_arr'	:
5007				['1+1+1','패키지','무료배송'],
5008			'use'		: false,
5009			'decoration': [],
5010			'background': default_style
5011		},
5012		'date' : {
5013			'condition' :
5014				'<div class="items_inner_wrap"><p><input type="radio" name="date_type" class="date_type" value="before"> <select class="regist_date"><option value="3">최근 3일 이내</option><option value="7">최근 7일 이내</option><option value="15">최근 15일 이내</option></select> 등록된 상품</p><p><input type="radio" name="date_type" class="date_type" value="after"> <input  type="text" class="regist_date_custom datepicker" size="10" readonly> <input type="text" class="regist_date_after" size="2"> 이후에 등록된 상품</p></div>',
5015			'txt_use'	: ['1','0','0'],
5016			'date_type'	: 'before',
5017			'regist_date' : '15',
5018			'regist_date_custom': '',
5019			'regist_date_after': '',
5020			'text_arr'	:
5021				['신상','','무료배송'],
5022			'use'		: false,
5023			'decoration': [],
5024			'background': default_icon
5025		},
5026		'empty' : {
5027			'condition' :
5028				'조건없음',
5029			'txt_use'	: ['1','0','0'],
5030			'text_arr'	:
5031				['BEST','{bestnum}위','무료배송'],
5032			'use'		: false,
5033			'decoration': [],
5034			'background': default_style
5035		}
5036	};
5037	var seq = 0;
5038	var target_obj = $('.icon_set_live');
5039	var condition = $('.image_icon_condition', target_obj).val();
5040
5041	if	(condition) {
5042		//저장된 조건이 있을 경우 순서를 재조정 한다
5043		condition = decode_base64_json(condition);
5044		var temp							= {};
5045		var use_cnt							= 0;
5046		$.each(condition, function(key, val){
5047			temp[val['key']]				= image_icon_default_arr[val['key']];
5048			temp[val['key']]['use']			= '';
5049			if	(val['use'] == 1) temp[val['key']]['use'] = 1;
5050			var txt_temp					= [];
5051			var txt_use						= [];
5052			var deco_temp					= [];
5053			$.each(val['contents'], function(k,v){
5054				var deco					= {};
5055				deco.txt_color				= v['txt_color'];
5056				deco.txt_font				= v['txt_font'];
5057				deco.txt_size				= v['txt_size'];
5058				deco.txt_weight				= v['txt_weight'];
5059
5060				deco_temp.push(deco);
5061				txt_use.push(v['use']);
5062				txt_temp.push(v['txt']);
5063			});
5064			temp[val['key']]['decoration']	= deco_temp;
5065			temp[val['key']]['txt_use']		= txt_use;
5066			temp[val['key']]['text_arr']	= txt_temp;
5067			temp[val['key']]['background']	= val['background'];
5068			if	(val['key'] == 'discount_per') {
5069				temp[val['key']]['discount']	= val['discount'];
5070			}else if(val['key'] == 'date'){
5071				temp[val['key']]['date_type']	= val['date_type'];
5072				temp[val['key']]['regist_date'] = val['date'];
5073				temp[val['key']]['regist_date_custom'] = val['date'];
5074				temp[val['key']]['date_after']	= val['date_after'];
5075			}
5076			use_cnt += parseInt(val['use']);
5077		});
5078		image_icon_default_arr				= temp;
5079		$('.icon_condition_cnt', target_obj).text(use_cnt);
5080		$('.image_icon_condition_cnt', target_obj).val(use_cnt);
5081	}
5082	$('.icon_container', parent_obj).html('');
5083	$.each(image_icon_default_arr,function(key, val){
5084		$(".colorpicker",parent_obj).customColorPicker("destroy");
5085		var clone_bak	= $('.icon_detail_bak').clone();
5086		var obj			= $('<ul class="icon_items"><li class="items_li"></li><li class="items_li_2"></li><li class="items_li_3"></li><li class="items_li_4"></li><li class="items_li_5"><input type="hidden" class="background_icon" value="'+val['background']+'" /><div class="sample_icon_wrap hand" onclick="change_icon_background(this);"></div></li></ul>');
5087		var use_chk		= '<label>미노출</label><input type="checkbox" class="use_chk hide" value="'+key+'" onclick="icon_condition_use_chk(this)">';
5088		var css_class	= 'condition_top';
5089
5090		$('.items_li', obj).html('<img src="/admin/skin/default/images/common/icon_move.gif" class="move">');
5091
5092		if (seq == 0) {
5093			use_chk		= '<label>노출</label><input type="checkbox" class="use_chk hide" value="'+key+'" checked onclick="icon_condition_use_chk(this)">';
5094		}else if(seq == 1 || seq == 2){
5095			var checked = '';
5096			if (val['use'] == 1) checked = 'checked';
5097			use_chk		= '<label></label><input type="checkbox" class="use_chk" value="'+key+'" '+checked+' onclick="icon_condition_use_chk(this)">';
5098		}
5099
5100		$('.items_li_2', obj).html(use_chk);
5101
5102		if	(key == 'date' || key == 'discount_per') {
5103			css_class	= 'condition_top2';
5104		}
5105		$('.items_li_3', obj).html('<span class="'+css_class+'">'+val.condition+'</span><span class="condition_bottom">무료배송 상품<span class="helpicon" title="기본배송방법(예:택배)의 기본배송비가 무료일 때입니다." options="{alignX: \'right\'}"></span>');
5106
5107		if	($.inArray(key, ['solo','discount','gift']) > -1) {
5108			$('.items_li_3', obj).find('.event_type').val(key);
5109		}
5110
5111		var span		= $('<span class="condition_top2"></span>');
5112		var span2		= $('<span class="condition_bottom"></span>');
5113
5114		for(i=0; i<3; i++){
5115			var temp_clone = clone_bak;
5116			if	(i == 0) {
5117				temp_clone.find('.txt_use').prop({'disabled':true, 'name':'txt_use_1_'+seq});
5118			}else{
5119				temp_clone.find('.txt_use').prop({'disabled':false, 'name':'txt_use'+seq});
5120			}
5121
5122			if	(i < 2) {
5123				span.append(temp_clone.html());
5124				span.find('.txt_val').eq(i).val(val['text_arr'][i]);
5125				if	(key == 'discount_per' && i == 1) {
5126					span.find('.txt_use').eq(1).prop({'disabled':true}).hide();
5127					span.find('p label').eq(1).append('ㄴ');
5128				}
5129			}else{
5130				span2.append(temp_clone.html());
5131				span2.find('.txt_val').val(val['text_arr'][i]).attr('txt_type','shipping_free');
5132			}
5133		}
5134
5135		$('.items_li_4', obj).append(span).append(span2);
5136
5137		if	(condition) {
5138			if	(key == 'discount_per') {
5139				$('.discount', obj).val(val['discount']);
5140			}else if(key == 'date'){
5141				$('.date_type[value="'+val['date_type']+'"]', obj).prop('checked',true);
5142				if	(val['date_type'] == 'before') {
5143					$('.regist_date', obj).val(val['regist_date']);
5144				}else{
5145					$('.regist_date_custom', obj).val(val['regist_date_custom']);
5146					$('.regist_date_after', obj).val(val['date_after']);
5147				}
5148			}
5149
5150			$('.items_li_4 p', obj).each(function(i){
5151				if	(i > 0)
5152					$('.txt_use' ,this).attr('checked',val['txt_use'][i] == 1 ? true : false);
5153				else
5154					$('.txt_use' ,this).attr('checked',true);
5155
5156				if	(val['decoration'][i]['txt_color'].length > 0)
5157					$('.txt_color' ,this).val(val['decoration'][i]['txt_color']);
5158
5159				if	(val['decoration'][i]['txt_font'].length > 0)
5160					$('.txt_font' ,this).val(val['decoration'][i]['txt_font']);
5161
5162				if	(val['decoration'][i]['txt_size'].length > 0)
5163					$('.txt_size' ,this).val(val['decoration'][i]['txt_size']);
5164
5165				if	(val['decoration'][i]['txt_weight'] == 1)
5166					$('.txt_weight' ,this).addClass('use');
5167			});
5168		}else{
5169			$('.items_li_4 p', obj).each(function(i){
5170				if	(i == 0) $('.txt_use' ,this).attr('checked',true);
5171			});
5172		}
5173
5174		$('.icon_container', parent_obj).append(obj);
5175		$(".colorpicker",parent_obj).customColorPicker();
5176		set_display_image_background();
5177		setDatepicker();
5178		help_tooltip();
5179		seq++;
5180	});
5181
5182	$(".icon_container", parent_obj).sortable({
5183		opacity : 0.5,
5184		beforeStop : function( event, ui ) {
5185			var item_seq = 0;
5186			$('.items_li_2', parent_obj).each(function(){
5187				if	(item_seq == 0) {
5188					$('label', this).text('노출');
5189					$('.use_chk', this).hide().prop('checked',true);
5190					$(this).closest('.icon_items').addClass('use');
5191				}else if(item_seq == 1 || item_seq == 2){
5192					before_chk = $('.use_chk', this).prop('checked');
5193					$('label', this).text('');
5194					$('.use_chk', this).show().prop('checked',before_chk);
5195				}else{
5196					$('label', this).text('미노출');
5197					$('.use_chk', this).hide().prop('checked',false);
5198					$(this).closest('.icon_items').removeClass('use');
5199				}
5200				item_seq++;
5201			});
5202		}
5203	});
5204
5205	$('.use_chk', parent_obj).each(function(){
5206		if	($(this).is(':checked')) $(this).closest('.icon_items').addClass('use');
5207	});
5208
5209	icon_condition_set_all();
5210}
5211
5212function icon_condition_set_all(){
5213	var parent_obj = $('#image_icon_wrap');
5214	$('.icon_items', parent_obj).each(function(){
5215		txt_arr = [];
5216		that = this;
5217		$('.txt_use', that).each(function(i){
5218			txt_obj = {};
5219			if	($(this).prop('disabled') || $(this).is(':checked')) {
5220				txt_parent = $(this).closest('p');
5221				if	($('.txt_val', txt_parent).val()) {
5222					txt_obj.key = $('.use_chk', that).val();
5223					txt_obj.txt = $('.txt_val', txt_parent).val();
5224					txt_obj.txt_color = $('.txt_color', txt_parent).val();
5225					txt_obj.txt_font = $('.txt_font', txt_parent).val();
5226					txt_obj.txt_size = $('.txt_size', txt_parent).val();
5227					txt_obj.txt_weight = $('.txt_weight', txt_parent).hasClass('use');
5228					txt_arr.push(txt_obj);
5229				}
5230			}
5231		});
5232		var background_icon = $('.background_icon', that).val();
5233		if	(txt_arr.length > 0) {
5234			set_condition_icon($('.sample_icon_wrap', that),txt_arr,false,background_icon);
5235		}
5236	});
5237}
5238
5239function icon_condition_use_chk(e){
5240	if	($(e).closest('.icon_items').hasClass('use'))
5241		$(e).closest('.icon_items').removeClass('use');
5242	else
5243		$(e).closest('.icon_items').addClass('use');
5244}
5245
5246function icon_condition_apply(){
5247	var parent_obj = $('#image_icon_wrap');
5248	var data = [];
5249	var seq = 0;
5250	var use_cnt = 0;
5251	$('.icon_items', parent_obj).each(function(){
5252		var sub_data	= {};
5253		var txt_array	= [];
5254		sub_data.key	= $('.use_chk', this).val();
5255		sub_data.use	= '0';
5256		if	($('.use_chk', this).prop('checked')) {
5257			sub_data.use = '1';
5258			use_cnt++;
5259		}
5260
5261		switch(sub_data.key){
5262			case 'discount_per':
5263				sub_data.discount = $('.discount', this).val();
5264			break;
5265			case 'solo':
5266				sub_data.event_type = 'solo';
5267			break;
5268			case 'discount':
5269				sub_data.event_type = 'discount';
5270			break;
5271			case 'gift':
5272				sub_data.event_type = 'gift';
5273			break;
5274			case 'package':
5275				sub_data.package = 1;
5276			break;
5277			case 'date':
5278				sub_data.date_type = $('.date_type:checked', this).val();
5279				if	(sub_data.date_type == undefined) {
5280					$('.date_type:eq(0)', this).prop('checked',true);
5281					sub_data.date_type = 'before';
5282				}
5283				if	(sub_data.date_type == 'before') {
5284					sub_data.date = $('.regist_date', this).val();
5285				}else{
5286					sub_data.date = $('.regist_date_custom', this).val();
5287					sub_data.date_after = $('.regist_date_after', this).val();
5288					if	(sub_data.date == '' || sub_data.date_after == '') {
5289						alert('날짜를 선택해주세요');
5290						return false;
5291					}
5292				}
5293			break;
5294			case 'empty':
5295			break;
5296		}
5297
5298		$('.items_li_4 p', this).each(function(){
5299			var use				= 0;
5300			var that			= this;
5301			var txt_data		= {};
5302			txt_data.key		= $(that).closest('.icon_items').find('.use_chk').val();
5303			txt_data.txt_type	= $('.txt_val', that).attr('txt_type');
5304			if	( $('.txt_use', that).prop('disabled')|| $('.txt_use', that).is(':checked') ) use = 1;
5305			txt_data.use		= use;
5306			txt_data.txt		= '';
5307			if	($('.txt_val', that).val())
5308				txt_data.txt	= $('.txt_val',that).val();
5309			txt_data.txt_color	= $('.txt_color', that).val();
5310			txt_data.txt_font	= $('.txt_font', that).val();
5311			txt_data.txt_size	= $('.txt_size', that).val();
5312			txt_data.txt_weight = $('.txt_weight', that).hasClass('use');
5313			txt_array.push(txt_data);
5314		});
5315
5316		sub_data.contents = txt_array;
5317		sub_data.background = $('.background_icon', this).val();
5318
5319		data[seq] = sub_data;
5320		seq++;
5321	});
5322	var icon_condition = Base64.encode(JSON.stringify(data));
5323	var target_obj = $('.icon_set_live');
5324	$('.image_icon_condition', target_obj).val(icon_condition);
5325	$('.image_icon_type', target_obj).val('condition');
5326	$('.image_icon_condition_cnt', target_obj).val(use_cnt);
5327	$('.use_image_icon', target_obj).change();
5328	$('.icon_type_txt[attr="no"]', target_obj).hide();
5329	$('.icon_type_txt[attr="condition"]', target_obj).show();
5330	$('.icon_condition_cnt', target_obj).text(use_cnt);
5331	/* 이미지 꾸미기 아이콘 조건 선택시 */
5332	sample_icon = $('.goodsDisplayImageTable', target_obj).find('.goodsDisplayImageIcon').clone();
5333	sample_icon.css({'position':'relative','display':'inline'});
5334	$('.image_icon_select', target_obj).hide();
5335	$('.image_icon_select_condition', target_obj).html(sample_icon).show();
5336	closeDialog("displayImageIconPopup");
5337}
5338
5339function get_icon_replace(txt, set_obj){
5340	var ret = txt;
5341	if	(txt) {
5342		var rep = {
5343			'{discount}'	: '10',
5344			'{brand}'		: '퍼스트몰',
5345			'{brandeng}'	: 'firstamll',
5346			'{bestnum}'		: '1'
5347		}
5348		if	(set_obj) rep = set_obj;
5349		$.each(rep,function(k, v){
5350			txt = txt.split(k).join(v);
5351		});
5352		ret = txt;
5353	}
5354	return ret;
5355}
5356
5357function set_condition_icon(target,obj,condition,background_icon){
5358	var cnt				= obj.length;
5359	var background_icon = decode_base64_json(background_icon);
5360	var icon_class		= 'icon_solo';
5361	var icon_class_arr	= ['icon_top','icon_bottom'];
5362	var icon_discount	= ['icon_top_discount','icon_top_discount_per','icon_bottom'];
5363	if	(cnt == 1) icon_class_arr[0] = icon_class;
5364	if	(cnt == 2 && obj[0].key == 'discount_per')
5365		icon_discount	= ['icon_solo_discount','icon_solo_discount_per'];
5366	$(target).html('');
5367	for(i=0; i<cnt; i++){
5368		var txt_obj = $('<span>');
5369		var num_obj = $('<num>');
5370		var txt_css = {
5371			'font-size'		:	'9pt',
5372			'color'			:	'#000000',
5373			'font-weight'	:	''
5374		};
5375
5376		txt_obj.text(get_icon_replace(obj[i].txt, condition));
5377
5378		if	(obj[i].txt_color)
5379			txt_css['color'] = obj[i].txt_color;
5380		if	(obj[i].txt_size)
5381			txt_css['font-size'] = parseInt(obj[i].txt_size)+'pt';
5382		if	(obj[i].txt_font)
5383			txt_css['font-family'] = obj[i].txt_font;
5384		if	(obj[i].txt_weight)
5385			txt_css['font-weight'] = 'bold';
5386
5387		if	(obj[i].key == 'discount_per') {
5388			txt_obj.addClass(icon_discount[i]);
5389		}else{
5390			txt_obj.addClass(icon_class_arr[i]);
5391		}
5392
5393		$(target).append(txt_obj.css(txt_css));
5394	}
5395
5396	if	(background_icon['type'] == 'image') {
5397		$(target).css({'background':'url("/data/icon/goodsdisplay/background/'+background_icon['img']+'") no-repeat center','width':'60px','height':'60px','opacity':'1'});
5398	}else{
5399		var custom_css = {};
5400		custom_css['background'] = '';
5401		custom_css['text-align'] = 'center';
5402		if	(background_icon['width']) {
5403			var width = background_icon['width']+'px';
5404			var left_width = (background_icon['width']*0.6)+'px';
5405			var right_width = background_icon['width']-(background_icon['width']*0.6)+'px';
5406			custom_css['width'] = width;
5407			if	($(target).find('.icon_solo').length > 0 || $(target).find('.icon_top').length > 0) {
5408				$(target).find('.icon_solo').css('width',width);
5409				$(target).find('.icon_top').css('width',width);
5410				$(target).find('.icon_bottom').css('width',width);
5411			}
5412			if	($(target).find('.icon_top_discount').length > 0 || $(target).find('.icon_solo_discount').length > 0) {
5413				$(target).find('.icon_top_discount').css('width',left_width);
5414				$(target).find('.icon_solo_discount').css('width',left_width);
5415				$(target).find('.icon_top_discount_per').css('width',right_width);
5416				$(target).find('.icon_solo_discount_per').css('width',right_width);
5417			}
5418		}
5419
5420		if	(background_icon['height']) {
5421			var height = background_icon['height']+'px';
5422			var half_height = background_icon['height']/2+'px';
5423			custom_css['height'] = height;
5424			if	($(target).find('.icon_solo').length > 0 || $(target).find('.icon_top').length > 0) {
5425				$(target).find('.icon_solo').css({'height':height,'line-height':height});
5426				$(target).find('.icon_top').css({'height':half_height,'line-height':half_height});
5427				$(target).find('.icon_bottom').css({'height':half_height,'line-height':half_height});
5428			}
5429			if	($(target).find('.icon_top_discount').length > 0 || $(target).find('.icon_solo_discount').length > 0) {
5430				$(target).find('.icon_top_discount').css({'height':half_height,'line-height':half_height});
5431				$(target).find('.icon_solo_discount').css({'height':height,'line-height':height});
5432				$(target).find('.icon_top_discount_per').css({'height':half_height,'line-height':half_height});
5433				$(target).find('.icon_solo_discount_per').css({'height':height,'line-height':height});
5434			}
5435		}
5436
5437		if	(background_icon['color'])
5438			custom_css['background-color'] = background_icon['color'];
5439
5440		if	(background_icon['width'])
5441			custom_css['opacity'] = 1-background_icon['opacity']/100;
5442		$(target).css(custom_css);
5443	}
5444}
5445
5446function display_set_border(e){
5447	if	($(e).val() == 'all') {
5448		$('.image_border1_width').prop('readonly',true);
5449		$('.image_border1_width').val($('.image_border_width').val());
5450		$('.img_effect_border_img[attr="all"]').show();
5451		$('.img_effect_border_img[attr="goods"]').hide();
5452	}else{
5453		$('.image_border1_width').prop('readonly',false);
5454		$('.img_effect_border_img[attr="all"]').hide();
5455		$('.img_effect_border_img[attr="goods"]').show();
5456	}
5457}
5458
5459function display_set_border_mobile(e){
5460	if	($(e).val() == 'all') {
5461		$('.img_effect_border_img_m[attr="all"]').show();
5462		$('.img_effect_border_img_m[attr="goods"]').hide();
5463	}else{
5464		$('.img_effect_border_img_m[attr="all"]').hide();
5465		$('.img_effect_border_img_m[attr="goods"]').show();
5466	}
5467}
5468
5469function display_chk_border(e){
5470	if	($('.image_border_type').val() == 'all') $('.image_border1_width').val($(e).val());
5471}
5472
5473function open_decoration_save(e, platform, type){
5474	var parent_obj	= $('#image_deco_favorite');
5475	var title		= '자주쓰는 꾸미기로 등록';
5476
5477	$('.decoraion_favorite').removeClass('decoraion_favorite');
5478	$(e).closest('.goodsDisplayDecorationContainer').addClass('decoraion_favorite');
5479
5480	if	($('.decoration_type[name="'+type+'_type"]:checked',$('.decoraion_favorite')).val() == 'quality') {
5481		type = type.replace(/m_/i,'');
5482		if	(type == 'goods_decoration') title = '자주쓰는 상품정보로 등록';
5483		$('#favorite_type', parent_obj).val(type);
5484		$('#favorite_platform', parent_obj).val(platform);
5485		$('.favorite_date', parent_obj).text('자동');
5486		$('input[name="favorite_title"]', parent_obj).val('');
5487		$('textarea[name="favorite_desc"]', parent_obj).val('');
5488		$('#favorite_act', parent_obj).val('insert');
5489		openDialog(title,'#image_deco_favorite', {'width':'500','show' : 'fade','hide' : 'fade'});
5490	}
5491	var parent_obj2 = $(e).closest('.goodsDisplayDecorationContainer');
5492	if	(type == 'goods_decoration') {
5493		$('#goods_favorite', parent_obj2).trigger("click");
5494		$('#m_goods_favorite', parent_obj2).trigger("click");
5495	}else	{
5496		$('#m_image_favorite', parent_obj2).trigger("click");
5497	}
5498}
5499
5500function open_image_deco_update(e, key, platform, type){
5501	var parent_obj = $('#image_deco_favorite');
5502	$('.decoraion_favorite').removeClass('decoraion_favorite');
5503	$(e).closest('.goodsDisplayDecorationContainer').addClass('decoraion_favorite');
5504
5505	var param = {
5506		'key'		: key,
5507		'type'		: type,
5508		'platform'	: platform
5509	}
5510
5511	$.ajax({
5512		'url'		: '/admin/design/favorite_decorations_info',
5513		'data'		: param,
5514		'type'		: 'post',
5515		'dataType'	: 'json',
5516		'success'	: function(res){
5517			date_txt = res[0].favorite_regist
5518			if	(res[0].favorite_update) {
5519				date_txt += ' ('+res[0].favorite_update+')';
5520			}
5521			$('.favorite_date', parent_obj).text(date_txt);
5522			$('input[name="favorite_title"]', parent_obj).val(res[0].favorite_title);
5523			$('textarea[name="favorite_desc"]', parent_obj).val(res[0].favorite_desc);
5524			$('#favorite_act', parent_obj).val('update');
5525			$('#favorite_key', parent_obj).val(res[0].favorite_key);
5526			if	(res[0].default == '1') {
5527				$('input[name="favorite_title"]', parent_obj).prop('readonly',true);
5528				$('textarea[name="favorite_desc"]', parent_obj).prop('readonly',true);
5529			}else{
5530				$('input[name="favorite_title"]', parent_obj).prop('readonly',false);
5531				$('textarea[name="favorite_desc"]', parent_obj).prop('readonly',false);
5532			}
5533			openDialog('자주쓰는 꾸미기 정보','#image_deco_favorite', {'width':'500','show' : 'fade','hide' : 'fade'});
5534		}
5535	});
5536}
5537
5538function image_deco_favorite_save(){
5539	var parent_obj		= $('#image_deco_favorite');
5540	var display_seq		= $('input[name="display_seq"]').val();
5541	var decoration		= $('input.image_decoration', '.decoraion_favorite').val();
5542	var text_align		= $('input.text_align:checked', '.decoraion_favorite').val();
5543	var favorite_desc	= $('textarea[name="favorite_desc"]', parent_obj).val();
5544	var favorite_title	= $('input[name="favorite_title"]', parent_obj).val();
5545	var favorite_type	= $('#favorite_type', parent_obj).val();
5546	var favorite_act	= $('#favorite_act', parent_obj).val();
5547	var favorite_key	= $('#favorite_key', parent_obj).val();
5548	var result_txt		= '추가되었습니다.';
5549	var platform		= $('#favorite_platform').val();
5550
5551	if	(!favorite_title || favorite_title == '') {
5552		alert('타이틀은 필수 입니다');
5553		return;
5554	}
5555
5556	if	(favorite_type == 'image_decoration') {
5557		if	(!decoration || decoration == '') {
5558			alert('저장할 설정값이 없습니다');
5559			return;
5560		}
5561		text_align = '';
5562	}else{
5563		var decoration_temp = [];
5564
5565		$('.info_setting', '.decoraion_favorite').each(function(){
5566			decoration_arr = $(this).val().replace(/\"{/g,'{');
5567			decoration_arr = decoration_arr.replace(/}\"/g,'}');
5568			if	($(this).val()) decoration_temp.push(decoration_arr);
5569		});
5570
5571		decoration = '['+decoration_temp.join(',')+']';
5572	}
5573
5574	if	($('.decoraion_favorite').hasClass('mobile_tab')) {
5575		display_seq = $('input[name="m_display_seq"]').val();
5576	}
5577
5578	var param = {
5579		'favorite_type' : favorite_type,
5580		'platform'		: platform,
5581		'display_seq'	: display_seq,
5582		'decoration'	: decoration,
5583		'favorite_desc'	: favorite_desc,
5584		'favorite_title': favorite_title,
5585		'favorite_act'	: favorite_act,
5586		'favorite_key'	: '',
5587		'text_align'	: text_align
5588	}
5589
5590	if	(favorite_act != 'insert') {
5591		param['favorite_key']	= favorite_key;
5592		result_txt				= '수정되었습니다.';
5593	}
5594
5595	$.ajax({
5596		'url'		: '/admin/design_process/favorite_decorations_save',
5597		'data'		: param,
5598		'type'		: 'post',
5599		'success'	: function(res){
5600			$('.decoraion_favorite').find('.decoration_favorite[platform="'+platform+'"][favorite_type="'+favorite_type+'"]').attr('json',res);
5601			set_decoration_favorite();
5602			$('textarea[name="favorite_desc"]').val('');
5603			$('input[name="favorite_title"]').val('');
5604			alert(result_txt);
5605			closeDialog('image_deco_favorite');
5606		}
5607	});
5608}
5609
5610function open_image_deco_delete(e, key, platform, type){
5611	$.ajax({
5612		'url'		: '/admin/design_process/favorite_decorations_save',
5613		'data'		: {'favorite_key':key, 'favorite_act': 'delete', 'platform':platform, 'favorite_type':type},
5614		'type'		: 'post',
5615		'success'	: function(res){
5616			$(e).closest('.decoration_favorite').attr('json',res);
5617			set_decoration_favorite();
5618			$('textarea[name="favorite_desc"]').val('');
5619			$('input[name="favorite_title"]').val('');
5620			alert('삭제되었습니다.');
5621			closeDialog('image_deco_favorite');
5622		}
5623	});
5624}
5625
5626function img_deco_favorite_copy(e, platform, type){
5627	var parent_obj = $(e).closest('.goodsDisplayDecorationContainer');
5628
5629	if	(type == 'image_decoration') {
5630		if	($('.decoration_type[name="image_decoration_type"]:checked', parent_obj).val() == 'favorite' || $('.decoration_type[name="m_image_decoration_type"]:checked', parent_obj).val() == 'favorite') {
5631			var decoration = $(e).attr('decoration');
5632
5633			$(".goodsDisplayImageWrap",parent_obj).data("decorationLoaded",false);
5634			$(".goodsDisplayImageWrap",parent_obj).attr("decoration",decoration);
5635			$(".goodsDisplayImageWrap",parent_obj).data("decoration",decode_base64_json(decoration));
5636			$("input.image_decoration",parent_obj).val(decoration);
5637			$("#image_quality",parent_obj).trigger("click");
5638			$("#m_image_quality",parent_obj).trigger("click");
5639
5640			goods_display_decoration_reset(parent_obj, platform);
5641			set_goods_display_decoration($(".goodsDisplayImageWrap", parent_obj));
5642			alert('해당 자주쓰는 꾸미기 정보가 고급설정으로 복사되었습니다.');
5643		}
5644	}else{
5645		if	($('.decoration_type[name="goods_decoration_type"]:checked', parent_obj).val() == 'favorite' || $('.decoration_type[name="m_goods_decoration_type"]:checked', parent_obj).val() == 'favorite') {
5646			var decoration = $(e).attr('decoration');
5647			var text_align = $(e).attr('text_align');
5648			$('.info_settings', parent_obj).val(decoration);
5649			$('.text_align[value="'+text_align+'"]', parent_obj).prop('checked', true);
5650			$('.info_item_container', parent_obj).html('');
5651			set_info_item_data(parent_obj);
5652			$("#goods_quality",parent_obj).trigger('click');
5653			$("#m_goods_quality",parent_obj).trigger('click');
5654
5655			alert('해당 자주쓰는 상품정보가 고급설정으로 복사되었습니다.');
5656		}
5657	}
5658}
5659
5660function set_decoration_favorite(){
5661	$('.decoration_favorite').each(function(){
5662		var favorite_type		= $(this).attr('favorite_type');
5663		var custorm_json		= $(this).attr('json');
5664		var use_key				= $(this).attr('use_key');
5665		var ul					= $('<ul class="favorite_ul"></ul>');
5666		var goodsinfo			= $('.goodsDisplayImageWrap').attr('goodsinfo');
5667		var this_platform		= $(this).attr('platform');
5668
5669		if	(custorm_json && custorm_json != 'e30=' ) {
5670			if	(favorite_type == 'image_decoration') {
5671				var favorite_key_name	= 'image_decoration_favorite_key';
5672				custorm_json = JSON.parse(Base64.decode(custorm_json));
5673
5674				$.each(custorm_json,function(k, v){
5675					if	(v.platform == 'mobile') favorite_key_name = 'm_image_decoration_favorite_key';
5676					var li = $('<li class="favorite_li">');
5677					var default_top = $('<div class="favorite_top"><span class="btn small gray"><input type="button" value="정보" onclick="open_image_deco_update(this, \''+v.favorite_key+'\', \''+v.platform+'\', \'image_decoration\')"></span> <span class="btn small delete_btn"><input type="button" value="삭제" onclick="open_image_deco_delete(this, \''+v.favorite_key+'\', \''+v.platform+'\', \'image_decoration\')"></span></div>');
5678					var default_img = $('<div class="favorite_wrap" onclick="img_deco_favorite_use(this)"><div class="goodsDisplayItemWrap"><span class="goodsDisplayImageWrapFavorite" version="display_edit" decoration="'+v.decoration+'" goodsinfo="'+goodsinfo+'"><input type="radio" name="'+favorite_key_name+'" value="'+v.favorite_key+'" class="hide decoration_favorite_chk"><img src="/admin/skin/default/images/design/img_effect_sample.gif" class="sample_img goodsDisplayImage"><div class="goodsDisplayBottomFuncWrap"><div class="goodsDisplayBottomFunc"><div class="display_quickview" onclick=""><img src="/data/icon/goodsdisplay/preview/thumb_quickview.png" alt="미리보기" /></div><div class="display_option" onclick="" goods_seq="1"><img src="/data/icon/goodsdisplay/preview/thumb_option.png" alt="옵션보기" /><div class="hide display_opt_bak"></div></div><div class="display_send" onclick="display_goods_send(this,\'bottom\')"><img src="/data/icon/goodsdisplay/preview/thumb_send.png" alt="SNS보내기" /></div><div class="display_zzim" onclick=""><img src="/data/icon/goodsdisplay/preview/thumb_zzim_off.png" class="zzimOffImg" alt="찜하기" /></div></div></div></div></span></div>');
5679					var default_bottom = $('<div class="favorite_bottom" onclick="img_deco_favorite_copy(this, \''+v.platform+'\', \'image_decoration\')">↓고급설정으로 복사</div>');
5680					if	(v.default == "1") default_top.find('.delete_btn').remove();
5681					default_bottom.attr('decoration',v.decoration);
5682					default_img.attr('decoration',v.decoration);
5683					li.html(default_top).append(default_img).append(default_bottom);
5684					ul.append(li);
5685				});
5686
5687				$(this).html(ul);
5688
5689				if	(use_key) {
5690					var use_obj = $('.decoration_favorite_chk[value="'+use_key+'"]', this);
5691					use_obj.click();
5692					use_obj.closest('.favorite_wrap').addClass('use');
5693				}
5694
5695				$('.decoration_type:checked').click();
5696
5697				var objBxSlider = $('.favorite_ul', this).bxSlider({
5698					minSlides: 2,
5699					maxSlides: 4,
5700					slideWidth: '150',
5701					slideMargin: 5,
5702					infiniteLoop: false,
5703					hideControlOnEnd: true,
5704					pager: 0
5705				});
5706				$('.favorite_ul', this).data("objBxSlider", objBxSlider);
5707
5708				set_goods_display_decoration($(".goodsDisplayImageWrapFavorite", this));
5709				if	(this_platform != 'mobile') {
5710					set_goods_display_decoration_event($(".goodsDisplayImageWrapFavorite", this));
5711				}
5712			}else{
5713				var favorite_key_name	= 'goods_decoration_favorite_key';
5714				custorm_json = JSON.parse(Base64.decode(custorm_json));
5715				kind_obj = {};
5716				$('.info_item_kind:eq(0) > option').each(function(){
5717					kind_obj[$(this).val()] = $(this).text();
5718				});
5719
5720				$.each(custorm_json, function(k, v){
5721					if	(v.platform == 'mobile') favorite_key_name = 'm_goods_decoration_favorite_key';
5722					var li = $('<li class="favorite_li">');
5723					var default_top = $('<div class="favorite_top"><span class="btn small gray"><input type="button" value="정보" onclick="open_image_deco_update(this, \''+v.favorite_key+'\', \''+v.platform+'\', \'goods_decoration\')"></span> <span class="btn small delete_btn"><input type="button" value="삭제" onclick="open_image_deco_delete(this, \''+v.favorite_key+'\', \''+v.platform+'\', \'goods_decoration\')"></span></div>');
5724					var default_img = $('<div class="favorite_wrap" onclick="img_deco_favorite_use(this)"><input type="radio" name="'+favorite_key_name+'" value="'+v.favorite_key+'" class="hide decoration_favorite_chk" /><div class="goods_info_area"></div></div>');
5725					var default_bottom = $('<div class="favorite_bottom" onclick="img_deco_favorite_copy(this, \''+v.platform+'\', \'goods_decoration\')">↓고급설정으로 복사</div>');
5726					if	(v.default == "1") default_top.find('.delete_btn').remove();
5727					default_bottom.attr({'decoration':v.decoration,'text_align':v.text_align});
5728					default_img.attr('decoration',v.decoration);
5729					var decoraion	= JSON.parse(v.decoration);
5730					var text		= '';
5731					var txt_obj		= '';
5732					var txt_css		= {};
5733					$.each(decoraion, function(info_key, info_val){
5734						txt_obj = $('<p>');
5735						txt_css = {};
5736						text	= kind_obj[info_val.kind];
5737
5738						if	(info_val.font_decoration) {
5739							if	(info_val.font_decoration.color)
5740								txt_css['color'] = info_val.font_decoration.color;
5741							if	(info_val.font_decoration.size)
5742								txt_css['font-size'] = info_val.font_decoration.size+'pt';
5743							if	(info_val.font_decoration.bold)
5744								txt_css['font-weight'] = info_val.font_decoration.bold;
5745							if	(info_val.font_decoration.font)
5746								txt_css['font-family'] = info_val.font_decoration.font;
5747							if	(info_val.font_decoration.underline)
5748								txt_css['text-decoration'] = info_val.font_decoration.underline;
5749						}
5750						if	(info_val.wrapper && typeof info_val.wrapper === "string")
5751							text = info_val.wrapper.substring(0,1)+text+info_val.wrapper.substring(1,2);
5752
5753						txt_obj.html(text);
5754
5755						txt_css['text-align'] = v.text_align;
5756						$('.goods_info_area', default_img).append(txt_obj.css(txt_css));
5757					});
5758					li.html(default_top).append(default_img).append(default_bottom);
5759					ul.append(li);
5760				});
5761
5762				$(this).html(ul);
5763
5764				if	(use_key) {
5765					var use_obj = $('.decoration_favorite_chk[value="'+use_key+'"]', this);
5766					use_obj.click();
5767					use_obj.closest('.favorite_wrap').addClass('use');
5768				}
5769
5770				var objBxSlider = $('.favorite_ul', this).bxSlider({
5771					minSlides: 2,
5772					maxSlides: 4,
5773					slideWidth: '150',
5774					slideMargin: 5,
5775					infiniteLoop: false,
5776					hideControlOnEnd: true,
5777					pager: 0
5778				});
5779				$('.favorite_ul', this).data("objBxSlider", objBxSlider);
5780			}
5781		}else if (custorm_json != 'W10=') {
5782			$(this).html('');
5783		}
5784	});
5785}
5786
5787function img_deco_favorite_use(e){
5788	$(e).closest('ul').find('.favorite_wrap').removeClass('use');
5789	$(e).addClass('use');
5790	$('.decoration_favorite_chk', e).attr('checked',true);
5791}
5792
5793// ga4 select_item 호출
5794function ga4_select_item(seq){
5795    if (seq != '' && seq != null && typeof seq != 'undefined' && typeof gtag != 'undefined') {
5796        $.ajax({
5797            url: "/goods/now_goods",
5798            data: {'seq' : seq},
5799            dataType: 'json',
5800            type: 'POST',
5801            success: function (res) {
5802                if (res == 0) {
5803                    return false;
5804                } else {
5805                    gtag("event", "select_item", {
5806                        items: res
5807                      });    
5808                }
5809            },error: function (xhr) {
5810                console.log('GA4 select_item 이벤트 호출 ajax 에러',xhr.responseText);
5811            } 
5812        });
5813    }
5814
5815}

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.