<!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/MypageLayoutWeb">
<!--
 *******************************************************************************
 * @source  : MypageReviewFormWeb.html
 * @desc    : 마이페이지 > 리뷰 Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2021 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.03.24   sowon     최초 작성
 *******************************************************************************
 -->
<body>
<th:block layout:fragment="content">
		<div class="content myReviewWrite"> <!-- 페이지특정 클래스 = myReviewWrite -->
				<div class="cont_body">
					<!-- CONT-BODY -->
					<div class="lnb">
						<div class="lnb_tit">
							<h2>마이페이지</h2>
						</div>
						<div class="lnb_list">
							<ul id="mypageLnbList"></ul>
						</div>
					</div>
					<div class="cont">
						<div class="sec_head">
							<h3 class="subH1">리뷰</h3>
						</div>
						<div class="sec_body">
							<div class="com_info_txt">
								<p class="tit">리뷰 안내</p>
								<ul>
									<li>일반 리뷰 작성 시 150P, 포토/영상 리뷰는 350P가 추가 적립됩니다!</li>
									<li>상품기준, 월 최대 10개의 상품까지 작성 및 적립 가능합니다.(동일상품의 옵션만 상이한 경우는 적립되지 않음)</li>
									<li>베스트 리뷰로 선정되면 10,000P가 추가 적립됩니다!</li>
									<li>리뷰는 주문일 기준 90일간 작성이 가능합니다.</li>
								</ul>
							</div>
							<form class="form_wrap" id="reviewForm" th:action="@{'/mypage/review/save'}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
								<input type="hidden" name="ordNo" th:value="${reviewInfo.ordNo}">
								<input type="hidden" name="ordDtlNo" th:value="${reviewInfo.ordDtlNo}">
								<input type="hidden" name="goodsCd" th:value="${reviewInfo.goodsCd}">
								<input type="hidden" name="custNo" th:value="${reviewInfo.custNo}">
								<input type="hidden" name="reviewStat" th:value="${reviewStat}">
								<input type="hidden" name="reviewSq" th:if="${reviewStat == 'u'}" th:value="${reviewInfo.reviewSq}">
								<h4 class="subH3">리뷰쓰기</h4>
								<div class="part_goods">
									<div class="goods_cont">
										<!-- 주문상품 -->

										<div class="goods_info">
											<div class="order_desc">
												<div class="goods_box">
													<div class="gd_item">
														<a th:onclick="cfnGoToGoodsDetail([[${ reviewInfo.goodsCd}]])" >
															<span class="thumb">
																<img th:src="${imageUrl + '/' + reviewInfo.sysImgNm +'?RS=550'}" width="100%" alt="">
															</span>
															<p>
																<span class="buy_date"><em th:text="${reviewInfo.ordDt}"></em>&nbsp;구매</span>
															</p>
															<p>
																<span class="brand" th:text="${reviewInfo.brandNm}"></span>
																<!-- <span class="tag">STYLE24 일반배송</span> -->
															</p>
															<p>
																<span class="name" th:text="${reviewInfo.goodsNm}"></span>
															</p>
														</a>
													</div>
													<div class="gd_opt">
														<div class="option_wrap">
															<span class="title sr-only">주문 옵션</span>
															<div id="optionDiv"><span class="option"></span></div>

														</div>
													</div>
												</div>
											</div>
										</div>

										<!-- //주문상품 -->
									</div>
								</div>

								<h4 class="subH3">별점 선택</h4>
								<div class="tbl type1">
									<table>
										<colgroup>
											<col width="170">
											<col width="*">
										</colgroup>
										<tr>
											<th>
												별점
											</th>
											<td>
												<div class="input_starscore" id="star">
													<input type="hidden" id="score" name="score">
													<button type="button" id="starBtn"></button>
													<button type="button" id="starBtn"></button>
													<button type="button" id="starBtn"></button>
													<button type="button" id="starBtn"></button>
													<button type="button" id="starBtn"></button>
												</div>
											</td>
										</tr>
									</table>
								</div>

								<h4 class="subH3">키 / 몸무게</h4>
								<div class="tbl type1">
									<table>
										<colgroup>
											<col width="170">
											<col width="*">
										</colgroup>
										<tr>
											<th>
												키
											</th>
											<td>
												<div class="input_my_physical">
													<div class="form_field">
														<div class="input_wrap">
															<input type="text" class="form_control" placeholder="숫자만 입력해 주세요." data-valid-type="numeric" maxlength="3" id="height" name="height">
															<span class="unit">cm</span>
														</div>
													</div>
												</div>
											</td>
										</tr>
										<tr>
											<th>
												몸무게
											</th>
											<td>
												<div class="input_my_physical">
													<div class="form_field">
														<div class="input_wrap">
															<input type="text" class="form_control" placeholder="숫자만 입력해 주세요." data-valid-type="numeric" maxlength="3" id="weight" name="weight">
															<span class="unit">kg</span>
														</div>
													</div>
												</div>
											</td>
										</tr>
									</table>
								</div>

								<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B' or reviewInfo.sizeGb == 'S'}">
								<h4 class="subH3">상품 평가</h4>
								<div class="tbl type1">
									<table>
										<colgroup>
											<col width="170">
											<col width="*">
										</colgroup>
										<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B' or reviewInfo.sizeGb == 'S'}">
										<tr>
											<th>
												사이즈
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreSize" id="rdi_review_size1" value="1">
															<label for="rdi_review_size1"><span>작음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreSize" id="rdi_review_size2" value="2">
															<label for="rdi_review_size2"><span>딱맞음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreSize" id="rdi_review_size3" value="3">
															<label for="rdi_review_size3"><span>큼</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										<tr>
											<th>
												컬러
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreColor" id="rdi_review_color1" value="1">
															<label for="rdi_review_color1"><span>밝음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreColor" id="rdi_review_color2" value="2">
															<label for="rdi_review_color2"><span>똑같음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreColor" id="rdi_review_color3" value="3">
															<label for="rdi_review_color3"><span>어두움</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										</th:block>
										<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B'}">
										<tr>
											<th>
												핏
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreFit" id="rdi_review_fit1" value="1">
															<label for="rdi_review_fit1"><span>슬림</span></label>
														</div>
														<div>
															<input type="radio" name="scoreFit" id="rdi_review_fit2" value="2">
															<label for="rdi_review_fit2"><span>레귤러</span></label>
														</div>
														<div>
															<input type="radio" name="scoreFit" id="rdi_review_fit3" value="3">
															<label for="rdi_review_fit3"><span>오버</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										<tr>
											<th>
												두께감
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreThick" id="rdi_review_thick1" value="1">
															<label for="rdi_review_thick1"><span>얇음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreThick" id="rdi_review_thick2" value="2">
															<label for="rdi_review_thick2"><span>적당함</span></label>
														</div>
														<div>
															<input type="radio" name="scoreThick" id="rdi_review_thick3" value="3">
															<label for="rdi_review_thick3"><span>도톰함</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										</th:block>
										<th:block th:if="${reviewInfo.sizeGb == 'S'}">
										<tr>
											<th>
												무게감
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreWeight" id="rdi_review_weight1" value="1">
															<label for="rdi_review_weight1"><span>가벼움</span></label>
														</div>
														<div>
															<input type="radio" name="scoreWeight" id="rdi_review_weight2" value="2">
															<label for="rdi_review_weight2"><span>적당함</span></label>
														</div>
														<div>
															<input type="radio" name="scoreWeight" id="rdi_review_weight3" value="3">
															<label for="rdi_review_weight3"><span>무거움</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										<tr>
											<th>
												볼너비
											</th>
											<td>
												<div class="input_simple_review">
													<div class="form_field">
														<div>
															<input type="radio" name="scoreBall" id="rdi_review_width1" value="1">
															<label for="rdi_review_width1"><span>작음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreBall" id="rdi_review_width2" value="2">
															<label for="rdi_review_width2"><span>딱맞음</span></label>
														</div>
														<div>
															<input type="radio" name="scoreBall" id="rdi_review_width3" value="3">
															<label for="rdi_review_width3"><span>큼</span></label>
														</div>
													</div>
												</div>
											</td>
										</tr>
										</th:block>
									</table>
								</div>
								</th:block>
								<h4 class="subH3">고객님의 리뷰가 다른 고객들에게 도움이 될 수 있어요!</h4>
								<div class="tbl type1">
									<table>
										<colgroup>
											<col width="170">
											<col width="*">
										</colgroup>
										<tr>
											<th>
												리뷰내용
											</th>
											<td>
												<div class="input_txt_review">
													<div class="form_field">
														<div class="input_wrap">
															<textarea class="doc_review" name="reviewContent" id="reviewContent" cols="30" rows="10" placeholder="·&nbsp;리뷰 내용은 최소 10자 이상 입력해 주세요.&#13;&#10;·&nbsp;상품과 무관하거나 스팸, 음란, 불법적인 내용의 리뷰는 통보 없이 삭제되며, 지급한 포인트는 회수 될 수 있습니다.&#13;&#10;·&nbsp;리뷰 등록 후 관리자 승인이 필요한 경우 바로 노출이 되지 않을 수 있습니다." style="resize: none;" maxlength="500"></textarea>
															<p class="txt_cnt"><span id="review_cnt" class="c_primary">0</span>/500</p>
														</div>
													</div>
												</div>
											</td>
										</tr>
										<tr>
											<th>
												포토/영상 첨부
											</th>
											<td>
												<div class="form_field">
													<div class="input_wrap">
														<!-- 이미지첨부 -->
														<div class="form_field">
															<div class="imgUpload">
																<label for="fileAdd" class="fileAdd" id="fileAdd_reply">첫번째업로드</label>
																<input type="file" id="fileAdd" name="files">
															</div>
														</div>
														<!-- //이미지첨부 -->
													</div>
												</div>
												<div class="txt_info">
													<ul>
														<li>
															최대 10개까지 등록 가능
														</li>
														<!-- 210419_수정 : 텍스트 추가 -->
														<li>
															동영상 첨부 시 관리자 승인이 필요하여 바로 노출이 되지 않을 수 있습니다.
														</li>
														<!-- //210419_수정 : 텍스트 추가 -->
													</ul>
												</div>
											</td>
										</tr>
									</table>
								</div>

								<div class="btn_footer_area">
									<button type="button" class="btn btn_default btn_md" onclick="reviewCancel()"><span>취소</span></button>
									<button type="button" id="btn_review_registration" class="btn btn_dark btn_md" th:if="${reviewStat == 'c'}" onclick="reviewCreate()"><span>리뷰 등록</span></button>
									<button type="button" id="btn_review_registration" class="btn btn_dark btn_md" th:if="${reviewStat == 'u'}" onclick="reviewUpdate()"><span>리뷰 수정</span></button>
								</div>
							</form>
						</div>
					</div>
					<!-- // CONT-BODY -->
				</div>
			</div>
<script type="text/javascript" src="/ux/plugins/gaga/gaga.kollus.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/exif-js"></script> -->
<script src="/ux/plugins/gaga/gaga.paging.js"></script>
<script th:inline="javascript">
let reviewList = [[${reviewInfo}]];
let reviewStat = [[${reviewStat}]];
let reviewAttach = [[${alreadyReviewAttach}]];

// 별점 class="on"
var $starEls = $('#star button#starBtn');
var rate = 1;

$starEls.each(function (index, el) {
    $(el).on('click', function () {
        rating(index);
        $("#score").attr("value",index+1);
    });
});

function rating(score) {
    $starEls.each(function (i, el) {
        if (i <= score) {
            $(el).addClass('on');
        } else {
            $(el).removeClass('on');
        }
    });

    rate = score;
}

// 리뷰  취소
var reviewCancel = function() {

	mcxDialog.confirm('취소하시겠습니까?', {
        cancelBtnText: "취소",
        sureBtnText: "확인",
        sureBtnClick: function(){
        	cfnGoToPage(_PAGE_MYPAGE_REVIEW);
        }
    });
}
var reviewValidation = function() {


}

// 리뷰 등록
var reviewCreate = function () {
	if($("#score").val()=='' || $("#score").val()==null){
		mcxDialog.alert('별점을 선택하세요.');
		return;
	}

	// 2021.08.11 이슈리스트 수정사항 선택값으로등록
	//if($("#reviewForm input[name=height]").val() == '' || $("#reviewForm input[name=height]").val() == null){
	//	mcxDialog.alert('키를 입력하세요.');
	//	return;
	//}

	//if($("#reviewForm input[name=weight]").val() == '' || $("#reviewForm input[name=weight]").val() == null){
	//	mcxDialog.alert('몸무게를 입력하세요.');
	//	return;
	//}

	if(reviewList.sizeGb == 'T' || reviewList.sizeGb == 'B' || reviewList.sizeGb == 'S'){
		if($('#reviewForm input:radio[name=scoreSize]:checked').length == 0){
			mcxDialog.alert('상품 사이즈를 평가해주세요.');
			return false;
		}

		if($('#reviewForm input:radio[name=scoreColor]:checked').length == 0){
			mcxDialog.alert('상품 컬러를 평가해주세요.');
			return false;
		}
	}

	if(reviewList.sizeGb == 'T' || reviewList.sizeGb == 'B'){
		if($('#reviewForm input:radio[name=scoreFit]:checked').length == 0){
			mcxDialog.alert('상품 핏을 평가해주세요.');
			return false;
		}
		if($('#reviewForm input:radio[name=scoreThick]:checked').length == 0){
			mcxDialog.alert('상품 두께감을 평가해주세요.');
			return false;
		}
	}

	if(reviewList.sizeGb == 'S' ){
		if($('#reviewForm input:radio[name=scoreWeight]:checked').length == 0){
			mcxDialog.alert('상품 무게감을 평가해주세요.');
			return false;
		}

		if($('#reviewForm input:radio[name=scoreBall]:checked').length == 0){
			mcxDialog.alert('상품 볼넓이를 평가해주세요.');
			return false;
		}
	}

	if($('#reviewContent').val().length<10){
		mcxDialog.alert("리뷰 내용을 10자 이상 입력해주세요.");
		return false;
	}


	mcxDialog.confirm('리뷰를 등록하시겠습니까?', {
        cancelBtnText: "취소",
        sureBtnText: "확인",
        sureBtnClick: function(){
        	gagajf.ajaxFormSubmit($('#reviewForm').prop('action'), '#reviewForm', fnSaveCallback, true);
        }
    });
}

// 리뷰 수정
var reviewUpdate = function() {

	if($("#reviewForm input[name=height]").val() == '' || $("#reviewForm input[name=height]").val() == null){
		mcxDialog.alert('키를 입력하세요.');
		return;
	}

	if($("#reviewForm input[name=weight]").val() == '' || $("#reviewForm input[name=weight]").val() == null){
		mcxDialog.alert('몸무게를 입력하세요.');
		return;
	}

	if($('#reviewContent').val().length<10){
		mcxDialog.alert("리뷰 내용을 10자 이상 입력해주세요.");
		return;
	}

	mcxDialog.confirm('리뷰를 수정하시겠습니까?', {
        cancelBtnText: "취소",
        sureBtnText: "확인",
        sureBtnClick: function(){
        	gagajf.ajaxFormSubmit("/mypage/review/update", '#reviewForm', fnUpdateCallback);
        }
    });
}

var fnSaveCallback = function (result) {
	// 2021.08.11
	if(result.status == "200"){
		if (result.resultStr == "SUCESS") {
			if (document.getElementsByName("kufKeyArr").length>0 || document.getElementsByName("orgFileNmArr").length>0) {
				mcxDialog.confirm("상품리뷰를 등록 하였습니다. 350P 적립 예정입니다.", {
					sureBtnText: "확인",
					sureBtnClick: function() {
						cfnGoToPage(_PAGE_MYPAGE_REVIEW);
					}
				});
			}else{
				mcxDialog.confirm("상품리뷰를 등록 하였습니다. 150P 적립 예정입니다.", {
					sureBtnText: "확인",
					sureBtnClick: function() {
						cfnGoToPage(_PAGE_MYPAGE_REVIEW);
					}
				});
			}
		}
		else {
			mcxDialog.confirm("상품리뷰를 등록 하였습니다.", {
				sureBtnText: "확인",
				sureBtnClick: function() {
					cfnGoToPage(_PAGE_MYPAGE_REVIEW);
				}
			});
		}
	}
}

var fnUpdateCallback = function (result) {
	if(result.status == "200"){
		mcxDialog.confirm("상품 리뷰를 수정하였습니다.", {
			sureBtnText: "확인",
			sureBtnClick: function() {
				cfnGoToPage(_PAGE_MYPAGE_REVIEW);
			}
		});

	}
}


// 글자 카운팅
$('#reviewContent').keyup(function (e){
    var content = $(this).val();
    $('.txt_cnt').html('<span id="review_cnt" class="c_primary">'+content.length+'</span>/500');    //글자수 실시간 카운팅


    if (content.length > 500){
        $(this).val(content.substring(0, 500));
        $('.txt_cnt').html('<span id="review_cnt" class="c_primary">500</span>/500');
    }
});

$('#fileAdd').on('change', function() { fnChooseFile(this); });

var fnChooseFile = function(obj) {
	var picLength = $(".pics").length;
	// multiple 속성이 있으면 files에는 다수의 객체가 할당됨
	var file = obj.files[0];
	var fileType = file.type;

	if (!gagajf.isNull(file.name)) {
		var extension = "\.(jpg|jpeg|png)$";
		if ((new RegExp(extension, "i")).test(file.name)) {
			if ( file.size > (10 * 1000000)) {
				mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
					sureBtnText: "확인",
					sureBtnClick: function() {
						$(".pics").find(".removes").eq(0).trigger('click');
					}
				});
				return false;
			}

			 gagajf.ajaxFileUpload('/common/file/upload?subDir=/review'
						, file
						, function(result) {
							// 업로드한 파일명 설정
							$(".pics").children().eq(0).append("<input type='hidden' name='orgFileNmArr' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
							$(".pics").children().eq(0).append("<input type='hidden' name='sysFileNmArr' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");
						}
				);
		}else{
			if ( file.size > (50 * 1000000)) {
				mcxDialog.alertC('동영상은 최대 50MB 이하 파일만 가능합니다.', {
					sureBtnText: "확인",
					sureBtnClick: function() {
						$(".pics").find(".removes").eq(0).trigger('click');
					}
				});
				return false;
			}

			setTimeout(function(){
				$(".imgUpload").find('.pics').eq(0).addClass("mov");
				$(".pics").children().eq(0).append("<input type='hidden' name='kufKeyArr' id='kufKey"+(picLength+1)+"'>");
				$(".pics").children().eq(0).append("<input type='hidden' name='kmcKeyArr' id='kmcKey"+(picLength+1)+"'>");
				gagaKollus.upload('Review', file, $('#kufKey'+(picLength+1)));
			}, 1000);
		}/* else{
			mcxDialog.alertC('첨부할 수 없는 파일 형식입니다.', {
				sureBtnText: "확인",
				sureBtnClick: function() {
					$(".pics").find(".removes").eq(0).trigger('click');
				}
			});
			return false;
		} */
	}

}


$(document).ready(function() {
	if (reviewList.goodsType == 'G056_S') {
		$.each(reviewList.colorNmArr, function(index, option) {
			$("#optionDiv").append('<span class="option">'+reviewList.itemNmArr[index] + ' / ' + option + '</span>');
		});
	}else{
		$(".option").append(reviewList.optCd1+"&nbsp;/&nbsp;"+reviewList.optCd2);
	}

	 if(reviewStat=='u'){
		 var reviewScore = reviewList.score;
		 $("#score").val(reviewScore);
		 rating(reviewScore-1);
		$("#reviewForm input[name=height]").val(reviewList.height);
		$("#reviewForm input[name=weight]").val(reviewList.weight);
		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());
		if(reviewList.scoreSize == "1"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreSize == "2"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreSize == "3"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreColor == "1"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreColor == "2"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreColor == "3"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreFit == "1"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreFit == "2"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreFit == "3"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreThick == "1"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreThick == "2"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreThick == "3"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreWeight == "1"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreWeight == "2"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreWeight == "3"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreBall == "1"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreBall == "2"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreBall == "3"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="3"]').prop('checked', true);
		}

		if(reviewAttach.length>0){
			for (var i = 0; i < reviewAttach.length; i++) {
				if(reviewAttach[i].reviewSq == reviewList.reviewSq){
					if(reviewAttach[i].fileGb == "I"){
						$("<span class=\"pics\">" +
								"<img class=\"picsThumbs\" src=\"" + _uploadImageUrl + '/' + reviewAttach[i].sysFileNm + "\" />" +
								"<input type='hidden' name='orgFileNmArr' value='"+reviewAttach[i].orgFileNm+"'>" +
								"<input type='hidden' name='sysFileNmArr' value='"+reviewAttach[i].sysFileNm+"'>" +
								"<br/><span class=\"removes\">Removes image</span>" +
								"</span>").insertAfter("#fileAdd");
					}else{
						$("<span class=\"pics mov\">" +
								"<img class=\"picsThumbs\" src=\"" + _kollusMediaUrl + '/poster/' + reviewAttach[i].kmcKey + "\"/>" +
								"<input type='hidden' name='kmcKeyArr' value='" + reviewAttach[i].kmcKey + "'>" +
								"<input type='hidden' name='kufKeyArr' value='" + reviewAttach[i].kufKey + "'>" +
								"<br/><span class=\"removes\">Removes image</span>" +
								"</span>").insertAfter("#fileAdd");
					}
				}

			}
			$(".removes").click(function(){
				$(this).parent(".pics").remove();
			});

		}
	}
	// 마이페이지 LNB 설정
	fnSetMypageLnbList(7);

	// 마이페이지 location 설정
	fnSetMypageLocation('리뷰', '_PAGE_MYPAGE_REVIEW');

});
</script>
</th:block>

</body>
</html>


