PageSourceSearch

https://andar.co.kr/ind-script/optimizer_user.php?filename=jdKxjsM…7b218f196963d2404513506&t=1789980546&user=T

js andar.co.kr collected 2026-09-26 06:48:34 UTC 891,600 bytes, 12,437 lines download raw bytes

1$(function () {
2  let storeList = EC$(".store-list");
3  let storeSearch = storeList.find("#search");
4  let isKeywordMatched = false;
5  // 카테고리 셋팅
6  let cateSlect = storeList.find(".cate-select");
7  let cateList = storeList.find(".cate-list");
8
9  let urlParams = new URLSearchParams(window.location.search);
10  let categoryNo = urlParams.get("category_no") || 0;
11  let storeKeyword = urlParams.get("search") || "";
12
13  let cateOptionArr = [];
14
15  cateSlect.find("option").each(function (index) {
16    let val = $(this).val();
17    let cateName = $(this).text();
18    cateOptionArr.push(cateName);
19    cateList.append(
20      `<li class="${
21        index == categoryNo ? "is-active" : ""
22      }"><button type="button" data-option="${val}" data-keyword="${cateName}">${cateName}</button></li>`
23    );
24  });
25
26  storeSearch.attr("placeholder", "백화점, 아울렛, 지역명 또는 상품군을 검색하세요 (예: 롯데백화점, 판교, 키즈)");
27
28  let searchForm = storeList.find("#search-form");
29  searchForm.on("submit", function (e) {
30    e.preventDefault();
31    let keyword = $(this).find('input[name="search"]').val();
32    location.href = `/store.html?board_no=15&page=1&search_date=all&search_key=subject&search=${keyword}`;
33  });
34
35  // 검색어 삭제
36  let deleteBtn = storeList.find(".delete-btn");
37  deleteBtn.on("click", function () {
38    location.href = `/store.html?board_no=15&page=1`;
39  });
40
41  if (storeKeyword) {
42    cateList.find("li").each(function () {
43      let $this = $(this);
44      let keyword = $this.find("button").data("keyword");
45      if (keyword == storeKeyword) {
46        $this.siblings().removeClass("is-active");
47        $this.addClass("is-active");
48      }
49    });
50
51    isKeywordMatched = isExactKeyword(storeKeyword);
52
53    storeSearch.val(storeKeyword).trigger("input");
54    deleteBtn.addClass("is-active");
55  }
56
57  cateList.find("button").on("click", function () {
58    let val = $(this).data("option");
59    storeKeyword = $(this).data("keyword");
60    if (storeKeyword == "전체") {
61      storeKeyword = "";
62    }
63    // location.href = `/store.html?board_no=15&page=1&search_key=subject&category_no=${val}&search=${storeKeyword}`;
64    location.href = `/store.html?board_no=15&page=1&search_key=subject&category_no=${val}`;
65  });
66
67  let storeLength = storeList.find(".list-length");
68  let storeBoardList = storeList.find(".board-list");
69
70  let lastOrder = storeBoardList.find("li").eq(0).data("order");
71  storeLength.find(".count").text(lastOrder);
72
73  // 게시글 안에 리스트 정보 보이게
74  storeList.find(".list-desc").removeClass("displaynone");
75  storeList.find(".store-wrap").remove();
76
77  //  평일, 주말에따른 시간 표시
78  let boardList = storeList.find(".board-list");
79  let today = new Date();
80  var nowTime = today.getHours() * 60 + today.getMinutes(); // 현재 시간을 '분' 단위로 변환
81  let day = today.getDay(); // 0: 일, 1: 월, ..., 6: 토
82  var month = today.getMonth(); // 0~11
83  let isWeekend = day >= 5 || day === 0; // 주말이면 true, 평일이면 false
84  let hour = "";
85
86  boardList.find(".item").each(function () {
87    let $this = $(this);
88    let desc = $this.find(`.list-desc`);
89    let weekdayTime = desc.data("weekday");
90    let weekendTime = desc.data("weekend");
91    let timeEl = desc.find(".time");
92    let isSummer = month >= 4 && month <= 9; // 5월 ~ 10월 //!isSummer; // 11월 ~ 4월
93    console.log("isSummer", isSummer);
94
95    if (desc.data("hour")) {
96      // 평일/주말 구분 없이 같은 시간
97      hour = desc.data("hour");
98    } else if (isSummer && desc.data("summer")) {
99      // 하절기 + 평일/주말 구분 없음
100      hour = desc.data("summer");
101    } else if (!isSummer && desc.data("winter")) {
102      // 동절기 + 평일/주말 구분 없음
103      hour = desc.data("winter");
104    } else {
105      // 평일/주말 각각 다르게 설정된 경우
106      hour = isWeekend ? weekendTime : weekdayTime;
107    }
108
109    if (!hour) return; // 데이터 없으면 패스
110
111    let times = hour.split("-");
112
113    let open = times[0].trim(); // "10:30"
114    let close = times[1].trim(); // "20:30"
115
116    // 시간 포맷 변경
117    let openFormatted = convertToAmPm(open); // "10:30am"
118    let closeFormatted = convertToAmPm(close); // "8:30pm"
119    let formattedHour = `${openFormatted} - ${closeFormatted}`;
120
121    // "10:30" → 분 단위 변환
122    var openParts = open.split(":");
123    var closeParts = close.split(":");
124    var openTime = parseInt(openParts[0]) * 60 + parseInt(openParts[1]);
125    var closeTime = parseInt(closeParts[0]) * 60 + parseInt(closeParts[1]);
126
127    // 비교
128    /*
129      open-time : 오픈전 class
130      business-time 오픈후 class
131    */
132
133    var status = "";
134    let statusText = "";
135    if (nowTime < openTime) {
136      status = "오픈 전";
137      statusText = "오픈 시간";
138      timeEl.addClass("open-time");
139    } else if (nowTime >= openTime && nowTime < closeTime) {
140      status = "영업 중";
141      statusText = "영업 시간";
142      timeEl.addClass("business-time");
143    } else {
144      status = "영업 종료";
145    }
146
147    timeEl.text(`${statusText} ${formattedHour}`);
148  });
149
150  function convertToAmPm(timeStr) {
151    const [hour, minute] = timeStr.split(":").map(Number);
152    const ampm = hour >= 12 ? "pm" : "am";
153    const hour12 = hour % 12 || 12;
154
155    return minute === 0 ? `${hour12}${ampm}` : `${hour12}:${minute}${ampm}`;
156  }
157
158  function isExactKeyword(keyword) {
159    return cateOptionArr.includes(keyword);
160  }
161});
162
163function topbnr_close(selector) {
164  var selector = jQuery1_11_2(selector);
165  var speed = 400;
166  if (jQuery1_11_2("#topbnr .slide_topbnr").css("display") == "block") {
167    jQuery1_11_2("#topbnr .slide_topbnr").slideUp(speed);
168    selector.addClass("active").animate({top: "0"}, speed);
169  } else {
170    jQuery1_11_2("#topbnr .slide_topbnr").slideDown(speed);
171    selector.removeClass("active").animate({top: "40px"}, speed);
172  }
173}
174
175$(document).ready(function () {
176  setTimeout(function () {
177    $("#topbnr .wrap_slide_topbnr").removeClass("displaynone");
178    $("#topbnr .wrap_slide_topbnr img").addClass("displaynone");
179
180    // 배너 이름에 #Timer(카운트다운종료날짜 6자리로 입력) 시간은 오전 12시로 고정
181    // ex> #Timer(231206) => 2023-12-06 00:00:00
182    var timerBannerCheck = /(#Timer\(\d{6}\))/;
183
184    var TopBannerSwiper = new Swiper("#topbnr", {
185      spaceBetween: 0,
186      centeredSlides: true,
187      effect: "fade",
188      autoplay: {
189        delay: 4000,
190        disableOnInteraction: false,
191      },
192    });
193
194    $("#topbnr .slide_topbnr").each(function () {
195      var dataBannerTitle = $(this).children("a").attr("data-title");
196      // 배너이름에 타이머배너 있는지 확인
197      if (timerBannerCheck.test(dataBannerTitle)) {
198        // 날짜 6자리만 추출
199        var timerHash = dataBannerTitle.search(timerBannerCheck);
200        var timerEndVal = dataBannerTitle.substr(timerHash + 7, 6);
201
202        // 추출한 날짜에서 년/월/일 분리하여 Date 객체 형식으로 변환
203        var year = timerEndVal.substr(0, 2);
204        var month = timerEndVal.substr(2, 2);
205        var date = timerEndVal.substr(4, 2);
206        var endTime = "20" + year + "-" + month + "-" + date + " 00:00:00";
207
208        // dataBannerTitle 에서 #Timer(날짜) 부분 찾아 timerSpan 으로 대체
209        var timerSpan = "<span class='top_banner_timer' data-endTime='" + endTime + "'><span class='timerDay'>0일</span><span class='timerHr'>00</span>:<span class='timerMin'>00</span>:<span class='timerSec'>00</span></span>";
210        dataBannerTitle = dataBannerTitle.replace(timerBannerCheck, timerSpan);
211      }
212      // dataBannerTitle => 배너 텍스트 넣어주기
213      $(this).children("a").prepend(dataBannerTitle);
214
215      // 아이콘 왼오 위치 구분
216      if ($(this).find(".icon-right").length > 0) {
217        $(this).find("img").removeClass("displaynone");
218        $(this).find("img").addClass("icon-right");
219      } else if ($(this).find(".icon-left").length > 0) {
220        $(this).find("img").clone().appendTo(".icon-left");
221        $(".icon-left img").removeClass("displaynone");
222      }
223    });
224    var TopBannerSwiper = new Swiper("#topbnr", {
225      spaceBetween: 0,
226      centeredSlides: true,
227      effect: "fade",
228      autoplay: {
229        delay: 4000,
230        disableOnInteraction: false,
231      },
232      init: false,
233    });
234    TopBannerSwiper.on("init", function () {
235      var topBnrTimer = $("#topbnr .top_banner_timer");
236
237      if (topBnrTimer.length > 0) {
238        topBnrTimer.each(function (index, banner) {
239          var dataEndTime = $(this).attr("data-endTime");
240          setInterval(function () {
241            updateTimerTopBnr($(banner), dataEndTime);
242          }, 1000);
243        });
244      }
245    });
246    TopBannerSwiper.init();
247  }, 300);
248});
249
250// 타이머 업데이트
251//
252function updateTimerTopBnr(banner, endTime) {
253  var timerDay = banner.children(".timerDay");
254  var timerHr = banner.children(".timerHr");
255  var timerMin = banner.children(".timerMin");
256  var timerSec = banner.children(".timerSec");
257
258  var endTime = +new Date(endTime);
259  var diff = endTime - +new Date();
260  if (diff <= 0 || !diff) {
261    return;
262  }
263
264  var diffDate = Math.floor(diff / (1000 * 60 * 60 * 24));
265  var diffHours = Math.floor(diff / (1000 * 60 * 60));
266  var diffMinutes = Math.floor(diff / (1000 * 60));
267  var diffSeconds = Math.floor(diff / 1000);
268
269  var leftDate = diffDate;
270  var leftHours = diffHours - diffDate * 24;
271  if (String(leftHours).length < 2) {
272    leftHours = "0" + leftHours;
273  }
274  var leftMinutes = diffMinutes - diffHours * 60;
275  if (String(leftMinutes).length < 2) {
276    leftMinutes = "0" + leftMinutes;
277  }
278  var leftSeconds = diffSeconds - diffMinutes * 60;
279  if (String(leftSeconds).length < 2) {
280    leftSeconds = "0" + leftSeconds;
281  }
282
283  timerDay.text(leftDate + "일");
284  timerHr.text(leftHours);
285  timerMin.text(leftMinutes);
286  timerSec.text(leftSeconds);
287}
288
289$(document).ready(function(){
290    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
291        var sShippingCountryCode4Cookie = 'shippingCountryCode';
292        var bShippingCountryProc = false;
293
294        // 배송국가 선택 설정이 사용안함이면 숨김
295        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
296            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
297            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
298        } else {
299            $('.thumb .xans-layout-multishoplistitem').hide();
300            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
301            if (typeof(aShippingCountryCode) != 'undefined' && aS
301hippingCountryCode != null && aShippingCountryCode.length > 2) {
302                var sShippingCountryValue = aShippingCountryCode[2];
303            }
304
305            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
306            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
307
308            if (aHrefCountryValue.length == 2) {
309                var sShippingCountryValue = aHrefCountryValue[1];
310            }
311
312            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
313            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
314                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
315
316                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
317                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
318                }
319            }
320            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
321                sShippingCountryValue = sShippingCountryValue.split("#")[0];
322                var bShippingCountryProc = true;
323
324                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
325                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
326                var expires = new Date();
327                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
328                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
329                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
330                    $("#f_country").val(sShippingCountryValue).change();;
331                }
332            }
333        }
334        // 언어선택 설정이 사용안함이면 숨김
335        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
336            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
337            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
338        } else {
339            $('.thumb .xans-layout-multishoplistitem').hide();
340        }
341
342        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
343        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
344            $(".xans-layout-multishopshipping").hide();
345            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
346        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
347            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
348            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
349            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
350            // 배송국가 선택을 사용해야 레이어를 보이게 함
351            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
352                $(".xans-layout-multishopshipping").show();
353            }
354        }
355
356        $(".xans-layout-multishopshipping .close").bind("click", function() {
357            $(".xans-layout-multishopshipping").hide();
358        });
359
360        $(".xans-layout-multishopshipping .ec-base-button a").bind("click", function() {
361            var expires = new Date();
362            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
363            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
364
365            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
365을 넘김
366            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
367
368            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
369        });
370        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").bind("click", function() {
371            $(".xans-layout-multishopshipping").show();
372        });
373    }
374});
375/**
376 * 움직이는 배너 Jquery Plug-in
377 * @author  cafe24
378 */
379
380//(function($){
381//
382//    $.fn.floatBanner = function(options) {
383//        options = $.extend({}, $.fn.floatBanner.defaults , options);
384//
385//        return this.each(function() {
386//            var aPosition = $(this).position();
387//            var jbOffset = $(this).offset();
388//            var node = this;
389//
390//            $(window).scroll(function() {
391//                var _top = $(document).scrollTop();
392//                _top = (aPosition.top < _top) ? _top : aPosition.top;
393//
394//                setTimeout(function () {
395//                    var newinit = $(document).scrollTop();
396//
397//                    if ( newinit > jbOffset.top ) {
398//                        _top -= jbOffset.top;
399//                        var container_height = $("#wrap").height();
400//                        var quick_height = $(node).height();
401//                        var cul = container_height - quick_height;
402//                        if(_top > cul){
403//                            _top = cul;
404//                        }
405//                    }else {
406//                        _top = 0;
407//                    }
408//
409//                    $(node).stop().animate({top: _top}, options.animate);
410//                }, options.delay);
411//            });
412//        });
413//    };
414//
415//    $.fn.floatBanner.defaults = {
416//        'animate'  : 500,
417//        'delay'    : 500
418//    };
419//
420//})(jQuery);
421
422/**
423 * 문서 구동후 시작
424 */
425$(document).ready(function () {
426  //$('#banner:visible, #quick:visible').floatBanner();
427
428  //placeholder
429  $(".ePlaceholder input, .ePlaceholder textarea").each(function (i) {
430    var placeholderName = $(this).parents().attr("title");
431    $(this).attr("placeholder", placeholderName);
432  });
433  /* placeholder ie8, ie9 */
434  $.fn.extend({
435    placeholder: function () {
436      //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴
437      if (hasPlaceholderSupport() === true) {
438        return this;
439      }
440      //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행
441      return this.each(function () {
442        var findThis = $(this);
443        var sPlaceholder = findThis.attr("placeholder");
444        if (!sPlaceholder) {
445          return;
446        }
447        findThis.wrap('<label class="ePlaceholder" />');
448        var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : "";
449        findThis.before("<span" + sDisplayPlaceHolder + ">" + sPlaceholder + "</span>");
450        this.onpropertychange = function (e) {
451          e = event || e;
452          if (e.propertyName == "value") {
453            $(this).trigger("focusout");
454          }
455        };
456        //공통 class
457        var agent = navigator.userAgent.toLowerCase();
458        if (agent.indexOf("msie") != -1) {
459          $(".ePlaceholder").css({position: "relative"});
460          $(".ePlaceholder span").css({position: "absolute", padding: "0 4px", color: "#878787"});
461          $(".ePlaceholder label").css({padding: "0"});
462        }
463      });
464    },
465  });
466
467  $(":input[placeholder]").placeholder(); //placeholder() 함수를 호출
468
469  //클릭하면 placeholder 숨김
470  $("body").delegate(".ePlaceholder span", "click", function () {
471    $(this).hide();
472  });
473
474  //input창 포커스 인 일때 placeholder 숨김
475  $("body").delegate(".ePlaceholder :input", "focusin", function () {
476    $(this).prev("span").hide();
477  });
478
479  //input창 포커스 아웃 일때 value 가 true 이면 숨김, false 이면 보여짐
480  $("body").delegate(".ePlaceholder :input", "focusout", function () {
481    if (this.value) {
482      $(this).prev("span").hide();
483    } else {
484      $(this).prev("span").show();
485    }
486  });
487
488  //input에 placeholder가 지원이 되면 true를 안되면 false를 리턴값으로 던져줌
489  function hasPlaceholderSupport() {
490    if ("placeholder" in document.createElement("input")) {
491      return true;
492    } else {
493      return false;
494    }
495  }
496});
497
498/**
499 *  썸네일 이미지 엑박일경우 기본값 설정
500 */
501$(window).load(function () {
502  $("img.thumb,img.ThumbImage,img.BigImage").each(function ($i, $item) {
503    var $img = new Image();
504    $img.onerror = function () {
505      $item.src = "//img.echosting.cafe24.com/thumb/img_product_big.gif";
506    };
507    $img.src = this.src;
508  });
509
510  //이너뷰 0720
511  //메인 배너 이미지 텍스트 겹침 현상
512  var main_visual_leng = $(".main_visual_section .swiper-slide").length;
513
514  $("#main .best_wrapper .prd_basic .box .img .prdimg > a").css("display", "block");
515  if (main_visual_leng > 1) {
516    //메인 비주얼 배너
517    var MainVisualSwiper = new Swiper(".main_visual_section.swiper-container", {
518      slidesPerView: 1,
519      effect: "fade",
520      fadeEffect: {
521        crossFade: true,
522      },
523      lazyLoading: true,
524      lazyLoadingInPrevNext: true,
525      watchSlidesProgress: true,
526      watchSlidesVisibility: true,
527      loop: true,
528      loopFillGroupWithBlank: true,
529      observer: true,
530      observeParents: true,
531      speed: 500,
532      autoplay: {
533        delay: 4000,
534        disableOnInteraction: false,
535      },
536      pagination: {
537        el: ".main_visual_section .swiper-pagination",
538        type: "fraction",
539      },
540      navigation: {
541        nextEl: ".main_visual_section .swiper-button-next",
542        prevEl: ".main_visual_section .swiper-button-prev",
543      },
544    });
545  } else {
546    $(".main_visual_section .swiper-pagination, .main_visual_section .swiper-button").hide();
547  }
548
549  /* 메인 비주얼 배너 renewer2023 */
550  var main_renewer2023_leng = $(".renewerVideo .swiper-slide").length;
551  if (main_renewer2023_leng > 1) {
552    // var MainVisualSwiper = new Swiper(".renewerVideo", {
553    //   watchSlidesProgress: true,
554    //   centeredSlides: true,
555    //   //slidesPerView: 2.941,
556    //   slidesPerView: 2.941,
557    //   centeredSlides: true,
558    //   spaceBetween: 0,
559    //   loop: true,
560    //   loopedSlides: 2,
561    //   observer: true,
562    //   observeParents: true,
563    //   speed: 1500,
564    //   autoplay: {
565    //     delay: 4000,
566    //     disableOnInteraction: false,
567    //   },
568    //   pagination: {
569    //     el: ".renewerVideo .swiper-pagination",
570    //     type: "fraction",
571    //   },
572    //   navigation: {
573    //     nextEl: ".renewerVideo .swiper-button-next",
574    //     prevEl: ".renewerVideo .swiper-button-prev",
575    //   },
576    // });
577  } else {
578    $(".renewerVideo .swiper-pagination, .renewerVideo .swiper-button").hide();
579  }
580  // $('.main_visual_container_2023 .renewerVideo').addClass('opacity');
581
582  /* #155 - 메인/상세 배너 페이지네이션 기능 문의 - 0926 */
583  var mainFlowBn = $(".main_FlowBn_wrap .swiper-slide").length;
584  if (mainFlowBn > 1) {
585    var mainFlowSwiper = new Swiper(".main_FlowBn_wrap", {
586      autoplay: {
587        delay: 4000,
588        stopOnLastSlide: false,
589        disableOnInteraction: false,
590      },
591      loop: true,
592      slidesPerView: "auto",
593      observer: true,
594      observeParents: true,
595      pagination: {
596        el: ".swiper-pagination",
597        type: "fraction",
598      },
599    });
600  }
601});
602
603//window popup script
604function winPop(url) {
605  window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
606}
607/**
608 * document.location.href split
609 * return array Param
610 */
611function getQueryString(sKey) {
612  var sQueryString = document.location.search.substring(1);
613  var aParam = {};
614
615  if (sQueryString) {
616    var aFields = sQueryString.split("&");
617    var aField = [];
618    for (var i = 0; i < aFields.length; i++) {
619      aField = aFields[i].split("=");
620      aParam[aField[0]] = aField[1];
621    }
622  }
623
624  aParam.page = aParam.page ? aParam.page : 1;
625  return sKey ? aParam[sKey] : aParam;
626}
627
628$(document).ready(function () {
629  // tab
630  $.eTab = function (ul) {
631    $(ul)
632      .find("a")
633      .click(function () {
634        var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"),
635          _target = $(this).attr("href"),
636          _siblings = "." + $(_target).attr("class");
637        $(_target).show().siblings(_siblings).hide();
638        return false;
639      });
640  };
641  if (window.call_eTab) {
642    call_eTab();
643  }
644});
645
646(function($){
647$.fn.extend({
648    center: function() {
649        this.each(function() {
650            var
651                $this = $(this),
652                $w = $(window);
653            $this.css({
654                position: "absolute",
655                top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
656                left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
657            });
658        });
659        return this;
660    }
661});
662$(function() {
663    var $container = function(){/*
664<div id="modalContainer">
665    <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
666</div>');
667*/}.toString().slice(14,-3);
668    $('body')
669    .append($('<div id="modalBackpanel"></div>'))
670    .append($($container));
671    function closeModal () {
672        $('#modalContainer').hide();
673        $('#modalBackpanel').hide();
674    }
675    $('#modalBackpanel').click(closeModal);
676    zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
677        var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
678        $('#modalContent').attr('src', $url);
679        $('#modalContent').bind("load",function(){
680            $(".header .close",this.contentWindow.document.body).bind("click", closeModal);
681        });
682        $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
683        $('#modalContainer').center().show();
684    }
685});
686})(jQuery);
687!function(i){"use strict";"function"==typeof define&&define.amd?define(["jQuery1_11_2"],i):"undefined"!=typeof exports?module.exports=i(require("jQuery1_11_2")):i(jQuery1_11_2)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
687ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
687slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
687parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
687,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 687
687,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
687!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
687):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
687o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
687,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}});
688
689/* 토글 */
690function toggle_view(selector, obj) {
691  var search = $("#" + selector + "");
692  var obj = $(obj);
693  if (selector == "layer_benefit" || selector == "layer_lowcalculator") {
694    if (search.css("display") == "none") {
695      search.addClass("active");
696      obj.addClass("active");
697      $("#dimmed").show();
698    } else {
699      search.removeClass("active");
700      obj.removeClass("active");
701      $("#dimmed").hide();
702    }
703    $("#dimmed").click(function () {
704      $(this).hide();
705      search.removeClass("active");
706      obj.removeClass("active");
707    });
708  } else {
709    if (search.css("display") == "none") {
710      search.addClass("active");
711      obj.addClass("active");
712    } else {
713      search.removeClass("active");
714      obj.removeClass("active");
715    }
716  }
717}
718
719/* 탭뷰 */
720function tabover(name, no) {
721  var tabs = $(".tab_" + name + "").find("li");
722  tabs.each(function (idx) {
723    var detail = $(".tabcnt_" + name + idx);
724    var link = $(this).find("a");
725    if (no == idx) {
726      detail.show();
727      link.addClass("active");
728    } else {
729      detail.hide();
730      link.removeClass("active");
731    }
732  });
733}
734
735/* 스크롤 이동 */
736function scrollup() {
737  $("html, body").animate({scrollTop: 0}, "slow");
738}
739function scrolldown() {
740  $("html, body").animate({scrollTop: $(document).height()}, "slow");
741}
742
743function sub_over(obj, select) {
744  var cnt = $("#" + obj + "");
745  var select = $(select);
746  var hd = $("#header .gnb .btn li.all a");
747  cnt.addClass("active");
748  select.addClass("active");
749  hd.addClass("active");
750}
751
752function sub_out(obj, select) {
753  var cnt = $("#" + obj + "");
754  var select = $(select);
755  var hd = $("#header .gnb .btn li.all a");
756  cnt.removeClass("active");
757  select.removeClass("active");
758  hd.removeClass("active");
759}
760
761$(document).ready(function () {
762  // 상품리스트 할인판매가 스타일 제어
763  if ($(".prd_basic").hasClass("rel") != true) {
764    // 디테일 관련상품 제외
765    $(".prd_basic .box").each(function () {
766      var sale = $(this).find(".price .sale"); //할인가
767      var sell = $(this).find(".price .sell"); //판매가
768      var customer = $(this).find(".price .customer"); //세트할인판매가 ?
769      if (sale.hasClass("displaynone") != true) {
770        // 할인판매가가 있을 때
771        if (customer.hasClass("displaynone") != true) {
772          // 소비자가가 있을 때
773          sell.hide(); // 판매가 숨김
774        } else {
775          $(this).find(".price").addClass("hassale");
776        }
777      } else {
778        $(this).find(".price").removeClass("hassale");
779      }
780    });
781  }
782});
783
784// $(window).scroll(function(){
785// 	var y = $(window).scrollTop();
786// 	var hd = $('#header');
787// 	var quick = $('#quick_menu');
788//     var btnTop = $('#quick_menu .top');
789// 	if (y > hd.offset().top) {
790// 		hd.addClass('fixed');
791// 	} else {
792// 		hd.removeClass('fixed');
793// 	}
794// 	if (y > 100) {
795// 		btnTop.fadeIn();
796// 	} else {
797// 		btnTop.fadeOut();
798// 	}
799// });
800
801/* morenvy.com 상품 더보기 쿠키 190619 정환 */
802function setCookie(cookieName, value, exdays) {
803  var exdate = new Date();
804  exdate.setDate(exdate.getDate() + exdays);
805  var cookieValue = escape(value) + (exdays == null ? "" : "; expires=" + exdate.toGMTString());
806  document.cookie = cookieName + "=" + cookieValue + "; path=/";
807}
808
809function deleteCookie(cookieName) {
810  var expireDate = new Date();
811  expireDate.setDate(expireDate.getDate() - 1);
812  document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString();
813}
814
815function getCookie(cookieName) {
816  cookieName = cookieName + "=";
817  var cookieData = document.cookie;
818  var start = cookieData.indexOf(cookieName);
819  var cookieValue = "";
820  if (start != -1) {
821    start += cookieName.length;
822    var end = cookieData.indexOf(";", start);
823    if (end == -1) end = cookieData.length;
824    cookieValue = cookieData.substring(start, end);
825  }
826  return unescape(cookieValue);
827}
828
829/** ===============================================================================================================================================
830 * 
831 * 랜덤 번호 생성
832 * - 배너매니저 등 사용할 경우 ord 변수가 이미 존재하여, 없는 경우에만 변수 생성하도록 정의
833 */
834if(typeof ord === 'undefind'){
835    var ord=Math.random();
836};
837/* ================================================================================================================================================== */
838/** ===============================================================================================================================================
839 * 
840 * IV$ 
841 * - 이미 호출 중인 jQuery(1.4.4이상)가 있는 경우 추가 호출하지않고 사용 / 충족하지 않을f때만 jQuery 1.11.2버전을 로드합니다.
842 * - ! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license
843 * @IV$ {function} jQuery 충돌방지 별칭 
844 */
845var IV$;
846try {
847    ( IVCallJQuery = function(){
848        if(typeof jQuery === 'undefined'){
849            !function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,a=n.indexOf,s={},l=s.toString,u=s.hasOwnProperty,c={},d="1.11.2",f=function(e,t){return new f.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,h=/^-ms-/,m=/-([\da-z])/gi,g=function(e,t){return t.toUpperCase()};function v(e){var t=e.length,n=f.type(e);return"function"!==n&&!f.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}f.fn=f.prototype={jquery:d,constructor:f,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=f.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return f.each(this,e,t)},map:function(e){return this.pushStack(f.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},f.extend=f.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{}
849,s++),"object"==typeof a||f.isFunction(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(i=arguments[s]))for(r in i)e=a[r],a!==(n=i[r])&&(u&&n&&(f.isPlainObject(n)||(t=f.isArray(n)))?(t?(t=!1,o=e&&f.isArray(e)?e:[]):o=e&&f.isPlainObject(e)?e:{},a[r]=f.extend(u,o,n)):void 0!==n&&(a[r]=n));return a},f.extend({expando:"jQuery"+(d+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===f.type(e)},isArray:Array.isArray||function(e){return"array"===f.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!f.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==f.type(e)||e.nodeType||f.isWindow(e))return!1;try{if(e.constructor&&!u.call(e,"constructor")&&!u.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(c.ownLast)for(t in e)return u.call(e,t);for(t in e);return void 0===t||u.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[l.call(e)]||"object":typeof e},globalEval:function(t){t&&f.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(h,"ms-").replace(m,g)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=v(e);if(n){if(o)for(;i>r&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;i>r&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(v(Object(e))?f.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(a)return a.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;)e[i++]=t[r++];if(n!=n)for(;void 0!==t[r];)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;o>i;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,o=0,a=e.length,s=[];if(v(e))for(;a>o;o++)null!=(r=t(e[o],o,n))&&s.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&s.push(r);return i.apply([],s)},guid:1,proxy:function(e,t){var n,i,o;return"string"==typeof t&&(o=e[t],t=e,e=o),f.isFunction(e)?(n=r.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(r.call(arguments)))}).guid=e.guid=e.guid||f.guid++,i):void 0},now:function(){return+new Date},support:c}),f.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var y=function(e){var t,n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,x="sizzle"+1*new Date,w=e.document,T=0,C=0,N=ae(),E=ae(),k=ae(),S=function(e,t){return e===t&&(d=!0),0},A=1<<31,D={}.hasOwnProperty,j=[],L=j.pop,H=j.push,q=j.push,_=j.slice,M=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",P=B.replace("w","w#"),R="\\["+O+"*("+B+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+O+"*\\]",W=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",$=new RegExp(O+"+","g"),z=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),I=new RegExp("^"+O+"*,"+O+"*"),X=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),U=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),V=new RegExp(W),J=new RegExp("^"+P+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=/'|\\/g,ne=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),re=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ie=function(){f()};try{q.apply(j=_.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){q={apply:j.length?function(e,t){H.apply(e,_.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}
849function oe(e,t,r,i){var o,s,u,c,d,h,v,y,T,C;if((t?t.ownerDocument||t:w)!==p&&f(t),r=r||[],c=(t=t||p).nodeType,"string"!=typeof e||!e||1!==c&&9!==c&&11!==c)return r;if(!i&&m){if(11!==c&&(o=Z.exec(e)))if(u=o[1]){if(9===c){if(!(s=t.getElementById(u))||!s.parentNode)return r;if(s.id===u)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&b(t,s)&&s.id===u)return r.push(s),r}else{if(o[2])return q.apply(r,t.getElementsByTagName(e)),r;if((u=o[3])&&n.getElementsByClassName)return q.apply(r,t.getElementsByClassName(u)),r}if(n.qsa&&(!g||!g.test(e))){if(y=v=x,T=t,C=1!==c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(h=a(e),(v=t.getAttribute("id"))?y=v.replace(te,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",d=h.length;d--;)h[d]=y+ge(h[d]);T=ee.test(e)&&he(t.parentNode)||t,C=h.join(",")}if(C)try{return q.apply(r,T.querySelectorAll(C)),r}catch(e){}finally{v||t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(p=a,h=a.documentElement,(i=a.defaultView)&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",ie,!1):i.attachEvent&&i.attachEvent("onunload",ie)),m=!o(a),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(a.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(a.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!a.getElementsByName||!a.getElementsByName(x).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){return m?t.getElementsByClassName(e):void 0},v=[],g=[],(n.qsa=K.test(a.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")}),le(function(e){var t=a.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.j
vendor: 6,266 bytes, line 849
849oin("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===a||e.ownerDocument===w&&b(w,e)?-1:t===a||t.ownerDocument===w&&b(w,t)?1:c?M(c,e)-M(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!i||!o)return e===a?-1:t===a?1:i?-1:o?1:c?M(c,e)-M(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?ce(s[r],l[r]):s[r]===w?-1:l[r]===w?1:0},a):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(U,"='$1']"),!(!n.matchesSelector||!m||v&&v.test(t)||g&&g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(p=(u=(c=g[x]||(g[x]={}))[e]||[])[0]===T&&u[1],f=u[0]===T&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){c[e]=[T,p,f];break}}else if(y&&(u=(t[x]||(t[x]={}))[e])&&u[0]===T)f=u[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[x]||(d[x]={}))[e]=[T,f]),d!==t)););return(f-=i)===r||f%r==0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[x]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(ne,re),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return J.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)}
vendor: 5,116 bytes, line 849
849,input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[0>n?n+t:n]}),even:pe(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pe(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pe(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pe(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function me(){}function ge(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[T,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((s=(l=t[x]||(t[x]={}))[r])&&s[0]===T&&s[1]===o)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,a))return!0}}}function ye(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function xe(e,t,n,r,i,o){return r&&!r[x]&&(r=xe(r)),i&&!i[x]&&(i=xe(i,o)),se(function(o,a,s,l){var u,c,d,f=[],p=[],h=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;i>r;r++)oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:be(m,f,e,s,l),v=n?i||(o?e:h||r)?[]:a:g;if(n&&n(g,v,s,l),r)for(u=be(v,p),r(u,[],s,l),c=u.length;c--;)(d=u[c])&&(v[p[c]]=!(g[p[c]]=d));if(o){if(i||e){if(i){for(u=[],c=v.length;c--;)(d=v[c])&&u.push(g[c]=d);i(null,v=[],u,l)}for(c=v.length;c--;)(d=v[c])&&(u=i?M(o,d):f[c])>-1&&(o[u]=!(a[u]=d))}}else v=be(v===a?v.splice(h,v.length):v),i?i(null,a,v,l):q.apply(a,v)})}function we(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=ve(function(e){return e===t},s,!0),d=ve(function(e){return M(t,e)>-1},s,!0),f=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,i}];o>l;l++)if(n=r.relative[e[l].type])f=[ve(ye(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;o>i&&!r.relative[e[i].type];i++);return xe(l>1&&ye(f),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,i>l&&we(e.slice(l,i)),o>i&&we(e=e.slice(i)),o>i&&ge(e))}f.push(n)}return ye(f)}function Te(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var d,f,h,m=0,g="0",v=o&&[],y=[],b=u,x=o||i&&r.find.TAG("*",c),w=T+=null==b?1:Math.random()||.1,C=x.length;for(c&&(u=a!==p&&a);g!==C&&null!=(d=x[g]);g++){if(i&&d){for(f=0;h=e[f++];)if(h(d,a,s)){l.push(d);break}c&&(T=w)}n&&((d=!h&&d)&&m--,o&&v.push(d))}if(m+=g,n&&g!==m){for(f=0;h=t[f++];)h(v,y,a,s);if(o){if(m>0)for(;g--;)v[g]||y[g]||(y[g]=L.call(l));y=be(y)}q.apply(l,y),c&&!o&&y.length>0&&m+t.length>1&&oe.uniqueSort(l)}return c&&(T=w,u=b),v};return n?se(o):o}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=oe.tokenize=function(e,t){var n,i,o,a,s,l,u,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in(!n||(i=I.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=X.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=Y[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):E(e,l).slice(0)},s=oe.compile=function(e,t){var n,r=[],i=[],o=k[e+" "];if(!o){for(t||(t=a(e)),n=t.length;n--;)(o=we(t[n]))[x]?r.push(o):i.push(o);(o=k(e,Te(i,r))).selector=e}return o},l=oe.select=function(e,t,i,o){var l,u,c,d,f,p="function"==typeof e&&e,h=!o&&a(e=p.selector||e);if(i=i||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&n.getById&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(ne,re),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(l=Y.needsContext.test(e)?0:u.length;l--&&(c=u[l],!r.relative[d=c.type]);)if((f=r.find[d])&&(o=f(c.matches[0].replace(ne,re),ee.test(u[0].type)&&he(t.parentNode)||t))){if(u.splice(l,1),!(e=o.length&&ge(u)))return q.apply(i,o),i;break}}return(p||s(e,h))(o,t,!m,i,ee.test(e)&&he(t.parentNode)||t),i},n.sortStable=x.split("").sort(S).join("")===x,n.detectDuplicates=!!d,f(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}
849)||ue("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(F,function(e,t,n){var r;return n?void 0:!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);f.find=y,f.expr=y.selectors,f.expr[":"]=f.expr.pseudos,f.unique=y.uniqueSort,f.text=y.getText,f.isXMLDoc=y.isXML,f.contains=y.contains;var b=f.expr.match.needsContext,x=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function T(e,t,n){if(f.isFunction(t))return f.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return f.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(w.test(t))return f.filter(t,e,n);t=f.filter(t,e)}return f.grep(e,function(e){return f.inArray(e,t)>=0!==n})}f.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?f.find.matchesSelector(r,e)?[r]:[]:f.find.matches(e,f.grep(t,function(e){return 1===e.nodeType}))},f.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(f(e).filter(function(){for(t=0;i>t;t++)if(f.contains(r[t],this))return!0}));for(t=0;i>t;t++)f.find(e,r[t],n);return(n=this.pushStack(i>1?f.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?f(e):e||[],!1).length}});var C,N=e.document,E=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(f.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:E.exec(e))||!n[1]&&t)return!t||t.jquery?(t||C).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof f?t[0]:t,f.merge(this,f.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:N,!0)),x.test(n[1])&&f.isPlainObject(t))for(n in t)f.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((r=N.getElementById(n[2]))&&r.parentNode){if(r.id!==n[2])return C.find(e);this.length=1,this[0]=r}return this.context=N,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):f.isFunction(e)?void 0!==C.ready?C.ready(e):e(f):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),f.makeArray(e,this))}).prototype=f.fn,C=f(N);var k=/^(?:parents|prev(?:Until|All))/,S={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}f.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!f(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),f.fn.extend({has:function(e){var t,n=f(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(f.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=b.test(e)||"string"!=typeof e?f(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&f.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?f.unique(o):o)},index:function(e){return e?"string"==typeof e?f.inArray(this[0],f(e)):f.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(f.unique(f.merge(this.get(),f(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),f.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return f.dir(e,"parentNode")},parentsUntil:function(e,t,n){return f.dir(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return f.dir(e,"nextSibling")},prevAll:function(e){return f.dir(e,"previousSibling")},nextUntil:function(e,t,n){return f.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return f.dir(e,"previousSibling",n)},siblings:function(e){return f.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return f.sibling(e.firstChild)},contents:function(e){return f.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:f.merge([],e.childNodes)}},function(e,t){f.fn[e]=function(n,r){var i=f.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=f.filter(r,i)),this.length>1&&(S[e]||(i=f.unique(i)),k.test(e)&&(i=i.reverse())),this.pushStack(i)}});var D,j=/\S+/g,L={};function H(){N.addEventListener?(N.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(N.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))}function q(){(N.addEventListener||"load"===event.type||"complete"===N.readyState)&&(H(),f.ready())}f.Callbacks=function(e){e="string"==typeof e?L[e]||function(e){var t=L[e]={};return f.each(e.match(j)||[],function(e,n){t[n]=!0}),t}(e):f.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(d){for(n=e.memory&&d,r=!0,o=a||0,a=0,i=s.length,t=!0;s&&i>o;o++)if(!1===s[o].apply(d[0],d[1])&&e.stopOnFalse){n=!1;break}t=!1,s&&(l?l.length&&u(l.shift()):n?s=[]:c.disable())},c={add:function(){if(s){var r=s.length;!function t(n){f.each(n,function(n,r){var i=f.type(r);"function"===i?e.unique&&c.has(r)||s.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=s.length:n&&(a=r,u(n))}return this},remove:function(){return s&&f.each(arguments,function(e,n){for(var r;(r=f.inArray(n,s,r))>-1;)s.splice(r,1),t&&(i>=r&&i--,o>=r&&o--)}),this},has:function(e){return e?f.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],i=0,this},disable:function(){return s=l=n=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,n||c.disable(),this},locked:function(){return!l},fireWith:function(e,n){return!s||r&&!l||(n=[e,(n=n||[]).slice?n.slice():n],t?l.push(n):u(n)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},f.extend({Deferred:function(e){var t=[["resolve","done",f.Callbacks("once memory"),"resolved"],["reject","fail",f.Callbacks("once memory"),"rejected"],["notify","progress",f.Callbacks("memory")]],n="pe
849nding",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f.Deferred(function(n){f.each(t,function(t,o){var a=f.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&f.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?f.extend(e,r):r}},i={};return r.pipe=r.then,f.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,a=r.call(arguments),s=a.length,l=1!==s||e&&f.isFunction(e.promise)?s:0,u=1===l?e:f.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?u.notifyWith(n,i):--l||u.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);s>o;o++)a[o]&&f.isFunction(a[o].promise)?a[o].promise().done(c(o,i,a)).fail(u.reject).progress(c(o,n,t)):--l;return l||u.resolveWith(i,a),u.promise()}}),f.fn.ready=function(e){return f.ready.promise().done(e),this},f.extend({isReady:!1,readyWait:1,holdReady:function(e){e?f.readyWait++:f.ready(!0)},ready:function(e){if(!0===e?!--f.readyWait:!f.isReady){if(!N.body)return setTimeout(f.ready);f.isReady=!0,!0!==e&&--f.readyWait>0||(D.resolveWith(N,[f]),f.fn.triggerHandler&&(f(N).triggerHandler("ready"),f(N).off("ready")))}}}),f.ready.promise=function(t){if(!D)if(D=f.Deferred(),"complete"===N.readyState)setTimeout(f.ready);else if(N.addEventListener)N.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{N.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var n=!1;try{n=null==e.frameElement&&N.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!f.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}H(),f.ready()}}()}return D.promise(t)};var _,M="undefined";for(_ in f(c))break;c.ownLast="0"!==_,c.inlineBlockNeedsLayout=!1,f(function(){var e,t,n,r;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",c.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=N.createElement("div");if(null==c.deleteExpando){c.deleteExpando=!0;try{delete e.test}catch(e){c.deleteExpando=!1}}e=null}(),f.acceptData=function(e){var t=f.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function B(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(O,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:F.test(n)?f.parseJSON(n):n)}catch(e){}f.data(e,t,n)}else n=void 0}return n}function P(e){var t;for(t in e)if(("data"!==t||!f.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function R(e,t,r,i){if(f.acceptData(e)){var o,a,s=f.expando,l=e.nodeType,u=l?f.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||void 0!==r||"string"!=typeof t)return c||(c=l?e[s]=n.pop()||f.guid++:s),u[c]||(u[c]=l?{}:{toJSON:f.noop}),("object"==typeof t||"function"==typeof t)&&(i?u[c]=f.extend(u[c],t):u[c].data=f.extend(u[c].data,t)),a=u[c],i||(a.data||(a.data={}),a=a.data),void 0!==r&&(a[f.camelCase(t)]=r),"string"==typeof t?null==(o=a[t])&&(o=a[f.camelCase(t)]):o=a,o}}function W(e,t,n){if(f.acceptData(e)){var r,i,o=e.nodeType,a=o?f.cache:e,s=o?e[f.expando]:f.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){f.isArray(t)?t=t.concat(f.map(t,f.camelCase)):t in r?t=[t]:t=(t=f.camelCase(t))in r?[t]:t.split(" "),i=t.length;for(;i--;)delete r[t[i]];if(n?!P(r):!f.isEmptyObject(r))return}
849(n||(delete a[s].data,P(a[s])))&&(o?f.cleanData([e],!0):c.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}f.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?f.cache[e[f.expando]]:e[f.expando])&&!P(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)}}),f.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=f.data(o),1===o.nodeType&&!f._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(0===(r=a[n].name).indexOf("data-")&&B(o,r=f.camelCase(r.slice(5)),i[r]));f._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){f.data(this,e)}):arguments.length>1?this.each(function(){f.data(this,e,t)}):o?B(o,e,f.data(o,e)):void 0},removeData:function(e){return this.each(function(){f.removeData(this,e)})}}),f.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=f._data(e,t),n&&(!r||f.isArray(n)?r=f._data(e,t,f.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=f.queue(e,t),r=n.length,i=n.shift(),o=f._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){f.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return f._data(e,n)||f._data(e,n,{empty:f.Callbacks("once memory").add(function(){f._removeData(e,t+"queue"),f._removeData(e,n)})})}}),f.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?f.queue(this[0],e):void 0===t?this:this.each(function(){var n=f.queue(this,e,t);f._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&f.dequeue(this,e)})},dequeue:function(e){return this.each(function(){f.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=f.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=f._data(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,z=["Top","Right","Bottom","Left"],I=function(e,t){return e=t||e,"none"===f.css(e,"display")||!f.contains(e.ownerDocument,e)},X=f.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===f.type(n))for(s in i=!0,n)f.access(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,f.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(f(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},U=/^(?:checkbox|radio)$/i;!function(){var e=N.createElement("input"),t=N.createElement("div"),n=N.createDocumentFragment();if(t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c.leadingWhitespace=3===t.firstChild.nodeType,c.tbody=!t.getElementsByTagName("tbody").length,c.htmlSerialize=!!t.getElementsByTagName("link").length,c.html5Clone="<:nav></:nav>"!==N.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),c.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",c.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",c.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,c.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){c.noCloneEvent=!1}),t.cloneNode(!0).click()),null==c.deleteExpando){c.deleteExpando=!0;try{delete t.test}catch(e){c.deleteExpando=!1}}}(),function(){var t,n,r=N.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(c[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),c[t+"Bubbles"]=!1===r.attributes[n].expando);r=null}();var V=/^(?:input|select|textarea)$/i,J=/^key/,Y=/^(?:mouse|pointer|contextmenu)|click/,G=/^(?:focusinfocus|focusoutblur)$/,Q=/^([^.]*)(?:\.(.+)|)$/;function K(){return!0}function Z(){return!1}function ee(){try{return N.activeElement}catch(e){}}function te(e){var t=ne.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}f.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f._data(e);if(v){for(n.handler&&(n=(l=n).handler,i=l.selector),n.guid||(n.guid=f.guid++),(a=v.events)||(a=v.events={}),(c=v.handle)||((c=v.handle=function(e){return typeof f===M||e&&f.event.triggered===e.type?void 0:f.event.dispatch.apply(c.elem,arguments)}).elem=e),s=(t=(t||"").match(j)||[""]).length;s--;)h=g=(o=Q.exec(t[s])||[])[1],m=(o[2]||"").split(".").sort(),h&&(u=f.event.special[h]||{},h=(i?u.delegateType:u.bindType)||h,u=f.event.special[h]||{},d=f.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&f.expr.match.needsContext.test(i),namespace:m.join(".")},l),(p=a[h])||((p=a[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,r,m,c)||(e.addEventListener?e.addEventListener(h,c,!1):e.attachEvent&&e.attachEvent("on"+h,c))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,d):p.push(d),f.event.global[h]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f.hasData(e)&&f._data(e);if(v&&(c=v.events)){for(u=(t=(t||"").match(j)||[""]).length;u--;)if(h=g=(s=Q.exec(t[u])||[])[1],m=(s[2]||"").split(".").sort(),h){for(d=f.event.special[h]||{},p=c[h=(r?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=p.length;o--;)a=p[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(p.splice(o,1),a.selector&&p.delegateCount--,d.remove&&d.remove.call(e,a));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||f.removeEvent(e,h,v.handle),delete c[h])}else for(h in c)f.event.remove(e,h+t[u],n,r,!0);f.isEmptyObject(c)&&(delete v.handle,f._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,c,d,p,h=[r||N],m=u.call(t,"type")?t.type:t,g=u.call(t,"namespace")?t.namespace.split("."):[];if(s=d=r=r||N,3!==r.nodeType&&8!==r.nodeType&&!G.test(m+f.event.triggered)&&(m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort()),a=m.indexOf(":")<0&&"on"+m,(t=t[f.expando]?t:new f.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.n
849amespace_re=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:f.makeArray(n,[t]),c=f.event.special[m]||{},i||!c.trigger||!1!==c.trigger.apply(r,n))){if(!i&&!c.noBubble&&!f.isWindow(r)){for(l=c.delegateType||m,G.test(l+m)||(s=s.parentNode);s;s=s.parentNode)h.push(s),d=s;d===(r.ownerDocument||N)&&h.push(d.defaultView||d.parentWindow||e)}for(p=0;(s=h[p++])&&!t.isPropagationStopped();)t.type=p>1?l:c.bindType||m,(o=(f._data(s,"events")||{})[t.type]&&f._data(s,"handle"))&&o.apply(s,n),(o=a&&s[a])&&o.apply&&f.acceptData(s)&&(t.result=o.apply(s,n),!1===t.result&&t.preventDefault());if(t.type=m,!i&&!t.isDefaultPrevented()&&(!c._default||!1===c._default.apply(h.pop(),n))&&f.acceptData(r)&&a&&r[m]&&!f.isWindow(r)){(d=r[a])&&(r[a]=null),f.event.triggered=m;try{r[m]()}catch(e){}f.event.triggered=void 0,d&&(r[a]=d)}return t.result}},dispatch:function(e){e=f.event.fix(e);var t,n,i,o,a,s=[],l=r.call(arguments),u=(f._data(this,"events")||{})[e.type]||[],c=f.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(s=f.event.handlers.call(this,e,u),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,void 0!==(n=((f.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],o=0;s>o;o++)void 0===i[n=(r=t[o]).selector+" "]&&(i[n]=r.needsContext?f(n,this).index(l)>=0:f.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[f.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Y.test(i)?this.mouseHooks:J.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new f.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=o.srcElement||N),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=(r=e.target.ownerDocument||N).documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ee()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===ee()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return f.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return f.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=f.extend(new f.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?f.event.trigger(i,null,t):f.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},f.removeEvent=N.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===M&&(e[r]=null),e.detachEvent(r,n))},f.Event=function(e,t){return this instanceof f.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?K:Z):this.type=e,t&&f.extend(this,t),this.timeStamp=e&&e.timeStamp||f.now(),void(this[f.expando]=!0)):new f.Event(e,t)},f.Event.prototype={isDefaultPrevented:Z,isPropagationStopped:Z,isImmediatePropagationStopped:Z,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=K,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=K,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=K,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}}
849,f.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){f.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return(!r||r!==this&&!f.contains(this,r))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),c.submitBubbles||(f.event.special.submit={setup:function(){return!f.nodeName(this,"form")&&void f.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=f.nodeName(t,"input")||f.nodeName(t,"button")?t.form:void 0;n&&!f._data(n,"submitBubbles")&&(f.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),f._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&f.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!f.nodeName(this,"form")&&void f.event.remove(this,"._submit")}}),c.changeBubbles||(f.event.special.change={setup:function(){return V.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(f.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),f.event.simulate("change",this,e,!0)})),!1):void f.event.add(this,"beforeactivate._change",function(e){var t=e.target;V.test(t.nodeName)&&!f._data(t,"changeBubbles")&&(f.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||f.event.simulate("change",this.parentNode,e,!0)}),f._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return f.event.remove(this,"._change"),!V.test(this.nodeName)}}),c.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){f.event.simulate(t,e.target,f.event.fix(e),!0)};f.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=f._data(r,t);i||r.addEventListener(e,n,!0),f._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=f._data(r,t)-1;i?f._data(r,t,i):(r.removeEventListener(e,n,!0),f._removeData(r,t))}}}),f.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){for(o in"string"!=typeof t&&(n=n||t,t=void 0),e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=Z;else if(!r)return this;return 1===i&&(a=r,(r=function(e){return f().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=f.guid++)),this.each(function(){f.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,f(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(!1===t||"function"==typeof t)&&(n=t,t=void 0),!1===n&&(n=Z),this.each(function(){f.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){f.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?f.event.trigger(e,t,n,!0):void 0}});var ne="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",re=/ jQuery\d+="(?:null|\d+)"/g,ie=new RegExp("<(?:"+ne+")[\\s/>]","i"),oe=/^\s+/,ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,se=/<([\w:]+)/,le=/<tbody/i,ue=/<|&#?\w+;/,ce=/<(?:script|style|link)/i,de=/checked\s*(?:[^=]|=\s*.checked.)/i,fe=/^$|\/(?:java|ecma)script/i,pe=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,me={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:c.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},ge=te(N).appendChild(N.createElement("div"));function ve(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==M?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==M?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||f.nodeName(r,t)?o.push(r):f.merge(o,ve(r,t));return void 0===t||t&&f.nodeName(e,t)?f.merge([e],o):o}function ye(e){U.test(e.type)&&(e.defaultChecked=e.checked)}function be(e,t){return f.nodeName(e,"table")&&f.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xe(e){return e.type=(null!==f.find.attr(e,"type"))+"/"+e.type,e}function we(e){var t=pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Te(e,t){for(var n,r=0;null!=(n=e[r]);r++)f._data(n,"globalEval",!t||f._data(t[r],"globalEval"))}function Ce(e,t){if(1===t.nodeType&&f.hasData(e)){var n,r,i,o=f._data(e),a=f._data(t,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(r=0,i=s[n].length;i>r;r++)f.event.add(t,n,s[n][r]);a.data&&(a.data=f.extend({},a.data))}}function Ne(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!c.noCloneEvent&&t[f.expando]){for(r in(i=f._data(t)).events)f.removeEvent(t,r,i.handle);t.removeAttribute(f.expando)}"script"===n&&t.text!==e.text?(xe(t).text=e.text,we(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),c.html5Clone&&e.innerHTML&&!f.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&U.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}me.optgroup=me.option,me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,f.extend({clone:function(e,t,n){var r,i,o,a,s,l=f.contains(e.ownerDocument,e);if(c.html5Clone||f.isXMLDoc(e)||!ie.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ge.innerHTML=e.outerHTML,ge.removeChild(o=ge.firstChild)),!(c.noCloneEvent&&c.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||f.isXMLDoc(e)))for(r=ve(o),s=ve(e),a=0;null!=(i=s[a]);++a)r[a]&&Ne(i,r[a]);if(t)if(n)for(s=s||ve(e),r=r||ve(o),a=0;null!=(i=s[a]);a++)Ce(i,r[a]);else Ce(e,o);return(r=ve(o,"script")).length>0&&Te(r,!l&&ve(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,d,p=e.length,h=te(t),m=[],g=0;p>g;g++)if((o=e[g])||0===o)if("object"===f.type(o))f.merge(m,o.nodeType?[o]:o);else if(ue.test(o)){for(s=s||h.appendChild(t.createElement("div")),l=(se.exec(o)||["",""])[1].toLowerCase(),d=me[l]||me._default,s.innerHTML=d[1]+o.replace(ae,"<$1></$2>")+d[2],i=d[0];i--;)s=s.lastChild;if(!c.leadingWhitespace&&oe.test(o)&&m.push(t.createTextNode(oe.exec(o)[0])),!c.tbody)for(i=(o="table"!==l||le.test(o)?"<table>"!==d[1]||le.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;)f.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(f.merge(m,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else m.push(t.createTextNode(o));for(s&&h.removeChild(s),c.appendChecked||f.grep(ve(m,"input"),ye),g=0;o=m[g++];)if((!r||-1===f.inArray(o,r))&&(a=f.contains(o.ownerDocument,o),s=ve(h.appendChild(o),"script"),a&&Te(s),n))for(i=0;o=s[i++];)fe.test(o.type||"")&&n.push(o);return s=null,h},cleanData:function(e,t){for(var r,i,o,a,s=0,l=f.expando,u=f.cache,d=c.deleteExpando,p=f.event.special;null!=(r=e[s]);s++)if((t||f.acceptData(r))&&(a=(o=r[l])&&u[o])){if(a.events)for(i in a.events)p[i]?f.event.remove(r,i):f.removeEvent(r,i,a.handle);u[o]&&(delete u[o],d?delete r[l]:typeof r.removeAttribute!==M?r.removeAttribute(l):r[l]=null,n.push(o))}}}),f.fn.extend({text:function(e){return X(this,function(e){return void 0===e?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||N).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||be(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=be(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?f.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||f.cleanData(ve(n)),n.parentNode&&(t&&f.contains(n.ownerDocument,n)&&Te(ve(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&f.cleanData(ve(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&f.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return f.clone(this,e,t)})},html:function(e){return X(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(re,""):void 0;if(!("string"!=typeof e||ce.test(e)||!c.htmlSerialize&&ie.test(e)||!c.leadingWhitespace&&oe.test(e)||me[(se.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(ae,"<$1></$2>");try{for(;r>n;n++)1===(t=this[n]||{}).nodeType&&(f.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,f.cleanData(ve(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,o,a,s,l,u=0,d=this.length,p=this,h=d-1,m=e[0],g=f.isFunction(m);if(g||d>1&&"string"==typeof m&&!c.checkClone&&de.test(m))return this.each(function(n){var r=p.eq(n);g&&(e[0]=m.call(this,n,r.html())),r.domManip(e,t)});if(d&&(n=(l=f.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=n),n)){for(o=(a=f.map(ve(l,"script"),xe)).length;d>u;u++)r=l,u!==h&&(r=f.clone(r,!0,!0),o&&f.merge(a,ve(r,"script"))),t.call(this[u],r,u);if(o)for(s=a[a.length-1].ownerDocument,f.map(a,we),u=0;o>u;u++)r=a[u],fe.test(r.type||"")&&!f._data(r,"globalEval")&&f.contains(s,r)&&(r.src?f._evalUrl&&f._evalUrl(r.src):f.globalEval((r.text||r.textContent||r.innerHTML||"").replace(he,"")));l=n=null}return this}}),f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){f.fn[e]=function(e){for(var n,r=0,i=[],a=f(e),s=a.length-1;s>=r;r++)n=r===s?this:this.clone(!0),f(a[r])[t](n),o.apply(i,n.get());return this.pushStack(i)}});var Ee,ke={};function Se(t,n){var r,i=f(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:f.css(i[0],"display");return i.detach(),o}function Ae(e){var t=N,n=ke[e];return n||("none"!==(n=Se(e,t))&&n||((t=((Ee=(Ee||f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow||Ee[0].contentDocument).document).write(),t.close(),n=Se(e,t),Ee.detach()),ke[e]=n),n}!function(){var e;c.shrinkWrapBlocks=function(){return null!=e?e:(e=!1,(n=N.getElementsByTagName("body")[0])&&n.style?(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(N.createElement("div")).style.width="5px",e=3!==t.offsetWidth),n.removeChild(r),e):void 0);var t,n,r}}();var De,je,Le=/^margin/,He=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),qe=/^(top|right|bottom|left)$/;function _e(e,t){return{get:function(){var n=e();if(null!=n)return n?void delete this.get:(this.get=t).apply(this,arguments)}}}e.getComputedStyle?(De=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},je=function(e,t,n){var r,i,o,a,s=e.style;return a=(n=n||De(e))?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||f.contains(e.ownerDocument,e)||(a=f.style(e,t)),He.test(a)&&Le.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):N.documentElement.currentStyle&&(De=function(e){return e.currentStyle},je=function(e,t,n){var r,i,o,a,s=e.style;return null==(a=(n=n||De(e))?n[t]:void 0)&&s&&s[t]&&(a=s[t]),He.test(a)&&!qe.test(t)&&(r=s.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left
849=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),function(){var t,n,r,i,o,a,s;if((t=N.createElement("div")).innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=(r=t.getElementsByTagName("a")[0])&&r.style){function l(){var t,n,r,l;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",i=o=!1,s=!0,e.getComputedStyle&&(i="1%"!==(e.getComputedStyle(t,null)||{}).top,o="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,(l=t.appendChild(N.createElement("div"))).style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",l.style.marginRight=l.style.width="0",t.style.width="1px",s=!parseFloat((e.getComputedStyle(l,null)||{}).marginRight),t.removeChild(l)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(l=t.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(a=0===l[0].offsetHeight)&&(l[0].style.display="",l[1].style.display="none",a=0===l[0].offsetHeight),n.removeChild(r))}n.cssText="float:left;opacity:.5",c.opacity="0.5"===n.opacity,c.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===t.style.backgroundClip,c.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,f.extend(c,{reliableHiddenOffsets:function(){return null==a&&l(),a},boxSizingReliable:function(){return null==o&&l(),o},pixelPosition:function(){return null==i&&l(),i},reliableMarginRight:function(){return null==s&&l(),s}})}}(),f.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};var Me=/alpha\([^)]*\)/i,Fe=/opacity\s*=\s*([^)]*)/,Oe=/^(none|table(?!-c[ea]).+)/,Be=new RegExp("^("+$+")(.*)$","i"),Pe=new RegExp("^([+-])=("+$+")","i"),Re={position:"absolute",visibility:"hidden",display:"block"},We={letterSpacing:"0",fontWeight:"400"},$e=["Webkit","O","Moz","ms"];function ze(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=$e.length;i--;)if((t=$e[i]+n)in e)return t;return r}function Ie(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)(r=e[a]).style&&(o[a]=f._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&I(r)&&(o[a]=f._data(r,"olddisplay",Ae(r.nodeName)))):(i=I(r),(n&&"none"!==n||!i)&&f._data(r,"olddisplay",i?n:f.css(r,"display"))));for(a=0;s>a;a++)(r=e[a]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function Xe(e,t,n){var r=Be.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ue(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=f.css(e,n+z[o],!0,i)),r?("content"===n&&(a-=f.css(e,"padding"+z[o],!0,i)),"margin"!==n&&(a-=f.css(e,"border"+z[o]+"Width",!0,i))):(a+=f.css(e,"padding"+z[o],!0,i),"padding"!==n&&(a+=f.css(e,"border"+z[o]+"Width",!0,i)));return a}function Ve(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=De(e),a=c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,o);if(0>=i||null==i){if((0>(i=je(e,t,o))||null==i)&&(i=e.style[t]),He.test(i))return i;r=a&&(c.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ue(e,t,n||(a?"border":"content"),r,o)+"px"}function Je(e,t,n,r,i){return new Je.prototype.init(e,t,n,r,i)}f.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:c.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=f.camelCase(t),l=e.style;if(t=f.cssProps[s]||(f.cssProps[s]=ze(l,s)),a=f.cssHooks[t]||f.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if("string"===(o=typeof n)&&(i=Pe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(f.css(e,t)),o="number"),null!=n&&n==n&&("number"!==o||f.cssNumber[s]||(n+="px"),c.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=f.camelCase(t);return t=f.cssProps[s]||(f.cssProps[s]=ze(e.style,s)),(a=f.cssHooks[t]||f.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=je(e,t,r)),"normal"===o&&t in We&&(o=We[t]),""===n||n?(i=parseFloat(o),!0===n||f.isNumeric(i)?i||0:o):o}}),f.each(["height","width"],function(e,t){f.cssHooks[t]={get:function(e,n,r){return n?Oe.test(f.css(e,"display"))&&0===e.offsetWidth?f.swap(e,Re,function(){return Ve(e,t,r)}):Ve(e,t,r):void 0},set:function(e,n,r){var i=r&&De(e);return Xe(0,n,r?Ue(e,t,r,c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,i),i):0)}}}),c.opacity||(f.cssHooks.opacity={get:function(e,t){return Fe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=f.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===f.trim(o.replace(Me,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=Me.test(o)?o.replace(Me,i):o+" "+i)}}),f.cssHooks.marginRight=_e(c.reliableMarginRight,function(e,t){return t?f.swap(e,{display:"inline-block"},je,[e,"marginRight"]):void 0}),f.each({margin:"",padding:"",border:"Width"},function(e,t){f.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+z[r]+t]=o[r]||o[r-2]||o[0];return i}},Le.test(e)||(f.cssHooks[e+t].set=Xe)}),f.fn.extend({css:function(e,t){return X(this,function(e,t,n){var r,i,o={},a=0;if(f.isArray(t)){for(r=De(e),i=t.length;i>a;a++)o[t[a]]=f.css(e,t[a],!1,r);return o}return void 0!==n?f.style(e,t,n):f.css(e,t)},e,t,arguments.length>1)},show:function(){return Ie(this,!0)},hide:function(){return Ie(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){I(this)?f(this).show():f(this).hide()})}}),f.Tween=Je,Je.prototype={constructor:Je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(f.cssNumber[n]?"":"px")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.pos=t=this.options.duration?f.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}},Je.prototype.init.prototype=Je.prototype,Je.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=f.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){f.fx.step[e.prop]?f.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[f.cssProps[e.prop]]||f.cssHooks[e.prop])?f.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Je.propHooks.scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},f.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},f.fx=Je.prototype.init,f.fx.step={};var Ye,Ge,Qe=/^(?:toggle|show|hide)$/,Ke=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),Ze=/queueHooks$/,et=[function(e,t,n){var r,i,o,a,s,l,u,d=this,p={},h=e.style,m=e.nodeType&&I(e),g=f._data(e,"fxshow");for(r in n.queue||(null==(s=f._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,f.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=f.css(e,"display"),"inline"===("none"===u?f._data(e,"olddisplay")||Ae(e.nodeName):u)&&"none"===f.css(e,"float")&&(c.inlineBlockNeedsLayout&&"inline"!==Ae(e.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",c.shrinkWrapBlocks()||d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),t)if(i=t[r],Qe.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||f.style(e,r)}else u=void 0;if(f.isEmptyObject(p))"inline"===("none"===u?Ae(e.nodeName):u)&&(h.display=u);else for(r in g?"hidden"in g&&(m=g.hidden):g=f._data(e,"fxshow",{}),o&&(g.hidden=!m),m?f(e).show():d.done(function(){f(e).hide()}),d.done(function(){var t;for(t in f._removeData(e,"fxshow"),p)f.style(e,t,p[t])}),p)a=it(m?g[r]:0,r,d),r in g||(g[r]=a.start,m&&(a.end=a.start,a.start="width"===r||"he
849ight"===r?1:0))}],tt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Ke.exec(t),o=i&&i[3]||(f.cssNumber[e]?"":"px"),a=(f.cssNumber[e]||"px"!==o&&+r)&&Ke.exec(f.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do{a/=s=s||".5",f.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function nt(){return setTimeout(function(){Ye=void 0}),Ye=f.now()}function rt(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)r["margin"+(n=z[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function it(e,t,n){for(var r,i=(tt[t]||[]).concat(tt["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,t,e))return r}function ot(e,t,n){var r,i,o=0,a=et.length,s=f.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Ye||nt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;a>o;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),1>r&&a?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:f.extend({},t),opts:f.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ye||nt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=f.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=f.camelCase(n)],o=e[n],f.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=f.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);a>o;o++)if(r=et[o].call(u,e,c,u.opts))return r;return f.map(c,it,u),f.isFunction(u.opts.start)&&u.opts.start.call(e,u),f.fx.timer(f.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}f.Animation=f.extend(ot,{tweener:function(e,t){f.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],tt[n]=tt[n]||[],tt[n].unshift(t)},prefilter:function(e,t){t?et.unshift(e):et.push(e)}}),f.speed=function(e,t,n){var r=e&&"object"==typeof e?f.extend({},e):{complete:n||!n&&t||f.isFunction(e)&&e,duration:e,easing:n&&t||t&&!f.isFunction(t)&&t};return r.duration=f.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in f.fx.speeds?f.fx.speeds[r.duration]:f.fx.speeds._default,(null==r.queue||!0===r.queue)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){f.isFunction(r.old)&&r.old.call(this),r.queue&&f.dequeue(this,r.queue)},r},f.fn.extend({fadeTo:function(e,t,n,r){return this.filter(I).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=f.isEmptyObject(e),o=f.speed(t,n,r),a=function(){var t=ot(this,f.extend({},e),o);(i||f._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=f.timers,a=f._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&Ze.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&f.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=f._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=f.timers,a=r?r.length:0;for(n.finish=!0,f.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),f.each(["toggle","show","hide"],function(e,t){var n=f.fn[t];f.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,r,i)}}),f.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){f.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),f.timers=[],f.fx.tick=function(){var e,t=f.timers,n=0;for(Ye=f.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||f.fx.stop(),Ye=void 0},f.fx.timer=function(e){f.timers.push(e),e()?f.fx.start():f.timers.pop()},f.fx.interval=13,f.fx.start=function(){Ge||(Ge=setInterval(f.fx.tick,f.fx.interval))},f.fx.stop=function(){clearInterval(Ge),Ge=null},f.fx.speeds={slow:600,fast:200,_default:400},f.fn.delay=function(e,t){return e=f.fx&&f.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;(t=N.createElement("div")).setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a>
849<input type='checkbox'/>",r=t.getElementsByTagName("a")[0],i=(n=N.createElement("select")).appendChild(N.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",c.getSetAttribute="t"!==t.className,c.style=/top/.test(r.getAttribute("style")),c.hrefNormalized="/a"===r.getAttribute("href"),c.checkOn=!!e.value,c.optSelected=i.selected,c.enctype=!!N.createElement("form").enctype,n.disabled=!0,c.optDisabled=!i.disabled,(e=N.createElement("input")).setAttribute("value",""),c.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),c.radioValue="t"===e.value}();var at=/\r/g;f.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=f.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,f(this).val()):e)?i="":"number"==typeof i?i+="":f.isArray(i)&&(i=f.map(i,function(e){return null==e?"":e+""})),(t=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=f.valHooks[i.type]||f.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(at,""):null==n?"":n:void 0}}),f.extend({valHooks:{option:{get:function(e){var t=f.find.attr(e,"value");return null!=t?t:f.trim(f.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(!(!(n=r[l]).selected&&l!==i||(c.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&f.nodeName(n.parentNode,"optgroup"))){if(t=f(n).val(),o)return t;a.push(t)}return a}
849,set:function(e,t){for(var n,r,i=e.options,o=f.makeArray(t),a=i.length;a--;)if(r=i[a],f.inArray(f.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]={set:function(e,t){return f.isArray(t)?e.checked=f.inArray(f(e).val(),t)>=0:void 0}},c.checkOn||(f.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var st,lt,ut=f.expr.attrHandle,ct=/^(?:checked|selected)$/i,dt=c.getSetAttribute,ft=c.input;f.fn.extend({attr:function(e,t){return X(this,f.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){f.removeAttr(this,e)})}}),f.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===M?f.prop(e,t,n):(1===o&&f.isXMLDoc(e)||(t=t.toLowerCase(),r=f.attrHooks[t]||(f.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=f.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void f.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(j);if(o&&1===e.nodeType)for(;n=o[i++];)r=f.propFix[n]||n,f.expr.match.bool.test(n)?ft&&dt||!ct.test(n)?e[r]=!1:e[f.camelCase("default-"+n)]=e[r]=!1:f.attr(e,n,""),e.removeAttribute(dt?n:r)},attrHooks:{type:{set:function(e,t){if(!c.radioValue&&"radio"===t&&f.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return!1===t?f.removeAttr(e,n):ft&&dt||!ct.test(n)?e.setAttribute(!dt&&f.propFix[n]||n,n):e[f.camelCase("default-"+n)]=e[n]=!0,n}},f.each(f.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ut[t]||f.find.attr;ut[t]=ft&&dt||!ct.test(t)?function(e,t,r){var i,o;return r||(o=ut[t],ut[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ut[t]=o),i}:function(e,t,n){return n?void 0:e[f.camelCase("default-"+t)]?t.toLowerCase():null}}),ft&&dt||(f.attrHooks.value={set:function(e,t,n){return f.nodeName(e,"input")?void(e.defaultValue=t):st&&st.set(e,t,n)}}),dt||(st={set:function(e,t,n){var r=e.getAttributeNode(n);return r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n)?t:void 0}},ut.id=ut.name=ut.coords=function(e,t,n){var r;return n?void 0:(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},f.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:void 0},set:st.set},f.attrHooks.contenteditable={set:function(e,t,n){st.set(e,""!==t&&t,n)}},f.each(["width","height"],function(e,t){f.attrHooks[t]={set:function(e,n){return""===n?(e.setAttribute(t,"auto"),n):void 0}}})),c.style||(f.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var pt=/^(?:input|select|textarea|button|object)$/i,ht=/^(?:a|area)$/i;f.fn.extend({prop:function(e,t){return X(this,f.prop,e,t,arguments.length>1)},removeProp:function(e){return e=f.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),f.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!f.isXMLDoc(e))&&(t=f.propFix[t]||t,i=f.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=f.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}}}),c.hrefNormalized||f.each(["href","src"],function(e,t){f.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),c.optSelected||(f.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),f.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){f.propFix[this.toLowerCase()]=this}),c.enctype||(f.propFix.enctype="encoding");var mt=/[\t\r\n\f]/g;f.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;
849if(f.isFunction(e))return this.each(function(t){f(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=f.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(f.isFunction(e))return this.each(function(t){f(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?f.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(f.isFunction(e)?function(n){f(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=f(this),o=e.match(j)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===M||"boolean"===n)&&(this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===e?"":f._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(mt," ").indexOf(t)>=0)return!0;return!1}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){f.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),f.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var gt=f.now(),vt=/\?/,yt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;f.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=f.trim(t+"");return i&&!f.trim(i.replace(yt,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():f.error("Invalid JSON: "+t)},f.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new DOMParser).parseFromString(t,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||f.error("Invalid XML: "+t),n};var bt,xt,wt=/#.*$/,Tt=/([?&])_=[^&]*/,Ct=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nt=/^(?:GET|HEAD)$/,Et=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,St={},At={},Dt="*/".concat("*");try{xt=location.href}catch(e){(xt=N.createElement("a")).href="",xt=xt.href}function jt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(j)||[];if(f.isFunction(n))for(;r=o[i++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Lt(e,t,n,r){var i={},o=e===At;function a(s){var l;return i[s]=!0,f.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ht(e,t){var n,r,i=f.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&f.extend(!0,e,n),e}bt=kt.exec(xt.toLowerCase())||[],f.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}
vendor: 5,286 bytes, line 849
849,flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ht(Ht(e,f.ajaxSettings),t):Ht(f.ajaxSettings,e)},ajaxPrefilter:jt(St),ajaxTransport:jt(At),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,a,s,l,u,c=f.ajaxSetup({},t),d=c.context||c,p=c.context&&(d.nodeType||d.jquery)?f(d):f.event,h=f.Deferred(),m=f.Callbacks("once memory"),g=c.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!u)for(u={};t=Ct.exec(o);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return l&&l.abort(t),T(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||xt)+"").replace(wt,"").replace(Et,bt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=f.trim(c.dataType||"*").toLowerCase().match(j)||[""],null==c.crossDomain&&(n=kt.exec(c.url.toLowerCase()),c.crossDomain=!(!n||n[1]===bt[1]&&n[2]===bt[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(bt[3]||("http:"===bt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=f.param(c.data,c.traditional)),Lt(St,c,t,w),2===b)return w;for(r in(s=f.event&&c.global)&&0==f.active++&&f.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Nt.test(c.type),i=c.url,c.hasContent||(c.data&&(i=c.url+=(vt.test(i)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=Tt.test(i)?i.replace(Tt,"$1_="+gt++):i+(vt.test(i)?"&":"?")+"_="+gt++)),c.ifModified&&(f.lastModified[i]&&w.setRequestHeader("If-Modified-Since",f.lastModified[i]),f.etag[i]&&w.setRequestHeader("If-None-Match",f.etag[i])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+Dt+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(r,c.headers[r]);if(c.beforeSend&&(!1===c.beforeSend.call(d,w,c)||2===b))return w.abort();for(r in x="abort",{success:1,error:1,complete:1})w[r](c[r]);if(l=Lt(At,c,t,w)){w.readyState=1,s&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},c.timeout));try{b=1,l.send(v,T)}catch(e){if(!(2>b))throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,n,r){var u,v,y,x,T,C=t;2!==b&&(b=2,a&&clearTimeout(a),l=void 0,o=r||"",w.readyState=e>0?4:0,u=e>=200&&300>e||304===e,n&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}return o?(o!==l[0]&&l.unshift(o),n[o]):void 0}(c,w,n)),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(c,x,w,u),u?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(f.lastModified[i]=T),(T=w.getResponseHeader("etag"))&&(f.etag[i]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=x.state,v=x.data,u=!(y=x.error))):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),w.status=e,w.statusText=(t||C)+"",u?h.resolveWith(d,[v,C,w]):h.rejectWith(d,[w,C,y]),w.statusCode(g),g=void 0,s&&p.trigger(u?"ajaxSuccess":"ajaxError",[w,c,u?v:y]),m.fireWith(d,[w,C]),s&&(p.trigger("ajaxComplete",[w,c]),--f.active||f.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return f.get(e,t,n,"json")},getScript:function(e,t){return f.get(e,void 0,t,"script")}}),f.each(["get","post"],function(e,t){f[t]=function(e,n,r,i){return f.isFunction(n)&&(i=i||r,r=n,n=void 0),f.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),f._evalUrl=function(e){return f.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},f.fn.extend({wrapAll:function(e){if(f.isFunction(e))return this.each(function(t){f(this).wrapAll(e.call(this,t))});if(this[0]){var t=f(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(f.isFunction(e)?function(t){f(this).wrapInner(e.call(this,t))}:function(){var t=f(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f.isFunction(e);return this.each(function(n){f(this).wrapAll(t?e.call(this,n):e)})}
vendor: 5,879 bytes, line 849
849,unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()}}),f.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!c.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||f.css(e,"display"))},f.expr.filters.visible=function(e){return!f.expr.filters.hidden(e)};var qt=/%20/g,_t=/\[\]$/,Mt=/\r?\n/g,Ft=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Bt(e,t,n,r){var i;if(f.isArray(t))f.each(t,function(t,i){n||_t.test(e)?r(e,i):Bt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==f.type(t))r(e,t);else for(i in t)Bt(e+"["+i+"]",t[i],n,r)}f.param=function(e,t){var n,r=[],i=function(e,t){t=f.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=f.ajaxSettings&&f.ajaxSettings.traditional),f.isArray(e)||e.jquery&&!f.isPlainObject(e))f.each(e,function(){i(this.name,this.value)});else for(n in e)Bt(n,e[n],t,i);return r.join("&").replace(qt,"+")},f.fn.extend({serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=f.prop(this,"elements");return e?f.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!f(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ft.test(e)&&(this.checked||!U.test(e))}).map(function(e,t){var n=f(this).val();return null==n?null:f.isArray(n)?f.map(n,function(e){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}}),f.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$t()||function(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:$t;var Pt=0,Rt={},Wt=f.ajaxSettings.xhr();function $t(){try{return new e.XMLHttpRequest}catch(e){}}e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Rt)Rt[e](void 0,!0)}),c.cors=!!Wt&&"withCredentials"in Wt,(Wt=c.ajax=!!Wt)&&f.ajaxTransport(function(e){var t;if(!e.crossDomain||c.cors)return{send:function(n,r){var i,o=e.xhr(),a=++Pt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Rt[a],t=void 0,o.onreadystatechange=f.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Rt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return f.globalEval(e),e}}}),f.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),f.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=N.head||f("head")[0]||N.documentElement;return{send:function(r,i){(t=N.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var zt=[],It=/(=)\?(?=&|$)|\?\?/;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||f.expando+"_"+gt++;return this[e]=!0,e}}),f.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(It.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&It.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=f.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(It,"$1"+i):!1!==t.jsonp&&(t.url+=(vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||f.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),a&&f.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),f.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||N;var r=x.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f.buildFragment([e],t,i),i&&i.length&&f(i).remove(),f.merge([],r.childNodes))};var Xt=f.fn.load;f.fn.load=function(e,t,n){if("string"!=typeof e&&Xt)return Xt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=f.trim(e.slice(s,e.length)),e=e.slice(0,s)),f.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&f.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?f("<div>").append(f.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},f.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){f.fn[t]=function(e){return this.on(t,e)}}),f.expr.filters.animated=function(e){return f.grep(f.timers,function(t){return e===t.elem}).length};var Ut=e.document.documentElement;function Vt(e){return f.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}f.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=f.css(e,"position"),c=f(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=f.css(e,"to
849p"),l=f.css(e,"left"),("absolute"===u||"fixed"===u)&&f.inArray("auto",[o,l])>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),f.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},f.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){f.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,f.contains(t,i)?(typeof i.getBoundingClientRect!==M&&(r=i.getBoundingClientRect()),n=Vt(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===f.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),f.nodeName(e[0],"html")||(n=e.offset()),n.top+=f.css(e[0],"borderTopWidth",!0),n.left+=f.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-f.css(r,"marginTop",!0),left:t.left-n.left-f.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Ut;e&&!f.nodeName(e,"html")&&"static"===f.css(e,"position");)e=e.offsetParent;return e||Ut})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);f.fn[e]=function(r){return X(this,function(e,r,i){var o=Vt(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?f(o).scrollLeft():i,n?i:f(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),f.each(["top","left"],function(e,t){f.cssHooks[t]=_e(c.pixelPosition,function(e,n){return n?(n=je(e,t),He.test(n)?f(e).position()[t]+"px":n):void 0})}),f.each({Height:"height",Width:"width"},function(e,t){f.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){f.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return X(this,function(t,n,r){var i;return f.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?f.css(t,n,a):f.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),f.fn.size=function(){return this.length},f.fn.andSelf=f.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return f});var Jt=e.jQuery,Yt=e.$;return f.noConflict=function(t){return e.$===f&&(e.$=Yt),t&&e.jQuery===f&&(e.jQuery=Jt),f},typeof t===M&&(e.jQuery=e.$=f),f});
850        	IV$ = window.IV$ = jQuery.noConflict(true); 
851        }else{
852            if($().jquery !== '1.4.4'){
853                IV$ = $;
854            }else{
855                !function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,a=n.indexOf,s={},l=s.toString,u=s.hasOwnProperty,c={},d="1.11.2",f=function(e,t){return new f.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,h=/^-ms-/,m=/-([\da-z])/gi,g=function(e,t){return t.toUpperCase()};function v(e){var t=e.length,n=f.type(e);return"function"!==n&&!f.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}f.fn=f.prototype={jquery:d,constructor:f,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=f.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return f.each(this,e,t)},map:function(e){return this.pushStack(f.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},f.extend=f.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{}
855,s++),"object"==typeof a||f.isFunction(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(i=arguments[s]))for(r in i)e=a[r],a!==(n=i[r])&&(u&&n&&(f.isPlainObject(n)||(t=f.isArray(n)))?(t?(t=!1,o=e&&f.isArray(e)?e:[]):o=e&&f.isPlainObject(e)?e:{},a[r]=f.extend(u,o,n)):void 0!==n&&(a[r]=n));return a},f.extend({expando:"jQuery"+(d+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===f.type(e)},isArray:Array.isArray||function(e){return"array"===f.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!f.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==f.type(e)||e.nodeType||f.isWindow(e))return!1;try{if(e.constructor&&!u.call(e,"constructor")&&!u.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(c.ownLast)for(t in e)return u.call(e,t);for(t in e);return void 0===t||u.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[l.call(e)]||"object":typeof e},globalEval:function(t){t&&f.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(h,"ms-").replace(m,g)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=v(e);if(n){if(o)for(;i>r&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;i>r&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(v(Object(e))?f.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(a)return a.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;)e[i++]=t[r++];if(n!=n)for(;void 0!==t[r];)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;o>i;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,o=0,a=e.length,s=[];if(v(e))for(;a>o;o++)null!=(r=t(e[o],o,n))&&s.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&s.push(r);return i.apply([],s)},guid:1,proxy:function(e,t){var n,i,o;return"string"==typeof t&&(o=e[t],t=e,e=o),f.isFunction(e)?(n=r.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(r.call(arguments)))}).guid=e.guid=e.guid||f.guid++,i):void 0},now:function(){return+new Date},support:c}),f.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var y=function(e){var t,n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,x="sizzle"+1*new Date,w=e.document,T=0,C=0,N=ae(),E=ae(),k=ae(),S=function(e,t){return e===t&&(d=!0),0},A=1<<31,D={}.hasOwnProperty,j=[],L=j.pop,H=j.push,q=j.push,_=j.slice,M=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",P=B.replace("w","w#"),R="\\["+O+"*("+B+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+O+"*\\]",W=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",$=new RegExp(O+"+","g"),z=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),I=new RegExp("^"+O+"*,"+O+"*"),X=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),U=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),V=new RegExp(W),J=new RegExp("^"+P+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=/'|\\/g,ne=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),re=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ie=function(){f()};try{q.apply(j=_.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){q={apply:j.length?function(e,t){H.apply(e,_.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}
855function oe(e,t,r,i){var o,s,u,c,d,h,v,y,T,C;if((t?t.ownerDocument||t:w)!==p&&f(t),r=r||[],c=(t=t||p).nodeType,"string"!=typeof e||!e||1!==c&&9!==c&&11!==c)return r;if(!i&&m){if(11!==c&&(o=Z.exec(e)))if(u=o[1]){if(9===c){if(!(s=t.getElementById(u))||!s.parentNode)return r;if(s.id===u)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&b(t,s)&&s.id===u)return r.push(s),r}else{if(o[2])return q.apply(r,t.getElementsByTagName(e)),r;if((u=o[3])&&n.getElementsByClassName)return q.apply(r,t.getElementsByClassName(u)),r}if(n.qsa&&(!g||!g.test(e))){if(y=v=x,T=t,C=1!==c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(h=a(e),(v=t.getAttribute("id"))?y=v.replace(te,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",d=h.length;d--;)h[d]=y+ge(h[d]);T=ee.test(e)&&he(t.parentNode)||t,C=h.join(",")}if(C)try{return q.apply(r,T.querySelectorAll(C)),r}catch(e){}finally{v||t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(p=a,h=a.documentElement,(i=a.defaultView)&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",ie,!1):i.attachEvent&&i.attachEvent("onunload",ie)),m=!o(a),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(a.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(a.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!a.getElementsByName||!a.getElementsByName(x).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){return m?t.getElementsByClassName(e):void 0},v=[],g=[],(n.qsa=K.test(a.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")}),le(function(e){var t=a.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.j
vendor: 6,266 bytes, line 855
855oin("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===a||e.ownerDocument===w&&b(w,e)?-1:t===a||t.ownerDocument===w&&b(w,t)?1:c?M(c,e)-M(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!i||!o)return e===a?-1:t===a?1:i?-1:o?1:c?M(c,e)-M(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?ce(s[r],l[r]):s[r]===w?-1:l[r]===w?1:0},a):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(U,"='$1']"),!(!n.matchesSelector||!m||v&&v.test(t)||g&&g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(p=(u=(c=g[x]||(g[x]={}))[e]||[])[0]===T&&u[1],f=u[0]===T&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){c[e]=[T,p,f];break}}else if(y&&(u=(t[x]||(t[x]={}))[e])&&u[0]===T)f=u[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[x]||(d[x]={}))[e]=[T,f]),d!==t)););return(f-=i)===r||f%r==0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[x]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(ne,re),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return J.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)}
vendor: 5,116 bytes, line 855
855,input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[0>n?n+t:n]}),even:pe(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pe(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pe(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pe(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function me(){}function ge(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[T,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((s=(l=t[x]||(t[x]={}))[r])&&s[0]===T&&s[1]===o)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,a))return!0}}}function ye(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function xe(e,t,n,r,i,o){return r&&!r[x]&&(r=xe(r)),i&&!i[x]&&(i=xe(i,o)),se(function(o,a,s,l){var u,c,d,f=[],p=[],h=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;i>r;r++)oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:be(m,f,e,s,l),v=n?i||(o?e:h||r)?[]:a:g;if(n&&n(g,v,s,l),r)for(u=be(v,p),r(u,[],s,l),c=u.length;c--;)(d=u[c])&&(v[p[c]]=!(g[p[c]]=d));if(o){if(i||e){if(i){for(u=[],c=v.length;c--;)(d=v[c])&&u.push(g[c]=d);i(null,v=[],u,l)}for(c=v.length;c--;)(d=v[c])&&(u=i?M(o,d):f[c])>-1&&(o[u]=!(a[u]=d))}}else v=be(v===a?v.splice(h,v.length):v),i?i(null,a,v,l):q.apply(a,v)})}function we(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=ve(function(e){return e===t},s,!0),d=ve(function(e){return M(t,e)>-1},s,!0),f=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,i}];o>l;l++)if(n=r.relative[e[l].type])f=[ve(ye(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;o>i&&!r.relative[e[i].type];i++);return xe(l>1&&ye(f),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,i>l&&we(e.slice(l,i)),o>i&&we(e=e.slice(i)),o>i&&ge(e))}f.push(n)}return ye(f)}function Te(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var d,f,h,m=0,g="0",v=o&&[],y=[],b=u,x=o||i&&r.find.TAG("*",c),w=T+=null==b?1:Math.random()||.1,C=x.length;for(c&&(u=a!==p&&a);g!==C&&null!=(d=x[g]);g++){if(i&&d){for(f=0;h=e[f++];)if(h(d,a,s)){l.push(d);break}c&&(T=w)}n&&((d=!h&&d)&&m--,o&&v.push(d))}if(m+=g,n&&g!==m){for(f=0;h=t[f++];)h(v,y,a,s);if(o){if(m>0)for(;g--;)v[g]||y[g]||(y[g]=L.call(l));y=be(y)}q.apply(l,y),c&&!o&&y.length>0&&m+t.length>1&&oe.uniqueSort(l)}return c&&(T=w,u=b),v};return n?se(o):o}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=oe.tokenize=function(e,t){var n,i,o,a,s,l,u,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in(!n||(i=I.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=X.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=Y[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):E(e,l).slice(0)},s=oe.compile=function(e,t){var n,r=[],i=[],o=k[e+" "];if(!o){for(t||(t=a(e)),n=t.length;n--;)(o=we(t[n]))[x]?r.push(o):i.push(o);(o=k(e,Te(i,r))).selector=e}return o},l=oe.select=function(e,t,i,o){var l,u,c,d,f,p="function"==typeof e&&e,h=!o&&a(e=p.selector||e);if(i=i||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&n.getById&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(ne,re),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(l=Y.needsContext.test(e)?0:u.length;l--&&(c=u[l],!r.relative[d=c.type]);)if((f=r.find[d])&&(o=f(c.matches[0].replace(ne,re),ee.test(u[0].type)&&he(t.parentNode)||t))){if(u.splice(l,1),!(e=o.length&&ge(u)))return q.apply(i,o),i;break}}return(p||s(e,h))(o,t,!m,i,ee.test(e)&&he(t.parentNode)||t),i},n.sortStable=x.split("").sort(S).join("")===x,n.detectDuplicates=!!d,f(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}
855)||ue("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(F,function(e,t,n){var r;return n?void 0:!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);f.find=y,f.expr=y.selectors,f.expr[":"]=f.expr.pseudos,f.unique=y.uniqueSort,f.text=y.getText,f.isXMLDoc=y.isXML,f.contains=y.contains;var b=f.expr.match.needsContext,x=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function T(e,t,n){if(f.isFunction(t))return f.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return f.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(w.test(t))return f.filter(t,e,n);t=f.filter(t,e)}return f.grep(e,function(e){return f.inArray(e,t)>=0!==n})}f.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?f.find.matchesSelector(r,e)?[r]:[]:f.find.matches(e,f.grep(t,function(e){return 1===e.nodeType}))},f.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(f(e).filter(function(){for(t=0;i>t;t++)if(f.contains(r[t],this))return!0}));for(t=0;i>t;t++)f.find(e,r[t],n);return(n=this.pushStack(i>1?f.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?f(e):e||[],!1).length}});var C,N=e.document,E=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(f.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:E.exec(e))||!n[1]&&t)return!t||t.jquery?(t||C).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof f?t[0]:t,f.merge(this,f.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:N,!0)),x.test(n[1])&&f.isPlainObject(t))for(n in t)f.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((r=N.getElementById(n[2]))&&r.parentNode){if(r.id!==n[2])return C.find(e);this.length=1,this[0]=r}return this.context=N,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):f.isFunction(e)?void 0!==C.ready?C.ready(e):e(f):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),f.makeArray(e,this))}).prototype=f.fn,C=f(N);var k=/^(?:parents|prev(?:Until|All))/,S={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}f.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!f(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),f.fn.extend({has:function(e){var t,n=f(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(f.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=b.test(e)||"string"!=typeof e?f(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&f.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?f.unique(o):o)},index:function(e){return e?"string"==typeof e?f.inArray(this[0],f(e)):f.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(f.unique(f.merge(this.get(),f(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),f.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return f.dir(e,"parentNode")},parentsUntil:function(e,t,n){return f.dir(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return f.dir(e,"nextSibling")},prevAll:function(e){return f.dir(e,"previousSibling")},nextUntil:function(e,t,n){return f.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return f.dir(e,"previousSibling",n)},siblings:function(e){return f.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return f.sibling(e.firstChild)},contents:function(e){return f.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:f.merge([],e.childNodes)}},function(e,t){f.fn[e]=function(n,r){var i=f.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=f.filter(r,i)),this.length>1&&(S[e]||(i=f.unique(i)),k.test(e)&&(i=i.reverse())),this.pushStack(i)}});var D,j=/\S+/g,L={};function H(){N.addEventListener?(N.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(N.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))}function q(){(N.addEventListener||"load"===event.type||"complete"===N.readyState)&&(H(),f.ready())}f.Callbacks=function(e){e="string"==typeof e?L[e]||function(e){var t=L[e]={};return f.each(e.match(j)||[],function(e,n){t[n]=!0}),t}(e):f.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(d){for(n=e.memory&&d,r=!0,o=a||0,a=0,i=s.length,t=!0;s&&i>o;o++)if(!1===s[o].apply(d[0],d[1])&&e.stopOnFalse){n=!1;break}t=!1,s&&(l?l.length&&u(l.shift()):n?s=[]:c.disable())},c={add:function(){if(s){var r=s.length;!function t(n){f.each(n,function(n,r){var i=f.type(r);"function"===i?e.unique&&c.has(r)||s.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=s.length:n&&(a=r,u(n))}return this},remove:function(){return s&&f.each(arguments,function(e,n){for(var r;(r=f.inArray(n,s,r))>-1;)s.splice(r,1),t&&(i>=r&&i--,o>=r&&o--)}),this},has:function(e){return e?f.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],i=0,this},disable:function(){return s=l=n=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,n||c.disable(),this},locked:function(){return!l},fireWith:function(e,n){return!s||r&&!l||(n=[e,(n=n||[]).slice?n.slice():n],t?l.push(n):u(n)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},f.extend({Deferred:function(e){var t=[["resolve","done",f.Callbacks("once memory"),"resolved"],["reject","fail",f.Callbacks("once memory"),"rejected"],["notify","progress",f.Callbacks("memory")]],n="pe
855nding",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f.Deferred(function(n){f.each(t,function(t,o){var a=f.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&f.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?f.extend(e,r):r}},i={};return r.pipe=r.then,f.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,a=r.call(arguments),s=a.length,l=1!==s||e&&f.isFunction(e.promise)?s:0,u=1===l?e:f.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?u.notifyWith(n,i):--l||u.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);s>o;o++)a[o]&&f.isFunction(a[o].promise)?a[o].promise().done(c(o,i,a)).fail(u.reject).progress(c(o,n,t)):--l;return l||u.resolveWith(i,a),u.promise()}}),f.fn.ready=function(e){return f.ready.promise().done(e),this},f.extend({isReady:!1,readyWait:1,holdReady:function(e){e?f.readyWait++:f.ready(!0)},ready:function(e){if(!0===e?!--f.readyWait:!f.isReady){if(!N.body)return setTimeout(f.ready);f.isReady=!0,!0!==e&&--f.readyWait>0||(D.resolveWith(N,[f]),f.fn.triggerHandler&&(f(N).triggerHandler("ready"),f(N).off("ready")))}}}),f.ready.promise=function(t){if(!D)if(D=f.Deferred(),"complete"===N.readyState)setTimeout(f.ready);else if(N.addEventListener)N.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{N.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var n=!1;try{n=null==e.frameElement&&N.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!f.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}H(),f.ready()}}()}return D.promise(t)};var _,M="undefined";for(_ in f(c))break;c.ownLast="0"!==_,c.inlineBlockNeedsLayout=!1,f(function(){var e,t,n,r;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",c.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=N.createElement("div");if(null==c.deleteExpando){c.deleteExpando=!0;try{delete e.test}catch(e){c.deleteExpando=!1}}e=null}(),f.acceptData=function(e){var t=f.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function B(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(O,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:F.test(n)?f.parseJSON(n):n)}catch(e){}f.data(e,t,n)}else n=void 0}return n}function P(e){var t;for(t in e)if(("data"!==t||!f.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function R(e,t,r,i){if(f.acceptData(e)){var o,a,s=f.expando,l=e.nodeType,u=l?f.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||void 0!==r||"string"!=typeof t)return c||(c=l?e[s]=n.pop()||f.guid++:s),u[c]||(u[c]=l?{}:{toJSON:f.noop}),("object"==typeof t||"function"==typeof t)&&(i?u[c]=f.extend(u[c],t):u[c].data=f.extend(u[c].data,t)),a=u[c],i||(a.data||(a.data={}),a=a.data),void 0!==r&&(a[f.camelCase(t)]=r),"string"==typeof t?null==(o=a[t])&&(o=a[f.camelCase(t)]):o=a,o}}function W(e,t,n){if(f.acceptData(e)){var r,i,o=e.nodeType,a=o?f.cache:e,s=o?e[f.expando]:f.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){f.isArray(t)?t=t.concat(f.map(t,f.camelCase)):t in r?t=[t]:t=(t=f.camelCase(t))in r?[t]:t.split(" "),i=t.length;for(;i--;)delete r[t[i]];if(n?!P(r):!f.isEmptyObject(r))return}
855(n||(delete a[s].data,P(a[s])))&&(o?f.cleanData([e],!0):c.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}f.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?f.cache[e[f.expando]]:e[f.expando])&&!P(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)}}),f.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=f.data(o),1===o.nodeType&&!f._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(0===(r=a[n].name).indexOf("data-")&&B(o,r=f.camelCase(r.slice(5)),i[r]));f._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){f.data(this,e)}):arguments.length>1?this.each(function(){f.data(this,e,t)}):o?B(o,e,f.data(o,e)):void 0},removeData:function(e){return this.each(function(){f.removeData(this,e)})}}),f.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=f._data(e,t),n&&(!r||f.isArray(n)?r=f._data(e,t,f.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=f.queue(e,t),r=n.length,i=n.shift(),o=f._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){f.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return f._data(e,n)||f._data(e,n,{empty:f.Callbacks("once memory").add(function(){f._removeData(e,t+"queue"),f._removeData(e,n)})})}}),f.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?f.queue(this[0],e):void 0===t?this:this.each(function(){var n=f.queue(this,e,t);f._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&f.dequeue(this,e)})},dequeue:function(e){return this.each(function(){f.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=f.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=f._data(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,z=["Top","Right","Bottom","Left"],I=function(e,t){return e=t||e,"none"===f.css(e,"display")||!f.contains(e.ownerDocument,e)},X=f.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===f.type(n))for(s in i=!0,n)f.access(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,f.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(f(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},U=/^(?:checkbox|radio)$/i;!function(){var e=N.createElement("input"),t=N.createElement("div"),n=N.createDocumentFragment();if(t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c.leadingWhitespace=3===t.firstChild.nodeType,c.tbody=!t.getElementsByTagName("tbody").length,c.htmlSerialize=!!t.getElementsByTagName("link").length,c.html5Clone="<:nav></:nav>"!==N.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),c.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",c.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",c.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,c.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){c.noCloneEvent=!1}),t.cloneNode(!0).click()),null==c.deleteExpando){c.deleteExpando=!0;try{delete t.test}catch(e){c.deleteExpando=!1}}}(),function(){var t,n,r=N.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(c[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),c[t+"Bubbles"]=!1===r.attributes[n].expando);r=null}();var V=/^(?:input|select|textarea)$/i,J=/^key/,Y=/^(?:mouse|pointer|contextmenu)|click/,G=/^(?:focusinfocus|focusoutblur)$/,Q=/^([^.]*)(?:\.(.+)|)$/;function K(){return!0}function Z(){return!1}function ee(){try{return N.activeElement}catch(e){}}function te(e){var t=ne.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}f.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f._data(e);if(v){for(n.handler&&(n=(l=n).handler,i=l.selector),n.guid||(n.guid=f.guid++),(a=v.events)||(a=v.events={}),(c=v.handle)||((c=v.handle=function(e){return typeof f===M||e&&f.event.triggered===e.type?void 0:f.event.dispatch.apply(c.elem,arguments)}).elem=e),s=(t=(t||"").match(j)||[""]).length;s--;)h=g=(o=Q.exec(t[s])||[])[1],m=(o[2]||"").split(".").sort(),h&&(u=f.event.special[h]||{},h=(i?u.delegateType:u.bindType)||h,u=f.event.special[h]||{},d=f.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&f.expr.match.needsContext.test(i),namespace:m.join(".")},l),(p=a[h])||((p=a[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,r,m,c)||(e.addEventListener?e.addEventListener(h,c,!1):e.attachEvent&&e.attachEvent("on"+h,c))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,d):p.push(d),f.event.global[h]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f.hasData(e)&&f._data(e);if(v&&(c=v.events)){for(u=(t=(t||"").match(j)||[""]).length;u--;)if(h=g=(s=Q.exec(t[u])||[])[1],m=(s[2]||"").split(".").sort(),h){for(d=f.event.special[h]||{},p=c[h=(r?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=p.length;o--;)a=p[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(p.splice(o,1),a.selector&&p.delegateCount--,d.remove&&d.remove.call(e,a));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||f.removeEvent(e,h,v.handle),delete c[h])}else for(h in c)f.event.remove(e,h+t[u],n,r,!0);f.isEmptyObject(c)&&(delete v.handle,f._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,c,d,p,h=[r||N],m=u.call(t,"type")?t.type:t,g=u.call(t,"namespace")?t.namespace.split("."):[];if(s=d=r=r||N,3!==r.nodeType&&8!==r.nodeType&&!G.test(m+f.event.triggered)&&(m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort()),a=m.indexOf(":")<0&&"on"+m,(t=t[f.expando]?t:new f.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.n
855amespace_re=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:f.makeArray(n,[t]),c=f.event.special[m]||{},i||!c.trigger||!1!==c.trigger.apply(r,n))){if(!i&&!c.noBubble&&!f.isWindow(r)){for(l=c.delegateType||m,G.test(l+m)||(s=s.parentNode);s;s=s.parentNode)h.push(s),d=s;d===(r.ownerDocument||N)&&h.push(d.defaultView||d.parentWindow||e)}for(p=0;(s=h[p++])&&!t.isPropagationStopped();)t.type=p>1?l:c.bindType||m,(o=(f._data(s,"events")||{})[t.type]&&f._data(s,"handle"))&&o.apply(s,n),(o=a&&s[a])&&o.apply&&f.acceptData(s)&&(t.result=o.apply(s,n),!1===t.result&&t.preventDefault());if(t.type=m,!i&&!t.isDefaultPrevented()&&(!c._default||!1===c._default.apply(h.pop(),n))&&f.acceptData(r)&&a&&r[m]&&!f.isWindow(r)){(d=r[a])&&(r[a]=null),f.event.triggered=m;try{r[m]()}catch(e){}f.event.triggered=void 0,d&&(r[a]=d)}return t.result}},dispatch:function(e){e=f.event.fix(e);var t,n,i,o,a,s=[],l=r.call(arguments),u=(f._data(this,"events")||{})[e.type]||[],c=f.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(s=f.event.handlers.call(this,e,u),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,void 0!==(n=((f.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],o=0;s>o;o++)void 0===i[n=(r=t[o]).selector+" "]&&(i[n]=r.needsContext?f(n,this).index(l)>=0:f.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[f.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Y.test(i)?this.mouseHooks:J.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new f.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=o.srcElement||N),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=(r=e.target.ownerDocument||N).documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ee()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===ee()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return f.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return f.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=f.extend(new f.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?f.event.trigger(i,null,t):f.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},f.removeEvent=N.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===M&&(e[r]=null),e.detachEvent(r,n))},f.Event=function(e,t){return this instanceof f.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?K:Z):this.type=e,t&&f.extend(this,t),this.timeStamp=e&&e.timeStamp||f.now(),void(this[f.expando]=!0)):new f.Event(e,t)},f.Event.prototype={isDefaultPrevented:Z,isPropagationStopped:Z,isImmediatePropagationStopped:Z,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=K,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=K,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=K,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}}
855,f.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){f.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return(!r||r!==this&&!f.contains(this,r))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),c.submitBubbles||(f.event.special.submit={setup:function(){return!f.nodeName(this,"form")&&void f.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=f.nodeName(t,"input")||f.nodeName(t,"button")?t.form:void 0;n&&!f._data(n,"submitBubbles")&&(f.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),f._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&f.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!f.nodeName(this,"form")&&void f.event.remove(this,"._submit")}}),c.changeBubbles||(f.event.special.change={setup:function(){return V.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(f.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),f.event.simulate("change",this,e,!0)})),!1):void f.event.add(this,"beforeactivate._change",function(e){var t=e.target;V.test(t.nodeName)&&!f._data(t,"changeBubbles")&&(f.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||f.event.simulate("change",this.parentNode,e,!0)}),f._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return f.event.remove(this,"._change"),!V.test(this.nodeName)}}),c.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){f.event.simulate(t,e.target,f.event.fix(e),!0)};f.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=f._data(r,t);i||r.addEventListener(e,n,!0),f._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=f._data(r,t)-1;i?f._data(r,t,i):(r.removeEventListener(e,n,!0),f._removeData(r,t))}}}),f.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){for(o in"string"!=typeof t&&(n=n||t,t=void 0),e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=Z;else if(!r)return this;return 1===i&&(a=r,(r=function(e){return f().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=f.guid++)),this.each(function(){f.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,f(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(!1===t||"function"==typeof t)&&(n=t,t=void 0),!1===n&&(n=Z),this.each(function(){f.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){f.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?f.event.trigger(e,t,n,!0):void 0}});var ne="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",re=/ jQuery\d+="(?:null|\d+)"/g,ie=new RegExp("<(?:"+ne+")[\\s/>]","i"),oe=/^\s+/,ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,se=/<([\w:]+)/,le=/<tbody/i,ue=/<|&#?\w+;/,ce=/<(?:script|style|link)/i,de=/checked\s*(?:[^=]|=\s*.checked.)/i,fe=/^$|\/(?:java|ecma)script/i,pe=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,me={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:c.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},ge=te(N).appendChild(N.createElement("div"));function ve(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==M?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==M?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||f.nodeName(r,t)?o.push(r):f.merge(o,ve(r,t));return void 0===t||t&&f.nodeName(e,t)?f.merge([e],o):o}function ye(e){U.test(e.type)&&(e.defaultChecked=e.checked)}function be(e,t){return f.nodeName(e,"table")&&f.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xe(e){return e.type=(null!==f.find.attr(e,"type"))+"/"+e.type,e}function we(e){var t=pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Te(e,t){for(var n,r=0;null!=(n=e[r]);r++)f._data(n,"globalEval",!t||f._data(t[r],"globalEval"))}function Ce(e,t){if(1===t.nodeType&&f.hasData(e)){var n,r,i,o=f._data(e),a=f._data(t,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(r=0,i=s[n].length;i>r;r++)f.event.add(t,n,s[n][r]);a.data&&(a.data=f.extend({},a.data))}}function Ne(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!c.noCloneEvent&&t[f.expando]){for(r in(i=f._data(t)).events)f.removeEvent(t,r,i.handle);t.removeAttribute(f.expando)}"script"===n&&t.text!==e.text?(xe(t).text=e.text,we(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),c.html5Clone&&e.innerHTML&&!f.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&U.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}me.optgroup=me.option,me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,f.extend({clone:function(e,t,n){var r,i,o,a,s,l=f.contains(e.ownerDocument,e);if(c.html5Clone||f.isXMLDoc(e)||!ie.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ge.innerHTML=e.outerHTML,ge.removeChild(o=ge.firstChild)),!(c.noCloneEvent&&c.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||f.isXMLDoc(e)))for(r=ve(o),s=ve(e),a=0;null!=(i=s[a]);++a)r[a]&&Ne(i,r[a]);if(t)if(n)for(s=s||ve(e),r=r||ve(o),a=0;null!=(i=s[a]);a++)Ce(i,r[a]);else Ce(e,o);return(r=ve(o,"script")).length>0&&Te(r,!l&&ve(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,d,p=e.length,h=te(t),m=[],g=0;p>g;g++)if((o=e[g])||0===o)if("object"===f.type(o))f.merge(m,o.nodeType?[o]:o);else if(ue.test(o)){for(s=s||h.appendChild(t.createElement("div")),l=(se.exec(o)||["",""])[1].toLowerCase(),d=me[l]||me._default,s.innerHTML=d[1]+o.replace(ae,"<$1></$2>")+d[2],i=d[0];i--;)s=s.lastChild;if(!c.leadingWhitespace&&oe.test(o)&&m.push(t.createTextNode(oe.exec(o)[0])),!c.tbody)for(i=(o="table"!==l||le.test(o)?"<table>"!==d[1]||le.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;)f.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(f.merge(m,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else m.push(t.createTextNode(o));for(s&&h.removeChild(s),c.appendChecked||f.grep(ve(m,"input"),ye),g=0;o=m[g++];)if((!r||-1===f.inArray(o,r))&&(a=f.contains(o.ownerDocument,o),s=ve(h.appendChild(o),"script"),a&&Te(s),n))for(i=0;o=s[i++];)fe.test(o.type||"")&&n.push(o);return s=null,h},cleanData:function(e,t){for(var r,i,o,a,s=0,l=f.expando,u=f.cache,d=c.deleteExpando,p=f.event.special;null!=(r=e[s]);s++)if((t||f.acceptData(r))&&(a=(o=r[l])&&u[o])){if(a.events)for(i in a.events)p[i]?f.event.remove(r,i):f.removeEvent(r,i,a.handle);u[o]&&(delete u[o],d?delete r[l]:typeof r.removeAttribute!==M?r.removeAttribute(l):r[l]=null,n.push(o))}}}),f.fn.extend({text:function(e){return X(this,function(e){return void 0===e?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||N).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||be(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=be(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?f.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||f.cleanData(ve(n)),n.parentNode&&(t&&f.contains(n.ownerDocument,n)&&Te(ve(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&f.cleanData(ve(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&f.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return f.clone(this,e,t)})},html:function(e){return X(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(re,""):void 0;if(!("string"!=typeof e||ce.test(e)||!c.htmlSerialize&&ie.test(e)||!c.leadingWhitespace&&oe.test(e)||me[(se.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(ae,"<$1></$2>");try{for(;r>n;n++)1===(t=this[n]||{}).nodeType&&(f.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,f.cleanData(ve(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,o,a,s,l,u=0,d=this.length,p=this,h=d-1,m=e[0],g=f.isFunction(m);if(g||d>1&&"string"==typeof m&&!c.checkClone&&de.test(m))return this.each(function(n){var r=p.eq(n);g&&(e[0]=m.call(this,n,r.html())),r.domManip(e,t)});if(d&&(n=(l=f.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=n),n)){for(o=(a=f.map(ve(l,"script"),xe)).length;d>u;u++)r=l,u!==h&&(r=f.clone(r,!0,!0),o&&f.merge(a,ve(r,"script"))),t.call(this[u],r,u);if(o)for(s=a[a.length-1].ownerDocument,f.map(a,we),u=0;o>u;u++)r=a[u],fe.test(r.type||"")&&!f._data(r,"globalEval")&&f.contains(s,r)&&(r.src?f._evalUrl&&f._evalUrl(r.src):f.globalEval((r.text||r.textContent||r.innerHTML||"").replace(he,"")));l=n=null}return this}}),f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){f.fn[e]=function(e){for(var n,r=0,i=[],a=f(e),s=a.length-1;s>=r;r++)n=r===s?this:this.clone(!0),f(a[r])[t](n),o.apply(i,n.get());return this.pushStack(i)}});var Ee,ke={};function Se(t,n){var r,i=f(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:f.css(i[0],"display");return i.detach(),o}function Ae(e){var t=N,n=ke[e];return n||("none"!==(n=Se(e,t))&&n||((t=((Ee=(Ee||f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow||Ee[0].contentDocument).document).write(),t.close(),n=Se(e,t),Ee.detach()),ke[e]=n),n}!function(){var e;c.shrinkWrapBlocks=function(){return null!=e?e:(e=!1,(n=N.getElementsByTagName("body")[0])&&n.style?(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(N.createElement("div")).style.width="5px",e=3!==t.offsetWidth),n.removeChild(r),e):void 0);var t,n,r}}();var De,je,Le=/^margin/,He=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),qe=/^(top|right|bottom|left)$/;function _e(e,t){return{get:function(){var n=e();if(null!=n)return n?void delete this.get:(this.get=t).apply(this,arguments)}}}e.getComputedStyle?(De=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},je=function(e,t,n){var r,i,o,a,s=e.style;return a=(n=n||De(e))?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||f.contains(e.ownerDocument,e)||(a=f.style(e,t)),He.test(a)&&Le.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):N.documentElement.currentStyle&&(De=function(e){return e.currentStyle},je=function(e,t,n){var r,i,o,a,s=e.style;return null==(a=(n=n||De(e))?n[t]:void 0)&&s&&s[t]&&(a=s[t]),He.test(a)&&!qe.test(t)&&(r=s.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left
855=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),function(){var t,n,r,i,o,a,s;if((t=N.createElement("div")).innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=(r=t.getElementsByTagName("a")[0])&&r.style){function l(){var t,n,r,l;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",i=o=!1,s=!0,e.getComputedStyle&&(i="1%"!==(e.getComputedStyle(t,null)||{}).top,o="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,(l=t.appendChild(N.createElement("div"))).style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",l.style.marginRight=l.style.width="0",t.style.width="1px",s=!parseFloat((e.getComputedStyle(l,null)||{}).marginRight),t.removeChild(l)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(l=t.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(a=0===l[0].offsetHeight)&&(l[0].style.display="",l[1].style.display="none",a=0===l[0].offsetHeight),n.removeChild(r))}n.cssText="float:left;opacity:.5",c.opacity="0.5"===n.opacity,c.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===t.style.backgroundClip,c.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,f.extend(c,{reliableHiddenOffsets:function(){return null==a&&l(),a},boxSizingReliable:function(){return null==o&&l(),o},pixelPosition:function(){return null==i&&l(),i},reliableMarginRight:function(){return null==s&&l(),s}})}}(),f.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};var Me=/alpha\([^)]*\)/i,Fe=/opacity\s*=\s*([^)]*)/,Oe=/^(none|table(?!-c[ea]).+)/,Be=new RegExp("^("+$+")(.*)$","i"),Pe=new RegExp("^([+-])=("+$+")","i"),Re={position:"absolute",visibility:"hidden",display:"block"},We={letterSpacing:"0",fontWeight:"400"},$e=["Webkit","O","Moz","ms"];function ze(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=$e.length;i--;)if((t=$e[i]+n)in e)return t;return r}function Ie(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)(r=e[a]).style&&(o[a]=f._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&I(r)&&(o[a]=f._data(r,"olddisplay",Ae(r.nodeName)))):(i=I(r),(n&&"none"!==n||!i)&&f._data(r,"olddisplay",i?n:f.css(r,"display"))));for(a=0;s>a;a++)(r=e[a]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function Xe(e,t,n){var r=Be.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ue(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=f.css(e,n+z[o],!0,i)),r?("content"===n&&(a-=f.css(e,"padding"+z[o],!0,i)),"margin"!==n&&(a-=f.css(e,"border"+z[o]+"Width",!0,i))):(a+=f.css(e,"padding"+z[o],!0,i),"padding"!==n&&(a+=f.css(e,"border"+z[o]+"Width",!0,i)));return a}function Ve(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=De(e),a=c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,o);if(0>=i||null==i){if((0>(i=je(e,t,o))||null==i)&&(i=e.style[t]),He.test(i))return i;r=a&&(c.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ue(e,t,n||(a?"border":"content"),r,o)+"px"}function Je(e,t,n,r,i){return new Je.prototype.init(e,t,n,r,i)}f.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:c.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=f.camelCase(t),l=e.style;if(t=f.cssProps[s]||(f.cssProps[s]=ze(l,s)),a=f.cssHooks[t]||f.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if("string"===(o=typeof n)&&(i=Pe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(f.css(e,t)),o="number"),null!=n&&n==n&&("number"!==o||f.cssNumber[s]||(n+="px"),c.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=f.camelCase(t);return t=f.cssProps[s]||(f.cssProps[s]=ze(e.style,s)),(a=f.cssHooks[t]||f.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=je(e,t,r)),"normal"===o&&t in We&&(o=We[t]),""===n||n?(i=parseFloat(o),!0===n||f.isNumeric(i)?i||0:o):o}}),f.each(["height","width"],function(e,t){f.cssHooks[t]={get:function(e,n,r){return n?Oe.test(f.css(e,"display"))&&0===e.offsetWidth?f.swap(e,Re,function(){return Ve(e,t,r)}):Ve(e,t,r):void 0},set:function(e,n,r){var i=r&&De(e);return Xe(0,n,r?Ue(e,t,r,c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,i),i):0)}}}),c.opacity||(f.cssHooks.opacity={get:function(e,t){return Fe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=f.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===f.trim(o.replace(Me,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=Me.test(o)?o.replace(Me,i):o+" "+i)}}),f.cssHooks.marginRight=_e(c.reliableMarginRight,function(e,t){return t?f.swap(e,{display:"inline-block"},je,[e,"marginRight"]):void 0}),f.each({margin:"",padding:"",border:"Width"},function(e,t){f.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+z[r]+t]=o[r]||o[r-2]||o[0];return i}},Le.test(e)||(f.cssHooks[e+t].set=Xe)}),f.fn.extend({css:function(e,t){return X(this,function(e,t,n){var r,i,o={},a=0;if(f.isArray(t)){for(r=De(e),i=t.length;i>a;a++)o[t[a]]=f.css(e,t[a],!1,r);return o}return void 0!==n?f.style(e,t,n):f.css(e,t)},e,t,arguments.length>1)},show:function(){return Ie(this,!0)},hide:function(){return Ie(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){I(this)?f(this).show():f(this).hide()})}}),f.Tween=Je,Je.prototype={constructor:Je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(f.cssNumber[n]?"":"px")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.pos=t=this.options.duration?f.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}},Je.prototype.init.prototype=Je.prototype,Je.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=f.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){f.fx.step[e.prop]?f.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[f.cssProps[e.prop]]||f.cssHooks[e.prop])?f.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Je.propHooks.scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},f.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},f.fx=Je.prototype.init,f.fx.step={};var Ye,Ge,Qe=/^(?:toggle|show|hide)$/,Ke=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),Ze=/queueHooks$/,et=[function(e,t,n){var r,i,o,a,s,l,u,d=this,p={},h=e.style,m=e.nodeType&&I(e),g=f._data(e,"fxshow");for(r in n.queue||(null==(s=f._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,f.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=f.css(e,"display"),"inline"===("none"===u?f._data(e,"olddisplay")||Ae(e.nodeName):u)&&"none"===f.css(e,"float")&&(c.inlineBlockNeedsLayout&&"inline"!==Ae(e.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",c.shrinkWrapBlocks()||d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),t)if(i=t[r],Qe.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||f.style(e,r)}else u=void 0;if(f.isEmptyObject(p))"inline"===("none"===u?Ae(e.nodeName):u)&&(h.display=u);else for(r in g?"hidden"in g&&(m=g.hidden):g=f._data(e,"fxshow",{}),o&&(g.hidden=!m),m?f(e).show():d.done(function(){f(e).hide()}),d.done(function(){var t;for(t in f._removeData(e,"fxshow"),p)f.style(e,t,p[t])}),p)a=it(m?g[r]:0,r,d),r in g||(g[r]=a.start,m&&(a.end=a.start,a.start="width"===r||"he
855ight"===r?1:0))}],tt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Ke.exec(t),o=i&&i[3]||(f.cssNumber[e]?"":"px"),a=(f.cssNumber[e]||"px"!==o&&+r)&&Ke.exec(f.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do{a/=s=s||".5",f.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function nt(){return setTimeout(function(){Ye=void 0}),Ye=f.now()}function rt(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)r["margin"+(n=z[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function it(e,t,n){for(var r,i=(tt[t]||[]).concat(tt["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,t,e))return r}function ot(e,t,n){var r,i,o=0,a=et.length,s=f.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Ye||nt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;a>o;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),1>r&&a?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:f.extend({},t),opts:f.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ye||nt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=f.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=f.camelCase(n)],o=e[n],f.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=f.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);a>o;o++)if(r=et[o].call(u,e,c,u.opts))return r;return f.map(c,it,u),f.isFunction(u.opts.start)&&u.opts.start.call(e,u),f.fx.timer(f.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}f.Animation=f.extend(ot,{tweener:function(e,t){f.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],tt[n]=tt[n]||[],tt[n].unshift(t)},prefilter:function(e,t){t?et.unshift(e):et.push(e)}}),f.speed=function(e,t,n){var r=e&&"object"==typeof e?f.extend({},e):{complete:n||!n&&t||f.isFunction(e)&&e,duration:e,easing:n&&t||t&&!f.isFunction(t)&&t};return r.duration=f.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in f.fx.speeds?f.fx.speeds[r.duration]:f.fx.speeds._default,(null==r.queue||!0===r.queue)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){f.isFunction(r.old)&&r.old.call(this),r.queue&&f.dequeue(this,r.queue)},r},f.fn.extend({fadeTo:function(e,t,n,r){return this.filter(I).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=f.isEmptyObject(e),o=f.speed(t,n,r),a=function(){var t=ot(this,f.extend({},e),o);(i||f._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=f.timers,a=f._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&Ze.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&f.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=f._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=f.timers,a=r?r.length:0;for(n.finish=!0,f.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),f.each(["toggle","show","hide"],function(e,t){var n=f.fn[t];f.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,r,i)}}),f.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){f.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),f.timers=[],f.fx.tick=function(){var e,t=f.timers,n=0;for(Ye=f.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||f.fx.stop(),Ye=void 0},f.fx.timer=function(e){f.timers.push(e),e()?f.fx.start():f.timers.pop()},f.fx.interval=13,f.fx.start=function(){Ge||(Ge=setInterval(f.fx.tick,f.fx.interval))},f.fx.stop=function(){clearInterval(Ge),Ge=null},f.fx.speeds={slow:600,fast:200,_default:400},f.fn.delay=function(e,t){return e=f.fx&&f.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;(t=N.createElement("div")).setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a>
855<input type='checkbox'/>",r=t.getElementsByTagName("a")[0],i=(n=N.createElement("select")).appendChild(N.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",c.getSetAttribute="t"!==t.className,c.style=/top/.test(r.getAttribute("style")),c.hrefNormalized="/a"===r.getAttribute("href"),c.checkOn=!!e.value,c.optSelected=i.selected,c.enctype=!!N.createElement("form").enctype,n.disabled=!0,c.optDisabled=!i.disabled,(e=N.createElement("input")).setAttribute("value",""),c.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),c.radioValue="t"===e.value}();var at=/\r/g;f.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=f.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,f(this).val()):e)?i="":"number"==typeof i?i+="":f.isArray(i)&&(i=f.map(i,function(e){return null==e?"":e+""})),(t=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=f.valHooks[i.type]||f.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(at,""):null==n?"":n:void 0}}),f.extend({valHooks:{option:{get:function(e){var t=f.find.attr(e,"value");return null!=t?t:f.trim(f.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(!(!(n=r[l]).selected&&l!==i||(c.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&f.nodeName(n.parentNode,"optgroup"))){if(t=f(n).val(),o)return t;a.push(t)}return a}
855,set:function(e,t){for(var n,r,i=e.options,o=f.makeArray(t),a=i.length;a--;)if(r=i[a],f.inArray(f.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]={set:function(e,t){return f.isArray(t)?e.checked=f.inArray(f(e).val(),t)>=0:void 0}},c.checkOn||(f.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var st,lt,ut=f.expr.attrHandle,ct=/^(?:checked|selected)$/i,dt=c.getSetAttribute,ft=c.input;f.fn.extend({attr:function(e,t){return X(this,f.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){f.removeAttr(this,e)})}}),f.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===M?f.prop(e,t,n):(1===o&&f.isXMLDoc(e)||(t=t.toLowerCase(),r=f.attrHooks[t]||(f.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=f.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void f.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(j);if(o&&1===e.nodeType)for(;n=o[i++];)r=f.propFix[n]||n,f.expr.match.bool.test(n)?ft&&dt||!ct.test(n)?e[r]=!1:e[f.camelCase("default-"+n)]=e[r]=!1:f.attr(e,n,""),e.removeAttribute(dt?n:r)},attrHooks:{type:{set:function(e,t){if(!c.radioValue&&"radio"===t&&f.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return!1===t?f.removeAttr(e,n):ft&&dt||!ct.test(n)?e.setAttribute(!dt&&f.propFix[n]||n,n):e[f.camelCase("default-"+n)]=e[n]=!0,n}},f.each(f.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ut[t]||f.find.attr;ut[t]=ft&&dt||!ct.test(t)?function(e,t,r){var i,o;return r||(o=ut[t],ut[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ut[t]=o),i}:function(e,t,n){return n?void 0:e[f.camelCase("default-"+t)]?t.toLowerCase():null}}),ft&&dt||(f.attrHooks.value={set:function(e,t,n){return f.nodeName(e,"input")?void(e.defaultValue=t):st&&st.set(e,t,n)}}),dt||(st={set:function(e,t,n){var r=e.getAttributeNode(n);return r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n)?t:void 0}},ut.id=ut.name=ut.coords=function(e,t,n){var r;return n?void 0:(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},f.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:void 0},set:st.set},f.attrHooks.contenteditable={set:function(e,t,n){st.set(e,""!==t&&t,n)}},f.each(["width","height"],function(e,t){f.attrHooks[t]={set:function(e,n){return""===n?(e.setAttribute(t,"auto"),n):void 0}}})),c.style||(f.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var pt=/^(?:input|select|textarea|button|object)$/i,ht=/^(?:a|area)$/i;f.fn.extend({prop:function(e,t){return X(this,f.prop,e,t,arguments.length>1)},removeProp:function(e){return e=f.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),f.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!f.isXMLDoc(e))&&(t=f.propFix[t]||t,i=f.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=f.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}}}),c.hrefNormalized||f.each(["href","src"],function(e,t){f.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),c.optSelected||(f.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),f.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){f.propFix[this.toLowerCase()]=this}),c.enctype||(f.propFix.enctype="encoding");var mt=/[\t\r\n\f]/g;f.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;
855if(f.isFunction(e))return this.each(function(t){f(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=f.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(f.isFunction(e))return this.each(function(t){f(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?f.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(f.isFunction(e)?function(n){f(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=f(this),o=e.match(j)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===M||"boolean"===n)&&(this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===e?"":f._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(mt," ").indexOf(t)>=0)return!0;return!1}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){f.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),f.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var gt=f.now(),vt=/\?/,yt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;f.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=f.trim(t+"");return i&&!f.trim(i.replace(yt,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():f.error("Invalid JSON: "+t)},f.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new DOMParser).parseFromString(t,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||f.error("Invalid XML: "+t),n};var bt,xt,wt=/#.*$/,Tt=/([?&])_=[^&]*/,Ct=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nt=/^(?:GET|HEAD)$/,Et=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,St={},At={},Dt="*/".concat("*");try{xt=location.href}catch(e){(xt=N.createElement("a")).href="",xt=xt.href}function jt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(j)||[];if(f.isFunction(n))for(;r=o[i++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Lt(e,t,n,r){var i={},o=e===At;function a(s){var l;return i[s]=!0,f.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ht(e,t){var n,r,i=f.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&f.extend(!0,e,n),e}bt=kt.exec(xt.toLowerCase())||[],f.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}
vendor: 5,286 bytes, line 855
855,flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ht(Ht(e,f.ajaxSettings),t):Ht(f.ajaxSettings,e)},ajaxPrefilter:jt(St),ajaxTransport:jt(At),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,a,s,l,u,c=f.ajaxSetup({},t),d=c.context||c,p=c.context&&(d.nodeType||d.jquery)?f(d):f.event,h=f.Deferred(),m=f.Callbacks("once memory"),g=c.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!u)for(u={};t=Ct.exec(o);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return l&&l.abort(t),T(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||xt)+"").replace(wt,"").replace(Et,bt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=f.trim(c.dataType||"*").toLowerCase().match(j)||[""],null==c.crossDomain&&(n=kt.exec(c.url.toLowerCase()),c.crossDomain=!(!n||n[1]===bt[1]&&n[2]===bt[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(bt[3]||("http:"===bt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=f.param(c.data,c.traditional)),Lt(St,c,t,w),2===b)return w;for(r in(s=f.event&&c.global)&&0==f.active++&&f.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Nt.test(c.type),i=c.url,c.hasContent||(c.data&&(i=c.url+=(vt.test(i)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=Tt.test(i)?i.replace(Tt,"$1_="+gt++):i+(vt.test(i)?"&":"?")+"_="+gt++)),c.ifModified&&(f.lastModified[i]&&w.setRequestHeader("If-Modified-Since",f.lastModified[i]),f.etag[i]&&w.setRequestHeader("If-None-Match",f.etag[i])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+Dt+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(r,c.headers[r]);if(c.beforeSend&&(!1===c.beforeSend.call(d,w,c)||2===b))return w.abort();for(r in x="abort",{success:1,error:1,complete:1})w[r](c[r]);if(l=Lt(At,c,t,w)){w.readyState=1,s&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},c.timeout));try{b=1,l.send(v,T)}catch(e){if(!(2>b))throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,n,r){var u,v,y,x,T,C=t;2!==b&&(b=2,a&&clearTimeout(a),l=void 0,o=r||"",w.readyState=e>0?4:0,u=e>=200&&300>e||304===e,n&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}return o?(o!==l[0]&&l.unshift(o),n[o]):void 0}(c,w,n)),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(c,x,w,u),u?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(f.lastModified[i]=T),(T=w.getResponseHeader("etag"))&&(f.etag[i]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=x.state,v=x.data,u=!(y=x.error))):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),w.status=e,w.statusText=(t||C)+"",u?h.resolveWith(d,[v,C,w]):h.rejectWith(d,[w,C,y]),w.statusCode(g),g=void 0,s&&p.trigger(u?"ajaxSuccess":"ajaxError",[w,c,u?v:y]),m.fireWith(d,[w,C]),s&&(p.trigger("ajaxComplete",[w,c]),--f.active||f.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return f.get(e,t,n,"json")},getScript:function(e,t){return f.get(e,void 0,t,"script")}}),f.each(["get","post"],function(e,t){f[t]=function(e,n,r,i){return f.isFunction(n)&&(i=i||r,r=n,n=void 0),f.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),f._evalUrl=function(e){return f.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},f.fn.extend({wrapAll:function(e){if(f.isFunction(e))return this.each(function(t){f(this).wrapAll(e.call(this,t))});if(this[0]){var t=f(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(f.isFunction(e)?function(t){f(this).wrapInner(e.call(this,t))}:function(){var t=f(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f.isFunction(e);return this.each(function(n){f(this).wrapAll(t?e.call(this,n):e)})}
vendor: 5,879 bytes, line 855
855,unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()}}),f.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!c.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||f.css(e,"display"))},f.expr.filters.visible=function(e){return!f.expr.filters.hidden(e)};var qt=/%20/g,_t=/\[\]$/,Mt=/\r?\n/g,Ft=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Bt(e,t,n,r){var i;if(f.isArray(t))f.each(t,function(t,i){n||_t.test(e)?r(e,i):Bt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==f.type(t))r(e,t);else for(i in t)Bt(e+"["+i+"]",t[i],n,r)}f.param=function(e,t){var n,r=[],i=function(e,t){t=f.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=f.ajaxSettings&&f.ajaxSettings.traditional),f.isArray(e)||e.jquery&&!f.isPlainObject(e))f.each(e,function(){i(this.name,this.value)});else for(n in e)Bt(n,e[n],t,i);return r.join("&").replace(qt,"+")},f.fn.extend({serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=f.prop(this,"elements");return e?f.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!f(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ft.test(e)&&(this.checked||!U.test(e))}).map(function(e,t){var n=f(this).val();return null==n?null:f.isArray(n)?f.map(n,function(e){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}}),f.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$t()||function(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:$t;var Pt=0,Rt={},Wt=f.ajaxSettings.xhr();function $t(){try{return new e.XMLHttpRequest}catch(e){}}e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Rt)Rt[e](void 0,!0)}),c.cors=!!Wt&&"withCredentials"in Wt,(Wt=c.ajax=!!Wt)&&f.ajaxTransport(function(e){var t;if(!e.crossDomain||c.cors)return{send:function(n,r){var i,o=e.xhr(),a=++Pt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Rt[a],t=void 0,o.onreadystatechange=f.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Rt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return f.globalEval(e),e}}}),f.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),f.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=N.head||f("head")[0]||N.documentElement;return{send:function(r,i){(t=N.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var zt=[],It=/(=)\?(?=&|$)|\?\?/;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||f.expando+"_"+gt++;return this[e]=!0,e}}),f.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(It.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&It.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=f.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(It,"$1"+i):!1!==t.jsonp&&(t.url+=(vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||f.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),a&&f.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),f.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||N;var r=x.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f.buildFragment([e],t,i),i&&i.length&&f(i).remove(),f.merge([],r.childNodes))};var Xt=f.fn.load;f.fn.load=function(e,t,n){if("string"!=typeof e&&Xt)return Xt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=f.trim(e.slice(s,e.length)),e=e.slice(0,s)),f.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&f.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?f("<div>").append(f.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},f.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){f.fn[t]=function(e){return this.on(t,e)}}),f.expr.filters.animated=function(e){return f.grep(f.timers,function(t){return e===t.elem}).length};var Ut=e.document.documentElement;function Vt(e){return f.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}f.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=f.css(e,"position"),c=f(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=f.css(e,"to
855p"),l=f.css(e,"left"),("absolute"===u||"fixed"===u)&&f.inArray("auto",[o,l])>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),f.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},f.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){f.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,f.contains(t,i)?(typeof i.getBoundingClientRect!==M&&(r=i.getBoundingClientRect()),n=Vt(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===f.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),f.nodeName(e[0],"html")||(n=e.offset()),n.top+=f.css(e[0],"borderTopWidth",!0),n.left+=f.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-f.css(r,"marginTop",!0),left:t.left-n.left-f.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Ut;e&&!f.nodeName(e,"html")&&"static"===f.css(e,"position");)e=e.offsetParent;return e||Ut})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);f.fn[e]=function(r){return X(this,function(e,r,i){var o=Vt(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?f(o).scrollLeft():i,n?i:f(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),f.each(["top","left"],function(e,t){f.cssHooks[t]=_e(c.pixelPosition,function(e,n){return n?(n=je(e,t),He.test(n)?f(e).position()[t]+"px":n):void 0})}),f.each({Height:"height",Width:"width"},function(e,t){f.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){f.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return X(this,function(t,n,r){var i;return f.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?f.css(t,n,a):f.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),f.fn.size=function(){return this.length},f.fn.andSelf=f.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return f});var Jt=e.jQuery,Yt=e.$;return f.noConflict=function(t){return e.$===f&&(e.$=Yt),t&&e.jQuery===f&&(e.jQuery=Jt),f},typeof t===M&&(e.jQuery=e.$=f),f});
856                IV$ = window.IV$ = jQuery.noConflict(true); 
857            };
858        };
859    })();
860} catch (err) {
861    //!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,a=n.indexOf,s={},l=s.toString,u=s.hasOwnProperty,c={},d="1.11.2",f=function(e,t){return new f.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,h=/^-ms-/,m=/-([\da-z])/gi,g=function(e,t){return t.toUpperCase()};function v(e){var t=e.length,n=f.type(e);return"function"!==n&&!f.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}f.fn=f.prototype={jquery:d,constructor:f,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=f.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return f.each(this,e,t)},map:function(e){return this.pushStack(f.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},f.extend=f.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{}
861,s++),"object"==typeof a||f.isFunction(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(i=arguments[s]))for(r in i)e=a[r],a!==(n=i[r])&&(u&&n&&(f.isPlainObject(n)||(t=f.isArray(n)))?(t?(t=!1,o=e&&f.isArray(e)?e:[]):o=e&&f.isPlainObject(e)?e:{},a[r]=f.extend(u,o,n)):void 0!==n&&(a[r]=n));return a},f.extend({expando:"jQuery"+(d+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===f.type(e)},isArray:Array.isArray||function(e){return"array"===f.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!f.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==f.type(e)||e.nodeType||f.isWindow(e))return!1;try{if(e.constructor&&!u.call(e,"constructor")&&!u.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(c.ownLast)for(t in e)return u.call(e,t);for(t in e);return void 0===t||u.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[l.call(e)]||"object":typeof e},globalEval:function(t){t&&f.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(h,"ms-").replace(m,g)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=v(e);if(n){if(o)for(;i>r&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;i>r&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(v(Object(e))?f.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(a)return a.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;)e[i++]=t[r++];if(n!=n)for(;void 0!==t[r];)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;o>i;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,o=0,a=e.length,s=[];if(v(e))for(;a>o;o++)null!=(r=t(e[o],o,n))&&s.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&s.push(r);return i.apply([],s)},guid:1,proxy:function(e,t){var n,i,o;return"string"==typeof t&&(o=e[t],t=e,e=o),f.isFunction(e)?(n=r.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(r.call(arguments)))}).guid=e.guid=e.guid||f.guid++,i):void 0},now:function(){return+new Date},support:c}),f.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var y=function(e){var t,n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,x="sizzle"+1*new Date,w=e.document,T=0,C=0,N=ae(),E=ae(),k=ae(),S=function(e,t){return e===t&&(d=!0),0},A=1<<31,D={}.hasOwnProperty,j=[],L=j.pop,H=j.push,q=j.push,_=j.slice,M=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",P=B.replace("w","w#"),R="\\["+O+"*("+B+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+O+"*\\]",W=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",$=new RegExp(O+"+","g"),z=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),I=new RegExp("^"+O+"*,"+O+"*"),X=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),U=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),V=new RegExp(W),J=new RegExp("^"+P+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=/'|\\/g,ne=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),re=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ie=function(){f()};try{q.apply(j=_.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){q={apply:j.length?function(e,t){H.apply(e,_.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}
861function oe(e,t,r,i){var o,s,u,c,d,h,v,y,T,C;if((t?t.ownerDocument||t:w)!==p&&f(t),r=r||[],c=(t=t||p).nodeType,"string"!=typeof e||!e||1!==c&&9!==c&&11!==c)return r;if(!i&&m){if(11!==c&&(o=Z.exec(e)))if(u=o[1]){if(9===c){if(!(s=t.getElementById(u))||!s.parentNode)return r;if(s.id===u)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&b(t,s)&&s.id===u)return r.push(s),r}else{if(o[2])return q.apply(r,t.getElementsByTagName(e)),r;if((u=o[3])&&n.getElementsByClassName)return q.apply(r,t.getElementsByClassName(u)),r}if(n.qsa&&(!g||!g.test(e))){if(y=v=x,T=t,C=1!==c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(h=a(e),(v=t.getAttribute("id"))?y=v.replace(te,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",d=h.length;d--;)h[d]=y+ge(h[d]);T=ee.test(e)&&he(t.parentNode)||t,C=h.join(",")}if(C)try{return q.apply(r,T.querySelectorAll(C)),r}catch(e){}finally{v||t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(p=a,h=a.documentElement,(i=a.defaultView)&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",ie,!1):i.attachEvent&&i.attachEvent("onunload",ie)),m=!o(a),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(a.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(a.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!a.getElementsByName||!a.getElementsByName(x).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){return m?t.getElementsByClassName(e):void 0},v=[],g=[],(n.qsa=K.test(a.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")}),le(function(e){var t=a.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.j
vendor: 6,266 bytes, line 861
861oin("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===a||e.ownerDocument===w&&b(w,e)?-1:t===a||t.ownerDocument===w&&b(w,t)?1:c?M(c,e)-M(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!i||!o)return e===a?-1:t===a?1:i?-1:o?1:c?M(c,e)-M(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?ce(s[r],l[r]):s[r]===w?-1:l[r]===w?1:0},a):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(U,"='$1']"),!(!n.matchesSelector||!m||v&&v.test(t)||g&&g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(p=(u=(c=g[x]||(g[x]={}))[e]||[])[0]===T&&u[1],f=u[0]===T&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){c[e]=[T,p,f];break}}else if(y&&(u=(t[x]||(t[x]={}))[e])&&u[0]===T)f=u[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[x]||(d[x]={}))[e]=[T,f]),d!==t)););return(f-=i)===r||f%r==0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[x]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(ne,re),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return J.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)}
vendor: 5,116 bytes, line 861
861,input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[0>n?n+t:n]}),even:pe(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pe(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pe(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pe(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function me(){}function ge(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[T,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((s=(l=t[x]||(t[x]={}))[r])&&s[0]===T&&s[1]===o)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,a))return!0}}}function ye(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function xe(e,t,n,r,i,o){return r&&!r[x]&&(r=xe(r)),i&&!i[x]&&(i=xe(i,o)),se(function(o,a,s,l){var u,c,d,f=[],p=[],h=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;i>r;r++)oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:be(m,f,e,s,l),v=n?i||(o?e:h||r)?[]:a:g;if(n&&n(g,v,s,l),r)for(u=be(v,p),r(u,[],s,l),c=u.length;c--;)(d=u[c])&&(v[p[c]]=!(g[p[c]]=d));if(o){if(i||e){if(i){for(u=[],c=v.length;c--;)(d=v[c])&&u.push(g[c]=d);i(null,v=[],u,l)}for(c=v.length;c--;)(d=v[c])&&(u=i?M(o,d):f[c])>-1&&(o[u]=!(a[u]=d))}}else v=be(v===a?v.splice(h,v.length):v),i?i(null,a,v,l):q.apply(a,v)})}function we(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=ve(function(e){return e===t},s,!0),d=ve(function(e){return M(t,e)>-1},s,!0),f=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,i}];o>l;l++)if(n=r.relative[e[l].type])f=[ve(ye(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;o>i&&!r.relative[e[i].type];i++);return xe(l>1&&ye(f),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,i>l&&we(e.slice(l,i)),o>i&&we(e=e.slice(i)),o>i&&ge(e))}f.push(n)}return ye(f)}function Te(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var d,f,h,m=0,g="0",v=o&&[],y=[],b=u,x=o||i&&r.find.TAG("*",c),w=T+=null==b?1:Math.random()||.1,C=x.length;for(c&&(u=a!==p&&a);g!==C&&null!=(d=x[g]);g++){if(i&&d){for(f=0;h=e[f++];)if(h(d,a,s)){l.push(d);break}c&&(T=w)}n&&((d=!h&&d)&&m--,o&&v.push(d))}if(m+=g,n&&g!==m){for(f=0;h=t[f++];)h(v,y,a,s);if(o){if(m>0)for(;g--;)v[g]||y[g]||(y[g]=L.call(l));y=be(y)}q.apply(l,y),c&&!o&&y.length>0&&m+t.length>1&&oe.uniqueSort(l)}return c&&(T=w,u=b),v};return n?se(o):o}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=oe.tokenize=function(e,t){var n,i,o,a,s,l,u,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in(!n||(i=I.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=X.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=Y[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):E(e,l).slice(0)},s=oe.compile=function(e,t){var n,r=[],i=[],o=k[e+" "];if(!o){for(t||(t=a(e)),n=t.length;n--;)(o=we(t[n]))[x]?r.push(o):i.push(o);(o=k(e,Te(i,r))).selector=e}return o},l=oe.select=function(e,t,i,o){var l,u,c,d,f,p="function"==typeof e&&e,h=!o&&a(e=p.selector||e);if(i=i||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&n.getById&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(ne,re),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(l=Y.needsContext.test(e)?0:u.length;l--&&(c=u[l],!r.relative[d=c.type]);)if((f=r.find[d])&&(o=f(c.matches[0].replace(ne,re),ee.test(u[0].type)&&he(t.parentNode)||t))){if(u.splice(l,1),!(e=o.length&&ge(u)))return q.apply(i,o),i;break}}return(p||s(e,h))(o,t,!m,i,ee.test(e)&&he(t.parentNode)||t),i},n.sortStable=x.split("").sort(S).join("")===x,n.detectDuplicates=!!d,f(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}
861)||ue("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(F,function(e,t,n){var r;return n?void 0:!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);f.find=y,f.expr=y.selectors,f.expr[":"]=f.expr.pseudos,f.unique=y.uniqueSort,f.text=y.getText,f.isXMLDoc=y.isXML,f.contains=y.contains;var b=f.expr.match.needsContext,x=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function T(e,t,n){if(f.isFunction(t))return f.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return f.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(w.test(t))return f.filter(t,e,n);t=f.filter(t,e)}return f.grep(e,function(e){return f.inArray(e,t)>=0!==n})}f.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?f.find.matchesSelector(r,e)?[r]:[]:f.find.matches(e,f.grep(t,function(e){return 1===e.nodeType}))},f.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(f(e).filter(function(){for(t=0;i>t;t++)if(f.contains(r[t],this))return!0}));for(t=0;i>t;t++)f.find(e,r[t],n);return(n=this.pushStack(i>1?f.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?f(e):e||[],!1).length}});var C,N=e.document,E=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(f.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:E.exec(e))||!n[1]&&t)return!t||t.jquery?(t||C).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof f?t[0]:t,f.merge(this,f.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:N,!0)),x.test(n[1])&&f.isPlainObject(t))for(n in t)f.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((r=N.getElementById(n[2]))&&r.parentNode){if(r.id!==n[2])return C.find(e);this.length=1,this[0]=r}return this.context=N,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):f.isFunction(e)?void 0!==C.ready?C.ready(e):e(f):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),f.makeArray(e,this))}).prototype=f.fn,C=f(N);var k=/^(?:parents|prev(?:Until|All))/,S={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}f.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!f(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),f.fn.extend({has:function(e){var t,n=f(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(f.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=b.test(e)||"string"!=typeof e?f(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&f.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?f.unique(o):o)},index:function(e){return e?"string"==typeof e?f.inArray(this[0],f(e)):f.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(f.unique(f.merge(this.get(),f(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),f.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return f.dir(e,"parentNode")},parentsUntil:function(e,t,n){return f.dir(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return f.dir(e,"nextSibling")},prevAll:function(e){return f.dir(e,"previousSibling")},nextUntil:function(e,t,n){return f.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return f.dir(e,"previousSibling",n)},siblings:function(e){return f.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return f.sibling(e.firstChild)},contents:function(e){return f.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:f.merge([],e.childNodes)}},function(e,t){f.fn[e]=function(n,r){var i=f.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=f.filter(r,i)),this.length>1&&(S[e]||(i=f.unique(i)),k.test(e)&&(i=i.reverse())),this.pushStack(i)}});var D,j=/\S+/g,L={};function H(){N.addEventListener?(N.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(N.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))}function q(){(N.addEventListener||"load"===event.type||"complete"===N.readyState)&&(H(),f.ready())}f.Callbacks=function(e){e="string"==typeof e?L[e]||function(e){var t=L[e]={};return f.each(e.match(j)||[],function(e,n){t[n]=!0}),t}(e):f.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(d){for(n=e.memory&&d,r=!0,o=a||0,a=0,i=s.length,t=!0;s&&i>o;o++)if(!1===s[o].apply(d[0],d[1])&&e.stopOnFalse){n=!1;break}t=!1,s&&(l?l.length&&u(l.shift()):n?s=[]:c.disable())},c={add:function(){if(s){var r=s.length;!function t(n){f.each(n,function(n,r){var i=f.type(r);"function"===i?e.unique&&c.has(r)||s.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=s.length:n&&(a=r,u(n))}return this},remove:function(){return s&&f.each(arguments,function(e,n){for(var r;(r=f.inArray(n,s,r))>-1;)s.splice(r,1),t&&(i>=r&&i--,o>=r&&o--)}),this},has:function(e){return e?f.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],i=0,this},disable:function(){return s=l=n=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,n||c.disable(),this},locked:function(){return!l},fireWith:function(e,n){return!s||r&&!l||(n=[e,(n=n||[]).slice?n.slice():n],t?l.push(n):u(n)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},f.extend({Deferred:function(e){var t=[["resolve","done",f.Callbacks("once memory"),"resolved"],["reject","fail",f.Callbacks("once memory"),"rejected"],["notify","progress",f.Callbacks("memory")]],n="pe
861nding",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f.Deferred(function(n){f.each(t,function(t,o){var a=f.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&f.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?f.extend(e,r):r}},i={};return r.pipe=r.then,f.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,a=r.call(arguments),s=a.length,l=1!==s||e&&f.isFunction(e.promise)?s:0,u=1===l?e:f.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?u.notifyWith(n,i):--l||u.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);s>o;o++)a[o]&&f.isFunction(a[o].promise)?a[o].promise().done(c(o,i,a)).fail(u.reject).progress(c(o,n,t)):--l;return l||u.resolveWith(i,a),u.promise()}}),f.fn.ready=function(e){return f.ready.promise().done(e),this},f.extend({isReady:!1,readyWait:1,holdReady:function(e){e?f.readyWait++:f.ready(!0)},ready:function(e){if(!0===e?!--f.readyWait:!f.isReady){if(!N.body)return setTimeout(f.ready);f.isReady=!0,!0!==e&&--f.readyWait>0||(D.resolveWith(N,[f]),f.fn.triggerHandler&&(f(N).triggerHandler("ready"),f(N).off("ready")))}}}),f.ready.promise=function(t){if(!D)if(D=f.Deferred(),"complete"===N.readyState)setTimeout(f.ready);else if(N.addEventListener)N.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{N.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var n=!1;try{n=null==e.frameElement&&N.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!f.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}H(),f.ready()}}()}return D.promise(t)};var _,M="undefined";for(_ in f(c))break;c.ownLast="0"!==_,c.inlineBlockNeedsLayout=!1,f(function(){var e,t,n,r;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",c.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=N.createElement("div");if(null==c.deleteExpando){c.deleteExpando=!0;try{delete e.test}catch(e){c.deleteExpando=!1}}e=null}(),f.acceptData=function(e){var t=f.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function B(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(O,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:F.test(n)?f.parseJSON(n):n)}catch(e){}f.data(e,t,n)}else n=void 0}return n}function P(e){var t;for(t in e)if(("data"!==t||!f.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function R(e,t,r,i){if(f.acceptData(e)){var o,a,s=f.expando,l=e.nodeType,u=l?f.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||void 0!==r||"string"!=typeof t)return c||(c=l?e[s]=n.pop()||f.guid++:s),u[c]||(u[c]=l?{}:{toJSON:f.noop}),("object"==typeof t||"function"==typeof t)&&(i?u[c]=f.extend(u[c],t):u[c].data=f.extend(u[c].data,t)),a=u[c],i||(a.data||(a.data={}),a=a.data),void 0!==r&&(a[f.camelCase(t)]=r),"string"==typeof t?null==(o=a[t])&&(o=a[f.camelCase(t)]):o=a,o}}function W(e,t,n){if(f.acceptData(e)){var r,i,o=e.nodeType,a=o?f.cache:e,s=o?e[f.expando]:f.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){f.isArray(t)?t=t.concat(f.map(t,f.camelCase)):t in r?t=[t]:t=(t=f.camelCase(t))in r?[t]:t.split(" "),i=t.length;for(;i--;)delete r[t[i]];if(n?!P(r):!f.isEmptyObject(r))return}
861(n||(delete a[s].data,P(a[s])))&&(o?f.cleanData([e],!0):c.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}f.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?f.cache[e[f.expando]]:e[f.expando])&&!P(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)}}),f.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=f.data(o),1===o.nodeType&&!f._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(0===(r=a[n].name).indexOf("data-")&&B(o,r=f.camelCase(r.slice(5)),i[r]));f._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){f.data(this,e)}):arguments.length>1?this.each(function(){f.data(this,e,t)}):o?B(o,e,f.data(o,e)):void 0},removeData:function(e){return this.each(function(){f.removeData(this,e)})}}),f.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=f._data(e,t),n&&(!r||f.isArray(n)?r=f._data(e,t,f.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=f.queue(e,t),r=n.length,i=n.shift(),o=f._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){f.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return f._data(e,n)||f._data(e,n,{empty:f.Callbacks("once memory").add(function(){f._removeData(e,t+"queue"),f._removeData(e,n)})})}}),f.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?f.queue(this[0],e):void 0===t?this:this.each(function(){var n=f.queue(this,e,t);f._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&f.dequeue(this,e)})},dequeue:function(e){return this.each(function(){f.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=f.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=f._data(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,z=["Top","Right","Bottom","Left"],I=function(e,t){return e=t||e,"none"===f.css(e,"display")||!f.contains(e.ownerDocument,e)},X=f.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===f.type(n))for(s in i=!0,n)f.access(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,f.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(f(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},U=/^(?:checkbox|radio)$/i;!function(){var e=N.createElement("input"),t=N.createElement("div"),n=N.createDocumentFragment();if(t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c.leadingWhitespace=3===t.firstChild.nodeType,c.tbody=!t.getElementsByTagName("tbody").length,c.htmlSerialize=!!t.getElementsByTagName("link").length,c.html5Clone="<:nav></:nav>"!==N.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),c.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",c.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",c.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,c.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){c.noCloneEvent=!1}),t.cloneNode(!0).click()),null==c.deleteExpando){c.deleteExpando=!0;try{delete t.test}catch(e){c.deleteExpando=!1}}}(),function(){var t,n,r=N.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(c[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),c[t+"Bubbles"]=!1===r.attributes[n].expando);r=null}();var V=/^(?:input|select|textarea)$/i,J=/^key/,Y=/^(?:mouse|pointer|contextmenu)|click/,G=/^(?:focusinfocus|focusoutblur)$/,Q=/^([^.]*)(?:\.(.+)|)$/;function K(){return!0}function Z(){return!1}function ee(){try{return N.activeElement}catch(e){}}function te(e){var t=ne.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}f.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f._data(e);if(v){for(n.handler&&(n=(l=n).handler,i=l.selector),n.guid||(n.guid=f.guid++),(a=v.events)||(a=v.events={}),(c=v.handle)||((c=v.handle=function(e){return typeof f===M||e&&f.event.triggered===e.type?void 0:f.event.dispatch.apply(c.elem,arguments)}).elem=e),s=(t=(t||"").match(j)||[""]).length;s--;)h=g=(o=Q.exec(t[s])||[])[1],m=(o[2]||"").split(".").sort(),h&&(u=f.event.special[h]||{},h=(i?u.delegateType:u.bindType)||h,u=f.event.special[h]||{},d=f.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&f.expr.match.needsContext.test(i),namespace:m.join(".")},l),(p=a[h])||((p=a[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,r,m,c)||(e.addEventListener?e.addEventListener(h,c,!1):e.attachEvent&&e.attachEvent("on"+h,c))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,d):p.push(d),f.event.global[h]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,v=f.hasData(e)&&f._data(e);if(v&&(c=v.events)){for(u=(t=(t||"").match(j)||[""]).length;u--;)if(h=g=(s=Q.exec(t[u])||[])[1],m=(s[2]||"").split(".").sort(),h){for(d=f.event.special[h]||{},p=c[h=(r?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=p.length;o--;)a=p[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(p.splice(o,1),a.selector&&p.delegateCount--,d.remove&&d.remove.call(e,a));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||f.removeEvent(e,h,v.handle),delete c[h])}else for(h in c)f.event.remove(e,h+t[u],n,r,!0);f.isEmptyObject(c)&&(delete v.handle,f._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,c,d,p,h=[r||N],m=u.call(t,"type")?t.type:t,g=u.call(t,"namespace")?t.namespace.split("."):[];if(s=d=r=r||N,3!==r.nodeType&&8!==r.nodeType&&!G.test(m+f.event.triggered)&&(m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort()),a=m.indexOf(":")<0&&"on"+m,(t=t[f.expando]?t:new f.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.n
861amespace_re=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:f.makeArray(n,[t]),c=f.event.special[m]||{},i||!c.trigger||!1!==c.trigger.apply(r,n))){if(!i&&!c.noBubble&&!f.isWindow(r)){for(l=c.delegateType||m,G.test(l+m)||(s=s.parentNode);s;s=s.parentNode)h.push(s),d=s;d===(r.ownerDocument||N)&&h.push(d.defaultView||d.parentWindow||e)}for(p=0;(s=h[p++])&&!t.isPropagationStopped();)t.type=p>1?l:c.bindType||m,(o=(f._data(s,"events")||{})[t.type]&&f._data(s,"handle"))&&o.apply(s,n),(o=a&&s[a])&&o.apply&&f.acceptData(s)&&(t.result=o.apply(s,n),!1===t.result&&t.preventDefault());if(t.type=m,!i&&!t.isDefaultPrevented()&&(!c._default||!1===c._default.apply(h.pop(),n))&&f.acceptData(r)&&a&&r[m]&&!f.isWindow(r)){(d=r[a])&&(r[a]=null),f.event.triggered=m;try{r[m]()}catch(e){}f.event.triggered=void 0,d&&(r[a]=d)}return t.result}},dispatch:function(e){e=f.event.fix(e);var t,n,i,o,a,s=[],l=r.call(arguments),u=(f._data(this,"events")||{})[e.type]||[],c=f.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(s=f.event.handlers.call(this,e,u),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,void 0!==(n=((f.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],o=0;s>o;o++)void 0===i[n=(r=t[o]).selector+" "]&&(i[n]=r.needsContext?f(n,this).index(l)>=0:f.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[f.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Y.test(i)?this.mouseHooks:J.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new f.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=o.srcElement||N),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=(r=e.target.ownerDocument||N).documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ee()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===ee()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return f.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return f.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=f.extend(new f.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?f.event.trigger(i,null,t):f.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},f.removeEvent=N.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===M&&(e[r]=null),e.detachEvent(r,n))},f.Event=function(e,t){return this instanceof f.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?K:Z):this.type=e,t&&f.extend(this,t),this.timeStamp=e&&e.timeStamp||f.now(),void(this[f.expando]=!0)):new f.Event(e,t)},f.Event.prototype={isDefaultPrevented:Z,isPropagationStopped:Z,isImmediatePropagationStopped:Z,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=K,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=K,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=K,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}}
861,f.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){f.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return(!r||r!==this&&!f.contains(this,r))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),c.submitBubbles||(f.event.special.submit={setup:function(){return!f.nodeName(this,"form")&&void f.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=f.nodeName(t,"input")||f.nodeName(t,"button")?t.form:void 0;n&&!f._data(n,"submitBubbles")&&(f.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),f._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&f.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!f.nodeName(this,"form")&&void f.event.remove(this,"._submit")}}),c.changeBubbles||(f.event.special.change={setup:function(){return V.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(f.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),f.event.simulate("change",this,e,!0)})),!1):void f.event.add(this,"beforeactivate._change",function(e){var t=e.target;V.test(t.nodeName)&&!f._data(t,"changeBubbles")&&(f.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||f.event.simulate("change",this.parentNode,e,!0)}),f._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return f.event.remove(this,"._change"),!V.test(this.nodeName)}}),c.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){f.event.simulate(t,e.target,f.event.fix(e),!0)};f.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=f._data(r,t);i||r.addEventListener(e,n,!0),f._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=f._data(r,t)-1;i?f._data(r,t,i):(r.removeEventListener(e,n,!0),f._removeData(r,t))}}}),f.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){for(o in"string"!=typeof t&&(n=n||t,t=void 0),e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=Z;else if(!r)return this;return 1===i&&(a=r,(r=function(e){return f().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=f.guid++)),this.each(function(){f.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,f(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(!1===t||"function"==typeof t)&&(n=t,t=void 0),!1===n&&(n=Z),this.each(function(){f.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){f.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?f.event.trigger(e,t,n,!0):void 0}});var ne="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",re=/ jQuery\d+="(?:null|\d+)"/g,ie=new RegExp("<(?:"+ne+")[\\s/>]","i"),oe=/^\s+/,ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,se=/<([\w:]+)/,le=/<tbody/i,ue=/<|&#?\w+;/,ce=/<(?:script|style|link)/i,de=/checked\s*(?:[^=]|=\s*.checked.)/i,fe=/^$|\/(?:java|ecma)script/i,pe=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,me={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:c.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},ge=te(N).appendChild(N.createElement("div"));function ve(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==M?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==M?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||f.nodeName(r,t)?o.push(r):f.merge(o,ve(r,t));return void 0===t||t&&f.nodeName(e,t)?f.merge([e],o):o}function ye(e){U.test(e.type)&&(e.defaultChecked=e.checked)}function be(e,t){return f.nodeName(e,"table")&&f.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xe(e){return e.type=(null!==f.find.attr(e,"type"))+"/"+e.type,e}function we(e){var t=pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Te(e,t){for(var n,r=0;null!=(n=e[r]);r++)f._data(n,"globalEval",!t||f._data(t[r],"globalEval"))}function Ce(e,t){if(1===t.nodeType&&f.hasData(e)){var n,r,i,o=f._data(e),a=f._data(t,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(r=0,i=s[n].length;i>r;r++)f.event.add(t,n,s[n][r]);a.data&&(a.data=f.extend({},a.data))}}function Ne(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!c.noCloneEvent&&t[f.expando]){for(r in(i=f._data(t)).events)f.removeEvent(t,r,i.handle);t.removeAttribute(f.expando)}"script"===n&&t.text!==e.text?(xe(t).text=e.text,we(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),c.html5Clone&&e.innerHTML&&!f.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&U.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}me.optgroup=me.option,me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,f.extend({clone:function(e,t,n){var r,i,o,a,s,l=f.contains(e.ownerDocument,e);if(c.html5Clone||f.isXMLDoc(e)||!ie.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ge.innerHTML=e.outerHTML,ge.removeChild(o=ge.firstChild)),!(c.noCloneEvent&&c.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||f.isXMLDoc(e)))for(r=ve(o),s=ve(e),a=0;null!=(i=s[a]);++a)r[a]&&Ne(i,r[a]);if(t)if(n)for(s=s||ve(e),r=r||ve(o),a=0;null!=(i=s[a]);a++)Ce(i,r[a]);else Ce(e,o);return(r=ve(o,"script")).length>0&&Te(r,!l&&ve(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,d,p=e.length,h=te(t),m=[],g=0;p>g;g++)if((o=e[g])||0===o)if("object"===f.type(o))f.merge(m,o.nodeType?[o]:o);else if(ue.test(o)){for(s=s||h.appendChild(t.createElement("div")),l=(se.exec(o)||["",""])[1].toLowerCase(),d=me[l]||me._default,s.innerHTML=d[1]+o.replace(ae,"<$1></$2>")+d[2],i=d[0];i--;)s=s.lastChild;if(!c.leadingWhitespace&&oe.test(o)&&m.push(t.createTextNode(oe.exec(o)[0])),!c.tbody)for(i=(o="table"!==l||le.test(o)?"<table>"!==d[1]||le.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;)f.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(f.merge(m,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else m.push(t.createTextNode(o));for(s&&h.removeChild(s),c.appendChecked||f.grep(ve(m,"input"),ye),g=0;o=m[g++];)if((!r||-1===f.inArray(o,r))&&(a=f.contains(o.ownerDocument,o),s=ve(h.appendChild(o),"script"),a&&Te(s),n))for(i=0;o=s[i++];)fe.test(o.type||"")&&n.push(o);return s=null,h},cleanData:function(e,t){for(var r,i,o,a,s=0,l=f.expando,u=f.cache,d=c.deleteExpando,p=f.event.special;null!=(r=e[s]);s++)if((t||f.acceptData(r))&&(a=(o=r[l])&&u[o])){if(a.events)for(i in a.events)p[i]?f.event.remove(r,i):f.removeEvent(r,i,a.handle);u[o]&&(delete u[o],d?delete r[l]:typeof r.removeAttribute!==M?r.removeAttribute(l):r[l]=null,n.push(o))}}}),f.fn.extend({text:function(e){return X(this,function(e){return void 0===e?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||N).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||be(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=be(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?f.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||f.cleanData(ve(n)),n.parentNode&&(t&&f.contains(n.ownerDocument,n)&&Te(ve(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&f.cleanData(ve(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&f.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return f.clone(this,e,t)})},html:function(e){return X(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(re,""):void 0;if(!("string"!=typeof e||ce.test(e)||!c.htmlSerialize&&ie.test(e)||!c.leadingWhitespace&&oe.test(e)||me[(se.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(ae,"<$1></$2>");try{for(;r>n;n++)1===(t=this[n]||{}).nodeType&&(f.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,f.cleanData(ve(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,o,a,s,l,u=0,d=this.length,p=this,h=d-1,m=e[0],g=f.isFunction(m);if(g||d>1&&"string"==typeof m&&!c.checkClone&&de.test(m))return this.each(function(n){var r=p.eq(n);g&&(e[0]=m.call(this,n,r.html())),r.domManip(e,t)});if(d&&(n=(l=f.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=n),n)){for(o=(a=f.map(ve(l,"script"),xe)).length;d>u;u++)r=l,u!==h&&(r=f.clone(r,!0,!0),o&&f.merge(a,ve(r,"script"))),t.call(this[u],r,u);if(o)for(s=a[a.length-1].ownerDocument,f.map(a,we),u=0;o>u;u++)r=a[u],fe.test(r.type||"")&&!f._data(r,"globalEval")&&f.contains(s,r)&&(r.src?f._evalUrl&&f._evalUrl(r.src):f.globalEval((r.text||r.textContent||r.innerHTML||"").replace(he,"")));l=n=null}return this}}),f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){f.fn[e]=function(e){for(var n,r=0,i=[],a=f(e),s=a.length-1;s>=r;r++)n=r===s?this:this.clone(!0),f(a[r])[t](n),o.apply(i,n.get());return this.pushStack(i)}});var Ee,ke={};function Se(t,n){var r,i=f(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:f.css(i[0],"display");return i.detach(),o}function Ae(e){var t=N,n=ke[e];return n||("none"!==(n=Se(e,t))&&n||((t=((Ee=(Ee||f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow||Ee[0].contentDocument).document).write(),t.close(),n=Se(e,t),Ee.detach()),ke[e]=n),n}!function(){var e;c.shrinkWrapBlocks=function(){return null!=e?e:(e=!1,(n=N.getElementsByTagName("body")[0])&&n.style?(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==M&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(N.createElement("div")).style.width="5px",e=3!==t.offsetWidth),n.removeChild(r),e):void 0);var t,n,r}}();var De,je,Le=/^margin/,He=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),qe=/^(top|right|bottom|left)$/;function _e(e,t){return{get:function(){var n=e();if(null!=n)return n?void delete this.get:(this.get=t).apply(this,arguments)}}}e.getComputedStyle?(De=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},je=function(e,t,n){var r,i,o,a,s=e.style;return a=(n=n||De(e))?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||f.contains(e.ownerDocument,e)||(a=f.style(e,t)),He.test(a)&&Le.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):N.documentElement.currentStyle&&(De=function(e){return e.currentStyle},je=function(e,t,n){var r,i,o,a,s=e.style;return null==(a=(n=n||De(e))?n[t]:void 0)&&s&&s[t]&&(a=s[t]),He.test(a)&&!qe.test(t)&&(r=s.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left
861=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),function(){var t,n,r,i,o,a,s;if((t=N.createElement("div")).innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=(r=t.getElementsByTagName("a")[0])&&r.style){function l(){var t,n,r,l;(n=N.getElementsByTagName("body")[0])&&n.style&&(t=N.createElement("div"),(r=N.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",i=o=!1,s=!0,e.getComputedStyle&&(i="1%"!==(e.getComputedStyle(t,null)||{}).top,o="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,(l=t.appendChild(N.createElement("div"))).style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",l.style.marginRight=l.style.width="0",t.style.width="1px",s=!parseFloat((e.getComputedStyle(l,null)||{}).marginRight),t.removeChild(l)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(l=t.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(a=0===l[0].offsetHeight)&&(l[0].style.display="",l[1].style.display="none",a=0===l[0].offsetHeight),n.removeChild(r))}n.cssText="float:left;opacity:.5",c.opacity="0.5"===n.opacity,c.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===t.style.backgroundClip,c.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,f.extend(c,{reliableHiddenOffsets:function(){return null==a&&l(),a},boxSizingReliable:function(){return null==o&&l(),o},pixelPosition:function(){return null==i&&l(),i},reliableMarginRight:function(){return null==s&&l(),s}})}}(),f.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};var Me=/alpha\([^)]*\)/i,Fe=/opacity\s*=\s*([^)]*)/,Oe=/^(none|table(?!-c[ea]).+)/,Be=new RegExp("^("+$+")(.*)$","i"),Pe=new RegExp("^([+-])=("+$+")","i"),Re={position:"absolute",visibility:"hidden",display:"block"},We={letterSpacing:"0",fontWeight:"400"},$e=["Webkit","O","Moz","ms"];function ze(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=$e.length;i--;)if((t=$e[i]+n)in e)return t;return r}function Ie(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)(r=e[a]).style&&(o[a]=f._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&I(r)&&(o[a]=f._data(r,"olddisplay",Ae(r.nodeName)))):(i=I(r),(n&&"none"!==n||!i)&&f._data(r,"olddisplay",i?n:f.css(r,"display"))));for(a=0;s>a;a++)(r=e[a]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function Xe(e,t,n){var r=Be.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ue(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=f.css(e,n+z[o],!0,i)),r?("content"===n&&(a-=f.css(e,"padding"+z[o],!0,i)),"margin"!==n&&(a-=f.css(e,"border"+z[o]+"Width",!0,i))):(a+=f.css(e,"padding"+z[o],!0,i),"padding"!==n&&(a+=f.css(e,"border"+z[o]+"Width",!0,i)));return a}function Ve(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=De(e),a=c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,o);if(0>=i||null==i){if((0>(i=je(e,t,o))||null==i)&&(i=e.style[t]),He.test(i))return i;r=a&&(c.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ue(e,t,n||(a?"border":"content"),r,o)+"px"}function Je(e,t,n,r,i){return new Je.prototype.init(e,t,n,r,i)}f.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:c.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=f.camelCase(t),l=e.style;if(t=f.cssProps[s]||(f.cssProps[s]=ze(l,s)),a=f.cssHooks[t]||f.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if("string"===(o=typeof n)&&(i=Pe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(f.css(e,t)),o="number"),null!=n&&n==n&&("number"!==o||f.cssNumber[s]||(n+="px"),c.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=f.camelCase(t);return t=f.cssProps[s]||(f.cssProps[s]=ze(e.style,s)),(a=f.cssHooks[t]||f.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=je(e,t,r)),"normal"===o&&t in We&&(o=We[t]),""===n||n?(i=parseFloat(o),!0===n||f.isNumeric(i)?i||0:o):o}}),f.each(["height","width"],function(e,t){f.cssHooks[t]={get:function(e,n,r){return n?Oe.test(f.css(e,"display"))&&0===e.offsetWidth?f.swap(e,Re,function(){return Ve(e,t,r)}):Ve(e,t,r):void 0},set:function(e,n,r){var i=r&&De(e);return Xe(0,n,r?Ue(e,t,r,c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,i),i):0)}}}),c.opacity||(f.cssHooks.opacity={get:function(e,t){return Fe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=f.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===f.trim(o.replace(Me,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=Me.test(o)?o.replace(Me,i):o+" "+i)}}),f.cssHooks.marginRight=_e(c.reliableMarginRight,function(e,t){return t?f.swap(e,{display:"inline-block"},je,[e,"marginRight"]):void 0}),f.each({margin:"",padding:"",border:"Width"},function(e,t){f.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+z[r]+t]=o[r]||o[r-2]||o[0];return i}},Le.test(e)||(f.cssHooks[e+t].set=Xe)}),f.fn.extend({css:function(e,t){return X(this,function(e,t,n){var r,i,o={},a=0;if(f.isArray(t)){for(r=De(e),i=t.length;i>a;a++)o[t[a]]=f.css(e,t[a],!1,r);return o}return void 0!==n?f.style(e,t,n):f.css(e,t)},e,t,arguments.length>1)},show:function(){return Ie(this,!0)},hide:function(){return Ie(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){I(this)?f(this).show():f(this).hide()})}}),f.Tween=Je,Je.prototype={constructor:Je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(f.cssNumber[n]?"":"px")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.pos=t=this.options.duration?f.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}},Je.prototype.init.prototype=Je.prototype,Je.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=f.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){f.fx.step[e.prop]?f.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[f.cssProps[e.prop]]||f.cssHooks[e.prop])?f.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Je.propHooks.scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},f.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},f.fx=Je.prototype.init,f.fx.step={};var Ye,Ge,Qe=/^(?:toggle|show|hide)$/,Ke=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),Ze=/queueHooks$/,et=[function(e,t,n){var r,i,o,a,s,l,u,d=this,p={},h=e.style,m=e.nodeType&&I(e),g=f._data(e,"fxshow");for(r in n.queue||(null==(s=f._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,f.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=f.css(e,"display"),"inline"===("none"===u?f._data(e,"olddisplay")||Ae(e.nodeName):u)&&"none"===f.css(e,"float")&&(c.inlineBlockNeedsLayout&&"inline"!==Ae(e.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",c.shrinkWrapBlocks()||d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),t)if(i=t[r],Qe.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||f.style(e,r)}else u=void 0;if(f.isEmptyObject(p))"inline"===("none"===u?Ae(e.nodeName):u)&&(h.display=u);else for(r in g?"hidden"in g&&(m=g.hidden):g=f._data(e,"fxshow",{}),o&&(g.hidden=!m),m?f(e).show():d.done(function(){f(e).hide()}),d.done(function(){var t;for(t in f._removeData(e,"fxshow"),p)f.style(e,t,p[t])}),p)a=it(m?g[r]:0,r,d),r in g||(g[r]=a.start,m&&(a.end=a.start,a.start="width"===r||"he
861ight"===r?1:0))}],tt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Ke.exec(t),o=i&&i[3]||(f.cssNumber[e]?"":"px"),a=(f.cssNumber[e]||"px"!==o&&+r)&&Ke.exec(f.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do{a/=s=s||".5",f.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function nt(){return setTimeout(function(){Ye=void 0}),Ye=f.now()}function rt(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)r["margin"+(n=z[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function it(e,t,n){for(var r,i=(tt[t]||[]).concat(tt["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,t,e))return r}function ot(e,t,n){var r,i,o=0,a=et.length,s=f.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Ye||nt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;a>o;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),1>r&&a?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:f.extend({},t),opts:f.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ye||nt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=f.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=f.camelCase(n)],o=e[n],f.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=f.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);a>o;o++)if(r=et[o].call(u,e,c,u.opts))return r;return f.map(c,it,u),f.isFunction(u.opts.start)&&u.opts.start.call(e,u),f.fx.timer(f.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}f.Animation=f.extend(ot,{tweener:function(e,t){f.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],tt[n]=tt[n]||[],tt[n].unshift(t)},prefilter:function(e,t){t?et.unshift(e):et.push(e)}}),f.speed=function(e,t,n){var r=e&&"object"==typeof e?f.extend({},e):{complete:n||!n&&t||f.isFunction(e)&&e,duration:e,easing:n&&t||t&&!f.isFunction(t)&&t};return r.duration=f.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in f.fx.speeds?f.fx.speeds[r.duration]:f.fx.speeds._default,(null==r.queue||!0===r.queue)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){f.isFunction(r.old)&&r.old.call(this),r.queue&&f.dequeue(this,r.queue)},r},f.fn.extend({fadeTo:function(e,t,n,r){return this.filter(I).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=f.isEmptyObject(e),o=f.speed(t,n,r),a=function(){var t=ot(this,f.extend({},e),o);(i||f._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=f.timers,a=f._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&Ze.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&f.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=f._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=f.timers,a=r?r.length:0;for(n.finish=!0,f.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),f.each(["toggle","show","hide"],function(e,t){var n=f.fn[t];f.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,r,i)}}),f.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){f.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),f.timers=[],f.fx.tick=function(){var e,t=f.timers,n=0;for(Ye=f.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||f.fx.stop(),Ye=void 0},f.fx.timer=function(e){f.timers.push(e),e()?f.fx.start():f.timers.pop()},f.fx.interval=13,f.fx.start=function(){Ge||(Ge=setInterval(f.fx.tick,f.fx.interval))},f.fx.stop=function(){clearInterval(Ge),Ge=null},f.fx.speeds={slow:600,fast:200,_default:400},f.fn.delay=function(e,t){return e=f.fx&&f.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;(t=N.createElement("div")).setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a>
861<input type='checkbox'/>",r=t.getElementsByTagName("a")[0],i=(n=N.createElement("select")).appendChild(N.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",c.getSetAttribute="t"!==t.className,c.style=/top/.test(r.getAttribute("style")),c.hrefNormalized="/a"===r.getAttribute("href"),c.checkOn=!!e.value,c.optSelected=i.selected,c.enctype=!!N.createElement("form").enctype,n.disabled=!0,c.optDisabled=!i.disabled,(e=N.createElement("input")).setAttribute("value",""),c.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),c.radioValue="t"===e.value}();var at=/\r/g;f.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=f.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,f(this).val()):e)?i="":"number"==typeof i?i+="":f.isArray(i)&&(i=f.map(i,function(e){return null==e?"":e+""})),(t=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=f.valHooks[i.type]||f.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(at,""):null==n?"":n:void 0}}),f.extend({valHooks:{option:{get:function(e){var t=f.find.attr(e,"value");return null!=t?t:f.trim(f.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(!(!(n=r[l]).selected&&l!==i||(c.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&f.nodeName(n.parentNode,"optgroup"))){if(t=f(n).val(),o)return t;a.push(t)}return a}
861,set:function(e,t){for(var n,r,i=e.options,o=f.makeArray(t),a=i.length;a--;)if(r=i[a],f.inArray(f.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]={set:function(e,t){return f.isArray(t)?e.checked=f.inArray(f(e).val(),t)>=0:void 0}},c.checkOn||(f.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var st,lt,ut=f.expr.attrHandle,ct=/^(?:checked|selected)$/i,dt=c.getSetAttribute,ft=c.input;f.fn.extend({attr:function(e,t){return X(this,f.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){f.removeAttr(this,e)})}}),f.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===M?f.prop(e,t,n):(1===o&&f.isXMLDoc(e)||(t=t.toLowerCase(),r=f.attrHooks[t]||(f.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=f.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void f.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(j);if(o&&1===e.nodeType)for(;n=o[i++];)r=f.propFix[n]||n,f.expr.match.bool.test(n)?ft&&dt||!ct.test(n)?e[r]=!1:e[f.camelCase("default-"+n)]=e[r]=!1:f.attr(e,n,""),e.removeAttribute(dt?n:r)},attrHooks:{type:{set:function(e,t){if(!c.radioValue&&"radio"===t&&f.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return!1===t?f.removeAttr(e,n):ft&&dt||!ct.test(n)?e.setAttribute(!dt&&f.propFix[n]||n,n):e[f.camelCase("default-"+n)]=e[n]=!0,n}},f.each(f.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ut[t]||f.find.attr;ut[t]=ft&&dt||!ct.test(t)?function(e,t,r){var i,o;return r||(o=ut[t],ut[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ut[t]=o),i}:function(e,t,n){return n?void 0:e[f.camelCase("default-"+t)]?t.toLowerCase():null}}),ft&&dt||(f.attrHooks.value={set:function(e,t,n){return f.nodeName(e,"input")?void(e.defaultValue=t):st&&st.set(e,t,n)}}),dt||(st={set:function(e,t,n){var r=e.getAttributeNode(n);return r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n)?t:void 0}},ut.id=ut.name=ut.coords=function(e,t,n){var r;return n?void 0:(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},f.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:void 0},set:st.set},f.attrHooks.contenteditable={set:function(e,t,n){st.set(e,""!==t&&t,n)}},f.each(["width","height"],function(e,t){f.attrHooks[t]={set:function(e,n){return""===n?(e.setAttribute(t,"auto"),n):void 0}}})),c.style||(f.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var pt=/^(?:input|select|textarea|button|object)$/i,ht=/^(?:a|area)$/i;f.fn.extend({prop:function(e,t){return X(this,f.prop,e,t,arguments.length>1)},removeProp:function(e){return e=f.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),f.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!f.isXMLDoc(e))&&(t=f.propFix[t]||t,i=f.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=f.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}}}),c.hrefNormalized||f.each(["href","src"],function(e,t){f.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),c.optSelected||(f.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),f.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){f.propFix[this.toLowerCase()]=this}),c.enctype||(f.propFix.enctype="encoding");var mt=/[\t\r\n\f]/g;f.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;
861if(f.isFunction(e))return this.each(function(t){f(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=f.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(f.isFunction(e))return this.each(function(t){f(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(j)||[];l>s;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(mt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?f.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(f.isFunction(e)?function(n){f(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=f(this),o=e.match(j)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===M||"boolean"===n)&&(this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===e?"":f._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(mt," ").indexOf(t)>=0)return!0;return!1}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){f.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),f.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var gt=f.now(),vt=/\?/,yt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;f.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=f.trim(t+"");return i&&!f.trim(i.replace(yt,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():f.error("Invalid JSON: "+t)},f.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new DOMParser).parseFromString(t,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||f.error("Invalid XML: "+t),n};var bt,xt,wt=/#.*$/,Tt=/([?&])_=[^&]*/,Ct=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nt=/^(?:GET|HEAD)$/,Et=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,St={},At={},Dt="*/".concat("*");try{xt=location.href}catch(e){(xt=N.createElement("a")).href="",xt=xt.href}function jt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(j)||[];if(f.isFunction(n))for(;r=o[i++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Lt(e,t,n,r){var i={},o=e===At;function a(s){var l;return i[s]=!0,f.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ht(e,t){var n,r,i=f.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&f.extend(!0,e,n),e}bt=kt.exec(xt.toLowerCase())||[],f.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}
vendor: 5,286 bytes, line 861
861,flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ht(Ht(e,f.ajaxSettings),t):Ht(f.ajaxSettings,e)},ajaxPrefilter:jt(St),ajaxTransport:jt(At),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,a,s,l,u,c=f.ajaxSetup({},t),d=c.context||c,p=c.context&&(d.nodeType||d.jquery)?f(d):f.event,h=f.Deferred(),m=f.Callbacks("once memory"),g=c.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!u)for(u={};t=Ct.exec(o);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return l&&l.abort(t),T(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||xt)+"").replace(wt,"").replace(Et,bt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=f.trim(c.dataType||"*").toLowerCase().match(j)||[""],null==c.crossDomain&&(n=kt.exec(c.url.toLowerCase()),c.crossDomain=!(!n||n[1]===bt[1]&&n[2]===bt[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(bt[3]||("http:"===bt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=f.param(c.data,c.traditional)),Lt(St,c,t,w),2===b)return w;for(r in(s=f.event&&c.global)&&0==f.active++&&f.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Nt.test(c.type),i=c.url,c.hasContent||(c.data&&(i=c.url+=(vt.test(i)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=Tt.test(i)?i.replace(Tt,"$1_="+gt++):i+(vt.test(i)?"&":"?")+"_="+gt++)),c.ifModified&&(f.lastModified[i]&&w.setRequestHeader("If-Modified-Since",f.lastModified[i]),f.etag[i]&&w.setRequestHeader("If-None-Match",f.etag[i])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+Dt+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(r,c.headers[r]);if(c.beforeSend&&(!1===c.beforeSend.call(d,w,c)||2===b))return w.abort();for(r in x="abort",{success:1,error:1,complete:1})w[r](c[r]);if(l=Lt(At,c,t,w)){w.readyState=1,s&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},c.timeout));try{b=1,l.send(v,T)}catch(e){if(!(2>b))throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,n,r){var u,v,y,x,T,C=t;2!==b&&(b=2,a&&clearTimeout(a),l=void 0,o=r||"",w.readyState=e>0?4:0,u=e>=200&&300>e||304===e,n&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}return o?(o!==l[0]&&l.unshift(o),n[o]):void 0}(c,w,n)),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(c,x,w,u),u?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(f.lastModified[i]=T),(T=w.getResponseHeader("etag"))&&(f.etag[i]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=x.state,v=x.data,u=!(y=x.error))):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),w.status=e,w.statusText=(t||C)+"",u?h.resolveWith(d,[v,C,w]):h.rejectWith(d,[w,C,y]),w.statusCode(g),g=void 0,s&&p.trigger(u?"ajaxSuccess":"ajaxError",[w,c,u?v:y]),m.fireWith(d,[w,C]),s&&(p.trigger("ajaxComplete",[w,c]),--f.active||f.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return f.get(e,t,n,"json")},getScript:function(e,t){return f.get(e,void 0,t,"script")}}),f.each(["get","post"],function(e,t){f[t]=function(e,n,r,i){return f.isFunction(n)&&(i=i||r,r=n,n=void 0),f.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),f._evalUrl=function(e){return f.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},f.fn.extend({wrapAll:function(e){if(f.isFunction(e))return this.each(function(t){f(this).wrapAll(e.call(this,t))});if(this[0]){var t=f(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(f.isFunction(e)?function(t){f(this).wrapInner(e.call(this,t))}:function(){var t=f(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f.isFunction(e);return this.each(function(n){f(this).wrapAll(t?e.call(this,n):e)})}
vendor: 5,879 bytes, line 861
861,unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()}}),f.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!c.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||f.css(e,"display"))},f.expr.filters.visible=function(e){return!f.expr.filters.hidden(e)};var qt=/%20/g,_t=/\[\]$/,Mt=/\r?\n/g,Ft=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Bt(e,t,n,r){var i;if(f.isArray(t))f.each(t,function(t,i){n||_t.test(e)?r(e,i):Bt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==f.type(t))r(e,t);else for(i in t)Bt(e+"["+i+"]",t[i],n,r)}f.param=function(e,t){var n,r=[],i=function(e,t){t=f.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=f.ajaxSettings&&f.ajaxSettings.traditional),f.isArray(e)||e.jquery&&!f.isPlainObject(e))f.each(e,function(){i(this.name,this.value)});else for(n in e)Bt(n,e[n],t,i);return r.join("&").replace(qt,"+")},f.fn.extend({serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=f.prop(this,"elements");return e?f.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!f(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ft.test(e)&&(this.checked||!U.test(e))}).map(function(e,t){var n=f(this).val();return null==n?null:f.isArray(n)?f.map(n,function(e){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}}),f.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$t()||function(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:$t;var Pt=0,Rt={},Wt=f.ajaxSettings.xhr();function $t(){try{return new e.XMLHttpRequest}catch(e){}}e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Rt)Rt[e](void 0,!0)}),c.cors=!!Wt&&"withCredentials"in Wt,(Wt=c.ajax=!!Wt)&&f.ajaxTransport(function(e){var t;if(!e.crossDomain||c.cors)return{send:function(n,r){var i,o=e.xhr(),a=++Pt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Rt[a],t=void 0,o.onreadystatechange=f.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Rt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return f.globalEval(e),e}}}),f.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),f.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=N.head||f("head")[0]||N.documentElement;return{send:function(r,i){(t=N.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var zt=[],It=/(=)\?(?=&|$)|\?\?/;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||f.expando+"_"+gt++;return this[e]=!0,e}}),f.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(It.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&It.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=f.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(It,"$1"+i):!1!==t.jsonp&&(t.url+=(vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||f.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),a&&f.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),f.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||N;var r=x.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f.buildFragment([e],t,i),i&&i.length&&f(i).remove(),f.merge([],r.childNodes))};var Xt=f.fn.load;f.fn.load=function(e,t,n){if("string"!=typeof e&&Xt)return Xt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=f.trim(e.slice(s,e.length)),e=e.slice(0,s)),f.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&f.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?f("<div>").append(f.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},f.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){f.fn[t]=function(e){return this.on(t,e)}}),f.expr.filters.animated=function(e){return f.grep(f.timers,function(t){return e===t.elem}).length};var Ut=e.document.documentElement;function Vt(e){return f.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}f.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=f.css(e,"position"),c=f(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=f.css(e,"to
861p"),l=f.css(e,"left"),("absolute"===u||"fixed"===u)&&f.inArray("auto",[o,l])>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),f.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},f.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){f.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,f.contains(t,i)?(typeof i.getBoundingClientRect!==M&&(r=i.getBoundingClientRect()),n=Vt(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===f.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),f.nodeName(e[0],"html")||(n=e.offset()),n.top+=f.css(e[0],"borderTopWidth",!0),n.left+=f.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-f.css(r,"marginTop",!0),left:t.left-n.left-f.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Ut;e&&!f.nodeName(e,"html")&&"static"===f.css(e,"position");)e=e.offsetParent;return e||Ut})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);f.fn[e]=function(r){return X(this,function(e,r,i){var o=Vt(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?f(o).scrollLeft():i,n?i:f(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),f.each(["top","left"],function(e,t){f.cssHooks[t]=_e(c.pixelPosition,function(e,n){return n?(n=je(e,t),He.test(n)?f(e).position()[t]+"px":n):void 0})}),f.each({Height:"height",Width:"width"},function(e,t){f.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){f.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return X(this,function(t,n,r){var i;return f.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?f.css(t,n,a):f.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),f.fn.size=function(){return this.length},f.fn.andSelf=f.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return f});var Jt=e.jQuery,Yt=e.$;return f.noConflict=function(t){return e.$===f&&(e.$=Yt),t&&e.jQuery===f&&(e.jQuery=Jt),f},typeof t===M&&(e.jQuery=e.$=f),f});
862    IV$ = window.IV$ = jQuery.noConflict(true); 
863};
864/* ================================================================================================================================================== */
865
866/** ===============================================================================================================================================
867 * 
868 * 회원데이터 생성 
869 * - winodow load 이후에 호출 시 정상 노출 / 값 없을 경우 null 
870 * @IV_MEMBER_ID 회원 아이디 {string} / @IV_MEMBER_NAME 회원 이름 {string} / @IV_MEMBER_NICKNAME 회원 별명 
871 * @IV_MEMBER_GROUPNAME 등급명 {string} / @IV_MEMBER_GROUPNO 등급번호 {string}
872 * @IV_MEMBER_EMAIL 회원 이메일 {string} / @IV_MEMBER_PHONE 회원 일반전화번호 {string} / @IV_MEMBER_CELLPHONE 회원 핸드폰번호 {string} / @IV_MEMBER_BIRTHDAY 회원 생일
873 * @IV_MEMBER_BOARDWRITENAME 회원 게시판 작성 시 이름 {string} / @IV_MEMBER_ADDITIONALINFOMATION 회원 추가정보 {array} (객체 배열) / @IV_MEMBER_CREATEDATE 회원 계정생성일 {string} 
874 * @IV_MEMBER_AVAIL_MILEAGE 회원 사용가능 적립금(소수점 포함) {string} / @IV_MEMBER_UNAVAIL_MILEAGE 회원 미가용 적립금(소수점 포함) {string} / @IV_MEMBER_RETURN_MILEAGE 회원 환불예정 적립금(소수점 포함) {string} 
875 * @IV_MEMBER_TOTAL_MILEAGE 회원 총적립금(미가용+가용) (소수점 포함) {string} / @IV_MEMBER_USED_MILEAGE 회원이 사용한 적립금(소수점 포함) {string} 
876 * @IV_MEMBER_ACC_DEPOSIT 회원 누적 예치금{string} / @IV_MEMBER_USED_DEPOSIT 회원 사용 예치금 {string} / @IV_MEMBER_AVAIL_DEPOSIT 사용 가능 예치금 / @IV_MEMBER_RETURN_DEPOSIT 현금 환불요청 예치금 /@IV_MEMBER_TOTAL_DEPOSIT 회원 총예치금(미가용+가용) 
877 * @IV_MEMBER_COUPON_COUNT 보유 쿠폰 수 {number}
878 * @IV_MEMBER_ORDER_COUNT 총주문수 {string} / @IV_MEMBER_ORDER_TOTAL 총주문금액 {string} / @IV_MEMBER_ORDER_INCREASEVALUE 승급까지 남은 정보 ? 
879 */
880var IV_MEMBER_CHECK = IV_MEMBER_CHECK || null;
881var IV_MEMBER_ID = IV_MEMBER_ID || null; 
882var IV_MEMBER_NAME = IV_MEMBER_NAME || null; 
883var IV_MEMBER_NICKNAME = IV_MEMBER_NICKNAME || null; 
884var IV_MEMBER_GROUPNAME = IV_MEMBER_GROUPNAME || null; 
885var IV_MEMBER_GROUPNO = IV_MEMBER_GROUPNO || null; 
886var IV_MEMBER_EMAIL = IV_MEMBER_EMAIL || null; 
887var IV_MEMBER_PHONE = IV_MEMBER_PHONE || null; 
888var IV_MEMBER_CELLPHONE = IV_MEMBER_CELLPHONE || null; 
889var IV_MEMBER_BIRTHDAY = IV_MEMBER_BIRTHDAY || null; 
890var IV_MEMBER_BOARDWRITENAME = IV_MEMBER_BOARDWRITENAME || null; 
891var IV_MEMBER_ADDITIONALINFOMATION = IV_MEMBER_ADDITIONALINFOMATION || null; 
892var IV_MEMBER_CREATEDATE = IV_MEMBER_CREATEDATE || null; 
893var IV_MEMBER_NAME_MILEAGE = IV_MEMBER_NAME_MILEAGE || null;
894var IV_MEMBER_UNIT_MILEAGE = IV_MEMBER_UNIT_MILEAGE || null;
895var IV_MEMBER_AVAIL_MILEAGE = IV_MEMBER_AVAIL_MILEAGE || null; 
896var IV_MEMBER_UNAVAIL_MILEAGE = IV_MEMBER_UNAVAIL_MILEAGE || null; 
897var IV_MEMBER_RETURN_MILEAGE = IV_MEMBER_RETURN_MILEAGE || null; 
898var IV_MEMBER_TOTAL_MILEAGE = IV_MEMBER_TOTAL_MILEAGE || null; 
899var IV_MEMBER_USED_MILEAGE = IV_MEMBER_USED_MILEAGE || null; 
900var IV_MEMBER_NAME_DEPOSIT = IV_MEMBER_NAME_DEPOSIT || null;
901var IV_MEMBER_UNIT_DEPOSIT = IV_MEMBER_UNIT_DEPOSIT || null;
902var IV_MEMBER_ACC_DEPOSIT = IV_MEMBER_ACC_DEPOSIT || null; 
903var IV_MEMBER_USED_DEPOSIT = IV_MEMBER_USED_DEPOSIT || null; 
904var IV_MEMBER_RETURN_DEPOSIT = IV_MEMBER_RETURN_DEPOSIT || null; 
905var IV_MEMBER_AVAIL_DEPOSIT = IV_MEMBER_AVAIL_DEPOSIT || null; 
906var IV_MEMBER_TOTAL_DEPOSIT = IV_MEMBER_TOTAL_DEPOSIT || null; 
907var IV_MEMBER_COUPON_COUNT = IV_MEMBER_COUPON_COUNT || null; 
908var IV_MEMBER_ORDER_COUNT = IV_MEMBER_ORDER_COUNT || null; 
909var IV_MEMBER_ORDER_TOTAL = IV_MEMBER_ORDER_TOTAL || null; 
910var IV_MEMBER_ORDER_INCREASEVALUE = IV_MEMBER_ORDER_INCREASEVALUE || null; 
911var IV_MEMBER_OBJ = IV_MEMBER_OBJ || {};
912/* ================================================================================================================================================== */
913
914/** ================================================================================================================================================== 
915 * 페이지 접속 정보 
916 * @ IV_LOCATION ~ : 주소줄 기준 정보
917 * @ isPopupPage 팝업페이지 여부 0 아님 1 iframe 2 새 창
918 * @ topDocument 최상위 문서
919 * @ IV_TOP_SUBCONTAINER_DATA_PAGE / IV_SUBCONTAINER_DATA_PAGE 최상위/현재 페이지 고유값
920 * @ IV_MEMBER_CHECK 회원/비회원 여부
921 */
922var IV_LOCATION_HREF = IV_LOCATION_HREF || window.location.href; /* 현재 주소줄 전체 */
923var IV_LOCATION_HOSTNAME = IV_LOCATION_HOSTNAME || window.location.hostname; /* 현재 주소 기준 hostname */
924var IV_LOCATION_PATHNAME = IV_LOCATION_PATHNAME || window.location.pathname; /* 현재 주소 기준 pathname */
925var IV_LOCATION_PROTOCOL = IV_LOCATION_PROTOCOL || window.location.protocol; /* 현재 주소 기준 protocol */
926var IV_LOCATION_PARAMETERS = IV_LOCATION_PARAMETERS || ((window.location.search == '') ? '' : window.location.search.split('?')[1]); /* 현재 주소 기준 parameters */
927var isPopupPage = isPopupPage || null; 
928var topDocument = topDocument || null; 
929var IV_TOP_SUBCONTAINER_DATA_PAGE = IV_TOP_SUBCONTAINER_DATA_PAGE || null;
930var IV_SUBCONTAINER_DATA_PAGE = IV_SUBCONTAINER_DATA_PAGE || null;
931try {
932    if(window.frameElement || opener){
933        if(window.frameElement){
934            isPopupPage = 1;
935            topDocument = top.document.documentElement;
936            document.documentElement.classList.add('ivIframeHtml');
937        }else{
938            if(IV$('html').attr('class').indexOf('popup') == -1){
939                isPopupPage = 0;
940                topDocument = document.documentElement;
941            }else{
942                isPopupPage = 2;
943                topDocument = opener.document.documentElement;
944                document.documentElement.classList.add('ivPopupHtml');
945            };
946        };
947    }else{
948        isPopupPage = 0;
949        topDocument = document.documentElement;
950    };
951} catch (err) {
952    isPopupPage = 0;
953    topDocument = document.documentElement;
954};
955IV_MEMBER_CHECK = topDocument.querySelectorAll('#loginChk_nomember').length > 0 ? false : true; //true : 회원 , false: 비회원
956/* ================================================================================================================================================== */
957/** ================================================================================================================================================= 
958 * 커스텀 이벤트 생성
959 */
960(function () {
961    if ( typeof window.CustomEvent === "function" ) return false;
962    /* ie 대응 */
963    function CustomEvent ( event, params ) {
964        params = params || { bubbles: false, cancelable: false, detail: undefined };
965        var evt = document.createEvent('CustomEvent');
966        evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
967        return evt;
968    };
969    CustomEvent.prototype = window.Event.prototype;
970    window.CustomEvent = CustomEvent;
971})();
972/**
973 * Object.assign() polyfill for IE11
974 * @see <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign>
975 */
976if (typeof Object.assign != "function") {
977    Object.defineProperty(Object, "assign", {
978        value: function assign(target, varArgs) {
979            "use strict";
980            if (target == null) {
981                throw new TypeError("Cannot convert undefined or null to object");
982            };
983            var to = Object(target);
984            for (var index = 1; index < arguments.length; index++) {
985                var nextSource = arguments[index];
986                if (nextSource != null) {
987                    for (var nextKey in nextSource) {
988                        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
989                            to[nextKey] = nextSource[nextKey];
990                        };
991                    };
992                };
993            };
994            return to;
995        },
996        writable: true,
997        configurable: true
998    });
999};
1000var includeJs = includeJs || function(jsFilePath, randomUse) {
1001    var ord=Math.random();
1002    var js = document.createElement("script");
1003    js.type = "text/javascript";
1004    if(randomUse){
1005        js.src = jsFilePath + '?v=' + ord;
1006    }else{
1007        js.src = jsFilePath;
1008    };
1009    document.body.appendChild(js);
1010};
1011var includeCss = includeCss || function(cssFilePath, randomUse){
1012    var ord=Math.random();
1013    // element 추가
1014    var link = document.createElement("link");
1015    // href 어트리뷰트에 경로 추가
1016    if(randomUse){
1017        link.href = cssFilePath + '?v=' + ord;
1018    }else{
1019        link.href = cssFilePath;
1020    };
1021    // 비동기식이 아닌 동기식으로 한다.
1022    link.async = false;
1023    // style일의 기본 어트리뷰트 추가
1024    link.rel = "stylesheet";
1025    link.type = "text/css";
1026    // 헤더에 추가
1027    document.head.appendChild(link);
1028};
1029var loadScript = loadScript || function(url, callback)
1030{
1031    // adding the script tag to the head as suggested before
1032    var head = document.getElementsByTagName('head')[0];
1033    var script = document.createElement('script');
1034    script.type = 'text/javascript';
1035    script.src = url;
1036    // then bind the event to the callback function 
1037    // there are several events for cross browser compatibility
1038    script.onreadystatechange = callback;
1039    script.onload = callback;
1040    // fire the loading
1041    head.appendChild(script);
1042};
1043/* edge로 이동 함수(기존창 닫힘) */
1044var moveEdge = function(){
1045    window.location = 'microsoft-edge:http:' + IV_LOCATION_HOSTNAME + IV_LOCATION_HREF.split(IV_LOCATION_HOSTNAME)[1].trim();
1046    setTimeout(function(){
1047        top.window.opener = top; 
1048        top.window.open('','_parent', ''); 
1049        top.window.close();
1050    },3000);
1051};
1052
1053/* ================================================================================================================================================== */
1054/** ================================================================================================================================================= 
1055 * 접속한 기기/브라우저 정보 (iv_userAgentChk통해 확인)
1056 * @ IV_DEVICE_CHK : PC/MO
1057 * @ IV_BROWSER_CHK : iphone/not-iphone, ie, chrome ... etc
1058 */
1059var IV_DEVICE_CHK;
1060var IV_BROWSER_CHK;
1061/**
1062 * userAgetn Check 
1063 * iv_userAgentChk.__userAgent : 현재 접속 기기 관련 정보 ex 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36'
1064 * deviceChk : PC or mobile 
1065 * browserChk : 브라우저 체크 (ie, edge, whale ...)
1066 */
1067var iv_userAgentChk = {
1068    __userAgent: navigator.userAgent,
1069    deviceChk: function () {
1070        var e;
1071        return e = "m." == IV_LOCATION_HOSTNAME.substr(0, 2) || "mobile--shop" == IV_LOCATION_HOSTNAME.substr(0, 12) || "skin-mobile" == IV_LOCATION_HOSTNAME.substr(0, 11) ? "mobile" : "pc", IV_DEVICE_CHK = e, e
1072    },
1073    browserChk: function () {
1074        var e, t = iv_userAgentChk.__userAgent;
1075        return "pc" == iv_userAgentChk.deviceChk() ? t.indexOf("Trident") > -1 ? e = "ie" : t.indexOf("Edg") > -1 ? e = "edge" : t.indexOf("Whale") > -1 ? e = "whale" : t.indexOf("Opera") > -1 || t.indexOf("OPR") > -1 ? e = "opera" : t.indexOf("Firefox") > -1 ? e = "firefox" : t.indexOf("Safari") > -1 && -1 == t.indexOf("Chrome") ? e = "safari" : t.indexOf("Chrome") > -1 && (e = "chrome") : e = t.match(/iPad/i) || t.match(/iPhone/i) ? "iphone" : "not-iphone", IV_BROWSER_CHK = e, iv_userAgentChk.appChk(), e
1076    },
1077    appChk: function () {
1078        var e = null;
1079        return e = iv_userAgentChk.__userAgent.indexOf("Cafe24Plus") > -1 ? "app" : "pc" == IV_DEVICE_CHK ? "pc-web" : "mobile-web", IV_TYPE_CHK = e, e
1080    }
1081};
1082iv_userAgentChk.browserChk();
1083/* ================================================================================================================================================== */
1084/** ================================================================================================================================================= 
1085 * 창 정보
1086 */
1087var IV_vh = IV_vh || 0;
1088var IV_vh2 = IV_vh2 || 0;
1089var IV_vw = IV_vw || (window.innerWidth * 0.01);
1090var IV_topHeight = IV_topHeight || 0;
1091/**
1092 * swiper custom Array -> 커스텀 swiper array 
1093 */
1094var IV_SwiperCustomArray = IV_SwiperCustomArray || [];
1095/**
1096 * property setting ->
1096 css변수 생성 지정 설정 
1097 */
1098var IVSetPropertyArray = IVSetPropertyArray || [
1099    {name : 'topBanner', element : '#base_topBanner_container'},
1100    {name : 'header', element : '#base_header_container'},
1101    {name : 'gnb', element : '#base_header_container .gnb'},
1102    {name : 'footer', element : '#base_footer_container'},
1103];
1104/* ================================================================================================================================================== */
1105/**
1106 * util function -> util 영역
1107 */
1108var iv_util = iv_util || {
1109    getParameterByName: function (href, name) {
1110        /**
1111         * 파라미터 name에 할당된 값 출력
1112         * @href 기준 주소 
1113         * @name 파라미터 name
1114         * result type string
1115         */
1116        try {
1117            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
1118            var regexS = "[\\?&]" + name + "=([^&#]*)";
1119            var regex = new RegExp(regexS);
1120            var results = regex.exec(href);
1121            if (results == null) {
1122                return '';
1123            } else {
1124                return decodeURIComponent(results[1].replace(/\+/g, " "));
1125            };
1126        } catch (err) {
1127            console.log(err);
1128            return '';
1129        };
1130    },
1131    getURLParameters: function (href, name) {
1132        /**
1133         * 파라미터 name에 할당된 값 출력
1134         * @href 기준 주소 
1135         * @name 파라미터 name
1136         * name 없을 경우 전체 파라미터를 object 형태로 출력, name있을 경우 해당 name에 할당된 값만 string으로 출력 (name 지정의 경우 getParameterByName와 유사함)
1137         * result type object/string
1138         */
1139        try {
1140            var result = {};
1141            href.replace(/[?&]{1}([^=&#]+)=([^&#]*)/g, function(s, k, v) { result[k] = decodeURIComponent(v); });
1142            if(typeof name !== 'undefined'){
1143                if(result[name]){
1144                    return result[name];
1145                }else{
1146                    result = '';
1147                    return result;
1148                };
1149            }else{
1150                return result;
1151            };
1152        } catch (err) {
1153            console.log(err);
1154            return '';
1155        };
1156    },
1157    getUrl : function(href){
1158        if(typeof href === 'undefined'){
1159            IV_LOCATION_HREF = window.location.href; /* 현재 주소줄 전체 */
1160            IV_LOCATION_HOSTNAME = window.location.hostname; /* 현재 주소 기준 hostname */
1161            IV_LOCATION_PATHNAME = window.location.pathname; /* 현재 주소 기준 pathname */
1162            IV_LOCATION_PROTOCOL = window.location.protocol; /* 현재 주소 기준 protocol */
1163            IV_LOCATION_PARAMETERS = ((window.location.search == '') ? '' : window.location.search.split('?')[1]); /* 현재 주소 기준 parameters */
1164        }else{
1165            if(href.indexOf('?') > -1){
1166            	return [href.split('?')[0], href.split('?')[1]];
1167            }else{
1168            	return href;
1169            }
1170        }
1171    },
1172    comma: function (str) {
1173        /**
1174         * 숫자 comma 찍어주는 함수
1175         * @str string
1176         * result type string
1177         */
1178        try {
1179            str = String(str);
1180            return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
1181        } catch (err) {
1182            console.log(err); 
1183            return str;
1184        };
1185    },
1186    uncomma: function (str) {
1187        /**
1188         * 숫자 comma 제거하는 함수
1189         * @str string
1190         * result type number
1191         */
1192        try {
1193            str = String(str);
1194            return Number(str.replace(/[^\d]+/g, ''));
1195        }
1196        catch (err) {
1197            console.log(err); 
1198            return str;
1199        }
1200    },
1201    checkAvailability : function(arr, val){
1202        /**
1203         * 배열 중에 특정 값이 존재하는지 여부 
1204         * @arr array 
1205         * @val value
1206         * result type boolean
1207         * error result : null
1208         */
1209        try {
1210            return arr.some(function(arrVal) {
1211                return val === arrVal;
1212            });
1213        } catch (err) {
1214            console.log(err); 
1215            return null;
1216        };
1217    },
1218    onlyNumbFunc : function(str){
1219        /**
1220         * 숫자만 남기는 함수
1221         * @str string
1222         * result type number
1223         */
1224        try {
1225            str = String(str);
1226            var reg = /[^0-9]/g;
1227            if(reg.test(str)){
1228                return Number(str.replace(reg,'').trim());
1229            }else{
1230                return Number(str);
1231            };
1232        } catch (err) {
1233            console.log(err); 
1234            return str;
1235        };
1236    }, 
1237    removeNumbFunc : function(str){
1238        /**
1239         * 숫자만 제거하는 함수
1240         * @str string
1241         * result type string
1242         */
1243        try {
1244            str = String(str);
1245            var reg = /[0-9]/g;
1246            if(reg.test(str)){
1247                return str.replace(reg,'').trim();
1248            }else{
1249                return str;
1250            };
1251        } catch (err) {
1252            console.log(err); 
1253            return str;
1254        };
1255    }, 
1256    removeDashFunc : function(str){
1257        /**
1258         * 대시 제거하는 함수
1259         * @str string
1260         * result type string
1261         */
1262        try {
1263            str = String(str);
1264            var reg = /\-/g;
1265            if(reg.test(str)){
1266                return str.replace(reg,'').trim();
1267            }else{
1268                return str;
1269            };
1270        } catch (err) {
1271            console.log(err); 
1272            return str;
1273        };
1274    },
1275    removeBlankFunc : function(str){
1276        /**
1277         * 공백 전체 제거하는 함수
1278         * @str string
1279         * result type string
1280         */
1281        try {
1282            str = String(str);
1283            var reg = / /g;
1284            if(reg.test(str)){
1285                return str.replace(reg,'').trim();
1286            }else{
1287                return str;
1288            };
1289        } catch (err) {
1290            console.log(err); 
1291            return str;
1292        };
1293    },
1294    removeEnterFunc : function(str){
1295        /**
1296         * 엔터문자 전체 제거하는 함수
1297         * @str string
1298         * result type string
1299         */
1300        try {
1301            str = String(str);
1302            var reg = /(\r\n|\n|\r)/gm;
1303            if(reg.test(str)){
1304                return str.replace(reg,'').trim();
1305            }else{
1306                return str;
1307            }
1308        } catch (err) {
1309            console.log(err); 
1310            return str;
1311        };
1312    },
1313    roundDown : function(number, decimals){
1314        /**
1315         * 특정 자리 수에서 버림 처리  
1316         * @number number
1317         * @decimals 자리수 (0,-1,-2...)
1318         * result type number
1319         */
1320        try {
1321            decimals = decimals || 0;
1322            return ( Math.floor( number * Math.pow(10, decimals) ) / Math.pow(10, decimals) );
1323        } catch (err) {
1324            console.log(err); 
1325            return number;
1326        };
1327    },
1328    roundUp : function(number, decimals){
1329        /**
1330         * 특정 자리 수에서 올림 처리  
1331         * @number number
1332         * @decimals 자리수 (0,-1,-2...)
1333         * result type number
1334         */
1335        try {
1336            decimals = decimals || 0;
1337            return ( Math.ceil( number * Math.pow(10, decimals) ) / Math.pow(10, decimals) );
1338        } catch (err) {
1339            console.log(err); 
1340            return number;
1341        };
1342    },
1343    round : function(number, decimals){
1344        /**
1345         * 특정 자리 수에서 반올림 처리  
1346         * @number number
1347         * @decimals 자리수 (0,-1,-2...)
1348         * result type number
1349         */
1350        try {
1351            decimals = decimals || 0;
1352            return ( Math.round( number * Math.pow(10, decimals) ) / Math.pow(10, decimals) );
1353        } catch (err) {
1354            console.log(err); 
1355            return number;
1356        };
1357    },
1358    removeSpecialChars : function(str){
1359        /**
1360         * 특수문자 제거하는 함수
1361         * @str string
1362         * result type string
1363         */
1364        try {
1365            str = String(str);
1366            var reg = /[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi;
1367            if(reg.test(str)){
1368                return str.replace(reg,'').trim();
1369            }else{
1370                return str;
1371            };
1372        } catch (err) {
1373            console.log(err); 
1374            return str;
1375        };
1376    },
1377    makeDimmed : function(e,t,n){
1378        /**
1379         * dimmed 영역 생성 함수
1380         * @e dimmed 영역 붙는 타이밍 true append -> addClass / false addClass -> append
1381         * @t dimmed number 
1382         * @n 노출되는 elemenet
1383         */
1384        if (arguments.length > 0) {
1385            let i = typeof arguments[0];
1386            "number" === i ? (e = !0, t = arguments[0], void 0 !== arguments[1] && (n = arguments[1])) : "object" === i ? (e = !0, t = 0, n = arguments[0]) : (t = t || 0, n = n || null)
1387        } else e = !0, t = 0, n = null;
1388        if (0 == IV$(".iv_dimmed_" + t).length) {
1389            let i = IV$('<div class="iv_dimmed_' + t + '"></div>');
1390            !1 === e ? (i.addClass("on"), IV$("body").append(i)) : (IV$("body").append(i), setTimeout(function () {
1391                i.addClass("on")
1392            }, 0)), i.on("click", function () {
1393                IV$('.ec-base-layer, [class*="iv_"][class*="_layer"], .ec-base-tooltip, .iv_base_tooptip').filter(".on").removeClass("on"), null !== n && EC$(n).children('[class*="close"], [class*="Close"], [class*="delete"]').trigger("click"), iv_util.removeDimmed(e)
1394            });
1395        };
1396    },
1397    removeDimmed : function(e){
1398        /**
1399         * dimmed 영역 제거 함수
1400         * @e dimmed 영역 붙는 타이밍 true remove -> removeClass / false removeClass -> remove
1401         */
1402        let t = IV$('[class*="iv_dimmed"]');
1403        if(t.length > 0){
1404            function n() {
1405                t.remove()
1406            }!1 === (e = e || !0) ? t.remove() : "all 0s ease 0s" == t.css("transition") ? (t.removeClass("on"), n()) : (t[0].addEventListener("transitionend", n), t.removeClass("on"));
1407        }else{
1408            return false;
1409        }
1410    },
1411    scrollDisabled : function(e,t){
1412        /**
1413         * 스크롤 막기 
1414         * @e 노출되는 element
1415         * @t dimmed 노출 여부
1416         */
1417        if (arguments.length > 0) {
1418            "object" !== typeof arguments[0] ? (t = arguments[0], e = null) : (e = e || null, t = t || !0)
1419        } else t = !0, e = null;
1420        iv_util.scrollDisabled.object = iv_util.scrollDisabled.object || [];
1421        let n = iv_util.scrollDisabled.object;
1422        null !== e && (n.push(e), e[0].iv_openCustomFunction && -1 == String(e[0].iv_openCustomFunction).indexOf("scrollDisabled") && e[0].iv_openCustomFunction());
1423        const i = topDocument;
1424        topDocument.querySelector("body");
1425        if (0 == i.classList.contains("noscroll")) {
1426            var r = window.pageYOffset;
1427            i.classList.add("noscroll"), i.style.top = -1 * r + "px", !1 !== t && (iv_util.makeDimmed(), IV$('[class*="iv_dimmed_"]').on("click", function () {
1428                iv_util.scrollEnabled()
1429            }));
1430        };
1431    },
1432    scrollEnabled : function(e){
1433        /**
1434         * 스크롤 풀기
1435         * @e  노출되는 element
1436         */
1437        if (null !== (e = e || null)) e[0].iv_closeCustomFunction ? -1 == String(e[0].iv_closeCustomFunction).indexOf("scrollEnabled") && e[0].iv_closeCustomFunction() : IV$(e).removeClass("on active");
1438        else {
1439            iv_util.scrollDisabled.object = iv_util.scrollDisabled.object || [];
1440            let e = iv_util.scrollDisabled.object;
1441            0 != e.lenegth && e.forEach(function (t, n) {
1442                t[0].iv_closeCustomFunction ? -1 == String(t[0].iv_closeCustomFunction).indexOf("scrollEnabled") && t[0].iv_closeCustomFunction() : IV$(t).removeClass("on active"), e.splice(n, 1)
1443            });
1444        };
1445        const t = topDocument;
1446        if (t.classList.contains("noscroll")) {
1447            topDocument.querySelector("body");
1448            var n = Math.abs(t.style.getPropertyValue("top").replace("px", ""));
1449            t.classList.remove("noscroll"), t.style.removeProperty("top"), window.scrollTo(0, n), IV$('[class*="iv_dimmed_"]').length > 0 && iv_util.removeDimmed()
1450        };
1451    },
1452    layerOpenFunc : function(e, t, n){
1453        /**
1454         * iv_layer 여는 함수
1455         * 클릭 ele에 data-layer값 필수(팝업 id, class등 구분값) : 열려야 하는 팝업 구분값
1456         * addClass on 형태 -> css 작업 필요함
1457         * 레이어 영역 외 클릭 시 닫힘 처리
1458         * @e button 
1459         * @t dimmed 생성 여부
1460         * @n scroll 고정 여부 
1461         */
1462        try {
1463            var i = e.getAttribute("data-layer"),
1464                r = IV$(i),
1465                o = r.attr("class");
1466            o = (o = o.indexOf("on") ? o.replace("on", "") : o).indexOf("active") ? o.replace("active", "") : o, IV$(o = "." + o).not(r).removeClass("on active"), r.addClass("on"), t = t || !1, !1 === (n = n || !1) ? !0 === t ? iv_util.scrollDisabled(IV$(i), !0) : iv_util.scrollDisabled(IV$(i), !1) : !0 === t ? iv_util.makeDimmed(IV$(i)) : iv_util.targetOutCloseFunc(IV$(i))
1467        } catch (e) {
1468            console.log(e)
1469        };
1470    },
1471    layerCloseFunc: function(e){
1472        /**
1473         * iv_layer 닫는 함수
1474         * 클릭 ele에 data-layer값 필수(팝업 id, class등 구분값) : 닫혀야 하는 팝업 구분값
1475         * removeClass on 형태 -> css 작업 필요함
1476         * @e button 
1477         */
1478        try {
1479            var layer = e.getAttribute('data-layer');
1480            IV$(layer).removeClass('on');
1481        } catch (err) {
1482            console.log(err); 
1483        };
1484    },
1485    targetOutCloseFunc : function(e, t){
1486        /**
1487         * classname으로 지정한 영역 외 클릭 시, classname 요소 닫힘 처리 함수
1488         * @e element
1489         * @t callback function 
1490         */
1491        setTimeout(function () {
1492            if (e) try {
1493                var n = IV$(e),
1494                    i = n.attr("class"),
1495                    r = null;
1496                if (void 0 !== i)(i = (i = i.indexOf("on") ? i.replace("on", "") : i).indexOf("active") ? i.replace("active", "") : i).indexOf(/ /gi) > -1 && (i = i.replace(/ /gi, ".")), i = "." + i, r = $(i);
1497                else {
1498                    var o = n.attr("id");
1499                    void 0 !== o ? r = $('[id^="' + o + '"]').not(n) : n.siblings().length > 0 && (r = n.siblings())
1500                };
1501                IV$("body").one("click", function (i) {
1502                    if (n.hasClass("on") || n.hasClass("active")) {
1503                        var o = IV$(i.target);
1504                        (i.target == e || o.parents().filter(n).length > 0) && !o.attr("data-layer") ? (null !== r && r.not(n).removeClass("on active"), iv_util.targetOutCloseFunc(n)) : void 0 !== t ? "all 0s ease 0s" == n.css("transition") ? (n.removeClass("on active"), t()) : (n[0].addEventListener("transitionend", t), n.removeClass("on active")) : n.removeClass("on active")
1505                    };
1506                })
1507            } catch (e) {
1508                console.log(e)
1509            };
1510        }, 0)
1511    },
1512    arrayUnique : function(arr){
1513        /**
1514         * 배열 항목 unique만 남기는 함수
1515         * @arr array
1516         */
1517        try {
1518            arr = 
1519                arr.reduce(function(acc,curr,index){
1520                acc.indexOf(curr) > -1 ? acc : acc.push(curr);
1521                return acc;
1522            },[]);
1523            return arr;
1524        } catch (err) {
1525            console.log(err); 
1526        };
1527    },
1528    checkBatchimEnding : function(str){
1529        /**
1530         * 한글 끝자리에 받침 있는지 확인 
1531         * true 받침있음 false 받침없음
1532         * @str string
1533         */
1534        try {
1535            if (typeof str !== 'string') return null;
1536            var lastLetter = str[str.length - 1];
1537            var uni = lastLetter.charCodeAt(0);
1538            if (uni < 44032 || uni > 55203) return null;
1539            return (uni - 44032) % 28 != 0;
1540        } catch (err) {
1541            console.log(err); 
1542        };
1543    },
1544    floatingBox : function (el1, el2){
1545        /**
1546         * 스크롤 
1547         * el1 기준점이 될 전체 영역
1548         * el2 //스크롤 시 따라다닐 영역
1549         */
1550        IV$(window).scroll(function(){srollFunc();});
1551        if(IV$(window).scrollTop() > 0){srollFunc();}
1552        function srollFunc(){
1553            var setScollStandard = el1.outerHeight();
1554            var infoBoxHeight = el2.outerHeight();
1555            var headerHeight = IV$('header').outerHeight() + 40;
1556            el2.find('[data-fixed="true"]').css('top',headerHeight);
1557            el1.css('min-height',infoBoxHeight);
1558            if(setScollStandard > infoBoxHeight){
1559                var scrollStartOffsetTop = el1.offset().top -headerHeight;
1560                var offSetMax = setScollStandard + scrollStartOffsetTop - infoBoxHeight;
1561                var winTop = IV$(window).scrollTop();
1562                if(winTop < offSetMax){
1563                    if(winTop < scrollStartOffsetTop){
1564                        el2.find('[data-fixed="true"]').removeClass('fixed');
1565                    }else{
1566                        el2.find('[data-fixed="true"]').addClass('fixed').removeClass('max');
1567                    };
1568                }else{
1569                    el2.find('[data-fixed="true"]').addClass('fixed max');
1570                };
1571            };
1572        };
1573    },
1574    execDaumPostcode : function(e, t){
1575        /**
1576         * 다음 우편번호 팝업 함수 
1577         * @e : data-layer / .content / data-addr=true 3가지 항목 필요
1578         * [data-addr-type="zipcode"] zipcode
1579         * [data-addr-type="raddr1"] addr1
1580         * [data-addr-type="raddr2"] addr2
1581         * @t page 구분
1582         */
1583        if(typeof IV_ZIPCODE_LAYER_THEME_FOR_DAUMKAKAO === 'undefined'){
1584            var IV_ZIPCODE_LAYER_THEME_FOR_DAUMKAKAO = {
1585                bgColor: "#FAFAFA", //바탕 배경색
1586                //searchBgColor: "", //검색창 배경색
1587                //contentBgColor: "", //본문 배경색(검색결과,결과없음,첫화면,검색서제스트)
1588                //pageBgColor: "", //페이지 배경색
1589                textColor: "#000000", //기본 글자색
1590                //queryTextColor: "", //검색창 글자색
1591                postcodeTextColor: "#EB3300" //우편번호 글자색
1592                //emphTextColor: "", //강조 글자색
1593                //outlineColor: "", //테두리
1594            };
1595        }
1596        var theme = IV_ZIPCODE_LAYER_THEME_FOR_DAUMKAKAO;
1597        // 우편번호 찾기 찾기 화면을 넣을 element
1598        var n = e.getAttribute("data-layer"),
1599            i = document.querySelector(n).querySelector(".content"),
1600            r = IV$(e).closest('[data-addr="true"]');
1601        Math.max(document.body.scrollTop, document.documentElement.scrollTop);
1602        new daum.Postcode({
1603            oncomplete: function (e) {
1604                var n = "",
1605                    i = "";
1606                n = "R" === e.userSelectedType ? e.roadAddress : e.jibunAddress, "R" === e.userSelectedType && ("" !== e.bname && /[동|로|가]$/g.test(e.bname) && (i += e.bname), "" !== e.buildingName && "Y" === e.apartment && (i += "" !== i ? ", " + e.buildingName : e.buildingName), "" !== i && (i = " (" + i + ")")), void 0 !== iv_util.execDaumPostcode.selectBefore ? iv_util.execDaumPostcode.selectBefore.execute(r, e, n, i) : (r.find('[data-addr-type="zipcode"]').val(e.zonecode), r.find('[data-addr-type="addr1"]').val(n + " " + i), r.find('[data-addr-type="addr2"]').val("").focus(), "orderform" === t && EC_SHOP_FRONT_ORDERFORM_SHIPPING.exec(), void 0 !== iv_util.execDaumPostcode.selectAfter && iv_util.execDaumPostcode.selectAfter.execute()), iv_util.scrollEnabled()
1607            },
1608            onsearch: function (e) {},
1609            theme: theme,
1610            onresize: function (e) {
1611                i.style.height = e.height + 30 + "px", document.querySelector(n).classList.add("on"), iv_util.scrollDisabled(IV$(n))
1612            },
1613            width: "100%",
1614            height: "100%"
1615        }).embed(i)
1616    },
1617    optionTxt : function(e){
1618       /**
1619        * 옵션명에서 추가금/대괄호 제거
1620        * @e element
1621        */
1622        e.find(".option_str_txt").each(function () {
1623            var e = IV$(this);
1624            e.text(e.text().slice(1, e.text().length - 1)), e.text().indexOf("(+") > -1 ? e.text(e.text().split("(+")[0].trim()) : e.text().indexOf("(-") > -1 && e.text(e.text().split("(-")[0].trim())
1625        })
1626    },
1627    tablePrc : function(e){
1628        /**
1629         * 상품테이블에서 가격 출력
1630         * @e element
1631         */
1632        var t = e.find(".td_prc"),
1633            n = t.find('[title="판매가"]'),
1634            i = t.find('[title="최종가"]'),
1635            r = e.find('input[id^="quantity_id_"]').val();
1636        void 0 === r && (r = 0 == e.find(".qty_text").length ? iv_util.uncomma(e.find(".qty-text").text()) : e.find(".qty_text").text());
1637        var o = r * Number(iv_util.uncomma(n.children("strong").text())),
1638            a = r * Number(iv_util.uncomma(i.children("strong").text()));
1639        e.find(".fin_prc > strong").text(iv_util.comma(a)), e.find(".default_prc").text(iv_util.comma(o)), a < o && (e.find(".default_prc").removeClass("displaynone"), e.find(".default_prc").hasClass("discount") || e.find(".default_prc").addClass("discount"))
1640    },
1641    IntersectionObserver : function(e, t, n){
1642        /**
1643         * viewport 감지
1644         * @e element
1645         * @t option
1646         * @n callback function
1647         */
1648        let i, r;
1649        (i = "string" == typeof e ? document.querySelectorAll(e) : e).forEach(function (e, i) {
1650            let o = IV$(e).css("top");
1651            "auto" == o && (o = IV_topHeight);
1652            let a = -1 * iv_util.onlyNumbFunc(o) - 1,
1653                s = -1 * Math.round(100 * IV_vh + a - 2);
1654            a = a + 'px';
1655            s = s + 'px';
1656            if(typeof t !== 'undefined'){
1657                r = t;
1658            }else{
1659                r = {
1660                    root: null,
1661                    rootMargin: a + " 0px " + s + " 0px",
1662                    threshold: [0]
1663                };
1664            };
1665            const l = new IntersectionObserver(function (e, t) {
1666                e.forEach(function (i) {
1667                    !0 === i.isIntersecting ? IV$(i.target).addClass("iv-isIntersecting") : IV$(i.target).removeClass("iv-isIntersecting"), n(i, t, e, l)
1668                });
1669            }, r);
1670            l.observe(e);
1671        });
1672    },
1673    debounce : function(callback, limit) {
1674        /**
1675         * debounce
1676         * @callback 실행할 함수
1677         * @limit 실행 기준 시간
1678         */
1679        let timeout;
1680        return function(arguments) { clearTimeout(timeout); timeout = setTimeout(function() { callback.apply(this, arguments); }, limit); }
1681    },
1682    throttle : function(callback, limit) {
1683        /**
1684         * debounce
1685         * @callback 실행할 함수
1686         * @limit 실행 기준 시간
1687         */
1688        let waiting = false;
1689        return function() {
1690            if(!waiting) {
1691                callback.apply(this, arguments);
1692                waiting = true;
1693                setTimeout(function() {
1694                    waiting = false;
1695                }, limit);
1696            };
1697        };
1698    },
1699    hexToRgb : function(e) {
1700        /**
1701         * hex -> rgb 전환 (축약/#포함미포함/확장형 모두 전환)
1702         * Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
1703         * @e = hex code
1704         */
1705        e = e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (e, t, n, i) {
1706            return t + t + n + n + i + i
1707        });
1708        var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
1709        return t ? {
1710            r: parseInt(t[1], 16),
1711            g: parseInt(t[2], 16),
1712            b: parseInt(t[3], 16)
1713        } : null
1714    },
1715    rgbToHex : function(e, t, n) {
1716        /**
1717         * rgb -> hex 전환 
1718         * @e red color value(number or string) ex 250
1719         * @t green color value(number or string) ex 250
1720         * @n blue color value(number or string) ex 250
1721         */
1722        return "#" + (16777216 + (e << 16 | t << 8 | n << 0)).toString(16).slice(1);
1723    },
1724    getComments : function(e){
1725        /**
1726         * 주석 내용 가져오기
1727         * @e element
1728         */
1729        let t = [];
1730        return e.contents().filter(function () {
1731            if (8 == this.nodeType) {
1732                let e = iv_util.removeBlankFunc(this.nodeValue);
1733                t.push(e)
1734            }
1735        }), t;
1736    },
1737    getCommentParam : function(e, t){
1738        /**
1739         * 주석 변수 name에 따라 출력
1740         * @e 주석
1741         * @t name
1742         */
1743        try {
1744            t = t.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
1745            var n = new RegExp("[\\$@]" + t + "=([^$@]*)").exec(e);
1746            return null == n ? "" : decodeURIComponent(n[1].replace(/\+/g, " "))
1747        } catch (e) {
1748            return console.log(e), ""
1749        };
1750    },
1751    getTime : function(date, type, type2){
1752        /**
1753         * 시간 가져오기 
1754         * @date 기준 날짜 (없을 경우 오늘 날짜) / type array 
1755         * @type 출력 타입 time or array
1756         * @type2 출력할 단계 1 날짜 + 시간 / 2 날짜 + 시간 + 분 / 3 날짜 + 시간 + 분 + 초 / else 날짜 
1757         */
1758        var today = new Date();
1759        type2 = String(type2);
1760        var basic = ['','','','','',''];
1761        date = IV$.extend(basic,date);
1762        if(date !== false){
1763            if(type2 === '1'){
1764                //날짜 + 시간
1765                if(type === 'time'){
1766                    date = new Date(date[0], date[1] -1, date[2], date[3], 00,00);
1767                    return date;
1768                }else{
1769                    return [date[0],date[1],date[2],'',''];
1770                };
1771            }else if(type2=='2'){
1772                //날짜 + 시간 + 분
1773                if(type === 'time'){
1774                    date = new Date(date[0], date[1] -1, date[2], date[3], date[4], 00);
1775                    return date;
1776                }else{
1777                    return [date[0],date[1],date[2],date[3],''];
1778                };
1779            }else if(type2 == '3'){
1780                //날짜 + 시간 + 분 + 초
1781                if(type === 'time'){
1782                    date = new Date(date[0], date[1] -1, date[2], date[3], date[4], date[5]);
1783                    return date;
1784                }else{
1785                    return [date[0],date[1],date[2],date[3],date[4],date[5]];
1786                };
1787            }else{
1788                //그 외 값이면 날짜까지만
1789                if(type === 'time'){
1790                    date = new Date(date[0], date[1] -1, date[2],00,00,00);
1791                    return date;
1792                }else{
1793                    return [date[0],date[1],date[2],'','',''];
1794                };
1795            };
1796        }else{
1797            date = today;
1798            var year = String(date.getFullYear());
1799            var month = ('0' + (date.getMonth() + 1)).slice(-2);
1800            var day = ('0' + date.getDate()).slice(-2);
1801            var hours = ('0' + date.getHours()).slice(-2); 
1802            var minutes = ('0' + date.getMinutes()).slice(-2);
1803            var seconds = ('0' + date.getSeconds()).slice(-2); 
1804            if(type2 === '1'){
1805                //날짜 + 시간
1806                if(type === 'time'){
1807                    date = new Date(year, date.getMonth(), day, hours, 00,00);
1808                    return date;
1809                }else{
1810                    return [year, month, day, hours, '', ''];
1811                };
1812            }else if(type2=='2'){
1813                //날짜 + 시간 + 분
1814                if(type === 'time'){
1815                    date = new Date(year, date.getMonth(), day, hours, minutes,00);
1816                    return date;
1817                }else{
1818                    return [year, month, day, hours, minutes, ''];
1819                };
1820            }else if(type2 == '3'){
1821                //날짜 + 시간 + 분 + 초
1822                if(type === 'time'){
1823                    date = new Date(year, date.getMonth(), day, hours, minutes,seconds);
1824                    return date;
1825                }else{
1826                    return [year, month, day, hours, minutes, seconds];
1827                };
1828            }else{
1829                //그 외 값이면 날짜까지만
1830                if(type === 'time'){
1831                    date = new Date(year, date.getMonth(), day, 00, 00,00);
1832                    return date;
1833                }else{
1834                    return [year, month, day, '', '', ''];
1835                };
1836            };
1837        };
1838    },
1839    getServerTime : function(){
1840        /**
1841         * 서버 시간 가져오기 
1842         */
1843        return new Promise(function (e, t) {
1844            $.get("https://ododoc.kr/api_return_cur_time", function (n) {
1845                if (n) {
1846                    var i = n.serverTime.split(" "),
1847                        r = i[0].split("-"),
1848                        o = i[1].split("-"),
1849                        a = r[0],
1850                        s = ("0" + r[1]).slice(-2),
1851                        l = ("0" + r[2]).slice(-2),
1852                        c = ("0" + o[0]).slice(-2),
1853                        u = ("0" + o[1]).slice(-2),
1854                        d = ("0" + o[2]).slice(-2),
1855                        f = [new Date(a, Number(s) - 1, l, c, u, d), a, s, l, c, u, d];
1856                    e(f);
1857                };
1858                t(new Error("Request is failed"))
1859            });
1860        });
1861    },
1862    replaceAt : function(e, t, n){
1863        /**
1864         * 특정 자리 수 기준으로 replace
1865         * @e string
1866         * @t 자리수
1867         * @n 변경할 텍스트 
1868         */
1869        return e.substr(0, t) + n + e.substr(t + n.length);
1870    },
1871    betweenDateGapCalc : function(stDate, endDate){
1872        /**
1873         * 날짜 사이 gap 구하는 함수 
1874         * 특수문자 포함 시 특수문자 기준으로 split / 없을 경우 자리수 기준으로 뜯기
1875         * yyyy-mm-dd-hh-mm-ss 양식
1876         * @stDate 시작일
1877         * @endDate 종료일
1878         */
1879        var reg = /[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi;
1880        let sTime;
1881        let eTime; 
1882        if(typeof stDate === 'string'){
1883            if(reg.test(stDate)){
1884                stDate = stDate.split(reg);
1885            }else{
1886                stDate = [stDate.substr(0,4), stDate.substr(4,2), stDate.substr(6,2), stDate.substr(8,2), stDate.substr(10,2), stDate.substr(12,2)];   
1887            };
1888            sTime = new Date(stDate[0], stDate[1] -1, stDate[2], stDate[3], stDate[4], stDate[5]);
1889        }else{
1890            if(Array.isArray(stDate)){
1891                sTime = new Date(stDate[0], stDate[1] -1, stDate[2], stDate[3], stDate[4], stDate[5]);
1892            }else{
1893                sTime = stDate;
1894            };
1895        };
1896        if(typeof endDate === 'string'){
1897            if(reg.test(endDate)){
1898                endDate = endDate.split(reg);
1899            }else{
1900                endDate = [endDate.substr(0,4), endDate.substr(4,2), endDate.substr(6,2), endDate.substr(8,2), endDate.substr(10,2), endDate.substr(12,2)];   
1901            };
1902            eTime = new Date(endDate[0], endDate[1] -1, endDate[2], endDate[3], endDate[4], endDate[5]); 
1903        }else{
1904            if(Array.isArray(endDate)){
1905                eTime = new Date(endDate[0], endDate[1] -1, endDate[2], endDate[3], endDate[4], endDate[5]); 
1906            }else{
1907                eTime = endDate;
1908            };
1909        };
1910        var dateGap = eTime.getTime() - sTime.getTime();
1911        var timeGap = new Date(0, 0, 0, 0, 0, 0, eTime - sTime); 
1912        var diffDay  = Math.floor(dateGap / (1000 * 60 * 60 * 24)); // 일수       
1913        var diffHour = timeGap.getHours();       // 시간
1914        var diffMin  = timeGap.getMinutes();      // 분
1915        var diffSec  = timeGap.getSeconds();      // 초
1916        var result = [dateGap, diffDay, diffHour, diffMin, diffSec];
1917        return result;
1918    },
1919    viewtestCondition : function(condition, callback){
1920        /**
1921         * 테스트 컨디션으로 보기 위한 함수
1922         * @condition 추가조건 / true/false
1923         * @callback function
1924         */
1925        if(typeof IV_TEST_CONDITION_ARRAY !== 'undefined'){
1926            if(condition){
1927                IV_TEST_CONDITION_ARRAY.some(function(e,i){
1928                    if(IV_MEMBER_ID == e){
1929                        if(typeof callback !== 'undefined'){
1930                            callback();
1931                        }
1932                    }
1933                });
1934            }
1935        }
1936    },
1937    getDeepestChild : function(param) {
1938        /**
1939         * 가장 깊은 단계 자식 요소 return 
1940         * @param element
1941         */
1942        var element_list = IV$(param);
1943        var depth = 0;
1944        var deepest_element;
1945        ( findChildren = function(){
1946            if(element_list.children().length == 0){
1947                deepest_element = element_list;
1948            }else{
1949                if(element_list.children().children().length > 0){
1950                    element_list = element_list.children();
1951                    findChildren();
1952                }else{
1953                    deepest_element = element_list.children();
1954                };
1955            };
1956        })();
1957        return deepest_element;
1958    },
1959    setCookie : function(name, value, exp){
1960        var date = new Date();
1961        date.setTime(date.getTime() + exp*24*60*60*1000);
1962        document.cookie = name + '=' + value + ';expires=' + date.toUTCString() + ';path=/';
1963    },
1964    getCookie : function(name){
1965        var value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
1966        return value? value[2] : null;
1967    },
1968    deleteCookie : function(name){
1969        document.cookie = name + '=; expires=Thu, 01 Jan 1999 00:00:10 GMT;path=/';
1970    },
1971};
1972
1973
1974/**
1975 * extend 
1976 */
1977var IV_SWIPE_NUM = IV_SWIPE_NUM || 0;
1978IV$.fn.extend({
1979    /**
1980     * 기본 swiper 생성 -> data-custom = false인 경우 생성
1981     */
1982    iv_swiperFunc : function(options){
1983        this.each(function(i, x){
1984            let classList = x.classList, 
1985                $x = IV$(x),
1986                config = {};
1987            if(typeof options === 'undefined'){
1988                if(typeof IV_SwiperBasicOption !== 'object'){
1989                    config = {
1990                        slidesPerView : 'auto',
1991                        spaceBetween : 0,
1992                        speed : 300,
1993                    };
1994                }else{
1995                    config = Object.assign({}, IV_SwiperBasicOption);
1996                };
1997            }
1998            if(classList.contains('ivswipe-done') === false){
1999                let dataSet = x.dataset,
2000                    dataSetKeyArray = Object.keys(dataSet),
2001                    name = (typeof dataSet['ivswipeName'] !== 'undefined') ? dataSet['ivswipeName'] : 'tempName' + String(IV_SWIPE_NUM),
2002                    custom = dataSet['ivswipeCustom'],
2003                    module = dataSet['ivswipeModule'],
2004                    connect = dataSet['ivswipeConnect'];
2005                name = (name.indexOf('ivswipe_') > -1) ? name.split('ivswipe_')[1].trim() : name;
2006                if(typeof window['ivswipe_'+name] !== 'undefined'){
2007                	name = 'tempName' + String(IV_SWIPE_NUM);
2008                }
2009                IV_SWIPE_NUM++;
2010                let ivswiper = null,
2011                    $baseSwiperContainer,
2012                    $swiperContainer,
2013                    $swiperSlide;
2014                if(classList.contains('ivswipe-init')){
2015                    $baseSwiperContainer = $x.closest('.base_swiper_container');
2016                    $swiperContainer = $x.parent('.swiper-container');
2017                    $swiperSlide = $x.children();
2018                    ivswiper = window['ivswipe_' + name];
2019                    if(typeof ivswiper !== 'undefined'){
2020                        ivswiper.init();
2021                    }else{
2022                        makeIvSwiper();
2023                    }
2024                }else{
2025                    $baseSwiperContainer = $x.parent().addClass('base_swiper_container');
2026                    $swiperSlide = $x.children().addClass('swiper-slide');
2027                    $x.wrap('<div class="swiper-container"></div>');
2028                    $swiperContainer = $x.closest('.swiper-container');
2029                    $x.addClass('ivswipe-init swiper-wrapper');
2030                    if(typeof module !== 'undefined' && module !== ''){
2031                        module = (module.indexOf(',') > -1) ? module.split(',') : [module];
2032                        module.forEach(function(e,i){
2033                            switch(e.trim()){
2034                                case 'scrollbar' :
2035                                    let $scrollbar;
2036                                    if($baseSwiperContainer.find('.base_swiper_scrollbar').length == 0){
2037                                        $scrollbar = IV$('<div class="base_module_container base_swiper_scrollbar"><div class="swiper-scrollbar"></div></div>');
2038                                        $baseSwiperContainer.append($scrollbar);
2039                                    }
2040                                    config['scrollbar'] = {el: $baseSwiperContainer.find('.swiper-scrollbar')[0],hide: false};
2041                                    break;
2042                                case 'pagination' :
2043                                    let $pagination;
2044                                    if($baseSwiperContainer.find('.base_swiper_pagination').length ==0){
2045                                        $pagination = IV$('<div class="base_module_container base_swiper_pagination"><div class="swiper-pagination"></div></div>');
2046                                        $baseSwiperContainer.append($pagination);
2047                                    }
2048                                    config['pagination'] = {el: $baseSwiperContainer.find('.swiper-pagination')[0],clickable: true}; 
2049                                    break;
2050                                case 'navigation' :
2051                                    let $navigation;
2052                                    if($baseSwiperContainer.find('.base_swiper_navigation').length == 0){
2053                                        $navigation = IV$('<div class="base_module_container base_swiper_navigation"><div class="swiper-button-prev"></div><div class="swiper-button-next"></div></div>');
2054                                        $baseSwiperContainer.append($navigation);
2055                                    }
2056                                    config['navigation'] = {
2057                                        nextEl: $baseSwiperContainer.find('.base_swiper_navigation .swiper-button-next')[0],
2058                                        prevEl: $baseSwiperContainer.find('.base_swiper_navigation .swiper-button-prev')[0]};
2059                                    break;
2060                                case 'progressbar' :
2061                                    let $progressbar;
2062                                    if($baseSwiperContainer.find('.base_swiper_pagination').length == 0){
2063                                        $progressbar = IV$('<div class="base_module_container base_swiper_pagination"><div class="swiper-pagination"></div></div>');
2064                                        $baseSwiperContainer.append($progressbar);
2065                                    }
2066                                    config['pagination'] = {el: $baseSwiperContainer.find('.swiper-pagination')[0],type: 'progressbar'};
2067                                    break;
2068                                case 'fraction' :
2069                                    let $fraction;
2070                                    if($baseSwiperContainer.find('.base_swiper_pagination').length == 0){
2071                                        $fraction = IV$('<div class="base_module_container base_swiper_pagination"><div class="swiper-pagination"></div></div>');
2072                                        $baseSwiperContainer.append($fraction);
2073                                    }
2074                                    config['pagination'] = {el: $baseSwiperContainer.find('.swiper-pagination')[0],type: 'fraction'};
2075                                    break;
2076                                default : 
2077                                    break;
2078                            }
2079                        });
2080                    }
2081                    makeIvSwiper();
2082                }
2083                /**
2084                 * swiper 생성 방법
2085                 * 1) IV_SwiperCustomArray -> {swiperName : 스와이퍼구분명, swiperOption : 스와이퍼 실행 옵션} 형태로 push
2086                 * 2) html 마크업에 data 속성으로 요소 넣는다
2087                 * 3) 직접 swiper option을 넣는다 ex $mainContent.addClass('iv_swiper').iv_swiperFunc(config);
2088                 */
2089                function makeIvSwiper(){
2090                    if(custom === 'true'){
2091                        if(typeof options !== 'undefined'){
2092                            config = IV$.extend(config,options);
2093                        }else{
2094                            IV_SwiperCustomArray.forEach(function(e,i){
2095                                if(e.swiperName == name){
2096                                    var options = e.swiperOption;
2097                                    config = IV$.extend(config,options);
2098                                }
2099                            });
2100                        }
2101                    }else{
2102                        let ivSwiperDataArray=dataSetKeyArray.reduce(function(acc,e,i,arr){
2103                            if(e.indexOf('ivswipe')>-1&&e.indexOf('ivswipeName')==-1&&e.indexOf('ivswipeCustom')==-1&&e.indexOf('ivswipeConnect')==-1&&e.indexOf('ivswipeModule')==-1){
2104                                let option=e.split('ivswipe')[1];option=option.replace(option[0],option[0].toLowerCase());
2105                                let value=dataSet[e];let numberValue=Number(value);if(isNaN(numberValue)===!1){value=numberValue}
2106                                switch(value){case 'true':value=!0;break;case 'false':value=!1;break;default:break}
2107                                switch(option){case 'autoplay':value={delay:value,disableOnInteraction:!1};break;case 'allowslidenext':option='allowSlideNext';break;case 'allowslideprev':option='allowSlidePrev';break;case 'allowtouchmove':option='allowTouchMove';break;case 'autoheight':option='autoHeight';break;case 'centerinsufficientslides':option='centerInsufficientSlides';break;case 'centeredslides':option='centeredSlides';break;
2107case 'centeredslidesbounds':option='centeredSlidesBounds';break;case 'containermodifierclass':option='containerModifierClass';break;case 'cssmode':option='cssMode';break;case 'edgeswipedetection':option='edgeSwipeDetection';break;case 'edgeswipethreshold':option='edgeSwipeThreshold';break;case 'focusableelements':option='focusableElements';break;case 'followfinger':option='followFinger';break;case 'grabcursor':option='grabCursor';break;case 'initialslide':option='initialSlide';break;case 'longswipes':option='longSwipes';break;case 'longswipesms':option='longSwipesMs';break;case 'longswipesratio':option='longSwipesRatio';break;case 'loopadditionalslides':option='loopAdditionalSlides';break;case 'loopfillgroupwithblank':option='loopFillGroupWithBlank';break;case 'looppreventsslide':option='loopPreventsSlide';break;case 'loopedslides':option='loopedSlides';break;case 'maxbackfacehiddenslides':option='maxBackfaceHiddenSlides';break;case 'noswiping':option='noSwiping';break;case 'noswipingclass':option='noSwipingClass';break;case 'noswipingselector':option='noSwipingSelector';break;case 'normalizeslideindex':option='normalizeSlideIndex';break;case 'observeparents':option='observeParents';break;case 'observeslidechildren':option='observeSlideChildren';break;case 'passivelisteners':option='passiveListeners';break;case 'preloadimages':option='preloadImages';break;case 'preventclicks':option='preventClicks';break;case 'preventclickspropagation':option='preventClicksPropagation';break;case 'preventinteractionontransition':option='preventInteractionOnTransition';break;case 'preventclickspropagation':option='preventClicksPropagation';break;case 'resistanceratio':option='resistanceRatio';break;case 'resizeobserver':option='resizeObserver';break;case 'roundlengths':option='roundLengths';break;case 'runcallbacksoninit':option='runCallbacksOnInit';break;case 'setwrappersize':option='setWrapperSize';break;case 'shortswipes':option='shortSwipes';break;case 'simulatetouch':option='simulateTouch';break;case 'slideactiveclass':option='slideActiveClass';break;case 'slideblankclass':option='slideBlankClass';break;case 'slideclass':option='slideClass';break;case 'slideduplicateactiveclass':option='slideDuplicateActiveClass';break;case 'slideduplicateclass':option='slideDuplicateClass';break;case 'slideduplicatenextclass':option='slideDuplicateNextClass';break;case 'slideduplicateprevclass':option='slideDuplicatePrevClass';break;case 'slideNextClass':option='slidenextclass';break;case 'slideprevclass':option='slidePrevClass';break;case 'slidetoclickedslide':option='slideToClickedSlide';break;case 'slidevisibleclass':option='slideVisibleClass';break;case 'slidesoffsetafter':option='slidesOffsetAfter';break;case 'slidesoffsetbefore':option='slidesOffsetBefore';break;case 'slidespergroup':option='slidesPerGroup';break;case 'slidespergroupauto':option='slidesPerGroupAuto';break;case 'slidespergroupskip':option='slidesPerGroupSkip';break;case 'slidesperview':option='slidesPerView';break;case 'spacebetween':option='spaceBetween';break;case 'swipehandler':option='swipeHandler';break;case 'touchangle':option='touchAngle';break;case 'toucheventstarget':option='touchEventsTarget';break;case 'touchmovestoppropagation':option='touchMoveStopPropagation';break;case 'touchratio':option='touchRatio';break;case 'touchreleaseonedges':option='touchReleaseOnEdges';break;case 'touchstartforcepreventdefault':option='touchStartForcePreventDefault';break;case 'touchangle':option='touchAngle';break;case 'touchstartpreventdefault':option='touchStartPreventDefault';break;case 'uniquenavelements':option='uniqueNavElements';break;case 'updateonimagesready':option='updateOnImagesReady';break;case 'updateonwindowresize':option='updateOnWindowResize';break;case 'useragent':option='userAgent';break;case 'virtualtranslate':option='virtualTranslate';break;case 'watchoverflow':option='watchOverflow';break;case 'watchslidesprogress':option='watchSlidesProgress';break;case 'wrapperclass':option='wrapperClass';break;case 'freemode':option='freeMode';break;case 'keyboard':value={enabled:!0};break;default:break}
2108                                acc[option]=value;return acc}else{return acc}},{});
2109                        config=IV$.extend(config,ivSwiperDataArray);
2110                    }
2111                };
2112                function updateSwipe(){
2113                    if(ivswiper.virtualSize - ivswiper.size < 5){
2114                        IV$(ivswiper.$wrapperEl).addClass('no-swiping');
2115                        IV$(ivswiper.$el).closest('.base_swiper_container').find('.base_module_container').addClass('displaynone');
2116                    }else{
2117                        IV$(ivswiper.$wrapperEl).removeClass('no-swiping');
2118                        IV$(ivswiper.$el).closest('.base_swiper_container').find('.base_module_container').removeClass('displaynone');
2119                    }
2120                    ivswiper.update();
2121                }
2122                if(typeof config['observeParents'] === 'undefined'){
2123                    const targetNode = $x.get(0);
2124                    const observer = new ResizeObserver(detectChange);
2125                    function detectChange(mutationsList, observer) {
2126                        if(mutationsList){
2127                            setTimeout(updateSwipe, 300);
2128                            setTimeout(updateSwipe, 1200);
2129                        }
2130                    };
2131                    observer.observe(targetNode, {box: "border-box"});
2132                }
2133                let slideUpdateFunc = function(a, b){
2134                    a.some(function(arr, val){
2135                        if(arr.type === 'childList'){
2136                            IV$(ivswiper.$wrapperEl).children().addClass('swiper-slide');
2137                            updateSwipe();
2138                            return true;
2139                        }
2140                    });
2141                }
2142                $x.iv_observerFunc(slideUpdateFunc, {
2143                    attributes: false,
2144                    childList: true,
2145                    subtree: false,
2146                });
2147                x['ivswipe'] = config; //iv_swiper에 넣어줌
2148                window['ivswipe_' +name] = new Swiper($swiperContainer[0], config);
2149                $x.attr('data-ivswipe-name', 'ivswipe_' + name);
2150                ivswiper = window['ivswipe_' +name];
2151                $x.addClass('ivswipe-done');
2152                let IV_SWIPER_SINGLE_CALL_END = new CustomEvent('IVSwiperCall', {'detail': window['ivswipe_' +name] });
2153                x.dispatchEvent(IV_SWIPER_SINGLE_CALL_END);
2154            }else{
2155                let name = IV$(this).attr('data-ivswipe-name');
2156                let ivswiper = window[name];
2157                if(typeof ivswiper !== 'undefined'){
2158                    ( chk = function(){
2159                        setTimeout(function(){
2160                            if(ivswiper.virtualSize - ivswiper.size < 5){
2161                                IV$(ivswiper.$wrapperEl).addClass('no-swiping');
2162                                IV$(ivswiper.$el).closest('.base_swiper_container').find('.base_module_container').addClass('displaynone');
2163                            }else{
2164                                IV$(ivswiper.$wrapperEl).removeClass('no-swiping');
2165                                IV$(ivswiper.$el).closest('.base_swiper_container').find('.base_module_container').removeClass('displaynone');
2166                            }
2167                            ivswiper.slideTo(0,0,true);
2168                        },300);
2169                    })();
2170                }
2171            }
2172        });
2173    },
2174    iv_swiperConnectFunc : function($ivSwiper, speed){
2175        this.each(function(i, x){
2176            let classList = x.classList; 
2177            if(classList.contains('ivswipe-done') === true){
2178                let $x = IV$(x),
2179                    name = $x.attr('data-ivswipe-name'),
2180                    ivswiper = window[name],
2181                    connect, 
2182                    ivswiperConnect = [];
2183                if(typeof $ivSwiper !== 'undefined'){
2184                    $ivSwiper.each(function(j, y){
2185                        let $y = IV$(y),
2186                            connectName = $y.attr('data-ivswipe-name'),
2187                            speed = y['ivswipe'].speed,
2188                            obj = {};
2189                        obj['name'] = connectName;
2190                        obj['speed'] = speed;
2191                        ivswiperConnect.push(obj);
2192                    });
2193                }else{
2194                    connect = $x.attr('data-ivswipe-connect');
2195                    if(typeof connect !== 'undefined' && connect !== ''){
2196                        connect = (connect.indexOf(',')>-1) ? connect.split(',') : [connect];
2197                        connect.forEach(function(e,i){
2198                            let connectName = (e.indexOf('ivswipe_')>-1) ? e : 'ivswipe_' + e,
2199                                $e = IV$('[data-ivswipe-name="'+ connectName +'"]');
2200                            if($e.length > 0){
2201                                let speed = $e[0]['ivswipe'].speed,
2202                                    obj = {};
2203                                obj['name'] = connectName;
2204                                obj['speed'] = speed;
2205                                ivswiperConnect.push(obj);
2206                            }
2207                        });
2208                    }
2209                }
2210                ivswiper.on('slideChange', function () {
2211                    let x = this;
2212                    ivswiperConnect.forEach(function(e,i){
2213                        window[e.name].slideTo(x.realIndex,e.speed,true);
2214                    });
2215                });
2216            }
2217        });
2218    },
2219    /**
2220     * change observer (dom 변화 감지 후 함수 실행)
2221     */
2222    iv_observerFunc : function(callback, config){
2223        const targetNode = this.get(0);
2224        const observer = new MutationObserver(detectChange);
2225        function detectChange(mutationsList, observer) {
2226            if(mutationsList){
2227                observer.disconnect(); 
2228                let result = callback(mutationsList,observer);
2229                if(result !== false){
2230                    setTimeout(function(){
2231                        observer.observe(targetNode, config);
2232                    },0);
2233                }
2234            }
2235        };
2236        observer.observe(targetNode, config);
2237    },
2238    iv_replaceTag : function(newTag) {
2239        var originalElement = this[0];
2240        if(typeof originalElement !== 'undefined'){
2241            var originalTag = originalElement.tagName.toLowerCase()
2242            , startRX = new RegExp('^<'+originalTag, 'i')
2243            , endRX = new RegExp(originalTag+'>$', 'i')
2244            , startSubst = '<'+newTag
2245            , endSubst = newTag+'>'
2246            , newHTML = originalElement.outerHTML
2247            .replace(startRX, startSubst)
2248            .replace(endRX, endSubst);
2249            this.replaceWith(newHTML);
2250        }
2251    },
2252});
2253
2254/**
2255 * menu list call
2256 */
2257var IVBaseMenuCall = IVBaseMenuCall || {
2258    __IV_DEFAULT_VALUE_FUNCTION_USE : true,
2259    __IV_DEFAULT_VALUE_AJAX_URL : '/exec/front/Product/SubCategory', 
2260    __IV_DEFAULT_VALUE_PRINT_ELEMENT : ['[data-ivcate-type]'], 
2261    __IV_DEFAULT_VALUE_SUBCATEGORY_DATA_ORIGINAL : [] || {},
2262    __IV_DEFAULT_VALUE_SUBCATEGORY_DATA : [] || {},
2263    __IV_DEFAULT_VALUE_LOCATION_HAS_CATE_PARAM : (IV_LOCATION_PARAMETERS.indexOf('cate_no=') > -1 ) ? true : false,
2264    __IV_DEFAULT_VALUE_LOCATION_NOW_CATE : null, 
2265    __IV_DEFAULT_VALUE_SUBCATEGORY_MAX_DEPTH : null,
2266    __IV_DEFAULT_VALUE_SUBCATEGORY_TYPE_LIST : [ 
2267        {type : 'allView_hover', allCateSet : 2,viewNextSet: 1}, 
2268        {type : 'allView_slide', allCateSet : 1,viewNextSet: 1},
2269        {type : 'currentView_list_full', allCateSet : 1,viewNextSet: 1},
2270        {type : 'currentView_list_under', allCateSet : 1,viewNextSet: 1}, 
2271        {type : 'currentView_list_select', allCateSet : 0,viewNextSet: 1}
2272    ],
2273    __IV_DEFAULT_VALUE_SUBCATEGORY_ALL_TXT : 'All',
2274    init : function(){
2275        return new Promise(function (res, rej) {
2276            /* 변경 세팅값 있으면 변경해줌 */
2277            if(typeof IV_CATE_LINK_SETTING !== 'undefined'){
2278                IV$.each(IV_CATE_LINK_SETTING, function(k, v){
2279                    if(typeof IVBaseMenuCall[k] === 'object'){
2280                        IVBaseMenuCall[k] = IV$.extend(true, IVBaseMenuCall[k], v);
2281                    }else{
2282                    	IVBaseMenuCall[k] = v;
2283                    };
2284                });
2285            };
2286            if(IVBaseMenuCall.__IV_DEFAULT_VALUE_FUNCTION_USE){
2287                if(IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA.length == 0){
2288                    IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE =  (IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_HAS_CATE_PARAM) ? Number(iv_util.getParameterByName(IV_LOCATION_HREF, 'cate_no')) : null;
2289                    /**
2290                     * ajax 호출 진행 (data)
2291                     */
2292                    IV$.ajax({
2293                        url : IVBaseMenuCall.__IV_DEFAULT_VALUE_AJAX_URL,
2294                        dataType: 'json',
2295                        success: function(aData) {
2296                            if (aData == null || aData == 'undefined') return;
2297                            let aDataClone = aData.slice(),
2298                                allCateLength = aDataClone.length,
2299                                prefix = '__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_',
2300                                prefix2 = '__IV_DEFAULT_VALUE_CATE_LIST_',
2301                                verify_number = 1,
2302                                verifyNumber = 1;
2303                            (findDepthCategory = function(num, cateDepth){
2304                                if(typeof num === 'undefined'){
2305                                	num = verifyNumber;
2306                                    cateDepth = 1;
2307                                }else{
2308                                	cateDepth = cateDepth + 1;
2309                                }
2310                                verifyNumber = cateDepth;
2311                                var dataFilterResult = aDataClone.filter(function(el,idx) { 
2312                                    if(el.parent_cate_no == num){
2313                                        return true;
2314                                    }
2315                                });
2316                                if(dataFilterResult.length > 0){
2317                                    dataFilterResult.forEach(function(data,i){
2318                                        var dataCateNo = data.cate_no,
2319                                            parentCateNo = data.parent_cate_no;
2320                                        var testdata= Object.assign({}, data);
2321                                        IVBaseMenuCall['__IV_DEFAULT_VALUE_SUBCATEGORY_DATA_ORIGINAL'][dataCateNo] = testdata;
2322                                        IV$.extend(data, {cate_depth : cateDepth});
2323                                        if(typeof IV_CATE_LINK_CUSTOM !== 'undefined') {
2324                                            IV_CATE_LINK_CUSTOM.some(function(v, idx, arr) { 
2325                                                if(v.cate_no == data.cate_no) {
2326                                                    IV$.extend(data, arr[idx]); 
2327                                                    arr.splice(idx,1); 
2328                                                    return true; 
2329                                                };
2330                                            });
2331                                        }
2332                                        let name = prefix + cateDepth;
2333                                        if(! IVBaseMenuCall[name]) IVBaseMenuCall[name] = [];
2334                                        IVBaseMenuCall[name][dataCateNo] = data;
2335                                        IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA.push(data);
2336                                        findDepthCategory(dataCateNo, cateDepth);
2337                                    });
2338                                }
2339                            })();
2340                            IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_MAX_DEPTH = verifyNumber;
2341                            var remainData = aDataClone.filter(function(el,idx) { 
2342                                if(typeof el.cate_depth === 'undefined'){
2343                                    return true;
2344                                }
2345                            });
2346                            if(remainData.length > 0){
2347                                IVBaseMenuCall[prefix + '_undefined'] = [];
2348                                for(let i=0; i<remainData.length; i++){
2349                                    IV$.extend(remainData[i], {cate_depth : 'undefined'});
2350                                    IVBaseMenuCall[prefix + '_undefined'][remainData[i].cate_no] = remainData[i];
2351                                    IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA.push(remainData[i]);
2352                                };
2353                            }
2354                            res(IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA);
2355                        },
2356                    });
2357                }else{
2358                    res(IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA);
2359                };
2360            }else{
2361                let obj = {};
2362                res(obj);
2363            };
2364        });
2365    },
2366    printList : function(){
2367        IVBaseMenuCall.init().then(function(res){
2368            let data = res;
2369            IVBaseMenuCall.__IV_DEFAULT_VALUE_PRINT_ELEMENT.forEach(function(e, i){
2370                IV$(e).each(function(idx, item){
2371                    let $baseMenuWrapper = IV$(item);
2372                    if(i == 0 && idx == 0){
2373                        $baseMenuWrapper.find('.menu_1li').each(function(){
2374                            let $menu1li = IV$(this);
2375                            let cate_no_chk = $menu1li.attr('data-cate');
2376                            if($baseMenuWrapper.find('.menu_1li[data-cate="'+ cate_no_chk +'"]').length > 0){
2377                                IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_DATA.filter(function(e,i){
2378                                    if(e.cate_no === Number(cate_no_chk)){
2379                                        IV$.extend(e,{is_main: true});
2380                                    };
2381                                });
2382                            };
2383                        });
2384                    };
2385                    if(! $baseMenuWrapper.hasClass('done')){
2386                        let dataCateType = $baseMenuWrapper.data('ivcate-type');
2387                        IVBaseMenuCall.custom(data, $baseMenuWrapper, dataCateType);
2388                    };
2389                });
2390            });
2391            let IV_MENU_CALL_END = new CustomEvent('IVMenuCall', {'detail': data });
2392            document.body.dispatchEvent(IV_MENU_CALL_END);
2393        });
2394    },
2395    custom : function(data, $el, type){
2396        switch(true){
2397            case (type.indexOf('allView') != -1) : 
2398                IVBaseMenuCall.allView(data, $el, type);
2399                break;
2400            case (type.indexOf('currentView') != -1) : 
2401                IVBaseMenuCall.currentView(data, $el, type);
2402                break;
2403            default : 
2404                break;
2405        };
2406    },
2407    allView : function(data, $el, type){
2408        let allCateSet = false;
2409        IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_TYPE_LIST.filter(function(el) {
2410            if(el.type == type){
2411                allCateSet = el.allCateSet;
2412            };
2413        });
2414        let dataLength = data.length;
2415        let allCateName = IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_ALL_TXT;
2416        let defaultEventExec = ($el.attr('data-ivcate-event')) ? ($el.attr('data-ivcate-event') === 'false')? false: true : true;
2417        /**
2418         * 카테고리 append
2419         */
2420        for(let i=0; i<dataLength; i++){
2421            let single_data = data[i];
2422            let dataDepth = single_data.cate_depth,
2423                cateNo = single_data['cate_no'],
2424                link = (single_data['custom_link']) ? single_data['custom_link'] : '/' + single_data['design_page_url'] + single_data['param'],
2425                name = (single_data['change_name']) ? single_data['change_name'] : single_data['name'],
2426                addText = (typeof single_data['add_sub_text'] != 'undefined') ? single_data['add_sub_text'] : null,
2427                viewType = (typeof single_data['cate_view_type'] != 'undefined') ? single_data['cate_view_type'] : null,
2428                allCateType = (typeof single_data['all_cate_type'] != 'undefined') ? single_data['all_cate_type'] : null,
2429                isMain = (typeof single_data['is_main'] != 'undefined') ? single_data['is_main'] : false,
2430                $cateEl = null;
2431            if(dataDepth != 'undefined'){
2432                $cateEl = (isMain==true) ? $el.find('[data-cate="'+ cateNo +'"]') : IV$('<li class="menu_'+ dataDepth +'li" data-cate="'+ cateNo +'" data-depth="'+ dataDepth +'"><a href="'+ link +'">'+ name +'</a></li>');
2433                let parentCateNo = single_data.parent_cate_no,
2434                    $parentCateEl = $el.find('[data-cate="'+ parentCateNo +'"]');
2435                if(isMain === false){
2436                    isNotMainCategory();
2437                }else{
2438                    if(dataDepth !== 1){
2439                        if($parentCateEl.length > 0){
2440                            isNotMainCategory();
2441                        }else{
2442                            isMainCategory(); 
2443                        };
2444                    }else{
2445                        isMainCategory();
2446                    };
2447                };
2448                function isMainCategory(){
2449                    $cateEl.children('a').attr('href', link);
2450                    $cateEl.children('a').text(name);
2451                    if(addText != null) $cateEl.addClass('menu_point').children('a').append('<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>');    
2452                    makeAllCate();
2453                };
2454                function isNotMainCategory(){
2455                    let parentCateDepth = Number($parentCateEl.attr('data-depth'));
2456                    dataDepth = parentCateDepth + 1;
2457                    $cateEl = IV$('<li class="menu_'+ dataDepth +'li" data-cate="'+ cateNo +'" data-depth="'+ dataDepth +'"><a href="'+ link +'">'+ name +'</a></li>');
2458                    if( $parentCateEl.children('.menu_'+ dataDepth + 'ul').length == 0 ){ 
2459                        $parentCateEl.append('<ul class="menu_'+ dataDepth + 'ul"></ul>'); 
2460                    }
2461                    if(! $parentCateEl.hasClass('submenu') && ! $parentCateEl.hasClass('hidden_under')) $parentCateEl.not('.menu_virtual').addClass('submenu');
2462                    if(addText != null) $cateEl.addClass('menu_point').children('a').append('<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>');
2463                    $parentCateEl.not('.menu_virtual').children('.menu_'+ dataDepth + 'ul').append($cateEl);
2464                    makeAllCate();
2465                };
2466                if(viewType != null){
2467                    switch(viewType[0]){
2468                        case 0 : /* 해당 카테고리 감춤 */ 
2469                            $cateEl.addClass('displaynone');
2470                            break;
2471                        case 1 : /* 해당 카테고리 하위 계층 안보여줌 */ 
2472                            $cateEl.addClass('hidden_under').removeClass('submenu');
2473                            break;
2474                        default :
2475                            break;
2476                    };
2477                };
2478                /**
2479                 * 전체 카테고리 생성 
2480                 */
2481                function makeAllCate(){
2482                    let makeAllCateView = 0;
2483                    /**
2484                    * 영역별 전체 카테고리 생성 설정 
2485                    */
2486                    switch(allCateSet){
2487                        case 0 : 
2488                            /* 전체 카테고리 생성 없음 */
2489                            break;
2490                        case 1 :
2491                            /* 실하위 카테고리가 하나 이상일때 하위에 전체 메뉴 생성 */
2492                            makeAllCateView = 1;
2493                            break;
2494                        case 2 : 
2495                            /* 실하위 카테고리와 무관하게 하
2495위에 전체 메뉴 생성 */
2496                            makeAllCateView = 2;
2497                            break;
2498                        default : 
2499                            break;
2500                    };
2501                    /**
2502                     * allCateSet 설정과 무관하게 우선적으로 적용되는 전체 카테고리 생성 설정 
2503                     */
2504                    if(allCateType != null){
2505                        switch(allCateType){
2506                            case 0 : 
2507                                makeAllCateView = 0;
2508                                /* 전체 카테고리 생성 없음 */
2509                                break;
2510                            case 1 :
2511                                /* 실하위 카테고리가 하나 이상일때 하위에 전체 메뉴 생성 */
2512                                makeAllCateView = 1;
2513                                break;
2514                            case 2 :
2515                                /* 실하위 카테고리와 무관하게 하위에 전체 메뉴 생성 */
2516                                makeAllCateView = 2;
2517                                break;
2518                            default : 
2519                                break;
2520                        };
2521                    };
2522                    if(makeAllCateView > 0){
2523                        //make all cate ul 
2524                        if(makeAllCateView == 2){
2525                            dataDepth = Number($cateEl.attr('data-depth'));
2526                            if($cateEl.children('.menu_'+ (dataDepth+1) + 'ul').length == 0){
2527                                $cateEl.append('<ul class="menu_'+ (dataDepth+1) + 'ul"></ul>');
2528                            };
2529                        };
2530                        if (makeAllCateView == 1){
2531                            if(typeof IVBaseMenuCall['__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_' + (dataDepth+1)] !== 'undefined'){
2532                                IVBaseMenuCall['__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_' + (dataDepth+1)].some(function(v, idx, arr) { 
2533                                    if(v.parent_cate_no == cateNo) {
2534                                        dataDepth = Number($cateEl.attr('data-depth'));
2535                                        if($cateEl.children('.menu_'+ (dataDepth+1) + 'ul').length == 0){
2536                                            $cateEl.append('<ul class="menu_'+ (dataDepth+1) + 'ul"></ul>');
2537                                        };
2538                                        return true; 
2539                                    };
2540                                });
2541                            };
2542                        };
2543                        //append all cate
2544                        let allCateNameFin;
2545                        if(! allCateName){
2546                            allCateNameFin = name;
2547                            if(addText) allCateNameFin += '<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>';
2548                        }else{
2549                            allCateNameFin = allCateName;
2550                        };
2551                        if($cateEl.children('.menu_'+ (dataDepth+1) + 'ul').length > 0){
2552                            var $cateEl2 = $cateEl.clone();
2553                            $cateEl2.attr('data-depth', dataDepth+1).removeClass().addClass('menu_' + (dataDepth+1) + 'li menu_virtual').children('a').html(allCateNameFin);
2554                            $cateEl.children('.menu_'+ (dataDepth+1) + 'ul').prepend($cateEl2);
2555                            $cateEl.addClass('submenu');
2556                        };
2557                    };
2558                };
2559            };
2560        };
2561        $el.find('ul[class*="menu_"]:empty').remove();
2562        if(defaultEventExec){
2563            switch(type){
2564                case 'allView_slide' :
2565                    $el.find('.submenu > a').attr('href','javascript: void(0);'); 
2566                    $el.find('li[class^="menu"]').off().on('click',function(event){
2567                        //상위전파 막기
2568                        if (event.stopPropagation) event.stopPropagation();
2569                        else event.cancelBubble = true; // IE 대응
2570                        var $clickMenu = IV$(this);
2571                        if($clickMenu.children('ul[class^="menu"]').hasClass('on')){
2572                            $clickMenu.removeClass('on');
2573                            $clickMenu.children('ul[class^="menu"]').hide();
2574                            $clickMenu.children('ul[class^="menu"]').removeClass('on');
2575                        }else{
2576                            $clickMenu.addClass('on');
2577                            $clickMenu.siblings().removeClass('on').find('li[class^="menu"]').removeClass('on');
2578                            $clickMenu.children('ul[class^="menu"]').fadeIn();
2579                            $clickMenu.children('ul[class^="menu"]').addClass('on');
2580                            $clickMenu.siblings().find('ul[class^="menu"]').hide();
2581                            $clickMenu.siblings().find('ul[class^="menu"]').removeClass('on');
2582                        };
2583                    });
2584                    break;
2585                case 'allView_depth' :
2586                    let depth = Number($el.attr('data-ivcate-depth'));
2587                    let $depthCate = $el.find('[data-depth="'+ depth +'"]');
2588                    let $menu1ul = $el.find('.menu_1ul');
2589                    let $depthNameUl = IV$('<ul class="cate_depth_ul" data-depth="'+ depth +'"></ul>');
2590                    $depthCate.each(function(j,y){
2591                        let $y = IV$(y);
2592                        let dataCate = $y.attr('data-cate');
2593                        let subMenu = ($y.hasClass('submenu')) ? 'submenu' : '';
2594                        let $depthName = $y.children('a');
2595                        let newli = IV$('<li class="'+ subMenu +'" data-cate="'+ dataCate +'"></li>');
2596                        if(subMenu == 'submenu'){
2597                            $depthName.attr('href','javascript: void(0);'); 
2598                        };
2599                        newli.append($depthName);
2600                        $depthNameUl.append(newli);
2601                    });
2602                    $depthNameUl.insertBefore($menu1ul);
2603                    $depthNameUl.find('li').off().on('click',function(event){
2604                        //상위전파 막기
2605                        if (event.stopPropagation) event.stopPropagation();
2606                        else event.cancelBubble = true; // IE 대응
2607                        var $clickMenu = IV$(this);
2608                        let dataCate = $clickMenu.attr('data-cate');
2609                        if($clickMenu.hasClass('on')){
2610                            $clickMenu.removeClass('on');
2611                            $menu1ul.find('li[class^="menu"]').filter('[data-cate="'+ dataCate +'"]').removeClass('on');
2612                        }else{
2613                            $clickMenu.addClass('on');
2614                            $clickMenu.siblings().removeClass('on');
2615                            $menu1ul.find('li[class^="menu"]').filter('[data-cate="'+ dataCate +'"]').addClass('on');
2616                            $menu1ul.find('li[class^="menu"]').filter('[data-cate="'+ dataCate +'"]').siblings().removeClass('on');
2617                        };
2618                    });
2619                    break;
2620                default :
2621                    break;
2622            };
2623        };
2624        $el.addClass('done');
2625        let IV_MENU_SINGLE_CALL_END = new CustomEvent('IVMenuCall', {'detail': data });
2626        $el[0].dispatchEvent(IV_MENU_SINGLE_CALL_END);
2627    },
2628    currentView : function(data, $el, type){
2629        if($el.find('.cate_path').length == 0){$el.prepend('<div class="cate_path"><ul></ul></div>');}
2630        if($el.find('.cate_list').length == 0){$el.find('.menu_1ul').wrap('<div class="cate_list"></div>');}
2631        var thisCateNum = $el.attr('data-ivcate-num');
2632        if(! thisCateNum){
2633            thisCateNum = IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE;
2634        };
2635        let allCateSet = false;
2636        let viewNextSet = false;
2637        IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_TYPE_LIST.filter(function(el) {
2638            if(el.type == type){
2639                allCateSet = el.allCateSet;
2640                if(typeof el.viewNextSet !== 'undefined'){
2641                    viewNextSet = el.viewNextSet;
2642                };
2643            };
2644        });
2645        let defaultEventExec = ($el.attr('data-ivcate-event')) ? ($el.attr('data-ivcate-event') === 'false')? false: true : true;
2646        let dataLength = data.length;
2647        let allCateName = IVBaseMenuCall.__IV_DEFAULT_VALUE_SUBCATEGORY_ALL_TXT;
2648        let this_data;
2649        data.filter(function(el) {
2650            if(el.cate_no == thisCateNum){
2651                this_data = el;
2652            };
2653        });
2654        if(this_data){
2655            let this_dataDepth = this_data.cate_depth,
2656                this_cateNo = this_data['cate_no'],
2657                this_link = (this_data['custom_link']) ? this_data['custom_link'] : '/' + this_data['design_page_url'] + this_data['param'],
2658                this_name = (this_data['change_name']) ? this_data['change_name'] : this_data['name'],
2659                this_addText = (this_data['add_sub_text']) ? this_data['add_sub_text'] : null,
2660                this_viewType = (typeof this_data['cate_view_type'] != 'undefined') ? this_data['cate_view_type'] : null,
2661                this_allCateType = (typeof this_data['all_cate_type'] != 'undefined') ? this_data['all_cate_type'] : null,
2662                this_$cateEl = IV$('<li class="menu_'+ this_dataDepth +'li" data-cate="'+ this_cateNo +'" data-depth="'+ this_dataDepth +'"><a href="'+ this_link +'">'+ this_name +'</a></li>');
2663            let this_parentCateNo = this_data.parent_cate_no;
2664            IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo] = [this_data];
2665            /**
2666             * 카테고리 트리 찾기 
2667             */
2668            var pastChk = this_parentCateNo;
2669            ( findCateTreeFunc = function(){
2670                if(pastChk === 1){
2671                    data.filter(function(el) {
2672                        if(el.cate_no == pastChk){
2673                            IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo].unshift(el);
2674                        };
2675                    });
2676                }else{
2677                    let chk = data.filter(function(el) {
2678                        if(el.cate_no == pastChk){
2679                            IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo].unshift(el);
2680                            pastChk = el.parent_cate_no;
2681                            return true;
2682                        };
2683                    });
2684                    if(chk.length > 0){
2685                        findCateTreeFunc();
2686                    };
2687                };
2688            })();
2689            if(typeof IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo] === 'undefind'){
2690                return false;
2691            };
2692            $el.find('.menu_1ul').html('');
2693            IVBaseMenuCall.__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_1.forEach(function(e,i){
2694                let single_data = e,
2695                    dataDepth = single_data.cate_depth,
2696                    cateNo = single_data['cate_no'],
2697                    link = (single_data['custom_link']) ? single_data['custom_link'] : '/' + single_data['design_page_url'] + single_data['param'],
2698                    name = (single_data['change_name']) ? single_data['change_name'] : single_data['name'],
2699                    addText = (single_data['add_sub_text']) ? single_data['add_sub_text'] : null,
2700                    //viewType = (typeof single_data['cate_view_type'] != 'undefined') ? single_data['cate_view_type'] : null,
2701                    allCateType = (typeof single_data['all_cate_type'] != 'undefined') ? single_data['all_cate_type'] : null,
2702                    $cateEl = IV$('<li class="menu_'+ dataDepth +'li" data-cate="'+ cateNo +'" data-depth="'+ dataDepth +'"><a href="'+ link +'">'+ name +'</a></li>');
2703                $el.find('.menu_1ul').append($cateEl);
2704            });
2705            /**
2706             * 카테고리 append
2707             */
2708            for(let i=0; i<dataLength; i++){
2709                let single_data = data[i],
2710                    dataDepth = single_data.cate_depth,
2711                    cateNo = single_data['cate_no'],
2712                    link = (single_data['custom_link']) ? single_data['custom_link'] : '/' + single_data['design_page_url'] + single_data['param'],
2713                    name = (single_data['change_name']) ? single_data['change_name'] : single_data['name'],
2714                    addText = (typeof single_data['add_sub_text'] !== 'undefined') ? single_data['add_sub_text'] : null,
2715                    //viewType = (typeof single_data['cate_view_type'] != 'undefined') ? single_data['cate_view_type'] : null,
2716                    allCateType = (typeof single_data['all_cate_type'] != 'undefined') ? single_data['all_cate_type'] : null,
2717                    $cateEl = (dataDepth == 1) ? $el.find('[data-cate="'+ cateNo +'"]') : IV$('<li class="menu_'+ dataDepth +'li" data-cate="'+ cateNo +'" data-depth="'+ dataDepth +'"><a href="'+ link +'">'+ name +'</a></li>');
2718                let test =  '__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_' +  (dataDepth-1);
2719                let parentCateNo = single_data.parent_cate_no,
2720                    $parentCateEl = $el.find('[data-cate="'+ parentCateNo +'"]');
2721                if(dataDepth != 'undefined'){
2722                    let pathTreeArray = IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo].slice();
2723                    if(parentCateNo != this_parentCateNo && dataDepth < this_dataDepth){
2724                        //상위 카테고리
2725                        if(pathTreeArray.length > 0) makeCatePathFunc(); 
2726                        if(parentCateNo == 1) makeCate();
2727                    }else if(parentCateNo == this_parentCateNo && dataDepth == this_dataDepth){
2728                        //동일 계층 카테고리
2729                        if(cateNo == this_cateNo) makeCatePathFunc();
2730                        else makeCate(); 
2731                    }else if (parentCateNo != this_parentCateNo && dataDepth > this_dataDepth){
2732                        //직계 하위 카테고리 
2733                        if(parentCateNo == this_cateNo) {
2734                            if(typeof IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_NEXT_DEPTH_CATE_FROM_' + this_cateNo] === 'undefined') IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_NEXT_DEPTH_CATE_FROM_' + this_cateNo] = [];
2735                            IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_NEXT_DEPTH_CATE_FROM_' + this_cateNo].push(single_data);
2736                            makeCate();
2737                        };
2738                    } ;
2739
2740                    /**
2741                     * 경로 생성 + 카테고리 생성 
2742                     */
2743                    function makeCatePathFunc(){
2744                        pathTreeArray.some(function(v, idx, arr) { 
2745                            if(v.cate_no == cateNo) {
2746                                pathTreeArray.splice(idx,1);
2747                                if(parentCateNo != 1 || (parentCateNo == 1 && cateNo == this_cateNo)){
2748                                    makeCate();
2749                                }
2750                                $el.find('[data-cate="'+ cateNo +'"]').addClass('selected');
2751                                if($el.find('[data-cate="'+ cateNo +'"]').prevAll('.menu_virtual').hasClass('selected')){
2752                                    $el.find('[data-cate="'+ cateNo +'"]').prevAll('.menu_virtual').removeClass('selected');
2753                                };
2754                                makeAllCate();
2755                                let parent_data = v,
2756                                    p_link = (parent_data['custom_link']) ? parent_data['custom_link'] : '/' + parent_data['design_page_url'] + parent_data['param'],
2757                                    p_name = (parent_data['change_name']) ? parent_data['change_name'] : parent_data['name'],
2758                                    p_addText = (parent_data['add_sub_text']) ? parent_data['add_sub_text'] : null,
2759                                    p_viewType = (parent_data['cate_view_type']) ? parent_data['cate_view_type'] : null;
2760                                $el.find('.cate_path ul').append('<li data-path="'+cateNo+'"><a href="'+ p_link +'">'+ p_name +'</a></li>');
2761                                return true; 
2762                            };
2763                        });
2764                    };
2765                    /**
2766                     * 카테고리 생성
2767                     */
2768                    function makeCate (){
2769                        if(dataDepth != 1){
2770                            if( $el.find('.cate_list').find('.menu_'+ dataDepth + 'ul').length == 0 ){ 
2771                                $el.find('.cate_list').append('<ul class="menu_'+ dataDepth + 'ul"></ul>'); 
2772                            };
2773                            if(! $parentCateEl.hasClass('submenu')) $parentCateEl.addClass('submenu');
2774                            if(addText != null) $cateEl.addClass('menu_point').children('a').append('<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>');
2775                            $el.find('.menu_'+ dataDepth + 'ul').append($cateEl);
2776                        }else{
2777                            $cateEl.children('a').attr('href', link);
2778                            $cateEl.children('a').text(name);
2779                            if(addText != null) $cateEl.addClass('menu_point').children('a').append('<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>');
2780                        };
2781                    };
2782                    /**
2783                     * 전체 카테고리 생성 
2784                     */
2785                    function makeAllCate(){
2786                        let makeAllCateView = 0;
2787                        /**
2788                        * 영역별 전체 카테고리 생성 설정 
2789                        */
2790                        switch(allCateSet){
2791                            case 0 : 
2792                                /* 전체 카테고리 생성 없음 */
2793                                break;
2794                            case 1 :
2795                                /* 실하위 카테고리가 하나 이상일때 하위에 전체 메뉴 생성 */
2796                                makeAllCateView = 1;
2797                                break;
2798                            case 2 : 
2799                                /* 실하위 카테고리와 무관하게 하
2799위에 전체 메뉴 생성 */
2800                                makeAllCateView = 2;
2801                                break;
2802                        };
2803                        /**
2804                         * allCateSet 설정과 무관하게 우선적으로 적용되는 전체 카테고리 생성 설정 
2805                         */
2806                        if(allCateType != null){
2807                            switch(allCateType){
2808                                case 0 : 
2809                                    makeAllCateView = 0;
2810                                    /* 전체 카테고리 생성 없음 */
2811                                    break;
2812                                case 1 :
2813                                    /* 실하위 카테고리가 하나 이상일때 하위에 전체 메뉴 생성 */
2814                                    makeAllCateView = 1;
2815                                    break;
2816                                case 2 :
2817                                    /* 실하위 카테고리와 무관하게 하위에 전체 메뉴 생성 */
2818                                    makeAllCateView = 2;
2819                                    break;
2820                            };
2821                        };
2822                        if(makeAllCateView > 0){
2823                            //make all cate ul 
2824                            if(makeAllCateView == 2){
2825                                if($el.find('.cate_list .menu_'+ (dataDepth+1) + 'ul').length == 0){
2826                                    $el.find('.cate_list').append('<ul class="menu_'+ (dataDepth+1) + 'ul"></ul>'); 
2827                                };
2828                            };
2829                            if ( makeAllCateView == 1){
2830                                if(IVBaseMenuCall['__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_' + (dataDepth+1)]){
2831                                    IVBaseMenuCall['__IV_DEFAULT_VALUE_CATE_LIST_DEPTH_' + (dataDepth+1)].some(function(v, idx, arr) { 
2832                                        if(v.parent_cate_no == cateNo) {
2833                                            if($el.find('.cate_list .menu_'+ (dataDepth+1) + 'ul').length == 0){
2834                                                $el.find('.cate_list').append('<ul class="menu_'+ (dataDepth+1) + 'ul"></ul>'); 
2835                                            };
2836                                            return true; 
2837                                        };
2838                                    });
2839                                };
2840                            };
2841                            //append all cate
2842                            let allCateNameFin;
2843                            if(! allCateName){
2844                                allCateNameFin = name;
2845                                if(addText) allCateNameFin += '<span class="add_txt" data-txt="'+ addText +'">'+ addText +'</span>';
2846                            }else{
2847                                allCateNameFin = allCateName;
2848                            };
2849                            if($el.find('.cate_list .menu_'+ (dataDepth+1) + 'ul').length > 0){
2850                                var $cateEl2 = $cateEl.clone();
2851                                $cateEl2.attr('data-depth', dataDepth+1).removeClass().addClass('menu_' + (dataDepth+1) + 'li menu_virtual selected').children('a').html(allCateNameFin);
2852                                $el.find('.cate_list .menu_'+ (dataDepth+1) + 'ul').append($cateEl2);
2853                            };
2854                        };
2855                    };
2856                };
2857            };
2858            switch(viewNextSet){
2859                case 0 :
2860                    if(typeof IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_NEXT_DEPTH_CATE_FROM_' + this_cateNo] === 'undefined'){
2861                        $el.addClass('displaynone');
2862                    }
2863                    break;
2864                default :
2865                    break;
2866            };
2867            if(this_viewType != null){
2868                switch(this_viewType[1]){
2869                    case 0 : /* 해당 카테고리로 기준 시, 모든 영역 감춤 */ 
2870                        $el.addClass('displaynone');
2871                        break;
2872                    case 1 : /* 해당 카테고리로 기준 시, 동일 계층 보여줌 (하위 카테 있어도 안 보여줌) */ 
2873                        $el.find('.cate_list').find('ul[class="menu_'+ (this_dataDepth+1)+'ul"]').remove();
2874                        $el.removeClass('displaynone');
2875                        break;
2876                };
2877            };
2878            $el.addClass('done');
2879            if(defaultEventExec){
2880                switch(type){
2881                    case 'currentView_list_full' :
2882                        break;
2883                    case 'currentView_list_under' :
2884                        break;
2885                    case 'currentView_list_select' :
2886                        $el.find('ul[class^="menu_"]').each(function(){
2887                            let $menu_ul = IV$(this);
2888                            if($menu_ul.find('.selected').length > 0){
2889                                var menuClass = iv_util.onlyNumbFunc($menu_ul.attr('class'));
2890                                var menuHeight = $menu_ul.outerHeight();
2891                                IV$(this).wrap('<div class="menu_'+ menuClass +'div"></div>');
2892                                IV$(this).before('<h4 class="current_cate"></h4>');
2893                                IV$(this).prev('h4').html(IV$(this).find('.selected').html());
2894                                IV$(this).attr('style', 'max-height: '+ menuHeight + 'px');
2895                                if(menuHeight == 0){
2896                                    IV$(this).prev('h4').addClass('noBg');
2897                                    IV$(this).prev('h4').find('a').addClass('noEvent');
2898                                }else{
2899                                    IV$(this).prev('h4').find('a').attr('href','javascript:void(0);');
2900                                };
2901                            }else{
2902                                $menu_ul.addClass('displaynone');
2903                            };
2904                        });
2905                        $el.find('h4 a:not(.noEvent)').on('click',function(){
2906                            if(IV$(this).closest('div').hasClass('on')){
2907                                IV$(this).closest('div').removeClass('on');
2908                            }else{
2909                                $el.find('div[class^="menu_"]').not(IV$(this).closest('div')).removeClass('on');
2910                                IV$(this).closest('div').addClass('on');
2911                                iv_util.targetOutCloseFunc(IV$(this).closest('div'));
2912                            };
2913                        });
2914                        $el.find('div[class^="menu_"]').each(function(){
2915                            IV$(this).iv_observerFunc(function () {
2916                                setTimeout(function(){
2917                                    if($el.find('div[class^="menu_"].on').length > 0){
2918                                        $el.addClass('on');
2919                                    }else{
2920                                        $el.removeClass('on');
2921                                    };
2922                                },0);
2923                            }, {
2924                                attributes: true,
2925                                childList: false,
2926                                subtree: false
2927                            });
2928                        });
2929                        break;
2930                    default :
2931                        break;
2932                };
2933            };
2934            let IV_MENU_SINGLE_CALL_END = new CustomEvent('IVMenuCall', {'detail': IVBaseMenuCall['__IV_DEFAULT_VALUE_CURRENT_CATE_STANDARD_NO_' + this_cateNo] });
2935            $el[0].dispatchEvent(IV_MENU_SINGLE_CALL_END);
2936        }
2937    },
2938};
2939
2940
2941
2942/**
2943 * swiper 
2944 */
2945var IVSwiperFunc = IVSwiperFunc || function(){
2946    let count = 0;
2947    let $ivSwiper = IV$('.iv_swiper');
2948    if($ivSwiper.length > 0){
2949        return new Promise(function (res, rej) {
2950            $ivSwiper.iv_swiperFunc();
2951            res(true);
2952        }).then(function(res) {
2953            if($ivSwiper.filter('[data-ivswipe-connect]').length > 0){
2954                $ivSwiper.filter('[data-ivswipe-connect]').iv_swiperConnectFunc();
2955            };
2956            if(typeof IVPrdDynamicCall !== 'undefined'){
2957                IVPrdDynamicCall.init();
2958            };
2959        });
2960    }else{
2961        if(typeof IVPrdDynamicCall !== 'undefined'){
2962            IVPrdDynamicCall.init();
2963        };
2964    };
2965};
2966
2967/**
2968 * 상품별 실행 : document ready 이후 실행해야 정상 동작합니다.
2969 * 상품 개별 영역 / 페이지 기준(ex 상품 상세/상품 선택창) 공통으로 사용 중
2970 */
2971var IVbasePrdInfoCall = IVbasePrdInfoCall || {
2972    __IV_DEFAULT_VALUE_FUNCTION_USE : false,
2973    __IV_DEFAULT_VALUE_PRC_CALC_USE : false, //할인율 계산 함수를 사용할 것인지 여부 : 쓰지 않을 경우 false로 바꾸고 개별적으로 지정하세요.
2974    __IV_DEFAULT_VALUE_PRC_ITEM_LIST: [
2975        {name: 'customPrice', element : '[id^="product_prc_custom"]'},
2976        {name: 'sellPrice', element : '[id^="product_prc_sell"]'},
2977        {name: 'promoPrice', element : '[id^="product_prc_promo"]'},
2978    ], // name : (example) + Price, value : [id^="product_prc_(example)"] / (example) 부분은 동일해야 합니다. & data-prc가 필요합니다.
2979    __IV_DEFAULT_VALUE_PRC_PAGE_LIST: [
2980        {name: 'customPrice', element : '#IV_ForFIndPrdDetailInfo #product_prc_custom_page'},
2981        {name: 'sellPrice', element : '#IV_ForFIndPrdDetailInfo #product_prc_sell_page'},
2982        {name: 'promoPrice', element : '#IV_ForFIndPrdDetailInfo #product_prc_promo_page'},
2983    ], // name : (example) + Price, value : 기준점이 될 요소 / (example) 부분 item list의 name값과 동일해야 합니다. & data-prc가 필요합니다.
2984    __IV_DEFAULT_VALUE_PRC_PAGE_PRINT_ELEMENT : [
2985        '.iv_prc_infoBox',
2986    ], // page 기준으로 출력하는 경우 출력해야 되는 요소 기준점
2987    __IV_DEFAULT_VALUE_PRC_CALC_STANDARD : [
2988        {oriEl: 'sellPrice', finEl: 'promoPrice'},
2989        {oriEl: 'customPrice', finEl: 'sellPrice'},
2990    ], //계산 기준 (순차실행이므로 각 쇼핑몰 계산 우선순위 맞춰서 배열에 넣어주세요)
2991    __IV_DEFAULT_VALUE_PRC_CALC_DECIMAL_SET : function(ori, fin){
2992        return Math.ceil(((ori - fin) / ori) * 100);
2993    }, //할인율 계산식 입력하시면 됩니다
2994    calc : function(el){
2995        if(IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_CALC_USE){
2996            if(! el){
2997                IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_PAGE_PRINT_ELEMENT.forEach(function(el,idx){ 
2998                    var el = IV$(el); 
2999                    if(el.length > 0){
3000                        IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_PAGE_LIST.forEach(function(e,i){
3001                            //모바일 환경 오류로 인한 수정
3002                            if(IV$(e.element).attr('content')){
3003                                if(IV$(e.element).attr('content').indexOf('(') > -1){
3004                                    IV$(e.element).attr('content', IV$(e.element).attr('content').split('(')[0]);
3005                                    IV$(e.element).attr('data-prc',IV$(e.element).attr('content').split('(')[0] );
3006                                };
3007                            };
3008                            el[e.name] = (IV$(e.element).length > 0) ? IV$(e.element).attr('data-prc') : 0;
3009                            if(el[e.name]){
3010                                el[e.name] = (el[e.name].indexOf('.') > -1) ? Math.floor(el[e.name]) : iv_util.onlyNumbFunc(el[e.name]);
3011                            };
3012                            IV$(e.element).attr('data-prc', el[e.name]);
3013                        });
3014                        prcCalc(el); 
3015                    };
3016                });
3017            }else{
3018                IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_ITEM_LIST.forEach(function(e,i){
3019                    el[e.name] =  (el.find(e.element).length > 0) ? el.find(e.element).attr('data-prc') : 0;
3020                    if(el[e.name]){ el[e.name] = (el[e.name].indexOf('.') > -1) ? Math.floor(el[e.name]) : iv_util.onlyNumbFunc(el[e.name]); }
3021                    el.find(e.element).attr('data-prc', el[e.name]);
3022                });
3023                prcCalc(el);
3024            };
3025            function prcCalc(el){
3026                var calcChk = false;
3027                IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_CALC_STANDARD.some(function(v, i, arr){
3028                    var $ori = '.base_prc_' + v.oriEl.split('Price')[0];
3029                    var $fin = '.base_prc_' + v.finEl.split('Price')[0];
3030                    //요소가 모두 있는지, 0은 아닌지, 최종값이 기본값보다 작은지 
3031                    if( el[v.oriEl] && el[v.finEl] &&  el[v.finEl] < el[v.oriEl] ){
3032                        var discountRatio = IVbasePrdInfoCall.__IV_DEFAULT_VALUE_PRC_CALC_DECIMAL_SET(el[v.oriEl], el[v.finEl]);
3033                        el.find('.base_prc_item .desc:not('+ $ori +'):not('+ $fin +')').text('');
3034                        el.find('.base_prc_item .desc:not('+ $ori +'):not('+ $fin +')').closest('.base_prc_item').addClass('displaynone');
3035                        el.find($ori).text(iv_util.comma(el[v.oriEl]));
3036                        el.find($fin).text(iv_util.comma(el[v.finEl]));
3037                        el.find($ori).closest('.base_prc_item').addClass('discount').removeClass('displaynone');
3038                        el.find($fin).closest('.base_prc_item').removeClass('displaynone');
3039                        el.find($fin).before('<span id="discount_ratio"><span class="desc">'+discountRatio+'%</span></span>');
3040                        calcChk = true;
3041                        return true; //가격 계산되면 그만돌림
3042                    };
3043                });
3044                if(! calcChk){
3045                    el.find('.base_prc_item .desc:not(.base_prc_sell)').text('');
3046                    el.find('.base_prc_item .desc:not(.base_prc_sell)').closest('.base_prc_item').addClass('displaynone');
3047                    el.find('.base_prc_sell').text(iv_util.comma(el['sellPrice']));
3048                    el.find('.base_prc_sell').closest('.base_prc_item').removeClass('displaynone');
3049                };
3050            };
3051        }else{
3052            console.log('이 함수를 사용하려면 변수값을 변경하세요.');
3053        };
3054    },
3055    iconChange : function(el){
3056        /**
3057     	 * 상품 아이콘 변경 / iv_promotion_icons 요소 필요
3058     	 */
3059        if(! el){
3060            el = IV$('body');
3061        }
3062        el.find('.iv_promotion_icons img').each(function(){
3063            var $icon = IV$(this);
3064            if($icon.css('display') != 'none'){
3065                var src = $icon.attr('src');
3066                //아이콘 출력 오류 시 제거
3067                if($icon.hasClass('displaynone') == false){
3068                    var img = new Image();
3069                    img.onerror = function() {
3070                        $icon.remove();
3071                    };
3072                    img.src = src;
3073                };
3074                var replaceTxt;
3075                IV_ICONS_CUSTOM.forEach(function(e,i){
3076                    if(src.indexOf(e.src) > -1){
3077                        $icon.after('<span class="icon_txt" data-type="'+ e.replaceTxt +'">'+ e.replaceTxt +'</span>');
3078                        $icon.addClass('displaynone');
3079                    };
3080                });
3081            };
3082        });
3083    },
3084    basketConfirmChk : function(el){
3085        if(typeof el === 'undefined'){
3086            el = IV$('[onClick*="/exec/"][onClick*="submit(2"]'); //장바구니 버튼
3087            let onClickList = el.attr('onClick');
3088            el.attr('onClick', 'basketConfirmShow(); ' + onClickList);
3089        }else{
3090            let basketButtonActionEl = el.find('.ec-admin-icon');
3091            let basketButtonEvent = basketButtonActionEl.attr('onClick');
3092            if(basketButtonEvent){
3093                if(basketButtonEvent.indexOf('CAPP_SHOP_NEW_PRODUCT_OPTIONSELECT') > -1){
3094                    basketButtonActionEl.closest('[onclick*="basketConfirmShow"]').removeAttr('onClick');
3095                };
3096            };
3097        };
3098    },
3099};
3100
3101
3102/**
3103 * 상품별 실행 함수 
3104 */
3105var IVPrdItemInfoCall = IVPrdItemInfoCall || {
3106    __IV_DEFAULT_VALUE_FUNCTION_USE : false, //상품 영역 함수 전체 사용 여부
3107    __IV_DEFAULT_VALUE_PRC_CALC_USE : false, //상품 영역 할인율 계산 사용 여부
3108    __IV_DEFAULT_VALUE_ICON_CHANGE_USE : false, //상품 영역 아이콘 변경 사용 여부 
3109    __IV_DEFAULT_VALUE_CUSTOM_FUNCTION_USE : false, //상품 영역 커스텀 함수 사용 여부
3110    __IV_DEFAULT_VALUE_BASKETCONFIRM_FUNCTION_USE : false, //상품 영역 장바구니 확인창 수정 함수 사용 여부 
3111    init : function(callback, el){
3112        if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_FUNCTION_USE){
3113            if (arguments.length == 0) {
3114                callback = null;
3115                el = null;
3116            }else if(arguments.length == 1 && typeof arguments[0] !== 'function'){
3117                el = arguments[0];
3118                callback = null;
3119            }else{
3120            	el = null;
3121            }
3122            if(el === null){
3123                el = IV$('.base_prd_list [id^="anchorBoxId_"]');
3124            };
3125            el.each(function(){
3126                var $this = IV$(this);
3127                if(! $this.hasClass('done')){
3128                    // * ============================ 상품 가격 ============================ * //
3129                    if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_PRC_CALC_USE){ IVbasePrdInfoCall.calc($this); }
3130                    // * ============================ 상품 가격 ============================ * //
3131                    // * ===================== 프로모션 아이콘 ======================= * //
3132                    if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_ICON_CHANGE_USE){ IVbasePrdInfoCall.iconChange($this); }
3133                    // * ===================== 프로모션 아이콘 ======================= * //
3134                    // * ===================== 추가 커스텀 함수 ======================= * //
3135                    if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION_USE){ if(callback !== null){ callback($this); } }
3136                    // * ===================== 추가 커스텀 함수 ======================= * //
3137                    // * ============================ 상품 담기 옵션창 ============================ * //
3138                    if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_BASKETCONFIRM_FUNCTION_USE){
3139                        IVbasePrdInfoCall.basketConfirmChk($this);
3140                    }
3141                    // * ============================ 상품 담기 옵션창 ============================ * //
3142                    $this.addClass('done');
3143                };
3144            });
3145        }else{
3146            console.log('이 함수를 사용하려면 변수값을 변경하세요.');
3147        };
3148    },
3149};
3150
3151/**
3152 * 페이지별 실행 함수 
3153 */
3154var IVPrdPageInfoCall = IVPrdPageInfoCall || {
3155    __IV_DEFAULT_VALUE_FUNCTION_USE : false, //페이지 기준 함수 전체 사용 여부
3156    __IV_DEFAULT_VALUE_PRC_CALC_USE : false, //페이지 기준 할인율 계산 사용 여부
3157    __IV_DEFAULT_VALUE_ICON_CHANGE_USE : false, //페이지 기준 아이콘 변경 사용 여부 
3158    __IV_DEFAULT_VALUE_CUSTOM_FUNCTION_USE : false, //페이지 기준 커스텀 함수 사용 여부
3159    __IV_DEFAULT_VALUE_BASKETCONFIRM_FUNCTION_USE : false, //페이지 기준 장바구니 확인창 수정 함수 사용 여부 
3160    init : function(callback){
3161        if(IVPrdPageInfoCall.__IV_DEFAULT_VALUE_FUNCTION_USE){
3162            if (arguments.length == 0) {
3163                callback = null;
3164            }
3165            // * ============================ 상품 가격 ============================ * //
3166            if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_PRC_CALC_USE){ IVbasePrdInfoCall.calc(); }
3167            // * ============================ 상품 가격 ============================ * //
3168            // * ===================== 프로모션 아이콘 ======================= * //
3169            if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_ICON_CHANGE_USE){ IVbasePrdInfoCall.iconChange(); }
3170            // * ===================== 프로모션 아이콘 ======================= * //
3171            // * ===================== 추가 커스텀 함수 ======================= * //
3172            if(IVPrdItemInfoCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION_USE){ if(callback !== null){ callback(); } }
3173            // * ===================== 추가 커스텀 함수 ======================= * //
3174            // * ============================ 상품 담기 옵션창 ============================ * //
3175            if(IVPrdPageInfoCall.__IV_DEFAULT_VALUE_BASKETCONFIRM_FUNCTION_USE){
3176                IVbasePrdInfoCall.basketConfirmChk();
3177            }
3178            // * ============================ 상품 담기 옵션창 ============================ * //
3179        }else{
3180            console.log('이 함수를 사용하려면 변수값을 변경하세요.');
3181        };
3182    },
3183};
3184
3185/** 
3186 * mcustomScrollbar
3187 */
3188var IVmcustomScrollbar = IVmcustomScrollbar || function() {
3189    $(".iv_mcustomScrollbar").each(function () {
3190        let e = $(this);
3191        try {
3192            0 == e.hasClass("mCustomScrollbar") && e.mCustomScrollbar({
3193                axis: "y",
3194                theme: "minimal-dark",
3195                alwaysShowScrollbar: 0,
3196                callbacks: {
3197                    onInit:function(){
3198                        let $scrollBox = e.find(".mCustomScrollBox");
3199                        let $scrollContent = e.find(".mCSB_container");
3200                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3201                        (gap < 10) ? e.find(".mCSB_scrollTools").addClass("layout-hidden") : e.find(".mCSB_scrollTools").removeClass("layout-hidden");
3202                    },
3203                    onBeforeUpdate: function () {
3204                        let $scrollBox = e.find(".mCustomScrollBox");
3205                        let $scrollContent = e.find(".mCSB_container");
3206                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3207                        (gap < 10) ? e.find(".mCSB_scrollTools").addClass("layout-hidden") : e.find(".mCSB_scrollTools").removeClass("layout-hidden");
3208                    },
3209                    onScrollStart: function () {
3210                        let $scrollBox = e.find(".mCustomScrollBox");
3211                        let $scrollContent = e.find(".mCSB_container");
3212                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3213                        (gap < 10) ? e.find(".mCSB_scrollTools").addClass("layout-hidden") : e.find(".mCSB_scrollTools").removeClass("layout-hidden");
3214                    }
3215                }
3216            });
3217        } catch (err) {
3218            console.log(err);
3219            IV$ = window.IV$ = jQuery.noConflict(true); 
3220        };
3221    });
3222};
3223
3224/**
3225 * 옵션 수정 레이어 열림 함수
3226 */
3227var IVoptionModifyLayer = IVoptionModifyLayer || function(el){
3228    let $el = IV$(el);
3229    let onClickInfo = $el.attr('onClick');
3230    let findElReg = /\(\'.*\'/g;
3231    let layerName;
3232    let result = onClickInfo.match(findElReg)[0];
3233    layerName = (result.indexOf('#') > -1) ? result.substring(3,result.length-1) : result.substring(2,result.length-1);
3234    let customChk = false;
3235    if(IV_SUBCONTAINER_DATA_PAGE == 'orderBasket'){
3236        if(iv_orderBaseFunc.__IV_DEFAULT_VALUE_OPTION_LAYER_FUNC_DEFAULT){
3237            let $modifyLayer = IV$('#ec-basketOptionModifyLayer');
3238            let $modifyLayer2 = null;
3239            switch (IV_DEVICE_CHK) {
3240                case 'pc':
3241                    $modifyLayer.find('.list_body tr').empty();
3242                    let $prd = $el.closest('.list');
3243                    let clone = $prd.clone();
3244                    clone.find('.optionModify').remove();
3245                    if($prd.find('.option_str_list > li').length > 1){
3246                        let optionIndex = iv_util.onlyNumbFunc(layerName.split(',')[0].trim().slice(-2)) + 1;
3247                        clone.find('.option_str_list > li:not(:nth-child('+ optionIndex +'))').remove();
3248                    };
3249                    clone.find('.b_chk').remove();
3250                    $modifyLayer.find('.list_body').html(clone);
3251                    $modifyLayer.addClass('on');
3252                    $modifyLayer.find('.iv_close_button, [class^="btnClose"], [class*="close"]').on('click',function(){
3253                        iv_util.scrollEnabled();
3254                    });
3255                    iv_util.scrollDisabled($modifyLayer);
3256                    break;
3257                case 'mobile':
3258                    $modifyLayer.addClass('on');
3259                    $modifyLayer.find('.iv_close_button, [class^="btnClose"], [class*="close"]').on('click',function(){
3260                        iv_util.scrollEnabled();
3261                    });
3262                    iv_util.scrollDisabled($modifyLayer);
3263                    break;
3264                default:
3265                    console.log('error');
3266                    break;
3267            };
3268        }else{
3269            let $modifyLayer = IV$('#ec-basketOptionModifyLayer');
3270            let openFunction = $modifyLayer[0].iv_openCustomFunction;
3271            let closeFunction = $modifyLayer[0].iv_closeCustomFunction;
3272            switch (IV_DEVICE_CHK) {
3273                case 'pc':
3274                    $modifyLayer.find('.list_body tr').empty();
3275                    let $prd = $el.closest('.list');
3276                    let clone = $prd.clone();
3277                    clone.find('.optionModify').remove();
3278                    clone.find('.b_chk').remove();
3279                    if($prd.find('.option_str_list > li').length > 1){
3280                        let optionIndex = iv_util.onlyNumbFunc(layerName.split(',')[0].trim().slice(-2)) + 1;
3281                        clone.find('.option_str_list > li:not(:nth-child('+ optionIndex +'))').remove();
3282                    };
3283                    $modifyLayer.find('.list_body').html(clone);
3284                    break;
3285                case 'mobile':
3286                    console.log($modifyLayer);
3287                    break;
3288                default:
3289                    console.log('error');
3290                    break;
3291            };
3292            openFunction();
3293            $modifyLayer.find('.iv_close_button, [class^="btnClose"], [class*="close"]').on('click',function(){
3294                iv_util.scrollEnabled();
3295                if(typeof closeFunction !== 'undefined'){
3296                    closeFunction();
3297                };
3298            });
3299        };
3300    }else{
3301        let openFunction = IV$('#' + layerName)[0].iv_openCustomFunction;
3302        let closeFunction = IV$('#' + layerName)[0].iv_closeCustomFunction;
3303        if(typeof openFunction === 'undefined'){
3304            IV$('#' + layerName).addClass('on');
3305            iv_util.scrollDisabled(IV$('#' + layerName));
3306            IV$('#' + layerName).find('.iv_close_button, [class^="btnClose"],[class*="close"]').on('click',function(){
3307                iv_util.scrollEnabled();
3308            });
3309        }else{
3310            openFunction();
3311            IV$('#' + layerName).find('.iv_close_button, [class^="btnClose"],[class*="close"]').on('click',function(){
3312                if(typeof closeFunction !== 'undefined'){
3313                    closeFunction();
3314                };
3315            });
3316        };
3317    };
3318};
3319
3320
3321/**
3322 * 테이블 레이아웃 수정
3323 */
3324var IVTableLayoutFix = IVTableLayoutFix || function(el){
3325    /**
3326     * 테이블 레이아웃 수정
3327     */
3328    let $baseOrderPrdList;
3329    if(typeof el === 'undefined'){
3330        $baseOrderPrdList = IV$('.base_order_prdlist');
3331    }else{
3332        $baseOrderPrdList = IV$(el);
3333    };
3334    let $orderPrdItem = $baseOrderPrdList.find('.list_body').children();
3335    $baseOrderPrdList.each(function(){
3336        let $this = IV$(this);
3337        if( $this.hasClass('done') === false ){
3338            if($this.hasClass('ec-base-table')){
3339                let $tfoot = $this.find('tfoot');
3340                let isEmpty = $this.closest('.xans-order-empty').length;
3341                let $tdLength = $this.find('tr').eq(0).children().length;
3342                if($tfoot.length > 0){
3343                    $tfoot.find('td').attr('colspan', $tdLength);	
3344                };
3345                if(isEmpty > 0){
3346                    $this.find('.list_body td').attr('colspan', $tdLength);	
3347                };
3348            };
3349            let $orderTable = $this.find('.orderList');
3350            if($orderTable.length == 0){
3351                $this.remove();
3352            }else{
3353                let dataStr = $orderTable.attr('data-dstr');
3354                $this.find('.delv_dstr').text(dataStr);
3355            };
3356            $this.addClass('done');
3357        };
3358    });
3359};
3360
3361
3362/**
3363 * 특정 체크박스 선택하면 연결된 체크박스 다 선택해줌
3364 */
3365var ivchkFunc = ivchkFunc || function(d, boolean){
3366    let $this = IV$(d);
3367    let dom = d;
3368    let $children = dom.iv_children;
3369    let nodeName = dom.nodeName;
3370    let customFunction = dom.iv_customFunction;
3371    if(typeof $children !== 'undefined'){
3372        if(nodeName === 'INPUT'){
3373            $this.on('change',function(e,eventDirection){
3374                let checkedChk = $this.is(':checked');
3375                let $parent = dom['iv_parent'];
3376                if(boolean !== false){
3377                    $children = dom.iv_children.filter(':not(:disabled)');
3378                }else{
3379                    $children = dom.iv_children;
3380                };
3381                if(typeof eventDirection === 'undefined'){
3382                    //trigger되지 않은 이벤트 실행
3383                    triggerChildren();
3384                    if(typeof $parent !== 'undefined'){
3385                        triggerParent();
3386                    };
3387                }else{
3388                    //trigger된 이벤트 실행
3389                    if(eventDirection.direction === 'down'){
3390                        triggerChildren();
3391                    }else if(eventDirection.direction === 'up'){
3392                        if(typeof $parent !== 'undefined'){
3393                            triggerParent();
3394                        };
3395                    };
3396                };
3397                if(typeof customFunction !== 'undefined'){
3398                    customFunction(d, checkedChk);
3399                };
3400                function triggerChildren(){
3401                    if(checkedChk){
3402                        $children.prop('checked',true).trigger('change',[{'direction': 'down'}]);
3403                    }else{
3404                        $children.prop('checked',false).trigger('change',[{'direction': 'down'}]);
3405                    };
3406                };
3407                function triggerParent(){
3408                    if($parent !== 'undefined'){
3409                        let $siblings = dom['iv_siblings']; 
3410                        if($siblings.length ==  $siblings.filter(':checked').length){
3411                            $parent.prop('checked',true).trigger('change',[{'direction': 'up'}]);
3412                        }else{
3413                            $parent.prop('checked',false).trigger('change',[{'direction': 'up'}]);
3414                        };
3415                    };
3416                };
3417            });
3418        };
3419        $children.on('change',function(e, eventDirection){
3420            let $this_children = IV$(this);
3421            let childrenLength = $children.length;
3422            let childrenChkLength = $children.filter(':checked').length;
3423            if(boolean === false && typeof $this_children.iv_children === 'undefined'){
3424                childrenLength = $children.filter(':not(:disabled)').length;
3425                childrenChkLength = $children.filter(':not(:disabled)').filter(':checked').length;
3426            };
3427            let checkedChk = $this_children.is(':checked');
3428            let customFunction = $this_children.iv_customFunction;
3429            if(typeof eventDirection === 'undefined'){
3430                //trigger되지 않은 이벤트 실행
3431                triggerParents();
3432            }else{
3433                //trigger된 이벤트 실행
3434                if(eventDirection.direction == 'up'){
3435                    triggerParents();
3436                };
3437            };
3438            function triggerParents(){
3439                if(childrenLength === childrenChkLength && childrenChkLength !== 0){
3440                    $this.prop('checked',true).trigger('change',[{'direction': 'up'}]);
3441                }else{
3442                    $this.prop('checked',false).trigger('change',[{'direction': 'up'}]);
3443                };
3444            };
3445            if(typeof customFunction !== 'undefined' && typeof $this_children.iv_children === 'undefined'){
3446                customFunction(this, checkedChk);
3447            };
3448        });
3449    };
3450};
3451
3452/**
3453 * 장바구니 확인창 관련 이벤트 
3454 */
3455if(IV$(topDocument).find('[id*="iv_memberChk_"] > input').length > 0){
3456    IV$(topDocument).find('[id*="iv_memberChk_"] > input').on('IVbasketConfirm',function(e){
3457        IV$(topDocument).find('[onClick*="basketConfirmShow"]').addClass('noEvent');
3458        basketConfirmFunc.run();
3459    });
3460    var basketConfirmFunc = basketConfirmFunc || {
3461        __layer : null,
3462        __count : 0,
3463        __maxCount : 10,
3464        __autoHide : true,
3465        __autoFadeTime : 500,
3466        __autoHideTime : 1500,
3467        init: function(){
3468            let IV_BASKET_CONFIRM_EVENT = new CustomEvent("IVbasketConfirm");
3469            IV$(topDocument).find('[id*="iv_memberChk_"] > input')[0].dispatchEvent(IV_BASKET_CONFIRM_EVENT);
3470        },
3471        run : function(){
3472            basketConfirmFunc.__layer = IV$('#confirmLayer');
3473            var $comfirmLayer = basketConfirmFunc.__layer;
3474            var confirmLength = $comfirmLayer.length;
3475            if(bIsRunningAddBasket){
3476                basketConfirmFunc.__count = basketConfirmFunc.__count + 1;
3477                setTimeout(basketConfirmFunc.run,150);   
3478            }else{
3479                if(confirmLength > 0){
3480                    clearTimeout(basketConfirmFunc.run);
3481                    try {
3482                        basketConfirmFunc.set();
3483                    } catch (e) {
3484                        console.log(e);
3485                        basketConfirmFunc.set();
3486                    };
3487                    if(basketConfirmFunc.__autoHide){
3488                        $comfirmLayer.find('.popup_container').children('.close').addClass('displaynone');
3489                        basketConfirmFunc.fadeInAuto();
3490                    }else{
3491                        iv_util.makeDimmed(true,1,$comfirmLayer.find('.popup_container'));
3492                        $comfirmLayer.find('.popup_container').addClass('on');
3493                        basketConfirmFunc.reset();
3494                    };
3495                }else{
3496                    basketConfirmFunc.__count = basketConfirmFunc.__count + 1;
3497                    if(basketConfirmFunc.__count > basketConfirmFunc.__maxCount){
3498                        basketConfirmFunc.reset();
3499                    }else{	
3500                        setTimeout(basketConfirmFunc.run,100);
3501                    };
3502                };
3503            };
3504        },
3505        set : function(){
3506            var $comfirmLayer = basketConfirmFunc.__layer;
3507            IVmcustomScrollbar();
3508            if($comfirmLayer.find('.base_prd_list').length > 0){
3509                basketConfirmFunc.__autoHide = false;
3510                setTimeout(function(){
3511                    IVPrdItemInfoCall.init(basePrdItemInfoCallCustom, $comfirmLayer.find('[id^="anchorBoxId_"]')); //상품별 실행 함수
3512                    $comfirmLayer.find('[onClick*="layer_basket_paging"]').each(function(){
3513                        let $page = IV$(this);
3514                        let onClick = $page.attr('onClick');
3515                        $page.attr('onClick', 'basketConfirmFunc.reset(); ' + onClick + '  setTimeout(basketConfirmFunc.run,500);');
3516                    });
3517                },500);
3518            };
3519        },
3520        fadeInAuto : function(){
3521            var $comfirmLayer = basketConfirmFunc.__layer;
3522            $comfirmLayer.hide();
3523            $comfirmLayer.find('.popup_container').addClass('on');
3524            $comfirmLayer.stop(true,true).fadeIn(basketConfirmFunc.__autoFadeTime).promise().done(function() {
3525                if($comfirmLayer.length > 0){
3526                    setTimeout(basketConfirmFunc.hideAuto,basketConfirmFunc.__autoHideTime);
3527                }else{
3528                    basketConfirmFunc.reset();
3529                };
3530            });
3531        },
3532        hideAuto : function(){
3533            var $comfirmLayer = basketConfirmFunc.__layer;
3534            if($comfirmLayer.length > 0){
3535                $comfirmLayer.stop(true,true).fadeOut(basketConfirmFunc.__autoFadeTime).promise().done(function() {
3536                    $comfirmLayer.find('.popup_container').removeClass('on').css('transition','all 0s ease 0s');
3537                    basketConfirmFunc.close();
3538                });
3539            }else{
3540                basketConfirmFunc.reset();
3541            };
3542        },
3543        reset : function(){
3544            basketConfirmFunc.__count = 0;
3545            clearTimeout(basketConfirmFunc.run);
3546            IV$(topDocument).find('[onClick*="basketConfirmShow"]').removeClass('noEvent');
3547        },
3548        close : function(){
3549            var $comfirmLayer = basketConfirmFunc.__layer;
3550            basketConfirmFunc.reset();
3551            if($comfirmLayer.find('.popup_container').css('transition') == 'all 0s ease 0s'){
3552                $comfirmLayer.find('.popup_container').removeClass('on');
3553                $comfirmLayer.remove();
3554                iv_util.removeDimmed();
3555            }else{
3556                $comfirmLayer.find('.popup_container')[0].addEventListener("transitionend", function(){
3557                	$comfirmLayer.remove();
3558                    iv_util.removeDimmed();
3559                });
3560                $comfirmLayer.find('.popup_container').removeClass('on');
3561            }
3562        },
3563    };
3564    var basketConfirmShow = basketConfirmFunc.init;
3565    IV$(topDocument).find('[id*="iv_memberChk_"] > input').on('IVwishConfirm',function(e){
3566        IV$(topDocument).find('[onClick*="wishConfirmShow"]').addClass('noEvent');
3567        wishConfirmFunc.run();
3568    });
3569    var wishConfirmFunc = wishConfirmFunc || {
3570        __layer : null,
3571        __count : 0,
3572        __maxCount : 10,
3573        __autoHide : true,
3574        __autoFadeTime : 500,
3575        __autoHideTime : 1500,
3576        init: function(){
3577            let IV_WISH_CONFIRM_EVENT = new CustomEvent("IVwishConfirm");
3578            IV$(topDocument).find('[id*="iv_memberChk_"] > input')[0].dispatchEvent(IV_WISH_CONFIRM_EVENT);
3579        },
3580        run : function(){
3581            wishConfirmFunc.__layer = IV$('#confirmLayer');
3582            var $comfirmLayer = wishConfirmFunc.__layer;
3583            var confirmLength = $comfirmLayer.length;
3584            if(confirmLength > 0){
3585                clearTimeout(wishConfirmFunc.run);
3586                if(wishConfirmFunc.__autoHide){
3587                    $comfirmLayer.find('.popup_container').children('.close').addClass('displaynone');
3588                    wishConfirmFunc.fadeInAuto();
3589                }else{
3590                    iv_util.makeDimmed(true,1,$comfirmLayer.find('.popup_container'));
3591                    $comfirmLayer.find('.popup_container').addClass('on');
3592                    wishConfirmFunc.reset();
3593                };
3594            }else{
3595                wishConfirmFunc.__count = wishConfirmFunc.__count + 1;
3596                if(wishConfirmFunc.__count > wishConfirmFunc.__maxCount){
3597                    wishConfirmFunc.reset();
3598                }else{	
3599                    setTimeout(wishConfirmFunc.run,100);
3600                };
3601            };
3602        },
3603        set : function(){
3604            var $comfirmLayer = wishConfirmFunc.__layer;
3605            IVmcustomScrollbar();
3606            if($comfirmLayer.find('.base_prd_list').length > 0){
3607                IVPrdItemInfoCall.init(basePrdItemInfoCallCustom, $comfirmLayer.find('[id^="anchorBoxId_"]')); //상품별 실행 함수
3608            };
3609        },
3610        fadeInAuto : function(){
3611            var $comfirmLayer = wishConfirmFunc.__layer;
3612            $comfirmLayer.hide();
3613            $comfirmLayer.find('.popup_container').addClass('on');
3614            $comfirmLayer.stop(true,true).fadeIn(wishConfirmFunc.__autoFadeTime).promise().done(function() {
3615                let chk = IV$('#confirmLayer');
3616                if(chk.length > 0){
3617                    setTimeout(wishConfirmFunc.hideAuto,wishConfirmFunc.__autoHideTime);
3618                }else{
3619                    wishConfirmFunc.reset();
3620                };
3621            });
3622        },
3623        hideAuto : function(){
3624            var $comfirmLayer = wishConfirmFunc.__layer;
3625            if($comfirmLayer.length > 0){
3626                $comfirmLayer.stop(true,true).fadeOut(wishConfirmFunc.__autoFadeTime).promise().done(function() {
3627                    $comfirmLayer.find('.popup_container').removeClass('on').css('transition','all 0s ease 0s');
3628                    wishConfirmFunc.close();
3629                });
3630            }else{
3631                wishConfirmFunc.reset();
3632            };
3633        },
3634        reset : function(){
3635            wishConfirmFunc.__count = 0;
3636            clearTimeout(wishConfirmFunc.run);
3637            IV$(topDocument).find('[onClick*="wishConfirmShow"]').removeClass('noEvent');
3638        },
3639        close : function(){
3640            var $comfirmLayer = wishConfirmFunc.__layer;
3641            wishConfirmFunc.reset();
3642            if($comfirmLayer.find('.popup_container').css('transition') == 'all 0s ease 0s'){
3643                $comfirmLayer.find('.popup_container').removeClass('on');
3644                $comfirmLayer.remove();
3645                iv_util.removeDimmed();
3646            }else{
3647                $comfirmLayer.find('.popup_container')[0].addEventListener("transitionend", function(){
3648                    $comfirmLayer.remove();
3649                    iv_util.removeDimmed();
3650                });
3651                $comfirmLayer.find('.popup_container').removeClass('on');
3652            }
3653        },
3654    };
3655    var wishConfirmShow = wishConfirmFunc.init;
3656};
3657
3658/**
3659 * 커스텀 셀렉트 생성 
3660 */
3661var iv_optionCustomUtil = iv_optionCustomUtil || {
3662    find: function ($select) {
3663        /**
3664         * 상품 셀렉트일때는 초기 옵션값 텍스트 변경 
3665         */
3666        if($select[0].tagName == 'SELECT' && $select.attr('data-ivcustom-input') === 'product'){
3667            var firstOption = $select.find('option:first-child');
3668            var requiredChk = (firstOption.text().indexOf('필수') > -1) ? true : false;
3669            var firstOptionTxt = '';
3670            if(requiredChk){
3671                firstOptionTxt += iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_REQUIRED_FIXED_TXT;
3672            }else{
3673                firstOptionTxt += iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_OPTIONAL_FIXED_TXT;
3674            };
3675            firstOptionTxt += ' ' + iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_DEFAULT_FIXED_TXT;
3676            firstOption.text(firstOptionTxt);
3677        };
3678        iv_optionCustomUtil.make($select);
3679        iv_optionCustomUtil.append($select);
3680    },
3681    update : function($select, result){
3682        var $customSelect = $select.prev('.base_data_connect');
3683        var dataConnectResult = $customSelect.attr('data-result');
3684        //본래 select에 변경이 발생했을때
3685        if($select.val() !== $customSelect.attr('data-selected')){
3686            var dataVal = $select.val();
3687            if(dataVal === ''){
3688                dataVal = '*';
3689            };
3690            let $dataOption = $customSelect.find('[data-value="'+ dataVal +'"]');
3691            var dataText = $dataOption.html();
3692            $customSelect.find('.base_data_view').html(dataText);
3693            $customSelect.attr('data-selected', dataVal);
3694            $dataOption.addClass('selected');
3695            $customSelect.removeClass('on');
3696            $customSelect.find('[data-value]').not($dataOption).removeClass('selected');
3697            if (dataConnectResult == 'button') {
3698                $customSelect.find('.base_data_select').slideUp();
3699            };
3700            let disbledChk = (typeof $select.attr('disabled') === 'undefined') ? false : $select.attr('disabled');
3701            if(disbledChk === 'disabled'){
3702                $customSelect.attr('data-disabled','disabled');
3703            }else{
3704                $customSelect.removeAttr('data-disabled');
3705            };
3706        };
3707        if(result === true){
3708            iv_optionCustomUtil.append($select);
3709        };
3710    },
3711    make: function ($select) {
3712        var $customSelect = $select.prev('.base_data_connect');
3713        if ($customSelect.length == 0) {
3714            switch (IV_DEVICE_CHK) {
3715                case 'pc':
3716                    var customProductSelect = EC$('<div class="base_data_connect data-done" data-ori="" data-result="select" data-selected=""><h4 class="base_data_view"></h4><ul class="base_data_select"></ul></div>');
3717                    break;
3718                case 'mobile':
3719                    var customProductSelect = EC$('<div class="base_data_connect data-done" data-ori="" data-result="button" data-selected=""><h4 class="base_data_view"></h4><ul class="base_data_select"></ul></div>');
3720                    break;
3721                default:
3722                    console.log('error');
3723                    break;
3724            };
3725            $select.addClass('layout-hidden');
3726            $select.before(customProductSelect);
3727            $customSelect = $select.prev('.base_data_connect');
3728            if ($select.hasClass('displaynone')) {
3729                $customSelect.addClass('displaynone');
3730            };
3731        };
3732        $customSelect.find('.base_data_view').off().on('click', function () {
3733            var $this = EC$(this);
3734            var $dataConnect = $this.closest('.base_data_connect');
3735            var dataConnectResult = $dataConnect.data('revealtype');
3736            var classname = '.base_data_connect';
3737            if($dataConnect.attr('data-disabled') == 'disabled'){
3738                return false;
3739            }else{
3740                if (dataConnectResult == 'select') {
3741                    if ($dataConnect.hasClass('on')) {
3742                        $dataConnect.removeClass('on');
3743                    } else {
3744                        $dataConnect.addClass('on');
3745                        iv_util.targetOutCloseFunc($dataConnect);
3746                    };
3747                    EC$(classname).not($dataConnect).removeClass('on');
3748                } else if (dataConnectResult == 'toggle') {
3749                    if ($dataConnect.hasClass('on')) {
3750                        $dataConnect.removeClass('on');
3751                        $dataConnect.find('.base_data_select').slideUp();
3752                    } else {
3753                        $dataConnect.addClass('on');
3754                        $dataConnect.find('.base_data_select').slideDown();
3755                    };
3756                    EC$(classname).not($dataConnect).removeClass('on');
3757                    EC$(classname).not($dataConnect).find('.base_data_select').slideUp();
3758                };
3759            };
3760        });
3761    },
3762    append: function ($select) {
3763        if ($select) {
3764            var $customSelect = $select.prev('.base_data_connect');
3765            var isProductSelect = ($select.attr('data-ivcustom-input') === 'product') ? true : false;
3766            if ($customSelect.length > 0) {
3767                if (!$select.hasClass('displaynone')) {
3768                    var required = $select.attr('required');
3769                    required = (required) ? iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_REQUIRED_FIXED_TXT : iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_OPTIONAL_FIXED_TXT;
3770                    $customSelect.find('.base_data_select').remove();
3771                    $customSelect.append('<ul class="base_data_select"></ul>');
3772                    var selectVal = $select.val();
3773                    $select.find('option').each(function () {
3774                        var $option = EC$(this);
3775                        var value = $option.val();
3776                        var disabled = ($option.attr('disabled')) ? 'disabled' : '';
3777                        if (value != '*' && value != '**' && value !== '') {
3778                            var text = $option.text();
3779                            var textSplit1,
3780                                textSplit2;
3781                            let soldOutChk = false;
3782                            if(text.indexOf('[품절]') > -1){
3783                                soldOutChk = true;
3784                            };
3785                            if (text.indexOf(iv_commonCustom.__IV_DEFAULT_VALUE_DETAIL_SELECT_CUSTOM_SUB_TXT_SIGN) > -1) {
3786                                var chk = text.indexOf(iv_commonCustom.__IV_DEFAULT_VALUE_DETAIL_SELECT_CUSTOM_SUB_TXT_SIGN);
3787                                textSplit1 = text.slice(0, chk).trim();
3788                                if(soldOutChk){
3789                                    textSplit2 = text.slice(chk + 1).split('[품절]')[0].trim();
3790                                    text = '<strong>' + textSplit1 + '</strong><span>' + textSplit2 + '<span class="soldOut">'+ iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_SOLDOUT_FIXED_TXT +'</span></span>';
3791                                }else{
3792                                    textSplit2 = text.slice(chk + 1).trim();
3793                                    text = '<strong>' + textSplit1 + '</strong><span>' + textSplit2 + '</span>';
3794                                };
3795                            } else {
3796                                if(soldOutChk){
3797                                    text = text.split('[품절]')[0].trim();
3798                                    text = '<strong>' + text + '<span class="soldOut">'+ iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_SOLDOUT_FIXED_TXT +'</span></strong>';
3799                                }else{
3800                                    text = '<strong>' + text + '</strong>';
3801                                };
3802                            };
3803                            var $li = IV$('<li data-value="' + value + '" class="base_data_option">' + text + '</li>');
3804                            if(disabled !== ''){
3805                            	$li.attr('data-disabled', 'disabled');
3806                            }
3807                            if (value == selectVal) {
3808                                $customSelect.find('.base_data_view').html(text);
3809                                $li.addClass('selected');
3810                                $customSelect.attr('data-selected', value);
3811                            };
3812                            $customSelect.find('.base_data_select').append($li);
3813                        };
3814                    });
3815                    if(isProductSelect){
3816                        var defaultTxt = required + ' ' + iv_commonCustom.__IV_DEFAULT_VALUE_OPTION_DEFAULT_FIXED_TXT;
3817                        $customSelect.find('.base_data_select').prepend('<li data-value="*" class="base_data_option">' + defaultTxt + '</li>');
3818                    }else{
3819                        $customSelect.find('.base_data_select').prepend('<li data-value="*" class="base_data_option">' + $select.find('option').eq(0).text() + '</li>');
3820                    };
3821                    let disbledChk = (typeof $select.attr('disabled') === 'undefined') ? false : $select.attr('disabled');
3822                    if ($customSelect.find('.base_data_option').length == 1 || disbledChk == 'disabled') {
3823                        $customSelect.attr('data-disabled', 'disabled');
3824                    } else {
3825                        $customSelect.removeAttr('data-disabled');
3826                    };
3827                    if (selectVal == '*' || selectVal == '') {
3828                        if(isProductSelect){
3829                            $customSelect.find('.base_data_view').text(defaultTxt);
3830                            $customSelect.find('.base_data_select [data-value="*"]').addClass('selected');
3831                            $customSelect.attr('data-selected', '*');
3832                        }else{
3833                            $customSelect.find('.base_data_view').text($select.find('option').eq(0).text());
3834                            $customSelect.find('.base_data_select [data-value="*"]').addClass('selected');
3835                            $customSelect.attr('data-selected', '*');
3836                        };
3837                    };
3838                    var dataConnectResult = $customSelect.attr('data-result');
3839                    if (dataConnectResult == 'select') {
3840                        $customSelect.attr('data-revealType', 'select');
3841                        try {
3842                            $customSelect.find('.base_data_select').mCustomScrollbar({
3843                                axis: "y",
3844                                theme: "minimal-dark",
3845                                alwaysShowScrollbar: 0,
3846                                callbacks: {
3847                                    onInit:function(){
3848                                        let $scrollBox = $customSelect.find(".mCustomScrollBox");
3849                                        let $scrollContent = $customSelect.find(".mCSB_container");
3850                                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3851                                        (gap < 10) ? $customSelect.find(".mCSB_scrollTools").addClass("layout-hidden") : $customSelect.find(".mCSB_scrollTools").removeClass("layout-hidden");
3852                                    },
3853                                    onBeforeUpdate: function () {
3854                                        let $scrollBox = $customSelect.find(".mCustomScrollBox");
3855                                        let $scrollContent = $customSelect.find(".mCSB_container");
3856                                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3857                                        (gap < 10) ? $customSelect.find(".mCSB_scrollTools").addClass("layout-hidden") : $customSelect.find(".mCSB_scrollTools").removeClass("layout-hidden");
3858                                    },
3859                                    onScrollStart: function () {
3860                                        let $scrollBox = $customSelect.find(".mCustomScrollBox");
3861                                        let $scrollContent = $customSelect.find(".mCSB_container");
3862                                        let gap = Math.abs($scrollBox.outerHeight() - $scrollContent.outerHeight());
3863                                        (gap < 10) ? $customSelect.find(".mCSB_scrollTools").addClass("layout-hidden") : $customSelect.find(".mCSB_scrollTools").removeClass("layout-hidden");
3864                                    }
3865                                }
3866                            });
3867                        }catch(e) {
3868							console.log(e);
3869                        }
3870                    } else if (dataConnectResult == 'button') {
3871                        $customSelect.attr('data-revealType', 'toggle');
3872                    };
3873                    $customSelect.find('.base_data_option').off().on('click', function () {
3874                        var $dataOption = EC$(this);
3875                        var dataVal = $dataOption.attr('data-value');
3876                        if(dataVal === '*' && $select.find('option[value="' + dataVal + '"]').length === 0){
3877                            dataVal = '';
3878                        };
3879                        var dataText = $dataOption.html();
3880                        if (!$dataOption.hasClass('selected')) {
3881                            $select.find('option[value="' + dataVal + '"]').prop('checked', true);
3882                            $select.val(dataVal).trigger('change');
3883                            $customSelect.find('.base_data_view').html(dataText);
3884                        };
3885                        $customSelect.attr('data-selected', dataVal);
3886                        $dataOption.addClass('selected');
3887                        $customSelect.removeClass('on');
3888                        $customSelect.find('[data-value]').not($dataOption).removeClass('selected');
3889                        if (dataConnectResult == 'button') {
3890                            $customSelect.find('.base_data_select').slideUp();
3891                        };
3892                    });
3893                    EC$($select).on('change',function(){
3894                        let value = $select.val();
3895                        if(value == '*' || value == '**'){
3896                            let $defaultOption = $customSelect.find('[data-value="*"]');
3897                            $customSelect.find('.base_data_view').html($defaultOption.html());
3898                            $customSelect.attr('data-selected', '*');
3899                            $defaultOption.addClass('selected');
3900                            $customSelect.removeClass('on');
3901                            $customSelect.find('[data-value]').not($defaultOption).removeClass('selected');
3902                            if (dataConnectResult == 'button') {
3903                                $customSelect.find('.base_data_select').slideUp();
3904                            };
3905                        }
3906                    });
3907                }
3908            }
3909        }
3910    },
3911};
3912
3913//상품 데이터 동적으로 붙이기
3914var IVPrdDynamicCall= IVPrdDynamicCall || {
3915    __IV_DEFAULT_VALUE_FUNCTION_USE : true, //이 함수 사용할 것인지
3916    __IV_DEFAULT_VALUE_AJAX_URL : ['/exec/front/Product/ApiProductNormal', '/exec/front/Product/ApiProductMain'], /* data 호출 url */
3917    __IV_DEFAULT_VALUE_CONDITION_ARRAY : [],
3918    __IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY : [],
3919    __IV_DEFAULT_VALUE_PRDLIST_AJAX_CALL_CUSTOM_DATA : {},
3920    __IV_DEFAULT_VALUE_AJAX_COUNT : 200, //max 200
3921    __IV_DEFAULT_VALUE_MOREBUTTON_TEXT : '+ 더보기',
3922    __IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG : null,
3923    __IV_DEFAULT_VALUE_CUSTOM_FUNCTION : null, //custom function
3924    /**
3925     * @ no : 동적상품영역 고유번호
3926     * @ $basePrdList : 동적상품영역 기준 최상위 엘리먼트 .base_prd_list 
3927     * @ $prdList : 상품이 붙는 영역 (직계 자식으로 상품 추가됨)
3928     * @ basicSettingArray : 카페24 상품 관련 설정 (ajax 호출 페이지 등)
3929     * @ ivSettingArray : IV 커스텀 세팅 설정 
3930     * @ _prdList_categoryList 상품분류 페이지의 일반 상품 진열 영역 > .prdItem_normalBox .base_prd_list
3931     */
3932    _prdList_categoryList : null,
3933    init: function(){ 
3934        IVPrdDynamicCall._prdList_categoryList = IV$('.prdItem_normalBox .base_prd_list')[0];
3935        /**
3936         * .base_prd_list 마크업 기준으로 생성 (필수)
3937         */
3938        IV$('.base_prd_list').each(function(idx, el){
3939            let $basePrdList = IV$(el);
3940            let no = IVPrdDynamicCall.getCondition($basePrdList); //호출 조건 세팅 no : 해당 영역 고유 번호 / false : 사용안함
3941            if( no !== false ){
3942                //해당 함수 사용 시
3943                if(IVPrdDynamicCall.__IV_DEFAULT_VALUE_FUNCTION_USE){
3944                    //상품 분류 일반 상품 진열 영역의 경우 큐레이션 동작 아닐때만 실행 
3945                    if(el == IVPrdDynamicCall._prdList_categoryList){
3946                        if(IV_LOCATION_HREF.indexOf('keyword=&search_form') === -1){
3947                            let keyword = IV_LOCATION_HREF.indexOf('keyword=&');
3948                            let cateFilter = IV_LOCATION_HREF.indexOf('%3Fcate_no%3D' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE);
3949                            if(keyword > -1){
3950                                let newLink = IV_LOCATION_HREF;
3951                                if(IV_LOCATION_HREF.indexOf('keyword=&rel_keyword=&') > -1){
3952                                    newLink.replace('keyword=&rel_keyword=','');
3953                                }else{
3954                                    newLink = newLink.replace('keyword=&','');
3955                                };
3956                                history.replaceState(null, null, newLink);  
3957                            };
3958                            let storage_ivCateInfo = sessionStorage.getItem('iv_cate_info');
3959                            let storage_ivCateInfo2 = sessionStorage.getItem('iv_cate_info2');
3960                            let storage_ivCateInfo3 = sessionStorage.getItem('iv_cate_info3');
3961                            try {
3962                                if(typeof storage_ivCateInfo3 === 'string' && typeof storage_ivCateInfo2 !== 'undefined' && typeof storage_ivCateInfo !== 'undefined'){
3963                                    storage_ivCateInfo = JSON.parse(storage_ivCateInfo);
3964                                    storage_ivCateInfo2 =  JSON.parse(storage_ivCateInfo2);
3965                                    storage_ivCateInfo3 =  JSON.parse(storage_ivCateInfo3);
3966                                    var iNowTime = Math.floor(new Date().getTime() / 1000);
3967                                    var iSessionTime = 60 * 5;
3968                                    if(typeof storage_ivCateInfo3 === 'string' && iNowTime - Number(storage_ivCateInfo['saveTime']) < iSessionTime && storage_ivCateInfo['oriCatePage']=== window.location.href){
3969                                        $basePrdList.find('.prdList').html(storage_ivCateInfo3);
3970                                        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no]; //카페24 기본 설정
3971                                        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no]; //IV 커스텀 설정
3972                                        IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no] = storage_ivCateInfo2;
3973                                        basicSettingArray['page'] = 3;
3974                                        if(storage_ivCateInfo['viewType']){
3975                                            IV$('.iv_viewType').find('[data-view="'+ storage_ivCateInfo['viewType'] +'"]').trigger('click');
3976                                        };
3977                                        IVPrdDynamicCall.run(no, $basePrdList);
3978                                    }else{
3979                                        IVPrdDynamicCall.run(no, $basePrdList);
3980                                    };
3981                                }else{
3982                                    IVPrdDynamicCall.run(no, $basePrdList);
3983                                };
3984                            }
3985                            catch (err) {
3986                                console.log(err); 
3987                                sessionStorage.removeItem('iv_cate_info');
3988                                sessionStorage.removeItem('iv_cate_info2');
3989                                sessionStorage.removeItem('iv_cate_info3');
3990                                IVPrdDynamicCall.run(no, $basePrdList);
3991                            };
3992                        };
3993                    }
3994                    //나머지는 @ivuse -> yes 값이 있으면 실행 
3995                    else{
3996                        IVPrdDynamicCall.run(no, $basePrdList);
3997                    };
3998                };
3999            };
4000            /**
4001             * 해당 함수 off되더라도 dom 변경 감지하여, 상품별로 호출해야 하는 함수가 있는 경우 실행될 수 있도록 함
4002             */
4003            if($basePrdList.find('.prdList').length > 0){
4004                $basePrdList.find('.prdList').iv_observerFunc( function(a,b,c){
4005                    //자식 노드 추가될 때 실행
4006                    //if(a[0].addedNodes){
4007                    if(typeof IVPrdItemInfoCall !== 'undefined'){
4008                        if(typeof basePrdItemInfoCallCustom !== 'undefined'){
4009                            IVPrdItemInfoCall.init(basePrdItemInfoCallCustom, $basePrdList.find('[id^="anchorBoxId_"]')); //상품별 실행 함수
4010                        }else{
4011                            IVPrdItemInfoCall.init(); //상품별 실행 함수
4012                        };
4013                    };
4014                    //}
4015                } , {
4016                    attributes: false,
4017                    childList: true, /* 자식요소만 변경 감지 */
4018                    subtree: false
4019                });
4020            };
4021        });
4022    },
4023    getCondition : function($basePrdList){
4024        /**
4025         * 주석에 입력된 내용 기반으로 조건 생성
4026         * @ $basePrdList : 기준으로 정보 호출
4027         */ 
4028        //조건 전체
4029        let targetHtml = String($basePrdList.html()); 
4030        let index1 = targetHtml.indexOf('<!--');
4031        let index2 = targetHtml.indexOf('-->');
4032        let condition = targetHtml.slice((index1+4), index2); 
4033        condition = iv_util.removeBlankFunc(condition); 
4034        let useChk = false,  //해당 기능 사용할 것인지 최종확인
4035            sTargetModuleName, //모듈타입
4036            count; //실행 체크 카운트
4037        if(IVPrdDynamicCall.__chkCount){ count = Number(IVPrdDynamicCall.__chkCount); } else { IVPrdDynamicCall.__chkCount = 0; count = 0; } 
4038        //설정 obj
4039        let array1 = {}; //카페24 기본 설정 obj
4040        let array2 = {}; //IV 커스텀 설정 obj
4041        var sum = condition.split(/\s/gi).reduce(function (acc, v, i) {
4042            if(v){
4043                if(v != '' && v!= '\n' && v.indexOf('basket') == -1){
4044                    if(v.indexOf('$') > -1){
4045                        /**
4046                         * 기존 주석옵션 ($)
4047                         */
4048                        let con = v.trim(),
4049                            name = con.split('=')[0].replace('$',''),
4050                            value = con.split('=')[1];
4051                        if(name == 'count' || name == 'sort_method' || name == 'ec_soldout_display' || name == 'cate_no'){
4052                            array1[name] = value;
4053                        }else if(name == 'cache'){
4054                            array1['b_' + name] = value;
4055                        };
4056                    }else if(v.indexOf('@iv') > -1){
4057                        /**
4058                         * 커스텀 옵션 (@)
4059                         */
4060                        let con = v.trim(),
4061                            name = con.split('=')[0].replace('@',''),
4062                            value = con.split('=')[1];
4063                        if(name == 'ivuse' && value == 'yes'){
4064                            useChk = true;
4065                        };
4066                        array2[name] = value;
4067                    };
4068                };
4069            };
4070        },[]);
4071        if(useChk){ 
4072            IVPrdDynamicCall.__chkCount = count + 1;
4073            //필요한 요소이나 주석에 기록하지 않는 항목 추가
4074            array1['first_page'] = 1;
4075            array1['page'] = 1; 
4076            array1['idx'] = count;
4077            let displaygroup = Number($basePrdList.siblings('.base_paginate_container').attr('data-ivdynamic-displyagroup'));  //더보기 버튼에서 가져옴 
4078            if(displaygroup === null || displaygroup === 'undefined' || displaygroup === ''){
4079                array1['display_group'] = 1;
4080            }else{
4081                array1['display_group'] = displaygroup;
4082            };
4083            //상품분류 페이지 일반 상품 영역
4084            if($basePrdList[0] === IVPrdDynamicCall._prdList_categoryList){
4085                array1['cate_no'] = IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE;
4086                array2['ivmodule'] = 'xans-product-listnormal';
4087                array1['sort_method'] = (typeof array1['sort_method'] === 'undefined') ? Number(iv_util.getParameterByName(IV_LOCATION_HREF, 'sort_method')) : array1['sort_method'];
4088            };
4089            //카테고리
4090            if(typeof array1['cate_no'] === 'undefined' || array1['cate_no'] === 0){
4091                array1['cate_no'] = 1;
4092            };
4093            //정렬
4094            if(typeof array1['sort_method'] === 'undefined'){ 
4095                array1['sort_method'] = 0;
4096            };
4097            //모듈 타입
4098            if(typeof array2['ivlink'] !== 'undefined'){
4099                if(array2['ivlink'] === '0'){
4100                    array2['ivmodule'] = 'xans-product-listnormal';
4101                    array2['ivstorage'] = 'sStorageList_' + array1['cate_no'] + '_' +  array1['display_group'];
4102                    if(array1['b_cache'] === 'yes'){
4103                        array1['first_page'] = EC$.cookie('mobile_more_current_page_' + array1['cate_no']);
4104                    };
4105                }else if(array2['ivlink'] === '1'){
4106                    let moduleNumber = $basePrdList[0].classList;
4107                    let moduleNumberChk = function(item){ if(item.indexOf('xans-product-listmain-') > -1){ return true; } }
4108                    moduleNumber = iv_util.onlyNumbFunc(moduleNumberChk);
4109                    array2['ivmodule'] = 'xans-product-listmain-' + moduleNumber;
4110                    array2['ivstorage'] = 'sStorageList_' + moduleNumber;
4111                    if(array1['b_cache'] === 'yes'){
4112                        array1['first_page'] = EC$.cookie('mobile_more_current_page_' + moduleNumber);
4113                    };
4114                }else{
4115                    array2['ivmodule'] = 'iv-dynamic-custom';
4116                };
4117            };
4118
4119            array1['cate_no'] = Number(array1['cate_no']);
4120            array1['count'] = Number(array1['count']);
4121            array1['sort_method'] = Number(array1['sort_method']);
4122
4123            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[count] = array1; //카페24 기본 설정 
4124            IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[count] = array2; //IV 커스텀 설정
4125
4126            $basePrdList.attr({'data-ivdynamic-idx' : count, //고유번호
4127                               'data-ivdynamic-init' : count 
4128                              }).addClass('iv_dynamic_prdList_' + count); //고유 클래스
4129
4130            return count; 
4131        } else { 
4132            return false; //사용안하는 경우 false return 
4133        };
4134    },
4135
4136    setData : function(no){
4137
4138        /**
4139         * 데이터 세팅
4140         */
4141        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no]; //카페24 기본 설정 
4142        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no]; //IV 커스텀 설정
4143        let moredata = basicSettingArray; //ajax를 요청하기 위한 data obj
4144        return moredata;
4145    },
4146
4147    sModuleHtmlForVDOM : function(sTargetModuleName, sPos){
4148        /**
4149         * VDOM에서 모듈 템플릿 호출 
4150         */
4151        var sModuleHtmlForVDOM = CAFE24.FRONT_XANS_TEMPLATE.getTemplateForVDOM(sTargetModuleName);
4152        var $li = EC$.fn[sPos].apply(EC$(sModuleHtmlForVDOM).find('ul').first().children('li'));
4153        $li.removeClass('on');
4154        var sLiHtmlForVDOM = EC$('<ul>').append($li).html();
4155        return CAFE24.FRONT_XANS_TEMPLATE.convertVDomHtmlToHTML(sLiHtmlForVDOM);
4156    },
4157
4158    getLiTemplate : function(sTargetModuleName, prdData){
4159        /**
4160         * 데이터/템플릿에서 li템플릿 호출
4161         */
4162        var sFirstLiTemplate = IVPrdDynamicCall.sModuleHtmlForVDOM(sTargetModuleName, 'first');
4163        var sLiTemplate = IVPrdDynamicCall.sModuleHtmlForVDOM(sTargetModuleName, 'last');
4164        var aHtml = [];
4165        var sTemplate = sLiTemplate;
4166        EC$(prdData).each(function(iIndex, aVar) {
4167            if (iIndex === 0) {
4168                sTemplate = sFirstLiTemplate;
4169            } else {
4170                sTemplate = sLiTemplate;
4171            };
4172            aHtml.push(CAFE24.FRONT_XANS_INTERPRETER.fetch(sTemplate, aVar));
4173        });
4174        var sHtml = aHtml.join('');
4175        return sHtml;
4176    },
4177
4178    dynamicDataEnd : function(no, $basePrdList, moredata, type){
4179        switch(type){
4180            case 'page' : 
4181                IVPrdDynamicCall.makePagination(no, $basePrdList, moredata);
4182                break;
4183            case 'button' : case  'scroll' :
4184                IVPrdDynamicCall.makeMoreButton(no, $basePrdList, moredata);
4185                break;
4186            case 'swipe' :
4187                break;
4188            default :
4189                break;
4190        };
4191
4192    },
4193
4194    makePagination: function(no, $basePrdList, moredata){
4195        /**
4196         * 페이지네이션 생성
4197         */
4198        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no];
4199        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no];
4200        let prdListData = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no];
4201        let $basicButton = $basePrdList.siblings('[class*="xans-product-listmore"]');
4202        let lastNum;
4203        let count = Number(basicSettingArray.count);
4204        if(prdListData){
4205            lastNum = Math.ceil(prdListData.length/count);
4206        }else{
4207            lastNum = $basicButton.find('[id^="more_total_page"]').text();
4208        };
4209        if(typeof moredata !== 'undefined'){
4210            IVPrdDynamicCall.saveCache(moredata, lastNum);
4211        };
4212        let $paginate = IV$('.iv_dynamic_paginate[data-ivdynamic-idx="'+no+'"]'); //페이지네이션 element
4213        //기존 페이지네이션 갱신
4214        if($paginate.length > 0){
4215            let chkLast = Number($paginate.attr('data-ivdynamic-last')); //마지막 페이지 
4216            let chkCount = Number($paginate.attr('data-ivdynamic-count')); //페이지 당 보이는 상품 수
4217            let chkLimit = Number($paginate.attr('data-ivdynamic-limit')); //페이지네이션 생성 시 리밋 (ex 리밋 5 -> 페이지네이션 번호 1,2,3,4,5 / 6,7,8,9,10, 리밋 3 -> 페이지네이션 번호 1,2,3 / 4,5,6 )
4218            let chkPage = Number($paginate.attr('data-ivdynamic-page')); //현재 보는 페이지 번호
4219            let $pagination = $paginate.find('ol'); //페이지네이션 번호 목록 
4220            let newViewEnd = Math.ceil(chkPage/chkLimit)*chkLimit; //새로 갱신 시 마지막 페이지네이션 목록 번호 
4221            let newViewStart = newViewEnd - chkLimit; //새로 갱신 시 최초 페이지네이션 목록 번호 
4222            if(newViewEnd > chkLast){ 
4223                newViewEnd = chkLast;
4224            };
4225            let $pageAll = '';
4226            for(var i=newViewStart; i<newViewEnd; i++){
4227                let $page = '<li><a href="javascript:void(0);" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4228                if(i==0){
4229                    $page = '<li class="on"><a href="javascript:void(0);" class="this" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4230                }else{
4231                    $page = '<li><a href="javascript:void(0);" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4232                };
4233                $pageAll += $page;
4234            };
4235            $pagination.html($pageAll);
4236        }
4237        //페이지네이션 최초 생성 
4238        else{
4239            let pageViewLimit = Number(ivSettingArray.ivpage); //페이지네이션 생성 시 리밋 (ex 리밋 5 -> 페이지네이션 번호 1,2,3,4,5 / 6,7,8,9,10, 리밋 3 -> 페이지네이션 번호 1,2,3 / 4,5,6 )
4240            let $paginationHtml = IV$('<div class="base_paginate_container iv_dynamic_paginate" data-ivdynamic-page="1" data-ivdynamic-count="'+ basicSettingArray.count +'" data-ivdynamic-idx="'+ no +'" data-ivdynamic-last="'+ lastNum +'" data-ivdynamic-limit="'+ pageViewLimit +'"></div>');
4241            let $goFirst = IV$('<a href="javascript:void(0);" class="first" data-page="1">first</a>');
4242            let $goPrev = IV$('<a href="javascript:void(0);" class="prev" data-page="1"></a>');
4243            let $pagination = IV$('<ol></ol>');
4244            let makePage = pageViewLimit;
4245            if(lastNum<pageViewLimit){
4246                makePage = lastNum;
4247            };
4248            let $pageAll = '';
4249            for(var i=0; i<makePage; i++){
4250                let $page = '<li><a href="javascript:void(0);" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4251                if(i==0){
4252                    $page = '<li class="on"><a href="javascript:void(0);" class="this" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4253                }else{
4254                    $page = '<li><a href="javascript:void(0);" data-page="'+ (i+1) +'">'+ (i+1) +'</a></li>';
4255                };
4256                $pageAll += $page;
4257            };
4258            $pagination.html($pageAll);
4259            let $goNext = IV$('<a href="javascript:void(0);" class="next" data-page="2">next</a>');
4260            let $goLast = IV$('<a href="javascript:void(0);" class="last" data-page="'+ lastNum +'">last</a>');
4261            $paginationHtml.append($goFirst, $goPrev, $pagination, $goNext, $goLast);
4262            $paginationHtml.insertAfter($basePrdList);
4263            $paginate = $paginationHtml;
4264            //최초 필터링 
4265            IVPrdDynamicCall.filter(no, $basePrdList);
4266        };
4267        //페이지네이션 a태그 클릭 시 data-page값에 맞춰 이동
4268        $paginate.find('a').off().on('click',function(){
4269            let page = Number($(this).attr('data-page'));
4270            IVPrdDynamicCall.goPage(no, page, $basePrdList);
4271        });
4272    },
4273
4274    goPage : function(no, page, $basePrdList){
4275
4276        /**
4277         * 페이지네이션 페이지 이동 
4278         */
4279
4280        page = Number(page);
4281
4282        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no];
4283        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no];
4284
4285        let $paginate = $basePrdList.siblings('.iv_dynamic_paginate[data-ivdynamic-idx="'+no+'"]'); //페이지네이션 
4286        let viewCount = Number(basicSettingArray.count); //한 페이지 당 보이는 상품 수 
4287        let maxCount = Number($paginate.attr('data-ivdynamic-last')); //마지막 페이지 
4288        let limitCountMin = Number($paginate.find('ol li:first-child a').attr('data-page')); //페이지 목록 첫번째 
4289        let limitCountMax = Number($paginate.find('ol li:last-child a').attr('data-page')); //페이지 목록 마지막 
4290
4291        let lastViewIndex = viewCount*page - 1;
4292        let startViewIndex = lastViewIndex - viewCount + 1;
4293        let nextpage;
4294        let prevpage;
4295
4296        //현재 보이는 페이지네이션 목록 범위에 이동 페이지 내용이 없다면 다시 목록 생성 
4297        $paginate.attr('data-ivdynamic-page',page);
4298        if((page > limitCountMax) || (page < limitCountMin)){
4299            IVPrdDynamicCall.makePagination(no, $basePrdList);
4300        };
4301        //페이지네이션에 이동 후 페이지 내용 갱신 
4302        $paginate.find('ol a[data-page]').removeClass('this');
4303        $paginate.find('ol a[data-page]').parent().removeClass('on');
4304        $paginate.find('ol a[data-page="'+ page +'"]').addClass('this');
4305        $paginate.find('ol a[data-page="'+ page +'"]').parent().addClass('on');
4306        nextpage = ((page+1) > maxCount) ? maxCount : page+1;
4307        prevpage = ((page-1) < 1) ? 1 : page-1;
4308        $paginate.find('.next').attr('data-page', nextpage);
4309        $paginate.find('.prev').attr('data-page', prevpage);
4310
4311        //현재 주소줄 내용 갱신 ---> 상품 분류 페이지 & 일반 상품 영역 일 경우에만
4312        if($basePrdList[0] == IVPrdDynamicCall._prdList_categoryList){
4313            let makePage;
4314            let nowLink = window.location.href;
4315            let linkPage = iv_util.getParameterByName(nowLink, 'page_num');
4316            let newLink;
4317            if(linkPage != ''){
4318                newLink = nowLink.replace('&page_num='+linkPage, '&page_num='+page);
4319            }else{
4320                let prevParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[0];
4321                let lastParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[1];
4322                newLink = prevParam + '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE + '&page_num=' + page + lastParam;
4323            };
4324            history.replaceState(null, null, newLink);  
4325        };
4326
4327        //페이지 갱신 내용에 맞춰 상품 display 변경
4328        let condition = function(v, i){
4329            if(i >= startViewIndex && i <= lastViewIndex ){
4330                return true;
4331            }else{
4332                return false;
4333            };
4334        };
4335        IVPrdDynamicCall.filtering(no, condition, $basePrdList);
4336    },
4337
4338    saveCache : function(moredata, count){
4339        //캐시 저장 기능 사용 시 
4340        if(typeof moredata['b_cache'] !== 'undefined'){
4341            if(moredata['cate_no']){
4342                EC$.cookie('mobile_more_current_page_' + moredata['cate_no'], (count), { expires: 1 });
4343            }else{
4344                EC$.cookie('mobile_more_current_page_' + moredata['display_group'], (count), { expires: 1 });
4345            };
4346        };
4347    },
4348
4349    filtering : function(no, condition, $basePrdList){
4350        /**
4351         * 상품 목록 필터링
4352         * @ prdListData : no 기준 상품 데이터
4353         * @ $prdList : 상품 목록이 붙는 영역
4354         * @ gridMax : 상품 목록 grid 기준 (class 부여 기준)
4355         */
4356        let prdListData = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA'+no],
4357            $prdList = $basePrdList.find('.prdList'),
4358            gridMax; 
4359        if($basePrdList.find('.iv_dynamic_nodata')){$basePrdList.find('.iv_dynamic_nodata').remove();}
4360        let gridClassChk = function(item){ if(item.indexOf('grid') > -1){ return true; } }
4361        let gridClassList = $prdList[0].classList.value.split(' ');
4362        if(gridClassList){
4363            gridMax = iv_util.onlyNumbFunc(gridClassList.filter(gridClassChk)) - 1;
4364        };
4365        if(gridMax == -1){
4366            gridMax = 1;	
4367        };
4368        let num = 0;
4369        let result = [];
4370        result = prdListData.reduce(function(acc, v, i, arr){
4371            let $prdEl = $prdList.children('[id^="anchorBoxId_"]').eq(i);
4372            if($prdEl.length > 0){
4373                let nClassChk = function(item){ if(item.indexOf('n') == 0){ return true; } }
4374                let nClass = $prdEl[0].classList.value.split(' ').filter(nClassChk);
4375                $prdEl.removeClass('on last-view even filter-chk '+ nClass);
4376            };
4377            if(condition(v,i) !== false){
4378                if(num > gridMax){ 
4379                    num = 0;
4380                    num++;
4381                }else{ 
4382                    num++; 
4383                };
4384                let addClass = '';
4385                if(num == 2 && gridMax == 1){
4386                    addClass = 'even';
4387                };
4388                $prdEl.addClass('on filter-chk n'+num + ' ' + addClass);
4389                acc[i] = i;
4390                return acc;
4391            }else{
4392                //$prdEl.removeClass('on');
4393                return acc;
4394            };
4395        },[]);
4396        if(result.length == 0){
4397            $basePrdList.append('<div class="iv_base_nodata iv_dynamic_nodata"><p>결과가 없습니다.</p></div>');
4398        }else{
4399            let lastIndex = result[result.length-1];
4400            $prdList.children().eq(lastIndex).addClass('last-view');
4401        };
4402        //console.log(result);
4403        IVPrdItemInfoCall.init(basePrdItemInfoCallCustom, $basePrdList.find('[id^="anchorBoxId_"].on')); 
4404
4405        return result;
4406    },
4407
4408
4409    run : function(no, $basePrdList){
4410
4411        /**
4412         * 상품 동적 호출 시작
4413         * @ no : 영역별 고유 번호
4414         * @ $basePrdList : .base_prd_list
4415         */
4416        let $prdList; //상품이 붙을 영역
4417        let $basicButton = $basePrdList.siblings('[class*="xans-product-listmore"]'); //기존 더보기 버튼 (base_prd_list 다음 요소여야 정상 동작)
4418
4419        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no]; //카페24 기본 설정
4420        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no]; //IV 커스텀 설정
4421        let moredata = IVPrdDynamicCall.setData(no); //ajax 호출 요청 시 필요한 데이터
4422        let ajaxLink = IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_URL[Number(ivSettingArray.ivlink)]; //ajax 링크
4423
4424        let defaultViewCount =  moredata['count']; //기본 노출 수 
4425        let pageChk = moredata['page'];
4426
4427        let type = ivSettingArray.ivmoretype; //더보기 출력 방식(페이지네이션/더보기/무한스크롤/swipe)
4428        let sTargetModuleName = ivSettingArray['ivmodule'];
4429        let sStorageListName = ivSettingArray['ivstorage'];
4430
4431        let sStorageListData;
4432
4433        let chkCount = pageChk; //ajax 호출 완료 체크용
4434
4435        let typeChk; 
4436        let lastPageChk = 0;
4437
4438        let lastPageNum;
4439        let resultType = true;
4440
4441        /**
4442         * 고유번호별 데이터 저장 위치 지정
4443         */
4444        if(typeof IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no] === 'undefined'){
4445            IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no] = [];
4446        };
4447
4448        /**
4449         * 기존 더보기 버튼 유무에 따라 호출 방식 지정
4450         * @ seq 동기 호출
4451         * @ async 비동기 호출
4452         */
4453        if($basicButton.length > 0){
4454            $basicButton.hide(); //기존 버튼 감춤
4455            if(sTargetModuleName.indexOf('xans-product-listmain') > -1 && Number(basicSettingArray['display_group']) != 0){
4456                typeChk = 'seq';
4457            }else{
4458                typeChk = 'async';
4459            };
4460        }else{
4461            typeChk = 'seq';
4462        };
4463
4464        //필터 사용 여부 
4465        let filterUseChk = false;
4466        if(($basePrdList.attr('data-ivdynamic-connect') !== 'undefined') && (typeof ivSettingArray.ivfilter !== 'undefined') ){
4467            filterUseChk = true;	
4468        }
4469        $basePrdList.attr('data-ivdynamic-type', type);
4470        let testchkCount = 0;
4471
4472        /**
4473         * 캐시 저장 유무에 따른 분류 
4474         */
4475        if(Number(basicSettingArray['first_page']) !== 1 && basicSettingArray.b_cache =='yes'){
4476            ( storageDataChk = function(){
4477                try {
4478                    sStorageListData = sessionStorage.getItem(sStorageListName);
4479                    if(sStorageListData){
4480                        console.log('캐시 사용하고 있고 세션에 데이터 있음');
4481                        IVPrdDynamicCall.displayMore(ajaxLink, '', moredata, defaultViewCount, true).then(function(res) {
4482                            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG = 'wait'; //캐시사용시 상품 append flag 시작
4483                            callDataNormal();
4484                        });
4485                    }else{
4486                        testchkCount++;
4487                        if(testchkCount < 5){
4488                            setTimeout(function(){storageDataChk();},100);
4489                        }else{
4490                            console.log('캐시 사용하고 있는데 세션에 데이터 없음');
4491                            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG = false; //캐시사용시 상품 append flag 필요X
4492                            callDataNormal();
4493                        };
4494                    };
4495                } catch (e) {
4496                }
4497            })();
4498        }else{
4499            console.log('첫번째 호출이거나 캐시 저장 기능 사용안함');
4500            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG = false; //캐시사용시 상품 append flag 필요X
4501            callDataNormal();
4502        };
4503
4504        /**
4505         * 영역타입별 상품 호출
4506         */
4507        function callDataNormal(){
4508            //상품 분류 페이지 일반 상품 영역
4509            if($basePrdList[0] == IVPrdDynamicCall._prdList_categoryList){
4510                callData();
4511            }
4512            //상품 분류 페이지의 일반 상품 영역이 아닌 경우 
4513            else{
4514                let testData = JSON.parse(JSON.stringify(moredata));
4515                testData['page'] = 1;
4516                IVPrdDynamicCall.displayMore(ajaxLink, '', testData, defaultViewCount, true).then(function(res) {
4517                    let prdData = res;
4518                    $basePrdList.find('.prdList').html(IVPrdDynamicCall.getLiTemplate(sTargetModuleName, res));
4519                    callData();
4520                });
4521            };
4522        };
4523
4524        /**
4525         * 더보기 방식에 따라 분기처리
4526         */
4527        function callData(){
4528            /**
4529             * @ page : 페이지네이션
4530             * @ button : 더보기 버튼
4531             * @ scroll : 무한스크롤
4532             * @ swipe : swiper 
4533             */
4534            switch(type){
4535                case 'page' :
4536                    $prdList = $basePrdList.find('.prdList');
4537                    ( dataCall = function(){
4538                        if(typeChk === 'seq'){
4539                            call_seq(resultType);
4540                        }else{
4541                            call_async(resultType);
4542                        };
4543                    })();
4544                    break;
4545                case 'button' :
4546                    $basicButton.hide();
4547                    $prdList = $basePrdList.find('.prdList');
4548                    if(typeChk === 'seq'){
4549                        call_seq(resultType);
4550                    }else{
4551                        call_async(resultType);
4552                        //filterUseChk = false;
4553                    };
4554                    break;
4555                case 'scroll' :
4556                    $basicButton.hide();
4557                    $prdList = $basePrdList.find('.prdList');
4558                    if(typeChk === 'seq'){
4559                        call_seq(resultType);
4560                    }else{
4561                        call_async(resultType);
4562                    };
4563                    filterUseChk = false;
4564                    break;
4565                case 'swipe' :
4566                    filterUseChk = false;
4567                    $basicButton.hide();
4568                    $prdList = $basePrdList.find('.prdList');
4569                    //sessionStorage.removeItem(sStorageListName);
4570                    resultType = false;
4571                    if(! $prdList.hasClass('swiper-wrapper')){
4572                        $prdList.addClass('iv_swiper');
4573                        $prdList.attr('data-ivswipe-name', 'ivdynamic'+no);
4574                        $prdList.attr('data-ivswipe-custom', 'false');
4575                        $prdList.attr('data-ivswipe-module', 'scrollbar');
4576                        callDataNormal_Swipe();
4577                    }else{
4578                        callDataNormal_Swipe();
4579                    };
4580                    function callDataNormal_Swipe(){
4581                        if(typeChk === 'seq'){
4582                            call_seq(resultType).then(function(resFin) {
4583                                $prdList.iv_swiperFunc();
4584                                let swiperName = $prdList.attr('data-ivswipe-name');
4585                                window[swiperName].on('reachEnd',function(){
4586                                    let beforeLength = $prdList.children().filter('[data-prd]').length;
4587                                    let sliceArray = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no].slice(beforeLength, beforeLength+Number(defaultViewCount));
4588                                    if(sliceArray.length > 0){
4589                                        $prdList.append(IVPrdDynamicCall.getLiTemplate(sTargetModuleName, sliceArray));
4590                                    };
4591                                });
4592                            });
4593                        }else{
4594                            call_async(resultType).then(function(resFin) {
4595                                $prdList.iv_swiperFunc();
4596                                let swiperName = $prdList.attr('data-ivswipe-name');
4597                                window[swiperName].on('reachEnd',function(){
4598                                    let beforeLength = $prdList.children().filter('[data-prd]').length;
4599                                    let sliceArray = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no].slice(beforeLength, beforeLength+Number(defaultViewCount));
4600                                    if(sliceArray.length > 0){
4601                                        $prdList.append(IVPrdDynamicCall.getLiTemplate(sTargetModuleName, sliceArray));
4602                                    };
4603                                });
4604                            });
4605                        };
4606                    };
4607                    //if(IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG === false){
4608                    if(typeof IVPrdDynamicCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION === 'function'){
4609                        IVPrdDynamicCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION();
4610                    };
4611                    IVPrdDynamicCall.initAfter();
4612                    $basePrdList.addClass('ivdynamic-done');
4613                    //}
4614                    break;
4615                default :
4616                    break;
4617            };
4618
4619            if(filterUseChk === false){
4620                IV$('.iv_dynamic_filter:not(.done)').addClass('displaynone');
4621            };
4622
4623            //순차 연쇄 실행
4624            function call_seq(resultType){
4625                console.log('동기 연쇄 실행');
4626                return new Promise(function (resFin, rejFin) {
4627                    let count = Number(IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_COUNT);
4628                    //sessionStorage.removeItem(sStorageListName);
4629                    ( seqDataCall = function(){
4630                        IVPrdDynamicCall.displayMore(ajaxLink, '', moredata, count).then(function(res) {
4631                            if(res != 'end'){
4632                                moredata['page'] = Number(moredata['page']) + 1;
4633                                chkCount++;
4634                                seqDataCall();
4635                            }else{
4636                                resFin(true);
4637                            };
4638                        });
4639                    })();
4640                }).then(function(resFin){
4641                    IVPrdDynamicCall.dynamicDataEnd(no, $basePrdList, moredata, type);
4642                });
4643            };
4644            //비동기 연쇄 실행
4645            function call_async(resultType){
4646                console.log('비동기 연쇄 실행');
4647                return new Promise(function (resFin, rejFin) {
4648                    let count = Number(IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_COUNT); //한 번 호출 실행 시 호출할 상품 수 
4649                    //sessionStorage.removeItem(sStorageListName);
4650                    let maxPrdCount;
4651                    let test = Number($basicButton.find('[id^="more_total_page"]').text()); //더보기 버튼에 적힌 마지막 페이지 숫자
4652                    maxPrdCount = Number($basicButton.find('[id^="more_total_page"]').text()) * defaultViewCount; //페이지 기준 최대 수량 
4653                    let callCount = Math.ceil(maxPrdCount/Number(IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_COUNT)); //필요한 ajax 호출 횟수
4654                    if(pageChk > callCount){
4655                        callCount = pageChk;
4656                    };
4657                    if(callCount > 0){ 
4658                        for(let i=pageChk; i<=callCount; i++){
4659                            moredata['page'] = i;
4660                            IVPrdDynamicCall.displayMore(ajaxLink, '', moredata, count).then(function(res) {
4661                                if(chkCount == callCount){
4662                                    //IVPrdDynamicCall.dynamicDataEnd(no, $basePrdList, moredata, type);
4663                                    resFin(true);
4664                                }else{
4665                                    //console.log(chkCount);
4666                                    chkCount++;
4667                                };
4668                            });
4669                        };
4670                    };
4671                }).then(function(resFin){
4672                    IVPrdDynamicCall.dynamicDataEnd(no, $basePrdList, moredata, type);
4673                });
4674            };
4675        };
4676    },
4677
4678    displayMore : function(url, $prdList, moredata, customCount, dataChk){
4679        let ajaxData =  JSON.parse(JSON.stringify(moredata)); // 최종호출 data
4680        let idx;
4681        if(typeof moredata['idx'] !== 'undefined'){
4682            idx = moredata['idx'];
4683            delete ajaxData['idx'];
4684        }else{
4685            idx = 999;
4686            delete ajaxData['ivmodule'];
4687        };
4688        let pageChk =  moredata['page'];
4689        delete ajaxData['first_page'];
4690        let count = moredata['count'];
4691        if(typeof customCount !== 'undefined'){
4692            ajaxData['count'] = customCount; 
4693        };
4694
4695        if(moredata['cate_no'] === 1){
4696            delete ajaxData['cate_no'];
4697        };
4698
4699
4700
4701        let sStorageListName;
4702        let sStorageListData;
4703        if(typeof moredata['display_group'] !== 'undefined'){
4704            sStorageListName = 'sStorageList_' + moredata['display_group'];
4705        };
4706        if(typeof moredata['cate_no'] !== 'undefined'){
4707            sStorageListName = 'sStorageList_' + moredata['cate_no'] + '_' + moredata['display_group'];
4708        };
4709        try {
4710            sStorageListData = sessionStorage.getItem(sStorageListName);
4711        } catch (e) {
4712        };
4713
4714        return new Promise(function (res, rej) {
4715            IV$.ajax({
4716                url: url,
4717                type: 'GET',
4718                dataType: 'json',
4719                data: ajaxData,
4720                success: function (data) {
4721                    var prdData = data["rtn_data"]["data"];
4722                    if(prdData != null){
4723                        if (prdData.length) {
4724                            if(dataChk){
4725                                if (sStorageListData !== null && idx !== 999) {
4726                                    IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + idx] = prdData;
4727                                };
4728                                if(data['rtn_data'].end){
4729                                    res('end');
4730                                }else{
4731                                    res(prdData);
4732                                };
4733                            }else{
4734                                if(idx !== 999){
4735                                    prdData.forEach(function(e, i){
4736                                        let num = ((pageChk-1)*Number(customCount)) + i;
4737                                        if(IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + idx]){
4738                                            IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + idx][num] = e;
4739                                        };
4740                                    });
4741                                }else{
4742                                    if($prdList !== '' && typeof $prdList !== 'undefined'){
4743                                        let sTargetModuleName;
4744                                        if(IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[idx]){
4745                                            sTargetModuleName = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[idx]['ivmodule'];
4746                                        }else{
4747                                            sTargetModuleName = moredata['ivmodule'];
4748                                        };
4749                                        $prdList.append(IVPrdDynamicCall.getLiTemplate(sTargetModuleName, prdData));
4750                                    };
4751                                };
4752                                if(data['rtn_data'].end){
4753                                    res('end');
4754                                }else{
4755                                    res('continue');
4756                                };
4757                            };
4758                        };
4759                    }else{
4760                        res('end');
4761                    };
4762                },
4763                error:function(request,status,error){
4764                    console.log("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
4765                }
4766
4767            });
4768        });
4769    },
4770
4771    makeMoreButton: function(no, $basePrdList, moredata){
4772
4773        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no];
4774        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no];
4775        let prdListData = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no];
4776
4777        let startNum = basicSettingArray.first_page;
4778        let lastNum;
4779        let $basicButton = $basePrdList.siblings('[class*="xans-product-listmore"]');
4780        $basicButton.hide();
4781        let count = Number(basicSettingArray.count);
4782        if(prdListData){
4783            lastNum = Math.ceil(prdListData.length/count);
4784        }else{
4785            lastNum = $basicButton.find('[id^="more_total_page"]').text();
4786        };
4787        if(startNum >= lastNum){
4788            startNum = lastNum;
4789        };
4790
4791        let $moreButtonHtml = '<div class="base_paginate_container iv_dynamic_moreButton" data-ivdynamic-page="'+ startNum +'" data-ivdynamic-count="'+ count +'" data-ivdynamic-idx="'+ no +'" data-ivdynamic-last="'+ lastNum +'" ><div class="iv_button">';
4792        $moreButtonHtml += '<a href="javascript:void(0);"><span>'+ IVPrdDynamicCall.__IV_DEFAULT_VALUE_MOREBUTTON_TEXT +'</span>';
4793        $moreButtonHtml += '<span id="more_current_page_iv_dynamic_'+ no +'">'+ startNum +'</span>/<span id="more_total_page_iv_dynamic_'+ no +'">'+ lastNum +'</span>';
4794        $moreButtonHtml = IV$($moreButtonHtml);
4795        if(startNum >= lastNum){ $moreButtonHtml.hide(); };
4796        $moreButtonHtml.insertAfter($basePrdList);
4797        IVPrdDynamicCall.clickButton(no, $basePrdList, moredata);
4798
4799        let typeChk = $basePrdList.attr('data-ivdynamic-type');
4800        if((typeChk !== 'button') || (typeChk === 'button' && lastNum == 1)){ $moreButtonHtml.hide(); }
4801        //if(IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG === false){
4802        IVPrdDynamicCall.filter(no, $basePrdList);
4803        //}
4804
4805    },
4806
4807    clickButton : function(no, $basePrdList, moredata){
4808        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no];
4809        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no];
4810        let prdListData = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA' + no];
4811        let lastNum;
4812        let $basicButton = $basePrdList.siblings('[class*="xans-product-listmore"]');
4813        let count = Number(basicSettingArray.count);
4814        if(prdListData){
4815            lastNum = Math.ceil(prdListData.length/count);
4816        }else{
4817            lastNum = $basicButton.find('[id^="more_total_page"]').text();
4818        };
4819        let ajaxLink = IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_URL[Number(ivSettingArray.ivlink)];
4820        let $moreButton = $basePrdList.siblings('.iv_dynamic_moreButton[data-ivdynamic-idx="'+no+'"]');
4821        $moreButton['bLoading'] = true;
4822
4823        if(typeof prdListData !== 'undefined'){
4824            $moreButton.off().on('click',function(){
4825                let nowPage = Number($moreButton.attr('data-ivdynamic-page'));
4826                let nextPage = nowPage + 1;
4827                let viewCount = Number($moreButton.attr('data-ivdynamic-count'));
4828                let maxCount = Number($moreButton.attr('data-ivdynamic-last'));
4829                let lastViewIndex = nextPage * viewCount - 1;
4830                let condition = function(v, i){
4831                    if(i <= lastViewIndex ){
4832                        return true;
4833                    }else{
4834                        return false;
4835                    };
4836                };
4837                //현재 주소줄 내용 갱신 ---> 상품 분류 페이지 & 일반 상품 영역 일 경우에만
4838                if($basePrdList[0] == IVPrdDynamicCall._prdList_categoryList){
4839                    let makePage;
4840                    let nowLink = window.location.href;
4841                    let linkPage = iv_util.getParameterByName(nowLink, 'page_num');
4842                    let newLink;
4843                    if(linkPage != ''){
4844                        newLink = nowLink.replace('&page_num='+linkPage, '&page_num='+nextPage);
4845                    }else{
4846                        let prevParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[0];
4847                        let lastParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[1];
4848                        newLink = prevParam + '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE + '&page_num=' + nextPage + lastParam;
4849                    };
4850                    history.replaceState(null, null, newLink);  
4851                };
4852                IVPrdDynamicCall.filtering(no, condition, $basePrdList);
4853                if(nextPage >= maxCount){
4854                    $moreButton.hide();
4855                    $moreButton.addClass('displaynone');
4856                }else{
4857                    IVPrdDynamicCall.infinitScroll(no, $basePrdList, $moreButton);
4858                };
4859                if(nextPage <= maxCount){
4860                    $moreButton.attr('data-ivdynamic-page', nextPage);
4861                    $moreButton.find('[id^="more_current_page"]').text(nextPage);
4862                    IVPrdDynamicCall.saveCache(moredata, nextPage);
4863                };
4864            });
4865        }else{
4866            $moreButton.off().on('click',function(){
4867                if(! $moreButton['bLoading']){
4868                    console.log('호출 기능 비활성화');
4869                }else{
4870                    console.log('호출 기능 활성화');
4871                    let nowPage = Number($moreButton.attr('data-ivdynamic-page'));
4872                    let nextPage = nowPage + 1;
4873                    let viewCount = Number($moreButton.attr('data-ivdynamic-count'));
4874                    let maxCount = Number($moreButton.attr('data-ivdynamic-last'));
4875                    moredata['page'] = nextPage;
4876                    $moreButton['bLoading'] = false;
4877                    //현재 주소줄 내용 갱신 ---> 상품 분류 페이지 & 일반 상품 영역 일 경우에만
4878                    if($basePrdList[0] == IVPrdDynamicCall._prdList_categoryList){
4879                        let makePage;
4880                        let nowLink = window.location.href;
4881                        let linkPage = iv_util.getParameterByName(nowLink, 'page_num');
4882                        let newLink;
4883                        if(linkPage != ''){
4884                            newLink = nowLink.replace('&page_num='+linkPage, '&page_num='+nextPage);
4885                        }else{
4886                            let prevParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[0];
4887                            let lastParam = nowLink.split('?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE)[1];
4888                            newLink = prevParam + '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE + '&page_num=' + nextPage + lastParam;
4889                        };
4890                        history.replaceState(null, null, newLink);  
4891                    };
4892
4893                    IVPrdDynamicCall.displayMore(ajaxLink, $basePrdList.find('.prdList'), moredata).then(function(res) {
4894                        $moreButton['bLoading'] = true;
4895                        if(res == 'end'){
4896                            $moreButton.hide();
4897                            $moreButton.addClass('displaynone');
4898                            $moreButton['bLoading'] = false;
4899                        }else{
4900                            $moreButton.find('[id^="more_current_page"]').text(nextPage);
4901                            $moreButton.attr('data-ivdynamic-page', nextPage)
4902                            IVPrdDynamicCall.infinitScroll(no, $basePrdList, $moreButton);
4903                        };
4904                        if(nextPage <= maxCount){
4905                            IVPrdDynamicCall.saveCache(moredata, nextPage);
4906                        };
4907                    });
4908                };
4909            });
4910        };
4911    },
4912
4913    infinitScroll : function(no, $basePrdList, $moreButton){
4914        if($basePrdList.attr('data-ivdynamic-type') === 'scroll'){
4915            let basicTag = $basePrdList.find('.prdList').children('[data-prd]').eq(0)[0].tagName.toLowerCase();
4916            if(! $moreButton.hasClass('displaynone')){
4917                var lastObserveFunc = function (a, b, c){
4918                    if (a.isIntersecting) {
4919                        IV$(a.target).removeClass('iv-isIntersecting');
4920                        b.disconnect();
4921                        $moreButton.trigger('click');
4922                    };
4923                };
4924                let findlastElidx = $basePrdList.find('.prdList').children().filter('.filter-chk').last().index();
4925                let findlastEl = '.iv_dynamic_prdList_'+ no +' .prdList > ' + basicTag + ':nth-child('+ findlastElidx +')';
4926                iv_util.IntersectionObserver(document.querySelectorAll(findlastEl), {
4927                    root: null, 
4928                    threshold: [0.95],
4929                }, lastObserveFunc);
4930            }else{
4931                return false;
4932            };
4933        }else{
4934            return false;
4935        };
4936    },
4937
4938    filter : function(no, $basePrdList){
4939
4940        /**
4941         * @ prdListData : no 기준 상품 데이터
4942         * 
4943         */
4944
4945        let ivSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_IVSETTING_CONDITION_ARRAY[no];
4946        let basicSettingArray = IVPrdDynamicCall.__IV_DEFAULT_VALUE_CONDITION_ARRAY[no];
4947        let prdListData = IVPrdDynamicCall['__IV_DEFAULT_VALUE_PRDLIST_ALL_DATA'+no];
4948
4949        let connect = $basePrdList.attr('data-ivdynamic-connect');
4950        let $curation = IV$('#iv_dynamic_curation[data-ivdynamic-connect='+ connect +']'); //큐레이션 영역 있으면 
4951        let $filter = IV$('.iv_dynamic_filter[data-ivdynamic-connect='+ connect +']'); //동적 필터 전체 영역
4952        $filter.addClass('done');
4953
4954        let filterType = ivSettingArray.ivfilter; //동적 필터 선택 타입 multiple (복수 선택 가능) / single (단일 선택)
4955        let moreViewType = ivSettingArray.ivmoretype; //더보기 타입
4956        let $paginate = $basePrdList.siblings('.iv_dynamic_paginate[data-ivdynamic-idx="'+no+'"]');
4957        let $moreButton = $basePrdList.siblings('.iv_dynamic_moreButton[data-ivdynamic-idx="'+no+'"]');
4958
4959        let $section = $filter.find('[data-ivdynamic-var]'); //조건별 섹션
4960        let sectionLength = $section.length; //섹션 수 
4961        let $filterButton = $filter.find('.iv_filter'); //필터 버튼
4962        let $filterAllButton = $section.find('.iv_filter[data-ivdynamic-type="all"]');
4962 //전체선택 버튼(== 해당영역 리셋)
4963
4964        let $sort = IV$('.iv_dynamic_sort[data-ivdynamic-connect='+ connect +']');
4965        let $sortButton = $sort.find('.iv_filter'); //정렬 버튼
4966
4967        let $curationButton = $curation.find('.iv_dynamic_buttons .iv_filter'); //큐레이션 버튼
4968
4969        let type = Number(ivSettingArray.ivlink);
4970        let defaultView = Number(basicSettingArray.count);
4971        let $prdList = $basePrdList.find('.prdList');
4972        let sTargetModuleName = ivSettingArray.ivmodule;
4973
4974        let filterResultType = 1;
4975
4976        //필터 버튼 형태 수정 (input태그 없을 경우 생성)
4977        ($sortButton, $filterButton).each(function(idx,el){
4978            let $el = IV$(el),
4979                parentIdx = $el.closest($section).index();
4980            if($el.find('input').length == 0){
4981                let text = $el.text().trim();
4982                $el.children().append('<input type="checkbox" name="filter_'+parentIdx+'" id="'+ text +'" / ><label></label>\n');
4983            };
4984        });
4985        $filterButton.each(function(){
4986            let val = IV$(this).closest($section).attr('data-ivdynamic-var'); 
4987            let idx = IV$(this).closest($section).index();
4988            let inputId = IV$(this).find('input').attr('id');
4989            $filterButton.css('cursor','pointer');
4990            $filterButton.children().css('pointer-events','none');
4991            IV$(this).attr('data-ivdynamic-val', val + '_'+ idx + '_' + inputId);
4992            IV$(this).find('input').attr('id',val + '_' + idx + '_' + inputId);
4993            IV$(this).find('input').next('label').attr('for',val +  '_'  + idx + '_' + inputId);
4994        });
4995
4996
4997        let saveTimeChk = false;
4998        let filterDIsplayChk = false;
4999        let storage_ivCateInfo = sessionStorage.getItem('iv_cate_info');
5000        let storage_ivCateInfo2 = sessionStorage.getItem('iv_cate_info2');
5001        let storage_ivCateInfo3 = sessionStorage.getItem('iv_cate_info3');
5002        let defaultSort = iv_util.getParameterByName(IV_LOCATION_HREF, 'sort_method');
5003
5004        if($basePrdList[0] == IVPrdDynamicCall._prdList_categoryList){
5005            window['IV_CATE_INFO'] = {
5006                'cateNo' : IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE,
5007                'viewType' : null,
5008                'scrollTop' : null,
5009                'oriCatePage' : null,
5010                'saveTime' : null,
5011            };
5012            window['IV_CATE_INFO2'] = prdListData.slice(0,IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_COUNT*2);
5013            window['IV_CATE_INFO3'] =  null;
5014
5015            var iNowTime = Math.floor(new Date().getTime() / 1000);
5016            var iSessionTime = 60 * 5;
5017            try {
5018                if(typeof storage_ivCateInfo3 === 'string' && typeof storage_ivCateInfo2 !== 'undefined' && typeof storage_ivCateInfo !== 'undefined'){
5019                    storage_ivCateInfo = JSON.parse(storage_ivCateInfo);
5020                    storage_ivCateInfo2 = JSON.parse(storage_ivCateInfo2);
5021                    storage_ivCateInfo3 = JSON.parse(storage_ivCateInfo3);
5022                    if(typeof storage_ivCateInfo3 === 'string' && iNowTime - Number(storage_ivCateInfo['saveTime']) < iSessionTime && storage_ivCateInfo['oriCatePage'] === window.location.href){
5023                        saveTimeChk = true;
5024                        $('html,body').animate({scrollTop:storage_ivCateInfo['scrollTop']}, 0);
5025                    };
5026                };
5027            }
5028            catch (err) {
5029                console.log(err); 
5030                sessionStorage.removeItem('iv_cate_info');
5031                sessionStorage.removeItem('iv_cate_info2');
5032                sessionStorage.removeItem('iv_cate_info3');
5033            };
5034            Object.keys(sessionStorage).forEach(function(el){
5035                if(el.indexOf('coupon_download_') > -1){
5036                    sessionStorage.removeItem(el);
5037                };
5038            });
5039            let appendLength = IV$(IVPrdDynamicCall._prdList_categoryList).find('[id^="anchorBoxId_"]').length;
5040            let arrayFin = prdListData.slice(appendLength);
5041            let templete = IVPrdDynamicCall.getLiTemplate(sTargetModuleName, arrayFin);
5042            if(templete.trim() != ''){
5043                $prdList.append(templete);
5044            };
5045            if(! saveTimeChk){
5046                saveTimeChk = Math.floor(new Date().getTime() / 1000);
5047            }else{
5048                saveTimeChk = storage_ivCateInfo['saveTime'];
5049            };
5050
5051            /**
5052             * 상품 클릭할때 데이터 세션에 저장 
5053             */
5054            IV$(document).on('click', '.prdItem_normalBox .prdList [id^="anchorBoxId_"]', function(e){
5055                var target = e.target;
5056                if(target.classList.contains('ec-admin-icon') || target.classList.contains('Prev_Cart')){
5057                }else{
5058                    let viewType = null;
5059                    if(IV$('.iv_viewType').is(':visible')){
5060                        viewType = IV$('.iv_viewType').attr('data-view');
5061                    };
5062                    window['IV_CATE_INFO']['viewType'] = viewType;
5063                    window['IV_CATE_INFO']['scrollTop'] = window.pageYOffset;
5064                    window['IV_CATE_INFO']['oriCatePage'] = window.location.href;
5065                    window['IV_CATE_INFO']['saveTime'] = saveTimeChk;
5066                    let html = '';
5067                    IV$('.prdItem_normalBox .prdList [id^="anchorBoxId_"]').each(function(idx,el){
5068                        if(idx < IVPrdDynamicCall.__IV_DEFAULT_VALUE_AJAX_COUNT*1.5){
5069                            html+= el.outerHTML;
5070                        };
5071                    });
5072                    window['IV_CATE_INFO3'] = html;
5073                    sessionStorage.setItem('iv_cate_info',  JSON.stringify(window['IV_CATE_INFO']));
5074                    sessionStorage.setItem('iv_cate_info2',  JSON.stringify(window['IV_CATE_INFO2']));
5075                    sessionStorage.setItem('iv_cate_info3',  JSON.stringify(window['IV_CATE_INFO3']));
5076                };
5077            });
5078
5079            //주소줄 정렬값 적용 
5080            if(defaultSort){
5081                $sortButton.filter('[data-ivdynamic-val$="sort_method='+ defaultSort +'"]').addClass('on');
5082                $sortButton.filter('[data-ivdynamic-val$="sort_method='+ defaultSort +'"]').find('input').prop('checked',true);
5083            };
5084
5085        }else{
5086            //let appendLength = $prdList.find('[id^="anchorBoxId_"]').length;
5087            //let arrayFin = prdListData.slice(appendLength);
5088            let templete = IVPrdDynamicCall.getLiTemplate(sTargetModuleName, prdListData);
5089            if(templete.trim() != ''){
5090                $prdList.append(templete);
5091            };
5092        };
5093
5094        if(IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG === 'wait'){
5095            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CACHE_ITEM_APPEND_CHK_FLAG = true;
5096        };
5097        if(typeof IVPrdDynamicCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION === 'function'){
5098            IVPrdDynamicCall.__IV_DEFAULT_VALUE_CUSTOM_FUNCTION();
5099        };
5100
5101        IVPrdDynamicCall.initAfter();
5102        $basePrdList.addClass('ivdynamic-done');
5103
5104
5105        /**
5106         * 주소줄 기본값 적용  
5107         */
5108        let defaultPage = iv_util.getParameterByName(IV_LOCATION_HREF, 'page_num');
5109        defaultPage = (defaultPage == '') ? 1 : defaultPage;
5110        let defaultFilter = '';
5111        $section.each(function(i,e){
5112            let chkVar = IV$(e).attr('data-ivdynamic-var');
5113            let chkVarValue;
5114            if($section.length == 1){
5115                chkVarValue = iv_util.getParameterByName(IV_LOCATION_HREF, 'custom_filter');
5116            }else{
5117                chkVarValue = iv_util.getParameterByName(IV_LOCATION_HREF, 'custom_filter_' + chkVar);
5118            };
5119            let idx = IV$(e).index();
5120            if(chkVarValue){
5121                chkVarValue = (chkVarValue.indexOf('_') > -1) ? chkVarValue.split('_') : [chkVarValue];
5122                if(chkVarValue[0].trim() == 'all'){
5123                    IV$(e).find('.iv_filter[data-ivdynamic-val="all"]').addClass('on');
5124                    IV$(e).find('.iv_filter[data-ivdynamic-val="all"] input').prop('checked',true);
5125                }else{
5126                    chkVarValue.forEach(function(e2, i2){
5127                        IV$(e).find('.iv_filter[data-ivdynamic-val="'+ chkVar + '_' + idx + '_' + e2.trim() + '"]').addClass('on');
5128                        IV$(e).find('.iv_filter[data-ivdynamic-val="'+ chkVar + '_' + idx + '_' + e2.trim() + '"]').find('input').prop('checked',true);
5129                    });
5130                };
5131                defaultFilter += chkVarValue;
5132            };
5133        });
5134        if(defaultFilter.trim() == ''){ //커스텀 필터값 없음 -> 페이지만 적용
5135            if(moreViewType == 'page'){
5136                $paginate.attr('data-ivdynamic-page',defaultPage);
5137                $paginate.find('ol li a[data-page="'+ defaultPage +'"]').addClass('this');
5138                $paginate.find('ol li a[data-page="'+ defaultPage +'"]').parent().addClass('on');
5139                if(! filterDIsplayChk){
5140                    IVPrdDynamicCall.goPage(no, defaultPage, $basePrdList);
5141                };
5142            }
5143            else if(moreViewType == 'button' || moreViewType == 'scroll'){
5144                $moreButton.attr('data-ivdynamic-page', defaultPage);
5145                $moreButton.find('[id^="more_current_page"]').text(defaultPage);
5146                let viewCount = Number($moreButton.attr('data-ivdynamic-count'));
5147                let maxCount = Number($moreButton.attr('data-ivdynamic-last'));
5148                let lastViewIndex = defaultPage * viewCount - 1;
5149                let condition = function(v, i){
5150                    if(i <= lastViewIndex ){
5151                        return true;
5152                    }else{
5153                        return false;
5154                    };
5155                };
5156                if(! filterDIsplayChk){
5157                    IVPrdDynamicCall.filtering(no, condition, $basePrdList);
5158                }
5159                if(defaultPage < maxCount){
5160                    if(moreViewType === 'button'){
5161                        $moreButton.show();
5162                    };
5163                    IVPrdDynamicCall.infinitScroll(no, $basePrdList, $moreButton);
5164                }else{
5165                    $moreButton.hide();
5166                };
5167            };
5168        }
5169        else{
5170            //커스텀 필터값 있음 -> 커스텀값 적용
5171            if($paginate.length > 0){
5172                $paginate.attr('data-ivdynamic-page',defaultPage);
5173                $paginate.find('ol li a[data-page="'+ defaultPage +'"]').addClass('this');
5174                $paginate.find('ol li a[data-page="'+ defaultPage +'"]').parent().addClass('on');
5175            }else if($moreButton.length > 0){
5176                $moreButton.attr('data-ivdynamic-page', defaultPage);
5177                $moreButton.find('[id^="more_current_page"]').text(defaultPage);
5178                let viewCount = Number($moreButton.attr('data-ivdynamic-count'));
5179                let maxCount = Number($moreButton.attr('data-ivdynamic-last'));
5180                if(defaultPage < maxCount){
5181                    if(moreViewType === 'button'){
5182                        $moreButton.show();
5183                    };
5184                }else{
5185                    $moreButton.hide();
5186                };
5187            };
5188            if(! filterDIsplayChk){
5189                filterCondition();
5190            };
5191        };
5192        if($curation.length > 0){
5193            filterResultType = 2;
5194            $sortButton.off().on('click',function(){
5195                let $this = IV$(this);
5196                if(! $this.hasClass('on')){
5197                    $this.addClass('on');
5198                    $this.find('input').prop('checked',true);
5199                    $sortButton.not($this).removeClass('on');
5200                    $sortButton.not($this).find('input').prop('checked',false);
5201                }else{
5202                    $this.removeClass('on');
5203                    $this.find('input').prop('checked',false);
5204                };
5205            });
5206            $curationButton.off().on('click',function(){
5207                let $this = IV$(this);
5208                let type = $this.attr('data-ivdynamic-val');
5209                if(type === 'search'){
5210                    let result = filterCondition();
5211                    window.location.href = '/product/list.html' + encodeURI(result);
5212                }else if(type === 'reset'){
5213                    $sort.find('.on').removeClass('on');
5214                    $section.find('.on').removeClass('on');
5215                    $sort.find('input').prop('checked',false);
5216                    $section.find('input').prop('checked',false);
5217                };
5218            });
5219        }else{
5220            filterResultType = 1;
5221            $sort.hide();
5222        };
5223        $filterButton.off().on('click', function(event){
5224            let $this = IV$(this);
5225            let type = $this.attr('data-ivdynamic-type');
5226            // 버튼 on/off 제어
5227            if(! $this.hasClass('on')){
5228                if(type === 'all'){
5229                    $this.addClass('on');
5230                    $this.find('input').prop('checked',true);
5231                    $this.siblings($filterButton).removeClass('on');
5232                    $this.siblings($filterButton).find('input').prop('checked',false);
5233                }else{
5234                    $this.addClass('on');
5235                    $this.find('input').prop('checked',true);
5236                    if(filterType !== 'multiple'){
5237                        $this.siblings($filterButton).removeClass('on');
5238                        $this.siblings($filterButton).find('input').prop('checked',false);
5239                    }else{
5240                        $this.siblings($filterButton).filter('[data-ivdynamic-type="all"]').removeClass('on');
5241                        $this.siblings($filterButton).filter('[data-ivdynamic-type="all"]').find('input').prop('checked',fal
5241se);
5242                    };
5243                };
5244            }else{
5245                $this.removeClass('on');
5246                $this.find('input').prop('checked',false);
5247            };
5248            if(filterResultType === 1){
5249                filterCondition();
5250            };
5251        });
5252        // 필터 컨디션 생성
5253        function filterCondition(){
5254            let allButtonOnLength = $filterAllButton.filter('.on').length;
5255            let sectionSelectLength = $section.has('.on').length;
5256            let makeParamFilter = '';
5257            let filterConditionChk;
5258            if(sectionLength == allButtonOnLength){
5259                //console.log('전체');
5260                filterConditionChk = 'all';
5261                condition = true;
5262            }else{
5263                $filter['filter'] = {};
5264                $section.each(function(i,e){
5265                    let chkVar = IV$(e).attr('data-ivdynamic-var');
5266
5267                    let text = IV$(e).find('.iv_filter.on').not('.iv_filter[data-ivdynamic-type="all"]').text().trim();
5268                    let textArray = [];
5269                    if(IV$(e).find('.iv_filter[data-ivdynamic-type="all"]').hasClass('on')){
5270                        textArray.push('all');
5271                    }else{
5272                        //iv_util.removeBlankFunc(text).split(/(\r\n|\n|\r)/gm).forEach(function(e2, i2){
5273                        //    if(e2 && e2 != '\n' && e2 != '\r' && e2 != ''){ textArray.push(e2); }
5274                        //});
5275                        IV$(e).find('.iv_filter.on').each(function(){
5276                            let $filterBtn = IV$(this);
5277                            let valueId = $filterBtn.find('input').attr('id');
5278                            if(valueId.indexOf('_') > -1){
5279                                valueId = valueId.split('_');
5280                                textArray.push(valueId[valueId.length-1]);
5281                            };
5282                        });
5283                    };
5284                    if(textArray.length !== 0){
5285                        if(textArray[0] != 'all'){
5286                            $filter['filter'][chkVar] = textArray;
5287                        };
5288                        if($section.length > 1){
5289                            makeParamFilter += '&custom_filter_' + chkVar + '=' + textArray.join('_');
5290                        }else{	
5291                            makeParamFilter += '&custom_filter=' + textArray.join('_');
5292                        };
5293                    };
5294                });
5295                let chkArray = JSON.parse(JSON.stringify($filter['filter']));
5296                if(sectionSelectLength>0){
5297                    $paginate.addClass('displaynone');
5298                    $moreButton.addClass('displaynone');
5299                    condition = function(v, i){
5300                        let chk = true;
5301                        let chk2 = true;
5302                        let length = Object.keys(chkArray).length;
5303                        for(let x=0; x<length; x++){
5304                            let key = Object.keys(chkArray)[x];
5305                            let value = chkArray[key];
5306                            if(chk === true){
5307                                let chkVal = v[key];
5308                                if(value.length > 0){
5309                                    let test = value.some(function(val) {
5310                                        return (chkVal.indexOf(val) > -1) ? true : false;
5311                                    });
5312                                    if(test === false){
5313                                        chk = false;
5314                                        break;
5315                                    };
5316                                };
5317                            };
5318                        };
5319                        if(chk === true){
5320                            return true;
5321                        }else{
5322                            return false;
5323                        };
5324                    };
5325                }else{
5326                    //console.log('선택된 것 없음');
5327                    filterConditionChk = 'reset';
5328                    IVPrdDynamicCall.infinitScroll(no, $basePrdList, $moreButton);
5329                };
5330            };
5331            if(filterResultType === 1){
5332                let makePage;
5333                if($paginate.length > 0){
5334                    makePage = Number($paginate.attr('data-ivdynamic-page'));
5335                }else{
5336                    makePage = Number($moreButton.attr('data-ivdynamic-page'));
5337                };
5338                if(filterConditionChk === 'reset'){
5339                    if($basePrdList.find('.iv_dynamic_nodata')){$basePrdList.find('.iv_dynamic_nodata').remove();}
5340                    if($paginate.length > 0){
5341                        $paginate.removeClass('displaynone');
5342                        IVPrdDynamicCall.goPage(no, makePage, $basePrdList);
5343                    }else{
5344                        $moreButton.removeClass('displaynone');
5345                        let viewCount = Number($moreButton.attr('data-ivdynamic-count'));
5346                        let maxCount = Number($moreButton.attr('data-ivdynamic-last'));
5347                        let lastViewIndex = makePage * viewCount - 1;
5348                        condition = function(v, i){
5349                            if(i <= lastViewIndex ){
5350                                return true;
5351                            }else{
5352                                return false;
5353                            };
5354                        };
5355                        IVPrdDynamicCall.filtering(no, condition, $basePrdList);
5356                    };
5357                }else{
5358                    IVPrdDynamicCall.filtering(no, condition, $basePrdList);
5359                };
5360                let makeParamSort = defaultSort.trim();
5361                if(makeParamSort != ''){
5362                    if(makeParamSort.indexOf('#Product_ListMenu')){
5363                        makeParamSort = '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE + '&sort_method=' + makeParamSort.split('#Product_ListMenu')[0].trim();
5364                    }else{
5365                        makeParamSort = '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE + '&sort_method=' + makeParamSort;
5366                    };
5367                }else{
5368                    makeParamSort = '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE;
5369                };
5370                let makeParamPage = '&page_num='+ makePage; 
5371                let lastParam = makeParamSort + makeParamPage + makeParamFilter;
5372                let newLink = IV_LOCATION_HREF.split(IV_LOCATION_PATHNAME)[0] + IV_LOCATION_PATHNAME + lastParam;
5373                history.replaceState(null, null, newLink);
5374
5375            }else{
5376                let makeParamSort = ($sortButton.filter('.on').length > 0) ? $sortButton.filter('.on').attr('data-ivdynamic-val') : '?cate_no=' + IVBaseMenuCall.__IV_DEFAULT_VALUE_LOCATION_NOW_CATE;
5377                let makeParamPage = '&page_num=1'; //우선 무조건 1페이지로 
5378                let lastParam = makeParamSort + makeParamPage + makeParamFilter;
5379                return lastParam;
5380            };
5381        };
5382    },
5383    initAfter : function(){
5384        sessionStorage.removeItem('iv_cate_info');
5385        sessionStorage.removeItem('iv_cate_info2');
5386        sessionStorage.removeItem('iv_cate_info3');
5387    },
5388}; 
5389
5390
5391/**
5392 * 공통 실행
5393 */
5394var iv_commonBaseFunc = iv_commonBaseFunc || {
5395    __IV_DEFAULT_VALUE_ORDER_LAYER_OPEN_CLOSE_FUNCTION_MODIFY : false,
5396    initBefore: function () {
5397        if(isPopupPage == 0){
5398            IV_MEMBER_CHECK = topDocument.querySelectorAll('#iv_memberChk_nomember').length > 0 ? false : true; //true : 회원 , false: 비회원
5399            IV_SUBCONTAINER_DATA_PAGE = IV$('.sub_container').attr('data-page'); 
5400            IV_TOP_SUBCONTAINER_DATA_PAGE = IV$('.sub_container').attr('data-page');  
5401
5402        }else{
5403            IV_SUBCONTAINER_DATA_PAGE = IV$('.popup_container').attr('data-page'); 
5404            IV_TOP_SUBCONTAINER_DATA_PAGE = IV$(topDocument).find('.sub_container').attr('data-page'); 
5405        };
5406        iv_commonBaseFunc.connectEvent();
5407        iv_commonBaseFunc.memberStateLayoutFix();
5408        IVBaseMenuCall.printList(); //메뉴 호출
5409    },
5410    init: function () {
5411        //페이지별 실행
5412        if(typeof basePrdPageInfoCallCustom !== 'undefined'){
5413            IVPrdPageInfoCall.init(basePrdPageInfoCallCustom);
5414        }else{
5415            IVPrdPageInfoCall.init();
5416        };
5417        //상품별 실행 
5418        if(typeof basePrdItemInfoCallCustom !== 'undefined'){
5419            IVPrdItemInfoCall.init(basePrdItemInfoCallCustom);
5420        }else{
5421            IVPrdItemInfoCall.init();
5422        };
5423        iv_commonBaseFunc.cssVarSet(isPopupPage);
5424        //custom swiper 
5425        IVSwiperFunc();
5426    },
5427    initLast : function(){
5428        if(isPopupPage == 0){
5429            if(IV_MEMBER_CHECK){
5430                ( memberDataCall = function(){
5431                    if(iv_commonBaseFunc.memberInfo() == false){
5432                        setTimeout(memberDataCall,300);
5433                    }else{
5434                        //회원 데이터 끝났을때 동작할 함수 
5435                        let IV_MEMBER_CALL_END = new CustomEvent("IVMemberCall",{'detail': IV_MEMBER_OBJ}); /* 멤버 정보 호출 완료 */
5436                        document.body.dispatchEvent(IV_MEMBER_CALL_END);
5437                    };
5438                })();
5439            }else{
5440                //회원 데이터 끝났을때 동작할 함수 
5441                let IV_MEMBER_CALL_END = new CustomEvent("IVMemberCall",{'detail' : 'guest-member'}); /* 멤버 정보 호출 완료 */
5442                document.body.dispatchEvent(IV_MEMBER_CALL_END);
5443            };
5444            //ie 브라우저 전환 유도 
5445            if(typeof ieAlert !== 'undefined' && typeof ieRedirect !== 'undefined'){
5446                if(ieAlert && IV_DEVICE_CHK == 'pc' && IV_BROWSER_CHK == 'ie'){
5447                    iv_commonBaseFunc.ieLeave();
5448                };
5449            }
5450        };
5451        IVmcustomScrollbar();
5452        iv_commonBaseFunc.cssVarSet(isPopupPage);
5453        IVBaseScroll.stickySet();
5454        window['oldURL'] = null;
5455        window['oldResponseText'] = null;
5456
5457    },
5458    memberStateLayoutFix : function(){
5459        //회원/비회원 class (Layout_statelogoff/Layout_statelogon 모듈 사용 불가 시 사용)
5460        if(IV_MEMBER_CHECK){
5461            IV$('.iv_statelogoff').remove();
5462            IV$('.iv_statelogoff2').addClass('displaynone');
5463            IV$('.iv_statelogoff3').addClass('layout-hidden');
5464            
5465            IV$('[class*="nm_return_btn"]').each(function(){
5466                var $this = IV$(this);
5467                $this.removeClass('nm_return_btn nm_return_btn2 nm_return_btn3');
5468            });
5469        }else{
5470            IV$('.iv_statelogon').remove();
5471            IV$('.iv_statelogon2').addClass('displaynone');
5472            IV$('.iv_statelogon3').addClass('layout-hidden');
5473            
5474            //type1 현재 링크를 return url로 넣기
5475            IV$('.nm_return_btn').each(function(){
5476                var $this = IV$(this);
5477                var oriLink = $this.attr('href');
5478                $this.attr('href',oriLink+'?returnUrl='+IV_LOCATION_HREF.split(IV_LOCATION_HOSTNAME)[1]);
5479            });
5480
5481            //type2 현재 링크를 주소줄에 있는 return Url값으로 넣기
5482            IV$('.nm_return_btn2').each(function(){
5483                if(IV_LOCATION_HREF.indexOf('returnUrl=') > -1){
5484                    var $this = IV$(this);
5485                    var oriLink = $this.attr('href');
5486                    var returnUrlLink = IV_LOCATION_HREF.split('returnUrl=')[1];
5487                    $this.attr('href',oriLink+'?returnUrl='+returnUrlLink);
5488                };
5489            });
5490
5491            //type3 현재 링크를 주소줄에 있는 return Url값으로 넣기 + 로그인 페이지로 보내기
5492            IV$('.nm_return_btn3').each(function(){
5493                var $this = IV$(this);
5494                var oriLink = $this.attr('href');
5495                $this.attr('href','/member/login.html?returnUrl='+oriLink);
5496            });
5497        };
5498    },
5499
5500    connectEvent : function(){
5501        
5502        //토클 클릭
5503        IV$(document).on('click', '.base_form_toggle > .title', function(e){
5504            // input/label 등 요소 클릭 시에는 열림/닫힘 기능하지 않게 수정 
5505            if(e.target.tagName =='INPUT'|| e.target.tagName =='LABEL') return;
5506            if(IV$(this).closest('.base_form_toggle').hasClass('on') && IV$(this).closest('.base_form_toggle').hasClass('fixed') == false){
5507                IV$(this).closest('.base_form_toggle').removeClass('on');
5508            }else{
5509                if(IV$(this).closest('.base_form_toggle').hasClass('fixed') == false){
5510                    IV$(this).closest('.base_form_toggle').addClass('on');
5511                };
5512            };
5513        });
5514
5515        //탭바 클릭
5516        IV$(document).on('click', '.tabbar_header li ', function(){
5517            var $this = IV$(this);
5518            var triggerClick = $this.data('click');
5519            $this.addClass('selected');
5520            $this.closest('.tabbar_container').find('.tabbar_header li').not($this).removeClass('selected');
5521            if(triggerClick){
5522                if(triggerClick.indexOf(',') > -1){
5523                    triggerClick = triggerClick.split(',');
5524                    triggerClick.forEach(function(e,i){
5525                        EC$(e).trigger('click');
5526                    });
5527                }else{
5528                    EC$(triggerClick).trigger('click');
5529                };
5530            };
5531            $this.closest('.tabbar_header').attr('data-selected',$this.index());
5532        });
5533    },
5534
5535    cssVarSet : function(isPopupPage){
5536        if(isPopupPage == 0){
5537            if(IV_vh == 0 || Math.abs(IV_vh - (window.innerHeight * 0.01)) > 3){
5538                IV_vh = window.innerHeight * 0.01;
5539                document.querySelector(':root').style.setProperty("--vh", IV_vh +"px"); /* 1vh 값 */
5540            };
5541            IV_vh2 = window.innerHeight * 0.01;
5542            document.querySelector(':root').style.setProperty("--vh2", IV_vh2 +"px"); /* 1vh 값2 */
5543            IV_vw = window.innerWidth * 0.01;
5544            if(typeof IVSetPropertyArray !== 'undefined'){
5545                IVSetPropertyArray.forEach(function(e,i){
5546                    var name = e.name;
5547                    var $el = IV$(e.element);
5548                    window['IV_'+name] = ($el.length > 0) ? $el.outerHeight() : 0;
5549                    document.querySelector(':root').style.setProperty('--' + name, window['IV_'+name] + 'px');
5550                });
5551            };
5552            document.querySelector(':root').style.setProperty("--vw", IV_vw +"px"); /* 1vw 값 */
5553        }else{
5554            IV_vh = top.window.innerHeight * 0.01;
5555            IV_vw = top.window.innerWidth * 0.01;
5556            document.querySelector(':root').style.setProperty("--vh", IV_vh +"px"); /* 1vh 값 */
5557            document.querySelector(':root').style.setProperty("--vw", IV_vw +"px"); /* 1vw 값 */
5558            if(typeof IVSetPropertyArray !== 'undefined'){
5559                IVSetPropertyArray.forEach(function(e,i){
5560                    var name = e.name;
5561                    var $el = IV$(topDocument).find(e.element);
5562                    window['IV_'+name] = ($el.length > 0) ? $el.outerHeight() : 0;
5563                    document.querySelector(':root').style.setProperty('--' + name, window['IV_'+name] + 'px');
5564                });
5565            };
5566        };
5567    },
5568    
5569    memberInfo : function(){
5570        IV_MEMBER_ID = CAPP_ASYNC_METHODS.member.__sMemberId; 
5571        if(IV_MEMBER_ID == null){
5572            return false;
5573        };
5574        IV_MEMBER_NAME = CAPP_ASYNC_METHODS.member.__sName;
5575        IV_MEMBER_NICKNAME = CAPP_ASYNC_METHODS.member.__sNickName; 
5576        IV_MEMBER_GROUPNAME = CAPP_ASYNC_METHODS.member.__sGroupName;
5577        IV_MEMBER_GROUPNO = CAPP_ASYNC_METHODS.member.__sGroupNo;
5578        IV_MEMBER_EMAIL = CAPP_ASYNC_METHODS.member.__sEmail; 
5579        IV_MEMBER_PHONE = CAPP_ASYNC_METHODS.member.__sPhone;
5580        IV_MEMBER_CELLPHONE = CAPP_ASYNC_METHODS.member.__sCellphone; 
5581        IV_MEMBER_BIRTHDAY = CAPP_ASYNC_METHODS.member.__sBirthday; 
5582        IV_MEMBER_BOARDWRITENAME = CAPP_ASYNC_METHODS.member.__sBoardWriteName; 
5583        IV_MEMBER_ADDITIONALINFOMATION = CAPP_ASYNC_METHODS.member.__sAdditionalInformation; 
5584        IV_MEMBER_CREATEDATE = CAPP_ASYNC_METHODS.member.__sCreatedDate;
5585        IV_MEMBER_NAME_MILEAGE = (typeof sMileageName === 'undefined') ? null : sMileageName;
5586        if(typeof sMileageUnit !== 'undefined'){
5587            IV_MEMBER_UNIT_MILEAGE = (sMileageUnit.indexOf(']')>-1) ? sMileageUnit.split(']')[1].trim() : sMileageUnit;
5588        }
5589        IV_MEMBER_AVAIL_MILEAGE = CAPP_ASYNC_METHODS.Mileage.__sAvailMileage;
5590        IV_MEMBER_UNAVAIL_MILEAGE = CAPP_ASYNC_METHODS.Mileage.__sUnavailMileage;
5591        IV_MEMBER_RETURN_MILEAGE = CAPP_ASYNC_METHODS.Mileage.__sReturnedMileage;
5592        IV_MEMBER_TOTAL_MILEAGE = CAPP_ASYNC_METHODS.Mileage.__sTotalMileage;
5593        IV_MEMBER_USED_MILEAGE = CAPP_ASYNC_METHODS.Mileage.__sUsedMileage;
5594        IV_MEMBER_COUPON_COUNT = CAPP_ASYNC_METHODS.Couponcnt.__iCouponCount;
5595        IV_MEMBER_ORDER_COUNT = CAPP_ASYNC_METHODS.Order.__iOrderCount;
5596        if(CAPP_ASYNC_METHODS.Order.__iOrderTotalPrice != null){
5597            IV_MEMBER_ORDER_TOTAL = (CAPP_ASYNC_METHODS.Order.__iOrderTotalPrice.indexOf('원') > -1) ? CAPP_ASYNC_METHODS.Order.__iOrderTotalPrice.replace('원','') : CAPP_ASYNC_METHODS.Order.__iOrderTotalPrice; 
5598        }
5599        IV_MEMBER_ORDER_INCREASEVALUE = CAPP_ASYNC_METHODS.Order.__iGradeIncreaseValue;
5600        IV_MEMBER_ACC_DEPOSIT = CAPP_ASYNC_METHODS.Deposit.__sAllDeposit; 
5601        IV_MEMBER_USED_DEPOSIT = CAPP_ASYNC_METHODS.Deposit.__sUsedDeposit; 
5602        IV_MEMBER_RETURN_DEPOSIT = CAPP_ASYNC_METHODS.Deposit.__sRefundWaitDeposit; 
5603        IV_MEMBER_AVAIL_DEPOSIT = CAPP_ASYNC_METHODS.Deposit.__sTotalDeposit; 
5604        IV_MEMBER_TOTAL_DEPOSIT = CAPP_ASYNC_METHODS.Deposit.__sMemberTotalDeposit; 
5605        IV_MEMBER_NAME_DEPOSIT = sDepositName;
5606        IV_MEMBER_UNIT_DEPOSIT = sDepositUnit;
5607        if(typeof sDepositUnit !== 'undefined'){
5608            IV_MEMBER_UNIT_DEPOSIT = (sDepositUnit.indexOf(']')>-1) ? sDepositUnit.split(']')[1].trim() : sDepositUnit;
5609        }
5610        IV_MEMBER_OBJ = {
5611            'IV_MEMBER_ID' : IV_MEMBER_ID,
5612            'IV_MEMBER_NAME' : IV_MEMBER_NAME , 
5613            'IV_MEMBER_NICKNAME' : IV_MEMBER_NICKNAME ,
5614            'IV_MEMBER_GROUPNAME' : IV_MEMBER_GROUPNAME ,
5615            'IV_MEMBER_GROUPNO' : IV_MEMBER_GROUPNO ,
5616            'IV_MEMBER_EMAIL' : IV_MEMBER_EMAIL ,
5617            'IV_MEMBER_PHONE' : IV_MEMBER_PHONE ,
5618            'IV_MEMBER_CELLPHONE' : IV_MEMBER_CELLPHONE ,
5619            'IV_MEMBER_BIRTHDAY' : IV_MEMBER_BIRTHDAY  ,
5620            'IV_MEMBER_BOARDWRITENAME' : IV_MEMBER_BOARDWRITENAME  ,
5621            'IV_MEMBER_ADDITIONALINFOMATION' : IV_MEMBER_ADDITIONALINFOMATION  ,
5622            'IV_MEMBER_CREATEDATE' : IV_MEMBER_CREATEDATE ,
5623            'IV_MEMBER_NAME_MILEAGE' : IV_MEMBER_NAME_MILEAGE ,
5624            'IV_MEMBER_UNIT_MILEAGE' : IV_MEMBER_UNIT_MILEAGE,
5625            'IV_MEMBER_AVAIL_MILEAGE' : IV_MEMBER_AVAIL_MILEAGE ,
5626            'IV_MEMBER_UNAVAIL_MILEAGE' : IV_MEMBER_UNAVAIL_MILEAGE ,
5627            'IV_MEMBER_RETURN_MILEAGE' : IV_MEMBER_RETURN_MILEAGE ,
5628            'IV_MEMBER_TOTAL_MILEAGE' : IV_MEMBER_TOTAL_MILEAGE ,
5629            'IV_MEMBER_USED_MILEAGE' : IV_MEMBER_USED_MILEAGE ,
5630            'IV_MEMBER_COUPON_COUNT' : IV_MEMBER_COUPON_COUNT ,
5631            'IV_MEMBER_ORDER_COUNT' : IV_MEMBER_ORDER_COUNT ,
5632            'IV_MEMBER_ORDER_TOTAL' : IV_MEMBER_ORDER_TOTAL ,
5633            'IV_MEMBER_ORDER_INCREASEVALUE' : IV_MEMBER_ORDER_INCREASEVALUE,
5634            'IV_MEMBER_NAME_DEPOSIT' : IV_MEMBER_NAME_DEPOSIT,
5635            'IV_MEMBER_UNIT_DEPOSIT' : IV_MEMBER_UNIT_DEPOSIT,
5636            'IV_MEMBER_ACC_DEPOSIT' : CAPP_ASYNC_METHODS.Deposit.__sAllDeposit,
5637            'IV_MEMBER_USED_DEPOSIT' : CAPP_ASYNC_METHODS.Deposit.__sUsedDeposit,
5638            'IV_MEMBER_RETURN_DEPOSIT' : CAPP_ASYNC_METHODS.Deposit.__sRefundWaitDeposit, 
5639            'IV_MEMBER_AVAIL_DEPOSIT' : CAPP_ASYNC_METHODS.Deposit.__sTotalDeposit,
5640            'IV_MEMBER_TOTAL_DEPOSIT' : CAPP_ASYNC_METHODS.Deposit.__sMemberTotalDeposit
5641        };
5642        Object.keys(IV_MEMBER_OBJ).forEach(function(el){
5643            let txt = (typeof IV_MEMBER_OBJ[el] === 'object') ? '' : String(IV_MEMBER_OBJ[el]);
5644            if(txt){
5645                if(iv_util.removeNumbFunc(txt).trim() == '.'){
5646                    IV$('.' + el).text(iv_util.comma(Math.floor(txt)));
5647                }else{
5648                    IV$('.' + el).text(txt);
5649                };
5650            };
5651        });
5652
5653        if(IV_MEMBER_GROUPNO == '' && IV_MEMBER_CHECK){
5654			IV$('.base_board_admin').removeClass('displaynone');
5655        };
5656
5657    },
5658
5659    ieLeave : function(){
5660        if(typeof ieAlert !== 'undefined' && typeof ieRedirect !== 'undefined'){
5661            if(ieAlert){
5662                if(ieRedirect){
5663                    //ie edge로 전환
5664                    alert("본 사이트는 Edge, Chrome 브라우저에 최적화 되어 있습니다." + "확인 버튼을 누르시면 Edge브라우저로 이동합니다.") 
5665                    moveEdge();
5666                }else{
5667                    /**
5668                     * Minified by jsDelivr using Terser v3.14.1.
5669                     * Original file: /gh/nuxodin/[email protected]/ie11CustomProperties.js
5670                     * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
5671                     */
5672                    !function(){"use strict";var e=document.createElement("i");if(e.style.setProperty("--x","y"),"y"!==e.style.getPropertyValue("--x")&&e.msMatchesSelector){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector);var t,r=[],n=document,o=!1;document.addEventListener("DOMContentLoaded",function(){o=!0}),"classList"in Element.prototype||H("classList",HTMLElement.prototype,Element.prototype),"innerHTML"in Element.prototype||H("innerHTML",HTMLElement.prototype,Element.prototype),"runtimeStyle"in Element.prototype||H("runtimeStyle",HTMLElement.prototype,Element.prototype),"sheet"in SVGStyleElement.prototype||Ob
5672ject.defineProperty(SVGStyleElement.prototype,"sheet",{get:function(){for(var e,t=document.styleSheets,r=0;e=t[r++];)if(e.ownerNode===this)return e}});var i={},s=new Set,c=!1,l=!1,a=/([\s{;])(--([A-Za-z0-9-_]*)\s*:([^;!}{]+)(!important)?)(?=\s*([;}]|$))/g,u=/([{;]\s*)([A-Za-z0-9-_]+\s*:[^;}{]*var\([^!;}{]+)(!important)?(?=\s*([;}$]|$))/g,f=/-ieVar-([^:]+):/g,p=/-ie-([^};]+)/g,d=/:(hover|active|focus|target|visited|link|:before|:after|:first-letter|:first-line)/;M("style",q),M('link[rel="stylesheet"]',q),M("[ie-style]",function(e){var t=B("{"+e.getAttribute("ie-style")).substr(1);e.style.cssText+=";"+t;var r=R(e.style);r.getters&&N(e,r.getters,"%styleAttr"),r.setters&&G(e,r.setters)});var m={hover:{on:"mouseenter",off:"mouseleave"},focus:{on:"focusin",off:"focusout"},active:{on:"CSSActivate",off:"CSSDeactivate"}},y=null;document.addEventListener("mousedown",function(e){setTimeout(function(){if(e.target===document.activeElement){var t=document.createEvent("Event");t.initEvent("CSSActivate",!0,!0),(y=e.target).dispatchEvent(t)}})}),document.addEventListener("mouseup",function(){if(y){var e=document.createEvent("Event");e.initEvent("CSSDeactivate",!0,!0),y.dispatchEvent(e),y=null}});var v=0,h=new MutationObserver(function(e){if(!l)for(var t,r=0;t=e[r++];)"iecp-needed"!==t.attributeName&&J(t.target)});setTimeout(function(){h.observe(document,{attributes:!0,subtree:!0})});var S=location.hash;addEventListener("hashchange",function(e){var t=document.getElementById(location.hash.substr(1));if(t){var r=document.getElementById(S.substr(1));J(t),J(r)}else J(document);S=location.hash});var E=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"style"),P=E.get;E.get=function(){const e=P.call(this);return e.owningElement=this,e},Object.defineProperty(HTMLElement.prototype,"style",E);var C=getComputedStyle;window.getComputedStyle=function(e){var t=C.apply(this,arguments);return t.computedFor=e,t};var g=CSSStyleDeclaration.prototype,b=g.getPropertyValue;g.getPropertyValue=function(e){if(this.lastPropertyServedBy=!1,"-"!==(e=e.trim())[0]||"-"!==e[1])return b.apply(this,arguments);const t=e.substr(2),r="-ie-"+t,n="-ie-❗"+t;let o=D(this[n]||this[r]);if(this.computedFor){if(void 0===o||T[o]){if(T[o]||!_[e]||_[e].inherits){let t=this.computedFor.parentNode;for(;1===t.nodeType;){if(t.ieCP_setters&&t.ieCP_setters[e]){var i=getComputedStyle(t),s=D(i[n]||i[r]);if(void 0!==s){o=Q(this,s),this.lastPropertyServedBy=t;break}}t=t.parentNode}}}else o=Q(this,o),this.lastPropertyServedBy=this.computedFor;if("initial"===o)return""}return void 0===o&&_[e]&&(o=_[e].initialValue),void 0===o?"":o};var T={inherit:1,revert:1,unset:1},L=g.setProperty;g.setProperty=function(e,t,r){if("-"!==e[0]||"-"!==e[1])return L.apply(this,arguments);const n=this.owningElement;n&&(n.ieCP_setters||(n.ieCP_setters={}),n.ieCP_setters[e]=1),e="-ie-"+("important"===r?"❗":"")+e.substr(2),this.cssText
vendor: 4,313 bytes, line 5672
5672+="; "+e+":"+k(t)+";",n&&J(n)},window.CSS||(window.CSS={});var _={};CSS.registerProperty=function(e){_[e.name]=e}}function w(e,t){try{return e.querySelectorAll(t)}catch(e){return[]}}function M(e,o){for(var i,s={selector:e,callback:o,elements:new WeakMap},c=w(n,s.selector),l=0;i=c[l++];)s.elements.set(i,!0),s.callback.call(i,i);r.push(s),t||(t=new MutationObserver(O)).observe(n,{childList:!0,subtree:!0}),A(s)}function A(e,t){var r,i=0,s=[];try{t&&t.matches(e.selector)&&s.push(t)}catch(e){}for(o&&Array.prototype.push.apply(s,w(t||n,e.selector));r=s[i++];)e.elements.has(r)||(e.elements.set(r,!0),e.callback.call(r,r))}function V(e){for(var t,n=0;t=r[n++];)A(t,e)}function O(e){for(var t,r,n,o,i=0;r=e[i++];)for(n=r.addedNodes,t=0;o=n[t++];)1===o.nodeType&&V(o)}function H(e,t,r){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n)}function q(e){if(!e.ieCP_polyfilled&&!e.ieCP_elementSheet&&e.sheet){if(e.href)return t=e.href,r=function(t){var r=B(t);t!==r&&j(e,r)},(n=new XMLHttpRequest).open("GET",t),n.overrideMimeType("text/css"),n.onload=function(){n.status>=200&&n.status<400&&r(n.responseText)},void n.send();var t,r,n,o=e.innerHTML,i=B(o);o!==i&&j(e,i)}}function B(e){return e.replace(a,function(e,t,r,n,o,i){return t+"-ie-"+(i?"❗":"")+n+":"+k(o)}).replace(u,function(e,t,r,n){return t+"-ieVar-"+(n?"❗":"")+r+"; "+r})}function k(e){return e}function D(e){return e}function R(e){e["z-index"]===e&&x();const t=e.cssText;var r,n,o=t.match(f);if(o){var s=[];for(r=0;n=o[r++];){let t=n.slice(7,-1);"❗"===t[0]&&(t=t.substr(1)),s.push(t),i[t]||(i[t]=[]),i[t].push(e)}}var c=t.match(p);if(c){var l={};for(r=0;n=c[r++];){let e=n.substr(4).split(":"),t=e[0],r=e[1];"❗"===t[0]&&(t=t.substr(1)),l[t]=r}}return{getters:s,setters:l}}function j(e,t){e.sheet.cssText=t,e.ieCP_polyfilled=!0;for(var r,n=e.sheet.rules,o=0;r=n[o++];){const e=R(r.style);e.getters&&F(r.selectorText,e.getters),e.setters&&z(r.selectorText,e.setters);const t=r.parentRule&&r.parentRule.media&&r.parentRule.media.mediaText;t&&(e.getters||e.setters)&&matchMedia(t).addListener(function(){J(document.documentElement)})}$()}function F(e,t){I(e),M(Z(e),function(r){N(r,t,e),W(r)})}function N(e,t,r){var n,o,i=0;const s=r.split(",");for(e.setAttribute("iecp-needed",!0),e.ieCPSelectors||(e.ieCPSelectors={});n=t[i++];)for(o=0;r=s[o++];){const t=r.trim().split("::");e.ieCPSelectors[n]||(e.ieCPSelectors[n]=[]),e.ieCPSelectors[n].push({selector:t[0],pseudo:t[1]?"::"+t[1]:""})}}function z(e,t){I(e),M(Z(e),function(e){G(e,t)})}function G(e,t){for(var r in e.ieCP_setters||(e.ieCP_setters={}),t)e.ieCP_setters["--"+r]=1;J(e)}function $(){for(var e in i){let o=i[e];for(var t,r=0;t=o[r++];)if(!t.owningElement){var n=t["-ieVar-"+e];if(n&&""!==(n=Q(getComputedStyle(document.documentElement),n)))try{t[e]=n}catch(e){}}}}function I(e){for(var t in e=e.split(",")[0],m){var r=e.split(":"+t);if(r.length>1){var n=r[1].match(/^[^\s]*/);let e=Z(r[0]+n);const o=m[t];M(e,function(e){e.addEventListener(o.on,K),e.addEventListener(o.off,K)})}}}function Z(e){return e.replace(d,"").replace(":not()","")}function W(e){s.add(e),c||(c=!0,requestAnimationFrame(function(){c=!1,l=!0,s.forEach(X),s.clear(),setTimeout(function(){l=!1})}))}function X(e){e.ieCP_unique||(e.ieCP_unique=++v,e.classList.add("iecp-u"+e.ieCP_unique));var t=getComputedStyle(e);let r="";for(var n in e.runtimeStyle.cssText="",e.ieCPSelectors){var o=t["-ieVar-❗"+n];let a=o||t["-ieVar-"+n];if(a){var i={},s=Q(t,a,i);o&&(s+=" !important");for(var c,l=0;c=e.ieCPSelectors[n][l++];)"%styleAttr"===c.selector&&(e.style[n]=s),(o||!1===i.allByRoot)&&(c.pseudo?r+=c.selector+".iecp-u"+e.ieCP_unique+c.pseudo+"{"+n+":"+s+"}\n":e.runtimeStyle[n]=s)}}!function(e,t){if(!e.ieCP_styleEl&&t){const t=document.createElement("style");t.ieCP_elementSheet=1,document.head.appendChild(t),e.ieCP_styleEl=t}e.ieCP_styleEl&&(e.ieCP_styleEl.innerHTML=t)}(e,r)}function J(e){if(e){e===document.documentElement&&$();var t=e.querySelectorAll("[iecp-needed]");e.hasAttribute&&e.hasAttribute("iecp-needed")&&W(e);for(var r,n=0;r=t[n++];)W(r)}}function K(e){J(e.target)}function Q(e,t,r){return function(e,t){let r,n,o=0,i=null,s=0,c="",l=0;for(;r=e[l++];){if("("===r&&(++o,null===i&&e[l-4]+e[l-3]+e[l-2]==="var"&&(i=o,c+=e.substring(s,l-4),s=l),e[l-5]+e[l-4]+e[l-3]+e[l-2]==="calc"&&(n=o)
5672),")"===r&&i===o){let r,o=e.substring(s,l-1).trim(),a=o.indexOf(",");-1!==a&&(r=o.slice(a+1),o=o.slice(0,a)),c+=t(o,r,n),s=l,i=null}")"===r&&n===--o&&(n=null)}return c+=e.substring(s)}(t,function(t,n,o){var i=e.getPropertyValue(t);return o&&(i=i.replace(/^calc\(/,"(")),r&&e.lastPropertyServedBy!==document.documentElement&&(r.allByRoot=!1),""===i&&n&&(i=Q(e,n,r)),i})}}();
5673                    //# sourceMappingURL=/sm/0d31c8eaba1cbe6281431a1768c1714c7071e7ded57ebaeec897ba2017ae561d.map
5674                    (function(){'use strict';if(typeof window!=='object'){return}if('IntersectionObserver'in window&&'IntersectionObserverEntry'in window&&'intersectionRatio'in window.IntersectionObserverEntry.prototype){if(!('isIntersecting'in window.IntersectionObserverEntry.prototype)){Object.defineProperty(window.IntersectionObserverEntry.prototype,'isIntersecting',{get:function(){return this.intersectionRatio>0}})}return}function getFrameElement(doc){try{return doc.defaultView&&doc.defaultView.frameElement||null}catch(e){return null}}var document=(function(startDoc){var doc=startDoc;var frame=getFrameElement(doc);while(frame){doc=frame.ownerDocument;frame=getFrameElement(doc)}return doc})(window.document);var registry=[];var crossOriginUpdater=null;var crossOriginRect=null;function IntersectionObserverEntry(entry){this.time=entry.time;this.target=entry.target;this.rootBounds=ensureDOMRect(entry.rootBounds);this.boundingClientRect=ensureDOMRect(entry.boundingClientRect);this.intersectionRect=ensureDOMRect(entry.intersectionRect||getEmptyRect());this.isIntersecting=!!entry.intersectionRect;var targetRect=this.boundingClientRect;var targetArea=targetRect.width*targetRect.height;var intersectionRect=this.intersectionRect;var intersectionArea=intersectionRect.width*intersectionRect.height;if(targetArea){this.intersectionRatio=Number((intersectionArea/targetArea).toFixed(4))}else{this.intersectionRatio=this.isIntersecting?1:0}}function IntersectionObserver(callback,opt_options){var options=opt_options||{};if(typeof callback!='function'){throw new Error('callback must be a function');}if(options.root&&options.root.nodeType!=1&&options.root.nodeType!=9){throw new Error('root must be a Document or Element');}this._checkForIntersections=throttle(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT);this._callback=callback;this._observationTargets=[];this._queuedEntries=[];this._rootMarginValues=this._parseRootMargin(options.rootMargin);this.thresholds=this._initThresholds(options.threshold);this.root=options.root||null;this.rootMargin=this._rootMarginValues.map(function(margin){return margin.value+margin.unit}).join(' ');this._monitoringDocuments=[];this._monitoringUnsubscribes=[]}IntersectionObserver.prototype.THROTTLE_TIMEOUT=100;IntersectionObserver.prototype.POLL_INTERVAL=null;IntersectionObserver.prototype.USE_MUTATION_OBSERVER=true;IntersectionObserver._setupCrossOriginUpdater=function(){if(!crossOriginUpdater){crossOriginUpdater=function(boundingClientRect,intersectionRect){if(!boundingClientRect||!intersectionRect){crossOriginRect=getEmptyRect()}else{crossOriginRect=convertFromParentRect(boundingClientRect,intersectionRect)}registry.forEach(function(observer){observer._checkForIntersections()})}}return crossOriginUpdater};IntersectionObserver._resetCrossOriginUpdater=function(){crossOriginUpdater=null;crossOriginRect=null};IntersectionObserver.prototype.observe=function(target){var isTargetAlreadyObserved=this._observationTargets.some(function(item){return item.element==target});if(isTargetAlreadyObserved){return}if(!(target&&target.nodeType==1)){throw new Error('target must be an Element');}this._registerInstance();this._observationTargets.push({element:target,entry:null});this._monitorIntersections(target.ownerDocument);this._checkForIntersections()};IntersectionObserver.prototype.unobserve=function(target){this._observationTargets=this._observationTargets.filter(function(item){return item.element!=target});this._unmonitorIntersections(target.ownerDocument);if(this._observationTargets.length==0){this._unregisterInstance()}};IntersectionObserver.prototype.disconnect=function(){this._observationTargets=[];this._unmonitorAllIntersections();this._unregisterInstance()};IntersectionObserver.prototype.takeRecords=function(){var records=this._queuedEntries.slice();this._queuedEntries=[];return records};IntersectionObserver.prototype._initThresholds=function(opt_threshold){var threshold=opt_threshold||[0];if(!Array.isArray(threshold))threshold=[threshold];return threshold.sort().filter(function(t,i,a){if(typeof t!='number'||isNaN(t)||t<0||t>1){throw new Error('threshold must be a number between 0 and 1 inclusively');}return t!==a[i-1]})};IntersectionObserver.prototype._parseRootMargin=function(opt_rootMargin){var marginString=opt_rootMargin||'0px';var margins=marginString.split(/\s+/).map(function(margin){var parts=/^(-?\d*\.?\d+)(px|%)$/.exec(margin);if(!parts){throw new Error('rootMargin must be specified in pixels or percent');}return{value:parseFloat(parts[1]),unit:parts[2]}});margins[1]=margins[1]||margins[0];margins[2]=margins[2]||margins[0];margins[3]=margins[3]||margins[1];return margins};IntersectionObserver.prototype._monitorIntersections=function(doc){var win=doc.defaultView;if(!win){return}if(this._monitoringDocuments.indexOf(doc)!=-1){return}var callback=this._checkForIntersections;var monitoringInterval=null;var domObserver=null;if(this.POLL_INTERVAL){monitoringInterval=win.setInterval(callback,this.POLL_INTERVAL)}else{addEvent(win,'resize',callback,true);addEvent(doc,'scroll',callback,true);if(this.USE_MUTATION_OBSERVER&&'MutationObserver'in win){domObserver=new win.MutationObserver(callback);domObserver.observe(doc,{attributes:true,childList:true,characterData:true,subtree:true})}}this._monitoringDocuments.push(doc);this._monitoringUnsubscribes.push(function(){var win=doc.defaultView;if(win){if(monitoringInterval){win.clearInterval(monitoringInterval)}removeEvent(win,'resize',callback,true)}removeEvent(doc,'scroll',callback,true);if(domObserver){domObserver.disconnect()}});var rootDoc=(this.root&&(this.root.ownerDocument||this.root))||document;if(doc!=rootDoc){var frame=getFrameElement(doc);if(frame){this._monitorIntersections(frame.ownerDocument)}}};IntersectionObserver.prototype._unmonitorIntersections=function(doc){var index=this._monitoringDocuments.indexOf(doc);if(index==-1){return}var rootDoc=(this.root&&(this.root.ownerDocument||this.root))||document;var hasDependentTargets=this._observationTargets.some(function(item){var itemDoc=item.element.ownerDocument;if(itemDoc==doc){return true}
5674while(itemDoc&&itemDoc!=rootDoc){var frame=getFrameElement(itemDoc);itemDoc=frame&&frame.ownerDocument;if(itemDoc==doc){return true}}return false});if(hasDependentTargets){return}var unsubscribe=this._monitoringUnsubscribes[index];this._monitoringDocuments.splice(index,1);this._monitoringUnsubscribes.splice(index,1);unsubscribe();if(doc!=rootDoc){var frame=getFrameElement(doc);if(frame){this._unmonitorIntersections(frame.ownerDocument)}}};IntersectionObserver.prototype._unmonitorAllIntersections=function(){var unsubscribes=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0;this._monitoringUnsubscribes.length=0;for(var i=0;i<unsubscribes.length;i++){unsubscribes[i]()}};IntersectionObserver.prototype._checkForIntersections=function(){if(!this.root&&crossOriginUpdater&&!crossOriginRect){return}var rootIsInDom=this._rootIsInDom();var rootRect=rootIsInDom?this._getRootRect():getEmptyRect();this._observationTargets.forEach(function(item){var target=item.element;var targetRect=getBoundingClientRect(target);var rootContainsTarget=this._rootContainsTarget(target);var oldEntry=item.entry;var intersectionRect=rootIsInDom&&rootContainsTarget&&this._computeTargetAndRootIntersection(target,targetRect,rootRect);var rootBounds=null;if(!this._rootContainsTarget(target)){rootBounds=getEmptyRect()}else if(!crossOriginUpdater||this.root){rootBounds=rootRect}var newEntry=item.entry=new IntersectionObserverEntry({time:now(),target:target,boundingClientRect:targetRect,rootBounds:rootBounds,intersectionRect:intersectionRect});if(!oldEntry){this._queuedEntries.push(newEntry)}else if(rootIsInDom&&rootContainsTarget){if(this._hasCrossedThreshold(oldEntry,newEntry)){this._queuedEntries.push(newEntry)}}else{if(oldEntry&&oldEntry.isIntersecting){this._queuedEntries.push(newEntry)}}},this);if(this._queuedEntries.length){this._callback(this.takeRecords(),this)}};IntersectionObserver.prototype._computeTargetAndRootIntersection=function(target,targetRect,rootRect){if(window.getComputedStyle(target).display=='none')return;var intersectionRect=targetRect;var parent=getParentNode(target);var atRoot=false;while(!atRoot&&parent){var parentRect=null;var parentComputedStyle=parent.nodeType==1?window.getComputedStyle(parent):{};if(parentComputedStyle.display=='none')return null;if(parent==this.root||parent.nodeType==9){atRoot=true;if(parent==this.root||parent==document){if(crossOriginUpdater&&!this.root){if(!crossOriginRect||crossOriginRect.width==0&&crossOriginRect.height==0){parent=null;parentRect=null;intersectionRect=null}else{parentRect=crossOriginRect}}else{parentRect=rootRect}}else{var frame=getParentNode(parent);var frameRect=frame&&getBoundingClientRect(frame);var frameIntersect=frame&&this._computeTargetAndRootIntersection(frame,frameRect,rootRect);if(frameRect&&frameIntersect){parent=frame;parentRect=convertFromParentRect(frameRect,frameIntersect)}else{parent=null;intersectionRect=null}}}else{var doc=parent.ownerDocument;if(parent!=doc.body&&parent!=doc.documentElement&&parentComputedStyle.overflow!='visible'){parentRect=getBoundingClientRect(parent)}}if(parentRect){intersectionRect=computeRectIntersection(parentRect,intersectionRect)}if(!intersectionRect)break;parent=parent&&getParentNode(parent)}return intersectionRect};IntersectionObserver.prototype._getRootRect=function(){var rootRect;if(this.root&&!isDoc(this.root)){rootRect=getBoundingClientRect(this.root)}else{var doc=isDoc(this.root)?this.root:document;var html=doc.documentElement;var body=doc.body;rootRect={top:0,left:0,right:html.clientWidth||body.clientWidth,width:html.clientWidth||body.clientWidth,bottom:html.clientHeight||body.clientHeight,height:html.clientHeight||body.clientHeight}}return this._expandRectByRootMargin(rootRect)};IntersectionObserver.prototype._expandRectByRootMargin=function(rect){var margins=this._rootMarginValues.map(function(margin,i){return margin.unit=='px'?margin.value:margin.value*(i%2?rect.width:rect.height)/100});var newRect={top:rect.top-margins[0],right:rect.right+margins[1],bottom:rect.bottom+margins[2],left:rect.left-margins[3]};newRect.width=newRect.right-newRect.left;newRect.height=newRect.bottom-newRect.top;return newRect};IntersectionObserver.prototype._hasCrossedThreshold=function(oldEntry,newEntry){var oldRatio=oldEntry&&oldEntry.isIntersecting?oldEntry.intersectionRatio||0:-1;var newRatio=newEntry.isIntersecting?newEntry.intersectionRatio||0:-1;if(oldRatio===newRatio)return;for(var i=0;i<this.thresholds.length;i++){var threshold=this.thresholds[i];if(threshold==oldRatio||threshold==newRatio||threshold<oldRatio!==threshold<newRatio){return true}}};IntersectionObserver.prototype._rootIsInDom=function(){return!this.root||containsDeep(document,this.root)};IntersectionObserver.prototype._rootContainsTarget=function(target){var rootDoc=(this.root&&(this.root.ownerDocument||this.root))||document;return(containsDeep(rootDoc,target)&&(!this.root||rootDoc==target.ownerDocument))};IntersectionObserver.prototype._registerInstance=function(){if(registry.indexOf(this)<0){registry.push(this)}};IntersectionObserver.prototype._unregisterInstance=function(){var index=registry.indexOf(this);if(index!=-1)registry.splice(index,1)};function now(){return window.performance&&performance.now&&performance.now()}function throttle(fn,timeout){var timer=null;return function(){if(!timer){timer=setTimeout(function(){fn();timer=null},timeout)}}}function addEvent(node,event,fn,opt_useCapture){if(typeof node.addEventListener=='function'){node.addEventListener(event,fn,opt_useCapture||false)}else if(typeof node.attachEvent=='function'){node.attachEvent('on'+event,fn)}}function removeEvent(node,event,fn,opt_useCapture){if(typeof node.removeEventListener=='function'){node.removeEventListener(event,fn,opt_useCapture||false)}else if(typeof node.detatchEvent=='function'){node.detatchEvent('on'+event,fn)}}function computeRectIntersection(rect1,rect2){var top=Math.max(rect1.top,rect2.top);var bottom=Math.min(rect1.bottom,rect2.bottom);var left=Math.max(rect1.left,rect2.left);var right=Math.min(rect1.right,rect2.right);var width=right-left;var height=bottom-top;return(width>=0&&height>=0)&&{top:top,bottom:bottom,left:left,right:right,width:width,height:height}||null}function getBoundingClientRect(el){var rect;try{rect=el.getBoundingClientRect()}catch(err){}if(!rect)return getEmptyRect();if(!(rect.width&&rect.height)){rect={top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left,width:rect.right-rect.left,height:rect.bottom-rect.top}}return rect}function getEmptyRect(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function ensureDOMRect(rect){if(!rect||'x'in rect){return rect}return{top:rect.top,y:rect.top,bottom:rect.bottom,left:rect.left,x:rect.left,right:rect.right,width:rect.width,height:rect.height}}function convertFromParentRect(parentBoundingRect,parentIntersectionRect){var top=parentIntersectionRect.top-parentBoundingRect.top;var left=parentIntersectionRect.left-parentBoundingRect.left;return{top:top,left:left,height:parentIntersectionRect.height,width:parentIntersectionRect.width,bottom:top+parentIntersectionRect.height,right:left+parentIntersectionRect.width}}function containsDeep(parent,child){var node=child;while(node){if(node==parent)return true;node=getParentNode(node)}return false}function getParentNode(node){var parent=node.parentNode;if(node.nodeType==9&&node!=document){return getFrameElement(node)}if(parent&&parent.assignedSlot){parent=parent.assignedSlot.parentNode}if(parent&&parent.nodeType==11&&parent.host){return parent.host}return parent}function isDoc(node){return node&&node.nodeType===9}window.IntersectionObserver=IntersectionObserver;window.IntersectionObserverEntry=IntersectionObserverEntry}());
5675                    IV$('#base_header_container').append('<div class="ie_info_banner"><p onClick="moveEdge();">본 사이트는 Edge, Chrome 브라우저에 최적화 되어 있습니다. Edge 브라우저로 이동하기 →</p></div>');
5676                };
5677            };
5678        }
5679    },
5680
5681};
5682
5683
5684var IVBaseScroll = IVBaseScroll || {
5685    delta : 0,
5686    didScroll : null,
5687    direction : null,
5688    amount : null,
5689    st :  null,
5690    lastSt : null,
5691    stickyActiveHeight : null,
5692    stickySet : function(){
5693        let stickyHeight = 0;
5694        var $ivsticky = document.querySelectorAll('.iv_sticky');
5695        if($ivsticky.length > 0){
5696            var $ivsticky = IV$('.iv_sticky');
5697            let ivStickyPositionArray = [];
5698            let ivStickyHeightArray = [];
5699            IVBaseScroll.stickyActiveHeight = 0;
5700            $ivsticky.each(function(i,e){
5701                let $e = IV$(e);
5702                let boundingClientRect = e.getBoundingClientRect();
5703                let height = boundingClientRect.height;
5704                let top = boundingClientRect.y;
5705                let stickyChk = parseInt($e.css('top'), 10);
5706                let dataStart = $e.attr('data-ivsticky-start'); 
5707                if(top < 0 && stickyChk == 0){
5708                    return false;
5709                }else{
5710                    var pass = false;
5711                    if(typeof dataStart !== 'undefined'){
5712                        if(dataStart.indexOf('auto') > -1){
5713                            let autoTop = ivStickyPositionArray.reduce(function(acc,el,idx,arr){
5714                                if(idx < arr.length-1){
5715                                    if(arr[idx+1] != el){
5716                                        acc = acc + Math.abs(ivStickyHeightArray[idx]);
5717                                    };
5718                                }else{
5719                                    acc = acc + Math.abs(ivStickyHeightArray[idx]);
5720                                };
5721                                return acc;
5722                            },0);
5723                            $e.css('top', autoTop);
5724                        };
5725                        if(dataStart === 'auto-once'){
5726                            $e.removeAttr('data-ivsticky-start');
5727                        }else if(dataStart == '1'){
5728                        	pass = true;
5729                        }
5730                    };
5731                    ivStickyHeightArray.push(height);
5732                    if(pass != true){
5733                        if(top < stickyChk){
5734                            $e.addClass('scroll-max').removeClass('scroll-fixed');
5735                            ivStickyHeightArray.splice(i,1,-1*ivStickyHeightArray[i]);
5736                        }else{
5737                            if(top == stickyChk){
5738                                let chk = true;
5739                                let filter = $ivsticky.filter(function(idx, el) {
5740                                    if(ivStickyPositionArray[idx] == stickyChk){
5741                                        let offsetParent1 = el.offsetParent;
5742                                        let offsetParent2 =   e.offsetParent;
5743                                        let zIndex1 = 0;
5744                                        let zIndex2 =  0;
5745                                        if(offsetParent1 == offsetParent2){
5746                                            zIndex1 = Number(IV$(el).css('zIndex'));
5747                                            zIndex2 =  IV$(e).css('zIndex');
5748                                        }else{
5749                                            zIndex1 = Number(IV$(offsetParent1).css('zIndex'));
5750                                            zIndex2 =  IV$(offsetParent2).css('zIndex');
5751                                        };
5752                                        zIndex1 = (isNaN(zIndex1)) ? 0 : zIndex1;
5753                                        zIndex2 = (isNaN(zIndex2)) ? 0 : zIndex2;
5754                                        if(zIndex1 <= zIndex2){
5755                                            IV$(el).addClass('scroll-max');
5756                                            ivStickyHeightArray.splice(idx,1,-1*ivStickyHeightArray[idx]);
5757                                            return true;
5758                                        }else{
5759                                            chk = false;
5760                                        };
5761                                    };
5762                                });
5763                                if(chk != false){
5764                                    if(IVBaseScroll.st > 0){
5765                                        $e.removeClass('scroll-max').addClass('scroll-fixed');
5766                                    }else{
5767                                        $e.removeClass('scroll-max scroll-fixed');
5768                                    };
5769                                }else{
5770                                    ivStickyHeightArray.splice(i,1,-1*ivStickyHeightArray[i]);
5771                                };
5772                            }else{
5773                                $e.removeClass('scroll-max scroll-fixed');
5774                                ivStickyHeightArray.splice(i,1,-1*ivStickyHeightArray[i]);
5775                            };
5776                        };
5777                    }
5778                    ivStickyPositionArray.push(stickyChk);
5779                }
5780            });
5781            IVBaseScroll.stickyActiveHeight = ivStickyHeightArray.reduce(function(acc,el){
5782                if(el > 0){
5783                    acc = acc + el;
5784                };
5785                return acc;
5786            },0);
5787            IV_topHeight = IVBaseScroll.stickyActiveHeight;
5788            document.querySelector(':root').style.setProperty("--topHeight", IV_topHeight +"px");
5789        }
5790    },
5791    fix : function(){
5792        if(IVBaseScroll.st > 0){
5793            IV$('.iv_sticky[data-ivsticky-start="1"]').addClass('scroll-fixed');
5794        }else{
5795            IV$('.iv_sticky[data-ivsticky-start="1"]').removeClass('scroll-fixed');
5796        };
5797    },
5798    scrollUp : function(){
5799        IV$('html, .iv_sticky').addClass('scroll-up').removeClass('scroll-down');
5800        IVBaseScroll.direction = 'up';
5801    },
5802    scrollDown : function(){
5803        IV$('html, .iv_sticky').addClass('scroll-down').removeClass('scroll-up');
5804        IVBaseScroll.direction = 'down';
5805    },
5806    infoUpdate : function(){
5807        IVBaseScroll.amount = IVBaseScroll.lastSt - IVBaseScroll.st;
5808        IVBaseScroll.lastSt = IVBaseScroll.st;
5809        IVBaseScroll.stickySet();
5810    },
5811    execute : function(){
5812        if(Math.abs(IVBaseScroll.lastSt - IVBaseScroll.st) <= IVBaseScroll.delta){
5813            IVBaseScroll.didScroll = false;
5814            return;
5815        };
5816        IVBaseScroll.didScroll = true;
5817        IVBaseScroll.basic();
5818    },
5819    basic : function(){
5820        IVBaseScroll.fix();
5821        if(IVBaseScroll.lastSt > IVBaseScroll.st){
5822            IVBaseScroll.scrollUp();
5823        }else{
5824            IVBaseScroll.scrollDown(); 
5825        };
5826        IVBaseScroll.infoUpdate();
5827    }
5828};
5829
5830if(IV_BROWSER_CHK == 'iphone'){
5831    //IVBaseScroll.delta = 50;
5832}
5833
5834/**
5835 * 문서 이벤트 
5836 * - iv_common.js에서 함수 호출하여 사용 (sub_container의 js보다 먼저 실행이 필요할때 사용)
5837 * @ IVreadyBefore {event} document.ready(DOMContentLoaded)보다 빠름
5838 * @ IVready {event} document.ready(DOMContentLoaded)
5839 * @ IVloadBefore {event} window.load(load)보다 빠름
5840 * @ IVload {event} window.load
5841 * @ IVbeforeunload {event} 사용자 페이지 이탈 중
5842 * @ IVunload {event} 사용자 페이지 이탈 
5843 */
5844var IVbeforeUnloadFlag = false;
5845document.addEventListener("readystatechange", function (e) {
5846    switch (document.readyState) {
5847        case "interactive":
5848            let e = new CustomEvent("IVreadyBefore");
5849            document.body.dispatchEvent(e);
5850            break;
5851        case "complete":
5852            let t = new CustomEvent("IVloadBefore");
5853            document.body.dispatchEvent(t);
5854    }
5855}), window.addEventListener("DOMContentLoaded", function (e) {
5856    let t = new CustomEvent("IVready");
5857    document.body.dispatchEvent(t)
5858}), window.addEventListener("load", function (e) {
5859    let t = new CustomEvent("IVload");
5860    document.body.dispatchEvent(t)
5861}), window.addEventListener("beforeunload", function (e) {
5862    let t = new CustomEvent("IVbeforeunload");
5863    IVbeforeUnloadFlag = true;
5864    document.body.dispatchEvent(t);
5865}), document.addEventListener("visibilitychange", function (e) {
5866    if (document.visibilityState === 'visible') {
5867        let t = new CustomEvent("IVVisible");
5868        document.body.dispatchEvent(t);
5869    } else if(document.visibilityState === 'hidden') {
5870        if(IVbeforeUnloadFlag){
5871            let t = new CustomEvent("IVunload");
5872            document.body.dispatchEvent(t, {cancelable: true, bubbles: true});
5873        }else{
5874            let t = new CustomEvent("IVNotvisible");
5875            document.body.dispatchEvent(t);
5876        }
5877    }
5878}), window.addEventListener("scroll", iv_util.throttle(function (e) {
5879    var t = window.pageYOffset;
5880    if (parseInt(IV$("html").css("top"), 10) < 0);
5881    else {
5882        IVBaseScroll.st = t;
5883        let e = new CustomEvent("IVScroll", {
5884            detail: IVBaseScroll
5885        });
5886        document.body.dispatchEvent(e)
5887    }
5888}, 100)), window.addEventListener("scroll", iv_util.debounce(function (e) {
5889    var t = window.pageYOffset;
5890    if (parseInt(IV$("html").css("top"), 10) < 0);
5891    else {
5892        IVBaseScroll.st = t;
5893        let e = new CustomEvent("IVScroll", {
5894            detail: IVBaseScroll
5895        });
5896        document.body.dispatchEvent(e)
5897    }
5898}, 200)), window.addEventListener("resize", function () {
5899    iv_commonBaseFunc.cssVarSet(isPopupPage)
5900});
5901//
5902//      강조 표시 할 카테고리 넘버를 배열에 넣어주세요.
5903//      강조할 카테고리 : 카테고리넘버   ex// var cate
5903ChkArray = [1118, 1619, 1600, 1622];
5904//      강조할 카테고리의 '전체'카테고리를 강조할 경우 : '상위카테고리넘버all'   ex// var cateChkArray = ['331all', '342all'];
5905
5906// 2024. 08 PC 강조점 / 컬러 변경 모두 카테앱으로 이관
5907var cateChkArray = [];
5908
5909$(document).ready(function () {
5910  var MEMBER_INFO = CAPP_ASYNC_METHODS.member.getData();
5911  //로그인 상태일때 버튼에 들어간 로그인페이지 이동 링크 없애기(test)
5912  $("#cnt a").each(function () {
5913    var contentALink = $(this).attr("href");
5914    if (contentALink !== undefined) {
5915      if (contentALink.indexOf("login.html") > -1 && $("#loginChk_member").length > 0) {
5916        $(this).attr("href", "");
5917        $(this).css("cursor", "default");
5918      }
5919    }
5920  });
5921
5922  // 분기처리 위한 개수 저장
5923  var main_page = $("#main").length;
5924  var login_page = $("#login").length;
5925  // 현재 페이지 url
5926  var nowLink = window.location.href;
5927  // 현재 페이지 hostname
5928  var nowLinkHostName = window.location.hostname;
5929  // 현재 페이지 pathname
5930  var nowLinkPathName = window.location.pathname;
5931
5932  //매핑 카카오 페이지
5933  var mapping_kakao = sessionStorage.getItem("mappingKaKao");
5934
5935  //우선 돌려보내야 하는 주소 저장
5936  // pathname에 '/member/'가 없고 '/myshop/'이 없다면 = /'member'/ /myshop/이 아니라면
5937  if (nowLinkPathName.indexOf("/member/") == -1 && nowLinkPathName.indexOf("/myshop/") == -1) {
5938    // linkSave에 현재페이지에서 pathname을 뺀 뒷부분의 내용을 저장
5939    var linkSave = nowLink.split(nowLinkPathName)[1];
5940    // 도메인을 제외한 뒷주소 'forReturnUrl'로 세션에 저장
5941    sessionStorage.setItem("forReturnUrl", nowLinkPathName + linkSave);
5942  }
5943
5944  //로그인 페이지
5945  if (login_page > 0) {
5946    //이전페이지 저장
5947    var refer_url = document.referrer;
5948    //이전페이지에서 login페이지가 아니라면
5949    if (refer_url.indexOf("login.html") == -1 && refer_url.indexOf("soylive") == -1) {
5950      //세션 저장
5951      sessionStorage.setItem("chk_url_prev", refer_url);
5952    }
5953    //비회원 구매 버튼 클릭시 팝업 등장
5954    $("#noMemberWrap").click(function () {
5955      $(".nonmember_pop_container").show();
5956    });
5957    //비회원 팝업 x 버튼 클릭시 팝업 닫힘
5958    $(".nonmember_pop .pop_close, .nonmember_pop_container").click(function () {
5959      $(".nonmember_pop_container").hide();
5960    });
5961    //return Url 값 있으면 회원가입 페이지에 연결해주기..
5962    if (nowLink.indexOf("returnUrl=") > -1) {
5963      var oriJoinLink = $(".box_member .intend_join a").attr("href");
5964      var returnUrlChk = nowLink.split("returnUrl=")[1];
5965      $(".box_member .intend_join a").attr("href", oriJoinLink + "?returnUrl=" + returnUrlChk);
5966    }
5967
5968    /**************** * 최적화 리다이렉트 * 회원가입 브릿지 페이지 => 로그인 페이지일때 로그인 후 메인페이지로 리다이렉트 ******************/
5969    var returnUrlInput = $("#returnUrl");
5970    // undefined를 indexOf하면 오류 발생해서 조건문에 !!returnUrlInput.val() && 추가
5971    if (!!returnUrlInput.val() && returnUrlInput.val().indexOf("/member/bridge.html") > -1) {
5972      returnUrlInput.val("/");
5973    }
5974    /**************** 회원가입 브릿지 페이지 => 로그인 페이지일때 로그인 후 메인페이지로 리다이렉트 ******************/
5975  }
5976
5977  //회원가입 페이지일때 ..........
5978  if ($("#join_input").length > 0) {
5979    if (nowLink.indexOf("returnUrl=") > -1) {
5980      var returnUrlChk = nowLink.split("returnUrl=")[1];
5981      $("#returnUrl").val("/member/join_result.html?returnUrl=" + returnUrlChk);
5982    }
5983  }
5984
5985  //회원가입 완료 페이지일때 ...
5986  if ($(".subtitle.member.finish").length > 0) {
5987    //return Url 값 있으면 보내줘..
5988    if (nowLink.indexOf("returnUrl=") > -1) {
5989      var returnUrlChk = nowLink.split("returnUrl=")[1];
5990      setTimeout(function () {
5991        //window.location.href = returnUrlChk;
5992      }, 1000);
5993    }
5994  }
5995
5996  // 현재 분기를 더해줘야 함 생각해보니 비로그인 > confim 확인 > 회원가입 > 후 > return
5997  // 그럴려면 sessionStorage를 이용해야할거 같은데..
5998  // 현재는 페이지만 return 전페이지로 간다
5999
6000  // 현재 페이지가 회원가입 완료후
6001
6002  //var preDprevPage = sessionStorage.getItem('forReturnUrl');
6003  if (nowLink.indexOf("/join_result") > -1) {
6004    var forname = sessionStorage.getItem("proReturnUrl");
6005    if (forname == 1) {
6006      window.location.href = mapping_kakao;
6007    }
6008  }
6009
6010  //현재 페이지가 로그인페이지가 아니라면 재입고 버튼 누르고 로그인창갔다가 다시 다른 창에 들어갔다가 로그인 해서 다시 본상품으로 돌아 갔을때 팝업 방지
6011
6012  var login_chk = $("#loginChk_member").length;
6013  // var main_page = $('#main').length; // 메인 페이지
6014  // var login_page = $('#login').length; 로그인 페이지
6015  var join_page = $("#join_input").length; // 회원가입 페이지
6016  var join_result_page = $(".subtitle.member.finish").length; // 회원가입 완료 페이지
6017  var sns_login_page = $(".mappging_login_container").length; // SNS 연동 페이지
6018  var event_page = $(".eventDetail").length; // 이벤트 페이지
6019
6020  // 로그인, 회원가입, 회원가입완료, SNS계정연동 페이지
6021  if (
6022    login_page != 1 &&
6023    join_page != 1 &&
6024    join_result_page != 1 &&
6025    sns_login_page != 1 &&
6026    event_page != 1
6027  ) {
6028    var $currentLinkFIX = window.location.pathname + window.location.search;
6029    sessionStorage.setItem("noLoginReturnFIX", $currentLinkFIX);
6030    // ★★ 최적화 리다이렉트: 쿠폰 없이 회원가입 => 리다이렉트 세션 (iv_coupon_refact.js 에서 옮김) ★★
6031  }
6032
6033  // 로그인, 회원가입, 회원가입완료, SNS계정연동 페이지, 메인페이지
6034  if (
6035    login_page != 1 &&
6036    join_page != 1 &&
6037    join_result_page != 1 &&
6038    sns_login_page != 1 &&
6039    main_page != 1
6040  ) {
6041    //var return_chk = sessionStorage.getItem("forReturnUrl");
6042    //if( return_chk == null || return_chk == undefined ){
6043    sessionStorage.removeItem("proReturnUrl");
6044
6045    // }
6046  } else if (main_page > 0 && login_chk == 0) {
6047    sessionStorage.removeItem("proReturnUrl");
6048  }
6049
6050  // 매핑 로그인 이후 메인페이지 도달 시 + proReturnUrl 있을시
6051  var document_prev = document.referrer; // 이전 페이지 값 구하기
6052  var forname = sessionStorage.getItem("proReturnUrl");
6053
6054  // 메인 페이지이고, 이전 페이지가 SNS로그인 페이지 였다면
6055  if (main_page > 0 && mapping_kakao != null) {
6056    // 재입고알림 버튼 클릭시 생성
6057    if (forname == 1) {
6058      window.location.href = mapping_kakao; // 해당 상품으로 리턴
6059    }
6060  }
6061
6062  //로그인페이지에서 저장한 세션값(로그인 페이지의 이전 페이지) 가져오기
6063  var prevPage = sessionStorage.getItem("chk_url_prev");
6064  var location_href = window.location.href;
6065  //현재 페이지가 로그인페이지라면
6066  if (location_href.indexOf("member/login.html") > -1) {
6067    //로그인 페이지에서 저장한 이전 페이지 session과 로그인 한 회원 id session값이 존재한다면
6068    // chk_url_prev 내용이 있고, 로그인했다면
6069    if (!!prevPage && CAPP_ASYNC_METHODS.member.__sMemberId !== null) {
6070      //로그인 페이지에서 저장한 이전페이지로 이동
6071      var couponLink = localStorage.getItem("coupon");
6072      if (couponLink) {
6073      } else {
6074        window.location.href = prevPage;
6075      }
6076    }
6077  }
6078
6079  //햄버거 메뉴 누르면
6080  // $(".gnb .cate_menu .all").click(function () {
6081  //   var hamMenu = $("#wrapper #header .gnb .menu .btn li.all a").hasClass("click");
6082
6083  //   if (hamMenu) {
6084  //     $("#wrapper #header .gnb .menu .btn li.all a").removeClass("click");
6085  //   } else {
6086  //     $("#wrapper #header .gnb .menu .btn li.all a").addClass("click");
6087  //   }
6088  //   // $('#wrapper #header .gnb .menu .btn li.all a').toggleClass("click"); 치환하면 어떨까..
6089  // });
6090
6091  //리뷰 수 클릭해서 상품 상세페이지인지 파악
6092  var nowLink_detail = nowLink.indexOf("/product/detail.html");
6093  if (nowLink_detail > 0) {
6094    var reveiwCon = sessionStorage.getItem("reviewClick");
6095    if (reveiwCon !== null) {
6096      //sessionStrorage 값이 있을 경우 = 메인에서 리뷰스를 클릭했을 경우만 실행
6097      var reviewTop = $("." + reveiwCon).offset().top;
6098      $("html").animate({ scrollTop: reviewTop - 300 }, 500);
6099    }
6100    sessionStorage.removeItem("reviewClick"); // 삭제
6101  } else {
6102    sessionStorage.removeItem("reviewClick"); // 삭제
6103  }
6104
6105  // var mypage = $("#mypage").length;
6106  // var mypage2 = $("#mypage_menu").length;
6107
6108  // if (mypage > 0 || mypage2 > 0) {
6109  //   //setTimeout(sessionChk, 100); // 회원,멤버십
6110  //   //sessionChk();
6111  //   mileageChk(); // 마일리지
6112  //   couponChk(); //쿠폰
6113  //   // var aData = CAPP_ASYNC_METHODS.aDatasetList.join(",");
6114  //   // var sPathRole = "&path_role=" + CAPP_ASYNC_METHODS.EC_PATH_ROLE;
6115  //   // var sEcMobile = "&EC_MOBILE=" + EC_MOBILE;
6116  //   // EC$.ajax({
6117  //   //   url: "/exec/front/manage/async?module=" + aData + sPathRole + sEcMobile,
6118  //   //   dataType: "json",
6119  //   //   success: function (aData) {
6120  //   //     console.log("aData ===>", aData);
6121  //   //     let member = aData.member.memberData;
6122
6123  //   //     var groupName = member.group_name;
6124  //   //     var memberName = member.name;
6125  //   //     var memberId = member.id;
6126
6127  //   //     if (memberId) {
6128  //   //       $(".myinfo_box .member").text(groupName);
6129  //   //       $(".myinfo_box .name").text(memberName);
6130
6131  //   //       $("#mypage_menu .name").text(memberName);
6132  //   //       $("#mypage_menu .grade").html(`<span>${groupName}</span> 회원`);
6133
6134  //   //       $("#mypage_menu .name > span").text(memberName);
6135  //   //       $("#mypage_menu .grade > span").text(groupName);
6136  //   //     }
6137  //   //   },
6138  //   // });
6139  //   // 회원,멤버십----------------------------------------------------------------------------------------------------------------------
6140  //   // (function sessionChk() {
6141  //   //   if (MEMBER_INFO.group_name !== null) {
6142  //   //     //var data_json = JSON.parse(member_session);
6143  //   //     var groupName = MEMBER_INFO.group_name; //그룹명
6144  //   //     var memberName = MEMBER_INFO.name; //아이디
6145  //   //     console.log("groupName", groupName);
6146
6147  //   //     $(".myinfo_box .member").text(groupName);
6148  //   //     $(".myinfo_box .name").text(memberName);
6149
6150  //   //     $("#mypage_menu .name").text(memberName);
6151  //   //     $("#mypage_menu .grade").html(`<span>${groupName}</span> 회원`);
6152
6153  //   //     $("#mypage_menu .name > span").text(memberName);
6154  //   //     $("#mypage_menu .grade > span").text(groupName);
6155  //   //   }
6156  //   // })();
6157  //   // 회원,멤버십----------------------------------------------------------------------------------------------------------------------
6158
6159  //   // 마일리지 ---------------------------------------------------------------------------------------------------------------------
6160  //   function mileageChk() {
6161  //     var mileageTxt = $(".myinfo_box #xans_myshop_bankbook_avail_mileage").text();
6162  //     if (mileageTxt.indexOf("원") > -1) {
6163  //       //마일리지 값들어옴
6164  //       //쿠폰, 마일리지 수 넣어주기
6165  //       var mileageResult = mileageTxt.replace("원", "");
6166  //       $(".myinfo_box #xans_myshop_bankbook_avail_mileage").text(mileageResult);
6167  //       setTimeout(function () {
6168  //         $(".myinfo_box #xans_myshop_bankbook_avail_mileage").text(mileageResult);
6169  //       }, 100);
6170  //     }
6171  //   }
6172  //   mileageChk();
6173  //   if ($(".myinfo_box #xans_myshop_bankbook_avail_mileage").length > 0) {
6174  //     IV$(".myinfo_box #xans_myshop_bankbook_avail_mileage").iv_observerFunc(
6175  //       function () {
6176  //         mileageChk();
6177  //       },
6178  //       {
6179  //         attributes: false,
6180  //         childList: true,
6181  //         subtree: false,
6182  //       }
6183  //     );
6184  //   }
6185  //   // 마일리지 ---------------------------------------------------------------------------------------------------------------------
6186
6187  //   // 쿠폰 ---------------------------------------------------------------------------------------------------------------------
6188  //   function couponChk() {
6189  //     var couponTxt = $(".myinfo_box #xans_myshop_bankbook_coupon_cnt").text().length;
6190  //     if (couponTxt > 0) {
6191  //       //마일리지 값들어옴
6192  //       //쿠폰, 마일리지 수 넣어주기
6193  //       var coupon = $(".myinfo_box #xans_myshop_bankbook_coupon_cnt").text();
6194  //       coupon = onlyNumbFunc(uncomma(coupon));
6195  //       $(".myinfo_box #xans_myshop_bankbook_coupon_cnt").text(comma(coupon));
6196  //     } else {
6197  //       setTimeout(couponChk, 100);
6198  //     }
6199  //   }
6200  //   // 쿠폰 ---------------------------------------------------------------------------------------------------------------------
6201
6202  //   // 예치금 ---------------------------------------------------------------------------------------------------------------------
6203  //   function depositChk() {
6204  //     var depositTxt = $(".myinfo_box #xans_myshop_bankbook_deposit").text();
6205  //     if (depositTxt.indexOf("원") > -1 && depositTxt != "0원") {
6206  //       var depositResult = depositTxt.replace("원", "");
6207  //       $(".myinfo_box #xans_myshop_bankbook_deposit").text(depositResult);
6208  //       setTimeout(function () {
6209  //         $(".myinfo_box #xans_myshop_bankbook_deposit").text(depositResult);
6210  //       }, 100);
6211
6212  //       // 0원이 아닐 때만 영역 보여주기
6213  //       $(".myinfo_box .right .deposits").removeClass("layout-hidden2");
6214  //     }
6215  //   }
6216  //   depositChk();
6217  //   if ($(".myinfo_box #xans_myshop_bankbook_deposit").length > 0) {
6218  //     IV$(".myinfo_box #xans_myshop_bankbook_deposit").iv_observerFunc(
6219  //       function () {
6220  //         depositChk();
6221  //       },
6222  //       {
6223  //         attributes: false,
6224  //         childList: true,
6225  //         subtree: false,
6226  //       }
6227  //     );
6228  //   }
6229  //   // 예치금 ---------------------------------------------------------------------------------------------------------------------
6230  // } // if( mypage > 0 || mypage2 > 0 )
6231
6232  //장바구니 상품 0 일때
6233  // var bsk_txt = $("#wrapper #header .gnb .menu .btn li.cart a span").text();
6234
6235  //dimmed 클릭 시 메뉴 닫히기
6236  // $("#allmenu .dimmed").click(function () {
6237  //   toggle_view("allmenu", $(".all a"));
6238  //   $(".all a").removeClass("click");
6239  // });
6240
6241  //카테고리 마우스오버
6242  // $(".category .left > ul .menu_2ul > li").mouseover(function () {
6243  //   $(this).find(".menu_3ul").css({"z-index": 15, opacity: 1, display: "block"});
6244  // });
6245
6246  // $(".category .left > ul .menu_2ul > li").mouseleave(function () {
6247  //   $(this).find(".menu_3ul").css({"z-index": -1, opacity: 0, display: "none"});
6248  // });
6249
6250  // ----------------------------------------------------------------------------------------------------------
6251
6252  $(".prd_basic  > .common_prd_list").each(function () {
6253    //상품분류. 메인에서 추가항목 있을 경우 할인율 띄우기
6254    var discount_show2 = $(this).find(".display_할인율노출여부").text().trim();
6255    // 관리자메뉴에서 직접입력했을경우 나오는것으로 보임...!
6256    if (discount_show2.indexOf("y") > -1 || discount_show2.indexOf("Y") > -1) {
6257      $(this).find(".price .sale_percent").show();
6258    }
6259
6260    var el = $(this);
6261    selectedColorChipFunc(el); //특정 선택 컬러칩으로 노출
6262    //세트 상품 = 세트 상품일 때는 컬러칩 모듈에 자동으로 displaynone 클래스 추가되어 있음
6263    if ($(this).find(".color_review .colorchip").hasClass("displaynone")) {
6264      if ($(this).find(".set_colornum").length > 0) {
6265        //세트 상품일 때 컬러칩 활용할 수 있는 추가 항목 생성함.
6266        var color_count = onlyNumbFunc($(this).find(".set_colornum > span").text()); //추가 항목에 입력되어 있는 텍스트의 숫자만 가져옴.
6267        $(this)
6268          .find(".color_review .colorchip_count")
6269          .append(color_count + '<span class="mgL5">컬러</span>');
6270        $(this).find(".color_review .colorchip_count").show();
6271      }
6272      //일반 상품
6273    } else {
6274      //컬러칩 추가 항목 입력에 따라 컬러수 or 컬러칩 노출
6275      //컬러수로 노출
6276      var color_count = $(this).find(".color_review .xans-product-colorchip > span").length; //상품 분류, 메인 에서 보여지는 컬러칩
6277      var color_count2 = $(this).find(".color_review .xans-search-colorchip > span").length; //상품 검색에서 보여지는 컬러칩
6278
6279      //0이 아니라면 옵션색상이 있다는 것이고, 단일 상품이라는 뜻. 세트 상품은 컬러칩 자체를 못 불러옴. 컬러칩은 ê²°êµ­ 옵션을 가져ì˜
6279¤ëŠ” 건데 세트 상품은 상품 + 상품 이기 때문에 기준이 없어서 못 가져오는 것 같음.
6280      if (color_count != 0 || color_count2 != 0) {
6281        //컬러박스로 노출 원할 경우, 컬러 count 숨김
6282        if ($(this).find(".colorchip_box > span").length > 0) {
6283          $(this).find(".color_review .colorchip_count").hide();
6284        } else {
6285          //컬러칩 말고 컬러 수로 노출 원할 경우
6286
6287          //검색페이지
6288          if ($(".color_review .xans-search-colorchip").length > 0) {
6289            //상품 검색에서 컬러칩 length 찾아서 append 시켜줌
6290            $(this)
6291              .find(".color_review .colorchip_count")
6292              .append(color_count2 + '<span class="mgL5">컬러</span>');
6293            $(this).find(".color_review .colorchip_count").show();
6294          } else {
6295            //상품 분류페이지
6296            //상품 분류,메인에서 컬러칩 length 찾아서 append 시켜줌
6297            $(this)
6298              .find(".color_review .colorchip_count")
6299              .append(color_count + '<span class="mgL5">컬러</span>');
6300            $(this).find(".color_review .colorchip_count").show();
6301          }
6302        }
6303      }
6304    }
6305    //특정 선택 컬러칩으로 노출
6306    function selectedColorChipFunc(el) {
6307      //추가항목 각각 실행
6308      el.find(".box .xans-product-listitem > li , .box .xans-search-listitem > li").each(function () {
6309        var colorchip = $(this).find(".title > span").text().trim();
6310        //추가항목 타이틀이 컬러칩 출력유무일 경우
6311        if (colorchip.indexOf("컬러칩출력유무") > -1) {
6312          $(this).addClass("colorchip_wrap"); //컬러칩출력유무 추가 항목에 addClass
6313
6314          // 컬러칩 출력유무 추가항목에서 '세트'라는 텍스트가 없을 경우 = 컬러칩으로 노출되기 원함.
6315          if ($(this).children("span").text().indexOf("세트") == -1) {
6316            var colortxt = $(this).children("span").text().split(","); //세트라는 텍스트가 없다면 핵스코드로 색상 입력했을 것임. 그래서 , 를 기준으로 split 하여 색상 값 가져옴.
6317            var colorWrap = $(this).parents(".info").find(".color_review .colorchip_box"); // 미리 마크업에 생성해둔 colorchip_box 에 append 시켜주기
6318            colortxt.forEach(function (color, idx) {
6319              $(colorWrap).append('<span class="color" style="background-color:' + color + '"></span>');
6320            });
6321
6322            //컬러칩으로 원하는 것이므로 컬러수는 숨김처리
6323            $(this).parents(".info").find(".color_review .colorchip_count").hide();
6324          } else {
6325            //세트 라는 텍스트 있을 경우 컬러수 노출을 원하는 경우임.
6326            $(this).addClass("set_colornum"); // 컬러수로 노출 될 경우엔 addClass .set_colornum
6327          }
6328        } else {
6329        }
6330      }); //추가 항목 반복문
6331    }
6332  }); //컬러칩 추가 항목 입력에 따라 컬러수 or 컬러칩 노출
6333
6334  // ------------------------------------------------------------------------------- GNB 영역 ------------------------------------------------------------------------------------- //
6335  // 전체메뉴 배너매니저 상단 영역
6336  $(".gnb_inner .right .all_menu_top ul li").each(function () {
6337    var $this = $(this);
6338    var mytext = $this.attr("data-text");
6339    var text_title = mytext.split(",")[0]; // title
6340    var text_desc = mytext.split(",")[1]; // desc
6341
6342    $this.find(".all_menu_title").text(text_title);
6343    $this.find(".all_menu_desc").text(text_desc);
6344  });
6345
6346  // ------------------------------------------------------------------------------- 메인 ------------------------------------------------------------------------------------- //
6347  if (main_page > 0) {
6348    //리뷰 누르면 session 저장
6349    $("#main .detail_review").click(function () {
6350      sessionStorage.setItem("reviewClick", "tab_revqna"); // 저장
6351    });
6352
6353    //카카오싱크로 가입했을때 , 메인 페이지로 떨어지면 원래 보고 있던 페이지로 보내줌
6354    var forMappingKaKao = sessionStorage.getItem("mappingKaKao");
6355    // 이전페이지 url
6356    var prevPageChk = document.referrer;
6357    // = typeof prevPageChk != ''; = prevPageChk 값이 있다면,
6358    if (typeof prevPageChk != "undefined") {
6359      if (prevPageChk.indexOf("kakao") > -1) {
6360        if (forMappingKaKao) {
6361          if (forMappingKaKao != "/") {
6362            sessionStorage.removeItem("mappingKaKao");
6363            window.location.href = forMappingKaKao; //해당 주소로 이동시킴
6364          } else {
6365            sessionStorage.removeItem("mappingKaKao");
6366          }
6367        }
6368      }
6369    }
6370
6371    // * --------------------------------------------------------- 배너 영역 -------------------------------------------------------------- * //
6372    $(".main_visual_section.swiper-container .swiper-slide").each(function () {
6373      var imgBg = $(this).find("img").attr("src");
6374      $(this).css("background-image", 'url("' + imgBg + '")');
6375      $(this).find("img").remove();
6376      $(this).find("a > *").wrapAll('<div class="text_box"></div>');
6377    });
6378
6379    //텍스트 겹침 현상으로 window load 위치로 스크립트 옮김
6380    //    /layout/basic/js/basic.js  파일로 이동
6381
6382    //주간 인기 상품
6383    var BestSwiper = new Swiper(".best_container .swiper-container", {
6384      slidesPerView: 4,
6385      spaceBetween: 20,
6386      slidesPerGroup: 4,
6387      observer: true,
6388      observeParents: true,
6389      navigation: {
6390        nextEl: ".best_container .swiper-button-next",
6391        prevEl: ".best_container .swiper-button-prev",
6392      },
6393    });
6394
6395    //이번달 신상품
6396    var NewSwiper = new Swiper(".new_container .swiper-container", {
6397      slidesPerView: 3,
6398      spaceBetween: 20,
6399      slidesPerGroup: 3,
6400      navigation: {
6401        nextEl: ".new_container .swiper-button-next",
6402        prevEl: ".new_container .swiper-button-prev",
6403      },
6404    });
6405
6406    //아울렛
6407    var OutletSwiper = new Swiper(".outlet_wrapper.swiper-container", {
6408      slidesPerView: 5.2,
6409      spaceBetween: 20,
6410      freeMode: true,
6411      pagination: {
6412        el: ".outlet_wrapper .swiper-pagination",
6413        clickable: true,
6414      },
6415    });
6416
6417    //레깅스
6418    var LeggingsSwiper = new Swiper(".leggings_wrapper.swiper-container", {
6419      slidesPerView: 5.2,
6420      spaceBetween: 20,
6421      freeMode: true,
6422      pagination: {
6423        el: ".leggings_wrapper .swiper-pagination",
6424        clickable: true,
6425      },
6426    });
6427
6428    //브라탑
6429    var BraTopSwiper = new Swiper(".bratop_wrapper.swiper-container", {
6430      slidesPerView: 5.2,
6431      spaceBetween: 20,
6432      freeMode: true,
6433      pagination: {
6434        el: ".bratop_wrapper .swiper-pagination",
6435        clickable: true,
6436      },
6437    });
6438
6439    //lookbook 게시글 가져오기
6440    $(".lookbook  .list_board > li").each(function () {
6441      var cate_no = $(this).find(".info .con .cate").text().split("/")[0];
6442      var prd_no = $(this).find(".info .con .cate").text().split("/")[1];
6443
6444      //cate_no= 0 일 경우, 상세페이지로
6445      if (cate_no == "0") {
6446        $(this)
6447          .find(".info .go_cate")
6448          .attr("href", "/product/detail.html?product_no=" + prd_no);
6449        $(this)
6450          .find(".info .con")
6451          .attr("href", "/product/detail.html?product_no=" + prd_no);
6452        $(this)
6453          .find(".board_box .img")
6454          .attr("href", "/product/detail.html?product_no=" + prd_no);
6455      } else if (prd_no == "0") {
6456        //prd_no = 0 일 경우, 카테고리 넘버로
6457        $(this)
6458          .find(".info .go_cate")
6459          .attr("href", "/product/list.html?cate_no=" + cate_no);
6460        $(this)
6461          .find(".info .con")
6462          .attr("href", "/product/list.html?cate_no=" + cate_no);
6463        $(this)
6464          .find(".board_box .img")
6465          .attr("href", "/product/list.html?cate_no=" + cate_no);
6466      } else if (prd_no !== "0" && cate_no !== "0") {
6467        $(this)
6468          .find(".info .go_cate")
6469          .attr("href", "/product/detail.html?product_no=" + prd_no + "&cate_no=" + cate_no);
6470        $(this)
6471          .find(".info .con")
6472          .attr("href", "/product/detail.html?product_no=" + prd_no + "&cate_no=" + cate_no);
6473        $(this)
6474          .find(".board_box .img")
6475          .attr("href", "/product/detail.html?product_no=" + prd_no + "&cate_no=" + cate_no);
6476      }
6477    });
6478    //main 끝
6479  } else {
6480    if (nowLinkPathName.indexOf("/member/") == -1) {
6481      sessionStorage.removeItem("mappingKaKao");
6482    }
6483  }
6484
6485  // 탭 형태 구현 ---------------------------------------------------------------------------- //
6486  $(".base_tab_container").each(function () {
6487    var tabAble = $(this).data("tab"); //탭 활성화 여부 true/false
6488    var tabModule = $(this).data("tab-module"); //탭 모듈 번호
6489
6490    //값이 true일때만 실행
6491    if (tabAble) {
6492      var tabContainer = jQuery1_11_2(this);
6493      var tabBar = jQuery1_11_2(this).find('[data-tab-type="header"]');
6494      var tabContent = jQuery1_11_2(this).find('[data-tab-type="content"]');
6495
6496      //탭 모듈 1 -- 탭 클릭 시 on off 전환
6497      if (tabModule == "1") {
6498        //첫번째 항목에 on 추가 (.displaynone 아닌 것 중 첫번째)
6499        tabBar.find("[data-tab-connect]:not(.displaynone)").eq(0).addClass("on");
6500
6501        //첫번째 항목에 on 추가 (.displaynone 아닌 것 중 첫번째)
6502        tabContent.find("[data-tab-connect]:not(.displaynone)").eq(0).addClass("on");
6503
6504        //클릭 시 제어
6505        tabBar
6506          .find("[data-tab-connect]")
6507          .off()
6508          .on("click", function (e) {
6509            e.stopPropagation();
6510            var tabBarConnect = $(this).data("tab-connect");
6511
6512            // tabBar
6513            tabBar.find("[data-tab-connect]").removeClass("on");
6514            tabBar.find('[data-tab-connect="' + tabBarConnect + '"]').addClass("on");
6515
6516            //tabContent
6517            tabContent.find("[data-tab-connect]").removeClass("on");
6518            tabContent.find('[data-tab-connect="' + tabBarConnect + '"]').addClass("on");
6519
6520            var tabOffset = tabBar.offset().top - 60;
6521
6522            //주문서페이지에서만
6523            if ($(".order_container").length > 0) {
6524              if (tabBarConnect == 2) {
6525                EC$("input[name=cashreceipt_regist]").filter("[value=1]").prop("checked", true).trigger("click");
6526              } else if (tabBarConnect == 3) {
6527                EC$("input[name=tax_request_regist]").filter("[value=1]").prop("checked", true).trigger("click");
6528              } else if (tabBarConnect == 1) {
6529                EC$("input[name=tax_request_regist]").filter("[value=99]").prop("checked", true).trigger("click");
6530                EC$("input[name=cashreceipt_regist]").filter("[value=99]").prop("checked", true).trigger("click");
6531              }
6532            }
6533          });
6534
6535        //탭 모듈2 -- 탭 클릭시 해당 위치로 이동
6536      } else if (tabModule == "2") {
6537        var topBannerHeight = jQuery1_11_2("#base_top_banner").outerHeight();
6538        var headerHeight = jQuery1_11_2("#header_container .hd_bottom_wrapper").outerHeight();
6539        var totalHeaderHeight = topBannerHeight + headerHeight;
6540        var tabHeight = tabBar.outerHeight();
6541        var tabOffsetArray = new Array();
6542
6543        $(window).ready(function () {
6544          if (tabContainer.hasClass("done") == false) {
6545            topWithTabHeightCalcFunc();
6546          }
6547          $(".prd_detail_content img").each(function () {
6548            var thisImg = $(this);
6549            imageLoad_resetArray(thisImg);
6550          });
6551          function imageLoad_resetArray(thisImg) {
6552            var thisImgHeight = thisImg.outerHeight();
6553            if (thisImg.outerHeight() == "1") {
6554              setTimeout(imageLoad_resetArray, 300, thisImg);
6555              thisImgHeight = thisImg.outerHeight();
6556            } else {
6557              setTimeout(function () {
6558                tabOffsetArray = [];
6559                tabContent.find("[data-tab-connect]:not(.displaynone)").each(function () {
6560                  var tabBarConnect = $(this).data("tab-connect");
6561                  var tabContentOffset = $(this).offset().top;
6562                  var tabContentHeight = $(this).outerHeight();
6563                  var tabOffsetItem = {
6564                    no: tabBarConnect,
6565                    offsetTop: tabContentOffset,
6566                    offsetHeight: tabContentHeight,
6567                  };
6568                  tabOffsetArray.push(tabOffsetItem);
6569                });
6570              }, 300);
6571            }
6572          }
6573        });
6574
6575        //모두 로딩 될때 헤더 높이 계산 완료
6576        function topWithTabHeightCalcFunc() {
6577          if (topBannerHeight == 0 || headerHeight == 0 || tabHeight == 0) {
6578            topBannerHeight = $("#base_top_banner").outerHeight();
6579            headerHeight = $("#header_container .hd_bottom_wrapper").outerHeight();
6580            totalHeaderHeight = topBannerHeight + headerHeight;
6581            tabHeight = tabBar.outerHeight();
6582            setTimeout(topWithTabHeightCalcFunc, 100);
6583          } else {
6584            tabContainer.addClass("done");
6585            //클릭 시 제어
6586            tabBar.find("[data-tab-connect]").click(function () {
6587              var tabBarConnect = $(this).data("tab-connect");
6588              var tabContentOffset = tabContent.find('[data-tab-connect="' + tabBarConnect + '"]').offset().top;
6589              var scrollTop = tabContentOffset - 200;
6590              $("html, body").animate(
6591                {
6592                  scrollTop: scrollTop,
6593                },
6594                500
6595              );
6596            });
6597
6598            //탭 영역 로딩 setTimeout
6599            setTimeout(function () {
6600              tabOffsetArray = [];
6601              tabContent.find("[data-tab-connect]:not(.displaynone)").each(function () {
6602                var tabBarConnect = $(this).data("tab-connect");
6603                var tabContentOffset = $(this).offset().top;
6604                var tabContentHeight = $(this).outerHeight();
6605                var tabOffsetItem = { no: tabBarConnect, offsetTop: tabContentOffset, offsetHeight: tabContentHeight };
6606                tabOffsetArray.push(tabOffsetItem);
6607              });
6608
6609              //스크롤 시 해당하는 탭 영역에 .on
6610              var elChk;
6611              $(window).scroll(function () {
6612                var scrollTop = $(window).scrollTop();
6613                tabOffsetArray.forEach(function (el, idx) {
6614                  if (scrollTop >= el.offsetTop - 250) {
6615                    elChk = el.no;
6616                  }
6617                });
6618                setTimeout(function () {
6619                  if (scrollTop < tabOffsetArray[0].offsetTop - 250) {
6620                    tabBar.find("[data-tab-connect]").removeClass("on");
6621                  }
6622                  if (tabBar.find('[data-tab-connect="' + elChk + '"]').hasClass("on") == false) {
6623                    tabBar.find("[data-tab-connect]").removeClass("on");
6624                    tabBar.find('[data-tab-connect="' + elChk + '"]').addClass("on");
6625                  }
6626                }, 150);
6627              });
6628            }, 800);
6629          }
6630        }
6631      }
6632    }
6633  });
6634  // 이미지 카테고리 애니메이션 적용
6635  // 231215 이미지 카테고리에 done 클래스 추가해주기
6636  $(".menu_2li.img-cate").addClass("done");
6637
6638  /* ================================================================================================================================================================================*/
6639
6640  /* 23.02 베스트 딱지 */
6641
6642  /*================================================================================================================================================================================== */
6643
6644  //NEW 뱃지만 위치 수정
6645  var prdlistPage = $(".common_prd_list").length;
6646  if (prdlistPage > 0) {
6647    $(".common_prd_list").each(function () {
6648      $(this)
6649        .find(".xans-product-imagestyle")
6650        .each(function () {
6651          var badge = $(this).find("img").attr("src");
6652          if (badge !== undefined) {
6653            badge = badge.split("image_custom_")[1];
6654            if (badge == "3716764386566056.png") {
6655              $(this).addClass("badge_new");
6656            }
6657          }
6658        });
6659    });
6660  }
6661
6662  var mainPage = $("#main").length;
6663  if (mainPage > 0) {
6664    /* 메인페이지 베스트 - 순서 딱지 붙여주기 */
6665    $("#mainBest .common_prd_list").each(function (index) {
6666      index = index + 1;
6667      if (index <= 20) {
6668        $(this)
6669          .find(".box .img")
6670          .append('<span class="rankBadge">' + index + "</span>");
6671        $(this).find(".xans-product-imagestyle").addClass("left");
6672      }
6673    });
6674
6675    $("#mainBest .list-element").click(function (index) {
6676      setTimeout(function () {
6677        /* #240 - 룩북 베스트 순위 딱지 오류 */
6678        $("#mainBest .common_prd_list").each(function (index) {
6679          index = index + 1;
6680          if (index <= 10) {
6681            $(this)
6682              .find(".box .img")
6683              .append('<span class="rankBadge">' + index + "</span>");
6684            $(this).find(".xans-product-imagestyle").addClass("left");
6685          }
6686        });
6687      }, 500);
6688    });
6689  }
6690
6691  // 상품정보 함수 실행
6692  productInfoFunc();
6693  //addTextbox();
6694  applyDiscountBadge();
6695  // let productListWrap = $(".product-list-wrap");
6696  // let productItem = productListWrap.find(".item");
6697  // productItem.each(function () {
6698  //   const discountRate = getDiscountRate($(this));
6699  //   if (discountRate > 0) {
6700  //     $(this).find(".price-wrap").append(`<p class="discount-badge">${discountRate}%</p>`);
6701  //   }
6702  // });
6703  const target = document.querySelector(".product-list-wrap");
6704  if (target) {
6705    const observer = new MutationObserver((mutations) => {
6706      mutations.forEach((mutation) => {
6707        mutation.addedNodes.forEach((node) => {
6708          if (node.nodeType === 1 && node.classList.contains("item")) {
6709            // 새로 추가된 li .item만 처리
6710            const $item = $(node);
6711            const discountRate = getDiscountRate($item);
6712
6713            if (discountRate > 0) {
6714              if ($item.find(".discount-badge").length === 0) {
6715                $item.find(".price-wrap").append(`<p class="discount-badge">${discountRate}%</p>`);
6716              }
6717            }
6718          }
6719        });
6720      });
6721    });
6722    observer.observe(target, { childList: true, subtree: true });
6723  }
6724
6725  function applyDiscountBadge() {
6726    let productListWrap = $(".product-list-wrap");
6727    let productItem = productListWrap.find(".item");
6728
6729    productItem.each(function () {
6730      const discountRate = getDiscountRate($(this));
6731      if (discountRate > 0) {
6732        // 중복 추가 방지
6733        if ($(this).find(".discount-badge").length === 0) {
6734          $(this).find(".price-wrap").append(`<p class="discount-badge">${discountRate}%</p>`);
6735        }
6736      }
6737    });
6738  }
6739
6740  MEMBER_INFO = CAPP_ASYNC_METHODS.member.getData();
6741
6742  buyerId = MEMBER_INFO.member_id; // 유저 아이디
6743  USERNAME = MEMBER_INFO.name;
6744  RPHONE = MEMBER_INFO.cellphone;
6745  var groupName = MEMBER_INFO.group_name; //그룹명
6746  var memberName = MEMBER_INFO.name; //아이디
6747
6748  // $(".myinfo_box .member, #mypage_menu .grade > span").text(groupName);
6749  // $(".myinfo_box .name,  #mypage_menu .name > span").text(memberName);
6750
6751  // $("#mypage_menu .name > span").text(memberName);
6752  // $("#mypage_menu .grade > span").text(groupName);
6753
6754  if (MEMBER_INFO.group_name === null) {
6755    MEMBER_INFO = CAPP_ASYNC_METHODS.member.getData();
6756    var groupName = MEMBER_INFO.group_name; //그룹명
6757    var memberName = MEMBER_INFO.name; //아이디
6758
6759    // $(".myinfo_box .member, #mypage_menu .grade > span").text(groupName);
6760    // $(".myinfo_box .name,  #mypage_menu .name > span").text(memberName);
6761
6762    // $("#mypage_menu .name > span").text(memberName);
6763    // $("#mypage_menu .grade > span").text(groupName);
6764  }
6765
6766  // 241105 헤더
6767  let $header = EC$(".header");
6768  let $cnt = EC$("#cnt");
6769  let headerHeight = $header.outerHeight();
6770  let headerTop = $header.offset().top;
6771  let $topbnr = $("#topbnr");
6772  let topbnrHeight = $topbnr.find("a").outerHeight() || 0;
6773
6774  // 전체메뉴 (햄버거 버튼 눌러쓸때)
6775  let headerDim = EC$(".header-dim");
6776  let allMenuBtn = EC$(".all-menu-button");
6777  let allMenu = EC$(".all-menu");
6778
6779  // --all-menu-margin 값을 20px으로 설정
6780  document.documentElement.style.setProperty("--all-menu-margin", `${topbnrHeight + headerHeight}px`);
6781  document.documentElement.style.setProperty("--header-margin", `${headerHeight}px`);
6782  document.documentElement.style.setProperty("--top-bnr-height", `${topbnrHeight}px`);
6783  document.documentElement.style.setProperty(
6784    "--scrollbar-width",
6785    `${window.innerWidth - document.documentElement.clientWidth}px`
6786  );
6787
6788  let wrapper = $("#wrapper");
6789  EC$(window).on("load scroll", function () {
6790    if ($(window).scrollTop() >= 42) {
6791      $header.addClass("fixed");
6792      wrapper.addClass("is-scroll-hide");
6793      $cnt.css("padding-top", `${headerHeight}px`);
6794    } else {
6795      $header.removeClass("fixed");
6796      wrapper.removeClass("is-scroll-hide");
6797      $cnt.css("padding-top", "0");
6798    }
6799  });
6800
6801  let gnb = $header.find("#gnb");
6802  gnb.on("mouseenter", ".depth1 > li", function () {
6803    if (!allMenu.hasClass("is-active")) {
6804      $(this).find(".depth2").show();
6805    }
6806  });
6807  gnb.on("mouseleave", ".depth1 > li", function () {
6808    if (!allMenu.hasClass("is-active")) {
6809      $(this).find(".depth2").hide();
6810    }
6811  });
6812
6813  function toggleMenu() {
6814    allMenuBtn.toggleClass("is-active");
6815    allMenu.toggleClass("is-active");
6816    headerDim.toggleClass("is-active");
6817    
6818    
6819    if(!EC$(".search-modal").hasClass("is-active")){
6820      $("body").toggleClass("scrollNo");
6821    } else {
6822      EC$(".search-modal").removeClass("is-active");
6823    }
6824  }
6825
6826  allMenuBtn.on("click", toggleMenu);
6827  headerDim.on("click", toggleMenu);
6828}); //document ready
6829
6830EC$(window).on("load", function () {});
6831
6832function formatPrice(num) {
6833  var p = parseInt(num) + "";
6834  return p
6835    .split("")
6836    .reverse()
6837    .reduce(function (acc, num, i, orig) {
6838      return num == "-" ? acc : num + (i && !(i % 3) ? "," : "") + acc;
6839    }, "");
6840}
6841
6842//숫자만 남기기
6843function onlyNumbFunc(text) {
6844  var reg = /[^0-9]/g;
6845  if (text !== undefined) {
6846    if (reg.test(text)) {
6847      return text.replace(reg, "").trim();
6848    } else {
6849      return text;
6850    }
6851  }
6852}
6853
6854// 숫자 입력 제어 --- 전화번호 입력받을 경우 숫자만 입력 가능
6855function number_control(ele) {
6856  ele.keyup(function () {
6857    var value = $(this).val();
6858    var value2 = "";
6859    var phoneNumberCheck = /(01[0|1|6|9|7])[-](\d{3}|\d{4})[-](\d{4}$)/g;
6860    var phoneNumberCheck2 = /^(01[0|1|6|9|7])$/gi;
6861    if (!phoneNumberCheck.test($(this).val())) {
6862      $(this).val(
6863        $(this)
6864          .val()
6865          .replace(/[^0-9]/gi, "")
6866      );
6867      if (value.length > 2) {
6868        value2 = value.substr(0, 3);
6869        if (!phoneNumberCheck2.test(value2)) {
6870          $(this).val($(this).val().replace(/[^01]/gi, ""));
6871        }
6872      }
6873    }
6874  });
6875}
6876
6877function number_control2(ele) {
6878  ele.keyup(function () {
6879    var value = $(this).val();
6880    var value2 = "";
6881    var phoneNumberCheck = /[0-9]/g;
6882    if (!phoneNumberCheck.test($(this).val())) {
6883      $(this).val(
6884        $(this)
6885          .val()
6886          .replace(/[^0-9]/gi, "")
6887      );
6888    }
6889  });
6890}
6891
6892//blur 시 하이픈 추가 - 핸드폰 번호
6893function add_hyphen_phone(ele) {
6894  ele.blur(function () {
6895    var value = ele.val();
6896    value = value.replace(/[^0-9]/g, "");
6897    var value2 = "";
6898
6899    if (value.length == 10) {
6900      value2 += value.substr(0, 3);
6901      value2 += "-";
6902      value2 += value.substr(3, 3);
6903      value2 += "-";
6904      value2 += value.substr(6);
6905      $(this).val(value2);
6906    }
6907
6908    if (value.length == 11) {
6909      value2 += value.substr(0, 3);
6910      value2 += "-";
6911      value2 += value.substr(3, 4);
6912      value2 += "-";
6913      value2 += value.substr(7);
6914      $(this).val(value2);
6915    }
6916  });
6917}
6918
6919//blur 시 하이픈 추가 - 사업자 번호
6920function add_hyphen_regno(ele) {
6921  ele.blur(function () {
6922    var value = ele.val();
6923    value = value.replace(/[^0-9]/g, "");
6924    var value2 = "";
6925    if (value.length == 10) {
6926      value2 += value.substr(0, 3);
6927      value2 += "-";
6928      value2 += value.substr(3, 2);
6929      value2 += "-";
6930      value2 += value.substr(5);
6931      $(this).val(value2);
6932    }
6933  });
6934}
6935
6936//이메일 뒷자리 입력시 한글 입력 및 특수기호 입력 불가
6937function email_control2(ele) {
6938  ele.keyup(function () {
6939    var value = $(this).val();
6940    $(this).val(
6941      $(this)
6942        .val()
6943        .replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/gi, "")
6944    );
6945    $(this).val(
6946      $(this)
6947        .val()
6948        .replace(/[~!#$@%^&*()+|/<>,?:{}]/gi, "")
6949    );
6950  });
6951  ele.blur(function () {
6952    var value = $(this).val();
6953    if (value != "") {
6954      if (value.indexOf("@") > -1) {
6955        $(this).val($(this).val().replace(/@/gi, ""));
6956      } else {
6957        $(this).val(value);
6958      }
6959    }
6960  });
6961}
6962
6963//이메일 앞자리 입력시 영문,숫자, 하이픈만 가능
6964function email_control1(ele) {
6965  ele.keyup(function () {
6966    var value = $(this).val();
6967    $(this).val(
6968      $(this)
6969        .val()
6970        .replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/gi, "")
6971    );
6972    $(this).val(
6973      $(this)
6974        .val()
6975        .replace(/[~!@#$%^&*()+|/<>,.?:{}]/gi, "")
6976    );
6977  });
6978}
6979
6980//배열값 내 특정 텍스트 존재하는지 확인
6981function checkAvailability(arr, val) {
6982  return arr.some(function (arrVal) {
6983    return val === arrVal;
6984  });
6985}
6986
6987// 카테고리의 cate_no 가져오기 * 변수: 가져올 값, 링크
6988function getCateParam(name, url) {
6989  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
6990  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
6991    results = regex.exec(url);
6992  return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
6993}
6994
6995//콤마찍기
6996function comma(str) {
6997  str = String(str);
6998  return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, "$1,");
6999}
7000
7001//콤마제거
7002function uncomma(string) {
7003  var no = string.replace(/[^0-9]/g, "");
7004  return no;
7005}
7006
7007// ajax 공통 출력 함수
7008/*
7009 ** @url : API link
7010 ** @type : GET or POST
7011 ** @moreData : API use data
7012 ** @event : event
7013 */
7014
7015var clickFlag = true;
7016
7017function commonAjax(url, type, moreData, event) {
7018  switch (type) {
7019    case "POST":
7020      var ajaxData = moreData == null ? null : JSON.stringify(moreData);
7021      break;
7022    case "GET":
7023      var ajaxData = moreData == null ? null : moreData;
7024      break;
7025  }
7026  return new Promise(function (res, rej) {
7027    $.ajax({
7028      url: url,
7029      type: type,
7030      data: ajaxData,
7031      contentType: "application/json",
7032      dataType: "json",
7033      error: function (err) {
7034        console.log("err========>", err);
7035        var message = err.responseJSON.message; // 에러메세지
7036        var status = err.responseJSON.status; // 에러코드
7037        if (event == null) {
7038          var actionType = "기본 호출";
7039        } else {
7040          var targetName = event.target.localName;
7041          var targetID = event.target.id != "" ? "#" + event.target.id : "";
7042          var targetClass = event.target.className.length != 0 ? "." + event.target.className.split(" ").join(".") : "";
7043          var target = targetName + targetID + targetClass;
7044          var actionType = `type : ${event.type}, target : ${target}`;
7045        }
7046
7047        var errData = {
7048          content: `status:${err.status}`,
7049          url: `windowURL : ${EC$(location).attr("href")}, APIURL : ${url}`,
7050          actionType: actionType,
7051        };
7052
7053        $.ajax({
7054          url: URL_ERROR_LOG_ADD,
7055          type: "POST",
7056          contentType: "application/json",
7057          dataType: "json",
7058          data: JSON.stringify(errData),
7059          success: function () {
7060            console.log("에러 전송 완료!");
7061            clickFlag = true;
7062          },
7063          error: function (err) {
7064            console.log("에러 전송 실패!", err);
7065          },
7066        });
7067
7068        alert(`${status} error.\n${message}`); // 에러메세지 호출
7069        clickFlag = true;
7070      }, // error
7071      success: function (data) {
7072        if (res) {
7073          res(data);
7074        }
7075        rej(new Error("error!"));
7076      },
7077    });
7078  }).catch(function (err) {
7079    console.log("promise err", err);
7080    console.log("url========>", url);
7081    if(url.indexOf("/api/mypage/balance") > -1){
7082      $('#mypage-main').removeClass("displaynone");
7083    }
7084    clickFlag = true;
7085  });
7086}
7087
7088/**** 상품정보 함수  ****/
7089function productInfoFunc() {
7090  var productListItem = $('.prd_basic .common_prd_list:not([iv-product-info = "true"])');
7091  productListItem.each(function () {
7092    var $this = $(this);
7093
7094    //textBoxFunc($this);
7095    styleOriginalPrice($this);
7096    discountPercent($this);
7097    productPlusInfo($this);
7098
7099    $this.attr("iv-product-info", true);
7100  });
7101}
7102
7103function productPlusInfo(item) {
7104  let couponPrice = item.find(".coupon_price");
7105  if (!couponPrice.hasClass("displaynone")) {
7106    couponPrice.addClass("has_coupon");
7107  }
7108}
7109
7110/* #218 - [공통] 메인페이지 영역 추가 요청 */
7111//추가 항목 : 텍스트박스 -----------------------------------------------------------------------------------
7112function addTextbox() {
7113  $(
7114    '.prd_basic .common_prd_list:not([iv-textbox = "done"]) .box .xans-product-listitem > li,.prd_basic .common_prd_list:not([iv-textbox = "done"]) .box .xans-search-listitem > li '
7115  ).each(function () {
7116    var $this = $(this);
7117    //text의 공백 없애기
7118    var textbox = $(this).find(".title > span").text().trim();
7119    if (textbox == "텍스트박스") {
7120      //텍스트박스 추가 항목일 경우
7121      $(this).addClass("textBox").removeClass("displaynone");
7122    }
7123    $this.closest("[id^='anchorBoxId_']").attr("iv-textbox", true);
7124  });
7125  writeTextbox();
7126}
7127
7128/* 상품 커스텀 텍스트 박스 */
7129function writeTextbox() {
7130  setTimeout(function () {
7131    $(".common_prd_list[iv-textbox = 'true']")
7132      .find(".textBox")
7133      .each(function () {
7134        var $this = $(this);
7135        var my_text = $this.find("strong + span").text().trim();
7136
7137        $this.find("span").text("");
7138        if (String(my_text).indexOf(";") > -1) {
7139          var array_text = my_text.replace(/(^ s*)|( s*$)/gi, "").split(";");
7140          var modify_arr = array_text
7141            .filter((x) => x === "라이브 소개")
7142            .concat(array_text.filter((x) => x !== "라이브 소개"));
7143          modify_arr.splice(5); // 5이상의 배열 전체 삭제
7144
7145          for (var i = 0; i < modify_arr.length; i++) {
7146            $this.find("span").append("<div class='add_text'>" + modify_arr[i] + "</div>");
7147          }
7148        } else {
7149          $this.find("span").append("<div class='add_text'>" + my_text + "</div>");
7150        }
7151
7152        $this.find(".add_text").each(function () {
7153          var text = $(this).text();
7154          if (text == "라이브 소개") {
7155            $(this).addClass("live");
7156          }
7157        });
7158        $this.closest("[id^='anchorBoxId_']").attr("iv-textbox", "done");
7159      });
7160  }, 300);
7161}
7162
7163function styleOriginalPrice(item) {
7164  if ($(".prd_basic").hasClass("rel") == true) {
7165    // 디테일 관련상품 제외
7166    return;
7167  }
7168  var sale = item.find(".price .sale"); //할인가
7169  var sell = item.find(".price .sell"); //판매가
7170  var customer = item.find(".price .customer"); //세트할인판매가 ?
7171  if (sale.hasClass("displaynone") != true) {
7172    // 할인판매가가 있을 때
7173    if (customer.hasClass("displaynone") != true) {
7174      // 소비자가가 있을 때
7175      sell.hide(); // 판매가 숨김
7176    } else {
7177      item.find(".price").addClass("hassale");
7178    }
7179  } else {
7180    item.find(".price").removeClass("hassale");
7181  }
7182}
7183
7184function discountPercent(item) {
7185  if (item.find(".sale_percent strong").length == 0) {
7186    var originPrice = item.find(".info .price .sell").text().trim();
7187    var originPriceLen = item.find(".info .price .sell").hasClass("displaynone");
7188
7189    //할인가격
7190    var discountPrice = item.find(".info .price .sale").text().trim();
7191    var discountPriceLen = item.find(".info .price .sale").hasClass("displaynone");
7192
7193    //할인혜택 가격
7194    var eventPrice = item.find(".info .price .customer").text().trim();
7195    var eventPriceLen = item.find(".info .price .customer").hasClass("displaynone");
7196
7197    //할인 혜택가가 있으면
7198    if (discountPriceLen == true && eventPriceLen == false) {
7199      if (originPrice != undefined && originPrice != null) {
7200        //상품가와 할인가에 , 없애주기
7201        originPrice = uncomma(originPrice);
7202        eventPrice = uncomma(eventPrice);
7203        var salePoint = Math.floor(100 - (originPrice / eventPrice) * 100);
7204
7205        item.find(".info .price .sale_percent").append("<strong>" + salePoint + "%</strong>");
7206      }
7207
7208      //할인가격이 있으면
7209    } else if (discountPriceLen == false && eventPriceLen == true) {
7210      if (originPrice != undefined && originPrice != null) {
7211        //상품가와 할인가에 , 없애주기
7212        originPrice = uncomma(originPrice);
7213        discountPrice = uncomma(discountPrice);
7214        var salePoint = Math.floor(100 - (discountPrice / originPrice) * 100);
7215        item.find(".info .price .sale_percent").append("<strong>" + salePoint + "%</strong>");
7216      }
7217
7218      //정상가만 있을 경우
7219    } else if (eventPriceLen == false && discountPriceLen == false) {
7220      if (originPrice != undefined && originPrice != null) {
7221        //상품가와 할인가에 , 없애주기
7222        discountPrice = uncomma(onlyNumbFunc(discountPrice));
7223        eventPrice = uncomma(onlyNumbFunc(eventPrice));
7224        var salePoint = Math.floor(100 - (discountPrice / eventPrice) * 100);
7225        item.find(".info .price .sale_percent").append("<strong>" + salePoint + "%</strong>");
7226      }
7227
7228      //정상가만 있을 경우
7229    } else if (discountPriceLen == true && eventPriceLen == true) {
7230      item.find(".info .price .sale_percent").hide();
7231    }
7232
7233    var per_Text = item.find(".sale_percent").text().trim();
7234    if (per_Text == "") {
7235      item.find(".sale_percent").css("display", "none");
7236    } else {
7237      item.find(".sale_percent").css("display", "inline");
7238    }
7239  }
7240}
7241
7242// 채널톡 채팅창 뜨면 버튼 숨김
7243function chTest() {
7244  IV$("#ch-plugin").iv_observerFunc(
7245    function () {
7246      console.log($("#ch-plugin-script").length, "ch-plugin-script");
7247      if ($("#ch-plugin-script").length > 0) {
7248        if (!!$("#ch-plugin-script").hasClass("ch-messenger-hidden")) {
7249          $("#ch-custom-button").css("visibility", "visible");
7250        } else {
7251          $("#ch-custom-button").css("visibility", "hidden");
7252        }
7253      }
7254    },
7255    {
7256      attributes: true,
7257      childList: true,
7258      subtree: true,
7259    }
7260  );
7261}
7262
7263function getDiscountRate($element) {
7264  let originalPrice = parseFloat($element.data("price")) || 0;
7265  let customPrice = parseFloat($element.data("custom"));
7266  let salePrice = parseFloat($element.data("sale")?.replace(/,/g, ""));
7267  if (customPrice == 0 || isNaN(customPrice)) {
7268    $element.find(".custom").remove();
7269  }
7270
7271  if (salePrice > 0) {
7272    // 세일이 있는 경우 (혜택 세일)
7273    $element.addClass("is-sale");
7274  }
7275
7276  // 소비자가도 있고 할가도 있는경우
7277  if (customPrice > 0 && salePrice > 0) {
7278    $element.find(".price").remove();
7279    originalPrice = customPrice;
7280  } else if (customPrice > 0) {
7281    // 소비자가가 있는 경우
7282    [salePrice, originalPrice] = [originalPrice, customPrice];
7283  }
7284
7285  const discountRate = Math.floor(((originalPrice - salePrice) / originalPrice) * 100);
7286
7287  return discountRate;
7288}
7289
7290
7291$(function(){
7292  var aData = CAPP_ASYNC_METHODS.aDatasetList.join(",");
7293  var sPathRole = "&path_role=" + CAPP_ASYNC_METHODS.EC_PATH_ROLE;
7294  var sEcMobile = "&EC_MOBILE=" + EC_MOBILE;  
7295  EC$.ajax({
7296    url: "/exec/front/manage/async?module=" + aData + sPathRole + sEcMobile,
7297    dataType: "json",
7298    success: function (aData) {
7299      let member = aData.member.memberData;
7300
7301      var groupName = member.group_name;
7302      var memberName = member.name;
7303      var memberId = member.id;
7304
7305      if (!memberId) {
7306        $(".no-member-info").removeClass("displaynone");
7307      }
7308    },
7309  });  
7310})
7311var exchange = $("#exchange_Return").length; // 교환반품 신청페이지 확인
7312var sameArray = new Array(); // 교환, 반품 원상품 배열
7313var exArray = new Array();
7314var exRefundTypetabChk;
7315
7316var opt_checked;
7317
7318$(window).load(function () {
7319  //교환 페이지에서만 실행
7320  //교환받을 제품 옵저버
7321  if ($(".page_exchange").length > 0) {
7322    IV$("#sPrdList").iv_observerFunc(
7323      function () {
7324        sameProduct();
7325      },
7326      {
7327        attributes: false,
7328        childList: true,
7329        subtree: false,
7330      }
7331    );
7332  }
7333});
7334
7335$(document).ready(function () {
7336  $(".confirmOpen").click(function () {
7337    var listUrl = "/myshop/order/list.html";
7338    localStorage.setItem("orderlist", listUrl);
7339  });
7340
7341  //반품 -> 리스트 페이지 찍고 교환신청 페이지로 이동
7342  var orderNum = $("#order_id").val();
7343  $(".returnToEx").each(function () {
7344    $(this).click(function () {
7345      sessionStorage.setItem("returnToEx", "exchange.html?order_id=" + orderNum);
7346      $(".page_return .returnToEx").attr("href", "/myshop/order/list.html");
7347    });
7348  });
7349  var returnToEx = sessionStorage.getItem("returnToEx");
7350  if (returnToEx) {
7351    window.location.href = returnToEx;
7352    sessionStorage.removeItem("returnToEx");
7353  }
7354
7355  //컨펌팝업
7356  $(".confirmOpen").click(function () {
7357    $(".confirmDim").addClass("on");
7358  });
7359  $(".confirmClose").click(function () {
7360    $(".confirmDim").removeClass("on");
7361  });
7362  $(".confirmNotice").click(function () {
7363    $(".confirmDim").removeClass("on");
7364  });
7365
7366  $(".confirmNotice").click(function () {
7367    var goInfo = document.querySelector(".common-info").offsetTop - 120;
7368    window.scrollTo({ top: goInfo });
7369  });
7370
7371  //상품정보 클릭 시 체크박스 연결
7372  $(".xans-myshop .product").click(function () {
7373    EC$(this)
7374      .parent()
7375      .find(".checkVal input")
7376      .prop("checked", !EC$(this).parent().find(".checkVal input").prop("checked"));
7377  });
7378
7379  // 문서 실행되자마자 풀어주기
7380
7381  var complete = false; // 최종 교환신청시 확인용 전역변수
7382  if (exchange > 0) {
7383    $("html").addClass("none_Opacity"); // 스니펫 opacity:0 막기 위해 추가
7384    /********************************************************** 최상단 페이지 넘버 구하기 참고 **********************************************************/
7385
7386    var leng = $(".productSale").length;
7387    for (var h = 0; h < leng; h++) {
7388      var prdContent = $(".productContent").length;
7389      if (leng != prdContent) {
7390        var popContent = $(".productContent").eq(h).clone();
7391        $(".product_Cover").prepend(popContent);
7392      }
7393    }
7394
7395    for (var i = 0; i < leng; i++) {
7396      var content = $(".productSale").eq(i).clone();
7397      $(".productCover").eq(i).find("tr:last-child").append(content);
7398      $(".productCover").eq(i).find(".productSale").prepend("<div class='pcQuantity'></div>");
7399    }
7400
7401    //팝업 안 컨텐츠별 숫자 부여
7402    function prdNumber() {
7403      // 개수 체크
7404      //var prdLength = $(".productContent").length;
7405      var prdLength_ = $(".productContent").not("div.displaynone").length;
7406      for (var i = 0; i < prdLength_; i++) {
7407        $(".productContent")
7408          .not("div.displaynone")
7409          .eq(i)
7410          .find(".pcQuantity")
7411          .text(i + 1);
7412      }
7413    }
7414
7415    /*======================================================================== 상품선택 & 교환상품  영역 ========================================================================*/
7416
7417    // 시작시 교환상품의 테이블 없애기
7418    //$("#sPrdList").addClass("displaynone");
7419    var productUrlNum;
7420    $(".apply_form_container .productSale").each(function () {
7421      var $this = $(this);
7422      var productUrl; //상품 url
7423      var oriPrice; // 상품 원가
7424
7425      oriPrice = $this.nextAll(".saleTd").find("strong").text();
7426      productUrl = $this.find(".thumbnail a").attr("href");
7427      productUrlNum = getCateParam("product_no", productUrl);
7428      productAjax(productUrlNum, $this, oriPrice);
7429    });
7430
7431    //원 글씨 뺴기
7432
7433    setTimeout(function () {
7434      $(".orderList").each(function (index) {
7435        let qtyInput = $(this).find(`#quantity_id_${index}`);
7436        let qtyValue = qtyInput.val();
7437        $(this).addClass("is-active");
7438        if (qtyValue == 1) {
7439          // $(this).addClass("input-hidden");
7440          // $(this).find(".ec-base-qty").prepend(`<p>${qtyValue}개</p>`);
7441          // qtyInput.remove();
7442        }
7443
7444        var wonText = $(this).find(".saleTd").find("strong").text();
7445        if (wonText.length > 0) {
7446          var resultWon = wonText.replace("원", "");
7447          $(this).find(".saleTd").find("strong").text(resultWon);
7448        }
7449      });
7450    }, 300);
7451
7452    function productAjax(url, el, ori) {
7453      $.ajax({
7454        url: "/iv/html/ajax/ajax_prdDetail.html?product_no=" + url,
7455        type: "GET",
7456        dataType: "html",
7457        success: function (html) {
7458          var salePrice = $(html).find(".productPrice .sale .font_Gilroy").text();
7459          var sameArrayEl = { prdNo: url, oriPrc: Number(onlyNumbFunc(ori)), salePrc: Number(onlyNumbFunc(salePrice)) };
7460          sameArray.push(sameArrayEl);
7461        },
7462        complete: function (html) {
7463          GiftClone(url, el);
7464        },
7465      });
7466    }
7467
7468    // 다른상품 교환 -> 상품 체크여부에 따라 함수 실행할지 결정
7469    EC$("#otherProduct #exProduct").mouseover(function () {
7470      var prdChk = $("input[id^='apply_product']:checked").length;
7471      if (prdChk == 0) {
7472        $(this).attr("onClick", "");
7473        return;
7474      } else {
7475        var reasonChk = $(".reasonList .ec-base-label input:checked").length;
7476        if (reasonChk > 0) {
7477          $(this).attr("onClick", "OrderApply.opensearchLayer();");
7478        } else {
7479          $(this).attr("onClick", "");
7480        }
7481      }
7482    });
7483
7484    // 교환상품선택시 체크한 상품이 없다면,,
7485    EC$(document).on("click", "#otherProduct a, #otherProduct2 a", function () {
7486      var prdChk = $("input[id^='apply_product']:checked").length;
7487      if (prdChk == 0) {
7488        alert("신청할 제품을 선택하세요.");
7489        $("html, body").animate({ scrollTop: 0 }, 0);
7490        return;
7491      }
7492    });
7493
7494    // 다른상품 교환 -> 상품 체크여부에 따라 함수 실행할지 결정
7495    EC$(document).on("click", "#exProduct", function () {
7496      var prdChk = $("input[id^='apply_product']:checked").length;
7497      var reasonChk = $(".reasonList .ec-base-label input:checked").length;
7498      if (prdChk == 0) {
7499        $(this).attr("onClick", "");
7500        return;
7501      } else {
7502        if (reasonChk == 0) {
7503          alert("교환 사유를 선택하세요.");
7504          $(this).attr("onClick", "");
7505          return;
7506        } else {
7507          OrderApply.opensearchLayer();
7508        }
7509      }
7510    });
7511
7512    // 수량추가 감소, +, - 버튼 클릭시
7513    $(".productList")
7514      .find("#qtyUps, #qtyDowns")
7515      .live("click", function () {
7516        $(this).parent().next(".modifyQty").trigger("click");
7517        setTimeout(sameProduct, 0);
7518        boolean = true;
7519      });
7520
7521    //동일상품 교환 버튼에 click event 연결
7522    EC$("#sameProducts").on("click", function () {
7523      var chkPrd = $("input[name^='apply_product']:checked").length;
7524      if (chkPrd == 0) {
7525        alert("신청할 제품을 선택하세요.");
7526        $("html, body").animate({ scrollTop: 0 }, 10);
7527        return false;
7528      } else {
7529        var reasonChk = $(".reasonList .ec-base-label input:checked").length;
7530        if (reasonChk == 0) {
7531          alert("교환 사유를 선택하세요.");
7532          return false;
7533        } else {
7534          opt_Chk();
7535          if (opt_checked == false) {
7536            return false;
7537          } else {
7538            OrderApply.exchangeSameProduct();
7539            exRefundTypetabChk = "same-product-tab";
7540            $(this).addClass("check");
7541            $("#exProduct").removeClass("check");
7542            setTimeout(sameProduct, 100);
7543          }
7544        }
7545      }
7546    });
7547
7548    //사이즈 교환 버튼에 click event 연결
7549    EC$(".exchangeProducts").on("click", function () {
7550      var chkPrd = $("input[name^='apply_product']:checked").length;
7551      if (chkPrd == 0) {
7552        alert("신청할 제품을 선택하세요.");
7553        $("html, body").animate({ scrollTop: 0 }, 10);
7554        return false;
7555      } else {
7556        opt_Chk();
7557        if (opt_checked == false) {
7558          return false;
7559        } else {
7560          OrderApply.exchangeSameProduct();
7561          exRefundTypetabChk = "same-product-tab";
7562          $(this).addClass("check");
7563          $("#exProduct").removeClass("check");
7564          setTimeout(sameProduct, 100);
7565        }
7566      }
7567    });
7568
7569    //다른상품 교환 버튼에 click event 연결
7570    EC$("#exProduct").on("click", function () {
7571      exRefundTypetabChk = "ex-product-tab";
7572      $(this).addClass("check");
7573      $("#sameProducts").removeClass("check");
7574      setTimeout(sameProduct, 100);
7575    });
7576
7577    // 상품선택 -> 신청수량 blur시
7578    EC$("input[name^='quantity_name']").on("blur", function () {
7579      // 신청수량 완전히 지울시 alert이 계속 발생하는 부분이 있어 2개이하일땐 return false;
7580      if ($(this).val() >= 1) {
7581        $(this).parent().next().trigger("click");
7582      } else if ($(this).val() <= 0) {
7583        alert("1개 이상 신청이 가능합니다.");
7584        $(this).val("1");
7585        return;
7586      }
7587    });
7588
7589    // 교환상품-> 상품 blur시
7590    $("input[name^='selected_quantity_name']").live("blur", function () {
7591      // 신청수량 완전히 지울시 alert이 계속 발생하는 부분이 있어 2개이하일땐 return false;
7592      if ($(this).val() >= 1) {
7593        $(this).parent().next().trigger("click");
7594      } else if ($(this).val() <= 0) {
7595        alert("1개 이상 신청이 가능합니다.");
7596        $(this).val("1");
7597        return;
7598      }
7599
7600      setTimeout(sameProduct, 100);
7601    });
7602
7603    /*======================================================================== 상품선택 & 교환상품 영역 ========================================================================*/
7604
7605    /*======================================================================== 교환제품 추가 영역  ========================================================================*/
7606    let orderListTitleArr = {};
7607
7608    $(".orderList").each(function (index) {
7609      let title = $(this).find("strong.name").text().trim();
7610      orderListTitleArr[index] = title;
7611    });
7612
7613    function getIndexByText(text) {
7614      return Object.entries(orderListTitleArr).find(([key, value]) => value === text)?.[0] || -1;
7615    }
7616
7617    if ($(".page_exchange").length > 0) {
7618      const observer = new MutationObserver((mutations) => {
7619        mutations.forEach((mutation) => {
7620          const target = document.querySelector("#selected_product");
7621          if (target) {
7622            console.log("#selected_product가 추가됨!");
7623            observer.observe(target, { childList: true, subtree: false });
7624            $(target)
7625              .find("tr")
7626              .each(function () {
7627                let name = $(this).find("strong.name").text();
7628                let index = getIndexByText(name);
7629                let qyyInput = $(".orderList").eq(index).find(".ec-base-qty input");
7630                let qty = 0;
7631                if (qyyInput.length) {
7632                  qty = $(".orderList").eq(index).find(".ec-base-qty input").val();
7633                } else {
7634                  qty = $(".orderList").eq(index).find(".ec-base-qty").text().replace("개", "");
7635                }
7636                if (!$(this).find(".read-qty").length) {
7637                  // $(this).find(".ec-base-qty").prepend(`<p class="read-qty">${qty}개</p>`);
7638                  // [옵션: M (225~240)/[EMTSC-08BLK] 블랙]
7639                  $(this).find(".ec-base-qty input").val(qty);
7640
7641                  var selPrdCount = $("#selected_product tr").length;
7642                  if (selPrdCount > 0) {
7643                    var reasonChk = $(".exReason .ec-base-label input:checked").attr("id");
7644                    // 선택한 갯수가 같을때 displaynone 추가 위의 상품 갯수랑,
7645                    console.log("reasonChk", reasonChk);
7646                    if (reasonChk == "reason_radio0" || reasonChk == "reason_radio1" || reasonChk == "reason_radio2") {
7647                      $(".addPrdBtn table").addClass("displaynone");
7648                    } else {
7649                      $(".addPrdBtn table").removeClass("displaynone");
7650                    }
7651                  }
7652                }
7653              });
7654          } else {
7655            console.log("#selected_product가 삭제됨!");
7656          }
7657        });
7658      });
7659
7660      // `body`를 감시해서 #selected_product의 생성/삭제 감지
7661      observer.observe(document.body, { childList: true, subtree: false });
7662
7663      //   window.onload = function () {
7664      //     var mutationObserver = new MutationObserver(function (mutations) {
7665      //       mutations.forEach(function (mutation) {
7666      //         var selPrdCount = $("#selected_product tr").length;
7667      //         console.log("selPrdCount", selPrdCount, $(".orderList").length);
7668      //         if (selPrdCount > 0) {
7669      //           var reasonChk = $(".exReason .ec-base-label input:checked").attr("id");
7670      //           // 선택한 갯수가 같을때 displaynone 추가 위의 상품 갯수랑,
7671      //           console.log("reasonChk", reasonChk);
7672      //           if (reasonChk == "reason_radio0" || reasonChk == "reason_radio1" || reasonChk == "reason_radio2") {
7673      //             if (selPrdCount == $(".orderList").length) {
7674      //               $(".addPrdBtn table").addClass("displaynone");
7675      //             } else {
7676      //               $(".addPrdBtn table").removeClass("displaynone");
7677      //             }
7678      //           }
7679      //         }
7680      //       });
7681      //     });
7682      //     var element = document.getElementById("sPrdList");
7683      //     var option = {
7684      //       attributes: true,
7685      //       characterData: true,
7686      //       childList: true,
7687      //       subtree: true,
7688      //       attributeOldValue: true,
7689      //       characterDataOldValue: true,
7690      //     };
7691      //     mutationObserver.observe(element, option);
7692      //   };
7693    }
7694
7695    /*======================================================================== 교환제품 추가 영역  ========================================================================*/
7696
7697    /*======================================================================== 교환사유 영역 ========================================================================*/
7698
7699    //교환사유 라디오버튼 위치변경
7700    function exchangeRadio() {
7701      $(".exReason").find(".ec-base-label").eq(0).appendTo($(".exReason").find(".reasonList"));
7702      $(".exReason").find(".ec-base-label").eq(0).appendTo($(".exReason").find(".reasonList"));
7703      $(".exReason").find(".ec-base-label").eq(1).appendTo($(".exReason").find(".reasonList"));
7704      $("#reason_radio3").closest(".ec-base-label").addClass("displaynone");
7705
7706      $("#reason_radio0").parent().append('<span class="colorNotice">배송비 구매자 부담</span>');
7707      $(".page_exchange #reason_radio1").parent().append('<span class="colorNotice">
77071회 무료 교환 (의류 한정)</span>'); //교환페이지에서만 노출
7708
7709      //교환사유-> 고객변심-> placeholder 내용
7710      $("#reason_detail").attr("placeholder", "상세 사유를 작성해주세요.(100자 이내)");
7711    }
7712    exchangeRadio();
7713
7714    // 교환 -> 교환사유 -> 고객변심 체크시
7715    //input/label 범위 벗어나는 $(".exReason .ec-base-label") 클릭 시 입력항목들은 열리는데 체크가 되지 않는 이슈 수정
7716    $(".exReason .ec-base-label").each(function () {
7717      $(this).append('<div class="for-exReason-click"></div>');
7718    });
7719
7720    $(".exReason .ec-base-label").click(function () {
7721      var changeMind = $(this).find("#reason_radio0").attr("checked");
7722      var prdChk = $("input[id^='apply_product']:checked").length;
7723      var findInput = $(this).find("label").attr("for");
7724
7725      if ($("#selected_product .xans-myshop-selectedproduct").hasClass("ex")) {
7726        if (findInput == "reason_radio2" || "reason_radio0") {
7727          alert("신청 사유를 변경하신 경우 아래 교환 받으실 제품을 삭제하신 후 다시 선택해 주세요.");
7728          return false;
7729        }
7730      } else {
7731        //상품불량 선택
7732        if ($(this).index() == 0) {
7733          if ($(".detailReasonOpen.complete").length == 0) {
7734            $("#reason_detail").val(""); //상세사유 textarea 비움
7735          } else {
7736            $("#reason_detail").val("상세사유 입력 완료"); //상세사유 이미 입력됨
7737          }
7738          if (prdChk == 0) {
7739            alert("신청할 제품을 선택하세요.");
7740            $("html, body").animate({ scrollTop: 0 }, 0);
7741            return false;
7742          } else {
7743            EC$(this).find("input").trigger("click");
7744            $(".detailReason").html("상세사유");
7745            $(".defaultTab").addClass("displaynone");
7746            $(".sizeTab").addClass("displaynone");
7747            $(".badTab").removeClass("displaynone");
7748            $(".detaliReasonWrite").addClass("displaynone layout-hidden");
7749
7750            //**************반품**************//
7751            $(".goExcahngeBtn").removeClass("displaynone layout-hidden");
7752            $(".detaliReasonPopBtn").removeClass("displaynone layout-hidden");
7753            $(".goExchange").addClass("displaynone layout-hidden");
7754          }
7755
7756          //교환받을 상품 추가한 경우 -> 추가 버튼 없애기
7757          var test = $("#selected_product .xans-myshop-selectedproduct").length;
7758
7759          if (test > 0) {
7760            $(".addPrdBtn table").addClass("displaynone");
7761          }
7762        }
7763        //고객변심 선택
7764        else if ($(this).index() == 1) {
7765          if (prdChk == 0) {
7766            alert("신청할 제품을 선택하세요.");
7767            $("html, body").animate({ scrollTop: 0 }, 0);
7768            return false;
7769          } else {
7770            EC$(this).find("input").trigger("click");
7771            $(".detailReason").html("상세사유");
7772            $("#reason_detail").val("");
7773            $(".defaultTab").removeClass("displaynone");
7774            $(".sizeTab").addClass("displaynone");
7775            $(".badTab").addClass("displaynone");
7776            $(".detaliReasonWrite").removeClass("displaynone layout-hidden");
7777
7778            //**************반품**************//
7779            $(".goExcahngeBtn").addClass("displaynone layout-hidden");
7780            $(".detaliReasonPopBtn").addClass("displaynone layout-hidden");
7781            $(".goExchange").addClass("displaynone layout-hidden");
7782          }
7783
7784          //교환받을 상품 추가한 경우 -> 추가 버튼
7785          var test = $("#selected_product .xans-myshop-selectedproduct").length;
7786          if (test > 0) {
7787            $(".addPrdBtn table").removeClass("displaynone");
7788          }
7789        }
7790        //사이즈 교환 선택
7791        else if ($(this).index() == 2) {
7792          if (prdChk == 0) {
7793            alert("신청할 제품을 선택하세요.");
7794            $("html, body").animate({ scrollTop: 0 }, 0);
7795            return false;
7796          } else {
7797            EC$(this).find("input").trigger("click");
7798            $(".detailReason").html("");
7799            $("#reason_detail").val("사이즈 교환");
7800            $(".defaultTab").addClass("displaynone");
7801            $(".sizeTab").removeClass("displaynone");
7802            $(".badTab").addClass("displaynone");
7803            $(".detaliReasonWrite").addClass("displaynone layout-hidden");
7804
7805            //**************반품**************//
7806            $(".goExcahngeBtn").addClass("displaynone layout-hidden");
7807            $(".detaliReasonPopBtn").addClass("displaynone layout-hidden");
7808            $(".goExchange").removeClass("displaynone layout-hidden");
7809          }
7810
7811          //교환받을 상품 추가한 경우 -> 추가 버튼 없애기
7812          var test = $("#selected_product .xans-myshop-selectedproduct").length;
7813          if (test > 0) {
7814            $(".addPrdBtn table").addClass("displaynone");
7815          }
7816        }
7817      }
7818      optionCompleteChkFunc();
7819    });
7820
7821    /*======================================================================== 교환사유 영역 ========================================================================*/
7822
7823    /*======================================================================== 교환사유-> 상세사유작성 팝업 클릭 영역 ========================================================================*/
7824
7825    var thisChk; // 전역변수 : 체크안된 상품의 인덱스번호
7826
7827    // 상세사유작성 클릭시 팝업
7828    $(".detaliReasonPopBtn .detaliReasonPopOpen").bind("click", function () {
7829      var prdChk = $("input[id^='apply_product']:checked").length; // 체크한 상품 개수
7830      var prdIndex = $("input[id^='apply_product']:checked").parents("tr").index();
7831      if (prdChk == 0) {
7832        alert("신청할 제품을 선택하세요.");
7833        $("html, body").animate({ scrollTop: 0 }, 0);
7834        return;
7835      } else {
7836        // 팝업 오픈
7837        $(".detailReasonPop").show();
7838        // 체크에 따른 팝업 안의 상품 보여주기
7839
7840        $("input[id^='apply_product']").each(function () {
7841          var chkIndex = $(this).parents("tr").index();
7842          if ($(this).is(":checked")) {
7843            $(".productContent").eq(chkIndex).removeClass("displaynone");
7844          } else {
7845            $(".productContent").eq(chkIndex).addClass("displaynone");
7846          }
7847        });
7848        //optionCompleteChkFunc(); // 필수옵션 모두 입력했는지 체크
7849
7850        // 상품개수 숫자 넣기
7851        prdNumber();
7852
7853        // 메인화면 스크롤 감추기
7854        $("body").css("overflow", "hidden");
7855        $("html").css({ opacity: "1", overflow: "hidden" });
7856      }
7857
7858      EC$(document).on("click", ".img-close-btn", function () {
7859        if ($(".productContent").length > 0) {
7860          $(this).closest("li").remove();
7861          var myIndex = $(this).closest(".myimg_lg").attr("data-num");
7862          $("#add_images" + myIndex).remove();
7863        }
7864      });
7865
7866      return false;
7867    });
7868
7869    EC$("input[id^='apply_product']").on("change", function () {
7870      $("input[id^='apply_product']").each(function () {
7871        var chkIndex = $(this).closest(".orderList").index();
7872        if ($(this).is(":checked")) {
7873          $(".detailReasonPop .productContent").eq(chkIndex).removeClass("displaynone");
7874        } else {
7875          $(".detailReasonPop .productContent").eq(chkIndex).addClass("displaynone");
7876        }
7877      });
7878      if (optionCompleteChkFunc() == true) {
7879        $(".reasonList .ec-base-label .detailReasonOpen").addClass("complete");
7880        $(".detaliReasonPopBtn a span").text("상세사유 다시 작성");
7881      } else {
7882        if ($("#reason_radio0").attr("checked") == false) {
7883          // 2021.11.18 조건 추가
7884          $("#reason_detail").val("");
7885        }
7886        $(".detaliReasonPopBtn a span").text("상세사유작성");
7887      }
7888    });
7889
7890    // 버튼클릭시 = 필수입력사항 체크되어 있을때만 닫히게
7891    // 필수사항 체크 안했을시 해당 내용으로 스크롤이동 및 alert
7892    EC$("#compReaseon button").on("click", function () {
7893      // 한번만 실행
7894      var option_chk = false;
7895
7896      // position값 구하기 위해 display:none 요소 제외
7897      $(".productContent:not(.displaynone)").each(function () {
7898        var option_length = $(this).find(".reasonList > ul > li").length; // 옵션 개수
7899        var complete_length = $(this).find(".reasonList > ul > li.option-complete").length; // 옵션 체크한 개수
7900
7901        // 옵션 체크 안된 애들만 구하기
7902        if (complete_length != option_length) {
7903          var no_chk = $(this).find(".reasonList > ul > li:not(.option-complete)").index(); // 체크안된 li Index
7904          var chk_scroll = $(this).find(".reasonList > ul > li:not(.option-complete)").position().top; // 체크안된 li position 값
7905        }
7906
7907        if (!option_chk) {
7908          if (no_chk >= 0) {
7909            if (no_chk + 1 == 1) {
7910              alert("1번 불량 종류를 선택해 주세요.");
7911            } else if (no_chk + 1 == 2) {
7912              alert("2번 제품의 상태를 선택해 주세요.");
7913            } else if (no_chk + 1 == 3) {
7914              alert("3번 참고사항을 입력해 주세요.");
7915            } else if (no_chk + 1 == 4) {
7916              alert(
7917                "4번 사진을 첨부해 주세요.\n택이 제거되지 않은 제품의 경우에도\n빠른 확인을 위해 사진을 첨부해 주세요."
7918              );
7919            }
7920
7921            setTimeout(function () {
7922              // 전체 스크롤 영역 = 652는 팝업 헤더를 제외한 높이값
7923              var scroll_height = $(".detailReasonPop").find("#mCSB_1_container").height() - 652;
7924
7925              // 스크롤바 영역
7926              var scrbar_height = $(".mCSB_draggerContainer").height(); //스크롤바 전체 높이
7927              var scr_height = $("#mCSB_1_dragger_vertical").height(); // 스크롤바 높이
7928
7929              // 옵션 position().top 값이 전체값보다 클때
7930              if (chk_scroll > scroll_height) {
7931                $(".detailReasonPop").find("#mCSB_1_container").css("top", -scroll_height); // 최하단으로 이동
7932                $(".detailReasonPop")
7933                  .find("#mCSB_1_dragger_vertical")
7934                  .css("top", scrbar_height - scr_height); // 스크롤바 최하단으로 이동
7935              } else {
7936                $(".detailReasonPop").find("#mCSB_1_container").css("top", -chk_scroll); // 체크안한 옵션 position값
7937                $(".detailReasonPop")
7938                  .find("#mCSB_1_dragger_vertical")
7939                  .css("top", chk_scroll / 5); // 대략적인 옵션 position값 만큼 이동
7940              }
7941            }, 200);
7942
7943            option_chk = true;
7944          }
7945        }
7946      });
7947
7948      if (optionCompleteChkFunc() == true) {
7949        $(".detailReasonPop").hide();
7950        $("body").css("overflow", "auto");
7951        $("html").css({ opacity: "1", overflow: "auto" });
7952        $("#reason_detail").val("상세사유 작성 완료"); //나중에 체크해보세요 211116
7953        $(".reasonList .ec-base-label .detailReasonOpen").addClass("complete");
7954        $(".detaliReasonPopBtn a span").text("상세사유 다시 작성");
7955      } else {
7956        var notCompleteOptionFirst = $(
7957          '.productContent:not(.displaynone) li[data-type="required"]:not(.option-complete)'
7958        ).first();
7959        var scrollTop = notCompleteOptionFirst.position().top;
7960        //alert('필수 항목을 선택해주세요.');
7961        $("#reason_detail").val("");
7962        $(".detailReasonPop").animate({ scrollTop: scrollTop }, 0); // 보류
7963        $(".detaliReasonPopBtn a span").text("상세사유작성");
7964      }
7965    });
7966
7967    // 고객변심 클릭시 -> 상품불량/배송오류 상세작성내용 작성했다면 고객변심 내용 비우기
7968    EC$(document).on("click", "#reason_radio0", function () {
7969      if (optionCompleteChkFunc() == true) {
7970        $("#reason_detail").val("");
7971      }
7972    });
7973
7974    // 1,2번 옵션 선택시 option-complete 부여
7975    EC$(".reasonChk").on("change", function () {
7976      var $this = $(this);
7977      var $thisParents = $this.closest(".productContent");
7978      var $thisParent = $this.closest("li[data-type]");
7979      if ($thisParent.find("input[type='checkbox']:checked").length > 0) {
7980        $thisParent.addClass("option-complete");
7981      } else {
7982        $thisParent.removeClass("option-complete");
7983      }
7984      optionCompleteChkFunc(); //필수옵션 모두 입력했는지 체크
7985    });
7986
7987    $(".productContent").each(function () {
7988      var $this = $(this);
7989
7990      // 3번 옵션 내용 확인
7991      $(this)
7992        .find("textarea[name='reason_etc']")
7993        .blur(function () {
7994          var my_text = $(this).val();
7995
7996          if (my_text != "") {
7997            $(this).closest("li").addClass("option-complete");
7998          } else {
7999            $(this).closest("li").removeClass("option-complete");
8000          }
8001
8002          optionCompleteChkFunc(); //필수옵션 모두 입력했는지 체크
8003        });
8004
8005      // 4번 옵션 내용 확인
8006      const targetNode = $this.find("#test_image").get(0); // 이미지 영역
8007      const observer = new MutationObserver(detectChange);
8008      function detectChange(mutationsList, observer) {
8009        if (mutationsList) {
8010          var image_length = $this.find("#test_image li").length;
8011
8012          if (image_length > 0) {
8013            $this.find(".reasonList > ul > li:last-child").addClass("option-complete");
8014          } else {
8015            $this.find(".reasonList > ul > li:last-child").removeClass("option-complete");
8016          }
8017          optionCompleteChkFunc(); //필수옵션 모두 입력했는지 체크
8018        }
8019      }
8020      var config = {
8021        attributes: true,
8022        childList: true,
8023      };
8024      observer.observe(targetNode, config);
8025    });
8026
8027    //이미지 첨부 반복문으로 label, input 이름 설정해놓기
8028    function loopImageName() {
8029      var imgLength = $(".productContent").length;
8030      for (var i = 0; i < imgLength; i++) {
8031        $(".add-image-box2")
8032          .eq(i)
8033          .find("label")
8034          .attr("for", "image" + i);
8035        $(".add-image-box2")
8036          .eq(i)
8037          .find("input")
8038          .attr("id", "image" + i);
8039      }
8040    }
8041    loopImageName();
8042
8043    // 상세사유작성 -> 팝업 -> 이미지 첨부
8044    function setThumbnail(event, imgId, thisNext) {
8045      // 이미지 여러장 올리기
8046      //for( var image of event.target.files) 수정전
8047      //for (var image; image < $target; image++) 수정후
8048
8049      //for( var image of event.target.files)  {
8050      $.each(event.target.files, function (idx, image) {
8051        var reader = new FileReader();
8052        // 이미지 개수 구하기
8053        var imgs = document.getElementById(imgId);
8054        var imageLength = imgs.parentNode.getElementsByTagName("li").length;
8055        if (imageLength < 3) {
8056          reader.onload = function (event) {
8057            var img = document.createElement("img");
8058            img.setAttribute("src", event.target.result);
8059            for (var i = 0; i < 3; i++) {
8060              //이미지 용량 /************************************************* 임시 *******************************************************/
8061              var maxSize = 10 * 1024 * 1024; // 10MB
8062              /************************************************* 임시 *******************************************************/
8063              // 업로드하는 input
8064              if (typeof document.getElementById(imgId).files[i] != "undefined") {
8065                var fileSize = document.getElementById(imgId).files[i].size;
8066                //var fileVal = $(imgId).val();
8067                var fileVal = document.getElementById(imgId).value;
8068                fileVal = fileVal.slice(fileVal.indexOf(".") + 1).toLowerCase();
8069                // 파일 용량 체크
8070                if (fileSize > maxSize) {
8071                  alert("첨부파일 사이즈는 10MB 이내로 등록 가능합니다.");
8072                  $(imgId).val("");
8073                  return;
8074                }
8075                // 파일 확장자 체크
8076                else if (
8077                  fileVal != "jpg" &&
8078                  fileVal != "jpeg" &&
8079                  fileVal != "gif" &&
8080                  fileVal != "png" &&
8081                  fileVal != "bmp" &&
8082                  fileVal != "HEIC"
8083                ) {
8084                  alert("jpg,jpeg,gif,png,bmp,HEIC 형식의 이미지만 첨부 가능합니다.");
8085                  $(imgId).val("");
8086                  return;
8087                } else {
8088                  var myid = document.getElementById(imgId);
8089                  thisNext.append(img);
8090                }
8091              }
8092            }
8093          };
8094        } else {
8095          alert("이미지는 최대 3장까지 업로드 가능합니다.");
8096          $(imgId).val("");
8097          return;
8098        }
8099        reader.readAsDataURL(image);
8100        // }
8101      });
8102    }
8103    //이미지 감싸놓기 // 나중 CSS 수정 위해서.
8104    var _num = 0;
8105    function wrapImage() {
8106      var imageLength = $(".add-image-box2 > ul img").length;
8107      if (imageLength >= 0) {
8108        // image에 <li></li> 씌우기
8109        $(".add-image-box2 ul")
8110          .children("img")
8111          .wrapAll('<li class="myimg_lg" data-num=' + _num + '><div class="preview"></div></li>');
8112        // 각 priview에 close 버튼 넣기
8113        $(".add-image-box2 ul > li .preview").each(function () {
8114          if ($(this).find(".img-close-btn").length == 0) {
8115            $(this).append(
8116              '<div class="common-btn img-close-btn"><img src="/web/andar/img/myshop/img-close.png" alt="close-btn"/></div>'
8117            );
8118          } else {
8119            return;
8120          }
8121        });
8122      } else {
8123        setTimeout(imageLength, 100);
8124      }
8125    }
8126
8127    EC$(".iv_add_images").on("click", function () {
8128      _num++;
8129      $(".addImages").each(function () {
8130        if ($(this).val() == "") {
8131          $(this).remove();
8132        }
8133      });
8134
8135      var thisNext = $(this).next();
8136      if (thisNext.find("li").length == 3) {
8137        alert("이미지는 최대 3장까지 업로드 가능합니다.");
8138        return;
8139      } else {
8140        var added = EC$("<input type='file' class='addImages' name = 'files' id=add_images" + _num + " />");
8141        EC$("#iv_apply_form").append(added);
8142
8143        added.on("change", function (imgId) {
8144          imgId = $(this).attr("id");
8145          setThumbnail(event, imgId, thisNext);
8146          setTimeout(wrapImage, 100);
8147        });
8148        added.click();
8149      }
8150    });
8151
8152    EC$(".img-close-btn").on("click", function () {
8153      if ($(".productContent").length > 0) {
8154        $(this).closest("li").remove();
8155        var myIndex = $(this).closest(".myimg_lg").attr("data-num");
8156        $("#add_images" + myIndex).remove();
8157      }
8158    });
8159
8160    /* 2021.10.12 */
8161    // 상세사유작성 팝업 checkbox id, label 값 넣기
8162    var rListlength = $(".rListSelect li").length;
8163    for (var i = 0; i < rListlength; i++) {
8164      $(".rListSelect li")
8165        .eq(i)
8166        .find("input")
8167        .attr("id", "reasonChk" + i);
8168      $(".rListSelect li")
8169        .eq(i)
8170        .find("label")
8171        .attr("for", "reasonChk" + i);
8172    }
8173
8174    /*======================================================================== 교환사유-> 상세사유작성 팝업 클릭 영역 ========================================================================*/
8175
8176    /*======================================================================== 수거신청 영역 ========================================================================*/
8177
8178    /* 수거신청 */
8179
8180    function collectionAppli() {
8181      var coll_Form = $(".collectionForm").length;
8182      if (coll_Form > 0) {
8183        // 수거신청 -> 수거해주세요
8184        $(".collectionForm").find("label[for='ispickup0']").text("수거해주세요");
8185        $(".collectionForm").find("label[for='ispickup0']").wrap("<div class='labelCover'></div>");
8186
8187        // 직접발송 -> 직접 발송할게요
8188        $(".collectionForm").find("label[for='ispickup1']").text("직접 발송할게요");
8189        $(".collectionForm").find("label[for='ispickup1']").wrap("<div class='labelCover'></div>");
8190
8191        //수거지선택
8192        $(".collectionForm").find("label[for='sameaddr0']").wrap("<div class='labelCover'></div>");
8193        $(".collectionForm").find("label[for='sameaddr1']").wrap("<div class='labelCover'></div>");
8194
8195        //수거지선택 -> 수거지 변경
8196        $(".collectionForm").find("#pickup_name").attr("placeholder", "이름");
8197        $(".collectionForm").find("#pickup_addr1").attr("placeholder", "기본주소");
8198        $(".collectionForm").find("#pickup_addr2").attr("placeholder", "나머지주소");
8199
8200        //직접 발송할게요 input
8201        $(".collectionForm").find("#pickup_csname").attr("placeholder", "택배사");
8202        $(".collectionForm").find("#pickup_invoiceno").attr("placeholder", "송장번호");
8203        $(".collectionForm").find(".directSend label").text("송장번호 없이 반품신청");
8204
8205        // "송장번호 없이 반품신청" 내용 숨기기
8206        $("#pickup_check0").addClass("displaynone");
8207        $("label[for='pickup_check0']").addClass("displaynone");
8208      }
8209    }
8210    collectionAppli();
8211
8212    $("#ispickup0").click(function () {
8213      $(".colAdress").removeClass("displaynone");
8214    });
8215
8216    $("#ispickup1").click(function () {
8217      $(".colAdress").addClass("displaynone");
8218    });
8219
8220    //id누락으로 '우편번호찾기' 기능이 정상 동작하지 않아 id 동적 부여
8221    $("#exchange_Return .collectionForm .selectPick a.searchAddr").attr("id", "btn_search_rzipcode");
8222
8223    /* 수거지 정보 가져오기 및 수거지변경 선택시 input 안에 값 넣기 */
8224    var thisData;
8225    function InputaddInfo() {
8226      if ($("#memberLogOn").length > 0) {
8227        var sameaddr = $("#sameaddr1").attr("checked");
8228
8229        // 수거지변경시 기본정보 "1" 번만 가져오기 (Class 체크 이후 클래스 부여)
8230        if (sameaddr == true && $("#sameaddr1").hasClass("info") == false) {
8231          // 각 배송지정보와 같은 값 추출
8232          var pickName = $("#sameaddr").find(".pickName").text();
8233          var pickZipCode = $("#sameaddr").find(".pickZipCode").text();
8234          var pickAddr = $("#sameaddr").find(".pickAddr").text();
8235          var pickAddr2 = $("#sameaddr").find(".pickAddr2").text();
8236          var pickPhone = $("#sameaddr").find(".pickPhone").text();
8237          var pickPhone2 = $("#sameaddr").find(".pickPhone2").text();
8238          var replacePhone = pickPhone2.replace(/-/g, "");
8239          var replacePhone_a = replacePhone.slice(0, 3);
8240          var replacePhone_b = replacePhone.slice(3, 7);
8241          var replacePhone_c = replacePhone.slice(7, 12);
8242
8243          // 각 배송지정보와 같은 값 추출
8244          setTimeout(function () {
8245            // 추출한 값 value, data-text로 저장
8246            $("#pickup_name").val(pickName).attr("data-text", pickName);
8247            $("#pickup_phone3").val(replacePhone).attr("data-text", replacePhone);
8248            $("#pickup_zipcode1").val(pickZipCode).attr("data-text", pickZipCode);
8249            $("#pickup_addr1").val(pickAddr).attr("data-text", pickAddr);
8250            $("#pickup_addr2").val(pickAddr2).attr("data-text", pickAddr2);
8251
8252            $("#pickup_phone2_1").val(replacePhone_a);
8253            $("#pickup_phone2_2").val(replacePhone_b);
8254            $("#pickup_phone2_3").val(replacePhone_c);
8255
8256            // 클래스를 부여하여 if문 끝내기.
8257            $("#sameaddr1").addClass("info");
8258          }, 100);
8259        }
8260        // 한번 가져온 이후에는 data-text의 값을 계속 호출
8261        else {
8262          $(".selectPick")
8263            .find("input")
8264            .each(function () {
8265              var thisData = $(this).attr("data-text");
8266              $(this).val(thisData);
8267            });
8268        }
8269      }
8270    }
8271    $("#sameaddr1").live("click", InputaddInfo);
8272    EC$("#sameaddr1").on("change", function () {
8273      setTimeout(function () {
8274        $("#pickup_phone3").trigger("blur");
8275      }, 200);
8276    });
8277
8278    // 일반전화 없을시 삭제
8279    function pickPhone01() {
8280      var pickNum01 = $(".pickPhone").text();
8281      if (pickNum01.indexOf("--") == 0) {
8282        $(".pickPhone").addClass("layout-hidden");
8283      }
8284    }
8285    pickPhone01();
8286
8287    // 임시 input on / off 구분
8288    $("input[name='sameaddr']").click(function () {
8289      var i = $(this).val();
8290      if (i == "T") {
8291        $(".customFormPhone").addClass("displaynone");
8292      } else if (i == "F") {
8293        $(".customFormPhone").removeClass("displaynone");
8294        $("#pickupPhone2").addClass("layout-hidden");
8295      }
8296    });
8297
8298    // selectPick 안의 인풋의 keyup시 해당 값 저장
8299    $(".selectPick")
8300      .find("input")
8301      .keyup(function () {
8302        // 각 input의 값을 data-text로 저장
8303        var thisText = $(this).val();
8304        $(this).attr("data-text", thisText);
8305      });
8306    //우편번호찾기 팝업으로 동작시에 data-text 값이 들어가지 않는 이슈 수정
8307    EC$("#pickup_addr2").on("focusin", function () {
8308      $(".selectPick input").each(function () {
8309        var $this = $(this);
8310        // 각 input의 값을 data-text로 저장
8311        var thisText = $this.val();
8312        $this.attr("data-text", thisText);
8313      });
8314    });
8315
8316    function phoneNum() {
8317      var coll_Form = $(".collectionForm").length;
8318      if (coll_Form > 0) {
8319        var myphone = $(".pickPhone2").text();
8320        var remyphone = myphone.replace(/[^0-9]/g, "");
8321        $("#pickup_phone3").attr("data-text", remyphone);
8322        var phone_attr = $("#pickup_phone3").attr("data-text");
8323        var phone_front = phone_attr.slice(0, 3);
8324        var phone_mid = phone_attr.slice(3, 7);
8325        var phone_back = phone_attr.slice(7, 12);
8326
8327        $("#pickup_phone3").attr("placeholder", "핸드폰번호 ‘-’ 없이 입력");
8328
8329        $("#pickup_phone2_1").val(phone_front);
8330        $("#pickup_phone2_2").val(phone_mid);
8331        $("#pickup_phone2_3").val(phone_back);
8332      }
8333    }
8334    phoneNum();
8335
8336    // 숨겨놓은 휴대폰 인풋창에 각각 내용 넣기
8337    var pickPhone3 = $("#pickup_phone3");
8338    pickPhone3.attr("maxLength", "11");
8338 //최대입력가능숫자지정 211117
8339    number_control(pickPhone3);
8340    add_hyphen_phone(pickPhone3);
8341
8342    $("#pickup_phone3").blur(function () {
8343      var thisAttr = $(this).val();
8344      if (thisAttr != "") {
8345        thisAttr = onlyNumbFunc(thisAttr);
8346        $(this).attr("data-text", thisAttr);
8347        var attrSlice = thisAttr.slice(0, 3);
8348        var result_b = thisAttr.slice(3, 7);
8349        var result_c = thisAttr.slice(7, 12);
8350        $("#pickup_phone2_2").val(result_b);
8351        $("#pickup_phone2_3").val(result_c);
8352        // 휴대폰번호 앞자리 체크후 맞을시 selectbox 의 value값 수정
8353        if (
8354          attrSlice == "010" ||
8355          attrSlice == "011" ||
8356          attrSlice == "016" ||
8357          attrSlice == "017" ||
8358          attrSlice == "018" ||
8359          attrSlice == "019"
8360        ) {
8361          EC$("#pickup_phone2_1").val(attrSlice);
8362        } else {
8363        }
8364      }
8365    });
8366
8367    // 송장번호 입력시 숫자만 입력
8368    $("#pickup_invoiceno").keyup(function () {
8369      var text = $(this).val();
8370      var result = text.replace(/[^0-9 | ^-]/g, "");
8371      $(this).val(result);
8372    });
8373
8374    /*======================================================================== 수거신청 영역 ========================================================================*/
8375
8376    /*======================================================================== 환불사유 영역 ========================================================================*/
8377
8378    var infoText = $(".refundBanks").text();
8379    var infoBank = infoText.split("/")[0];
8380    var infoName = infoText.split("/")[1];
8381
8382    $(".infoBank").text(infoBank);
8383    $(".infoName").text(infoName);
8384
8385    EC$(document).on("change", "#acc_depositor, #acc_bank_name", function () {
8386      var infoName = $("#acc_depositor").val();
8387      var infoBank = $("#acc_bank_name").val();
8388      var infoNo = $("#acc_no").val();
8389
8390      $(".infoBank").text(infoBank + ":" + infoNo);
8391      $(".infoName").text("예금주 :" + infoName);
8392    });
8393
8394    $(".collectionForm")
8395      .find("#pickup_check0")
8396      .click(function () {
8397        var myChk = $(this).attr("checked");
8398        if (myChk == true) {
8399          $(this)
8400            .parents(".directSend")
8401            .find("input[type='text']")
8402            .each(function () {
8403              $(this).attr("disabled", "disabled");
8404            });
8405        } else {
8406          $(this)
8407            .parents(".directSend")
8408            .find("input[type='text']")
8409            .each(function () {
8410              $(this).attr("disabled", "");
8411            });
8412        }
8413      });
8414
8415    /*======================================================================== 환불사유 영역 ========================================================================*/
8416
8417    /*======================================================================== 교환상품 상품 옵션 클릭시 ========================================================================*/
8418
8419    // 닫기2 (딤 클릭시)
8420    $(".closeReasonPop, .exdimm").bind("click", function () {
8421      $(".detailReasonPop").hide();
8422      $("body").css("overflow", "auto");
8423      $("html").css({ opacity: "1", overflow: "auto" });
8424    });
8425
8426    // 옵션 클릭시 스크롤바 막기
8427    var option_index;
8428    EC$(document).on("click", ".optionBtn01, .optionBtn02", function () {
8429      option_index = $(this).index();
8430      $("body").css("overflow", "hidden");
8431      $("html").css({ opacity: "1", overflow: "hidden" });
8432    });
8433
8434    // 닫기버튼 클릭시
8435    EC$(document).on("click", ".optionDimm, .close", function () {
8436      $("#exchange_Return .optionModify").hide();
8437      $("body").css("overflow", "auto");
8438      $("html").css({ opacity: "1", overflow: "auto" });
8439    });
8440
8441    // 옵션 변경 -> 변경 클릭시
8442    // let optionSize = "";
8443    // let optionColorCode = "";
8444    // let colorChangePopup = $(".color-change-popup");
8445    // colorChangePopup.find(".close-btn").click(function () {
8446    //   colorChangePopup.removeClass("is-active");
8447    // });
8448    // $(".optionModifyBtn").live("click", function () {
8449    // let parentContainer = $(this).parent();
8450    // let visibleBtns = parentContainer.find(".optionModifyBtn").not(".displaynone");
8451    // 현재 클릭한 버튼이 visibleBtns에서 몇 번째인지 확인
8452    // let index = visibleBtns.index($(this));
8453    // let originLi = $(this).closest(".infoContent").find(".optionList").children("li").eq(index);
8454    // let originOption = originLi.find(".optionStr");
8455    // let originOptionText = originOption.text();
8456    // 정규식 수정 (정확한 그룹 추출)
8457    // const match = originOptionText.match(/\[\s*([A-Za-z0-9-]+)\] (\S+)\s*\/\s*(.+?)\s*\]/);
8458    // const match = originOptionText.split("/");
8459    // console.log("match", match[0]);
8460    // console.log("match", match[1]);
8461    // console.log("match", match[2]);
8462    // optionSize = match[0];
8463    // optionColorCode = match[1];
8464    // if (match) {
8465    //   // optionColorCode = `[${match[1]}] ${match[2]}`.trim(); // "[ENTSC-11BEG] 베이지"
8466    //   // optionSize = match[3].trim(); // "F (Free)"
8467    //   console.log(`옵션 컬러는 "${optionColorCode}"`);
8468    //   console.log(`옵션 사이즈는 "${optionSize}"`);
8469    // } else {
8470    //   console.error("옵션명을 파싱할 수 없습니다.");
8471    // }
8472    // });
8473
8474    $(".optionChangeBtn").live("click", function () {
8475      $(".optionBtn01").addClass("modify"); //옵션 변경 시 클래스 추가
8476      $(".optionBtn02").addClass("modify"); //옵션 변경 시 클래스 추가
8477
8478      var option_val = new Array();
8479
8480      var this_prd_no = $(this).parents(".product.left").find(".thumbnail").find("a").attr("href");
8481      this_prd_no = getCateParam("product_no", this_prd_no); // 현재 옵션의 product_no
8482      // var myIndex = $(this).parents(".productList").index();
8483      // var myLength = $(this).parents(".productList").length;
8484
8485      // let count = 0;
8486      // let isSameSize = false;
8487      // let isSameColor = false;
8488      // EC$(this)
8489      //   .parents(".optionCover")
8490      //   .find(".content ul li select")
8491      //   .each(function (index) {
8492      //     var thisVal = $(this).val();
8493
8494      //     if (thisVal == "*") {
8495      //       $("body").css("overflow", "hidden");
8496      //       $("html").css({opacity: "1", overflow: "hidden"});
8497      //     } else {
8498      //       count++;
8499      //       $("body").css("overflow", "auto");
8500      //       $("html").css({opacity: "1", overflow: "auto"});
8501      //     }
8502
8503      //     // let optionTitle = $(this).attr("option_title");
8504      //     // let reasonVal = $(".reasonList .ec-base-label input:checked").val();
8505
8506      //     // if (reasonVal == "P" || reasonVal == "O") {
8507      //     //   if (optionTitle.includes("사이즈")) {
8508      //     //     if (optionSize.includes(thisVal)) {
8509      //     //       isSameSize = true;
8510      //     //     }
8511      //     //   }
8512      //     //   if (optionTitle.includes("색상")) {
8513      //     //     if (optionColorCode.includes(thisVal)) {
8514      //     //       isSameColor = true;
8515      //     //     }
8516      //     //   }
8517      //     // }
8518      //   });
8519      // if (isSameSize && !isSameColor) {
8520      //   colorChangePopup.addClass("is-active");
8521      // }
8522
8523      var modify_layer = $("[id^='option_modify_layer']").css("display");
8524
8525      if (modify_layer == "none") {
8526        $("body").css("overflow", "auto");
8527        $("html").css({ opacity: "1", overflow: "auto" });
8528      }
8529
8530      var listClass = $("#selected_product .productList");
8531      setTimeout(sameProduct, 100);
8532    });
8533
8534    /************************************************************* 교환/반품 페이지 사은품 영역 추가하기 *****************************************************************/
8535
8536    var this_url = window.location.href; // 현재 URL 구하기
8537    var order_id = this_url.split("order_id=")[1]; // order_id= 를 제외한 뒷자리 = 주문번호 구하기
8538
8539    // url = 상품 product_no , el = $(this)
8540    function GiftClone(num, el) {
8541      $.ajax({
8542        url: "/iv/html/ajax/ajax_myshop_orderDetail.html?order_id=" + order_id,
8543        type: "GET",
8544        dataType: "html",
8545        success: function (html) {
8546          // 사은품의 개수 구하기
8547          var gift_length = $(html).find(".gift_length").length;
8548          var iv_ExGiftForm = $(".iv_ExGiftForm").length; // 복사한 사은품 영역
8549
8550          // 분기처리하기 (사은품이 있을때만 실행)
8551          if (gift_length > 0) {
8552            if (iv_ExGiftForm == 0) {
8553              // 한번만 실행하기
8554              // 사은품 복사
8555              var myGift = $(html).find(".iv_ExGiftForm").clone();
8556
8557              // 사은품 개수만큼 넣기
8558              $(".append_Gift").append(myGift);
8559            }
8560          } // 분기처리하기
8561
8562          // 각 상품별 당시구매금액 구하기
8563          $(html)
8564            .find("._pay")
8565            .each(function () {
8566              var prd_href = $(this).find(".thumb a").attr("href"); // 상품번호 href
8567              var prd_num = getCateParam("product_no", prd_href); // 상품번호만 추출
8568
8569              var og_price_dispaly = $(this).find(".og_pay_price").hasClass("displaynone"); // 할인가 displaynone 여부
8570              var prd_price_display = $(this).find(".prd_pay_price").hasClass("displaynone"); // 실제구매금액 displaynone 여부
8571
8572              var og_pay_price = $(this).find(".og_pay_price strong").text(); // 할인가
8573              var prd_pay_price = $(this).find(".prd_pay_price strong").text(); // 실제 구매금액
8574
8575              // 교환/반품의 상품번호와 실구매금액의 상품번호가 같다면
8576              if (prd_num == num) {
8577                // 주문정보에 할인가가 없다면
8578                if (prd_price_display == true) {
8579                  el.nextAll(".saleTd").find(".salePrice").text("");
8580                  el.nextAll(".saleTd").find("strong").addClass("able"); // 교환/반품에 기존내용 금액 출력하기
8581                } else {
8582                  el.nextAll(".saleTd").find(".salePrice").text(prd_pay_price); // 교환/반품에 할인가격 출력하기
8583                  el.nextAll(".saleTd").find(".salePrice").append("<span class='won_abled'>원</span>");
8584                }
8585              }
8586            });
8587        },
8588        complete: function () {
8589          $(".apply_form_container .productSale").each(function () {
8590            var sale_price_won = $(this).nextAll(".saleTd").find(".salePrice").text(); // 할인가 구하기
8591            var sale_price = sale_price_won.replace(/[^0-9]/gi, ""); // 숫자를 제외한 나머지 항목 삭제
8592
8593            var og_price = $(this).nextAll(".saleTd").find("strong").text(); // 원가 구하기
8594
8595            if (sale_price == "") {
8596              $(this).nextAll(".saleTd").attr("data-price", og_price);
8597            } else {
8598              $(this).nextAll(".saleTd").attr("data-price", sale_price);
8599            }
8600          });
8601        },
8602      }); // ajax
8603    } // GiftClone
8604
8605    //href 값 지워주기
8606    $(".name a").removeAttr("href");
8607    $(".thumbnail a").removeAttr("href");
8608
8609    /************************************************************* 교환/반품 페이지 사은품 영역 추가하기 *****************************************************************/
8610  } // if( exchange > 0 )
8611
8612  /*======================================================================== 교환상품-> 다른상품교환-> 상품검색시 ========================================================================*/
8613
8614  var exSearchForm = $("#exSearchForm").length;
8615  if (exSearchForm > 0) {
8616    /* 다른상품교환 -> 검색시 프로모션 가격 노출 */
8617    var productonClick;
8618    var modi;
8619    var productonClickNum;
8620    var salePrice; // 프로모션가격
8621    var reSalePrice; // 숫자만 남기기
8622    var pageCallChk = 2;
8623
8624    function exSearchFormPrdCall(el) {
8625      var $this2 = el;
8626      if ($this2.hasClass("done") == false) {
8627        // originalPrice 뒤에 0이 4개 추가로 붙는 현상이 있어 뒤에 "0" 4개 자르기
8628        var oriPrice = $this2
8629          .find(".salePriceShow .productPrice")
8630          .text()
8631          .replace(/[^0-9]/g, "");
8632        productonClick = String($this2.find(".select a").attr("onclick"));
8633        modi = $this2.find(".select a").attr("data-num", productonClick.replace(/[^0-9]/g, ""));
8634        productonClickNum = $this2.find(".select a").attr("data-num");
8635
8636        $.ajax({
8637          url: "/iv/html/ajax/ajax_prdDetail.html?product_no=" + productonClickNum,
8638          type: "GET",
8639          dataType: "html",
8640          success: function (html) {
8641            salePrice = $(html).find(".productPrice .sale .font_Gilroy").text();
8642            reSalePrice = salePrice.replace(/[^0-9]/g, "");
8643            // 교환 반품
8644            if (reSalePrice == oriPrice) {
8645              $this2.find(".salePriceShow").find(".salePrice").text(comma(oriPrice));
8646              $this2.find(".salePriceShow").find(".productPrice").text("");
8647              $this2.find(".salePriceShow").find(".productPrice").attr("data-ori", oriPrice);
8648              $this2.find(".salePriceShow").find(".salePrice").append("<span class='won_abled'>원</span>");
8649            } else {
8650              $this2.find(".salePriceShow").find(".salePrice").text(comma(salePrice));
8651              $this2.find(".salePriceShow").find(".productPrice").attr("data-ori", oriPrice);
8652              $this2.find(".salePriceShow").find(".salePrice").append("<span class='won_abled'>원</span>");
8653            }
8654            $this2.addClass("done");
8655          },
8656        });
8657      } // productAjax2
8658    }
8659
8660    // 다른상품교환 -> 검색 클릭시 전체 상품 보이기
8661    // 상품 전체 보이게 하기
8662    // 셀렉트 박스에 전체상품 개수 value 추가하여 선택하게 하기
8663    // 검색창 나왔을시에만 실행
8664    if ($("#exchange_product_search_form").length > 0) {
8665      // 전체 상품 개수 구하기
8666      var allProductNum = $(".allSearchProduct").find("strong").text();
8667      // select박스 val()
8668      var limitVal = $(".allSearchProductView #limit").val();
8669      // 전체상품 개수
8670      var prdLenght = $(".selectSale").length;
8671      // 마지막 옵션의 value값 전체상품 개수로 변경
8672      $(".allSearchProductView #limit").find("option:last").val(allProductNum);
8673      // 마지막옵션 선택
8674      $(".allSearchProductView #limit").find("option:last").attr("selected", "selected");
8675      // selectbox의 value 값 전체상품값으로 변경
8676      $(".allSearchProductView #limit").val(allProductNum).attr("selected", "selected");
8677
8678      $("#exSearchForm").css("opacity", "1");
8679      // selectbox val 값과 전체 개수값 / 전체개수값과 상품개수 값 비교, 전체상품개수가 0이 아니라면,
8680      // selectbox 전체 상품 개수의 val 값으로 change 되면서 페이지 리로드, 다시 비교식을 검토하여 else로 빠짐
8681      if (limitVal != allProductNum && Number(allProductNum) != prdLenght && allProductNum != 0) {
8682        setTimeout(function () {
8683          $(".allSearchProductView #limit").val(allProductNum).change();
8684        }, 100);
8685      }
8686      // 총 상품갯수와 셀렉트박스(상품몇개 표시)값이 같다면 return 후 종료
8687      else if (limitVal == allProductNum && Number(allProductNum) == prdLenght) {
8688      }
8689      // 검색결과가 없을시 = 검색상품이 "0"개 라면,
8690      else if (limitVal != allProductNum && Number(allProductNum) != prdLenght && allProductNum == 0) {
8691        //return;
8692      }
8693    } else {
8694      $("#exSearchForm").css("opacity", "1");
8695    }
8696    // searchAllProduct();
8697
8698    var maxItemChk = Number($(".allSearchProduct").find("strong").text().trim());
8699    var ajaxStartChk = 0;
8700    var scrollCallItem = Number(limitVal);
8701
8702    for (var e = 0; e < scrollCallItem * 2; e++) {
8703      var el = $(".selectSale").eq(e);
8704      if (el.length > 0) {
8705        exSearchFormPrdCall(el);
8706      }
8707    }
8708    ajaxStartChk = 0 + scrollCallItem * 2;
8709    //최초 상품만 우선 실행
8710
8711    // 다른상품교환 -> 상품검색 이후 마우스 휠에 따른 탑버튼 노출 (위 or 아래)
8712    // 마우스 휠 감지
8713
8714    var lastScroll = 0;
8715    var delta = 5;
8716    var navbar = $("#exchange_product_search_form .header h1").outerHeight();
8717    var didScroll = false;
8718
8719    $(window).scroll(function (event) {
8720      var scr = $(this).scrollTop();
8721      var exSF = $("#exSearchForm .header").height();
8722
8723      if (scr > exSF) {
8724        $("#exSearchForm .header").addClass("fixHeader");
8725      } else {
8726        $("#exSearchForm .header").removeClass("fixHeader");
8727      }
8728
8729      if ($("#exchange_product_search_form").length > 0) {
8730        didScroll = true;
8731      }
8732    }); // $(window).scroll
8733
8734    setInterval(function () {
8735      if (didScroll) {
8736        hasScrolled();
8737        didScroll = false;
8738      }
8739    }, 250);
8740    function hasScrolled() {
8741      var st = $(this).scrollTop();
8742
8743      if (st > $(document).height() - $(window).height() * 2.5) {
8744        if (ajaxStartChk <= maxItemChk) {
8745          for (var e = ajaxStartChk; e < ajaxStartChk + scrollCallItem; e++) {
8746            var el = $(".selectSale").eq(e);
8747            if (el.length > 0) {
8748              exSearchFormPrdCall(el);
8749            }
8750          }
8751          ajaxStartChk = ajaxStartChk + scrollCallItem;
8752        }
8753      }
8754
8755      if (Math.abs(lastScroll - st) <= delta) {
8756        return;
8757      }
8758
8759      if ((st > lastScroll && st > navbar) || st == 0) {
8760        $(".searchTopBtn").css("display", "none");
8761      } else {
8762        if (st + $(window).height() < $(document).height()) {
8763          $(".searchTopBtn").css("display", "block");
8764        }
8765      }
8766      lastScroll = st;
8767    } // hasScrolled
8768
8769    //탑버튼 클릭시 맨위로,,
8770    $(".searchTopBtn").click(function () {
8771      $("body, html").stop().animate(
8772        {
8773          scrollTop: 0,
8774        },
8775        0
8776      );
8777    });
8778  }
8779
8780  /*======================================================================== 교환상품-> 다른상품교환-> 상품검색시 ========================================================================*/
8781
8782  /*======================================================================== 교환신청 버튼 클릭시 ========================================================================*/
8783
8784  /* 교환/반품 신청하기 버튼 클릭시 alert */
8785  EC$(".confirmPop .confirmComplete").on("click", function () {
8786    var returnTitle = $(".titleArea h2").text();
8787    //상품 선택 체크
8788    var prdChk = $("input[id^='apply_product']:checked").length;
8789    if (prdChk == 0) {
8790      alert("제품을 선택하세요.");
8791      $(".confirmDim").removeClass("on");
8792      $("html, body").animate({ scrollTop: 0 }, 0);
8793      return false;
8794    } else {
8795      if (returnTitle.indexOf("교환") == 0) {
8796        if ($("#selected_product .productList").length == 0) {
8797          alert("교환제품을 선택하세요.");
8798          $(".confirmDim").removeClass("on");
8799          $("html, body").animate(
8800            {
8801              scrollTop: $("#exPrd").offset().top - 150,
8802            },
8803            0
8804          );
8805          return false;
8806        } else {
8807          //교환할 상품을 선택은 했으나 옵션을 정하지 않은 경우 선택하게 함
8808          if ($("#selected_product .productList .option-default:not(.displaynone)").length > 0) {
8809            alert("교환제품의 옵션을 선택하세요.");
8810            $(".confirmDim").removeClass("on");
8811            $("html, body").animate(
8812              {
8813                scrollTop: $("#exPrd").offset().top - 150,
8814              },
8815              0
8816            );
8817            return false;
8818          }
8819        }
8820      }
8821    }
8822
8823    // 사유 작성 체크
8824    if (!$(".detaliReasonWrite").hasClass("displaynone")) {
8825      var reasonDetailChk = $("#reason_detail").val().trim();
8826      if (reasonDetailChk.length == 0) {
8827        alert("상세사유를 작성하세요.");
8828        $(".confirmDim").removeClass("on");
8829        $("#reason_detail").val("");
8830        $("html, body").animate(
8831          {
8832            scrollTop: $("#exReason").offset().top - 150,
8833          },
8834          0
8835        );
8836        return;
8837      }
8838    } else if (!$(".detaliReasonPopBtn").hasClass("displaynone")) {
8839      var optionLength = $(".detailReasonPop").find(
8840        '.productContent:not(.displaynone) li[data-type="required"]'
8841      ).length; // li개수
8842      var optionCompleteLength = $(".detailReasonPop .productContent:not(.displaynone)").find(
8843        ".option-complete"
8844      ).length; // 체크된 li개수
8845
8846      // li개수와 체크된 li가 같고,
8847      if (optionLength == optionCompleteLength && optionLength > 0 && optionCompleteLength > 0) {
8848        $("#reason_detail").val("상세사유 작성 완료");
8849      } else {
8850        alert("상세사유를 작성하세요.");
8851        $(".confirmDim").removeClass("on");
8852        $("#reason_detail").val("");
8853        $("html, body").animate(
8854          {
8855            scrollTop: $("#exReason").offset().top - 150,
8856          },
8857          0
8858        );
8859        return;
8860      }
8861    } else {
8862      //사이즈 교환 선택 시 - 상세사유: 사이즈 교환
8863      $(".detaliReasonWrite #reason_detail").html("사이즈 교환");
8864      $(".detaliReasonWrite #reason_detail").val("사이즈 교환");
8865    }
8866
8867    //수거신청 항목 체크
8868    var pickUpValue = $('input[id^="ispickup"]:checked').val();
8869
8870    //수거해주세요 체크
8871    if (pickUpValue == "T") {
8872      if ($('input[id^="sameaddr"]:checked').val() == "T") {
8873      } else {
8874        var isValid = true;
8875        var inputOffsetTop;
8876        $(".colAdress tbody tr").each(function () {
8877          if ($(this).hasClass("selectPick") || $(this).hasClass("salePick")) {
8878            $(this)
8879              .find("input[type=text]")
8880              .each(function () {
8881                if ($(this).val() == "") {
8882                  var label = $(this).attr("fw-label");
8883                  alert(label + "의 값을 입력해주세요.");
8884                  $(this).focus();
8885                  isValid = false;
8886                  inputOffsetTop = $("#coll").offset().top - 150;
8887                  return false;
8888                }
8889              });
8890            return isValid;
8891          }
8892        });
8893        if (isValid == false) {
8894          $("html, body").animate(
8895            {
8896              scrollTop: inputOffsetTop,
8897            },
8898            0
8899          );
8900          return false;
8901        }
8902      }
8903    }
8904    //직접 발송할게요 체크
8905    else {
8906      if ($("#pickup_check0").is(":checked") == false) {
8907        if ($("#pickup_csname").val() == "") {
8908          alert("택배사를 입력하세요.");
8909          $(".confirmDim").removeClass("on");
8910          $("#pickup_csname").focus();
8911          $("html, body").animate(
8912            {
8913              scrollTop: $("#coll").offset().top - 150,
8914            },
8915            0
8916          );
8917          return false;
8918        }
8919        if ($("#pickup_invoiceno").val() == "") {
8920          alert("송장번호를 입력하세요.");
8921          $(".confirmDim").removeClass("on");
8922          $("#pickup_invoiceno").focus();
8923          $("html, body").animate(
8924            {
8925              scrollTop: $("#coll").offset().top - 150,
8926            },
8927            0
8928          );
8929          return false;
8930        }
8931      }
8932    }
8933
8934    //환불계좌 등록 여부
8935    var accBank = $("#acc_reg_disp").hasClass("displaynone");
8936
8937    if ($("#refund").length > 0) {
8938      if (accBank == false) {
8939        alert("환불계좌를 입력하세요.");
8940        $("html, body").animate(
8941          {
8942            scrollTop: $("#refund").offset().top - 150,
8943          },
8944          0
8945        );
8946        return false;
8947      }
8948    }
8949
8950    // 최종주문하기 버튼 클릭시
8951
8952    // prdChk = 내가 체크한 상품 개수
8953    var iv_ExGiftForm = $(".iv_ExGiftForm").length; // 사은품 있는지?
8954    var myPrd_length = $(".exTableCustom .orderList").length; // 상품의 개수
8955
8956    EC$("#applyForm").off("submit");
8957    EC$("#applyForm").on("submit", function (e) {
8958      e.preventDefault();
8959      fillApplyForm();
8960    });
8961    setTimeout(function () {
8962      if (iv_ExGiftForm > 0) {
8963        // 내가 체크한 상품이 1개 이상이고, 전체 상품보다는 적다면
8964        if (prdChk > 0 && prdChk < myPrd_length) {
8965          var myConfirm = confirm(
8966            "*유의사항\n주문서 내에 포함된 사은품은, 결제 및 지급 조건에 따라 상담원이 회수 요청을 드릴 수 있습니다."
8967          );
8968          if (myConfirm == true) {
8969            OrderApply.apply();
8970          } else {
8971          }
8972        } //fillApplyForm();
8973
8974        // 내가 선택한 상품이 전체상품 개수와 같다면 = 전체선택시
8975        else if (prdChk == myPrd_length) {
8976          OrderApply.apply();
8977        }
8978      } else {
8979        OrderApply.apply();
8980      }
8981    }, 100);
8982
8983    return false;
8984  });
8985
8986  /*======================================================================== 교환신청 버튼 클릭시 ========================================================================*/
8987
8988  /*======================================================================== 기타 ========================================================================*/
8989
8990  /* 교환상품 탭 관련 내용 */
8991
8992  /* 탑버튼 */
8993  $(".searchTopBtn").bind("click", function () {
8994    $("html, body").stop().animate(
8995      {
8996        scrollTop: 0,
8997      },
8998      600
8999    );
9000  });
9001
9002  // 다른상품교환 팝업
9003  $(".searchBtn").bind("click", function () {
9004    $("#searchProductPop").show();
9005  });
9006  $(".closePop").bind("click", function () {
9007    $("#searchProductPop").hide();
9008  });
9009
9010  //  2025 교반앱 개선
9011
9012  // 변수 선언
9013  const sameAddressRadio = $("#same_address");
9014  const changeAddressRadio = $("#change_address");
9015  const sameAddressContent = $("#same-address-content");
9016  const changeAddressContent = $("#change-address-content");
9017
9018  let pickName = $(".pickName");
9019  let pickZipCode = $(".pickZipCode");
9020  let pickAddr = $(".pickAddr");
9021  let pickAddr2 = $(".pickAddr2");
9022  let pickPhone2 = $(".pickPhone2");
9023
9024  sameAddressContent.find(".recipient-name").text(pickName.text());
9025  sameAddressContent.find(".postal-code").text(pickZipCode.text());
9026  sameAddressContent.find(".street-address").text(pickAddr.text());
9027  sameAddressContent.find(".detail-address").text(pickAddr2.text());
9028  sameAddressContent.find(".contact-number").text(pickPhone2.text());
9029
9030  function toggleContent() {
9031    const isSameChecked = sameAddressRadio.is(":checked");
9032
9033    sameAddressContent.toggleClass("displaynone", !isSameChecked);
9034    changeAddressContent.toggleClass("displaynone", isSameChecked);
9035
9036    if (isSameChecked) {
9037      defaultInput();
9038    }
9039  }
9040
9041  function defaultInput() {
9042    $("#receive_name").val(pickName.text());
9043    $("#receive_hp").val(pickPhone2.text());
9044    $("#receive_zipcode").val(pickZipCode.text());
9045    $("#receive_address").val(pickAddr.text());
9046    $("#receive_address2").val(pickAddr2.text());
9047  }
9048
9049  // 초기 상태 설정
9050  defaultInput();
9051  toggleContent();
9052
9053  // 이벤트 리스너 추가
9054  let addressOption = EC$("input[name='address_option']");
9055  if (addressOption) {
9056    EC$("input[name='address_option']").on("change", toggleContent);
9057  }
9058  let findPostalBtn = document.querySelector(".find-postal-btn");
9059
9060  if (findPostalBtn) {
9061    findPostalBtn.addEventListener("click", function () {
9062      new daum.Postcode({
9063        oncomplete: function (data) {
9064          // 주소 검색 후 데이터 채우기
9065          document.querySelector("#receive_zipcode").value = data.zonecode; // 우편번호
9066          document.querySelector("#receive_address").value = data.roadAddress; // 도로명 주소
9067
9068          // 상세 주소 입력 필드로 포커스 이동
9069          document.querySelector("#receive_address2").value = "";
9070          document.querySelector("#receive_address2").focus();
9071        },
9072      }).open();
9073    });
9074  }
9075
9076  let receiveHp = document.querySelector("#receive_hp");
9077  if (receiveHp) {
9078    receiveHp.addEventListener("input", function (event) {
9079      let input = event.target;
9080
9081      // 숫자만 입력하도록 필터링 (정규식 사용)
9082      let numbersOnly = input.value.replace(/[^0-9]/g, "");
9083
9084      // 전화번호 형식으로 변환
9085      let formattedNumber = formatPhoneNumber(numbersOnly);
9086
9087      // 변환된 값 입력 필드에 반영
9088      input.value = formattedNumber;
9089    });
9090  }
9091
9092  function formatPhoneNumber(number) {
9093    if (number.length <= 3) {
9094      return number;
9095    } else if (number.length <= 7) {
9096      return number.slice(0, 3) + "-" + number.slice(3);
9097    } else {
9098      return number.slice(0, 3) + "-" + number.slice(3, 7) + "-" + number.slice(7, 11);
9099    }
9100  }
9101}); // $(document).ready();
9102
9103function exSearchOpen() {
9104  if ($(".listCtrl").hasClass("displaynone") == false) {
9105    $(".searchMessage").addClass("displaynone");
9106  } else {
9107    $(".searchMessage").removeClass("displaynone");
9108  }
9109  var exSearchForm = $("#exSearchForm").length;
9110  // 검색창 분기처리
9111  if (exSearchForm > 0) {
9112    $("#popup").addClass("width");
9113
9114    // 옵션 여러개 선택할수 있도록 설정
9115    $("#search_type").attr("multiple", true);
9116
9117    // 옵션 동시 선택
9118    //value 값을 2개 넣어 동시 검색되게,
9119    $("#search_type option").eq(0).val("product_name product_code");
9120
9121    // 옵션창 숨겨놓기
9122    $("#search_type").addClass("displaynone");
9123
9124    // 검색창 placeholder 추가
9125    $("#exSearchForm .exSearchBox .inputTypeText").attr("placeholder", "제품명/제품코드로 검색하세요.");
9126
9127    // val값 확인하여 x 표시 on/off
9128    $("#exSearchForm .exSearchBox .inputTypeText").keyup(function () {
9129      var thisVal = $(this).val();
9130      if (thisVal != "") {
9131        $(".keywordBox .subtract").css("display", "block");
9132      } else {
9133        $(".keywordBox .subtract").css("display", "none");
9134      }
9135    });
9136    // 검색이후 검색값이 남아 있을경우 x버튼 표기
9137    if ($("#exSearchForm .exSearchBox .inputTypeText").val() != "") {
9138      $(".keywordBox .subtract").css("display", "block");
9139    } else {
9140      $(".keywordBox .subtract").css("display", "none");
9141    }
9142
9143    // 검색창 x 표시 클릭시 검색내용 삭제
9144    $(".keywordBox .subtract").bind("click", function () {
9145      $("#exSearchForm .exSearchBox .inputTypeText").val("");
9146      $(this).css("display", "none");
9147    });
9148  }
9149}
9150exSearchOpen();
9151
9152/*****************************************************************************************************************************************************************/
9153
9154/* 교환신청 -> 상품선택 내 프로모션 가격 호출 */
9155
9156/* ★★★★★ */
9157
9158/*****************************************************************************************************************************************************************/
9159
9160// CSS exchange_back.html <style></style> 임시작성
9161function sameProduct() {
9162  var sameNum;
9163  var selectNum;
9164  var same_price;
9165  var costPrice; // 원가,,
9166  var qtyLength = null; // 수량변경시 사용
9167  var boolean = false;
9168
9169  /***********************************************/
9170
9171  /***********************************************/
9172
9173  // 선택된 교환제품 없으면 제품추가 버튼 노출
9174  if ($("#sPrdList .productList").length == 0) {
9175    $(".addPrdBtn table").removeClass("displaynone");
9176  }
9177
9178  $("#selected_product .productList").each(function () {
9179    var $this = $(this);
9180    var same_product = $this.find(".thumbnail a").attr("href");
9181    var qtyNum = $this.find(".ec-base-qty input[type='text']").val();
9182    var sameChk = false;
9183
9184    sameNum = getCateParam("product_no", same_product);
9185    sameArray.forEach(function (el, index) {
9186      if (Number(el.prdNo) == Number(sameNum)) {
9187        sameChk = true;
9188        var forTotalChk = Number(uncomma($this.find(".totalPrice strong").text()));
9189        $this.find(".totalPrice strong").attr("data-ori", forTotalChk);
9190        $this.find(".totalPrice strong").attr("data-prd", Number(sameNum));
9191        if (el.oriPrc != el.salePrc) {
9192          var prc = el.salePrc * qtyNum;
9193          $this.find(".totalPrice strong").text(comma(prc));
9194          $this.find(".totalPrice strong").append("<span class='won_abled'>원</span>");
9195        } else {
9196          var prc = el.oriPrc * qtyNum;
9197          $this.find(".totalPrice strong").text(comma(prc));
9198          $this.find(".totalPrice strong").append("<span class='won_abled'>원</span>");
9199        }
9200        $this.not(".ex").addClass("same");
9201      }
9202    });
9203
9204    if (!sameChk) {
9205      $this.addClass("ex").removeClass("same");
9206      exArray.forEach(function (el, index) {
9207        if (Number(el.prdNo) == Number(sameNum)) {
9208          var forTotalChk = Number(uncomma($this.find(".totalPrice strong").text()));
9209          $this.find(".totalPrice strong").attr("data-ori", forTotalChk);
9210          $this.find(".totalPrice strong").attr("data-prd", Number(sameNum));
9211
9212          if (el.oriPrc != el.salePrc) {
9213            var prc = el.salePrc * qtyNum;
9214            $this.find(".totalPrice strong").text(comma(prc));
9215            $this.find(".totalPrice strong").append("<span class='won_abled'>원</span>");
9216          } else {
9217            var prc = el.oriPrc * qtyNum;
9218            $this.find(".totalPrice strong").text(comma(prc));
9219            $this.find(".totalPrice strong").append("<span class='won_abled'>원</span>");
9220          }
9221        }
9222      });
9223    } else {
9224      $this.not(".ex").addClass("same");
9225    }
9226
9227    $this.find(".optionBtn01, .optionBtn02").each(function () {
9228      var thisOption = $(this);
9229      $(this).parents(".productList").find(".optionBtn01_box").append(thisOption);
9230    });
9231
9232    // 옵션 한곳에 몰아넣기
9233    $this.find(".optionBtn01, .optionBtn02").each(function () {
9234      var thisOption01 = $(this);
9235      $(this).parents(".productList").find(".optionBtn01_box").append(thisOption01);
9236    });
9237
9238    // 옵션 텍스트 변경
9239    var hasSame = $this.hasClass("same");
9240    if (hasSame == true) {
9241      //동일상품 추가 했을 때
9242      $this.find(".optionBtn01_box").each(function () {
9243        var thisLength = $(this).find("a.optionBtn01").length;
9244        for (var i = 0; i < thisLength; i++) {
9245          var optionCount = $(this).find("a").length;
9246          if (optionCount == 2) {
9247            $(this).find("a.optionBtn01").eq(i).text("옵션 변경");
9248            $(this).find("a.optionBtn02").eq(i).text("옵션 선택");
9249          } else {
9250            $(this)
9251              .find("a.optionBtn01")
9252              .eq(i)
9253              .text("세트 옵션 변경 " + (i + 1));
9254            $(this)
9255              .find("a.optionBtn02")
9256              .eq(i)
9257              .text("세트 옵션 선택 " + (i + 1));
9258          }
9259        }
9260      });
9261    } else {
9262      //다른상품 추가 했을 때
9263      $this.find(".optionBtn01_box").each(function () {
9264        var thisLength = $(this).find("a.optionBtn01").length;
9265        for (var i = 0; i < thisLength; i++) {
9266          var optionCount = $(this).find("a").length;
9267          if (optionCount == 2) {
9268            $(this).find("a.optionBtn01").eq(i).text("옵션 선택");
9269            $(this).find("a.optionBtn01.modify").eq(i).text("옵션 변경");
9270            $(this).find("a.optionBtn02").eq(i).text("옵션 선택");
9271          } else {
9272            $(this)
9273              .find("a.optionBtn01")
9274              .eq(i)
9275              .text("세트 옵션 변경 " + (i + 1));
9276            $(this)
9277              .find("a.optionBtn02")
9278              .eq(i)
9279              .text("세트 옵션 선택 " + (i + 1));
9280          }
9281        }
9282      });
9283    }
9284
9285    // 옵션명 displaynone 클래스 삭제하기
9286    $(".productList .optionMargin > li strong").removeClass("displaynone");
9287
9288    $this.find(".optionList .name").each(function () {
9289      if ($(this).closest("li").find(".option-default").length == 0) {
9290        $(this).after('<p class="option-default">[옵션: 옵션을 선택해주세요]</p>');
9291      }
9292      if ($(this).find(".optionStr").text().length == 0) {
9293        $(this).closest("li").find(".option-default").removeClass("displaynone");
9294      } else {
9295        $(this).closest("li").find(".option-default").addClass("displaynone");
9296      }
9297    });
9298    // }
9299
9300    var checkReason = $(".reasonList .ec-base-label input:checked").parent().index();
9301    if (checkReason == 2) {
9302      $(".defaultAdd").addClass("displaynone");
9303      $(".sizeAdd").removeClass("displaynone");
9304    } else {
9305      $(".defaultAdd").removeClass("displaynone");
9306      $(".sizeAdd").addClass("displaynone");
9307    }
9308  });
9309
9310  //다른상품교환 상품 하나도 없으면 배열 비움
9311  if ($("#sPrdList .productList.ex").length == 0) {
9312    exArray = [];
9313  }
9314
9315  $("#selected_product").removeClass("displaynone");
9316}
9317
9318EC$(document).on("click", ".productList #deleteProduct", function () {
9319  setTimeout(sameProduct, 100);
9320});
9321
9322EC$("#test_id").on("click", function () {
9323  setTimeout(sameProduct, 100);
9324});
9325
9326function exProductSelect(el) {
9327  var ele = $(el); // 상품
9328  var prdNo = String(ele.data("num")); // 각 상품의 data-num 값
9329  var oriPrc = ele.closest(".selectSale").find(".productPrice").data("ori"); // 각 상품의 원가
9330  if (ele.closest(".selectSale").find(".salePrice").text() != "") {
9331    var salePrice = ele
9332      .closest(".selectSale")
9333      .find(".salePrice")
9334      .text()
9335      .replace(/[^0-9]/g, "");
9336  } else {
9337    var salePrice = oriPrc;
9338  }
9339  var exArrayEl = { prdNo: prdNo, oriPrc: oriPrc, salePrc: Number(salePrice) };
9340  window.opener.exArray.push(exArrayEl);
9341  window.opener.EC$("#test_id").click();
9342}
9343
9344function exArrayRemoveFunc(el) {
9345  var ele = $(el);
9346  var prdNoChk = ele.parents(".productList").find(".thumbnail > a").attr("href");
9347  prdNoChk = getCateParam("product_no", prdNoChk); //현재 생성 상품 번호
9348  var onlyOnceChk = false;
9349  exArray.forEach(function (e, i) {
9350    if (Number(e.prdNo) == Number(prdNoChk)) {
9351      if (!onlyOnceChk) {
9352        exArray.splice(i, 1);
9353        onlyOnceChk = true;
9354      }
9355    }
9356  });
9357}
9358
9359function bankChange() {
9360  var infoName = $("#acc_depositor").val();
9361  var infoBank = $("#acc_bank_name").val();
9362  var infoNo = $("#acc_no").val();
9363  $(".infoBank").text("[" + infoBank + "] " + infoNo);
9364  $(".infoName").text("예금주 :" + infoName);
9365  $(".refundBanks").addClass("displaynone");
9366}
9367
9368EC$("#test_id2").on("click", function () {
9369  setTimeout(bankChange, 100);
9370});
9371
9372function bankClick() {
9373  window.opener.EC$("#test_id2").click();
9374}
9375
9376// 동일상품 추가 두번쨰 테이블 버튼 내용
9377function clickEvent2() {
9378  if ($("input[type='checkbox'][name^='apply_product']:checked").length == 0) {
9379    return;
9380  } else {
9381    // return 값이 없다면 동일상품 추가 함수 실행
9382    opt_Chk();
9383    if (opt_checked == false) {
9384      return false;
9385    } else {
9386      OrderApply.exchangeSameProduct();
9387      setTimeout(sameProduct, 100);
9388      setTimeout(function () {
9389        $(".defaultAdd").addClass("displaynone");
9390        $(".sizeAdd").removeClass("displaynone");
9391      }, 100);
9392    }
9393  }
9394} //clickEvent2
9395
9396//콤마찍기
9397function comma(str) {
9398  str = String(str);
9399  return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, "$1,");
9400}
9401
9402//콤마제거
9403function uncomma(string) {
9404  var no = string.replace(/[^0-9]/g, "");
9405  return no;
9406}
9407
9408function opt_Chk() {
9409  opt_checked = true;
9410  var myOrder = aOrderProductData.length;
9411
9412  $("input[name^='apply_product']:checked").each(function () {
9413    var myIndex = $(this).closest("tr").index();
9414    var product_no = aOrderProductData[myIndex].product_no;
9415    var opt_str = aOrderProductData[myIndex].opt_str;
9416
9417    // 동일/다른상품 교환시 상품번호, 옵션값
9418    $("input[name^='selected_item']").each(function () {
9419      var myItem = $(this).val();
9420      var item_product_no = Number(myItem.split("||")[0]); // 상품번호
9421      var item_opt_str = myItem.split("||")[4]; // 옵션값
9422      if (opt_checked == true) {
9423        if (product_no == item_product_no && opt_str == item_opt_str) {
9424          alert("이미 동일옵션이 등록되어있습니다.");
9425          opt_checked = false;
9426          return false;
9427        } else {
9428          opt_checked = true;
9429        }
9430      }
9431    });
9432  });
9433  //order 상품의 상품번호, 옵션값
9434}
9435
9436/*======================================================================== 유효성 ========================================================================*/
9437
9438//상세사유입력팝업 필수입력항목 모두 채웠는지 확인 함수
9439function optionCompleteChkFunc() {
9440  complete = false;
9441  var optionLength = $(".detailReasonPop").find('.productContent:not(.displaynone) li[data-type="required"]').length; // li개수
9442  var optionCompleteLength = $(".detailReasonPop .productContent:not(.displaynone)").find(".option-complete").length; // 체크된 li개수
9443
9444  // li개수와 체크된 li가 같고,
9445  if (optionLength == optionCompleteLength && optionLength > 0 && optionCompleteLength > 0) {
9446    $("#compReaseon button").css("background-color", "#B75622");
9447    complete = true;
9448  } else {
9449    $("#compReaseon button").css("background-color", "#777");
9450  }
9451  return complete;
9452}
9453
9454var submitChk1 = false;
9455var submitChk2 = false;
9456var submitChk3 = false;
9457
9458//필수항목 모두 선택시 교환 신청 버튼 색 변경
9459$(".orderList").click(function () {
9460  //1. 반품 접수할 제품 선택
9461  submitChk1 = $(".orderList .checkVal input:checked").length;
9462  if (submitChk1 > 0) {
9463    $(".confirmOpen").addClass("a");
9464  } else {
9465    $(".confirmOpen").removeClass("a");
9466  }
9467});
9468
9469// if (exchange > 0) {
9470//   IV$(window).on(
9471//     "scroll",
9472//     iv_util.throttle(function () {
9473//       //2. 교환 사유 선택 및 상세사유 입력
9474//       var reason1 = $(".detaliReasonWrite #reason_detail").attr("value"); // 고객변심
9475//       var reason2 = $("#reason_radio1").attr("checked"); // 사이즈 불만족
9476//       var reason3 = $(".detaliReasonPopOpen span").html(); // 제품 불량
9477
9478//       if (reason2) {
9479//         $(".confirmOpen").addClass("b");
9480//       } else if (reason1.length > 0) {
9481//         $(".confirmOpen").addClass("b");
9482//       } else if (reason3 == "상세사유 다시 작성") {
9483//         $(".confirmOpen").addClass("b");
9484//       } else {
9485//         $(".confirmOpen").removeClass("b");
9486//       }
9487//       //3. 교환 받으실 상품 선택
9488//       submitChk3 = $(".xans-myshop-selectedproduct").length;
9489//       if (submitChk3 > 0) {
9490//         $(".confirmOpen").addClass("c");
9491//       } else {
9492//         $(".confirmOpen").removeClass("c");
9493//       }
9494
9495//       //교환&반품 페이지 분기
9496//       if ($(".page_exchange").length > 0) {
9497//         if ($(".confirmOpen").hasClass("a") && $(".confirmOpen").hasClass("b") && $(".confirmOpen").hasClass("c")) {
9498//           $("#exchange_Return .confirmOpen.exRequest").css("background-color", "#B75622");
9499//         } else {
9500//           $("#exchange_Return .confirmOpen.exRequest").css("background-color", "#777");
9501//         }
9502//       } else if ($(".page_return").length > 0) {
9503//         if ($(".confirmOpen").hasClass("a") && $(".confirmOpen").hasClass("b")) {
9504//           $("#exchange_Return .confirmOpen.exRequest").css("background-color", "#B75622");
9505//         } else {
9506//           $("#exchange_Return .confirmOpen.exRequest").css("background-color", "#777");
9507//         }
9508//       }
9509//     }, 200)
9510//   );
9511// }
9512
9513sCouponDownResultUrl = '/coupon/coupon_down_result.html';
9514var customMessageChk = false;
9515var customMessageSuccess = '';
9516var customMessageFail = '';
9517var goScrollTop = '';
9518var isLogin = false;
9519var isLoginOpenerUrl = '';
9520var currentUrl = window.location.href;
9521var windowPathName = window.location.pathname;
9522var downloadCouponHref = '';
9523var downloadCouponJoin = '';
9524var returnUrlChk = '';
9525var isMemberPage = false; //로그인, 회원가입 등 비회원 상태에서 접근하는 페이지인지
9526
9527$(document).ready(function(){
9528    if(windowPathName.indexOf('/member/') > -1){
9529    	isMemberPage = true;
9530    }
9531    
9532    if(windowPathName.indexOf('/test') > -1){
9533    }else{
9534        //배너에 쿠폰넘버가 있는지 체크
9535        $('.df_banner_wrap').each(function(){
9536            var dfBannerWrap = $(this);
9537            dfBannerWrap.find('a').each(function(){
9538                var bannerHerf = $(this).data('href');
9539                var bannerTitle = $(this).data('title');
9540
9541                //배너 구분(링크Xor쿠폰링크or일반링크)
9542                if(bannerHerf == '#none'){ //배너 url #none일 경우 클릭이벤트 X
9543                    $(this).css('pointer-events', 'none');
9544                }else if(bannerHerf.indexOf('coupon_no') > -1){ //쿠폰 링크 이동 배너일 경우
9545                    var coponNo = iv_util.getParameterByName(bannerHerf, 'coupon_no');
9546                    if(bannerTitle){
9547                        if(typeof bannerTitle == 'number') {
9548                            bannerTitle = String(bannerTitle);
9549                        }
9550                        if(bannerTitle.indexOf('alertCustom') > -1){
9551                            if(coponNo.indexOf(',') > -1){
9552                                $(this).addClass('coupon_download_all');
9553                            }
9554                        }else{
9555                            if(bannerHerf.indexOf('opener_url=') > -1){
9556                                $(this).attr('href',bannerHerf);
9557                            }else{
9558                                if(isMemberPage){
9559                                    $(this).attr('href',bannerHerf + '&opener_url=/index.html' );
9560                                }else{
9561                                    $(this).attr('href',bannerHerf + '&opener_url=' + window.location.pathname + window.location.search );
9562                                }
9563                            }
9564                        }
9565                    }else{
9566                        if(bannerHerf.indexOf('opener_url=') > -1){
9567                            $(this).attr('href',bannerHerf);
9568                        }else{
9569                            if(isMemberPage){
9570                                $(this).attr('href',bannerHerf + '&opener_url=/index.html' );
9571                            }else{
9572                                $(this).attr('href',bannerHerf + '&opener_url=' + window.location.pathname + window.location.search );
9573                            }
9574                        }
9575                    }
9576                }else{ //일반 링크 이동 배너일 경우
9577                    $(this).attr('href', bannerHerf);
9578                }
9579            });
9580        });
9581
9582        //분류or상세페이지 -> 로그인 하고 왔을 때 currentUrl값을 세션에 저장된 값으로 바꿔줌
9583        if($('#loginChk_member').length > 0){
9584            var couponInfoCallTemp = sessionStorage.getItem('couponzone_moveback');
9585            if(couponInfoCallTemp){
9586                couponInfoCallTemp = JSON.parse(couponInfoCallTemp);
9587                if(couponInfoCallTemp.ivCouponReturnUrl){
9588                    currentUrl = couponInfoCallTemp.ivCouponReturnUrl;
9589                }
9590            }
9591        }
9592
9593        if(!isMemberPage){
9594            if(currentUrl.indexOf('coupon_param=') > -1){
9595                var couponDownChk = currentUrl.split('coupon_param=')[1];
9596                couponDownChk = couponDownChk.split('coupon_no=')[1];
9597                if(couponDownChk.indexOf('&') > -1){
9598                    couponDownChk = couponDownChk.split('&')[0];
9599                }
9600                if(couponDownChk.indexOf('#') > -1){
9601                    couponDownChk = couponDownChk.split('#')[0];
9602                }
9603
9604                var couponInfoCall = sessionStorage.getItem('couponzone_moveback');
9605                if(couponInfoCall){
9606                    couponInfoCall = JSON.parse(couponInfoCall);
9607                    $('html, body').animate({scrollTop: couponInfoCall.scrollTop}, 300);
9608                    if(couponInfoCall.customChk){
9609                        customMessageChk = true;
9610                        customMessageSuccess = couponInfoCall.customSuccess;
9611                        customMessageFail = couponInfoCall.customFail;
9612                    }
9613                    if(couponInfoCall.ivCouponReturnUrl){
9614                        var couponReturnUrl = couponInfoCall.ivCouponReturnUrl;
9615                        if(couponReturnUrl.indexOf('?coupon_param') > -1){
9616                            couponReturnUrl = couponInfoCall.ivCouponReturnUrl.split('?coupon_param')[0];
9617                        }else if(couponReturnUrl.indexOf('&coupon_param') > -1){
9618                            couponReturnUrl = couponInfoCall.ivCouponReturnUrl.split('&coupon_param')[0];
9619                        }else{
9620                        }
9621                        history.pushState(null, null, couponReturnUrl);
9622                    }
9623                    sessionStorage.removeItem('couponzone_moveback');
9624                }
9625                //쿠폰발급실행 레이어
9626                setTimeout(function(){
9627                    if (typeof(sCouponDownResultUrl) !== 'undefined') {
9628                        sDownloadURL = '/exec/front/newcoupon/IssueDownload';
9629                        aParam = 'coupon_no=' + couponDownChk;
9630                        aParam += '&return_type=json';
9631                        //쿠폰발급 실행
9632                        $.post(sDownloadURL, aParam, function( data ) {
9633                            COUPON.getDownCouponResultForm(data);
9634                        }, 'json');
9635                    } else {
9636                        location.href='/exec/front/newcoupon/IssueDownload?coupon_no='+ couponDownChk +'&opener_url=' ;
9637                    }
9638                },300);
9639            }else{
9640                sessionStorage.removeItem('couponzone_moveback');
9641            }
9642        }
9643
9644    }
9645
9646    $('.coupon_download_all').bind('click', function(e) {
9647        downloadCouponHref = $(this).data('href');
9648        downloadCouponJoin = iv_util.getParameterByName(downloadCouponHref, 'coupon_no');
9649        e.preventDefault();
9650        customMessageChk = false;
9651        customMessageSuccess = '';
9652        customMessageFail = '';
9653        goScrollTop = $(window).scrollTop();
9654        if($('#loginChk_member').length > 0){
9655        	isLogin =  true;
9656            var thisUrl = $(this).data('href');
9657            if(thisUrl.indexOf('opener_url') > -1){
9658            	isLoginOpenerUrl = thisUrl.split('opener_url=')[1];
9659            }
9660        }
9661        
9662        //쿠폰발급실행 레이어
9663        if (typeof(sCouponDownResultUrl) !== 'undefined') {
9664            sDownloadURL = '/exec/front/newcoupon/IssueDownload';
9665            aParam = 'coupon_no=' + downloadCouponJoin;
9666            aParam += '&return_type=json';
9667            //쿠폰발급 실행
9668            $.post(sDownloadURL, aParam, function(data) {
9669                COUPON.getDownCouponResultForm(data);
9670            }, 'json');
9671        } 
9672    });
9673    
9674});
9675
9676
9677var COUPON = {
9678    is_coupon_code_submit: false,
9679    is_coupon_use_submit: false,
9680    viewInfo: function(iCouponNo, oCouponElem)
9681    {
9682        var aPos = EC$(oCouponElem).offset();
9683        var oCoupon = aCouponInfo[iCouponNo];
9684        EC$('#dCouponDetail').remove();
9685        var sHtml = '<div id="dCouponDetail" class="layerTheme"></div>';
9686        EC$('body').append(sHtml);
9687        if (mobileWeb === true) {
9688            try {
9689                EC$('#dCouponDetail').html('<h4><strong>' + __('쿠폰정보') + '</strong></h4>' +
9690                                           '<ul class="couponInfo">' +
9691                                           '<li>' + __('쿠폰명') + ' : ' + decodeURIComponent(oCoupon.coupon_name) + '</li>' +
9692                                           '<li>' + __('적용상품') + ' : ' + decodeURIComponent(oCoupon.coupon_product_info) + '</li>' +
9693                                           '<li>' + __('사용조건') + ' : ' + decodeURIComponent(oCoupon.coupon_usecon) + ' ' + decodeURIComponent(oCoupon.region_delivery_msg) + ' ' + decodeURIComponent(oCoupon.foreign_delivery_msg) + '</li>' +
9694                                           '<li>' + __('발행수량') + ' : ' + decodeURIComponent(oCoupon.coupon_issue) + '</li>' +
9695                                           '<li>' + __('사용기간') + ' : ' + decodeURIComponent(oCoupon.coupon_period_detail) + '</li>' +
9696                                           '</ul>' +
9697                                           '<p class="mButton">' +
9698                                           '<a href="' + oCoupon.coupon_issue_url + '" class="tSubmit1">' + '<span>' + __('다운받기') + '</span></a>' +
9699                                           '<a href="#none" class="tSubmit2" onclick="EC$(\'#dCouponDetail\').remove();">' + '<span>' + __('닫기') + '</span> </a>' +
9700                                           '</p>');
9701            } catch (err) {
9702                EC$('#dCouponDetail').html('<h4><strong>' + __('쿠폰정보') + '</strong></h4>' +
9703                                           '<ul class="couponInfo">' +
9704                                           '<li>' + __('쿠폰명') + ' : ' + oCoupon.coupon_name + '</li>' +
9705                                           '<li>' + __('적용상품') + ' : ' + oCoupon.coupon_product_info + '</li>' +
9706                                           '<li>' + __('사용조건') + ' : ' + oCoupon.coupon_usecon + ' ' + oCoupon.region_delivery_msg + ' ' + oCoupon.foreign_delivery_msg + '</li>' +
9707                                           '<li>' + __('발행수량') + ' : ' + oCoupon.coupon_issue + '</li>' +
9708                                           '<li>' + __('사용기간') + ' : ' + oCoupon.coupon_period_detail + '</li>' +
9709                                           '</ul>' +
9710                                           '<p class="mButton">' +
9711                                           '<a href="' + oCoupon.coupon_issue_url + '" class="tSubmit1">' + '<span>' + __('다운받기') + '</span></a>' +
9712                                           '<a href="#none" class="tSubmit2" onclick="EC$(\'#dCouponDetail\').remove();">' + '<span>' + __('닫기') + '</span> </a>' +
9713                                           '</p>');
9714            }
9715            var iLeft = '-' + EC$('#dCouponDetail').width() / 2 + 'px', iTop = '-' + EC$('#dCouponDetail').height() / 2 + 'px';
9716            EC$('#dCouponDetail').css({top: '50%', left: '50%', position: 'fixed', marginTop: iTop, marginLeft: iLeft});
9717        } else {
9718            try {
9719                EC$('#dCouponDetail').html('<h3 class="title">' + __('쿠폰정보') + '</h3>' +
9720                                           '<a href="#none" onclick="EC$(\'#dCouponDetail\').remove();">' +
9721                                           '<img src="//img.cafe24.com/images/ec_hosting/front/btn_close_003.gif" />' +
9722                                           '</a>' +
9723                                           '<div class="content">' +
9724                                           '<ul>' +
9725                                           '<li><span>' + __('쿠폰명') + ' :</span> ' + decodeURIComponent(oCoupon.coupon_name) + '</li>' +
9726                                           '<li><span>' + __('적용상품') + ' :</span> ' + decodeURIComponent(oCoupon.coupon_product_info) + '</li>' +
9727                                           '<li><span>' + __('사용조건') + ' :</span> ' + decodeURIComponent(oCoupon.coupon_usecon) + ' ' + decodeURIComponent(oCoupon.region_delivery_msg) + ' ' + decodeURIComponent(oCoupon.foreign_delivery_msg) + '</li>' +
9728                                           '<li><span>' + __('발행수량') + ' :</span> ' + decodeURIComponent(oCoupon.coupon_issue) + '</li>' +
9729                                           '<li><span>' + __('사용기간') + ' :</span> ' + decodeURIComponent(oCoupon.coupon_period_detail) + '</li>' +
9730                                           '</ul>' +
9731                                           '<a href="' + oCoupon.coupon_issue_url + '&is_popup=' + '&opener_url=' + document.URL + '">' +
9732                                           '<img src="//img.echosting.cafe24.com/skin/admin_' + SHOP.getLanguage() + '/product/btn_coupon_download.gif" />' +
9733                                           '</a>' +
9734                                           '</div>');
9735            } catch (err) {
9736                EC$('#dCouponDetail').html('<h3 class="title">' + __('쿠폰정보') + '</h3>' +
9737                                           '<a href="#none" onclick="EC$(\'#dCouponDetail\').remove();">' +
9738                                           '<img src="//img.cafe24.com/images/ec_hosting/front/btn_close_003.gif" />' +
9739                                           '</a>' +
9740                                           '<div class="content">' +
9741                                           '<ul>' +
9742                                           '<li><span>' + __('쿠폰명') + ' :</span> ' + oCoupon.coupon_name + '</li>' +
9743                                           '<li><span>' + __('적용상품') + ' :</span> ' + oCoupon.coupon_product_info + '</li>' +
9744                                           '<li><span>' + __('사용조건') + ' :</span> ' + oCoupon.coupon_useco + ' ' + oCoupon.region_delivery_msg + ' ' + oCoupon.foreign_delivery_msg + '</li>' +
9745                                           '<li><span>' + __('발행수량') + ' :</span> ' + oCoupon.coupon_issue + '</li>' +
9746                                           '<li><span>' + __('사용기간') + ' :</span> ' + oCoupon.coupon_period_detail + '</li>' +
9747                                           '</ul>' +
9748                                           '<a href="' + oCoupon.coupon_issue_url + '&is_popup=' + '&opener_url=' + document.URL + '">' +
9749                                           '<img src="//img.echosting.cafe24.com/skin/admin_' + SHOP.getLanguage() + '/product/btn_coupon_download.gif" />' +
9750                                           '</a>' +
9751                                           '</div>');
9752            }
9753
9754            EC$('#dCouponDetail').offset({top: aPos.top+20,left: aPos.left+30});
9755        }
9756    },
9757    useCoupon: function()
9758    {
9759        if (COUPON.is_coupon_use_submit === true) {
9760            setTimeout(alert(__('USE.TRY.IN.FEW.MINUTES', 'NEWCOUPON.FRONT.COUPON.JS')), 3000);
9761            location.reload();
9762            return;
9763        }
9764        var cnt = 0;
9765        for (var i=0;
9765 i<document.frmCouponlist.length; i++) {
9766            if ((document.frmCouponlist.elements[i].type == "checkbox") && (document.frmCouponlist.elements[i].name == "coupon_code[]")) {
9767                if (document.frmCouponlist.elements[i].checked == true)
9768                    cnt = cnt + 1;
9769            }
9770        }
9771        if (cnt < 1) {
9772            alert(__("선택된 쿠폰이 없습니다."));
9773            return false;
9774        }
9775        COUPON.is_coupon_use_submit = true;
9776        document.frmCouponlist.action = '/exec/front/Coupon/Mileage/';
9777        document.frmCouponlist.submit();
9778    },
9779    //쿠폰발급결과 출력
9780    getDownCouponResultForm: function(data)
9781    {	
9782        var total = data['total_list'];
9783        var fullAlert = '';
9784        var downChk = false;
9785        var allowChk = true;
9786        var sContent = "<ul>";
9787        if (typeof(data.message) === 'object') {
9788            EC$.each(data.message, function(key, val) {
9789                var couponName = val.split(']')[0] + '] ';
9790                if(val.indexOf('초과') > -1){
9791                    downChk = true;
9792                    fullAlert = fullAlert + couponName + couponDown_failAlert2 + '\n';
9793                }else if(val.indexOf('불가능') > -1){
9794                    allowChk = false;
9795                    fullAlert = fullAlert + couponName + couponDown_failAlert1 + '\n';
9796                }else if(val.indexOf('로그인 후 이용하실 수 있습니다') > -1){
9797                    fullAlert = fullAlert + couponName + couponDown_failAlert3 + '\n';
9798                    returnUrlChk = data.replace_url;
9799                }else if(val.indexOf('발급 되었습니다') > -1){
9800                }
9801                sContent += '<li>'+val+'</li>';
9802            });
9803        } else {
9804            var couponName = '';
9805            if(data.message.indexOf(']') > -1){
9806                couponName = data.message.split(']')[0] + '] ';
9807            }
9808            if(data.message.indexOf('초과') > -1){
9809                downChk = true;
9810                fullAlert = fullAlert + couponName + couponDown_failAlert2 + '\n';
9811            }else if(data.message.indexOf('불가능') > -1){
9812                allowChk = false;
9813                fullAlert = fullAlert + couponName + couponDown_failAlert1 + '\n';
9814            }else if(data.message.indexOf('로그인 후 이용하실 수 있습니다') > -1){
9815                fullAlert = fullAlert + couponName + couponDown_failAlert3 + '\n';
9816                returnUrlChk = data.replace_url;
9817            }else if(data.message.indexOf('발급 되었습니다') > -1){
9818            }
9819            sContent = '<li>'+data.message+'</li>';
9820        }
9821        sContent += '</ul>';
9822        var iSuccessCnt = 0;
9823        
9824        if (typeof(data['issue_list']) !== 'undefined') {
9825            iSuccessCnt = data['issue_list'].length;
9826        }
9827        var aData = {
9828            'total': total,
9829            'success_cnt': iSuccessCnt,
9830            'content': sContent
9831        };
9832		
9833        EC$.get(sCouponDownResultUrl, aData, function(formData) {
9834            formData = formData.replace(/\{\$total\}/, parseInt(total))
9835                .replace(/\{\$success_cnt\}/, parseInt(iSuccessCnt))
9836                .replace(/\{\$fail_cnt\}/, parseInt(total - iSuccessCnt))
9837                .replace(/\{\$content\}/, sContent);
9838            
9839            
9840            if(customMessageChk){
9841                if(aData.success_cnt > 0){
9842                    alert(customMessageSuccess);
9843                }else{
9844                    if(returnUrlChk != ''){
9845                        //alert(fullAlert);
9846                        alert(couponDown_failAlert3);
9847                        returnUrlChk = decodeURIComponent(returnUrlChk);
9848                        returnUrlChk = '/member/login.html?returnUrl='+windowPathName+'?coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9849                        var couponzone_moveback = {scrollTop: goScrollTop, customChk: customMessageChk, customSuccess: customMessageSuccess, customFail: customMessageFail};
9850                        couponzone_moveback = JSON.stringify(couponzone_moveback);
9851                        sessionStorage.setItem('couponzone_moveback', couponzone_moveback);
9852                        setTimeout(function(){
9853                            window.location.href = returnUrlChk;
9854                        },200);
9855                    }else{
9856                        //alert(fullAlert);
9857                        if(allowChk == false){
9858                            alert(couponDown_failAlert1);
9859                            return false;
9860                        }
9861                        if(downChk){
9862                            alert(customMessageFail);
9863                        }
9864                    }
9865                }
9866                
9867                // 여기서부터가 coupon_download_all 클릭 했을때
9868            }else{
9869                if(aData.success_cnt > 0){
9870                    //발급 성공
9871                    var couponDown_successAlert = aData.success_cnt + '개의 쿠폰이 발급되었습니다.';
9872                    setTimeout(function(){
9873                    	alert(couponDown_successAlert);
9874                        if(isLogin){
9875                        	if(isLoginOpenerUrl){
9876                            	window.location.href = IV_LOCATION_PROTOCOL + "//" + IV_LOCATION_HOSTNAME + isLoginOpenerUrl;;
9877                            }
9878                        }
9879                    }, 300);
9880                }else{
9881                    //발급 실패
9882                    if(returnUrlChk != ''){
9883                        alert(couponDown_failAlert3);
9884                        returnUrlChk = decodeURIComponent(returnUrlChk);
9885                        var couponReturnUrl = '';
9886                        if(downloadCouponHref.indexOf('opener_url=') > -1){
9887                            var openerUrl = downloadCouponHref.split('opener_url=')[1];
9888                            if(openerUrl.indexOf('?') > -1){
9889                            	couponReturnUrl = openerUrl + '&coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9890                            }else{
9891                            	couponReturnUrl = openerUrl + '?' + 'coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9892                            }
9893                        }else{
9894                            if(isMemberPage){
9895                            	couponReturnUrl = '/index.html?coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9896                            }else{
9897                                if(IV_LOCATION_PARAMETERS){
9898                                    couponReturnUrl = IV_LOCATION_PATHNAME + '?' + IV_LOCATION_PARAMETERS + '&coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9899                                }else{
9900                                    couponReturnUrl = IV_LOCATION_PATHNAME + '?coupon_param=/exec/' + returnUrlChk.split('/exec/')[1];
9901                                }
9902                            }
9903                        }
9904                        returnUrlChk = '/member/login.html?returnUrl='+couponReturnUrl;
9905                        
9906                        var couponzone_moveback = {scrollTop: goScrollTop, customChk: customMessageChk, customSuccess: customMessageSuccess, customFail: customMessageFail, ivCouponReturnUrl: couponReturnUrl};
9907                        couponzone_moveback = JSON.stringify(couponzone_moveback);
9908                        sessionStorage.setItem('couponzone_moveback', couponzone_moveback);
9909                        setTimeout(function(){
9910                            window.location.href = returnUrlChk;
9911                        },200);
9912                        //};
9913                    }else{
9914                        if(allowChk == false){
9915                            alert(couponDown_failAlert1);
9916                            return false;
9917                        }
9918                        if(downChk){
9919                            alert(couponDown_failAlert2);
9920                        }
9921                    }
9922                }
9923            }
9924        });
9925    }
9926};
9927
9928//쿠폰 세팅 -------------------------------------------------------------------------------------------------------------------------------------------
9929
9930
9931var couponDown_failAlert1 = '쿠폰 발급이 불가능합니다.'; //다운로드 불가 조건 시 노출될 텍스트 ex 운영자
9932var couponDown_failAlert2 = '쿠폰이 이미 발급되었습니다. 마이페이지에서 확인해주세요.'; //이미 다운로드 받은 경우 노출될 텍스트 ex 동일인 재발급 수량 초과
9933var couponDown_failAlert3 = '로그인 후 이용하실 수 있습니다.'; //비회원일 경우 노출될 텍스트
9934
9935
9936function removeStorage(){
9937    sessionStorage.removeItem("currentLink");
9938    sessionStorage.removeItem("couponReturnLink");
9939}
9940
9941
9942//쿠폰 세팅 -------------------------------------------------------------------------------------------------------------------------------------------
9943/* ================================================================================================================================================================================*/
9944
9945/* 안다르__특정카테고리_쿠폰다운로드_버튼_요청 */
9946
9947/*================================================================================================================================================================================== */
9948
9949/* ↓↓↓↓↓ 건드리지 마세요!!! ---------------------------------------------------------------------- */
9950
9951var this_Url = window.location.href; // 현재 URL 값 구하기
9952var cate_Url = getCateParam("cate_no", this_Url); // cate_no= 뒷부분만 구하기
9953
9954/* ↑↑↑↑↑ 건드리지 마세요!!! ---------------------------------------------------------------------- */
9955
9956/* ================================================================================================================================================================================*/
9957
9958/* 2022-04-14 GNB 카테고리 개편 작업 */
9959
9960/*================================================================================================================================================================================== */
9961
9962var find_leggings_link = "/product/list.html?cate_no=2030"; // 내게 맞는 레깅스 찾기 - 연결할 링크 입력
9963var find_sports_link = "/product/list.html?cate_no=2036"; // 내게 맞는 조거팬츠 찾기 - 연결할 링크 입력
9964
9965var find_leggings_visible = "off"; // "내게 맞는 레깅스 찾기" 카드 노출 여부 - on, off 로 구분
9966var find_sports_visible = "off"; // "내게 맞는 조거팬츠 찾기" 카드 노출 여부 - on, off 로 구분
9967
9968// 레깅스 가이드 - 노출시키고 싶은 카테고리 넘버 양식과 동일하게 입력
9969var leggings_guide = [""]; // 일상/요가 -> 맨즈 슬랙스 영역에 노출되도록 변경 221104
9970var leggings_guide02 = [""]; // 요가/필라테스/피트니스
9971var leggings_guide03 = [""]; // 피트니스/고강도
9972var leggings_guide04 = [""]; // 조거팬츠
9973var leggings_guide05 = [""]; // 우먼즈 > 레깅스 카테고리
9974
9975// 컬러 변경할 카테고리 표시
9976var point_color_cate = ["2135"]; // 컬러 변경할 카테고리 넘버 입력
9977
9978// 브래드크럼 제거
9979//var no_breadcrumb = ["2030", "2043"];
9980
9981// #227 [공통] 가이드 영역 추가 문의 - 가이드배너 세팅 스크립트 제거
9982
9983// 순서 딱지 적용할 카테고리 넘버를 기입해주세요.
9984// var listBadgeArr = ["2017","2018","2022","2026","2019","2020","2021","2023","2024","2025","2578","2084","2088","2093"];
9985var listBadgeArr = [
9986  "2017",
9987  "2018",
9988  "2022",
9989  "2026",
9990  "2019",
9991  "2020",
9992  "2021",
9993  "2023",
9994  "2024",
9995  "2025",
9996  "2578",
9997  "2084",
9998  "2088",
9999  "2093",
10000  "3512",
10001  "3514",
10002];
10003
10004/* #267 - 카테고리 페이지 영역 추가 240507 */
10005// 카테고리 영상 배너 미노출 카테고리 지정
10006var IVHideCateBanner = [
10007  "2031",
10008  "2042",
10009  "2912",
10010  "2462",
10011  "2036",
10012  "2066",
10013  "2200",
10014  "2484",
10015  "2582",
10016  "2581",
10017  "2583",
10018  "2067",
10019  "2481",
10020  "2482",
10021  "2911",
10022  "2069",
10023  "2071",
10024  "2072",
10025  "2533",
10026  "2512",
10027  "2604",
10028  "2090",
10029  "2089",
10030  "2553",
10031  "2091",
10032  "2094",
10033  "2541",
10034  "2556",
10035  "2584",
10036  "2585",
10037  "2557",
10038  "2542",
10039  "2630",
10040  "2629",
10041  "2628",
10042  "2627",
10043  "2777",
10044  "3020",
10045  "2073",
10046  "2074",
10047  "2075",
10048  "2850",
10049  "2534",
10050  "2535",
10051  "2536",
10052  "2077",
10053  "2830",
10054  "2831",
10055  "2832",
10056  "2833",
10057  "2638",
10058  "2675",
10059  "2834",
10060  "2677",
10061  "2107",
10062  "2403",
10063  "2108",
10064  "2109",
10065  "2393",
10066  "2110",
10067  "2777",
10068  "2782",
10069  "2656",
10070  "2293",
10071  "2111",
10072  "2112",
10073  "2113",
10074  "2114",
10075  "2115",
10076  "2116",
10077  "2944",
10078  "2945",
10079  "2946",
10080  "2950",
10081  "2953",
10082  "2956",
10083  "2959",
10084  "2947",
10085  "2948",
10086  "2949",
10087  "2951",
10088  "2952",
10089  "2954",
10090  "2955",
10091  "2957",
10092  "2958",
10093  "2960",
10094  "2983",
10095  "2941",
10096  "2818",
10097  "2888",
10098  "2973",
10099  "2889",
10100  "2977",
10101  "2974",
10102  "2887",
10103  "2896",
10104  "2531",
10105  "2610",
10106  "3026",
10107  "3027",
10108  "3028",
10109  "3029",
10110  "2594",
10111  "2595",
10112  "2596",
10113  "2597",
10114  "2598",
10115  "2599",
10116  "2600",
10117  "2986",
10118  "2993",
10119  "2984",
10120  "2999",
10121  "3000",
10122  "3001",
10123  "2272",
10124  "2273",
10125  "2274",
10126  "2275",
10127  "3006",
10128  "3007",
10129  "3012",
10130  "3015",
10131  "2867",
10132  "3018",
10133  "3019",
10134  "2784",
10135  "2785",
10136  "2786",
10137  "2788",
10138  "3021",
10139  "3013",
10140  "3014",
10141  "2650",
10142  "2068",
10143  "2070",
10144  "2076",
10145  "2078",
10146  "2480",
10147  "2180",
10148  "2182",
10149  "2829",
10150  "2468",
10151  "2469",
10152  "2470",
10153  "2511",
10154  "2524",
10155  "2661",
10156  "2037",
10157  "2038",
10158  "2039",
10159  "2040",
10160  "2119",
10161  "2120",
10162  "2121",
10163  "2081",
10164  "2082",
10165  "2083",
10166  "2085",
10167  "2086",
10168  "2087",
10169  "2835",
10170  "2836",
10171  "2837",
10172  "2982",
10173  "2527",
10174  "2543",
10175  "2575",
10176  "2544",
10177  "2572",
10178  "2574",
10179  "2573",
10180  "2100",
10181  "2101",
10182  "2103",
10183  "2105",
10184  "2104",
10185  "2102",
10186  "2043",
10187  "2530",
10188  "2838",
10189  "2839",
10190  "2840",
10191  "2044",
10192  "2852",
10193  "2841",
10194  "2054",
10195  "2842",
10196  "2049",
10197  "2843",
10198  "2844",
10199  "2845",
10200  "2846",
10201  "2847",
10202];
10203
10204// 주문서 작성 페이지 디폴트 결제수단 설정 변수
10205
10206var DEFAULT_PAY_METHOD = "kakaopay";
10207// 디폴트 변경 예시
10208// var DEFAULT_PAY_METHOD = "kakaopay";
10209
10210/* 디폴트 결제수단 변경시 원하는 결제수단 복사하여 위 예시와 같이 입력해주세요
10211 * 무통장: icash
10212 * 카드: card
10213 * 카카오페이: kakaohttps://www.teamblind.com/kr/post/%EC%B6%9C%EA%B7%BC%EA%B8%B8%EC%97%90-%EC%83%88%EB%98%A5%EB%A7%9E%EC%9C%BC%EB%A9%B4-RmJ3jCBspay
10214 * 네이버페이: naverpay
10215 * 핸드폰: cell
10216 * 토스: toss
10217 * 페이코: payco
10218 */
10219
10220$(window).load(function(){    
10221    
10222    var Main_length = $("#main").length; // 메인페이지 구분용
10223    //var Main_length = $("#resultKakao").length; // ★★ 임시확인용 ★★
10224    
10225    var memberLogOn = $("#memberLogOn").length; // 로그인 여부, 카카오인지도 확인 필요
10226    var mySession; // 세션스토리지 member_1 전체값 구하기  
10227    var complete_Coupon; // 쿠폰 전체 발급이후 alert 노출을 위한 전역변수 선언.
10228        
10229    var my_User_Id; // 아이디값 구하기 ( $("#sf_user_name") 텍스트값 못불러오는 현상 있어 전역변수 설정이후 JSON으로 데이터 추출 )
10230    var my_Group_Id; // 그룹네임값 구하기 ( $("#sf_Group_name") 텍스트값 못불러오는 현상 있어 전역변수 설정이후 JSON으로 데이터 추출 )
10231    var my_Member_Id; // 네임값 구하기 ( $("#sf_member_name") 텍스트값 못불러오는 현상 있어 전역변수 설정이후 JSON으로 데이터 추출 )
10232        
10233    var result_Date; // 회원가입일 = created_date; // 전역변수 사용위해 따로 빼놓음.
10234    var current_Date; // 현재 yyyymmdd; //전역변수 사용위해 따로 빼놓음.
10235       
10236    
10237    function add_Coupon(){
10238        if ( memberLogOn > 0 ){
10239            if ( mySession == undefined ){
10240                mySession = CAPP_ASYNC_METHODS.member;
10241                setTimeout(add_Coupon, 500);
10242            }
10243            else if ( mySession != undefined ){
10244                
10245                my_User_Id = mySession.__sMemberId; // user_id 추출 - ex) ivtest30
10246                my_Group_Id = mySession.__sGroupName; // group_id 추출 - ex) 일반회원
10247                my_Member_Id = mySession.__sName; // member_id 추출 - ex) 테스트30          
10248                
10249                var kakao_id = my_User_Id.indexOf("@k"); // 아이디에 ivtest가 들어가는지 확인 (임시) = 카카오계정 (@k)가 들어가는지 확인
10250                              
10251                // ※※※※※※※※※※※※※※※※※※※※※※※ 계정생성일, 현재날짜 구하기 ※※※※※※※※※※※※※※※※※※※※※※※
10252                
10253                var created_data = mySession.__sCreatedDate; // 계정생성일만 추출
10254                var date_indexOf = created_data.indexOf(" "); // 공백부분 기준잡기 ( 가입시간, 분, 초는 상관없기에. )
10255                var slice_Date = created_data.slice("0", date_indexOf); // 공백부분 기준으로 앞부분 추출 ( yyyy-mm-dd )
10256                
10257                result_Date = Number(slice_Date.replace(/[-]/g, "")); // "-" 제외한 숫자만 남기기, 회원가입일 = created_date;
10258                
10259
10260                // 현재 날짜 구하기
10261                var date = new Date(); // 날짜 추출
10262                var current_year = date.getFullYear().toString(); // 년도 구하기
10263
10264                var current_month = date.getMonth() + 1; // 월 구하기, 10보다 낮을경우 앞에 0 붙이기, 아닐경우 그냥 리턴
10265                current_month = current_month < 10 ? '0' + current_month.toString() : current_month.toString();
10266
10267                var current_day = date.getDate(); // 일 구하기, 10보다 낮을경우 앞에 0 붙이기, 아닐경우 그냥 리턴
10268                current_day = current_day < 10 ? '0' + current_day.toString() : current_day.toString();
10269
10270                current_Date = Number(current_year+current_month+current_day); // 현재 yyyymmdd;
10271                var current_Date_prev = Number(current_year+current_month+(current_day-1)); // 이전날자 구하기
10272                
10273                var date_indexOf2 = created_data.indexOf("."); // 가입일자 초 소수점 단위 기준잡기
10274                var slice_Date2 = created_data.slice("0", date_indexOf2); // 소수점 까지 제거
10275                var split_Date = slice_Date2.split(" ")[1]; // 공백 기준 뒷부분만 남기기(시, 분, 초 만 남기기)
10276                var replace_Date = Number(split_Date.replace(/:/g,"")); // 시, 분, 초의 " : " 내용 제거
10277                
10278                // ※※※※※※※※※※※※※※※※※※※※※※※ 계정생성일, 현재날짜 구하기 ※※※※※※※※※※※※※※※※※※※※※※※
10279                
10280            }
10281            else { setTimeout(add_Coupon, 500); }
10282        }
10283        
10284        
10285        if( kakao_id > -1 && result_Date == current_Date ) {
10286        	make_Coupon();  // make_Coupon 실행 ↓
10287        }
10288        else if ( kakao_id > -1 && replace_Date > 235000 && current_Date_prev == result_Date ) {
10289        	make_Coupon();  // make_Coupon 실행 ↓
10290        }
10291    }
10292    var isJoinKakao = sessionStorage.getItem('isJoinKakao');
10293    if(!!isJoinKakao) {        
10294    	add_Coupon(); // 쿠폰발급 함수 실행.
10295    }
10296    
10297    function make_Coupon(){
10298        var couponNumber = $('.kakao_join_coupon div').attr('data-kakao-coupon');        
10299        if( couponNumber.indexOf(',') > -1 ){
10300            //복수쿠폰
10301            couponNumber = couponNumber.split(',');
10302        } else {
10303            //단일쿠폰
10304            couponNumber = Array(couponNumber);
10305        };
10306        
10307    	var get_Coupon_leng = couponNumber.length; // 쿠폰 개수
10308        var complete_Num = 0; // 쿠폰 정상적으로 돌았다면 alert 띄우기
10309        var fail_coupon = false; // 중복일경우 값 변경을 위한 변수
10310        var title_Array = []; // 쿠폰명 저장을 위한 배열 생성
10311            
10312        
10313        for (var i = 0; i < get_Coupon_leng; i++){
10314            var coupon_link = "/exec/front/newcoupon/IssueDownload?coupon_no="+couponNumber[i]; // 쿠폰 뿌려주기 위한 넘버값
10315            $.ajax({
10316                url: "/exec/front/newcoupon/IssueDownload?coupon_no="+couponNumber[i],
10317                type: 'GET',
10318                dataType: 'html',
10319                async: false,
10320                success: function (html) {
10321                    var dup_Coupon_text = $(html).text().trim(); // 쿠폰 발급 페이지 내 텍스트 추출
10322                    var dup_Coupon = dup_Coupon_text.indexOf("재발급"); // "재발급" 글자가 있는지 확인
10323                    var none_Coupon = dup_Coupon_text.indexOf("불가능"); // "불가능" 글자가 있는지 확인
10324                    var gm_Coupon = dup_Coupon_text.indexOf("운영자"); // "운영자" 글자가 있는지 확인
10325                    var full_Coupon = dup_Coupon_text.indexOf("초과"); // "초과" 글자가 있는지 확인
10326                    var login_Coupon = dup_Coupon_text.indexOf("로그인");
10327                    
10328                    var replace_dup = dup_Coupon_text.split("\\n").join("<br/>"); // 개행문자 <br/>로 치환하기
10329                    var title_01 = replace_dup.indexOf("<br/>"); // 첫번째 <br/> 체크 = 쿠폰명 이후에 바로 나오는 <br/>
10330                    var title_02 = replace_dup.indexOf("["); // alert 텍스트 제거 위한 구분값
10331                    
10332                    var title_slice = dup_Coupon_text.slice(0, title_01); // 타이틀 부분만 남기기
10333                    var title_result = title_slice.slice(title_02, -1); // 앞의 alert 부분 제거하기
10334					
10335                    // 재발급이거나, 쿠폰이 없거나(발급기한 지난경우, 발급불가인 경우), 운영자이거나, 쿠폰개수를 초과했을 경우
10336                    if ( dup_Coupon > -1 || none_Coupon > -1 || gm_Coupon > -1 || full_Coupon > -1 ){
10337                        fail_coupon = true;
10338                        //return false;
10339                    } else {
10340                        complete_Num = complete_Num + 1;
10341                        title_Array.push(title_result+" 가 발급되었습니다.\n"); // 단일 쿠폰 발급 성공 알럿 메세지
10342                    }
10343                    sessionStorage.removeItem('isJoinKakao');
10344                }, // success
10345            }); // ajax
10346        } // 반복문
10347        
10348        if(complete_Num == 0 && fail_coupon) { // 발급된 쿠폰이 없을때
10349            removeStorage();
10350        } else if(complete_Num > 0) { // 발급된 쿠폰이 있음
10351            if(get_Coupon_leng > 1) { // 복수 쿠폰
10352                removeStorage();
10353                alert( '카카오 가입 쿠폰 : '+ complete_Num + '개의 쿠폰이 발급되었습니다.');
10354            } else if(get_Coupon_leng == 1) { // 단일 쿠폰
10355                removeStorage();
10356                alert(title_Array.join(""));
10357            }
10358        }
10359        
10360    } // make_Coupon ↑위에서 실행                    
10361
10362    // kakao싱크 회원가입 분기 처리 위한 변수
10363	var Kakao_length = $("#resultKakao").length;
10364    //var Kakao_length = $("#mypage").length; //★★ 임시확인용 ★★
10365    
10366    if( Kakao_length > 0 ){
10367        
10368        function my_mem_Id(){
10369        	if( my_Member_Id == undefined ){
10370            	setTimeout(my_mem_Id, 500);
10371            }
10372            else {
10373            	$(".kakao_name").text(my_Member_Id); // 이름값에 "member_1"에서 추출한 name값 넣기
10374            }
10375        }
10376        my_mem_Id();
10377        
10378        // 메인페이지에서 쿠폰 발급을 받았다면 alert띄운 후 막기.
10379        // 메인에서 쿠폰 유,무를 가리기 때문에 더이상 뜰일 없음..?
10380        var get_Complete_Coupon = sessionStorage.getItem("complete_Coupon");
10381        
10382        
10383        var $thisUrl = window.location.href; // 현재 Url 값 저장 = 의미없음.
10384            
10385    } // if(Kakao_length > 0)
10386}); // $(document).ready();
10387
10388function removeStorage(){
10389    sessionStorage.removeItem("currentLink");
10390    sessionStorage.removeItem("couponReturnLink");
10391}
10392$(document).ready(function () {
10393  // gnb, 햄버거 메뉴 생성
10394  getCateData();
10395
10396  /* ================================================================================================================================================================================*/
10397
10398  /* 2022-02 가이드 배너 */
10399
10400  /*================================================================================================================================================================================== */
10401
10402  // #227 [공통] 가이드 영역 추가 문의 - 가이드배너 관련 스크립트 제거
10403  // waitForScript(innerviewBanner);
10404  var $stepBanners = $(".step_banner");
10405  
10406  $stepBanners.each(function () {
10407    var $this = $(this);
10408    var guide_length = $this.find(".common_li").length;
10409    var guide_cont_length = $this.find(".guide_cont").length;
10410  
10411    if (guide_cont_length >= 1) {
10412      $(".cntbody").addClass("w100");
10413      $this.removeClass("displaynone");
10414  
10415      var guideBnOptions;
10416  
10417      if (guide_length >= 1) {
10418        if (guide_length <= 5) {
10419          guideBnOptions = {
10420            slidesPerView: 6.2,
10421            spaceBetween: 12,
10422            observeParents: true,
10423            touchRatio: 0,
10424            on: {
10425              slideChange: function () {
10426                var swiper_begining = this.isBeginning;
10427                var swiper_end = this.isEnd;
10428  
10429                if (swiper_begining == true) {
10430                  $this.find(".guide_area").removeClass("l_shadow");
10431                } else {
10432                  $this.find(".guide_area").addClass("l_shadow");
10433                }
10434  
10435                if (swiper_end == true) {
10436                  $this.find(".guide_area").removeClass("r_shadow");
10437                } else {
10438                  $this.find(".guide_area").addClass("r_shadow");
10439                }
10440              },
10441            },
10442          };
10443        } else if (guide_length > 5) {
10444          $this.find(".guide_area").addClass("r_shadow");
10445  
10446          guideBnOptions = {
10447            slidesPerView: 6.2,
10448            spaceBetween: 12,
10449            observeParents: true,
10450            on: {
10451              slideChange: function () {
10452                var swiper_begining = this.isBeginning;
10453                var swiper_end = this.isEnd;
10454  
10455                if (swiper_begining == true) {
10456                  $this.find(".guide_area").removeClass("l_shadow");
10457                } else {
10458                  $this.find(".guide_area").addClass("l_shadow");
10459                }
10460  
10461                if (swiper_end == true) {
10462                  $this.find(".guide_area").removeClass("r_shadow");
10463                } else {
10464                  $this.find(".guide_area").addClass("r_shadow");
10465                }
10466              },
10467            },
10468          };
10469        }
10470  
10471        var guide_swiepr = new Swiper($this.find(".guide_cont")[0], guideBnOptions);
10472      }
10473    }
10474  });
10475  
10476  // step_banner가 전부 displaynone이면 부모 remove
10477  if ($stepBanners.length === $stepBanners.filter(".displaynone").length) {
10478    $stepBanners.parent().remove();
10479  }
10480}); // $(document).ready
10481
10482// function innerviewBanner() {
10483// }
10484
10485// 전체 카테고리 api 호출
10486function getCateData() {
10487  $.ajax({
10488    // 테섭
10489    //url: "https://andarcate.innerviewit.co.kr/api/list",
10490    url: "https://andarcate.co.kr/api/list",
10491    type: "GET",
10492    dataType: "JSON",
10493    success: function (data) {
10494      var data;
10495      let dataList;
10496      let defaultColor;
10497      if (IV_LOCATION_PATHNAME !== "/myshop/giftcard/list.html") {
10498        data = JSON.parse(data);
10499      }
10500
10501      dataList = data.list;
10502      defaultColor = data.defaultColor;
10503
10504      let gnb = EC$("#gnb");
10505      let allMenu = EC$("#all-menu");
10506
10507      let { border, createdAt, id, marker, text, updatedAt } = defaultColor?.[0] || {};
10508
10509      // gnb에 생성
10510      /*
10511        createMenu(데이터, 메뉴 추가될 영역, 뎁스, 뎁스);
10512      */
10513      createMenu(dataList, gnb, 1, 2, "gnb");
10514
10515      // 전체메뉴 좌측  depth1
10516      createMenu(dataList, allMenu.find(".first-depth"), 1, 1);
10517
10518      createSelectSubCate(dataList, 0);
10519
10520      allMenu.on("mouseenter", ".depth1 > li > a", function (e) {
10521        e.preventDefault();
10522        let idx = $(this).parent().index();
10523        createSelectSubCate(dataList, idx);
10524        allMenu.removeClass("fullHeight");
10525
10526        if (allMenu.outerHeight() > 674) {
10527          allMenu.addClass("fullHeight");
10528        }
10529      });
10530
10531      if (gnb.find(".is-img").length) {
10532        gnb.addClass("is-img");
10533      }
10534
10535      $(".header .dot").css({
10536        background: marker,
10537      });
10538    },
10539    complete: function (data) {}, // complete
10540  });
10541}
10542
10543function createMenu(menuData, targetElement, depthNum, maxDepth, type) {
10544  return new Promise((resolve, reject) => {
10545    // 메뉴 생성 코드
10546    let depth1Empty = $(`<ul class="depth${depthNum}"></ul>`);
10547    let cateSub;
10548    menuData.forEach(function (cate) {
10549      if (type == "gnb") {
10550        if (!cate.gnb) {
10551          return;
10552        } else {
10553          cateSub = cate.sub;
10554        }
10555      } else {
10556        cateSub = cate.sub;
10557      }
10558
10559      depth1Empty.append(`${createCateItem(cate)}`);
10560
10561      if (maxDepth == 2) {
10562        let depth2Empty = $(`<ul class="depth${depthNum + 1}"></ul>`);
10563
10564        let UseAll = cate.use_all;
10565        if (UseAll) {
10566          depth2Empty.append(
10567            `${createCateItem({
10568              id: cate.id,
10569              link: cate.link,
10570              order: cate.order,
10571              title: "전체",
10572              type: cate.type,
10573            })}`
10574          );
10575        }
10576
10577        cateSub.forEach((cate) => {
10578          depth2Empty.append(`${createCateItem(cate)}`);
10579          depth1Empty.children().each(function () {
10580            $(this).append(depth2Empty);
10581          });
10582        });
10583      }
10584    });
10585    targetElement.find(".depth2").remove(); // .depth2 요소만 제거
10586    targetElement.append(depth1Empty);
10587    resolve(); // 생성 완료 후 Promise 완료
10588  });
10589}
10590
10591function createSelectSubCate(data, index) {
10592  let cateItem = data[index];
10593
10594  let id = cateItem.id;
10595  let type = cateItem.type;
10596  let cateSub = cateItem.sub;
10597  let allMenu = $("#all-menu");
10598  let actionMenu = $(".action-menu");
10599  let showAll = actionMenu.find(".show-all");
10600
10601  showAll.find("a").attr("href", cateItem.link ? cateItem.link : cateLink(id, type));
10602  showAll.find(".cateTitle").text(cateItem.new_title || cateItem.title);
10603
10604  createMenu(cateSub, actionMenu, 2, 2).then(() => {
10605    allMenu.find(".depth1 > li").removeClass("is-active").eq(index).addClass("is-active");
10606
10607    let items = allMenu.find(".depth2 > li");
10608    let columns = 6;
10609    let lastRowStartIndex = Math.floor((items.length - 1) / columns) * columns;
10610
10611    items.slice(lastRowStartIndex).addClass("last-row");
10612  });
10613}
10614
10615function createCateItem(cate) {
10616  let title = cate.new_title || cate.title;
10617  let id = cate.id;
10618  let type = cate.type;
10619  let useMarker = cate.use_marker;
10620  let titleColor = cate.title_color;
10621  let titleColorStyle = titleColor || "";
10622
10623  let gnbImage = cate.gnb_image;
10624
10625  let href = cate.link;
10626  if (!href) {
10627    href = cateLink(id, type);
10628  }
10629  let relAttr = title === "아울렛" ? ' rel="nosublink"' : '';
10630  return `
10631    <li class="${gnbImage ? "is-img" : ""}" data-cate="${id}">
10632      <a href="${href}" style="color:${titleColorStyle};"${relAttr}>
10633        ${gnbImage ? `<img src="${gnbImage}" alt=${title} />` : title}
10634        ${useMarker ? `<span class="dot"></span>` : ""}
10635      </a>
10636    </li>
10637  `;
10638}
10639
10640function cateLink(id, type) {
10641  const hrefMap = {
10642    category: `/product/list.html?cate_no=${id}`,
10643    board: `/board/product/list2.html?board_no=${id}`,
10644    gallery: `/board/gallery/list2.html?board_no=${id}`,
10645  };
10646
10647  return hrefMap[type] || "";
10648}
10649
10650$(document).ready(function () {
10651  // 각 등급별 객체 생성
10652  const grades = [
10653    { gradeName: "VIP", discountRate: 0.95 }, //5%할인
10654    { gradeName: "대표", discountRate: 0.5 }, //50%할인
10655    { gradeName: "ANDAR PARTNERSHIP", discountRate: 0.6 }, // 40% 할인
10656    { gradeName: "Department BUSINESS", discountRate: 0.6 }, // 40% 할인
10657    // {gradeName: "TEACHER", discountRate: 0.9}, // 10% 할인
10658    // {gradeName: "BUSINESS", discountRate: 0.7}, //30% 할인
10659    { gradeName: "ATHLETE LEADER", discountRate: 0.7 }, //30% 할인
10660    { gradeName: "PARTNER", discountRate: 0.8 }, // 20% 할인
10661    { gradeName: "Ambassador", discountRate: 0.6 }, // 40% 할인
10662    { gradeName: "CREW", discountRate: 0.7 }, // 30% 할인
10663    { gradeName: "ALLIANCE", discountRate: 0.65 }, //35% 할인
10664    { gradeName: "테스트용01", discountRate: 0.7 }, //30% 할인
10665  ];
10666  // const BASE_URL = "https://search-demo.corca.dev/";
10667  const BASE_URL = "https://api.dalpha.so/";
10668
10669  let customer_id = "";
10670  let groupName = "";
10671
10672  function getQueryParam(paramName) {
10673    const queryString = window.location.search.substring(1); // '?' 제거
10674    const params = queryString.split("&"); // '&'로 분리하여 각 파라미터 처리
10675
10676    for (let param of params) {
10677      const [key, value] = param.split("="); // '='로 key와 value 분리
10678      if (key === paramName) {
10679        // '+'를 공백으로 복원하고 디코딩
10680        return decodeURIComponent(value.replace(/\+/g, " "));
10681      }
10682    }
10683    return null; // 파라미터가 없으면 null 반환
10684  }
10685
10686  // 'keyword' 파라미터 값 가져오기
10687  const keyword = getQueryParam("keyword");
10688  let $header = EC$(".header");
10689  let searchBtn = $header.find(".search-button");
10690  let searchModal = EC$(".search-modal");
10691  let searchResult = EC$("#search_result");
10692  let searchInput = searchModal.find("#search-input");
10693  let searchDelete = searchModal.find(".search-delete");
10694  let searchModalcloseBtn = searchModal.find(".close-btn");
10695  let searchForm = EC$("#search-form");
10696  let fabriProduct = searchResult.find(".fabri-product");
10697  let fabricBnr = searchResult.find(".fabric-bnr");
10698  let fabricNotBnr = searchResult.find(".fabric-not-bnr");
10699  let searchFnEle = searchResult.find(".search-fn");
10700  let searchProduct = searchResult.find(".search-product");
10701  let autoComplete = searchModal.find(".autoComplete");
10702  let relatedKeywordsResult = searchResult.find(".related-keywords");
10703  let propose = searchResult.find(".propose");
10704  let prdBasic = searchResult.find(".prd_basic");
10705
10706  let discountRates = 0;
10707
10708  let autoCompleteOff = $(`[data-type="autoComplete-off"]`);
10709
10710  // pladeholder 설정
10711  let hiddenPlaceholder = $(".hidden-placeholder");
10712  let hiddenPlaceholderLi = hiddenPlaceholder.find("li");
10713  let hiddenPlaceholderText = hiddenPlaceholderLi.eq(0).text();
10714  let hiddenPlaceholderHref = hiddenPlaceholderLi.eq(1).text();
10715  searchInput.attr("placeholder", hiddenPlaceholderText);
10716
10717  searchForm.on("submit", function (e) {
10718    e.preventDefault();
10719    let searchInput = EC$("#search-input");
10720    let keyword = searchInput.val();
10721    if (!keyword) {
10722      location.href = hiddenPlaceholderHref;
10723      return false;
10724    } else {
10725      let queryId = window["dts"].trackSearch({
10726        keyword,
10727        variant: "A",
10728      });
10729
10730      sessionStorage.setItem("queryId", queryId);
10731      const encodedKeyword = encodeURIComponent(keyword);
10732      const hasSkinPath = location.pathname.includes(`/skin-${CAFE24.SKIN_CODE}`);
10733      const categoryBaseUrl = hasSkinPath
10734        ? `/skin-${CAFE24.SKIN_CODE}/product/search.html?keyword=${encodedKeyword}&order_by=favor`
10735        : `/product/search.html?keyword=${encodedKeyword}&order_by=favor`;
10736      window.location.href = categoryBaseUrl;
10737      return true; // 폼 제출 허용
10738    }
10739  });
10740
10741  EC$(document).on("click", ".common_prd_list a", function (e) {
10742    let id = $(this).closest("li").data("id");
10743    let idx = $(this).closest("li").index();
10744    let queryId = sessionStorage.getItem("queryId");
10745    window["dts"].trackClickItem({
10746      queryId,
10747      itemId: id,
10748      index: idx,
10749    });
10750  });
10751
10752  var aData = CAPP_ASYNC_METHODS.aDatasetList.join(",");
10753  var sPathRole = "&path_role=" + CAPP_ASYNC_METHODS.EC_PATH_ROLE;
10754  var sEcMobile = "&EC_MOBILE=" + EC_MOBILE;
10755
10756  EC$.ajax({
10757    url: "/exec/front/manage/async?module=" + aData + sPathRole + sEcMobile,
10758    dataType: "json",
10759    success: function (aData) {
10760      let member = aData?.member?.memberData;
10761      if (member.id) {
10762        customer_id = member.id;
10763        groupName = member.group_name;
10764      }
10765      searchFn();
10766      // waitForScript(searchFn);
10767    },
10768  });
10769  
10770  searchBtn.on("click", function () {
10771    searchModal.addClass("is-active");
10772    $("body").addClass("scrollNo");
10773    searchInput.focus();
10774    $('.all-menu-button').removeClass('is-active');
10775    $('.all-menu').removeClass('is-active');
10776    $('.header-dim').removeClass("is-active");
10777  });
10778  function searchFn() {
10779    console.log("searchFn")
10780    // 등급별 할인율
10781    discountRates = getDiscountRate(groupName) ?? 1;
10782
10783    searchInput.val("");
10784    if (keyword) {
10785      let orderBy = getQueryParam("order_by");
10786      productSearchAPI(keyword, orderBy);
10787      $(".search-text .title").html(`<span class="search-word">${keyword}</span> 검색중`)
10788    }
10789
10790    recentAPI(keyword, "recent-keywords");
10791    popularAPI("popular-keywords");
10792
10793    searchModalcloseBtn.find("button").on("click", function () {
10794      searchModal.removeClass("is-active");
10795      $("body").removeClass("scrollNo");
10796      searchInput.val("").trigger("input");
10797    });
10798
10799    // 검색어 삭제
10800    searchDelete.on("click", function () {
10801      searchInput.val("");
10802      searchInput.trigger("input");
10803      searchInput.focus();
10804      searchDelete.removeClass("is-active");
10805    });
10806
10807    // 디바운스 함수 정의
10808    function debounce(func, delay) {
10809      let timeout;
10810      return function (...args) {
10811        clearTimeout(timeout);
10812        timeout = setTimeout(() => func.apply(this, args), delay);
10813      };
10814    }
10815
10816    // autoCompleate 호출을 디바운스로 감싸기
10817    const debouncedAutoCompleate = debounce(autoCompleate, 100);
10818
10819    searchInput.on("input", function () {
10820      let val = $(this).val();
10821
10822      if (val != "") {
10823        searchDelete.addClass("is-active");
10824        autoComplete.addClass("is-active");
10825        autoCompleteOff.addClass("hide");
10826        // 디바운스된 autoCompleate 호출
10827        debouncedAutoCompleate(val);
10828      } else {
10829        searchDelete.removeClass("is-active");
10830        autoComplete.removeClass("is-active");
10831        autoCompleteOff.removeClass("hide");
10832      }
10833    });
10834
10835    // // 겁색 팝업 원단별 탐색 배너 클릭
10836    searchForm.on("click", ".fabric-bnr a", function (e) {
10837      e.preventDefault();
10838      const keyword = $(this).closest(".slide-ivBanner").find(".guide_cont_desc").text().trim();
10839      handleSearchLinkClick(keyword);
10840    });
10841
10842    // 원단 더보기 버튼 클릭
10843    fabriProduct.on("click", ".more a, .all-view", function (e) {
10844      e.preventDefault();
10845      const keyword = $(this).data("keyword");
10846      handleSearchLinkClick(keyword);
10847    });
10848  } // searchFn END
10849
10850  // gradeName으로 discountRate 찾기 함수
10851  function getDiscountRate(gradeName) {
10852    const grade = grades.find((grade) => grade.gradeName?.trim() === gradeName?.trim());
10853    return grade ? grade.discountRate : null; // 찾으면 할인율 반환, 없으면 null
10854  }
10855
10856  // 인기 검색 API
10857  async function popularAPI(containerSelector) {
10858    // 오늘 날짜를 기준으로
10859    const today = new Date();
10860
10861    // 3일 전 날짜 계산
10862    const threeDaysAgo = new Date();
10863    threeDaysAgo.setDate(today.getDate() - 3);
10864
10865    // ISO 형식 (예: 2025-10-27T10:00:00)으로 포맷
10866    const startDate = threeDaysAgo.toISOString().split(".")[0]; // 'Z' 제거용
10867    const endDate = today.toISOString().split(".")[0];
10868    const API_URL = `/partner-v2/stats/inference/andar-text-search/andar/ranking?startDate=${encodeURIComponent(
10869      startDate,
10870    )}&endDate=${encodeURIComponent(endDate)}&limit=6`;
10871    const response = await fetch(getEndpoint(API_URL), {
10872      method: "GET",
10873      headers: {
10874        "Content-Type": "application/json",
10875        "x-api-key": "5e873ebd-a0fd-4f5d-8cb4-5e993e097a5c",
10876      },
10877    });
10878
10879    let data = await response.json();
10880
10881    let keywords = data.ranking || [];
10882    // keyword만 추출
10883    let keywordList = keywords.map((item) => item.keyword);
10884
10885    // 공통 함수 호출
10886    renderKeywords(keywordList, containerSelector, false);
10887
10888    // 업데이트 날짜 출력
10889    const updateTime = searchModal.find(".updateTime");
10890    const date = new Date(); // 오늘 날짜로 변경
10891    const formattedDate = `${date.getFullYear()}. ${String(date.getMonth() + 1).padStart(2, "0")}. ${String(
10892      date.getDate(),
10893    ).padStart(2, "0")}`;
10894    updateTime.text(`${formattedDate} 업데이트`);
10895  }
10896
10897  // 공통된 검색어 리스트 출력 함수
10898  function renderKeywords(keywords, containerSelector, isDeletable = false, maxCount = 6) {
10899    const container = EC$(`.${containerSelector}`);
10900    const list = container.find(".list");
10901    const noResults = container.find(".no-results");
10902
10903    list.html(""); // 기존 리스트 초기화
10904
10905    if (keywords.length === 0 || !keywords) {
10906      noResults && noResults.removeClass("displaynone"); // 결과 없을 때 메시지 표시
10907    } else {
10908      noResults && noResults.addClass("displaynone"); // 결과 있을 때 메시지 숨김
10909      keywords.slice(0, maxCount).forEach((keyword, index) => {
10910        const deleteButton = isDeletable
10911          ? `<button type="button" class="delete" data-index="${index}" data-keyword="${keyword}">
10912             <img src="/iv/img/search/recent-close.svg" alt="" />
10913           </button>`
10914          : "";
10915
10916        list.append(`
10917        <li>
10918          <a href="#;" data-keyword="${keyword}">${keyword}</a>
10919          ${deleteButton}
10920        </li>
10921      `);
10922      });
10923
10924      list.on("click", "a", function (e) {
10925        e.preventDefault();
10926        let keyword = $(this).data("keyword");
10927        handleSearchLinkClick(keyword);
10928      });
10929
10930      if (isDeletable) {
10931        // 최근검색어 삭제
10932        EC$(".all-delete").on("click", function (e) {
10933          localStorage.removeItem("recentSearches");
10934          recentAPI(null, "recent-keywords");
10935        });
10936
10937        list.on("click", ".delete", function (e) {
10938          let index = $(this).data("index");
10939          removeRecent(index);
10940        });
10941      }
10942    }
10943  }
10944
10945  // 최근검색어 저장
10946  function recentAPI(keyword, containerSelector) {
10947    const maxRecent = 6;
10948    let recents = JSON.parse(localStorage.getItem("recentSearches") || "[]");
10949
10950    // ✅ keyword가 있을 때만 저장 로직 실행
10951    if (keyword) {
10952      keyword = keyword.trim();
10953      if (keyword !== "") {
10954        recents = recents.filter((item) => item !== keyword); // 중복 제거
10955        recents.unshift(keyword); // 맨 앞에 추가
10956        if (recents.length > maxRecent) recents.pop();
10957        localStorage.setItem("recentSearches", JSON.stringify(recents));
10958      }
10959    }
10960
10961    // ✅ keyword 유무 관계없이 항상 렌더링 실행
10962    renderKeywords(recents, containerSelector, true);
10963  }
10964
10965  // 최근검색어 삭제
10966  function removeRecent(index) {
10967    let recents = JSON.parse(localStorage.getItem("recentSearches") || "[]");
10968    recents.splice(index, 1);
10969    localStorage.setItem("recentSearches", JSON.stringify(recents));
10970    renderKeywords(recents, "recent-keywords", true);
10971  }
10972
10973  // 동적으로 그려지는 배너를 기다렸다가 상태를 적용
10974  function applyBannerStateWhenReady(container, applyMatch, timeout = 4000) {
10975    const $container = $(container);
10976
10977    const applyState = () => {
10978      const $banners = $container.find(".slide-ivBanner");
10979
10980      if (!$banners.length) {
10981        return false;
10982      }
10983
10984      $banners.removeClass("is-active");
10985
10986      $banners.each(function () {
10987        const $banner = $(this);
10988        const text = $banner.find(".guide_cont_text").text().trim();
10989        const $aTag = $banner.find("a");
10990        const onClick = $aTag.attr("onclick");
10991
10992        if (onClick && /clickCount\([^,]+,\s*(null|'null'|"null"|''|""|,)\s*,/.test(onClick)) {
10993          $aTag.css({
10994            "pointer-events": "none",
10995            cursor: "default",
10996          });
10997        }
10998
10999        if (applyMatch(text)) {
11000          $banner.addClass("is-active");
11001        }
11002      });
11003
11004      return true;
11005    };
11006
11007    if (applyState()) {
11008      return;
11009    }
11010
11011    const observer = new MutationObserver(() => {
11012      if (applyState()) {
11013        observer.disconnect();
11014      }
11015    });
11016
11017    observer.observe($container[0], {
11018      childList: true,
11019      subtree: true,
11020    });
11021
11022    setTimeout(() => {
11023      observer.disconnect();
11024    }, timeout);
11025  }
11026
11027  async function productSearchAPI(keyword, orderBy) {
11028    searchResult.addClass("is-active");
11029    const API_URL = `/partner/response/andar-text-search/andar`;
11030    const response = await fetch(getEndpoint(API_URL), {
11031      method: "POST",
11032      headers: {
11033        "Content-Type": "application/json",
11034        "x-api-key": "5e873ebd-a0fd-4f5d-8cb4-5e993e097a5c",
11035      },
11036      body: JSON.stringify({
11037        keyword: keyword,
11038        order_by: orderBy,
11039      }),
11040    });
11041    let data = await response.json();
11042    let payload = data.payload;
11043    let products = payload.products;
11044
11045    let total_count = $(".total_count");
11046    let noResults = searchResult.find(".no-results");
11047    let csMessage = searchResult.find(".cs-message");
11048    let isMultipleFabricSearch = payload.is_multiple_fabric_search;
11049    let is_fabric = payload.is_fabric;
11050    let is_faq = payload.is_faq;
11051    let length = products.length;
11052    let suggestedQuery = payload.suggested_query;
11053    let show_banner = payload.show_banner;
11054    // 자주 묻는 질문 클릭시 log API
11055    // csMessage.find("a").on("click", function (e) {
11056    //   const data = {
11057    //     client_id: client_id,
11058    //     session_id: session_id,
11059    //     device_id: device_id,
11060    //     customer_id: customer_id,
11061    //     banner_id: "faq-banner",
11062    //   };
11063    //   fetch(getEndpoint("logs/banner"), {
11064    //     method: "POST",
11065    //     headers: {
11066    //       accept: "application/json",
11067    //       "Content-Type": "application/json",
11068    //     },
11069    //     body: JSON.stringify(data),
11070    //   });
11071    // });
11072    if (suggestedQuery) {
11073      propose.removeClass("displaynone");
11074      propose.find(".keyword").text(suggestedQuery);
11075    } else {
11076      propose.remove();
11077    }
11078
11079    // 검색결과 분기 배너 노출 is_multiple_fabric_search : true 인경우 노출함
11080    if (isMultipleFabricSearch && !is_faq) {
11081      fabricBnr.removeClass("displaynone");
11082      let fabricName = payload.fabric_name;
11083      applyBannerStateWhenReady(fabricBnr, function (text) {
11084        return keyword.includes(text) || text.includes(fabricName || "");
11085      });
11086    }
11087
11088    // 검색결과 미분기 배너 노출 is_multiple_fabric_search : false 인경우 노출함
11089    if (!isMultipleFabricSearch && !is_faq) {
11090      fabricNotBnr.removeClass("displaynone");
11091      applyBannerStateWhenReady(fabricNotBnr, function (text) {
11092        return removeAllSpaces(keyword) === removeAllSpaces(text);
11093      });
11094    }
11095
11096    // if (!is_fabric && show_banner) {
11097    //   fabricNotBnr.removeClass("displaynone");
11098    //   fabricNotBnr.find(".slide-ivBanner").each(function (index) {
11099    //     let text = $(this).find(".guide_cont_text").text().trim();
11100    //     // let bannerLink = $(this).find(".banner_link");
11101    //     // let href = bannerLink.attr("href");
11102    //     // if (href == "#;") {
11103    //     //   bannerLink.addClass("no-link");
11104    //     // }
11105
11106    //     if (removeAllSpaces(keyword) === removeAllSpaces(text)) {
11107    //       $(this).addClass("is-active");
11108    //     }
11109    //   });
11110    // }
11111
11112    // if (is_fabric) {
11113    //   // 원단, 원단 더보기 배너 노출
11114    //   fabricBnr.removeClass("displaynone");
11115    //   let fabricName = payload.fabric_name;
11116    //   fabricBnr.find(".slide-ivBanner").each(function (index) {
11117    //     let text = $(this).find(".guide_cont_text").text().trim();
11118    //     if (keyword.includes(text) || text.includes(fabricName)) {
11119    //       $(this).addClass("is-active");
11120    //     }
11121    //   });
11122    // }
11123
11124    // CS 관련 키워드인경우
11125    if (is_faq) {
11126      let faqKeyword = payload.faq_keyword;
11127      csMessage.removeClass("displaynone");
11128      csMessage
11129        .find(".link")
11130        .attr(
11131          "href",
11132          `/board/product/list2.html?board_no=17&page=1&board_sort=&search_key=subject&search=${faqKeyword}`,
11133        );
11134      csMessage.find(".desc").text(`${faqKeyword}에 대해 자주 묻는 질문을 확인해보세요.`);
11135    } else {
11136      csMessage.remove();
11137    }
11138
11139    // 상품이 없는 경우
11140    if (length == 0) {
11141      noResults.removeClass("displaynone");
11142      relatedKeywordsResult.remove();
11143      searchResult.addClass("is-active");
11144      $(".search-text .title").html(`<span class="search-word">${keyword}</span> 검색결과`)
11145      // propose.remove();
11146    } else {
11147      noResults.remove();
11148      if (isMultipleFabricSearch && is_fabric) {
11149        // 원단 검색시 멀티검색(세트, 하의, 상의,)
11150        const query = suggestedQuery || keyword;
11151
11152        const checkKeywords = [
11153          `${query} 세트`,
11154          `${query} 하의`,
11155          `${query} 상의`,
11156        ];
11157        $(".search-text .title").addClass("displaynone"); // 제목 숨기기
11158        multiSearchAPI(checkKeywords, orderBy, query);
11159      } else {
11160        searchFnEle.addClass("is-active");
11161        total_count.text(length);
11162        fabriProduct.remove();
11163        const productHTML = products.map(generateProductHTML).join("");
11164        prdBasic.append(productHTML);
11165        searchResult.addClass("is-active");
11166        $(".search-text .title").html(`<span class="search-word">${keyword}</span> 검색결과`)
11167      }
11168    }
11169  }
11170
11171  // 상품 세트, 하의, 상의 검색
11172  async function multiSearchAPI(checkKeywords, orderBy, query) {
11173    let promiseAllArr = [];
11174    for (const keyword of checkKeywords) {
11175      const API_URL = `/partner/response/andar-text-search/andar`;
11176      try {
11177        promiseAllArr.push(
11178          fetch(getEndpoint(API_URL), {
11179            method: "POST",
11180            headers: {
11181              "Content-Type": "application/json",
11182              "x-api-key": "5e873ebd-a0fd-4f5d-8cb4-5e993e097a5c",
11183            },
11184            body: JSON.stringify({
11185              keyword: keyword,
11186              order_by: orderBy,
11187            }),
11188          }),
11189        );
11190      } catch (error) {
11191        console.error("Error fetching data for", query, error);
11192      }
11193    }
11194    let result = await Promise.all(promiseAllArr);
11195    for (const [index, item] of result.entries()) {
11196      let data = await item.json();
11197      let products = data.payload.products;
11198      let title = checkKeywords[index].replace(`${query.split(" ")[0]} `, "") || "";
11199      if (products.length) {
11200        if (title === "상의" || title === "하의") {
11201          products = products.filter((product) => product.set_product_type === "");
11202        }
11203
11204        const productHTML = products.slice(0, 4).map(generateProductHTML).join("");
11205        fabriProduct.append(generateFabricHTML(products, title, productHTML, checkKeywords[index]));
11206      }
11207    }
11208    fabricBnr.removeClass("displaynone");
11209    fabriProduct.addClass("is-multi");
11210    searchFnEle.remove();
11211    searchProduct.remove();
11212    searchResult.addClass("is-active");
11213  }
11214
11215  //  자동완성 API
11216  async function autoCompleate(keyword) {
11217    const API_URL = `/partner-v2/search/inference/andar-text-search/andar/autocomplete?limit=10&query=${keyword}`;
11218    let searchKeyword = keyword;
11219    try {
11220      const response = await fetch(getEndpoint(API_URL), {
11221        method: "GET",
11222        headers: {
11223          "Content-Type": "application/json",
11224          "x-api-key": "5e873ebd-a0fd-4f5d-8cb4-5e993e097a5c",
11225        },
11226      });
11227      let data = await response.json();
11228      let autoCompletes = data.autoCompletes;
11229      let list = autoComplete.find(".list");
11230      let noSearch = autoComplete.find(".no-search");
11231      list.html("");
11232      if (!autoCompletes.length) {
11233        if (!noSearch.length) {
11234          autoComplete.append(`<div class="no-search">일치하는 자동 완성 검색어가 없습니다.</div>`);
11235        }
11236      } else {
11237        noSearch.remove();
11238        autoCompletes.forEach((autoComplete) => {
11239          const highlighted = autoComplete.keyword.replace(
11240            new RegExp(searchKeyword, "g"),
11241            `<span>${searchKeyword}</span>`,
11242          );
11243          list.append(`<li><a href="#;" data-keyword="${autoComplete.keyword}">${highlighted}</a></li>`);
11244        });
11245
11246        list.find("a").on("click", function (e) {
11247          e.preventDefault();
11248          let selectedKeyword = $(this).data("keyword");
11249          handleSearchLinkClick(selectedKeyword);
11250        });
11251        // list.find("a").on("click", function (e) {
11252        //   e.preventDefault();
11253        //   let selectedKeyword = $(this).data("keyword");
11254
11255        //   const data = {
11256        //     client_id: client_id,
11257        //     session_id: session_id,
11258        //     device_id: device_id,
11259        //     customer_id: customer_id,
11260        //     keyword: keyword,
11261        //     autocomplete_keyword: selectedKeyword,
11262        //   };
11263
11264        //   handleSearchLinkClick(selectedKeyword);
11265
11266        //   fetch(getEndpoint("logs/autocomplete-keyword"), {
11267        //     method: "POST",
11268        //     headers: {
11269        //       accept: "application/json",
11270        //       "Content-Type": "application/json",
11271        //     },
11272        //     body: JSON.stringify(data),
11273        //   });
11274        // });
11275      }
11276    } catch (error) {
11277      console.error("Error fetching data for", keyword, error);
11278    }
11279  }
11280
11281  function getEndpoint(path) {
11282    return `${BASE_URL}${path}`;
11283  }
11284
11285  //  검색어 클릭시
11286  function handleSearchLinkClick(keyword) {
11287    searchInput.val(keyword);
11288    searchForm.submit();
11289  }
11290
11291  // 할인 계산
11292  function calculateDiscountRate(originalPrice, discountPrice) {
11293    if (originalPrice < 0) {
11294      throw new Error("Original price must be greater than 0.");
11295    }
11296    const discountRate = ((originalPrice - discountPrice) / originalPrice) * 100;
11297    return discountRate.toFixed(0);
11298  }
11299
11300  // 개별 제품의 HTML 생성 함수
11301  function generateProductHTML(product) {
11302    const isSet = product.set_product_type || null;
11303    const {
11304      id,
11305      link,
11306      list_image: listImage,
11307      small_image: smallImage,
11308      name,
11309      model_name: modelName,
11310      usp_message: uspMessage,
11311      coupon_description: couponDescription,
11312      retail_price: retailPrice,
11313      discountprice,
11314    } = product;
11315
11316
11317    let decorationImage = product.decoration_image;
11318    let imgPath;
11319    let startDate;
11320    let endDate;
11321    let showDate;
11322
11323    if (decorationImage) {
11324      ({
11325        decoration_image_path: imgPath,
11326        show_start_date: startDate,
11327        show_end_date: endDate,
11328        use_show_date: showDate,
11329      } = decorationImage);
11330    }
11331
11332    let icons = product.icons;
11333    let iconPaths;
11334    let iconStartDate;
11335    let iconEndDate;
11336    let iconShowDate;
11337
11338    if (icons) {
11339      ({
11340        icon_paths: iconPaths,
11341        show_start_date: iconStartDate,
11342        show_end_date: iconEndDate,
11343        use_show_date: iconShowDate,
11344      } = icons);
11345    }
11346
11347    let discountPrice = parseInt(discountprice.mobile_discount_price || product.price);
11348
11349    if (!name.includes("상품권")) {
11350      if (isSet != null) {
11351        // 세트상품인경우
11352        if (groupName == "VIP") {
11353          discountPrice *= discountRates;
11354        }
11355      } else {
11356        discountPrice *= discountRates;
11357      }
11358    }
11359
11360    const originalPrice = retailPrice && parseInt(retailPrice) > 0 ? parseInt(retailPrice) : parseInt(product.price);
11361    // 회원 혜택이 있는경우 (로그인한경우) 멤버 할인 추가
11362    if (customer_id && groupName !== "VIP") {
11363      const basePrice = discountPrice;
11364      let totalDiscount = 0;
11365
11366      product.benefits.forEach((benefit) => {
11367        const userBinding = benefit.use_group_binding;
11368        const benefitType = benefit.benefit_type;
11369
11370        console.log("benefitType", benefitType);
11371
11372        // PG 타입은 할인 금액 계산에서 제외
11373        if (benefitType === "PG") {
11374          return;
11375        }
11376
11377        const unit = benefit.discount_value_unit;
11378        const value = benefit.discount_value;
11379
11380        // 퍼센트 할인
11381        if (unit === "P") {
11382          const discountAmount = (basePrice * parseFloat(value)) / 100;
11383          totalDiscount += Math.ceil(discountAmount / 100) * 100;
11384        }
11385
11386        // 금액 할인
11387        if (unit === "W") {
11388          totalDiscount += parseInt(value, 10);
11389        }
11390      });
11391
11392      // console.log("totalDiscount", originalPrice, isSet, basePrice, totalDiscount);
11393
11394      // 모든 혜택 합산 후 한 번만 적용
11395      if (isSet == null) {
11396        discountPrice = basePrice - totalDiscount;
11397      } else {
11398        discountPrice = originalPrice - totalDiscount;
11399      }
11400    }
11401
11402    if (isNaN(discountPrice)) {
11403      discountPrice = 0;
11404    }
11405
11406    const salePercent = calculateDiscountRate(originalPrice, discountPrice);
11407
11408    return `
11409    <li id="anchorBoxId_${id}" class="common_prd_list xans-record-" style="display: inline-block; opacity: 1;" data-id=${id}>
11410      <div class="box dd_box">
11411        <div class="img">
11412          <div class="prdimg thumbnail">
11413            <a href="${link}" name="anchorBoxName_${id}">
11414              <img src="${listImage}" alt="${name}" class="lazyautosizes lazyloaded" />
11415            </a>
11416            ${
11417              decorationImage
11418                ? (() => {
11419                    const commonTemplate = `
11420                <span class="xans-element- xans-product xans-product-imagestyle xans-record-">
11421                  <span class="prdIcon ec-product-bgLT">
11422                    <img src="${imgPath}" />
11423                  </span>
11424                </span>
11425              `;
11426                    if (showDate === "F") {
11427                      return commonTemplate; // 항상 노출
11428                    }
11429                    if (showDate === "T") {
11430                      const now = new Date();
11431                      const start = new Date(startDate);
11432                      const end = new Date(endDate);
11433                      if (now >= start && now <= end) {
11434                        return commonTemplate; // 조건에 맞으면 노출
11435                      }
11436                    }
11437                    return ""; // 조건에 맞지 않으면 빈 문자열
11438                  })()
11439                : ""
11440            }
11441            <div class="wish displaynone"><img src="/web/upload/icon_202504031715207700.png" class="icon_img ec-product-listwishicon" alt="관심상품 등록 전" productno="${id}" categoryno="2027" icon_status="off" login_status="F" individual-set="F"></div>
11442          </div>
11443        </div>
11444        <div class="info">
11445          <p class="model">${modelName}</p>
11446          <p class="name">
11447            <a href="${link}">
11448              <span class="product_name">
11449                <span style="font-size: 14px; color: #000000">${name}</span>
11450              </span>
11451            </a>
11452          </p>
11453          ${uspMessage ? `<p class="usp_text">${uspMessage}</p>` : ""}
11454          <div class="price ${discountPrice !== originalPrice ? "hassale" : ""}">
11455            <span class="sale ${
11456              discountPrice === originalPrice ? "displaynone" : ""
11457            }"><strong>${discountPrice.toLocaleString()}원</strong></span>
11458            <span class="sell"><strong>${originalPrice.toLocaleString()}</strong>원</span>
11459            ${
11460              discountPrice !== originalPrice
11461                ? `<span class="sale_percent" style="display:inline-block;"><strong>${salePercent}%</strong></span>`
11462                : ""
11463            }
11464          </div>
11465          ${couponDescription ? `<div class="coupon_price has_coupon">${couponDescription}</div>` : ""}
11466          ${
11467            icons
11468              ? (() => {
11469                  const commonTemplate = `
11470                  <div class="icon">
11471                  ${iconPaths.map((src) => `<img src="${src}" />`).join("")}
11472                </div>
11473            `;
11474                  if (iconShowDate === "F") {
11475                    return commonTemplate; // 항상 노출
11476                  }
11477                  if (iconShowDate === "T") {
11478                    const now = new Date();
11479                    const start = new Date(iconStartDate);
11480                    const end = new Date(iconEndDate);
11481                    if (now >= start && now <= end) {
11482                      return commonTemplate; // 조건에 맞으면 노출
11483                    }
11484                  }
11485                  return ""; // 조건에 맞지 않으면 빈 문자열
11486                })()
11487              : ""
11488          }
11489        </div>
11490      </div>
11491    </li>
11492  `;
11493  }
11494
11495  // 원단 템플릿
11496  function generateFabricHTML(products, title, productHTML, keyword) {
11497    // <p class="count">검색결과 <span class="total_count">${products.length}</span>개</p>
11498    return `
11499    <article>
11500      <div class="title-area">
11501        <div class="title">${title}</div>
11502        <div class="fabri-fn">
11503          <a href="#;" class="all-view" data-keyword="${keyword}">상품 더보기<img src="/iv/img/search/search-arrow.svg" alt="" /></a>
11504        </div>
11505      </div>
11506  
11507      <ul class="prd_basic col4">${productHTML}</ul>
11508      <div class="more"><a href="javascript:void(0);" data-keyword="${keyword}"><span>${title}</span>더보기 <img src="/iv/img/search/search-more.svg" alt="" /></a></div>
11509    </article>
11510  `;
11511  }
11512
11513  // 공백제거
11514  function removeAllSpaces(str) {
11515    return str.replace(/\s/g, "");
11516  }
11517});
11518
11519// function waitForScript(callback) {
11520//   const targetSrc = "ba809c5a807dbc805d80b218a189dc3e.js";
11521
11522//   function handleScript(scriptEl) {
11523//     if (!scriptEl || !scriptEl.src || !scriptEl.src.includes(targetSrc)) {
11524//       return false;
11525//     }
11526
11527//     // 이미 로드된 스크립트면 즉시 콜백 실행
11528//     if (
11529//       scriptEl.readyState === "complete" ||
11530//       scriptEl.readyState === "loaded" ||
11531//       scriptEl.getAttribute("data-loaded") === "true"
11532//     ) {
11533//       console.log("이미 로드된 스크립트 감지:", scriptEl.src);
11534//       callback(scriptEl);
11535//       return true;
11536//     }
11537
11538//     scriptEl.addEventListener(
11539//       "load",
11540//       () => {
11541//         scriptEl.setAttribute("data-loaded", "true");
11542//         callback(scriptEl);
11543//       },
11544//       { once: true },
11545//     );
11546//     return true;
11547//   }
11548
11549//   // 감시 시작 전에 이미 존재하는 스크립트를 먼저 확인
11550//   const existingScript = document.querySelector(`script[src*="${targetSrc}"]`);
11551//   if (existingScript && handleScript(existingScript)) {
11552//     return;
11553//   }
11554
11555//   const observer = new MutationObserver((mutations, obs) => {
11556//     for (const mutation of mutations) {
11557//       for (const node of mutation.addedNodes) {
11558//         if (node.tagName === "SCRIPT" && handleScript(node)) {
11559//           console.log("스크립트 로드 감지:", node.src);
11560//           obs.disconnect();
11561//         }
11562//       }
11563//     }
11564//   });
11565
11566//   observer.observe(document.documentElement, {
11567//     childList: true,
11568//     subtree: true,
11569//   });
11570// }
11571
11572// ELO 로직
11573(async () => {
11574    const TEST_COOKIE_PREFIX = "ab_test_result_";
11575    const SESSION_KEY = "ab_test_entry_info";
11576    const TRACKING_INFO_KEY = "ab_test_tracking_info";
11577    const PA_SENT_PREFIX = "ab_test_pa_sent_";
11578
11579        const deleteCookie = (name) => {
11580            document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC`;
11581        };
11582        const getUTMParams = () => {
11583            const params = new URLSearchParams(window.location.search);
11584            const utm = {};
11585            for (const [key, value] of params.entries()) {
11586                if (key.toLowerCase().startsWith("utm_"))
11587                    utm[key.toLowerCase()] = value;
11588            }
11589            return utm;
11590        };
11591        const getCurrentParams = () => {
11592            const params = new URLSearchParams(window.location.search);
11593            const out = {};
11594            for (const [key, value] of params.entries()) {
11595                out[key.toLowerCase()] = value;
11596            }
11597            return out;
11598        };
11599        const buildURLWithQueryConditions = (baseUrl, queryConditions = []) => {
11600            try {
11601                const u = new URL(baseUrl, location.origin);
11602                const conditions = Array.isArray(queryConditions) ? queryConditions : [];
11603                for (const cond of conditions) {
11604                    const key = cond?.key;
11605                    const value = cond?.value;
11606                    if (!key || typeof value === "undefined" || value === null) continue;
11607                    u.searchParams.set(String(key), String(value));
11608                }
11609                return u.toString();
11610            } catch {
11611                return baseUrl;
11612            }
11613        };
11614        const saveSessionEntry = () => {
11615            if (!sessionStorage.getItem(SESSION_KEY)) {
11616                sessionStorage.setItem(
11617                    SESSION_KEY,
11618                    JSON.stringify({ url: window.location.href, utm: getUTMParams() })
11619                );
11620            }
11621        };
11622        const getCookie = (name) => {
11623            const match = document.cookie.match(new RegExp(`${name}=([^;]+)`));
11624            return match ? decodeURIComponent(match[1]) : null;
11625        };
11626        const setCookie = (name, value, expires) => {
11627            document.cookie = `${name}=${encodeURIComponent(
11628                value
11629            )}; path=/; expires=${expires.toUTCString()}`;
11630        };
11631
11632        const getPageKeyFromURL = (url, { stripTracking = true } = {}) => {
11633            try {
11634                const u = new URL(url, location.origin);
11635
11636                // host/path 정규화
11637                let host = u.hostname.toLowerCase();
11638
11639                // www. / m. / mobile. / amp. 제거 → 같은 페이지로 취급
11640                host = host.replace(/^(www\.|m\.|mobile\.|amp\.)/, "");
11641
11642                let path = u.pathname.replace(/\/{2,}/g, "/");
11643                if (path.length > 1) path = path.replace(/\/+$/, "");
11644
11645                // 쿼리 정규화
11646                const raw = u.search.startsWith("?") ? u.search.slice(1) : u.search;
11647                const usp = new URLSearchParams(raw);
11648                const pairs = [];
11649                for (const key of [...new Set([...usp.keys()])].sort()) {
11650                    const all = usp.getAll(key).map(String).sort();
11651                    for (const val of all) pairs.push([key, val]);
11652                }
11653
11654                // 트래킹 제거(원하면 false로 꺼도 됨)
11655                const TRACKING_RE =
11656                    /^(utm_|gclid$|fbclid$|msclkid$|ttclid$|igshid$|_ga$|wbraid$|gbraid$|yclid$|dclid$|twclid$|utm_id$|cafe_mkt$|mkt_in$|ghost_mall_id$|ref$|NaPm$|NaPt$|NaPp$|NaPa$|n_media$|n_query$|n_rank$|n_ad_group_type$|acode$|scode$|app4$|g_adid$|media$|p_code$|skey$|campaign_id$|adgroup_id$|ad_keyword$|shopbytracking$|shopby_ref$|shopby_event$|k_medium$|k_campaign$|k_content$|k_keyword$|ad_id$|click_id$|fb_action_ids$|fb_action_types$|fb_source$)/i;
11657                const filtered = stripTracking
11658                    ? pairs.filter(([k]) => !TRACKING_RE.test(k))
11659                    : pairs;
11660
11661                const query = filtered
11662                    .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
11663                    .join("&");
11664                return query ? `${host}${path}?${query}` : `${host}${path}`;
11665            } catch {
11666                return null;
11667            }
11668        };
11669
11670        const isIncludedURL = (sourceUrl, targetUrl, options) => {
11671            const sourceKey = getPageKeyFromURL(sourceUrl, options);
11672            const targetKey = getPageKeyFromURL(targetUrl, options);
11673            if (!sourceKey || !targetKey) return false;
11674            return sourceKey.includes(targetKey) || targetKey.includes(sourceKey);
11675        };
11676
11677        const getComparableURLInfo = (url) => {
11678            try {
11679                const u = new URL(url, location.origin);
11680                const host = u.hostname
11681                    .toLowerCase()
11682                    .replace(/^(www\.|m\.|mobile\.|amp\.)/, "");
11683                let path = u.pathname.replace(/\/{2,}/g, "/");
11684                if (path.length > 1) path = path.replace(/\/+$/, "");
11685                const params = new URLSearchParams(u.search);
11686                const pairs = [];
11687                for (const key of [...new Set([...params.keys()])].sort()) {
11688                    const values = params.getAll(key).map(String).sort();
11689                    for (const value of values) pairs.push([key, value]);
11690                }
11691                return { host, path, pairs };
11692            } catch {
11693                return null;
11694            }
11695        };
11696
11697        const isSamePageURL = (sourceUrl, targetUrl) => {
11698            const source = getComparableURLInfo(sourceUrl);
11699            const target = getComparableURLInfo(targetUrl);
11700            if (!source || !target) return false;
11701            if (source.host !== target.host || source.path !== target.path) return false;
11702
11703            return target.pairs.every(([targetKey, targetValue]) =>
11704                source.pairs.some(
11705                    ([sourceKey, sourceValue]) =>
11706                        sourceKey === targetKey && sourceValue === targetValue
11707                )
11708            );
11709        };
11710        const getTestOriginURL = (test) =>
11711            buildURLWithQueryConditions(test?.origin?.url || "", test?.queryConditions);
11712        const isSameOrSubsetURL = (sourceUrl, targetUrl) =>
11713            isSamePageURL(sourceUrl, targetUrl) || isSamePageURL(targetUrl, sourceUrl);
11714
11715        const determineGroupName = (url, test) => {
11716            const originUrl = getTestOriginURL(test);
11717            if (url && originUrl && isSameOrSubsetURL(url, originUrl))
11718                return "원본";
11719            for (let i = 0; i < test.alternates.length; i++) {
11720                const altUrl = test.alternates[i]?.url;
11721                if (altUrl && url && isSameOrSubsetURL(url, altUrl))
11722                    return `대안${i + 1}`;
11723            }
11724            return "unknown";
11725        };
11726        const isLegacyBaseOriginURL = (url, test) => {
11727            const rawOriginUrl = test?.origin?.url;
11728            const resolvedOriginUrl = getTestOriginURL(test);
11729            if (!url || !rawOriginUrl || !resolvedOriginUrl) return false;
11730
11731            const rawOriginKey = getPageKeyFromURL(rawOriginUrl, { stripTracking: false });
11732            const resolvedOriginKey = getPageKeyFromURL(resolvedOriginUrl, {
11733                stripTracking: false,
11734            });
11735            const currentKey = getPageKeyFromURL(url, { stripTracking: false });
11736            if (!rawOriginKey || !resolvedOriginKey || !currentKey) return false;
11737            if (rawOriginKey === resolvedOriginKey) return false;
11738
11739            return currentKey === rawOriginKey;
11740        };
11741        const normalizeABInfoForTest = (abInfo, test) => {
11742            if (!abInfo || !test) return abInfo;
11743
11744            const normalized = { ...abInfo };
11745            const originUrl = getTestOriginURL(test);
11746
11747            if (isLegacyBaseOriginURL(normalized.url, test) && originUrl) {
11748                normalized.url = originUrl;
11749            }
11750
11751            const group = determineGroupName(normalized.url, test);
11752            if (group !== "unknown") normalized.group = group;
11753            if (normalized.group === "원본" && originUrl) normalized.url = originUrl;
11754
11755            return normalized;
11756        };
11757
11758        const weightedRandom = (variants) => {
11759            const total = variants.reduce((sum, v) => sum + Number(v.weight || 0), 0);
11760            if (total <= 0) return variants[0];
11761            const r = Math.random() * total;
11762            let acc = 0;
11763            for (const v of variants) {
11764                acc += Number(v.weight || 0);
11765                if (r < acc) return v;
11766            }
11767            return variants[variants.length - 1];
11768        };
11769
11770        const toISODate = (val) => {
11771            if (val == null) return null;
11772            if (typeof val === "number") {
11773                const ms = val < 1e12 ? val * 1000 : val;
11774                return new Date(ms).toISOString();
11775            }
11776            const d = new Date(val);
11777            return isNaN(d.getTime()) ? null : d.toISOString();
11778        };
11779        const pick = (...cands) => {
11780            for (const c of cands) if (c !== undefined && c !== null) return c;
11781            return undefined;
11782        };
11783
11784        const toArray = (value) => {
11785            if (Array.isArray(value)) return value;
11786            if (value === undefined || value === null || value === "") return [];
11787            return [value];
11788        };
11789
11790        const normalizeOriginEntries = (...candidates) => {
11791            return candidates
11792                .flatMap((candidate) => toArray(candidate))
11793                .map((entry) => {
11794                    if (typeof entry === "string") return { url: entry, weight: 1 };
11795                    const url = entry?.url || entry?.href || entry?.link || entry?.originUrl;
11796                    if (!url) return null;
11797                    return {
11798                        url,
11799                        weight: Number(pick(entry.weight, 1)) || 1,
11800                    };
11801                })
11802                .filter(Boolean);
11803        };
11804
11805        const matchesUTMConditions = (item) => {
11806            if (!item?.useCondition) return true;
11807
11808            const currentUTM = getUTMParams();
11809            const effectiveUTM = Object.keys(currentUTM).length > 0 ? currentUTM : {};
11810            const sets =
11811                Array.isArray(item.conditions) && Array.isArray(item.conditions[0])
11812                    ? item.conditions
11813                    : [item.conditions || []];
11814
11815            const matchesUTMValue = (utmVal, conditionVal) => {
11816                if (typeof utmVal === "undefined" || conditionVal === null) return false;
11817                return String(utmVal).includes(String(conditionVal));
11818            };
11819
11820            const passesSet = (set) => {
11821                let includeOK = true;
11822                let excludeHit = false;
11823                for (const cond of set) {
11824                    const key = cond?.utmKey?.toLowerCase();
11825                    const val = cond?.utmValue;
11826                    if (!key || typeof val === "undefined") continue;
11827                    const utmVal = effectiveUTM[key];
11828                    if (cond.isIncluded) includeOK = includeOK && matchesUTMValue(utmVal, val);
11829                    else if (matchesUTMValue(utmVal, val)) excludeHit = true;
11830                    if (!includeOK || excludeHit) break;
11831                }
11832                return includeOK && !excludeHit;
11833            };
11834
11835            return sets.some(passesSet);
11836        };
11837
11838        const matchesQueryConditions = (item) => {
11839            const queryConditions = Array.isArray(item?.queryConditions)
11840                ? item.queryConditions
11841                : [];
11842            if (queryConditions.length === 0) return true;
11843
11844            const currentParams = getCurrentParams();
11845            return queryConditions.every((cond) => {
11846                const key = cond?.key?.toLowerCase();
11847                const val = cond?.value;
11848                if (!key || typeof val === "undefined") return true;
11849                return currentParams[key] === String(val);
11850            });
11851        };
11852
11853        const isActiveNow = (item, now = new Date()) => {
11854            const start = new Date(item.startTime);
11855            const end = new Date(item.endTime);
11856            return now >= start && now <= end;
11857        };
11858
11859        // === 새 스키마 정규화: { [originUrl]: { abtests: [...], redirects: [...] } } ===
11860        const normalizeByOrigin = (raw0) => {
11861            const raw = raw0?.landings ?? raw0?.data ?? raw0; // 루트 래핑 흡수
11862            const out = {};
11863            if (!raw || typeof raw !== "object") return out;
11864
11865            const entries = Array.isArray(raw)
11866                ? raw
11867                : Object.entries(raw).map(([k, v]) => ({ origin: k, payload: v }));
11868
11869            // 케이스/단복수 무시 배열 추출
11870            const getArrayCI = (obj, ...names) => {
11871                if (!obj || typeof obj !== "object") return [];
11872                const table = {};
11873                for (const [k, v] of Object.entries(obj)) table[k.toLowerCase()] = v;
11874                for (const n of names) {
11875                    const v = table[n.toLowerCase()];
11876                    if (Array.isArray(v)) return v;
11877                }
11878                return [];
11879            };
11880
11881            for (const item of entries) {
11882                const payload = item.payload || item;
11883                const itemOrigins = normalizeOriginEntries(
11884                    item.originUrls,
11885                    item.originUrl,
11886                    item.origin,
11887                    item.url,
11888                    payload.originUrls,
11889                    payload.originUrl,
11890                    payload.origin,
11891                    payload.url
11892                );
11893
11894                // abTest / abtests 등 흡수 (소문자 기준 abtest 포함)
11895                const abArr = getArrayCI(
11896                    payload,
11897                    "abTest",
11898                    "abTests",
11899                    "abtest",
11900                    "abtests"
11901                );
11902
11903                // redirection / redirects 등 흡수
11904                const redArr = getArrayCI(
11905                    payload,
11906                    "redirection",
11907                    "redirects",
11908                    "redirect"
11909                );
11910
11911                const abtests = [];
11912                for (const t of abArr) {
11913                    const id = String(
11914                        pick(t.id, t.testId, t.uuid, Math.random().toString(36).slice(2))
11915                    );
11916                    const name = pick(t.name, t.title, `test_${id}`);
11917                    const startTime =
11918                        toISODate(pick(t.startTime, t.start, t.schedule?.start)) ||
11919                        new Date(0).toISOString();
11920                    // endTime이 없을 수도 있어 기본 1년 뒤로 보정 (이전 로직은 없으면 스킵)
11921                    const endTime =
11922                        toISODate(pick(t.endTime, t.end, t.schedule?.end)) ||
11923                        new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString();
11924
11925                    const origins = normalizeOriginEntries(
11926                        t.originUrls,
11927                        t.originUrl,
11928                        t.origins,
11929                        t.origin,
11930                        itemOrigins
11931                    );
11932                    if (origins.length === 0) continue;
11933
11934                    const variants = []
11935                        .concat(t.alternates || [])
11936                        .concat(t.variants || [])
11937                        .map((v) => {
11938                            const url = v?.url || v?.href || v?.link;
11939                            if (!url) return null;
11940                            return { url, weight: Number(pick(v.weight, v.ratio, 1)) || 1 };
11941                        })
11942                        .filter(Boolean);
11943
11944                    for (const origin of origins) {
11945                        abtests.push({
11946                            id,
11947                            name,
11948                            startTime,
11949                            endTime,
11950                            origin,
11951                            origins,
11952                            alternates: variants,
11953                            queryConditions: Array.isArray(t.queryConditions)
11954                                ? t.queryConditions
11955                                : [],
11956                            useCondition: !!t.useCondition,
11957                            conditions: Array.isArray(t.conditions) ? t.conditions : [],
11958                        });
11959                    }
11960                }
11961
11962                const redirects = [];
11963                for (const r of redArr) {
11964                    const id = String(
11965                        pick(r.id, r.uuid, Math.random().toString(36).slice(2))
11966                    );
11967                    const name = pick(r.name, r.title, `redirect_${id}`);
11968                    const startTime =
11969                        toISODate(pick(r.startTime, r.start)) || new Date(0).toISOString();
11970                    const endTime =
11971                        toISODate(pick(r.endTime, r.end)) ||
11972                        new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString();
11973
11974                    // 이 스키마는 r.alternate(문자열) 로 옴 -> 배열로 표준화
11975                    let alts = [];
11976                    if (typeof r.alternate === "string" && r.alternate.trim()) {
11977                        alts = [{ url: r.alternate }];
11978                    } else {
11979                        const rawAlts =
11980                            r.alternates ||
11981                            r.urls ||
11982                            r.targets ||
11983                            r.destinations ||
11984                            r.to ||
11985                            [];
11986                        alts = (Array.isArray(rawAlts) ? rawAlts : [rawAlts])
11987                            .map((u) => {
11988                                if (typeof u === "string") return { url: u };
11989                                const url =
11990                                    u?.url || u?.href || u?.link || u?.to || u?.destination;
11991                                return url ? { url } : null;
11992                            })
11993                            .filter(Boolean);
11994                    }
11995                    if (alts.length === 0) continue;
11996
11997                    const origins = normalizeOriginEntries(
11998                        r.originUrls,
11999                        r.originUrl,
12000                        r.origins,
12001                        r.origin,
12002                        itemOrigins
12003                    );
12004                    if (origins.length === 0) continue;
12005
12006                    for (const origin of origins) {
12007                        redirects.push({
12008                            id,
12009                            name,
12010                            startTime,
12011                            endTime,
12012                            origin,
12013                            origins,
12014                            alternates: alts,
12015                            queryConditions: Array.isArray(r.queryConditions)
12016                                ? r.queryConditions
12017                                : [],
12018                            useCondition: !!r.useCondition,
12019                            conditions: Array.isArray(r.conditions) ? r.conditions : [],
12020                        });
12021                    }
12022                }
12023
12024                for (const test of abtests) {
12025                    const originKey = getPageKeyFromURL(test.origin.url);
12026                    if (!originKey) continue;
12027                    if (!out[originKey]) out[originKey] = { abtests: [], redirects: [] };
12028                    out[originKey].abtests.push(test);
12029                }
12030
12031                for (const redirect of redirects) {
12032                    const originKey = getPageKeyFromURL(redirect.origin.url);
12033                    if (!originKey) continue;
12034                    if (!out[originKey]) out[originKey] = { abtests: [], redirects: [] };
12035                    out[originKey].redirects.push(redirect);
12036                }
12037            }
12038            return out;
12039        };
12040
12041        const clearOtherLandings = (keepId) => {
12042            const keysToRemove = [];
12043            for (let i = 0; i < sessionStorage.length; i++) {
12044                const key = sessionStorage.key(i);
12045                if (
12046                    key.startsWith("ab_test_landed_") &&
12047                    key !== "ab_test_landed_" + keepId
12048                ) {
12049                    keysToRemove.push(key);
12050                }
12051            }
12052            keysToRemove.forEach((k) => sessionStorage.removeItem(k));
12053        };
12054        const clearTrackingInfo = () => {
12055            delete window.abTestTrackedSafe;
12056            sessionStorage.removeItem(TRACKING_INFO_KEY);
12057        };
12058        const setTrackingInfo = (abInfo) => {
12059            if (!abInfo?.id) return;
12060            window.abTestTrackedSafe = abInfo;
12061            sessionStorage.setItem(TRACKING_INFO_KEY, JSON.stringify(abInfo));
12062        };
12063        const markLandingSession = (abInfo) => {
12064            if (!abInfo?.id) return;
12065            const flagKey = "ab_test_landed_" + abInfo.id;
12066            console.log("[AB landing mark]", {
12067                currentUrl: window.location.href,
12068                flagKey,
12069                abInfo,
12070            });
12071            if (!sessionStorage.getItem(flagKey)) {
12072                sessionStorage.setItem(flagKey, "true");
12073                clearOtherLandings(abInfo.id);
12074            }
12075            setTrackingInfo(abInfo);
12076        };
12077
12078        // === GTM 커스텀 이벤트 헬퍼 ===
12079        const pushDL = (evt, abInfo) => {
12080            try {
12081                window.dataLayer = window.dataLayer || [];
12082                window.dataLayer.push({
12083                    event: evt, // 'ab_assign' | 'ab_landing'
12084                    ab_id: String(abInfo.id),
12085                    ab_name: abInfo.name,
12086                    ab_group: abInfo.group,
12087                    ab_url: abInfo.url,
12088                    ab_page_key: getPageKeyFromURL(location.href),
12089                    ab_ts: Date.now(),
12090                });
12091            } catch (e) { }
12092        };
12093        const sendABEvent = (abInfo) => {
12094            try {
12095                if (!abInfo?.id || !abInfo?.name || !abInfo?.group) return;
12096                const sentKey = PA_SENT_PREFIX + abInfo.id;
12097                if (sessionStorage.getItem(sentKey) === "true") return;
12098
12099                const trySend = (attempt = 0) => {
12100                    if (typeof window.pa === "function") {
12101                        window.pa("send", "Event", {
12102                            eventNumber: 1,
12103                            abTest: {
12104                                id: String(abInfo.id),
12105                                name: abInfo.name,
12106                                group: abInfo.group,
12107                            },
12108                        });
12109                        sessionStorage.setItem(sentKey, "true");
12110                        console.log("[AB pa sent]", {
12111                            currentUrl: window.location.href,
12112                            abInfo,
12113                            attempt,
12114                        });
12115                        return;
12116                    }
12117
12118                    if (attempt >= 10) {
12119                        console.warn("[AB pa missing]", {
12120                            currentUrl: window.location.href,
12121                            abInfo,
12122                            attempt,
12123                        });
12124                        return;
12125                    }
12126
12127                    setTimeout(() => trySend(attempt + 1), 300);
12128                };
12129
12130                trySend();
12131            } catch (e) {
12132                console.warn("[AB pa send failed]", e?.message || e);
12133            }
12134        };
12135        
12136        const sendPageviewAndReplace = (url, attempt = 0) => {
12137            const replace = () => {
12138                location.replace(url);
12139            };
12140
12141            if (typeof window.pa === "function") {
12142                try {
12143                    window.pa("send", "Pageview");
12144                    console.log("[PA Pageview sent before redirect]", {
12145                        currentUrl: window.location.href,
12146                        targetUrl: url,
12147                        attempt,
12148                    });
12149                } catch (e) {
12150                    console.warn("[PA Pageview send failed]", e?.message || e);
12151                }
12152
12153                setTimeout(replace, 0);
12154                return;
12155            }
12156
12157            if (attempt >= 3) {
12158                console.warn("[PA Pageview skipped: window.pa missing]", {
12159                    currentUrl: window.location.href,
12160                    targetUrl: url,
12161                    attempt,
12162                });
12163
12164                replace();
12165                return;
12166            }
12167
12168            setTimeout(() => {
12169                sendPageviewAndReplace(url, attempt + 1);
12170            }, 150);
12171        };
12172
12173        // redirect 루프 방지 플래그 (id 단위)
12174        const markRedirectDone = (id) =>
12175            sessionStorage.setItem("ab_redirect_done_" + id, "true");
12176        const wasRedirectDone = (id) =>
12177            sessionStorage.getItem("ab_redirect_done_" + id) === "true";
12178
12179        try {
12180            clearTrackingInfo();
12181            const response = await fetch(
12182                "https://landingoptcdnprd.edisonoptimizer.com/andar/landings2.json?ts=" +
12183                Date.now(),
12184                { method: "GET", cache: "no-store" }
12185            );
12186            if (!response.ok) throw new Error("AB 테스트 설정 불러오기 실패");
12187
12188            const raw = await response.json();
12189            console.log(raw);
12190            saveSessionEntry();
12191
12192            // 새 스키마 정규화
12193            const byOrigin = normalizeByOrigin(raw);
12194            const currentKey = getPageKeyFromURL(window.location.href);
12195            const matchedOriginKey = currentKey
12196                ? Object.keys(byOrigin).find(
12197                    (originKey) =>
12198                        originKey.includes(currentKey) || currentKey.includes(originKey)
12199                )
12200                : undefined;
12201            const cfg = matchedOriginKey ? byOrigin[matchedOriginKey] : undefined;
12202
12203            // 쿠키 정리: 현재 구성에서 살아있는 AB 테스트 id만 유지
12204            const aliveIds = new Set(
12205                Object.values(byOrigin)
12206                    .flatMap((v) => v.abtests || [])
12207                    .map((t) => String(t.id))
12208            );
12209            const abTestsById = new Map();
12210            Object.values(byOrigin)
12211                .flatMap((v) => v.abtests || [])
12212                .forEach((test) => {
12213                    const id = String(test?.id || "");
12214                    if (id && !abTestsById.has(id)) abTestsById.set(id, test);
12215                });
12216            document.cookie.split(";
12216").forEach((cookie) => {
12217                const [name] = cookie.trim().split("=");
12218                if (name.startsWith(TEST_COOKIE_PREFIX)) {
12219                    const id = name.replace(TEST_COOKIE_PREFIX, "");
12220                    if (!aliveIds.has(id)) deleteCookie(name);
12221                }
12222            });
12223
12224            const syncTrackedLandingFromCookie = () => {
12225                for (const id of aliveIds) {
12226                    const existing = getCookie(TEST_COOKIE_PREFIX + id);
12227                    if (!existing) continue;
12228                    try {
12229                        let abInfo = JSON.parse(existing);
12230                        const test = abTestsById.get(String(abInfo?.id || id));
12231                        if (test) {
12232                            const normalized = normalizeABInfoForTest(abInfo, test);
12233                            if (JSON.stringify(normalized) !== JSON.stringify(abInfo)) {
12234                                setCookie(
12235                                    TEST_COOKIE_PREFIX + id,
12236                                    JSON.stringify(normalized),
12237                                    new Date(normalized.expired || test.endTime)
12238                                );
12239                            }
12240                            abInfo = normalized;
12241                        }
12242                        if (!isSamePageURL(window.location.href, abInfo.url)) continue;
12243                        window.abTest = abInfo;
12244                        console.log("[AB landing fired: cookie-sync]", {
12245                            currentUrl: window.location.href,
12246                            abInfo,
12247                        });
12248                        markLandingSession(abInfo);
12249                        pushDL("ab_landing", abInfo);
12250                        sendABEvent(abInfo);
12251                        return true;
12252                    } catch {
12253                        continue;
12254                    }
12255                }
12256                return false;
12257            };
12258
12259            if (!cfg) {
12260                syncTrackedLandingFromCookie();
12261                return; // 현재 페이지에 해당하는 설정 없음
12262            }
12263
12264            // ===== 활성 ABTEST 우선 =====
12265            {
12266                const now = new Date();
12267                const activeABs = (
12268                    Array.isArray(cfg.abtests) ? cfg.abtests : []
12269                ).filter((test) => {
12270                    return (
12271                        isActiveNow(test, now) &&
12272                        matchesQueryConditions(test) &&
12273                        isSamePageURL(window.location.href, getTestOriginURL(test))
12274                    );
12275                });
12276
12277                if (activeABs.length > 0) {
12278                    // 시간/페이지 조건까지 만족하는 테스트들 안에서 UTM조건 통과 테스트가 있으면 수행
12279                    for (const test of activeABs) {
12280                        if (!matchesUTMConditions(test)) {
12281                            continue;
12282                        }
12283
12284                        // 여기 도달 = 활성 + (조건 통과 또는 조건 없음)
12285
12286                        // [추가] 원본 weight를 대안 합에서 뺀 값으로 계산
12287                        (() => {
12288                            const baseTotal = 100;
12289                            const altSum = (
12290                                Array.isArray(test.alternates) ? test.alternates : []
12291                            ).reduce((s, a) => s + (Number(a?.weight) || 0), 0);
12292
12293                            if (!test.origin) test.origin = { url: test.origin?.url || "" };
12294                            test.origin.weight = Math.max(0, baseTotal - altSum);
12295                            console.log("[AB weight 조정]", {
12296                                originWeight: test.origin.weight,
12297                                altWeights: (test.alternates || []).map((a) => a.weight),
12298                            });
12299                        })();
12300
12301                        const cookieKey = TEST_COOKIE_PREFIX + test.id;
12302                        const endDate = new Date(test.endTime);
12303                        const existing = getCookie(cookieKey);
12304                        if (existing) {
12305                            try {
12306                                let abInfo = JSON.parse(existing);
12307                                const normalized = normalizeABInfoForTest(abInfo, test);
12308                                if (JSON.stringify(normalized) !== JSON.stringify(abInfo)) {
12309                                    setCookie(cookieKey, JSON.stringify(normalized), endDate);
12310                                }
12311                                abInfo = normalized;
12312                                window.abTest = abInfo;
12313                                const isSame = isSamePageURL(
12314                                    window.location.href,
12315                                    abInfo.url
12316                                );
12317                                console.log("[AB redirect check: existing]", {
12318                                    currentUrl: window.location.href,
12319                                    targetUrl: abInfo.url,
12320                                    currentSearch: window.location.search,
12321                                    targetKey: getPageKeyFromURL(abInfo.url, {
12322                                        stripTracking: false,
12323                                    }),
12324                                    currentKey: getPageKeyFromURL(window.location.href, {
12325                                        stripTracking: false,
12326                                    }),
12327                                    isSame,
12328                                    abInfo,
12329                                });
12330                                if (isSame) {
12331                                    console.log("[AB landing fired: existing]", {
12332                                        currentUrl: window.location.href,
12333                                        abInfo,
12334                                    });
12335                                    markLandingSession(abInfo);
12336                                    pushDL("ab_landing", abInfo);
12337                                    sendABEvent(abInfo);
12338                                }
12339                                
12340                            if (!isSame) {
12341                                sendPageviewAndReplace(abInfo.url);
12342                            }
12343                                return; // ABtest 수행 완료
12344                            } catch {
12345                                /* 쿠키 파싱 실패 → 새로 세팅 진행 */
12346                            }
12347                        }
12348
12349                        const candidates = [
12350                            { ...test.origin, url: getTestOriginURL(test) },
12351                            ...test.alternates,
12352                        ];
12353                        const selected =
12354                            candidates.length === 1
12355                                ? candidates[0]
12356                                : weightedRandom(candidates);
12357                        if (!selected?.url) continue;
12358
12359                        const group = determineGroupName(selected.url, test);
12360                        const abInfo = {
12361                            id: String(test.id),
12362                            name: test.name,
12363                            group,
12364                            ratio: String(selected.weight ?? 1),
12365                            url: selected.url,
12366                            expired: endDate.toISOString(),
12367                        };
12368
12369                        setCookie(cookieKey, JSON.stringify(abInfo), endDate);
12370                        window.abTest = abInfo;
12371
12372                        const isSame = isSamePageURL(
12373                            window.location.href,
12374                            selected.url
12375                        );
12376                        console.log("[AB redirect check: selected]", {
12377                            currentUrl: window.location.href,
12378                            targetUrl: selected.url,
12379                            currentSearch: window.location.search,
12380                            targetKey: getPageKeyFromURL(selected.url, {
12381                                stripTracking: false,
12382                            }),
12383                            currentKey: getPageKeyFromURL(window.location.href, {
12384                                stripTracking: false,
12385                            }),
12386                            isSame,
12387                            selected,
12388                            abInfo,
12389                        });
12390                        if (isSame) {
12391                            console.log("[AB landing fired: selected]", {
12392                                currentUrl: window.location.href,
12393                                abInfo,
12394                            });
12395                            markLandingSession(abInfo);
12396                            pushDL("ab_landing", abInfo);
12397                            sendABEvent(abInfo);
12398                        }
12399                        if (!isSame) {
12400                            sendPageviewAndReplace(selected.url);
12401                        }
12402                        return; // ABtest 수행 완료
12403                    }
12404                }
12405            }
12406
12407            if (syncTrackedLandingFromCookie()) {
12408                return;
12409            }
12410
12411            // ===== 2) Redirect (활성 ABtest 없을 때만) =====
12412            if (Array.isArray(cfg.redirects) && cfg.redirects.length > 0) {
12413                for (const r of cfg.redirects) {
12414                    const now = new Date();
12415                    if (!isActiveNow(r, now)) continue;
12416                    if (wasRedirectDone(r.id)) continue;
12417                    if (!matchesQueryConditions(r)) continue;
12418                    if (!matchesUTMConditions(r)) continue;
12419
12420                    const target = r.alternates.find(
12421                        (a) =>
12422                            a.url &&
12423                            !isSamePageURL(window.location.href, a.url)
12424                    );
12425
12426                    if (target?.url) {
12427                        markRedirectDone(r.id);
12428                        location.replace(target.url);
12429                        return;
12430                    }
12431                }
12432            }
12433    } catch (err) {
12434        console.warn("A/B 테스트 처리 실패:", err?.message || err);
12435    }
12436})();
12437

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.