//**************** 검색 상품리스트  start **********************************
var categoryGoodsList = [];
var cnt = 1;
var email = '';
var fnCreateGoodsList = function(result, ithrCd, contentLoc, goodsUrl, lastPage, endRow, appGb, keyWord) {
	console.log('search fnCreateGoodsList');
	var tag = '';
	var rank = 0;
	var cnt = 1;
	if(lastPage!='1'){
		rank = endRow;
	}

	$.each(result.dataList, function(idx, item) {
		if (idx < 3) {
			categoryGoodsList.push(item.goodsCd);
		}
		if(!gagajf.isNull(item.goodsCd)){
			tag += '<div class="item_prod" >';
			tag += '	<div class="item_state';
			if(!gagajf.isNull(item.sizes)){
				var sizeArr = item.sizes.split(",");
				let soldOutCnt = 0;
				for(let i=0; i<sizeArr.length; i++){
					var sizeInfo = sizeArr[i].split(":");
					var sizeVal = sizeInfo[0];
					var soldOutYn = sizeInfo[1];
					if(soldOutYn=='Y'){
						soldOutCnt++;
					}
				}
				if(sizeArr.length==soldOutCnt){
					tag += ' soldout';
				}
			}
			tag += '">';
			tag += '		<button type="button" class="itemLike';
			if(item.likeIt == 'likeit'){
				tag += ' likeit';
			}
			tag += ' "';
			if(appGb == 'Mob'){
				tag += ' onClick="cfnMoPutWishList(this);" goodsCd=\''+item.goodsCd+'\', goodsNm=\'' + item.goodsFullNm + '\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
			}else{
				tag += ' onClick="cfnPutWishList(this);" goodsCd=\''+item.goodsCd+'\', goodsNm=\'' + item.goodsFullNm + '\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
			}

			tag += '<a href="javascript:void(0);" class="itemLink" onclick="fnClickGoodsCd(\''+item.goodsCd+'\',\'' + item.colorCd + '\',\'' + keyWord + '\',\'' + item.id + '\' );">';

			// ad
			if(item.adFlag == 'Y'){
				tag += '<div class="shape"><span>AD</span></div>';
			}

			tag += '			<div class="itemPic">';
			if(!gagajf.isNull(item.videos)){
				var videoArr = item.videos.split(",");
				var videoGb = '';
				var videoUrl = '';
				for(let i=0; i<videoArr.length; i++){
					var videoInfo = videoArr[i].split(":");
					videoGb = videoInfo[0];
					videoUrl = videoInfo[1];
				}
				if(videoGb=='Y'){
					tag += '<iframe id="pdThumbVideo" class="pd_mov" src="https://www.youtube.com/embed/'+videoUrl+'?autoplay=1&mute=1"></iframe>';
					//tag += '<iframe id="pdThumbVideo" class="pd_mov" src="http://v.kr.kollus.com/164MyIiv?enable_initialize_focus=false&autoplay&mute&controls_activation=none" allow="fullscreen" allowFullScreen></iframe>';
				}else{
					tag += '<iframe id="pdThumbVideo" class="pd_mov" src="'+_kollusMediaUrl+'/'+videoUrl+'?enable_initialize_focus=false&autoplay&mute&controls_activation=none" allow="video-autoplay" allowFullScreen></iframe>';
				}
			}
			var imgUrl = "//image.istyle24.com/Upload/ProductImage/";
			tag += '		<img class=" vLHTC pd_img" src="' + goodsUrl + '/' +item.sysImgNm.replace(imgUrl,"")+'" data-img="' + goodsUrl + '/' + item.sysImgNm2.replace(imgUrl,"")+'" onerror="noneImg(this)">';
			if(!gagajf.isNull(item.sizes) && item.selfGoodsYn=='Y'){
				var sizeArr = item.sizes.split(",");
				var minSize;
				var maxSize;
				var sizeVal = '';
				var soldOutYn = '';
				tag +='<div class="itemOpt">';

				if(sizeArr.length>5){
					for(let i=0; i<sizeArr.length; i++){
						var sizeInfo = sizeArr[i].split(":");
						sizeVal = sizeInfo[0];
						soldOutYn = sizeInfo[1];
						if(i==0){
							minSize = sizeVal;
						}else if(i==sizeArr.length-1){
							maxSize = sizeVal;
						}
					}
					tag +='	<div class="exc">';
					tag +='		<span>'+minSize+'</span> ~ <span>'+maxSize+'</span> 사이즈가 있습니다.';
					tag +='	</div>';
				}else{
					tag += '<ul>';
					for(let i=0; i<sizeArr.length; i++){
						var sizeInfo = sizeArr[i].split(":");
						sizeVal = sizeInfo[0];
						soldOutYn = sizeInfo[1];
						if(soldOutYn=='N'){
							tag +='		<li>'+sizeVal+'</li>';
						}else{
							tag +='		<li class="none">'+sizeVal+'</li>';
						}
					}
					tag += '</ul>';
				}
				tag += '			</div>';
			}

			tag += '			</div>';

			tag += '			<p class="itemBrand">'+item.brandGroupNm+'</p>';
			if(item.goodsTnm != null && item.goodsTnm != ''){
				tag += '			<div class="itemComment">'+item.goodsTnm+'</div>';
			}
			tag += '			<div class="itemName">'+item.goodsFullNm+'</div>';
			if(appGb != 'Mob'){
				if(item.goodsType=='G056_D'){
					tag += '			<p class="itemPrice">'+item.currPrice.addComma()+'~ ';
				}else{
					tag += '			<p class="itemPrice">'+item.currPrice.addComma()
				}
				if(item.currPrice != item.listPrice){
					tag += '				<span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
					if(item.listPrice != 0){
						tag += '				<span class="itemPercent">'+ Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) +'%</span>';
					}
				}
				tag += '			</p>';
			}else{
				tag += '			<p class="itemPrice">';
				if(item.currPrice != item.listPrice) {
					tag += '				<span class="itemPrice_original">' + item.listPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + '</span>';
				}
				if(item.goodsType=='G056_D'){
					tag += item.currPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +'~ ';
				}else{
					tag += item.currPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
				}
				if(item.currPrice != item.listPrice){
					if(item.listPrice != 0){
						tag += '				<span class="itemPercent">'+ Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) +'%</span>';
					}
				}
				tag += '			</p>';
			}

			tag += '			<div class="itemcolorchip">';
			if(!gagajf.isNull(item.colorChips)){
				var colorArr = item.colorChips.split(",");
				var colorCd = '';
				var rgbColor = '';
				for(let i=0; i<colorArr.length; i++){
					var colorInfo = colorArr[i].split(":");
					colorCd = colorInfo[0];
					rgbColor = colorInfo[1];
					if(rgbColor=='#FFFFFF'){
						tag += '	<span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>';
					}else{
						tag += '	<span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>';
					}
				}
			}
			tag += '			</div>';

			if(!gagajf.isNull(item.benefits)){
				var iconArr = item.benefits.split(",");
				var iconGb = '';
				var iconNm = '';
				tag += '	<p class="itemBadge">';
				let arrCnt;
				if(iconArr.length > 2){
					arrCnt = 3;
				}else{
					arrCnt = iconArr.length;
				}
				for(let i=0; i<arrCnt; i++){
					var iconInfo = iconArr[i].split(":");
					iconGb = iconInfo[0];
					iconNm = iconInfo[1];
					tag += '	<span class="badge13" value="'+iconGb+'">'+iconNm+' </span>';
				}
				tag += '	</p>';
			}

			tag += '		</a>';
			tag += '	</div>';
			tag += '</div>';
		}
		// if(appGb=='Mob'){
		// 	if(idx==1 && firstRow==1){
		// 		tag += adBannerTag;
		// 	}
		// }else{
		// 	if(idx==4 && firstRow==1){
		// 		tag += adBannerTag;
		// 	}
		// }

		if (cnt == 1) {
			// <!-- Criteo 카테고리/리스팅 태그 -->
			window.criteo_q = window.criteo_q || [];
			var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
			window.criteo_q.push(
				{event: "setAccount", account: 6762}, // 이 라인은 업데이트하면 안됩니다
				{event: "setEmail", email: criteoEmail}, // 유저가 로그인이 안되 있는 경우 빈 문자열을 전달
				{event: "setSiteType", type: deviceType},
				{event: "viewList", item: categoryGoodsList} // 가장 위에있는 3개의 상품 ID를 전달
			);
			// <!-- END 카테고리/리스팅 태그 -->
			cnt++;
		}
	});

	return tag;
}

// 인피니트 스크롤 초기화
var fnCategoryGoodsInfiniteScrollInit = function(){
	sessionStorage.removeItem(document.location.href);
	//History 초기화
	$("#listBox").html("");
}

var filterHtml = '';
var filterStatHtml = '';

// 공용,신상 조건
var fnFilterOption = function (obj, stat){
	var thisId = $(obj).attr('id');
	var tag = '';

	if(thisId == 'unisex'){
		if(stat=='on'){
			$(obj).attr('onclick','fnResetListIdx();fnFilterOption(this,\'off\');');
			$(obj).attr('checked', true);
			tag += '<input type="hidden" name="unisex" value="G007_Z"/>\n';
			$("#searchGoodsForm").append(tag);
		}else{
			$(obj).attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');
			$(obj).attr('checked', false);
			$("#searchGoodsForm input:hidden[name=unisex]").remove();
		}
	}else{
		if(stat=='on'){
			$(obj).attr('onclick','fnResetListIdx();fnFilterOption(this,\'off\');');
			$(obj).attr('checked', true);
			tag += '<input type="hidden" name="newGoods" value="40"/>\n';
			// tag += '<input type="hidden" name="benefitArr" value="40:신상"/>\n';
			$("#searchGoodsForm").append(tag);
		}else{
			$(obj).attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');
			$(obj).attr('checked', false);
			$("#searchGoodsForm input:hidden[name=newGoods]").remove();
			$("#searchGoodsForm input:hidden[name=benefitArr]").each(function(){
				if($(this).val() == "40:신상"){
					$(this).remove();
				}
			});
		}
	}
	fnSetFilterHtml();
	fnCategoryGoodsInfiniteScrollInit();
	fnSearchGoodsListSearch();
}

// 상품상세 필터 조회
var filterSel = function (obj, gubun, staus, sizeGb){
	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
	let $obj = $(obj);
	if(staus=='on'){
		filterStatHtml = '';
		if(gubun=='size'){
			$(obj).attr('onclick','fnResetListIdx();filterSel(this,\''+gubun+'\',\'off\',\''+sizeGb+'\');');
		}else{
			$(obj).attr('onclick','fnResetListIdx();filterSel(this,\''+gubun+'\',\'off\',\'\');');
		}

		$("#filterData").find('span').each(function(idx,item) {
			if(gubun=='color'){
				if($obj.attr('data-id').replace('#','').trim() == $(this).closest("span").attr('id')) {
					$(this).closest("span").remove();
				}
			}else{
				if($obj.attr('data-id') == $(this).closest("span").text()) {
					$(this).closest("span").remove();
				}
			}
		});
		filterStatHtml = $("#filterData").html();
	}else{
		if(gubun=='size'){
			$(obj).attr('onclick','fnResetListIdx();filterSel(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');');
		}else{
			$(obj).attr('onclick','fnResetListIdx();filterSel(this,\''+gubun+'\',\'on\',\'\');');
		}

		let tag = '';
		if(gubun=='color'){
			tag += '<span id="'+$obj.attr('data-id').replace('#','')+'">';
			if($obj.attr('data-id')=='#FFFFFF'){
				tag += '	<span class="pdColor-color" style="background-color: #'+$obj.attr('data-id')+';border:1px solid #aaa;" value="'+$obj.attr('data-id')+'"></span>';
			}else{
				tag += '	<span class="pdColor-color" style="background-color: #'+$obj.attr('data-id')+'" value="'+$obj.attr('data-id')+'"></span>';
			}
			tag += '	<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\');"></a >';
			tag += '</span>';
		}else{
			tag += '<span>'+$obj.attr('data-id');
			if(!gagajf.isNull(sizeGb)){
				tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');"></a >';
			}else{
				tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\',\'\');"></a >';
			}
			tag += '</span>';
		}

		$("#filterData").append(tag);

		filterStatHtml += tag;
	}

	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
	fnFilterSet(gubun, sizeGb);
}

var fnFilterSet = function (searchId, sizeGb, appGb){
	fnCategoryGoodsInfiniteScrollInit();
	$("#searchGoodsForm input:hidden[name="+searchId+"Arr]").remove();
	var tag = '';
	var mobTag = '';
	if(searchId=='size'){
		$('#filterForm input[name='+searchId+']:checked').each(function(){
			tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).attr('data-id')+'"/>\n';
			$("#searchGoodsForm").append(tag);
		});
	}else{
		$('#filterForm input[name='+searchId+']:checked').each(function(){
			tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).val()+'"/>\n';
			$("#searchGoodsForm").append(tag);
		});
		if(searchId=='benefit'){
			if ($('#newGoods').is(":checked")) {
				// tag = '<input type="hidden" name="'+searchId+'Arr" value="40:신상"/>\n';
				$("#searchGoodsForm").append(tag);
			}
		}
	}

	if(appGb == 'Mob'){
		var data = '';
		var tag = '';
		var filterSet = '';
		$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
		$('#filterForm input[name='+searchId+']:checked').each(function(idx){
			if(searchId=='color'){
				$('#'+searchId+'FilterDiv').find('.daps1').find('.pic').find('span').html('');
				var mobTag = '';
				var color = $(this).attr('data-id');
				if(color=='FFFFFF'){
					mobTag += '<span class="pdColor-color" style="background-color:#'+color+';border:1px solid #aaa;"></span>';
				}else{
					mobTag += '<span class="pdColor-color" style="background-color:#'+color+'"></span>';
				}
				$("#"+searchId+"FilterDiv").find('.daps1').find('.pic').append(mobTag);
			}else{
				$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
				if(idx>0){
					data += ',';
				}
				data += $(this).attr('data-id');
				$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
			}
		});

	}
	fnSetFilterHtml();
	fnSearchGoodsListSearch();
}

var fnSetFilterHtml = function (gubun, staus, mobGb){
	filterHtml = '';

	$('#filterForm input[name=size]:checked').each(function(){
		filterHtml += '<input type="hidden" name="sizeArr" value="'+$(this).attr('data-id')+'"/>\n';
	});
	$('#filterForm input[name=brandGroup]:checked').each(function(){
		filterHtml += '<input type="hidden" name="brandGroupArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=age]:checked').each(function(){
		filterHtml += '<input type="hidden" name="ageArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=season]:checked').each(function(){
		filterHtml += '<input type="hidden" name="seasonArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=color]:checked').each(function(){
		filterHtml += '<input type="hidden" name="colorArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=benefit]:checked').each(function(){
		filterHtml += '<input type="hidden" name="benefitArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=price]:checked').each(function(){
		filterHtml += '<input type="hidden" name="priceArr" value="'+$(this).val()+'"/>\n';
	});
	$('#filterForm input[name=dcRate]:checked').each(function(){
		filterHtml += '<input type="hidden" name="dcRateArr" value="'+$(this).val()+'"/>\n';
	});
	let priceVal = '';
	if(!gagajf.isNull($("#filterForm input[name=hPriceFrom]").val())){
		// filterHtml += '<input type="hidden" name="priceFrom" value="'+$("#filterForm input[name=hPriceFrom]").val()+'"/>\n';
		priceVal += $("#filterForm input[name=hPriceFrom]").val().removeComma();
	}
	if(!gagajf.isNull($("#filterForm input[name=hPriceTo]").val())){
		// filterHtml += '<input type="hidden" name="priceTo" value="'+$("#filterForm input[name=hPriceTo]").val()+'"/>\n';
		priceVal += ',' + $("#filterForm input[name=hPriceTo]").val().removeComma();
	}
	filterHtml += '<input type="hidden" name="priceArr" value="'+priceVal+'"/>\n';

	let dcRateVal = '';
	if(!gagajf.isNull($("#filterForm input[name=hDcRateFrom]").val())){
		// filterHtml += '<input type="hidden" name="dcRateFrom" value="'+$("#filterForm input[name=hDcRateFrom]").val()+'"/>\n';
		dcRateVal += $("#filterForm input[name=hDcRateFrom]").val();
	}
	if(!gagajf.isNull($("#filterForm input[name=hDcRateTo]").val())){
		// filterHtml += '<input type="hidden" name="dcRateTo" value="'+$("#filterForm input[name=hDcRateTo]").val()+'"/>\n';
		dcRateVal += ',' + $("#filterForm input[name=hDcRateTo]").val();
	}
	filterHtml += '<input type="hidden" name="dcRateArr" value="'+dcRateVal+'"/>\n';

	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate1No]').val())){
		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate1No]').val()+'"/>\n';
	}
	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate2No]').val())){
		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate2No]').val()+'"/>\n';
	}
	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate3No]').val())){
		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate3No]').val()+'"/>\n';
	}
	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate4No]').val())){
		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate4No]').val()+'"/>\n';
	}
	if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate5No]').val())){
		filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate5No]').val()+'"/>\n';
	}
	if($('#filterForm').find("input:checkbox[id='unisex']").is(":checked") == true){
		filterHtml += '<input type="hidden" name="unisex" value="G007_Z"/>\n';
	}
	if($('#filterForm').find("input:checkbox[id='newGoods']").is(":checked") == true){
		filterHtml += '<input type="hidden" name="newGoods" value="40"/>\n';
	}

	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
}

// 상품상세 필터 삭제
var fnDeleteFilter = function (obj, gubun, staus, sizeGb){
	if(gubun=='size'){
		$("#"+gubun+"FilterDiv #sizeLi"+sizeGb).each(function(idx,item) {
			$('#sizeLi'+sizeGb+' .size_btn').each(function (){
				if($(obj).closest("span").text() == $(this).find('input').attr('data-id')){
					$(this).find('input').click();
				}
			});
		});
	}else{
		$("#"+gubun+"FilterDiv > ul > li").each(function(idx,item) {
			if(gubun == 'color'){
				if($(obj).closest("span").attr('id') == $(this).find('input').attr('data-id').trim()){
					$(this).find('input').click();
				}
			}else{
				if($(obj).closest("span").text() == $(this).find('input').attr('data-id')){
					$(this).find('input').click();
				}
			}
		});
	}

	$(obj).closest("span").remove();
	fnSetFilterHtml();
}

// 정렬 순서
var fnSortingChange = function (obj, sortingType, stat, appGb){
	fnCategoryGoodsInfiniteScrollInit();
	if(stat != 'back'){
		// if($("#searchGoodsForm input[name=sortingType]").val()==sortingType){
		// 	return;
		// }
	}

	if(appGb != 'Mob'){
		$("#sortArea").find('li').each(function (){
			$(this).find('a').attr('class','off');
		});
	}else{
		$("#sortArea").find('button').each(function (){
			$(this).removeClass("on");
		});
		$("#sorting"+sortingType).addClass("on");
		$("#filter").text($("#sorting"+sortingType).find('span').text());
	}

	$(obj).addClass("on");
	if(stat=='back'){
		$("#sorting"+sortingType).addClass("on");
	}
	$("#searchGoodsForm").find("[name=sortingType]").val(sortingType);
	$("#searchGoodsForm").find("[name=pageNo]").val(1);
	gagaInfiniteScroll.pageStatus.loadPage = 1;
	gagaInfiniteScroll.pageStatus.pageNum = [];
	gagaInfiniteScroll.pageStatus.sortingType = sortingType;

	$('#endPage').hide();
	$('#noFilterData').hide();
	fnSearchGoodsListSearch();
}

// 상품상세
var fnClickGoodsCd = function (goodsCd, mainColorCd, keyWord , searchId){
	let scrollpos = $(window).scrollTop();
	localStorage.setItem('scrollpos', scrollpos);
	gagajf.setCookie('scrollpos',scrollpos);
	cfnGoToGoodsDetail(goodsCd, mainColorCd,'','','','', keyWord , searchId);
}

// 카테고리 set test
var fnSetSearchCate = function (obj, status, cate1No, cate2No, cate3No, cate4No, cate5No){
	$('.fillter').show();
	$("#categorySpan").remove();
	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;

	$("#ulAllCate").find('li > a').each(function (){
		$(this).parent().find('li').removeClass("on");
		$(this).removeClass("on");
		$(this).attr('onclick','fnResetListIdx();fnSetSearchCate(this, \'off\','+$(this).attr('data1')+','+$(this).attr('data2')+','+$(this).attr('data3')+','+$(this).attr('data4')+','+$(this).attr('data5')+');');
	});

	if(status=='on'){
		// 필터 제거
		filterStatHtml = '';
		if($(obj).attr('data-depth') > 1){
			$(obj).attr('onclick','fnResetListIdx();fnSetSearchCate(this, \'off\','+$(obj).attr('data1')+','+$(obj).attr('data2')+','+$(obj).attr('data3')+','+$(obj).attr('data4')+','+$(obj).attr('data5')+');');
			$(obj).removeClass("on");
			$(obj).click();
			gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
			filterStatHtml = $("#filterData").html();
			// 상위카테고리 선택
			// let dep = $(obj).attr('data-depth') - 1;
			// if(dep>1){
			// 	$(obj).parent().parent().parent().parent().find('[data-depth='+dep+']').click();
			// }else{
			// 	$(obj).parent().parent().parent().parent().find('[data-depth='+dep+']').click();
			// 	$(obj).parent().parent().parent().parent().find('[data-depth='+dep+']').parent().find('.sub_cate').css('display','block');
			// }
			// gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
			// filterStatHtml = $("#filterData").html();
		}else{
			gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
			filterStatHtml = $("#filterData").html();
			fnSetCateFilter('', '', '', '', '');
		}
	}else{
		if($(obj).attr('data-depth')==1){
			$("#ulAllCate").find('li > a').each(function (){
				$(this).parent().find('li').removeClass("on");
				$(this).removeClass("on");
				$(this).attr('onclick','fnResetListIdx();fnSetSearchCate(this, \'off\','+$(this).attr('data1')+','+$(this).attr('data2')+','+$(this).attr('data3')+','+$(this).attr('data4')+','+$(this).attr('data5')+');');
			});
			$("#ulAllCate").find('li').each(function (){
				$(this).find('.sub_cate').css('display','none');
			});
			$(obj).attr('onclick','fnResetListIdx();fnSetSearchCate(this, \'off\','+$(obj).attr('data1')+','+$(obj).attr('data2')+','+$(obj).attr('data3')+','+$(obj).attr('data4')+','+$(obj).attr('data5')+');');
			$(obj).addClass("on");
		}else{
			$(obj).attr('onclick','fnResetListIdx();fnSetSearchCate(this, \'on\','+$(obj).attr('data1')+','+$(obj).attr('data2')+','+$(obj).attr('data3')+','+$(obj).attr('data4')+','+$(obj).attr('data5')+');');
			$(obj).addClass("on");
		}
		let tag = '';
		let cateNm = '';
		if(!gagajf.isNull(cate1No) || !gagajf.isNull(cate2No) || !gagajf.isNull(cate3No) || !gagajf.isNull(cate4No)){
			tag += '<span id="categorySpan">\n';
			if(!gagajf.isNull(cate1No)){
				cateFullNm = $(obj).attr("cateFullNm");
				cateNm  = cateFullNm;
			}
			if(!gagajf.isNull(cate2No)){
				cateFullNm = $(obj).attr("cateFullNm");
				cateNm  = cateFullNm;
			}
			if(!gagajf.isNull(cate3No)){
				cateFullNm = $(obj).attr("cateFullNm");
				cateNm  = cateFullNm;
			}
			if(!gagajf.isNull(cate4No)){
				cateFullNm = $(obj).attr("cateFullNm");
				cateNm  = cateFullNm;
			}
			tag += cateNm;
			tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteCategoryFilter(this);"></a>\n';
			tag += '</span>\n';
		}

		$("#filterData").append(tag);
		filterStatHtml += tag;

		gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
		fnSetCateFilter(cate1No, cate2No, cate3No, cate4No, cate5No);
	}
}

var fnDeleteCategoryFilter = function (obj){
	filterStatHtml = '';
	filterStatHtml = $("#filterData").html();
	$("#ulAllCate").find('li > a').each(function (){
		$(this).removeClass("on");
		$(this).parent().removeClass("on");
		$(this).parent().find('.sub_cate').css('display','none');
	});
	$("#searchGoodsForm input:hidden[name=cate1No]").remove();
	$("#searchGoodsForm input:hidden[name=cate2No]").remove();
	$("#searchGoodsForm input:hidden[name=cate3No]").remove();
	$("#searchGoodsForm input:hidden[name=cate4No]").remove();
	$("#searchGoodsForm input:hidden[name=cate5No]").remove();
	$(obj).closest("span").remove();
	fnSetFilterHtml();
	fnCategoryGoodsInfiniteScrollInit();
	fnSearchGoodsListSearch();
}

// 카테고리 set
var fnSetCateFilter = function (cate1No, cate2No, cate3No, cate4No, cate5No){
	fnCategoryGoodsInfiniteScrollInit();
	$("#searchGoodsForm input:hidden[name=cate1No]").remove();
	$("#searchGoodsForm input:hidden[name=cate2No]").remove();
	$("#searchGoodsForm input:hidden[name=cate3No]").remove();
	$("#searchGoodsForm input:hidden[name=cate4No]").remove();
	$("#searchGoodsForm input:hidden[name=cate5No]").remove();
	let tag = '';
	if(!gagajf.isNull(cate1No) || !gagajf.isNull(cate2No) || !gagajf.isNull(cate3No) || !gagajf.isNull(cate4No)){
		if(!gagajf.isNull(cate1No)){
			tag += '<input type="hidden" name="cate1No" value="'+cate1No+'"/>';
		}
		if(!gagajf.isNull(cate2No)){
			tag += '<input type="hidden" name="cate2No" value="'+cate2No+'"/>';
		}
		if(!gagajf.isNull(cate3No)){
			tag += '<input type="hidden" name="cate3No" value="'+cate3No+'"/>';
		}
		if(!gagajf.isNull(cate4No)){
			tag += '<input type="hidden" name="cate4No" value="'+cate4No+'"/>';
		}
		if(!gagajf.isNull(cate5No)){
			tag += '<input type="hidden" name="cate5No" value="'+cate5No+'"/>';
		}
	}

	$("#searchGoodsForm").append(tag);

	fnSetFilterHtml();
	fnSearchGoodsListSearch();
}

// 필터 가격 확인
var fnCheckPrice = function (data,priceLen){
	$("#priceSpan").remove();
	// $("#searchGoodsForm input:hidden[name=priceFrom]").remove();
	// $("#searchGoodsForm input:hidden[name=priceTo]").remove();
	$("#searchGoodsForm input:hidden[name=priceArr]").remove();
	let min = data.from;
	let max = data.to;
	$("#price_input_from").val(custom_values[0]);
	$("#price_input_to").val(custom_values[priceLen]);

	fnFilterSlider('price' , custom_values[min].addComma(), custom_values[max].addComma());
}

// 필터 할인율 확인
var fnCheckDcRate = function (data){
	$("#dcrateSpan").remove();
	// $("#searchGoodsForm input:hidden[name=dcRateFrom]").remove();
	// $("#searchGoodsForm input:hidden[name=dcRateTo]").remove();
	$("#searchGoodsForm input:hidden[name=dcRateArr]").remove();
	let min = data.from;
	let max = data.to;
	$("#price_input_from").val(0);
	$("#price_input_to").val(100);

	fnFilterSlider('dcrate' , custom_values02[min].replace('%',''), custom_values02[max].replace('%',''));
}


var fnFilterSlider = function (gubun, min, max){
	fnCategoryGoodsInfiniteScrollInit();
	let tag = '';
	let oriMin = '';
	let oriMax = '';
	filterHtml = '';
	filterStatHtml = '';
	filterStatHtml = $("#filterData").html();
	// $("#searchGoodsForm").find('input[name=priceFrom]').remove();
	// $("#searchGoodsForm").find('input[name=priceTo]').remove();
	// $("#searchGoodsForm").find('input[name=dcRateFrom]').remove();
	// $("#searchGoodsForm").find('input[name=dcRateTo]').remove();
	$("#searchGoodsForm").find('input[name=priceArr]').remove();
	$("#searchGoodsForm").find('input[name=dcRateArr]').remove();
	if(gubun=='price'){
		oriMin = $("#price_input_from").val();
		oriMax = $("#price_input_to").val();
	}else{
		oriMin = $("#dcrate_input_from").val();
		oriMax = $("#dcrate_input_to").val();
	}

	if(gubun=='price'){
		if(min!=max){
			tag += '<span id="priceSpan">'+ min +'원~'+max+'원';
		}else{
			tag += '<span id="priceSpan">'+max+'원';
		}
		$("#filterForm").find('input[name=hPriceFrom]').val(min);
		$("#filterForm").find('input[name=hPriceTo]').val(max);
	}else{
		if(min!=max){
			tag += '<span id="dcrateSpan">'+ min +'~'+max+'%';
		}else{
			tag += '<span id="dcrateSpan">'+max+'%';
		}
		$("#filterForm").find('input[name=hDcRateFrom]').val(min);
		$("#filterForm").find('input[name=hDcRateTo]').val(max);
	}
	tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilterSlider(this,\''+gubun+'\', \''+oriMin+'\', \''+oriMax+'\');"></a >';
	tag += '</span>';

	$("#filterData").append(tag);
	filterStatHtml += tag;

	var tag2 = '';
	if(gubun=='price'){
		tag2 += '<input type="hidden" name="priceArr" value="'+min.replace(",", "")+','+max.replace(",", "")+'"/>\n';
		$("#searchGoodsForm").append(tag2);
	}else{
		tag2 += '<input type="hidden" name="dcRateArr" value="'+min+','+max+'"/>\n';
		$("#searchGoodsForm").append(tag2);
	}
	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
	fnSetFilterHtml();
	fnSearchGoodsListSearch();
}

var fnDeleteFilterSlider = function (obj, gubun, minVal, maxVal){
	filterStatHtml = '';
	filterStatHtml = $("#filterData").html();
	if(gubun=='price'){
		$("#searchGoodsForm").find("input:hidden[name=priceArr]").remove();
		var $range = $(".dp .js-range-slider01, .sch_result .js-range-slider01");
		var $inputFrom = $("#price_input_from");
		var $inputTo = $("#price_input_to");
		var instance;

		instance = $range.data("ionRangeSlider");
		instance.update({
			from: 0
		});
		$inputFrom.val(minVal);

		instance.update({
			to: 5
		});
		$inputTo.prop("value",maxVal);
		$("#filterForm input:hidden[name=priceArr]").remove();
	}else{
		$("#searchGoodsForm").find("input:hidden[name=dcRateArr]").remove();
		var $range = $(".dp .js-range-slider02, .sch_result .js-range-slider02");
		var $inputFrom = $("#dcrate_input_from");
		var $inputTo = $("#dcrate_input_to");
		var instance;

		instance = $range.data("ionRangeSlider");
		instance.update({
			from: 0
		});
		$inputFrom.prop("value",minVal);

		instance.update({
			to: 10
		});
		$inputTo.prop("value",maxVal);
		$("#searchGoodsForm input:hidden[name=dcRateArr]").remove();
	}
	$(obj).closest("span").remove();
	fnSetFilterHtml();
	fnCategoryGoodsInfiniteScrollInit();
	fnSearchGoodsListSearch();
}

// 상품상세 필터 조회
var fnSelectFilerMob = function (obj, gubun, staus, sizeGb){
	gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
	gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
	let $obj = $(obj);
	if(staus=='on'){
		if(gubun=='size'){
			$(obj).attr('onclick','fnResetListIdx();fnSelectFilerMob(this,\''+gubun+'\',\'off\',\''+sizeGb+'\');');
		}else{
			$(obj).attr('onclick','fnResetListIdx();fnSelectFilerMob(this,\''+gubun+'\',\'off\',\'\');');
		}

		$("#filterData").find('span').each(function(idx,item) {
			if(gubun=='color'){
				if($obj.attr('data-id').replace('#','').trim() == $(this).closest("span").attr('id')) {
					$(this).closest("span").remove();
				}
			}else{
				if($obj.attr('data-id') == $(this).closest("span").text()) {
					$(this).closest("span").remove();
				}
			}
		});
	}else{
		if(gubun=='size'){
			$(obj).attr('onclick','fnResetListIdx();fnSelectFilerMob(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');');
		}else{
			$(obj).attr('onclick','fnResetListIdx();fnSelectFilerMob(this,\''+gubun+'\',\'on\',\'\');');
		}
	}
	fnFilterSet(gubun, sizeGb, 'Mob');
}

var fnSetMobCateFilter = function (obj, gubun, cate1No, cate2No, cate3No, cate4No, cate5No){
	// 활성화 되었을때
	if($(obj).hasClass("on")) {
		if(gubun == 'ALL'){
			$('#categoryFilterDiv').find('.daps1').find('span').html('');
			fnSetCateFilter();
		}else{
			if($(obj).attr('data-depth')==1){
				$('#categoryFilterDiv').find('.daps1').find('span').html('');
				fnSetCateFilter();
			}else if($(obj).attr('data-depth')==2){
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=1]').attr('cateFullNm'));
				fnSetCateFilter(cate1No);
			}else if($(obj).attr('data-depth')==3){
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=2]').attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No);
			}else if($(obj).attr('data-depth')==4){
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=3]').attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No, cate3No);
			}else{
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).parent().parent().parent().find('[data-depth=4]').attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No, cate3No, cate4No);
			}
		}
	}else{
		if(gubun == 'ALL'){
			$("#categoryFilterDiv").find('.daps4').each(function (idx){
				$(this).parent().find('a').removeClass('on');
				$(this).css('display','none');
			});
			$("#categoryFilterDiv").find('.daps3').each(function (idx){
				$(this).parent().find('a').removeClass('on');
				$(this).css('display','none');
			});
			$("#categoryFilterDiv").find('.daps2').each(function (idx){
				$(this).parent().find('a').removeClass('on');
			});
			$("#categoryFilterDiv").find('.daps1').each(function (idx){
				$(this).parent().find('a').removeClass('on');
			});
			$(this).removeClass("on");
			$(this).parent().find('ul').css('display','none');
			$('#categoryFilterDiv').find('.daps1').find('span').html('');
			fnSetCateFilter();
		}else{
			if($(obj).attr('data-depth')==1){
				$("#categoryFilterDiv").find('[data-depth=1]').each(function (){
					$("#categoryFilterDiv").find('.daps4').each(function (idx){
						$(this).parent().find('a').removeClass('on');
						$(this).css('display','none');
					});
					$("#categoryFilterDiv").find('.daps3').each(function (idx){
						$(this).parent().find('a').removeClass('on');
						$(this).css('display','none');
					});
					$("#categoryFilterDiv").find('.daps2').each(function (idx){
						$(this).parent().find('a').removeClass('on');
					});
					$(this).removeClass("on");
					$(this).parent().find('ul').css('display','none');
				});
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
				fnSetCateFilter(cate1No);
			}else if($(obj).attr('data-depth')==2) {
				$("#categoryFilterDiv").find('[data-depth=2]').each(function (){
					$("#categoryFilterDiv").find('.daps4').each(function (idx){
						$(this).parent().find('a').removeClass('on');
						$(this).css('display','none');
					});
					$(this).removeClass("on");
					$(this).parent().find('ul').css('display','none');
				});
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No);
			}else if($(obj).attr('data-depth')==3) {
				$("#categoryFilterDiv").find('[data-depth=3]').each(function (){
					$(this).removeClass("on");
					$(this).parent().find('ul').css('display','none');
				});
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No, cate3No);
			}else if($(obj).attr('data-depth')==4) {
				$("#categoryFilterDiv").find('[data-depth=4]').each(function (){
					$(this).removeClass("on");
					$(this).parent().find('ul').css('display','none');
				});
				$('#categoryFilterDiv').find('.daps1').find('span').html($(obj).attr('cateFullNm'));
				fnSetCateFilter(cate1No, cate2No, cate3No, cate4No);
			}else{
				fnSetCateFilter(cate1No, cate2No, cate3No, cate4No, cate5No);
			}
		}
	}
}

// 모바일 할인 필터
var filterDcRateMob = function (obj, gubun, staus, idx){
	if(staus=='on'){
		$(obj).attr('onclick','fnResetListIdx();filterDcRateMob(this,\''+gubun+'\',\'off\',\''+idx+'\');');
	}else{
		$(obj).attr('onclick','fnResetListIdx();filterDcRateMob(this,\''+gubun+'\',\'on\',\''+idx+'\');');
	}
	fnFilterSet(gubun, 'dcRate', 'Mob');
}

// 모바일 가격 필터
var filterPriceMob = function (obj, gubun, staus, idx){
	if(staus=='on'){
		$(obj).attr('onclick','fnResetListIdx();filterPriceMob(this,\''+gubun+'\',\'off\',\''+idx+'\');');
	}else{
		$(obj).attr('onclick','fnResetListIdx();filterPriceMob(this,\''+gubun+'\',\'on\',\''+idx+'\');');
	}

	fnFilterSet(gubun, 'price', 'Mob');
}

var fnReCheckFilterList = function (){
	var searchId = '';
	$('#filterForm').find('.allFilter').find('.chkFilter').each(function() {
		if(!gagajf.isNull($(this).attr('id'))){
			if($(this).attr('id') == 'sizeFilterDiv'){
				searchId = 'size';
			}else{
				searchId = $(this).attr('id').replace('FilterDiv','');
			}
		}

		if(!gagajf.isNull(searchId)){
			var data = '';
			if(searchId == 'price'){
				let priceSpan = '';
				$('#searchGoodsForm').find('input[name=priceArr]').each(function (idx){
					let formPrice = $(this).val();
					$('#filterForm #priceArea').find('li').each(function(index){
						let filterPrice = $(this).find('input[name=price]').val();
						if(formPrice == filterPrice){
							$("#price"+(index+1)).prop('checked',true);
							if(idx>0){
								priceSpan += ',';
							}
							priceSpan += $("#pricdSpan"+(index+1)).text();
						}
					});
				});
				// $('#filterForm #priceArea').find('li').each(function(index){
				// 	if($(this).find('input[name=price]').prop('checked') == true){
				// 		if(index > 0){
				// 			priceSpan += ',';
				// 		}
				// 		priceSpan += $("#pricdSpan"+(index+1)).text();
				// 	}
				// });
				$("#priceFilterDiv").find('.daps1').append('<span class="pic">'+priceSpan+'</span>');
			}else if(searchId == 'dcRate'){
				let dcRateSpan = '';
				$('#filterForm #dcRateArea').find('li').each(function(index){
					if($(this).find('input[name=dcRate]').prop('checked') == true){
						if(index > 1){
							dcRateSpan += ',';
						}
						dcRateSpan += $("#dcRateText"+(index+1)).text();
					}
				});
				$("#dcRateFilterDiv").find('.daps1').append('<span class="pic">'+dcRateSpan+'</span>');
			}else{
				$('#filterForm input[name='+searchId+']:checked').each(function(idx){
					if(searchId=='color'){
						$('#'+searchId+'FilterDiv').find('.daps1').find('.pic').find('span').html('');
						var mobTag = '';
						var color = $(this).attr('data-id');
						console.log('color::'+$(this).attr('data-id'));
						if(color=='FFFFFF'){
							mobTag += '<span class="pdColor-color" style="background-color:#'+color+';border:1px solid #aaa;"></span>';
						}else{
							mobTag += '<span class="pdColor-color" style="background-color:#'+color+'"></span>';
						}
						$("#"+searchId+"FilterDiv").find('.daps1').find('.pic').append(mobTag);
					}else if(searchId=='brandGroup'){
						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
						if(idx>0){
							data += ',';
						}
						data += $(this).attr('data-id');
						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
					}else if(searchId=='size'){
						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
						if(idx>0){
							data += ',';
						}
						data += $(this).attr('data-id');
						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
					}else if(searchId=='season'){
						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
						if(idx>0){
							data += ',';
						}
						data += $(this).attr('data-id');
						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
					}else if(searchId=='benefit'){
						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
						if(idx>0){
							data += ',';
						}
						data += $(this).attr('data-id');
						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
					}else{
						$('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
						if(idx>0){
							data += ',';
						}
						data += $(this).attr('data-id');
						$("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
					}
				});
			}

		}

	});
}

var fnFilterSliderMove = function (min, max){
	var $range = $(".dp .js-range-slider01, .sch_result .js-range-slider01");
	var $inputFrom = $("#price_input_from");
	var $inputTo = $("#price_input_to");
	var instance;

	instance = $range.data("ionRangeSlider");
	instance.update({
		from: min
	});
	//$inputFrom.val(min);

	instance.update({
		to: max
	});
	//$inputTo.prop("value",max);
	fnSetFilterHtml();
}

// 필터 초기화
var fnMobFilterReset = function (pageGb){
	$(".list_defult").hide();
	$("#searchGoodsForm input:hidden[name=cate1No]").remove();
	$("#searchGoodsForm input:hidden[name=cate2No]").remove();
	$("#searchGoodsForm input:hidden[name=cate3No]").remove();
	$("#searchGoodsForm input:hidden[name=cate4No]").remove();
	$("#searchGoodsForm input:hidden[name=cate5No]").remove();
	$("#searchGoodsForm input:hidden[name=brandGroupArr]").remove();
	$("#searchGoodsForm input:hidden[name=sizeArr]").remove();
	$("#searchGoodsForm input:hidden[name=dcRateArr]").remove();
	$("#searchGoodsForm input:hidden[name=priceArr]").remove();
	$("#searchGoodsForm input:hidden[name=ageArr]").remove();
	$("#searchGoodsForm input:hidden[name=seasonArr]").remove();
	$("#searchGoodsForm input:hidden[name=colorArr]").remove();
	$("#searchGoodsForm input:hidden[name=benefitArr]").remove();
	$("#searchGoodsForm input:hidden[name=newGoods]").val('');
	$("#unisex").prop('checked',false);
	$("#unisex").attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');
	$("#searchGoodsForm input:hidden[name=unisex]").remove();
	$("#newGoods").prop('checked',false);
	$("#newGoods").attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');
	$('.allFilter .chkFilter').find('input[type=checkbox]').each(function (idx){
		$(this).prop('checked',false);
	});
	$('.allFilter .chkFilter .daps1').find('span').each(function (idx){
		$(this).text('');
	});
	$("#categoryFilterDiv").find('.daps4').each(function (idx){
		$(this).parent().find('a').removeClass('on');
		$(this).css('display','none');
	});
	$("#categoryFilterDiv").find('.daps3').each(function (idx){
		$(this).parent().find('a').removeClass('on');
		$(this).css('display','none');
	});
	$("#categoryFilterDiv").find('.daps2').each(function (idx){
		$(this).parent().find('a').removeClass('on');
	});
	$('.allFilter').find('.daps1').each(function (idx){
		$(this).removeClass('on');
		$(this).parent().find('ul').css('display','none');
	});
	gagaInfiniteScroll.pageStatus.filterHtml = '';
	gagaInfiniteScroll.pageStatus.filterStatHtml = '';
	fnCategoryGoodsInfiniteScrollInit();
	fnSearchGoodsListSearch();
	if(pageGb!='brandSearch'){
		fnGetSearchPlanningList();
		fnGetSearchEventList();
	}
}

// 필터 초기화
var fnFilterReset = function (){
	//document.location.href = currUrl;
	$("#searchGoodsForm input:hidden[name=brandGroupArr]").remove();
	$("#searchGoodsForm input:hidden[name=sizeArr]").remove();
	$("#searchGoodsForm input:hidden[name=dcRateFrom]").remove();
	$("#searchGoodsForm input:hidden[name=dcRateTo]").remove();
	$("#searchGoodsForm input:hidden[name=priceFrom]").remove();
	$("#searchGoodsForm input:hidden[name=priceTo]").remove();
	$("#searchGoodsForm input:hidden[name=ageArr]").remove();
	$("#searchGoodsForm input:hidden[name=seasonArr]").remove();
	$("#searchGoodsForm input:hidden[name=colorArr]").remove();
	$("#searchGoodsForm input:hidden[name=benefitArr]").remove();
	$("#searchGoodsForm input:hidden[name=cate1No]").remove();
	$("#searchGoodsForm input:hidden[name=cate2No]").remove();
	$("#searchGoodsForm input:hidden[name=cate3No]").remove();
	$("#searchGoodsForm input:hidden[name=cate4No]").remove();
	$("#searchGoodsForm input:hidden[name=cate5No]").remove();
	$("#searchGoodsForm input:hidden[name=newGoods]").remove();
	$("#unisex").prop('checked',false);
	$("#unisex").attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');
	$("#searchGoodsForm input:hidden[name=unisex]").remove();
	$("#newGoods").prop('checked',false);
	$("#newGoods").attr('onclick','fnResetListIdx();fnFilterOption(this,\'on\');');

	$("#ulAllCate").find('.sub_cate').each(function (idx){
		$(this).css('display','none');
		$(this).parent().parent().find('li').removeClass('on');
	});
	// fnFilterSliderMove(0,5);
	// fnDcRateFilterSliderMove(0,10);
	$('.filter_content .sort').find('input[type=checkbox]').each(function (idx){
		$(this).prop('checked',false);
	});
	$('#ulAllCate').find('input[type=checkbox]').each(function (idx){
		$(this).prop('checked',false);
	});
	$("#filterData").html('');
	gagaInfiniteScroll.pageStatus.filterHtml = '';
	gagaInfiniteScroll.pageStatus.filterStatHtml = '';
	fnCategoryGoodsInfiniteScrollInit();
	fnSearchGoodsListSearch();
	if(pageGb!='brandSearch'){
		fnGetSearchPlanningList();
		fnGetSearchEventList();
	}
}
//****************상품리스트  end **********************************