<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="web/common/layout/DefaultLayoutWeb">
<!--
 *******************************************************************************
 * @source  : GoodsDetailFormWeb.html
 * @desc	: 딜 상품상세 Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE		 AUTHOR		 DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.03.02   eskim	   최초 작성
 *******************************************************************************
 -->
<body>
<th:block layout:fragment="content">
<script src="/ux/pc/js/ion.rangeSlider.min.js"></script>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>
<script type="text/javascript" th:src="${@environment.getProperty('naverPay.button.pc.js.url')}" src="" charset="UTF-8"></script>
<script type="text/javascript" src="https://wcs.naver.net/wcslog.js"></script>

<form id="nPayForm" name="nPayForm"></form>
<form id="nPayWishForm" name="nPayWishForm" method="get">
	<input type="hidden" name="SHOP_ID" />
	<input type="hidden" name="ITEM_ID" />
</form>
<div id="container" class="container pd deal" th:with="imgGoodsUrl=${@environment.getProperty('upload.goods.view')}, uxImgUrl=${@environment.getProperty('domain.uximage')}, imgUrl=${@environment.getProperty('upload.image.view')}">
	<div class="wrap">
		<!-- 상품 대표설명 -->
		<div class="content pd_detail">
			<div class="cont_head">
				<h3 class="sr-only">상품 대표설명</h3>
			</div>
			<div class="cont_body">
				<!-- CONT-BODY -->
				<div class="item_detail">
					<div class="area_pic">
						<div class="thumb_nav_wrap"  th:if="${goodsImgList != null and !goodsImgList.empty}" >
							<div class="thumbnav">
									<div class="swiper-container">
										<div class="swiper-wrapper">
										<th:block th:each="goodsImg, status : ${goodsImgList}">
											<div class="swiper-slide" th:classappend="${status.first}? 'on' : ''" 
													th:if="${ not (#strings.contains(goodsImg.sysImgNm,'_F1.') 
															or #strings.contains(goodsImg.sysImgNm,'_L1.')
															or #strings.contains(goodsImg.sysImgNm,'_L2.'))}">
											<a th:href="${'#navLocate'+ status.count}"><span class="thumb"><img th:src="${imgGoodsUrl+'/'+goodsImg.sysImgNm+'?RS=48'}" alt="" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'"></span></a></div>
										</th:block>	
										</div>
									</div>
									<div class="swiper-button-next"></div>
									<div class="swiper-button-prev"></div>
								</div>
						</div>
						<div class="thumb_list_wrap"  th:if="${goodsImgList != null and !goodsImgList.empty}" >
							<ul>
								<th:block th:each="goodsImg, status : ${goodsImgList}">
								<li th:id="${'navLocate'+ status.count}"  th:classappend="${status.first}? 'on' : ''" 
									th:if="${ not (#strings.contains(goodsImg.sysImgNm,'_F1.') 
												or #strings.contains(goodsImg.sysImgNm,'_L1.')
												or #strings.contains(goodsImg.sysImgNm,'_L2.'))}">
									<a href="javascript:void(0);"><span class="thumb"><img th:src="${imgGoodsUrl+'/'+goodsImg.sysImgNm+'?RS=558'}" alt="" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'"></span></a></li>
								</th:block>
							</ul>
						</div>
					</div>
					<form name="cartForm" id="cartForm" method="post">
					<input type="hidden" name="mode">
					<input type="hidden" name="goodsCd" th:value="${params.goodsCd}" />
					<input type="hidden" name="contentsLoc" th:value="${params.contentsLoc}" />
					<input type="hidden" name="ithrCd"  th:value="${params.ithrCd}" />
					<input type="hidden" name="planDtlSq" th:value="${params.planDtlSq}" />
					<input type="hidden" name="adminYn" th:value="${params.adminYn}" />
					<input type="hidden" name="optCd" />
					<input type="hidden" name="optCd1" />
					<input type="hidden" name="optCd2" />
					<input type="hidden" name="addPrice" />
					<input type="hidden" name="ordQty" />
					<input type="hidden" name="stock" />
					<input type="hidden" name="minOrdQty"/>
					<input type="hidden" name="maxOrdQty"/>
					<input type="hidden" name="goodsType" th:value="${goodsInfo.goodsType}"/>
					<input type="hidden" name="selfGoodsYn" th:value="${goodsInfo.selfGoodsYn}"/>
					<div class="area_desc">
						<div class="desc_wrap">
							<div class="timer_box" style="display:none;">
								<p>
									<span class="tit">남은시간</span>
									<span class="timer">
										<em id="d-days">0</em>
										<em id="d-hours">0</em>
										<em id="d-minutes">0</em>
										<em id="d-seconds">0</em>
									</span>
								</p>
							</div>
							<div class="descript_box">
								<div class="desc_top">
									<div class="shareSet">
										<button class="btn_share" data-name="openShare">공유하기</button>
										<th:block th:include="~{web/goods/GoodsIncludeFormWeb :: goodsSnsForm}"></th:block>
									</div>
									<button type="button" class="itemLike" th:classappend="${goodsInfo.wishYn == 'Y'}? 'likeit' : ''"  onclick="cfnPutWishList(this);" th:attr="goodsCd=${params.goodsCd}, goodsNm=${goodsInfo.goodsFullNm}, ithrCd=${params.ithrCd}, contentsLoc=${params.contentsLoc}, planDtlSq=${params.planDtlSq}">관심상품 추가</button>
								</div>
								<div class="desc_info">
									<div class="title_blk">
										<span class="comment" th:text="${goodsInfo.goodsTnm}">
											#본사 직영 인기캐주얼 특가전
										</span>
										<span class="name" th:text="${goodsInfo.goodsFullNm}">
											[NBA외] 본사 직영~ 봄 신상 야구모자/백팩 외 99종 무료배송!
										</span>
									</div>
									<div class="price_blk">
										<span class="sale_price">
											<em th:text="${#numbers.formatInteger(goodsInfo.currPrice, 0,'COMMA')}">134,100</em>원 ~ 
										</span>
										<button type="button" id="btn_saleCoupon_pop" class="btn btn_primary btn_sm btn_coupon"  th:if="${goodsCouponList != null and !goodsCouponList.empty}" th:onclick="cfGoodsCouponInfo([[${goodsInfo.goodsCd}]],[[${goodsInfo.goodsType}]] )"><span>쿠폰받기</span></button>
									</div>
								</div>
							</div>
							<div class="benefit_box" th:if="${(cardInfoList != null and !cardInfoList.empty) or
																(goodsCouponList != null and !goodsCouponList.empty)
															}" >
								<dl>
									<div class="bnf_shopping" th:if="${(goodsCouponList != null and !goodsCouponList.empty) or
																		(tmtbList != null and !tmtbList.empty) or
																		(freeGoodsList != null and !freeGoodsList.empty)  or 
																		(goodsCoupon1List != null and !goodsCoupon1List.empty)}" >
										<dt>쇼핑혜택</dt>
											<dd>
												<span th:if="${(goodsCoupon1List != null and !goodsCoupon1List.empty)}">
												<th:block th:each="goodsCoupon, status : ${goodsCoupon1List}" th:if="${status.first}">
													<em class="c_primary" >
													<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
													<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
													</em>
													 즉시할인
												</th:block>
												</span>
												<span th:if="${goodsCouponList != null and !goodsCouponList.empty}">
												<th:block th:each="goodsCoupon, status : ${goodsCouponList}" th:if="${status.first}">
												최대 <em class="c_primary" >
													<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
													<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
												</em> 쿠폰 할인
												</th:block>
												</span> 
												<span th:if="${tmtbList != null and !tmtbList.empty}">
												<th:block th:each="tmtb, status : ${tmtbList}" th:if="${status.first}">
												<em class="c_primary"><th:block th:text="${#numbers.formatInteger(tmtb.sectionVal, 0,'COMMA')}"></th:block><th:block th:text="${(tmtb.sectionGb == 'G810_10')? '개':'금액'}"></th:block></em> 이상 구매 시 
												<em class="c_primary"><th:block th:text="${#numbers.formatInteger(tmtb.dcVal, 0,'COMMA')}"></th:block><th:block th:text="${(tmtb.dcWay == 'G240_10')? '원':'%'}"></th:block></em></em> 할인
												</th:block>
												</span>
												<span th:if="${freeGoodsList != null and !freeGoodsList.empty}">
												<th:block th:each="freeGoods, status : ${freeGoodsList}" th:if="${status.first}">
												<th:block th:text="${freeGoods.goodsNm}"></th:block> 증정 <th:block th:if="${freeGoods.allYn == 'Y'}" th:text="${'외 택1'}"></th:block></th:block></span>
												<button type="button" id="btn_bnfShopping_pop" class="btn_popup" th:onclick="cfGoodsShopBenefitInfo([[${goodsInfo.goodsCd}]])"><span>자세히</span></button>
											</dd>
									</div>
									<div class="bnf_card" th:if="${cardInfoList != null and !cardInfoList.empty}">
										<dt>카드혜택</dt>
										<dd>
											<th:block th:each="cardInfo, status : ${cardInfoList}">
											<span th:if="${cardInfo.prmtGb == 'A' and cardInfo.dcGb != '3'}"><th:block th:text="${cardInfo.prmtTargetNm}"></th:block> <em class="c_primary"><th:block th:text="${#numbers.formatInteger(cardInfo.dcVal, 0,'COMMA')+ cardInfo.dcWayNm}"></th:block></em> <th:block th:text="${cardInfo.prmtGbNm}"></span>
											<span th:if="${cardInfo.prmtGb == 'A' and cardInfo.dcGb == '3'}" th:text="${cardInfo.prmtNm}">프로모션명</span>
											<span th:if="${cardInfo.prmtGb == 'B'}">신용카드 무이자 혜택</span>
											</th:block>
											<button type="button" id="btn_bnfCard_pop" class="btn_popup" onclick="cfCardInfo();return false;"><span>자세히</span></button>
										</dd>
									</div>
								</dl>
							</div>
							<div class="option_box">
								<div class="opt_select">
									<div class="form_field">
										<div class="select_custom deal_opt_item">
											<div class="combo">
												<div class="select">
													<div class="item_prod">
														<div class="item_state">
															<a href="javascript:void(0);" class="itemLink">
																<div class="itemPic">
																	<img alt="" class="vLHTC pd_img" th:src="${imgGoodsUrl+'/'+goodsInfo.sysImgNm+'?RS=285'}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'">
																</div>
																<div class="itemName">상품선택</div>
															</a>
														</div>
													</div>
												</div>
												<ul class="list" th:if="${goodsDealComposeList  != null and !goodsDealComposeList.empty}">
													<th:block th:each="goodsInfo, status : ${goodsDealComposeList}" >
													<li th:onclick="fnOption1('Up', [[${goodsInfo.compsGoodsCd}]], [[${goodsInfo.currPrice}]] , [[${goodsInfo.selfGoodsYn}]]);"
															th:attr="aria-disabled=${(goodsInfo.goodsStat != 'G008_90' or goodsInfo.stockQty <= 0)? 'true':''}, data-soldout=${(goodsInfo.stockQty <= 0)? 'true':''}">
														<div class="item_prod">
															<div class="item_state" >
																<a href="javascript:void(0);" class="itemLink" >
																	<div class="itemPic">
																		<img alt="" class="vLHTC pd_img" th:src="${imgGoodsUrl+'/'+goodsInfo.sysImgNm+'?RS=285'}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'">
																	</div>
																	<p class="itemBrand" th:text="${goodsInfo.brandGroupNm}">NBA 키즈</p>
																	<div class="itemName" ><span class="tit_option" th:text="${'[상품'+status.count+']'}">[상품1]</span><th:block th:text="${goodsInfo.goodsFullNm}"></th:block></div>
																	<p class="itemPrice" ><th:block th:text="${#numbers.formatInteger(goodsInfo.currPrice, 0,'COMMA')}"> 134,100</th:block>
																		<span class="itemPrice_original" th:if="${goodsInfo.listPrice > goodsInfo.currPrice}" th:text="${#numbers.formatInteger(goodsInfo.listPrice, 0,'COMMA')}">149,000</span>
																		<span class="itemPercent" th:if="${goodsInfo.dcRate > 0}" th:text="|${#numbers.formatDecimal(goodsInfo.dcRate,0,0)}%|">30%</span>
																	</p>
																</a>
																<input type="hidden" name="selectGoods" th:attr="goodsNm=${'[상품'+status.count+']' +goodsInfo.goodsFullNm}, currPrice=${goodsInfo.currPrice}, goodsCd=${goodsInfo.compsGoodsCd}" />
															</div>
														</div>
													</li>
													</th:block> 
												</ul>
											</div>
										</div>
									</div>
									<div class="form_field" id="form_field1_Up">
										<div class="select_custom deal_opt1" disabled>
											<div class="combo">
												<div class="select">옵션1선택</div>
												<ul class="list" id="goodsDealOptUp1">
													<!--  옵션 1 -->
												</ul>
											</div>
										</div>
									</div>
									<div class="form_field" id="form_field2_Up">
										<div class="select_custom deal_opt2" disabled>
											<div class="combo">
												<div class="select">옵션2선택</div>
												<ul class="list" id="goodsDealOptUp2">
													<!--  옵션 2 -->
												</ul>
											</div>
										</div>
									</div>
								</div>
								<div class="opt_result">
								</div>
							</div>
							<div class="price_box" style="display:none;">
								<p class="number">
									총&nbsp;<span id="goodsTotalQty">0</span>개
								</p>
								<p class="price">
									<span>
										<b id="goodsTotalPrice">0</b><em>원</em>
									</span>
								</p>
							</div>
							<div class="btn_box">
								<div class="btn_group_block ui_row">
								<th:block  th:if="${goodsInfo.stockQty > 0 and goodsInfo.goodsStat == 'G008_90'}">
									<div class="ui_col_6">
										<button type="button" class="btn btn_dark btn_block" id="btnGoodsWish" onclick="fnAddCart('C','Up');"><span>쇼핑백</span></button>
									</div>
									<div class="ui_col_6">
										<button type="button" class="btn btn_primary btn_block" id="btnGoodsCart" onclick="fnAddCart('O','Up');"><span>바로구매</span></button>
									</div>
								</th:block>
								<th:block  th:unless="${goodsInfo.stockQty > 0 and goodsInfo.goodsStat == 'G008_90'}">
									<div class="ui_col_12">
										<button type="button" class="btn btn_dark btn_block" disabled=""><span>SOLD OUT</span></button>
									</div>
								</th:block>
								</div>
							</div>
							<th:block th:if="${sessionInfo != null and (sessionInfo.custId == 'xodud1202' or sessionInfo.custId == 'jsh77b' or sessionInfo.custId == 'card007')}">
								<div style="margin-top:10px;">
									<th:block th:with="buttonKey=${@environment.getProperty('naverPay.button.key')}">
										<script th:inline="javascript">
											if(!wcs_add) var wcs_add = {};
											wcs_add["wa"] = "[[${@environment.getProperty('naverPay.common.certification.key')}]]";
											wcs.inflow("style24.com");
											wcs_do();
										</script>

										<script type="text/javascript" >
											//<![CDATA[
											/*버튼설정*/
											naver.NaverPayButton.apply({
												BUTTON_KEY              : "[[${buttonKey}]]",       // 네이버페이에서 제공받은 버튼 인증 키 입력
												TYPE                    : "C",                      // 버튼 모음 종류 설정
												COLOR                   : 1,                        // 버튼 모음의 색 설정
												COUNT                   : 2,                        // 버튼 개수 설정. 구매하기 버튼만 있으면(장바구니 페이지) 1, 찜하기 버튼도 있으면(상품 상세 페이지) 2를 입력.
												ENABLE                  : "Y",                      // 품절 등의 이유로 버튼 모음을 비활성화할 때에는 "N" 입력
												BUY_BUTTON_HANDLER      : buy_nc,                   // 구매하기 버튼 이벤트 Handler 함수 등록, 품절인 경우 not_buy_nc 함수 사용
												WISHLIST_BUTTON_HANDLER : wishlist_nc,              // 찜하기 버튼 이벤트 Handler 함수 등록
												"":""
											});

											/*네이버구매하기*/
											function buy_nc() {
												// 자사 일반 상품 정보
												let compsList = [];

												$("#cartForm .result_item input[name=cea]").each(function() {
													let dealGoodsCd = "[[${goodsInfo.goodsCd}]]";
													let goodsType = "[[${goodsInfo.goodsType}]]";
													let goodsCd = $(this).parent().find("input[name=coption]").attr("goodscd");
													let optCd = $(this).attr("optcd");
													let goodsQty = $(this).val();

													if (!goodsCd) {
														mcxDialog.alert("상품정보가 존재하지 않습니다. 새로고침 후 다시 시도해주세요.");
														return false;
													}

													if (!goodsQty || goodsQty < 1) {
														mcxDialog.alert("구매 수량을 확인해주세요.");      /*수량*/
														return false;
													}

													if (!optCd) {
														mcxDialog.alert("상품 옵션을 확인 할 수 없습니다. 새로고침 후 다시 시도해주세요.");   /*옵션*/
														return false;
													}

													var obj = new Object();
													obj.cartGb = "N";
													obj.goodsType = goodsType;
													obj.goodsCd = goodsCd;
													obj.optCd = optCd;
													obj.goodsQty = goodsQty;
													obj.dealGoodsCd = $("#cartForm  input[name=goodsCd]").val();
													obj.afLinkCd =$("#cartForm  input[name=afLinkCd]").val();
													obj.ithrCd =$("#cartForm  input[name=ithrCd]").val();
													obj.contentsLoc =$("#cartForm  input[name=contentsLoc]").val();
													obj.planDtlSq = $("#cartForm  input[name=planDtlSq]").val();
													compsList.push(obj);
												});

												// 장바구니담기
												cfnAddCart(compsList);

												return false;
											}

											<!-- 구매불가 -->
											function not_buy_nc() {
												mcxDialog.alert("죄송합니다. 네이버페이로 구매가 불가한 상품입니다.");
												return false;
											}
											
											<!-- 찜하기 -->
											function wishlist_nc() {
												let goodsCd			= "[[${goodsInfo.goodsCd}]]";
												let goodsNm			= "[[${goodsInfo.goodsNm}]]";
												let colorCd			= "[[${goodsInfo.colorCd}]]";
												let currPrice		= "[[${goodsInfo.currPrice}]]";
												let sysImgNm		= "[[${goodsInfo.sysImgNm}]]";
												let selfGoodsYn		= "[[${goodsInfo.selfGoodsYn}]]";
												
												let data = {};
												data.goodsCd		= goodsCd;
												data.goodsNm		= goodsNm;
												data.colorCd		= colorCd;
												data.currPrice		= currPrice;
												data.sysImgNm		= sysImgNm;
												data.selfGoodsYn	= selfGoodsYn;
												
												let jsonData = JSON.stringify(data);
												
												$.ajax( {
													type		: "POST",
													url 		: "/pg/create/npay/zzim",
													dataType 	: 'json',
													data		: jsonData,
													beforeSend : function(xhr, settings) {
														xhr.setRequestHeader("AJAX"			, "true");
														xhr.setRequestHeader('Accept'		, 'application/json');
														xhr.setRequestHeader('Content-Type'	, 'application/json');
													},
													error: function(xhr, status, error) {
														mcxDialog.alert(status + '; ' + error);
													},
													success : function(result) {
														if (result.state == "success") {
															$('#nPayWishForm input[name=SHOP_ID]').val(result.shopId);
															$('#nPayWishForm input[name=ITEM_ID]').val(result.itemId);

															let option = 'width=530, height=380';
															window.open('about:blank', 'popupView', option);
															document.nPayWishForm.target = 'popupView';
															document.nPayWishForm.action = result.action;
															document.nPayWishForm.submit();
														} else {
															mcxDialog.alert(result.message);
														}
													}
												});
											}
											//]]>
										</script>
									</th:block>
								</div>
							</th:block>
						</div>
					</div>
					</form>
				</div>
			</div>
		</div>
		<!-- 상품 대표설명 -->
		
		<!-- //***** 상품소개영역 ***** -->
		<th:block th:include="~{web/goods/GoodsIncludeFormWeb :: goodsDealComposeForm}"></th:block>
		
		<!-- 이 상품과 함께 본 상품 -->
		<div class="content wide pd_clickother" id="goodsTogetherbArea" th:if="${togetherGoodsList != null and !togetherGoodsList.empty}">
			<div class="cont_head">
				<h3 class="subH1 t_c mb40">이 상품과 함께 본 상품</h3>
			</div>
			<div class="cont_body">
				<!-- CONT-BODY -->
				<div class="area_slider">
					<div class="swiper-container">
						<div class="swiper-wrapper">
							<div class="swiper-slide" th:each="result, status : ${togetherGoodsList}">
								<div class="item_prod">
									<div class="item_state">
										<button type="button" class="itemLike" th:classappend="${result.product.itemId == 'Y'}? 'active' : ''"  onclick="cfnPutWishList(this);" th:attr="goodsCd=${result.product.itemId}, goodsNm=${result.product.itemName}, ithrCd='IN15_03', contentsLoc='', planDtlSq=''">관심상품 추가</button>
										<a href="javascript:void(0);" th:onclick="cfnGoToGoodsDetail([[${result.product.itemId}]], '','IN15_03','','','pc_detail');" class="itemLink" >
											<div class="itemPic">
												<img alt="" class="vLHTC pd_img" th:src="${result.product.itemImage +'?RS=300'}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'">
											</div>
											<p class="itemBrand" th:text="${result.product.brandName}">BRAND NAME1</p>
											<div class="itemName" th:text="${result.product.itemName}">남성 로고 자카드 방풍 패딩</div>
											<p class="itemPrice">
												<th:block th:text="${#numbers.formatInteger(result.product.salePrice, 0,'COMMA')}"></th:block>
												<th:block th:if="${result.product.originalPrice != result.product.salePrice}">
												<span class="itemPrice_original" th:if="${result.product.originalPrice > result.product.salePrice}"  th:text="${#numbers.formatInteger(result.product.originalPrice, 0,'COMMA')}">1,000,000</span>
												<span class="itemPercent" th:if="${result.product.salePrice != result.product.originalPrice}" th:text="${(result.product.originalPrice == 0 ? 0 : #numbers.formatDecimal((result.product.originalPrice - result.product.salePrice) / (result.product.originalPrice * 1.0) * 100, 1, 0)) + '%'}">0%</span>
												</th:block>
											</p>
										</a>
									</div>
								</div>
							</div>
						</div>
						
					</div>
					<!-- Add Pagination-->
					<div class="swiper-pagination"></div>
					<!-- Add Arrows -->
					<div class="swiper-button-next"></div>
					<div class="swiper-button-prev"></div>
				</div>
				<!-- // CONT-BODY -->
			</div>
		</div>
		<!-- // 이 상품과 함께 본 상품 -->
	</div>
	<!-- 상품썸네일 크게보기 팝업 -->
	<div class="pd_pop full_pop pd_itemthumb_pop" id="pdItemThumbPop" th:if="${(goodsImgList != null and !goodsImgList.empty)}" > 
		<div class="full_popup_wrap">
			<h5 class="sr-only">상품썸네일 크게보기</h5>
			<div class="btn_close">
				<a href="" id="btn_close_itemThumbPop">닫기버튼</a>
			</div>
			<div class="full_pop_container"  th:with="videoYn=${(goodsVideoList != null and !goodsVideoList.empty)? 'Y' :'N'}">
			<th:block th:each="goodsImg, status : ${goodsImgList}" th:with="count=${(videoYn == 'Y')?  (status.count +1): status.count }"
						th:if="${ not (#strings.contains(goodsImg.sysImgNm,'_F1.') 
								or #strings.contains(goodsImg.sysImgNm,'_L1.')
								or #strings.contains(goodsImg.sysImgNm,'_L2.'))}">
				<div th:id="${'popThumb'+ count}" class="scaleview" >
					<img th:src="${imgGoodsUrl+'/'+goodsImg.sysImgNm}" alt="" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/images/pc/thumb/bg_item_none.png'}+'\';'"></div>
			</th:block>
			</div>
		</div>		
	</div>
	<!-- //상품썸네일 크게보기 팝업 -->
	
	<!-- **************** 개별상품 상세정보 팝업 **************** -->


	<!-- 바로구매 장바구니 등록 정보 저장을 위한 form -->
	<form id="directOrderForm" method="POST" action="/order/noMember"></form>
</div>

<script th:inline="javascript">
/*<![CDATA[*/
	
	let socialSq = [[${goodsInfo.socialSq}]];	
	let socialEddt = [[${goodsInfo.socialEddt}]];
	
	function promotionTimer() {
		var endTime = new Date(socialEddt); // 남은시간 지정	30 March 2021 9:56:00 GMT+0900	
			endTime = (Date.parse(endTime) / 1000);

			var now = new Date();
			now = (Date.parse(now) / 1000);

			var timeLeft = endTime - now;

			var days = Math.floor(timeLeft / 86400); 
			var hours = Math.floor((timeLeft - (days * 86400)) / 3600);
			var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60);
			var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60)));

			if (hours < '10') { hours = '0' + hours; }
			if (minutes < '10') { minutes = '0' + minutes; }
			if (seconds < '10') { seconds = '0' + seconds; }
			
			if (Number(days) > 0 ){
			//	hours = Number(hours) + (Number(days) * 24);
				$('#d-days').html(days);
			}else{
				$('#d-days').hide();
			}
			
			$('#d-hours').html(hours);
			$('#d-minutes').html(minutes);
			$('#d-seconds').html(seconds);
	}

	if (!gagajf.isNull(socialSq)){
		$('.timer_box').css('display', 'block');
		setInterval(function() { promotionTimer(); }, 1000);
	};

	
	var cateNm = "";
	
	// 함께본 상품
	var fnGoodsTogetherSearch = function(params) {
		//gagajf.ajaxSubmit("/goods/detail/together/frame", "html", "goodsTogetherbArea", params);
		
		$.ajax( {
			type		: "POST",
			url 		: '/goods/detail/together/frame',
			data		: JSON.stringify(params),
			dataType 	: 'html',
			beforeSend : function(xhr, settings) {
				xhr.setRequestHeader("AJAX"			, "true");
				xhr.setRequestHeader('Accept'		, 'application/json');
				xhr.setRequestHeader('Content-Type'	, 'application/json');
			},
			success 	: function(result) {
				if (result != null) {
					$("#goodsTogetherbArea").css("display", "block");
					$("#goodsTogetherbArea").html(result);
					var otherItemSwiper1 = new Swiper('.pd .pd_clickother .area_slider .swiper-container', {
					     slidesPerView: 5,
					     slidesToScroll: 5,
					     slidesPerGroup: 5,
					     spaceBetween: 20,
					     navigation: {
					         nextEl: '.pd_clickother .swiper-button-next',
					         prevEl: '.pd_clickother .swiper-button-prev',
					     },
					     pagination: {
					         el: '.pd_clickother .swiper-pagination',
					         clickable: true,
					     },
					 });   
				}
			}
		});
	}
	
	// 옵션1 조회
	var fnOption1 = function(flag, goodsCd, currPrice, selfGoodsYn){
		
		let data = {goodsCd : goodsCd
					};
		let jsonData = JSON.stringify(data);
		
		$('.form_field .select_custom.deal_opt1').find('.combo .select').html('옵션1선택');
		$('.form_field .select_custom.deal_opt2').attr('disabled', true);
		$('.form_field .select_custom.deal_opt2').find('.combo .select').html('옵션2선택');
		
		gagajf.ajaxJsonSubmit('/goods/detail/option1/list', jsonData, function(result) {
			
			if (result.dataList != null && result.dataList.length > 0) {
				
				let tagUpS = "";
				let tagDownS = "";
				let tagUp = "";
				let tagDown = "";
				let $objUp = null;
				let $objDown = null;
				let qty = 1;
				$.each(result.dataList, function(idx, item) {
					let tag1 = "";
					let tag2 = "";
					if (idx == 0){
						if (flag == "layer"){
							$objUp = $('.pd_descrp_pop .opt_select .select_custom.deal_opt1');
					//		$objUp.html('');
							$objUp.remove();
						}else if (flag == "Up"){
							$objUp = $('.pd_detail .opt_select .select_custom.deal_opt1');
					//		$objUp.html('');
							$objUp.remove();
						}else{
							$objDown = $('.pd_desc_wrap .opt_select .select_custom.deal_opt1');
					//		$objDown.html('');
							$objDown.remove();
						}
					//	$('.form_field .select_custom.deal_opt1').attr('disabled', false);
						//------
						tag1 += '<div class="select_custom deal_opt1">\n';	
						tag1 += '<div class="combo">\n';
						tag1 += '<div class="select">옵션1선택</div>\n';
						tag1 += '<ul class="list">\n';
						//------
						//tag1 += '<li class="selected" id="goodsOpt1">옵션1선택</li>\n';	
					}
					let soldoutYn = ""; 
					let disabledYn = ""; 
					if (item.stockQty <= 0) soldoutYn = "true";
					if (soldoutYn == "true" || item.goodsStat != 'G008_90') disabledYn = "true";
					if (flag == "layer"){
						tagUp = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnOption2(this, \'layer\')">\n';
					}else if (flag == "Up"){
						tagUp = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnOption2(this, \'Up\')">\n';
					}else{ 
						tagDown = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnOption2(this, \'Down\')">\n';	
					}
					tag2 += '<div class="opt_name">'+ item.optCd1Nm+'</div>\n';
					if (item.addPrice > 0){
						tag2 += '<div class="opt_price">+'+ item.addPrice.addComma() +'원</div>\n';	
					}
					tag2 += '<input type="hidden" name="opt1" value="'+ goodsCd +'" currPrice="'+ currPrice+'" optCd1="'+item.optCd1+'"  minOrdQty="'+item.minOrdQty+'"  maxOrdQty="'+item.maxOrdQty+'"   selfGoodsYn="'+selfGoodsYn+'" />\n';
					tag2 += '</li>\n';
					
					tagUpS += tag1+tagUp+tag2;
					tagDownS += tag1+tagDown+tag2;
					
				});
				
				if (!gagajf.isNull(tagUpS)){
					//------
					tagUpS += '</ul>\n';
					tagUpS += '</div>\n';
					tagUpS += '</div>\n';
					tagDownS += '</ul>\n';
					tagDownS += '</div>\n';
					tagDownS += '</div>\n';
					//------	
				}
				
				if (flag == "layer"){
				//	$objUp.prepend(tagUpS);
					$('#form_field1_'+flag).append(tagUpS);
					var pop_desc_option02 = new sCombo('.pd_descrp_pop .opt_select .select_custom.deal_opt1');
					//$('.pd_descrp_pop .opt_select .select_custom.deal_opt1').find('.combo .select').trigger('click');
				}else if (flag == "Up"){
				//	$objUp.prepend(tagUpS);
					$('#form_field1_'+flag).append(tagUpS);
					var detail_deal_option02 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt1');
					//$('.pd_detail .opt_select .select_custom.deal_opt1').find('.combo .select').trigger('click');
				}else{
				//	$objDown.prepend(tagDownS);
					$('#form_field1_'+flag).append(tagDownS);
					var desc_option02 = new sCombo('.pd_desc_wrap .opt_select .select_custom.deal_opt1');
					//$('.pd_desc_wrap .opt_select .select_custom.deal_opt1').find('.combo .select').trigger('click');
				}
				
			}
			
/* 			if (flag != "layer"){
				// 상품 선태값 적용
				let $obj = null;
				let $taget = null;
				// 하단 우측 상품선택영역  Up/ Down
				if (flag  == "Up"){
					$obj = $('.pd_detail .opt_select .select_custom.deal_opt_item').find('.combo .select'); 
					$taget = $('.pd_desc_wrap .opt_select .select_custom.deal_opt_item').find('.combo .select');
				}else{
					$taget = $('.pd_detail .opt_select .select_custom.deal_opt_item').find('.combo .select');
					$obj = $('.pd_desc_wrap .opt_select .select_custom.deal_opt_item').find('.combo .select');
				}
				let goodsDealInfo = $obj.html();
				$taget.html(goodsDealInfo);
			} */
			
		});
		
	}
	
	// 옵션2 조회
	var fnOption2 = function(obj, flag){
		
		let $obj = $(obj);
		let $target = $obj.find('input[name="opt1"]');
		let goodsCd = $target.val();
		let currPrice = $target.attr("currPrice");
		let optCd1 = $target.attr("optCd1");
		let minOrdQty = $target.attr("minOrdQty");
		let maxOrdQty = $target.attr("maxOrdQty");
		let selfGoodsYn = $target.attr("selfGoodsYn");
		
		let data = {goodsCd : goodsCd
					,optCd1 : optCd1
					};
		let jsonData = JSON.stringify(data);
		
		gagajf.ajaxJsonSubmit('/goods/detail/option2/list', jsonData, function(result) {
			
			if (result.dataList != null && result.dataList.length > 0) {
				let tagUpS = "";
				let tagDownS = "";
				let tagUp = "";
				let tagDown = "";
				let $objUp = null;
				let $objDown = null;
				$.each(result.dataList, function(idx, item) {
					let tag1 = "";
					let tag2 = "";
					if (idx == 0){
						if (flag == "layer"){
							$objUp = $('.pd_descrp_pop .opt_select .select_custom.deal_opt2');
					//		$objUp.html('');
							$objUp.remove();
						}else if (flag == "Up"){
							$objUp = $('.pd_detail .opt_select .select_custom.deal_opt2');
					//		$objUp.html('');
							$objUp.remove();
						}else{
							$objDown = $('.pd_desc_wrap .opt_select .select_custom.deal_opt2');
					//		$objDown.html('');
							$objDown.remove();
							
						}
						//$('.form_field .select_custom.deal_opt2').attr('disabled', false);	
						//------
						tag1 += '<div class="select_custom deal_opt2">\n';	
						tag1 += '<div class="combo">\n';
						tag1 += '<div class="select">옵션2선택</div>\n';
						tag1 += '<ul class="list">\n';
						//------
						//tag1 += '<li class="selected" id="goodsOpt2">옵션2</li>\n';	
					}
					let soldoutYn = ""; 
					let disabledYn = "";
					if ("Y" == item.soldoutYn || item.stockQty <= 0) soldoutYn = "true";
					if (soldoutYn == "true")  disabledYn = "true";
					if (flag == "layer"){
						tagUp = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnViewStock(this, \'layer\' )">\n';
					}else if (flag == "Up"){
						tagUp = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnViewStock(this, \'Up\' )">\n';
					}else{
						tagDown = '<li aria-disabled="'+disabledYn+'" data-soldout="'+soldoutYn +'" onclick="fnViewStock(this, \'Down\' )">\n';	
					}
					tag2 += '<div class="opt_name">'+ item.optCd2+'</div>\n';
					if (item.addPrice > 0){
						tag2 += '<div class="opt_price">+'+ item.addPrice.addComma() +'원</div>\n';	
					}
					tag2 += '<input type="hidden" name="opt2" value="'+ goodsCd +'" currPrice="'+ currPrice+'" addPrice="'+item.addPrice+'"  optCd="'+item.optCd+'"  optCd1="'+item.optCd1+'" optCd1Nm="'+item.optCd1Nm+'"  optCd2="'+item.optCd2+'"  minOrdQty="'+minOrdQty+'"  maxOrdQty="'+maxOrdQty+'" selfGoodsYn="'+selfGoodsYn+'"/>\n';
					tag2 += '</li>\n';
					
					tagUpS += tag1+tagUp+tag2;
					tagDownS += tag1+tagDown+tag2;
					
				});
				
				if (!gagajf.isNull(tagUpS)){
					//------
					tagUpS += '</ul>\n';
					tagUpS += '</div>\n';
					tagUpS += '</div>\n';
					tagDownS += '</ul>\n';
					tagDownS += '</div>\n';
					tagDownS += '</div>\n';
					//------	
				}
				
				if (flag == "layer"){
				//	$objUp.prepend(tagUpS);
					$('#form_field2_'+flag).append(tagUpS);
					var pop_desc_option02 = new sCombo('.pd_descrp_pop .opt_select .select_custom.deal_opt2');
					//$('.pd_descrp_pop .opt_select .select_custom.deal_opt2').find('.combo .select').trigger('click');
				}else if (flag == "Up"){
				//	$objUp.prepend(tagUpS);
					$('#form_field2_'+flag).append(tagUpS);
					var detail_deal_option03 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt2');
					//$('.pd_detail .opt_select .select_custom.deal_opt2').find('.combo .select').trigger('click');
				}else{
				//	$objDown.prepend(tagDownS);
					$('#form_field2_'+flag).append(tagDownS);
					var desc_option03 = new sCombo('.pd_desc_wrap .opt_select .select_custom.deal_opt2');
					//$('.pd_desc_wrap .opt_select .select_custom.deal_opt2').find('.combo .select').trigger('click');
				}
			}
			
		/* 	if (flag != "layer"){
				// 옵션 1 선태값 적용
				let $obj2 = null;
				let $taget2 = null;
				// 하단 우측 상품선택영역  Up/ Down
				if (flag  == "Up"){
					$obj2 = $('.pd_detail .opt_select .select_custom.deal_opt1').find('.combo .select'); 
					$taget2 = $('.pd_desc_wrap .opt_select .select_custom.deal_opt1').find('.combo .select');
				}else{
					$obj2 = $('.pd_desc_wrap .opt_select .select_custom.deal_opt1').find('.combo .select');
					$taget2 = $('.pd_detail .opt_select .select_custom.deal_opt1').find('.combo .select');
				}
				
				let goodsDealInfo = $obj2.html();
				$taget2.html(goodsDealInfo);	
			} */
			
		});	
	}
	
	//사이즈 클릭시 - 단품
	var fnViewStock = function(obj, flag ) {
		
		let $obj = $(obj);
		let $target = $obj.find('input[name="opt2"]');
		let goodsCd = $target.val();
		let currPrice = $target.attr("currPrice");
		let optCd = $target.attr("optCd");
		let optCd1 = $target.attr("optCd1");
		let optCd1Nm = $target.attr("optCd1Nm");
		let optCd2 = $target.attr("optCd2");
		let minOrdQty = $target.attr("minOrdQty");
		let maxOrdQty = $target.attr("maxOrdQty");
		let addPrice  = $target.attr("addPrice");
		let selfGoodsYn  = $target.attr("selfGoodsYn");
		let optQty = minOrdQty;
		
		let params = new Object();
		params.goodsCd = goodsCd;
		params.optCd = optCd;
		params.optCd1 = optCd1;
		params.optCd2 = optCd2;
		params.selfGoodsYn = selfGoodsYn;
		
		// 중복선택 확인  opt_result
		var overlap = 0;
		$('.pd_detail .opt_result .number_count').each(function() {
			if ($('input[name="coption"]', this).val() == optCd) {
				++overlap;
			}
		});
		if (overlap > 0) {
			mcxDialog.alert("이미 선택하신 옵션입니다.");
			return false;
		}
		
		$.get("/goods/detail/ajaxGoodsStockQty", $.param(params), function(result) {
			let itemCnt = eval(result); //해당 아이템에 선택되어진 사이즈의 수량
			
			if (maxOrdQty > itemCnt) {
				maxOrdQty = itemCnt;
			}

			if (minOrdQty > itemCnt) {
				mcxDialog.alert("주문 가능한 옵션이 아닙니다. 옵션을 다시  선택해 주세요."); 
				return false;
			}
			
			//상품정보
			let $selObj = null;
			if (flag  == "layer"){
				$selObj = $('.pd_descrp_pop .form_field .select_custom.deal_opt_item');
			}else if (flag  == "Up"){
				$selObj = $('.pd_detail .opt_select .select_custom.deal_opt_item');
			}else{
				$selObj = $('.pd_desc_wrap .opt_select .select_custom.deal_opt_item');
			}
			let $goodsObj =$selObj.find('.combo .select').find('input[name=selectGoods]');
			let goodsNm =  $goodsObj.attr('goodsnm');
			let goodsCd =  $goodsObj.attr('goodscd');
			let price = parseInt(currPrice)+ parseInt(addPrice);
			
			let tag = "";
			tag += '<div class="result_item result_'+optCd+'">\n';
			tag += '	<div class="opt_header">\n';
			tag += '		<span class="item_name">'+goodsNm+'</span>\n';
			tag += '		<span class="item_option">'+optCd1Nm+'/'+optCd2+'</span>\n';
			tag += '	</div>\n';
			tag += '	<div class="number_count">\n';
			tag += '		<span class="minus min_val" onclick="fnAdjustOrderEa(this);" adjust="-"><em class="sr-only">감소</em></span>\n';
			tag += '		<input type="text" name="cea" optCd="'+optCd+'" maxlength="3" style="ime-mode:disabled" value="' +optQty+'" readonly minOrdQty="'+minOrdQty+'" maxOrdQty="'+maxOrdQty+'">\n';
			tag += '		<input type="hidden" name="coption" value="'+optCd+'"  goodsCd="'+goodsCd+'"  price="'+currPrice+'"  addPrice="'+addPrice+'">\n';
			tag += '		<span class="plus" onclick="fnAdjustOrderEa(this);" adjust="+"><em class="sr-only">추가</em></span>\n';
			tag += '	</div>\n';
			tag += '	<div class="item_price">\n';
			tag += '		<p><em id="goodsPrice">'+price.addComma() +'</em>원</p>\n';
			tag += '	</div>\n';
			tag += '	<button type="button" class="btn_delete_item" onclick="fnSelectGoodsDel(\''+optCd+'\')"><span>삭제</span></button>\n';
			tag += '</div>\n';
			
			
			let $objUp = null;
			let $objDown = null;
			// 하단 우측 상품선택영역  Up/ Down/ layer
			if (flag  == "layer"){
				$objLayer = $('.pd_descrp_pop .opt_result'); 
				$objUp = $('.pd_detail .opt_result'); 
				$objDown = $('.pd_desc_wrap .opt_result');
				$objLayer.prepend(tag);
			}else{
				$objUp = $('.pd_detail .opt_result'); 
				$objDown = $('.pd_desc_wrap .opt_result');
			}
			
			$objUp.prepend(tag);
			$objDown.prepend(tag);
			
			if (flag  != "layer"){
				// 옵션 2 선태값 적용
				let $obj2 = null;
				let $taget2 = null;
				// 하단 우측 상품선택영역  Up/ Down
				if (flag  == "Up"){
					$obj2 = $('.pd_detail .opt_select .select_custom.deal_opt2').find('.combo .select'); 
					$taget2 = $('.pd_desc_wrap .opt_select .select_custom.deal_opt2').find('.combo .select');
				}else{
					$obj2 = $('.pd_desc_wrap .opt_select .select_custom.deal_opt2').find('.combo .select');
					$taget2 = $('.pd_detail .opt_select .select_custom.deal_opt2').find('.combo .select');
					
				}
				
				let goodsDealInfo = $obj2.html();
				$taget2.html(goodsDealInfo);
				
				
			}
			fnSetTotalPrice();	
			
			var dTag = '';
			dTag += '';
			dTag += '<div class="item_prod">\n';
			dTag += '<div class="item_state">\n';
			dTag += '	<a href="javascript:void(0);" class="itemLink">\n';
			dTag += '		<div class="itemPic">\n';
			dTag +='			<img class="vLHTC pd_img" src="'+_uploadGoodsUrl +'/'+[[${goodsInfo.sysImgNm}]]+'?RS=285" alt="" onerror="' + _uximgUrl + '/images/pc/thumb/bg_item_none.png"  />\n';
			dTag += '		</div>\n';
			dTag += '		<div class="itemName">상품선택</div>\n';
			dTag += '	</a>\n';
			dTag += '</div>\n';
			dTag += '</div>\n';
			
			$('.pd_detail .opt_select .select_custom.deal_opt_item').find('.combo .select').html(dTag);
			$('.pd_desc_wrap .opt_select .select_custom.deal_opt_item').find('.combo .select').html(dTag);
			//$('.pd_descrp_pop .form_field .select_custom.deal_opt_item').find('.combo .select').html(dTag);
			if (flag  != "layer"){
				$('.form_field .select_custom.deal_opt1').attr('disabled', true);
				//$('.form_field .select_custom.deal_opt1').find('.combo .select').html('옵션1선택');	
			}
			$('.form_field .select_custom.deal_opt1').find('.combo .select').html('옵션1선택');
			$('.form_field .select_custom.deal_opt2').attr('disabled', true);
			$('.form_field .select_custom.deal_opt2').find('.combo .select').html('옵션2선택');
			
		}, "text");
	}
	
	// 수량 변경 클릭
	var fnAdjustOrderEa = function(obj) {
		
		let $obj = $(obj);
		let $target = $obj.parent().children('input[name="cea"]');
		let minOrdQty = parseInt( $target.attr('minOrdQty'));
		let maxOrdQty = parseInt( $target.attr('maxOrdQty'));
		let ea =parseInt($target.val());

		if ($obj.attr('adjust') == '-') --ea;
		else ++ea;

		//var maxOrdQty = $("#cartForm  input[name=maxOrdQty]").val();

		//if (maxOrdQty && ea > maxOrdQty) ea = maxOrdQty;
		//if (ea.toString().length > maxOrdQty) --ea;
		if (ea < 1) ea = minOrdQty;

		$target.val(ea);
		$target.attr('value', ea);

		fnChangeOrderEa($target[0]);
	}

	//옵션 갯수 변경
	var fnChangeOrderEa = function(obj) { 
		let $obj = $(obj);
		let ea = parseInt($obj.val());
		let maxOrdQty = parseInt($(obj).attr('maxOrdQty'));
		let minOrdQty = parseInt($(obj).attr('minOrdQty'));
		let optCd =  $(obj).attr('optCd');
		let alertMsg = '';
		if (ea < minOrdQty) {
			alertMsg = minOrdQty+"개 부터 구매 가능합니다.";
			ea = minOrdQty;
		}

		if (ea > maxOrdQty) {
			alertMsg = maxOrdQty+"개 까지만 구매 가능합니다.";
			ea = maxOrdQty;
		}

		obj.value = ea;
		
		if (alertMsg != ''){
			mcxDialog.alert(alertMsg);
			return false;
		}
		
		if (ea <= 1){
			$('.number_count').find('.minus').addClass('min_val');	
		}else{
			$('.number_count').find('.minus').removeClass('min_val');
		}
		
		let addPrice = parseInt($obj.parent().find('input[name="coption"]').attr('addprice'));
		let goodsPrice = parseInt($obj.parent().find('input[name="coption"]').attr('price'));
		let totalPrice = ((goodsPrice+addPrice) * ea);
		//$obj.parent().parent().find('#goodsPrice').text(totalPrice.addComma());
		$('.opt_result .result_'+optCd+' .number_count').find('input[name=cea]').val(ea);
		$('.opt_result .result_'+optCd+' .number_count').find('input[name=cea]').attr('value',ea);
		$('.opt_result .result_'+optCd+' .item_price').find('em').text(totalPrice.addComma());
		
		fnSetTotalPrice();
	}
	
	//합계 계산
	var fnSetTotalPrice = function() {
		
		$('.price_box').show();
		//let f = document.cartForm;

		let totalEa = 0;
		let totalPrice = 0;
		
		$('input[name="cea"]', document.cartForm).each(function() {
			let ea = parseInt($(this).val());
			let target=$('.select_custom.item_opt2');
			let addPrice = parseInt($(this).parent().find('input[name="coption"]').attr('addprice'));
			let goodsPrice = parseInt($(this).parent().find('input[name="coption"]').attr('price'));

			totalEa += ea;
			if (goodsPrice > 0) {
				totalPrice += ((goodsPrice+addPrice) * ea);
			}
		});

		$('.price_box .number  span').html(totalEa.addComma());
		$('.price_box .price > span').html(totalPrice.addComma());
		
		if ($('input[name="cea"]', document.cartForm).length <= 0 ) {
			$('.price_box').hide();
		}
		
	}
	
	//장바구니담기
	var fnAddCart = function(btnType, flag){
		let compsList = [];
		
		let $target = $('#cartForm input[name=cea]');
		let targetSize = $target.length;	//선택성품 갯수
		if ($target.length <= 0){
			let $selObj = null;
			if (flag  == "layer"){
				$selObj = $('.pd_descrp_pop .form_field .select_custom.deal_opt_item');
			}else if (flag  == "Up"){
				$selObj = $('.pd_detail .opt_select .select_custom.deal_opt_item');
			}else{
				$selObj = $('.pd_desc_wrap .opt_select .select_custom.deal_opt_item');
			}
			
			let selGoodsCd = $selObj.find('.combo .select').find('input[name=selectGoods]').attr('goodscd');
			if (gagajf.isNull(selGoodsCd) || typeof (selGoodsCd) == 'undefined'){
				mcxDialog.alert("상품을 선택해 주세요.");
				return false;
			}else{
				mcxDialog.alert("옵션을 선택해 주세요.");
				return false;
			}
		}
		
		$target.each(function() {
			
			let ea = parseInt($(this).val());
			let goodsCd = $(this).parent().find('input[name="coption"]').attr('goodscd');
			let optCd = $(this).parent().find('input[name="coption"]').val();
			//let addPrice = parseInt($(this).parent().find('input[name="coption"]').attr('addprice'));
			//let goodsPrice = parseInt($(this).parent().find('input[name="coption"]').attr('price'));
			
			var obj = new Object();
			obj.cartGb = btnType;
			obj.goodsType = $("#cartForm  input[name=goodsType]").val();
			obj.goodsCd = goodsCd;
			obj.optCd = optCd;
			obj.goodsQty = ea;
			obj.dealGoodsCd = $("#cartForm  input[name=goodsCd]").val();
			obj.afLinkCd =$("#cartForm  input[name=afLinkCd]").val();
			obj.ithrCd =$("#cartForm  input[name=ithrCd]").val();
			obj.contentsLoc =$("#cartForm  input[name=contentsLoc]").val();
			obj.planDtlSq = $("#cartForm  input[name=planDtlSq]").val();
			compsList.push(obj);
			
		});
		
		// 장바구니담기
		cfnAddCart(compsList);
		
	}
	
	// 선택상품 삭제
	var fnSelectGoodsDel = function(optCd){
		$('.result_'+optCd).remove();
		fnSetTotalPrice();
	}
	
	//공유 버튼 토글 
	$("button[data-name=openShare]").on("click", function(){
		$(this).toggleClass("on").next(".shareWrap").toggleClass("on");
		return false;
	});
	//영역밖 클릭으로 공유토글 닫기
	$("body").on('click', function(e) { 
		if(!$(".shareWrap.on").parent().has(e.target).length) {
			$("button[data-name=openShare]").removeClass("on");
			$(".shareWrap").removeClass("on");
		};
	});


	var params = new Object();
	params.goodsCd = [[${params.goodsCd}]];
	params.colorCd = [[${params.colorCd}]];
	params.viewDt = [[${params.viewDt}]];
	params.preview = [[${params.preview}]];
	params.adminYn = [[${params.adminYn}]];
	params.goodsType = [[${params.goodsType}]];
	params.supplyCompCd = [[${params.supplyCompCd}]];
	params.brandGroupNm = [[${goodsInfo.brandGroupNm}]];

	//함께본 상품(ajax html)
/* 	$('#goodsTogetherbArea').load('GoodsDetailFormWeb.html', function() {
		params.goodsOtherGb = "together";
		params.ithrCd = "tmtb";
		params.contentsLoc = "tmtb";
		fnGoodsTogetherSearch(params);
	}); */
	
	//상품상세정보 더보기
	$(document).on('click','.pd_descrp_pop .btn_more_box button',function(e){
		$('.pd_descrp_pop .cont_body').toggleClass('on'); 
		$(this).toggleClass('active');
		$(this).parent('.btn_more_box').toggleClass('covered');
		var descrpToggle = $(this).find('span');
		$(descrpToggle).text($(descrpToggle).text() == '상세정보 더보기' ? '상세정보 접기' : '상세정보 더보기');
		return false;
	}); 

	//상품상세정보 탭
	$(document).on('click','.pd.deal .tab_detail_nav ul li',function(e){
		$(this).addClass('active').siblings().removeClass('active');
		$('.pd.deal .tab_detail_cont').hide();		
		$('.pd.deal .tab_detail_cont').eq($(this).index()).show();
		return false;
	});
	
	//슬라이드 - 이 상품과 함께 본 상품
	var otherItemSwiper = new Swiper('.pd .pd_clickother .area_slider .swiper-container', {
	     slidesPerView: 5,
	     slidesToScroll: 5,
	     slidesPerGroup: 5,
	     spaceBetween: 20,
	     navigation: {
	         nextEl: '.pd_clickother .swiper-button-next',
	         prevEl: '.pd_clickother .swiper-button-prev',
	     },
	     pagination: {
	         el: '.pd_clickother .swiper-pagination',
	         clickable: true,
	     },
	 });   
	
	// 상품평 상세 조회
	var fnReviewDetail = function() {
		
		var params = new Object();
		params.goodsCd = $('#reviewDetailForm input[name=goodsCd]').val();
		params.reviewSq = $('#reviewDetailForm input[name=reviewSq]').val();
		params.bestYn =$('#reviewDetailForm input[name=bestYn]').val();
		params.photoYn = $('#reviewDetailForm input[name=photoYn]').val();
		
		gagajf.ajaxSubmit("/goods/review/detail/list", "json", fnReviewDetailCallback, params);
	}

	// 상품평 상세 조회 - 콜백
	var fnReviewDetailCallback = function(result) {
		$('#reviewBody').html('');
		// 목록
		if (result.reviewList != null && result.reviewList.length > 0) {
			let fileGbClass = '';
			let rdx = $('#reviewDetailForm input[name=attachSq]').val();
			$.each(result.reviewList, function(idx, review) {
				let tag = '';
				tag +='<div class="pop_cont">\n';
				tag +='<div class="swiper-container detail">\n';
				tag +='<div class="swiper-wrapper">\n';
				tag +='<div class="swiper-slide">\n';
				
				let reviewClass = 'empty_photo';
				if (review.reviewAttachList != null && review.reviewAttachList.length > 0){
					reviewClass = '';
				}
				tag +='<div class="review '+reviewClass+'" >\n';  <!-- 첨부이미지 없을 시 empty_photo 클래스 추가 --> 
				tag +='	<div class="pic">\n';
				if (review.reviewAttachList != null && review.reviewAttachList.length > 0){
					$.each(review.reviewAttachList, function(aIdx, reviewAttach){
						fileGbClass = '';
						if (reviewAttach.fileGb == "M") fileGbClass = "mov";
				tag +='		<span class="thumb '+fileGbClass+'">\n';<!-- 동영상의 썸네일일 경우 mov 클래스 추가-->
						if (reviewAttach.fileGb == "M") {
				tag +='			<iframe width="100%" height="100%" src="'+_kollusMediaUrl +'/'+reviewAttach.kmcKey +'?player_version=html5" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>\n';
						}else{
				tag +='			<img src="'+ _imgUrl + reviewAttach.sysFileNm +'" alt="">\n';	
						}
				tag +='		</span>\n';
						return false;
					});	
				}else{
				tag +='		<span class="thumb">\n';
				tag +='			<img src="'+_uploadGoodsUrl +'/'+review.sysImgNm+'?RS=545" alt="" onerror="' + _uximgUrl + '/images/pc/thumb/bg_item_none.png"  />\n';
				tag +='		</span>\n';	
				}
				tag +='	</div>\n';
				tag +='	<div class="review_cont">\n';
				tag +='		<div class="box_wrap">\n';
				tag +='			<div class="star_box">\n';
				tag +='				<div class="star_score">\n';
				tag +='					<span class="star">\n';
				tag +='						<em class="progbar" style="width:'+(review.iscore*20)+'%;"></em>\n'; <!-- 평점 style로 표기 -->
				tag +='					</span>\n';
				tag +='				</div>\n';
				tag +='			</div>\n';
				tag +='			<div class="response_box">\n';
				tag +='				<div class="full">\n';
				tag +='					<dl>\n';
				
				tag +='						<div>\n';
				tag +='							<dt>구매옵션</dt>\n';
				if (review.goodsOptionList != null && review.goodsOptionList.length > 0){
				tag +='							<dd>\n';	
					$.each(review.goodsOptionList, function(aIdx, reviewGoods){
				tag +='							<p><span>'+ reviewGoods.optCd1Nm +'</span> / <span>'+ reviewGoods.optCd2+'</span></p>\n';
					});		
				tag +='							<dd>\n';	
				}

				tag +='						</div>\n';
				tag +='					</dl>\n';
				tag +='				</div>\n';
				tag +='				<div class="full">\n';
				tag +='					<dl>\n';
				tag +='						<div>\n';
				tag +='							<dt>키/몸무게</dt>\n';
				tag +='							<dd>'+review.height+'cm / '+review.weight +'kg \n';
				tag +='							</dd>\n';
				tag +='						</div>\n';
				tag +='					</dl>\n';
				tag +='				</div>\n';
				if (!gagajf.isNull(review.sizeGb)){  <!-- 사이즈구분(T:상의, B:하의, S:신발) -->
				tag +='				<div>\n'; 
				tag +='					<dl > \n';
				tag +='						<div>\n';
				tag +='							<dt>사이즈</dt>\n';
				tag +='							<dd>'+review.scoreSizeNm+'</dd>\n';
				tag +='						</div>\n';
				tag +='						<div>\n';
				tag +='							<dt>컬러</dt>\n';
				tag +='							<dd>'+review.scoreColorNm+'</dd>\n';
				tag +='						</div>\n';
					if (review.sizeGb == 'T' || review.sizeGb == 'B'){
				tag +='						<div>\n';
				tag +='							<dt>핏</dt>\n';
				tag +='							<dd>'+review.scoreFitNm+'</dd>\n';
				tag +='						</div>\n';
				tag +='						<div>\n';
				tag +='							<dt>두께감</dt>\n';
				tag +='							<dd>'+ review.scoreThickNm+'</dd>\n';
				tag +='						</div>\n';
					}
					if (review.sizeGb == 'S'){
				tag +='						<div>\n';
				tag +='							<dt>무게감</dt>\n';
				tag +='							<dd>'+review.scoreWeightNm+'</dd>\n';
				tag +='						</div>\n';
				tag +='						<div>\n';
				tag +='							<dt>볼너비</dt>\n';
				tag +='							<dd>'+review.scoreBallNm+'</dd>\n';
				tag +='						</div>\n';
					}
				tag +='					</dl>\n';
				tag +='				</div>\n';
				}
				tag +='			</div>\n';
				tag +='			<div class="txt_review_box">\n';
				tag +='				<p>' + review.reviewContent +'</p>\n';
				tag +='			</div>\n';
				tag +='			<div class="writer_box">\n';
				tag += '			<div class="writer">\n';
				tag += '				<span class="wr_id">'+ review.maskingCustId +'</span>\n';
				tag += '				<span class="wr_date">' + review.regDt + '</span>\n';
				tag += '			</div>\n'
				tag +='			</div>\n';
				if (!gagajf.isNull(review.admRpl)){
				tag += '		<div class="reply_box">\n';
				tag += '			<div class="reply">\n';
				tag += '				<div class="reply_writer">\n';
				tag += '					<span class="wr_name">관리자</span>\n';
				tag += '					<span class="wr_date">'+review.admRplDt+'</span>\n';
				tag += '				</div>\n';
				tag += '				<div class="reply_txt">\n';
				tag += '					<p>' + review.admRpl+'</p>\n';
				tag += '				</div>\n';
				tag += '			</div>\n';
				tag += '		</div>\n';	
				}
				tag +='		</div>\n';
				tag +='	</div>\n';
				if (review.reviewAttachList != null && review.reviewAttachList.length >= 2){
				tag +='	<div class="thumblist">\n';
				tag +='		<ul>\n';
					let activeClass = '';
					
					$.each(review.reviewAttachList, function(aIdx, reviewAttach){
						activeClass = '';
						if (aIdx == rdx){
							activeClass = 'active';
						}
						fileGbClass = '';
						if (reviewAttach.fileGb == "M") fileGbClass = "mov";
				tag +='			<li>\n';
				tag +='				<div class="pic '+activeClass+'"> \n'; <!-- 활성화시 active 클래스 추가 -->
				
					if (reviewAttach.fileGb == "M") {
				tag +='					<span class="thumb '+fileGbClass+'"><iframe width="100%" height="100%" src="'+_kollusMediaUrl +'/'+reviewAttach.kmcKey +'?player_version=html5" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></span>\n';
					}else{
				tag +='					<span class="thumb" style="background-image:url('+ _imgUrl + reviewAttach.sysFileNm +');\" >\n';
				tag +='					<img src="'+ _imgUrl + reviewAttach.sysFileNm +'" alt="">\n';	
					}
				tag +='					</span>\n';
				tag +='				</div>\n';
				tag +='			</li>\n';
					});
				tag +='		</ul>\n';
				tag +='	</div>\n';
				}
				tag +='</div>\n';
				
				tag +='</div>\n';
				tag +='</div>\n';
				tag +='</div>\n';
				if (gagajf.isNull(review.nextReviewSq) || review.nextReviewSq <= 0) {
					tag +='<div class="swiper-button-next swiper-button-disabled" id="reviewBodyNext" ></div>\n';
				}else{
					tag +='<div class="swiper-button-next" id="reviewBodyNext" onclick="fnReviewNext('+review.nextReviewSq+')"></div>\n';	
				}
				
				if (gagajf.isNull(review.prevReviewSq) || review.prevReviewSq <= 0) {
					tag +='<div class="swiper-button-prev swiper-button-disabled" id="reviewBodyPrev"  ></div>\n';
				}else{
					tag +='<div class="swiper-button-prev" id="reviewBodyPrev" onclick="fnReviewNext('+review.prevReviewSq+')"></div>\n';	
				}
				tag +='</div>\n';
				
				$('#reviewBody').append(tag);
				
				 $('.pd_photoreviewdetail_pop .swiper-slide').each(function(index, element){
				        var $this = $(this);
				        
				        var thumbCount = $this.find('.thumblist ul li').length;
				        var thumbUlWidth = $this.find('.thumblist ul li').width() * thumbCount;
				        var thumbMargin = 8 * thumbCount;
				        var thumbListWidth = thumbUlWidth + thumbMargin;

				        $this.find('.thumblist ul').attr('style', 'width:' + thumbListWidth + 'px;');
				        
				    });
				
				$('.pd_photoreviewdetail_pop .thumblist ul li').eq(rdx).trigger("click");
			});
		}
		
	}
	
	// 다른 상품평 보기
	var fnReviewNext = function(reviewSq){
		if (gagajf.isNull(reviewSq)) return false;
		
		$('#reviewDetailForm input[name=reviewSq]').val(reviewSq);
		$('#reviewDetailForm input[name=attachSq]').val(0);
		fnReviewDetail();
	}

	
	// 상품평 상세 레이어 호출후 콜백에서 호출하므로 여기에 있어야함
	var fnReviewDetailLayerCollBack = function(){
		fnReviewDetail();
	       
		 //슬라이드 - 상품 베스트 리뷰 자세히보기 영역 
	    var photoReviewDetailSwiper = new Swiper('.pd_photoreviewdetail_pop .swiper-container.detail', {
	        effect :'fade',
	        slidesPerView: 1,
	        spaceBetween: 0,
	        simulateTouch:false,
	        navigation: {
	            nextEl: '.pd_photoreviewdetail_pop .swiper-button-next',
	            prevEl: '.pd_photoreviewdetail_pop .swiper-button-prev',
	        },
	    });   
	}
	
	$('.pd_photoreviewdetail_pop .swiper-slide').each(function(index, element){
        var $this = $(this);
        
        var thumbCount = $this.find('.thumblist ul li').length;
        var thumbUlWidth = $this.find('.thumblist ul li').width() * thumbCount;
        var thumbMargin = 8 * thumbCount;
        var thumbListWidth = thumbUlWidth + thumbMargin;

        $this.find('.thumblist ul').attr('style', 'width:' + thumbListWidth + 'px;');
        
    });

    $(document).on('click','.pd_photoreviewdetail_pop .thumblist ul li',function(e){

        $(this).parents(".swiper-slide").find(".review > .pic > .thumb").empty();
        $(this).parents(".swiper-slide").find(".thumblist ul li .pic").removeClass('active');
        $(this).find(".pic").addClass('active');

        var thumbIndex = $(this).index();
        thumbContentHtml = $(this).find('.pic .thumb').html();
        $(this).parents(".swiper-slide").find(".review > .pic > .thumb").append(thumbContentHtml);

        return false;
    });
	
	
	$(document).ready( function() {
		
		//상품 대표설명 > 우측 상품정보 
		/* 딜 옵션선택 후 다음 옵션 활성화 */
		var detail_deal_option01 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt_item');
		//var detail_deal_option02 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt1');
		//var detail_deal_option03 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt2');
		/* $('.pd_detail .opt_select .select_custom .combo .list > li').click(function(e) {
			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
			return false;
		}); */

		// 하단 우측 상품선택영역
		/* 딜 옵션선택 후 다음 옵션 활성화 */
		var desc_option01 = new sCombo('.pd_desc_wrap .opt_select .select_custom.deal_opt_item');
		//var desc_option02 = new sCombo('.pd_desc_wrap .opt_select .select_custom.deal_opt1');
		//var desc_option03 = new sCombo('.pd_desc_wrap .opt_select .select_custom.deal_opt2');
		/* $('.pd_desc_wrap .opt_select .select_custom .combo .list > li').click(function(e) {
			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
			return false;
		});	 */		

		// 상품선택 옵션 : 하단 상품정보 영역  
		var tab_review_item = new sCombo('.tab_detail_cont .select_custom.deal_opt_item.forReview');
		var tab_qna_item = new sCombo('.tab_detail_cont .select_custom.deal_opt_item.forQna');
		var tab_exinfo_item = new sCombo('.tab_detail_cont .select_custom.deal_opt_item.forExinfo');

		// 상품선택 옵션 : 상세정보 > 상품 > 팝업
		var pop_desc_option01 = new sCombo('.pd_descrp_pop .select_custom.deal_opt_item');
		//var pop_desc_option02 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt1');
		//var pop_desc_option03 = new sCombo('.pd_detail .opt_select .select_custom.deal_opt2');

		/* 상품옵션변경 팝업 > 수량조절 */
		//수량1개 이하 감소버튼 비활성화 
		var valItemCount = $('.option_box .result_item .number_count input').val();
		if ( valItemCount == 1 ) {
			$(' .option_box .result_item .number_count .minus').addClass('min_val');
		} 

		
		
		// 탭별 선택시 기본 상품 설정
		let selIdx = 0;
		$('.tab_detail_cont.pd_delivery').find('.combo .list li').each(function() { 
			if (typeof ($(this).attr('aria-disabled')) == 'undefined' || !$(this).attr('aria-disabled')){
				return false;
			}
			selIdx ++;
		});
		$('.tab_detail_cont.pd_delivery').find('.combo .list li').eq(selIdx).trigger("click");
		$('.tab_detail_cont.pd_qnalist').find('.combo .list li').eq(selIdx).trigger("click");
		$('.tab_detail_cont.pd_review').find('.combo .list li').eq(selIdx).trigger("click");
		
	});

	function buy_nc_req(cartSqArr) {
		let data = {  cartSqArr : cartSqArr
			, backUrl : location.href
			, goodsUrl : _PAGE_GOODS_DETAIL
		};
		let jsonData = JSON.stringify(data);
	
		$.ajax( {
			type		: "POST",
			url 		: "/pg/nPayReq",
			dataType 	: 'json',
			data		: jsonData,
			beforeSend : function(xhr, settings) {
				xhr.setRequestHeader("AJAX"			, "true");
				xhr.setRequestHeader('Accept'		, 'application/json');
				xhr.setRequestHeader('Content-Type'	, 'application/json');
			},
			error: function(xhr, status, error) {
				mcxDialog.alert(status + '; ' + error);
			},
			success : function(result) {
				if (result.state == "sucess") {
					enp('create', 'conversion', 'is24', { device: 'W', paySys: 'naverPay' });	// 모비온 네이버주문형 클릭시
					window.open('about:blank', 'popupView');
					document.nPayForm.target = 'popupView';
					document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;
					document.nPayForm.submit();
				} else {
					mcxDialog.alert(result.message);
				}
			}
		});
		
	}
	
	window.onload = function(){
		// 위시처리- 로그인 되어 있을시
  		if (cfCheckLogin()) {
  			//이상품과 함께본 상품
  			let targetT = $('#goodsTogetherbArea').find('.item_state').find('button');
  			//let targetTSize = targetT.length;
  			targetT.each(function(){
  				let goodsCd = $(this).attr('goodscd');
  				var $this = $(this);
  				let url = "/mypage/wish/list/check/"+goodsCd;
  				var result = '';
  				$.ajax({
  					type: 'get'
  					, async: false
  					, url: url
  					, success: function (data) {
  						//likeit active
  						if ("Y" == data){
  							$this.addClass('likeit').addClass('active');
  						}
  					}
  				});
  			});
  		}
	}
	
	// 광고 스크립트용
	var goodsNavigation = [[${goodsNavigation}]];
	var cate1No = "";
	var cate2No = "";
	var cate3No = "";
	var cate4No = "";
	var cate5No = "";
	var cate1Nm = "";
	var cate2Nm = "";
	var cate3Nm = "";
	var cate4Nm = "";
	var cate5Nm = "";
	if (!gagajf.isNull(goodsNavigation)) {
		cate1No = goodsNavigation.cate1No;
		cate2No = goodsNavigation.cate2No;
		cate3No = goodsNavigation.cate3No;
		cate4No = goodsNavigation.cate4No;
		cate5No = goodsNavigation.cate5No;
		cateNm  = cate3No;
		cate1Nm = goodsNavigation.cate1Nm;
		cate2Nm = goodsNavigation.cate2Nm;
		cate3Nm = goodsNavigation.cate3Nm;
		cate4Nm = goodsNavigation.cate4Nm;
		cate5Nm = goodsNavigation.cate5Nm;
	}
	// 광고 스크립트용
	
	var snsGoodsImg = _uploadGoodsUrl + "/"+  [[${goodsInfo.sysImgNm}]];
	var snsUrl = location.protocol + _PAGE_GOODS_DETAIL + params.goodsCd;
	if (typeof (params.colorCd) != 'undefined') snsUrl += "&colorCd=" + params.colorCd;
	var snsGoodsFullNm = [[${goodsInfo.goodsFullNm}]];
	
	<!-- 페이스북 카카오스토리 연동 관련 메타태그 -->
	$("meta[property='og:url']").attr('content', snsUrl);
	$("meta[property='og:title']").attr('content', snsGoodsFullNm);
	$("meta[property='og:description']").attr('content', snsGoodsFullNm);
	$("meta[property='og:image']").attr('content', snsGoodsImg);
	$("meta[property='og:type']").attr('content', "article");
	
	<!-- 트위터 관련 메타태그 -->
	$("meta[name='twitter:url']").attr('content', snsUrl);
	$("meta[name='twitter:title']").attr('content', snsGoodsFullNm);
	$("meta[name='twitter:description']").attr('content', snsGoodsFullNm);
	$("meta[name='twitter:image']").attr('content', snsGoodsImg);
	
	// 추천솔류션 meta 설정
	$("meta[property='eg:type']").attr('content',"product");
	$("meta[property='eg:cuid']").attr('content',eglqueueCuid);
	$("meta[property='eg:itemId']").attr('content', [[${goodsInfo.goodsCd}]] );
	$("meta[property='eg:itemName']").attr('content',[[${goodsInfo.goodsFullNm}]] );
	$("meta[property='eg:itemImage']").attr('content', snsGoodsImg);
	$("meta[property='eg:itemUrl']").attr('content',snsUrl);
	$("meta[property='eg:originalPrice']").attr('content',[[${goodsInfo.listPrice}]]);
	$("meta[property='eg:salePrice']").attr('content',[[${goodsInfo.currPrice}]]);
	$("meta[property='eg:category1']").attr('content',cate1No);
	$("meta[property='eg:category2']").attr('content',cate2No);
	$("meta[property='eg:category3']").attr('content',cate3No);
	$("meta[property='eg:category4']").attr('content',cate4No);
	$("meta[property='eg:category5']").attr('content',cate5No);
	$("meta[property='eg:category1_name']").attr('content',cate1Nm);
	$("meta[property='eg:category2_name']").attr('content',cate2Nm);
	$("meta[property='eg:category3_name']").attr('content',cate3Nm);
	$("meta[property='eg:category4_name']").attr('content',cate4Nm);
	$("meta[property='eg:category5_name']").attr('content',cate5Nm);
	$("meta[property='eg:brandId']").attr('content',[[${goodsInfo.brandGroupNo}]]);
	$("meta[property='eg:brandName']").attr('content',[[${goodsInfo.brandGroupNm}]]);
	$("meta[property='eg:regDate']").attr('content',[[${goodsInfo.regDt}]].toDate("YYYYMMDDHHmmss").format("YYYY-MM-DDTHH:mm:ssZ"));
	$("meta[property='eg:updateDate']").attr('content',[[${goodsInfo.updDt}]].toDate("YYYYMMDDHHmmss").format("YYYY-MM-DDTHH:mm:ssZ"));
	$("meta[property='eg:stock']").attr('content',[[${goodsInfo.goodsStockQty}]]);
	$("meta[property='eg:state']").attr('content',[[${goodsInfo.goodsStat}]]);
	$("meta[property='eg:description']").attr('content',null);
	$("meta[property='eg:extraImage']").attr('content',null);
	$("meta[property='eg:locale']").attr('content',"KR");
	$("meta[property='eg:isNew']").attr('content',([[${goodsInfo.formalGb}]] == 'G009_10')? 'True' :'False');
	$("meta[property='eg:etc1']").attr('content', [[${goodsInfo.selfGoodsYn}]]);
/*]]>*/
</script>

<!-- 광고 스크립트 -->
<th:block th:replace="~{web/common/advertisements/GoodsDetailScriptsWeb :: scripts}"></th:block>
<!-- //광고 스크립트 -->
</th:block>

</body>
</html>