1 2; /* Start:"a:4:{s:4:"full";s:84:"/bitrix/templates/aspro_next/components/bitrix/catalog/main/script.js?17298632751357";s:6:"source";s:69:"/bitrix/templates/aspro_next/components/bitrix/catalog/main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3$(document).on("click","#headerfixed .buy.btn",function(){$(".catalog_detail .buy_block .offer_buy_block .to-cart").length?$(".catalog_detail .buy_block .offer_buy_block .to-cart").is(":visible")?$(".catalog_detail .buy_block .offer_buy_block .to-cart").trigger("click"):location.href=arNextOptions.PAGES.BASKET_PAGE_URL:$(".catalog_detail .buy_block .offer_buy_block .btn").length&&$(".catalog_detail .buy_block .offer_buy_block .btn").trigger("click")}),$(document).on("click","#headerfixed .bx_catalog_item_scu",function(){var t=0;t=$(".catalog_detail .sku_props .bx_catalog_item_scu").offset().top,$("body, html").animate({scrollTop:t-150},500)}),$(document).on("click",".stores-title .stores-title__list",function(){var t=$(this);t.siblings().removeClass("stores-title--active"),t.addClass("stores-title--active"),$(".stores_block_wrap .stores-amount-list").hide(100).removeClass("stores-amount-list--active"),$(".stores_block_wrap .stores-amount-list:eq("+t.index()+")").show(100,function(){t.hasClass("stores-title--map")&&"undefined"!=typeof map&&(void 0!==map.container?map.container.fitToViewport():void 0!==window.google&&"undefined"!=typeof bounds&&map.fitBounds(bounds),"undefined"==typeof clusterer||$(this).find(".detail_items").is(":visible")||map.setBounds(clusterer.getBounds(),{zoomMargin:40}))}).addClass("stores-amount-list--active")}); 4/* End */ 5; 6; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_next/js/slick/slick.min.js?172959399141953";s:6:"source";s:50:"/bitrix/templates/aspro_next/js/slick/slick.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 7/* 8 _ _ _ _ 9 ___| (_) ___| | __ (_)___ 10/ __| | |/ __| |/ / | / __| 11\__ \ | | (__| < _ | \__ \ 12|___/_|_|\___|_|\_(_)/ |___/ 13 |__/ 14 15 Version: 1.6.0 16 Author: Ken Wheeler 17 Website: http://kenwheeler.github.io 18 Docs: http://kenwheeler.github.io/slick 19 Repo: http://github.com/kenwheeler/slick 20 Issues: http://github.com/kenwheeler/slick/issues 21 22 */ 23!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('<button type="button" data-role="none" role="button" tabindex="0" />').text(c+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!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},e.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,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.focussed=!1,e.interrupted=!1,e.hidden="hidden",e.paused=!0,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,d,f),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0)}var b=0;return c}(),b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))}
vendor: 6,412 bytes, line 23
23,complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.getNavTarget=function(){var b=this,c=b.options.asNavFor;return c&&null!==c&&(c=a(c).not(b.$slider)),c},b.prototype.asNavFor=function(b){var c=this,d=c.getNavTarget();null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayClear(),a.slideCount>a.options.slidesToShow&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this,b=a.currentSlide+a.options.slidesToScroll;a.paused||a.interrupted||a.focussed||(a.options.infinite===!1&&(1===a.direction&&a.currentSlide+1===a.slideCount-1?a.direction=0:0===a.direction&&(b=a.currentSlide-a.options.slidesToScroll,a.currentSlide-1===0&&(a.direction=1))),a.slideHandler(b))},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(b.$slider.addClass("slick-dotted"),d=a("<ul />").addClass(b.options.dotsClass),c=0;c<=b.getDotCount();c+=1)d.append(a("<li />").append(b.options.customPaging.call(this,b,c)));b.$dots=d.appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.empty().append(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.currentTarget);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&a("li",b.$dots).off("click.slick",b.changeSlide).off("mouseenter.slick",a.proxy(b.interrupt,b,!0)).off("mouseleave.
23slick",a.proxy(b.interrupt,b,!1)),b.$slider.off("focus.slick blur.slick"),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.cleanUpSlideEvents(),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpSlideEvents=function(){var b=this;b.$list.off("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.empty().append(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.$slider.removeClass("slick-dotted"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.focusHandler=function(){var b=this;b.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.options.pauseOnFocus&&(b.focussed=d.is(":focus"),b.autoPlay())},0)})},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else if(a.options.asNavFor)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else d=1+Math.ceil((a.slideCount-a.options.slidesToShow)/a.options.slidesToScroll);return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.o
vendor: 4,100 bytes, line 23
23ptions.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots(),c.checkResponsive(!0),c.focusHandler()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA(),c.options.autoplay&&(c.paused=!1,c.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.off("click.slick").on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.interrupt,b,!0)).on("mouseleave.slick",a.proxy(b.interrupt,b,!1))},b.prototype.initSlideEvents=function(){var b=this;b.options.pauseOnHover&&(b.$list.on("mouseenter.slick",a.proxy(b.interrupt,b,!0)),b.$list.on("mouseleave.
23slick",a.proxy(b.interrupt,b,!1)))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.initSlideEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:b.options.rtl===!0?"next":"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:b.options.rtl===!0?"previous":"next"}}))},b.prototype.lazyLoad=function(){function g(c){a("img[data-lazy]",c).each(function(){var c=a(this),d=a(this).attr("data-lazy"),e=document.createElement("img");e.onload=function(){c.animate({opacity:0}
23,100,function(){c.attr("src",d).animate({opacity:1},200,function(){c.removeAttr("data-lazy").removeClass("slick-loading")}),b.$slider.trigger("lazyLoaded",[b,c,d])})},e.onerror=function(){c.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),b.$slider.trigger("lazyLoadError",[b,c,d])},e.src=d})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=Math.ceil(e+b.options.slidesToShow),b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.autoPlay(),a.options.autoplay=!0,a.paused=!1,a.focussed=!1,a.interrupted=!1},b.prototype.postSlide=function(a){var b=this;b.unslicked||(b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay&&b.autoPlay(),b.options.accessibility===!0&&b.initADA())},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(b){b=b||1;var e,f,g,c=this,d=a("img[data-lazy]",c.$slider);d.length?(e=d.first(),f=e.attr("data-lazy"),g=document.createElement("img"),g.onload=function(){e.attr("src",f).removeAttr("data-lazy").removeClass("slick-loading"),c.options.adaptiveHeight===!0&&c.setPosition(),c.$slider.trigger("lazyLoaded",[c,e,f]),c.progressiveLazyLoad()},g.onerror=function(){3>b?setTimeout(function(){c.progressiveLazyLoad(b+1)},500):(e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),c.$slider.trigger("lazyLoadError",[c,e,f]),c.progressiveLazyLoad())},g.src=f):c.$slider.trigger("allImagesLoaded",[c])},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,!c.options.infinite&&c.currentSlide>e&&(c.currentSlide=e),c.slideCount<=c.options.slidesToShow&&(c.currentSlide=0),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.cleanUpSlideEvents(),b.initSlideEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.setPosition(),b.focu
vendor: 2,346 bytes, line 23
23sHandler(),b.paused=!b.options.autoplay,b.autoPlay(),b.$slider.trigger("reInit",[b])},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}
vendor: 3,177 bytes, line 23
23):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(){var c,d,e,f,h,b=this,g=!1;if("object"===a.type(arguments[0])?(e=arguments[0],g=arguments[1],h="multiple"):"string"===a.type(arguments[0])&&(e=arguments[0],f=arguments[1],g=arguments[2],"responsive"===arguments[0]&&"array"===a.type(arguments[1])?h="responsive":"undefined"!=typeof arguments[1]&&(h="single")),"single"===h)b.options[e]=f;else if("multiple"===h)a.each(e,function(a,c){b.options[a]=c});else if("responsive"===h)for(d in f)if("array"!==a.type(b.options.responsive))b.options.responsive=[f[d]];else{for(c=b.options.responsive.length-1;c>=0;)b.options.responsive[c].breakpoint===f[d].breakpoint&&b.options.responsive.splice(c,1),c--;b.options.responsive.push(f[d])}g&&(b.unload(),b.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,
vendor: 1,607 bytes, line 24
24d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.
24interrupt=function(a){var b=this;a||b.autoPlay(),b.interrupted=a},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,j,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.options.asNavFor&&(j=i.getNavTarget(),j=j.slick("getSlick"),j.slideCount<=j.options.slidesToShow&&j.setSlideClasses(i.currentSlide)),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"down":"up":"vertical"},b.prototype.swipeEnd=function(a){var c,d,b=this;if(b.dragging=!1,b.interrupted=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe){switch(d=b.swipeDirection()){case"left":case"down":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.currentDirection=0;break;case"right":case"up":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.currentDirection=1}"vertical"!=d&&(b.slideHandler(c),b.touchObject={},b.$slider.trigger("swipe",[b,d]))}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>
vendor: 3,462 bytes, lines 24-27
244&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return b.interrupted=!0,1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;a.options.autoplay&&(document[a.hidden]?a.interrupted=!0:a.interrupted=!1)},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}}); 25/* End */ 26; 27; /* Start:"a:4:{s:4:"full";s:94:"/bitrix/templates/aspro_next/components/bitrix/catalog.element/main/script.
27js?1775643055112634";s:6:"source";s:77:"/bitrix/templates/aspro_next/components/bitrix/catalog.element/main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 28var ItemObj = {}; 29 30$(document).on('click', ".item-stock .store_view", function(){ 31 scroll_block($('.tabs_section')); 32}); 33 34 35$(document).ready(function (){ 36 37 if ($(".similar-products-slider").length) { 38 $(".similar-products-slider").slick({ 39 40 // normal options... 41 slidesToShow: 3, 42 infinite: true, 43 44 // the magic 45 responsive: [{ 46 47 breakpoint: 1024, 48 settings: { 49 slidesToShow: 3, 50 infinite: true 51 } 52 53 }, { 54 55 breakpoint: 768, 56 settings: { 57 slidesToShow: 2, 58 } 59 60 }, { 61 62 breakpoint: 480, 63 settings: { 64 slidesToShow: 1, 65 } 66 }] 67 }); 68 } 69 70 //set fixed tabs 71 $('<div class="product-item-detail-tabs-container-fixed">'+ 72 '<div class="wrapper_inner">'+ 73 '<ul class="product-item-detail-tabs-list nav nav-tabs">'+ 74 $('ul.nav.nav-tabs').html()+ 75 '<li class="last"></li>'+ 76 '</ul>'+ 77 '</div>'+ 78 '</div>').insertAfter($('#headerfixed')); 79 $('.product-item-detail-tabs-list a').addClass('dark_link'); 80 $('.tab_slider_wrapp .tabs > li').first().addClass('cur'); 81 $('.tab_slider_wrapp .slider_navigation > li').first().addClass('cur'); 82 $('.tab_slider_wrapp .tabs_content > li').first().addClass('cur'); 83 84 $('.tab_slider_wrapp .tabs > li').on('click', function(){ 85 InitFlexSlider(); 86 $('.tab_slider_wrapp .tabs_content').height($('.tab_slider_wrapp .tabs_content > li.cur').data('unhover')); 87 $(window).resize(); 88 }); 89 90 $('.items-services .item').sliceHeight(); 91 92 $(document).on({ 93 mouseover: function(e){ 94 e.stopImmediatePropagation(); 95 var tabsContentHover = $(this).closest('.tab').attr('data-hover') * 1; 96 $(this).closest('.tab').fadeTo(100, 1); 97 $(this).closest('.tab').stop().css({'height': tabsContentHover}); 98 $(this).closest('.flex-viewport').stop().css({'height': tabsContentHover}); 99 }, 100 mouseleave: function(e){ 101 e.stopImmediatePropagation(); 102 var tabsContentUnhoverHover = $(this).closest('.tab').attr('data-unhover') * 1; 103 $(this).closest('.tab').stop().animate({'height': tabsContentUnhoverHover}, 100); 104 $(this).closest('.flex-viewport').stop().css({'height': tabsContentUnhoverHover}); 105 } 106 }, '.tabs_slider > li'); 107 108 $(".opener").click(function(){ 109 $(this).find(".opener_icon").toggleClass("opened"); 110 var showBlock = $(this).parents("tr").toggleClass("nb").next(".offer_stores").find(".stores_block_wrap"); 111 showBlock.slideToggle(200); 112 }); 113 114 $('a[data-toggle="tab"]').on('shown.bs.tab', function(e){ 115 var _this = $(e.target), 116 parent = _this.parent(); 117 118 //top nav 119 if(_this.closest('.product-item-detail-tabs-list').length) 120 { 121 var content_offset=$('.tabs_section').offset(), 122 tab_height = $('.product-item-detail-tabs-container-fixed').actual('outerHeight'), 123 hfixed_height = $('#headerfixed').actual('outerHeight'); 124 $('html, body').animate({scrollTop: content_offset.top-hfixed_height-tab_height}, 400); 125 } 126 127 $('.nav.nav-tabs li').each(function(){ 128 $(this).removeClass('active'); 129 if($(this).index() == parent.index()) 130 $(this).addClass('active'); 131 }) 132 133 if(parent.hasClass('product_reviews_tab')) // review 134 { 135 $(".shadow.common").hide(); 136 $("#reviews_content").show(); 137 } 138 else 139 { 140 $(".shadow.common").show(); 141 $("#reviews_content").hide(); 142 143 if($(this).attr('href') == '#descr'){ 144 var $gallery = $('.galerys-block'); 145 if($gallery.length){ 146 var bTypeBig = $gallery.find('.big_slider').length; 147 var $slider = bTypeBig ? $gallery.find('.big_slider') : $gallery.find('.small_slider'); 148 InitFlexSlider(); 149 var interval = setInterval(function(){ 150 if($slider.find('.slides .item').attr('style').indexOf('height') === -1){ 151 $(window).resize(); 152 } 153 else{ 154 clearInterval(interval); 155 } 156 }, 100); 157 } 158 } 159 } 160 }) 161 162 if($('.title-tab-heading').length) 163 { 164 $('.title-tab-heading').on('click', function(){ 165 var _this = $(this), 166 content_offset = _this.offset(); 167 $('html, body').animate({scrollTop: content_offset.top-100}, 400); 168 }) 169 } 170
171 $(document).on('click', ".hint .icon", function(e){ 172 var tooltipWrapp = $(this).parents(".hint"); 173 // tooltipWrapp.click(function(e){e.stopPropagation();}) 174 if(tooltipWrapp.is(".active")){ 175 tooltipWrapp.removeClass("active").find(".tooltip").slideUp(200); 176 } 177 else{ 178 tooltipWrapp.addClass("active").find(".tooltip").slideDown(200); 179 tooltipWrapp.find(".tooltip_close").click(function(e){ 180 e.stopPropagation(); tooltipWrapp.removeClass("active").find(".tooltip").slideUp(100); 181 }); 182 /*$(document).click(function(){ 183 tooltipWrapp.removeClass("active").find(".tooltip").slideUp(100); 184 });*/ 185 } 186 }); 187 188 $('html, body').on('mousedown', function(e) { 189 if(typeof e.target.className == 'string' && e.target.className.indexOf('adm') < 0) 190 { 191 e.stopPropagation(); 192 var hint = $(e.target).closest('.hint'); 193 if(!$(e.target).closest('.hint').length) 194 { 195 $('.hint').removeClass("active").find(".tooltip").slideUp(100); 196 } 197 else 198 { 199 var pos_tmp = hint.offset().top+''+hint.offset().left; 200 $('.hint').each(function(){ 201 var pos_tmp2 = $(this).offset().top+''+$(this).offset().left; 202 if($(this).text()+pos_tmp2 != hint.text()+pos_tmp) 203 { 204 $(this).removeClass("active").find(".tooltip").slideUp(100); 205 } 206 }) 207 } 208 } 209 }) 210 $('.share_wrapp').find('*').on('mousedown', function(e) { 211 e.stopPropagation(); 212 }); 213 214 BX.addCustomEvent('onSlideInit', function(eventdata) { 215 try{ 216 ignoreResize.push(true); 217 if(eventdata){ 218 var slider = eventdata.slider; 219 if(slider){ 220 if(slider.find('.catalog_item').length){ 221 setHeightBlockSlider(); 222 } 223 if(slider.hasClass('small_slider')){ 224 $('.detail .small-gallery-block .item').sliceHeight({lineheight: -3}); 225 } 226 if(slider.hasClass('big_slider')){ 227 $('.detail .big_slider .item').sliceHeight({lineheight: -3}); 228 } 229 } 230 } 231 } 232 catch(e){} 233 finally{ 234 ignoreResize.pop(); 235 } 236 }); 237 238 BX.addCustomEvent('onWindowResize', function(eventdata){ 239 try{ 240 ignoreResize.push(true); 241 InitFlexSlider(); 242 } 243 catch(e){} 244 finally{ 245 ignoreResize.pop(); 246 } 247 }); 248}) 249$('.set_block').ready(function(){ 250 $('.set_block ').equalize({children: '.item:not(".r") .cost', reset: true}); 251 $('.set_block').equalize({children: '.item .item-title', reset: true}); 252 $('.set_block').equalize({children: '.item .item_info', reset: false}); 253}); 254 255(function (window) { 256 257if (!window.JCCatalogOnlyElement) 258{ 259 260 window.JCCatalogOnlyElement = function (arParams) 261 { 262 if (typeof arParams === 'object') 263 { 264 this.params = arParams; 265 266 this.obProduct = null; 267 this.set_quantity = 1; 268 269 this.currentPriceMode = ''; 270 this.currentPrices = []; 271 this.currentPriceSelected = 0; 272 this.currentQuantityRanges = []; 273 this.currentQuantityRangeSelected = 0; 274 275 if (this.params.MESS) 276 { 277 this.mess = this.params.MESS; 278 } 279 280 this.init(); 281 } 282 } 283 window.JCCatalogOnlyElement.prototype = { 284 init: function() 285 { 286 var i = 0, 287 j = 0, 288 treeItems = null; 289 290 this.obProduct = BX(this.params.ID); 291 292 if(!!this.obProduct) 293 { 294 $(this.obProduct).find('.counter_wrapp .counter_block input').data('product', 'ob'+this.obProduct.id+'el'); 295 this.currentPriceMode = this.params.ITEM_PRICE_MODE; 296 this.currentPrices = this.params.ITEM_PRICES; 297 this.currentQuantityRanges = this.params.ITEM_QUANTITY_RANGES; 298 } 299 300 }, 301 302 setPriceAction: function() 303 { 304 this.set_quantity = this.params.MIN_QUANTITY_BUY; 305 if($(this.obProduct).find('input[name=quantity]').length) 306 this.set_quantity = $(this.obProduct).find('input[name=quantity]').val(); 307 308 this.checkPriceRange(this.set_quantity); 309 310 $(this.obProduct).find('.not_matrix').hide(); 311 312 $(this.obProduct).find('.with_matrix .price_value_block').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_PRICE)); 313 314 if($(this.obProduct).find('.with_matrix .discount')) 315 { 316 $(this.obProduct).find('.with_matrix .discount').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE)); 317 } 318 319 if(this.params.SHOW_DISCOUNT_PERCENT_NUMBER == 'Y') 320 { 321 if(this.currentPrices[this.currentPriceSelected].PERCENT > 0 && this.currentPrices[this.currentPriceSelected].PERCENT < 100) 322 { 323 if(!$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 324 $('<div class="value"></div>').insertBefore($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .text')); 325 326 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').html('-<span>'+this.currentPrices[this.currentPriceSelected].PERCENT+'</span>%'); 327 } 328 else 329 { 330 if($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 331 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').remove(); 332 } 333 } 334 335 $(this.obProduct).find('.with_matrix .sale_block .text .values_wrapper').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT)); 336 337 $(this.obProduct).find('.with_matrix').show(); 338 339 if(arNextOptions['THEME']['SHOW_TOTAL_SUMM'] == 'Y') 340 { 341 if(typeof this.currentPrices[this.currentPriceSelected] !== 'undefined') 342 setPriceItem($(this.obProduct), this.set_quantity, this.currentPrices[this.currentPriceSelected].PRICE); 343 } 344 }, 345 346 checkPriceRange: function(quantity) 347 { 348 if (typeof quantity === 'undefined'|| this.currentPriceMode != 'Q') 349 return; 350 351 var range, found = false;
352 353 for (var i in this.currentQuantityRanges) 354 { 355 if (this.currentQuantityRanges.hasOwnProperty(i)) 356 { 357 range = this.currentQuantityRanges[i]; 358 359 if ( 360 parseInt(quantity) >= parseInt(range.SORT_FROM) 361 && ( 362 range.SORT_TO == 'INF' 363 || parseInt(quantity) <= parseInt(range.SORT_TO) 364 ) 365 ) 366 { 367 found = true; 368 this.currentQuantityRangeSelected = range.HASH; 369 break; 370 } 371 } 372 } 373 374 if (!found && (range = this.getMinPriceRange())) 375 { 376 this.currentQuantityRangeSelected = range.HASH; 377 } 378 379 for (var k in this.currentPrices) 380 { 381 if (this.currentPrices.hasOwnProperty(k)) 382 { 383 if (this.currentPrices[k].QUANTITY_HASH == this.currentQuantityRangeSelected) 384 { 385 this.currentPriceSelected = k; 386 break; 387 } 388 } 389 } 390 }, 391 392 getMinPriceRange: function() 393 { 394 var range; 395 396 for (var i in this.currentQuantityRanges) 397 { 398 if (this.currentQuantityRanges.hasOwnProperty(i)) 399 { 400 if ( 401 !range 402 || parseInt(this.currentQuantityRanges[i].SORT_FROM) < parseInt(range.SORT_FROM) 403 ) 404 { 405 range = this.currentQuantityRanges[i]; 406 } 407 } 408 } 409 410 return range; 411 } 412 } 413} 414 415if (!!window.JCCatalogElement) 416{ 417 return; 418} 419 420var BasketButton = function(params) 421{ 422 BasketButton.superclass.constructor.apply(this, arguments); 423 this.nameNode = BX.create('span', { 424 props : { className : 'bx_medium bx_bt_button', id : this.id }, 425 style: typeof(params.style) === 'object' ? params.style : {}, 426 text: params.text 427 }); 428 this.buttonNode = BX.create('span', { 429 attrs: { className: params.ownerClass }, 430 children: [this.nameNode], 431 events : this.contextEvents 432 }); 433 if (BX.browser.IsIE()) 434 { 435 this.buttonNode.setAttribute("hideFocus", "hidefocus"); 436 } 437}; 438BX.extend(BasketButton, BX.PopupWindowButton); 439 440window.JCCatalogElement = function (arParams) 441{ 442 this.skuVisualParams = { 443 SELECT: 444 { 445 TAG_BIND: 'select', 446 TAG: 'option', 447 ACTIVE_CLASS: 'active', 448 HIDE_CLASS: 'hidden', 449 EVENT: 'change', 450 }, 451 LI: 452 { 453 TAG_BIND: 'li', 454 TAG: 'li', 455 ACTIVE_CLASS: 'active', 456 HIDE_CLASS: 'missing', 457 EVENT: 'click', 458 } 459 }; 460 this.productType = 0; 461 462 this.config = { 463 useCatalog: true, 464 showQuantity: true, 465 showPrice: true, 466 showAbsent: true, 467 showOldPrice: false, 468 showPercent: false, 469 showSkuProps: false, 470 showOfferGroup: false, 471 useCompare: false, 472 mainPictureMode: 'IMG', 473 showBasisPrice: false, 474 showPercentNumber: false, 475 basketAction: ['BUY'], 476 showClosePopup: false 477 }; 478 479 this.basketLinkURL = ''; 480 481 this.checkQuantity = false; 482 this.maxQuantity = 0; 483 this.SliderImages=0; 484 this.defaultCount = 1; 485 this.stepQuantity = 1; 486 this.isDblQuantity = false; 487 this.canBuy = true; 488 this.currentBasisPrice = {}; 489 this.canSubscription = true; 490 this.currentIsSet = false; 491 this.updateViewedCount = false; 492 493 this.currentPriceMode = ''; 494 this.currentPrices = []; 495 this.currentPriceSelected = 0; 496 this.currentQuantityRanges = []; 497 this.currentQuantityRangeSelected = 0; 498 499 this.precision = 6; 500 this.precisionFactor = Math.pow(10,this.precision); 501 502 this.listID = { 503 main: ['PICT_ID', 'BIG_SLIDER_ID', 'BIG_IMG_CONT_ID'], 504 stickers: ['STICKER_ID'], 505 productSlider: ['SLIDER_CONT', 'SLIDER_LIST', 'SLIDER_LEFT', 'SLIDER_RIGHT'], 506 offerSlider: ['SLIDER_CONT_OF_ID', 'SLIDER_LIST_OF_ID', 'SLIDER_LEFT_OF_ID', 'SLIDER_RIGHT_OF_ID'], 507 offerSliderMobile: ['SLIDER_CONT_OFM_ID', 'SLIDER_LIST_OFM_ID', 'SLIDER_LEFT_OFM_ID', 'SLIDER_RIGHT_OFM_ID'], 508 offers: ['TREE_ID', 'TREE_ITEM_ID', 'DISPLAY_PROP_DIV', 'DISPLAY_PROP_ARTICLE_DIV', 'OFFER_GROUP'], 509 quantity: ['QUANTITY_ID', 'QUANTITY_UP_ID', 'QUANTITY_DOWN_ID', 'QUANTITY_MEASURE', 'QUANTITY_LIMIT', 'BASIS_PRICE'], 510 price: ['PRICE_ID'], 511 oldPrice: ['OLD_PRICE_ID', 'DISCOUNT_VALUE_ID'], 512 discountPerc: ['DISCOUNT_PERC_ID'], 513 basket: ['BASKET_PROP_DIV', 'BUY_ID', 'BASKET_LINK', 'ADD_BASKET_ID', 'BASKET_ACTIONS_ID', 'NOT_AVAILABLE_MESS', 'SUBSCRIBE_ID', 'SUBSCRIBED_ID'], 514 magnifier: ['MAGNIFIER_ID', 'MAGNIFIER_AREA_ID'], 515 compare: ['COMPARE_LINK_ID'] 516 }; 517 518 this.visualPostfix = { 519 // main pict 520 PICT_ID: '_pict', 521 BIG_SLIDER_ID: '_big_slider', 522 BIG_IMG_CONT_ID: '_bigimg_cont', 523 // stickers 524 STICKER_ID: '_sticker', 525 // product pict slider 526 SLIDER_CONT: '_slider_cont', 527 SLIDER_LIST: '_slider_list', 528 SLIDER_LEFT: '_slider_left', 529 SLIDER_RIGHT: '_slider_right', 530 // offers sliders 531 SLIDER_CONT_OF_ID: '_slider_cont_', 532 SLIDER_LIST_OF_ID: '_slider_list_', 533 SLIDER_LEFT_OF_ID: '_slider_left_', 534 SLIDER_RIGHT_OF_ID: '_slider_right_', 535 // offers sliders mobile 536 SLIDER_CONT_OFM_ID: '_sliderm_cont_', 537 SLIDER_LIST_OFM_ID: '_sliderm_list_', 538 SLIDER_LEFT_OFM_ID: '_sliderm_left_', 539 SLIDER_RIGHT_OFM_ID: '_sliderm_right_', 540 // offers 541 TREE_ID: '_skudiv', 542 TREE_ITEM_ID: '_prop_', 543 DISPLAY_PROP_DIV: '_sku_prop', 544 DISPLAY_PROP_ARTICLE_DIV: '_sku_article_prop', 545 // quantity 546 QUANTITY_ID: '_quantity', 547 QUANTITY_UP_ID: '_quant_up', 548 QUANTITY_DOWN_ID: '_quant_down', 549 QUANTITY_MEASURE: '_quant_measure', 550 QUANTITY_LIMIT: '_quant_limit', 551 BASIS_PRICE: '_basis_price', 552 // price and discount 553 PRICE_ID: '_price', 554 OLD_PRICE_ID: '_old_price', 555 DISCOUNT_VALUE_ID: '_price_discount', 556 DISCOUNT_PERC_ID: '_dsc_pict', 557 // basket 558 BASKET_PROP_DIV: '_basket_prop', 559 BUY_ID: '_buy_link', 560 BASKET_LINK: '_basket_link', 561 ADD_BASKET_ID: '_add_basket_link', 562 BASKET_ACTIONS_ID: '_basket_actions', 563 NOT_AVAILABLE_MESS: '_not_avail', 564 SUBSCRIBE_ID: '_subscribe_div', 565 SUBSCRIBED_ID: '_subscribed_div', 566 // magnifier 567 MAGNIFIER_ID: '_magnifier', 568 MAGNIFIER_AREA_ID: '_magnifier_area', 569 // offer groups 570 OFFER_GROUP: '_set_group_', 571 // compare 572 COMPARE_LINK_ID: '_compare_link' 573 }; 574 575 this.visual = {}; 576 577 this.basketMode = ''; 578 this.product = { 579 checkQuantity: false, 580 maxQuantity: 0, 581 stepQuantity: 1, 582 startQuantity: 1, 583 isDblQuantity: false, 584 canBuy: true, 585 canSubscription: true, 586 name: '', 587 pict: {}, 588 id: 0, 589 addUrl: '', 590 buyUrl: '', 591 slider: {}, 592 sliderCount: 0, 593 useSlider: false, 594 sliderPict: [] 595 }; 596 this.mess = {}; 597 598 this.basketData = { 599 useProps: false, 600 emptyProps: false, 601 quantity: 'quantity', 602 props: 'prop', 603 basketUrl: '', 604 sku_props: '', 605 sku_props_var: 'basket_props', 606 add_url: '', 607 buy_url: '' 608 }; 609 this.compareData = { 610 compareUrl: '', 611 comparePath: '' 612 }; 613 614 this.defaultPict = { 615 preview: null, 616 detail: null 617 }; 618 619 this.offers = []; 620 this.offerNum = 0; 621 this.treeProps = []; 622 this.obTreeRows = []; 623 this.showCount = []; 624 this.showStart = []; 625 this.selectedValues = {}; 626 this.sliders = []; 627 628 this.obProduct = null; 629 this.obQuantity = null; 630 this.obQuantityUp = null; 631 this.obQuantityDown = null; 632 this.obBasisPrice = null; 633 this.obPict = null; 634 this.obPictAligner = null; 635 this.obPrice = { 636 price: null, 637 full: null, 638 discount: null, 639 percent: null 640 }; 641 this.obTree = null; 642 this.obBuyBtn = null; 643 this.obBasketBtn = null; 644 this.obAddToBasketBtn = null; 645 this.obBasketActions = null; 646 this.obNotAvail = null; 647 this.obSkuProps = null; 648 this.obSlider = null; 649 this.obMeasure = null; 650 this.obQuantityLimit = { 651 all: null, 652 value: null 653 }; 654 this.obCompare = null; 655 656 this.viewedCounter = { 657 path: '/bitrix/components/bitrix/catalog.element/ajax.php', 658 params: { 659 AJAX: 'Y', 660 SITE_ID: '', 661 PRODUCT_ID: 0, 662 PARENT_ID: 0 663 } 664 }; 665 666 this.currentImg = { 667 src: '', 668 width: 0, 669 height: 0, 670 screenWidth: 0, 671 screenHeight: 0, 672 screenOffsetX: 0, 673 screenOffsetY: 0, 674 scale: 1 675 }; 676 this.currentBigImg = { 677 src: '', 678 } 679 680 this.obPopupWin = null; 681 this.basketUrl = ''; 682 this.basketParams = {}; 683 684 this.obPopupPict = null; 685 this.magnify = { 686 obMagnifier: null, 687 obMagnifyPict: null, 688 obMagnifyArea: null, 689 obBigImg: null, 690 obBigSlider: null, 691 magnifyShow: false, 692 areaParams : { 693 width: 100, 694 height: 130, 695 left: 0, 696 top: 0, 697 scaleFactor: 1, 698 globalLeft: 0, 699 globalTop: 0, 700 globalRight: 0, 701 globalBottom: 0 702 }, 703 magnifierParams: { 704 top: 0, 705 left: 0, 706 width: 0, 707 height: 0, 708 ratioX: 10, 709 ratioY: 13, 710 defaultScale: 1 711 }, 712 magnifyPictParams: { 713 marginTop: 0, 714 marginLeft: 0, 715 width: 0, 716 height: 0 717 } 718 }; 719 720 this.treeRowShowSize = 5; 721 this.treeEnableArrow = { display: '', cursor: 'pointer', opacity: 1 }; 722 this.treeDisableArrow = { display: '', cursor: 'default', opacity: 0.2 }; 723 this.sliderRowShowSize = 5; 724 this.sliderEnableArrow = { display: '', cursor: 'pointer', opacity: 1 }; 725 this.sliderDisableArrow = { display: '', cursor: 'default', opacity: 0.2 }; 726 727 this.errorCode = 0; 728 if (typeof arParams === 'object') 729 {
730 this.params = arParams; 731 this.initConfig(); 732 733 if (!!this.params.MESS) 734 { 735 this.mess = this.params.MESS; 736 } 737 switch (this.productType) 738 { 739 case 0:// no catalog 740 case 1://product 741 case 2://set 742 this.initProductData(); 743 break; 744 case 3://sku 745 this.initOffersData(); 746 break; 747 default: 748 this.errorCode = -1; 749 } 750 751 this.initBasketData(); 752 this.initCompareData(); 753 } 754 if (0 === this.errorCode) 755 { 756 BX.ready(BX.delegate(this.Init,this)); 757 } 758 this.params = {}; 759}; 760 761window.JCCatalogElement.prototype.Init = function() 762{ 763 var i = 0, 764 j = 0, 765 strPrefix = '', 766 SliderImgs = null, 767 TreeItems = null; 768 769 this.obProduct = BX(this.visual.ID); 770 if (!this.obProduct) 771 { 772 this.errorCode = -1; 773 } 774 this.obPict = BX(this.visual.PICT_ID); 775 if (!this.obPict) 776 { 777 this.errorCode = -2; 778 } 779 else 780 { 781 this.obPictAligner = this.obPict.parentNode; 782 } 783 784 if (this.config.showPrice) 785 { 786 this.obPrice.price = BX(this.visual.PRICE_ID); 787 if (!this.obPrice.price && this.config.useCatalog) 788 { 789 this.errorCode = -16; 790 } 791 else 792 { 793 if (this.config.showOldPrice) 794 { 795 this.obPrice.full = BX(this.visual.OLD_PRICE_ID); 796 this.obPrice.discount = BX(this.visual.DISCOUNT_VALUE_ID); 797 if(!!this.obPrice.full) 798 BX.adjust(this.obPrice.full, {style: {display: 'none'}, html: ''}); 799 /*if (!this.obPrice.full || !this.obPrice.discount) 800 { 801 this.config.showOldPrice = false; 802 }*/ 803 } 804 if (this.config.showPercent) 805 { 806 this.obPrice.percent = BX(this.visual.DISCOUNT_PERC_ID); 807 /*if (!this.obPrice.percent) 808 { 809 this.config.showPercent = false; 810 }*/ 811 } 812 } 813 this.obBasketActions = BX(this.visual.BASKET_ACTIONS_ID); 814 if (!!this.obBasketActions) 815 { 816 if (BX.util.in_array('BUY', this.config.basketAction)) 817 { 818 this.obBuyBtn = BX(this.visual.BUY_ID); 819 } 820 if (BX.util.in_array('ADD', this.config.basketAction)) 821 { 822 this.obAddToBasketBtn = BX(this.visual.BUY_ID); 823 } 824 if (!!this.visual.BASKET_LINK) 825 { 826 this.obBasketBtn = BX(this.visual.BASKET_LINK); 827 } 828 829 } 830 this.obNotAvail = BX(this.visual.NOT_AVAILABLE_MESS); 831 } 832 833 if (this.config.showQuantity) 834 { 835 this.obQuantity = BX(this.visual.QUANTITY_ID); 836 if (!!this.visual.QUANTITY_UP_ID) 837 { 838 this.obQuantityUp = BX(this.visual.QUANTITY_UP_ID); 839 } 840 if (!!this.visual.QUANTITY_DOWN_ID) 841 { 842 this.obQuantityDown = BX(this.visual.QUANTITY_DOWN_ID); 843 } 844 if (this.config.showBasisPrice) 845 { 846 this.obBasisPrice = BX(this.visual.BASIS_PRICE); 847 } 848 } 849 if (3 === this.productType) 850 { 851 if (!!this.visual.TREE_ID) 852 { 853 this.obTree = BX(this.visual.TREE_ID); 854 if (!this.obTree) 855 { 856 this.errorCode = -256; 857 } 858 strPrefix = this.visual.TREE_ITEM_ID; 859 for (i = 0; i < this.treeProps.length; i++) 860 { 861 this.obTreeRows[i] = { 862 LEFT: BX(strPrefix+this.treeProps[i].ID+'_left'), 863 RIGHT: BX(strPrefix+this.treeProps[i].ID+'_right'), 864 LIST: BX(strPrefix+this.treeProps[i].ID+'_list'), 865 CONT: BX(strPrefix+this.treeProps[i].ID+'_cont') 866 }; 867 if (!this.obTreeRows[i].LIST || !this.obTreeRows[i].CONT) 868 { 869 this.errorCode = -512; 870 break; 871 } 872 } 873 } 874 if (!!this.visual.QUANTITY_MEASURE) 875 { 876 this.obMeasure = BX(this.visual.QUANTITY_MEASURE); 877 } 878 if (!!this.visual.QUANTITY_LIMIT) 879 { 880 this.obQuantityLimit.all = BX(this.visual.QUANTITY_LIMIT); 881 if (!!this.obQuantityLimit.all) 882 { 883 this.obQuantityLimit.value = BX.findChild(this.obQuantityLimit.all, {tagName: 'span'}, false, false); 884 if (!this.obQuantityLimit.value) 885 { 886 this.obQuantityLimit.all = null; 887 } 888 } 889 } 890 } 891 892 if (this.config.showSkuProps) 893 { 894 if (!!this.visual.DISPLAY_PROP_DIV) 895 { 896 this.obSkuProps = BX(this.visual.DISPLAY_PROP_DIV); 897 } 898 if (!!this.visual.DISPLAY_PROP_ARTICLE_DIV) 899 { 900 this.obSkuArticleProps = BX(this.visual.DISPLAY_PROP_ARTICLE_DIV); 901 } 902 903 } 904 905 if (this.config.useCompare) 906 { 907 this.obCompare = BX(this.visual.COMPARE_LINK_ID); 908 } 909 if (0 === this.errorCode) 910 { 911 912 if (this.config.showQuantity) 913 { 914 if (!!this.obQuantityUp) 915 { 916 BX.bind(this.obQuantityUp, 'click', BX.delegate(this.QuantityUp, this)); 917 } 918 if (!!this.obQuantityDown) 919 { 920 BX.bind(this.obQuantityDown, 'click', BX.delegate(this.QuantityDown, this)); 921 } 922 if (!!this.obQuantity) 923 { 924 BX.bind(this.obQuantity, 'change', BX.delegate(this.QuantityChange, this)); 925 } 926 } 927 switch (this.productType) 928 { 929 case 0://no catalog 930 case 1://product 931 case 2://set 932 if (this.product.useSlider) 933 { 934 this.product.slider = { 935 COUNT: this.product.sliderCount, 936 ID: this.visual.SLIDER_CONT, 937 CONT: BX(this.visual.SLIDER_CONT), 938 LIST: BX(this.visual.SLIDER_LIST), 939 LEFT: BX(this.visual.SLIDER_LEFT), 940 RIGHT: BX(this.visual.SLIDER_RIGHT), 941 START: 0 942 }; 943 SliderImgs = BX.findChildren(this.product.slider.LIST, {tagName: 'li'}, true); 944 if (!!SliderImgs && 0 < SliderImgs.length) 945 { 946 for (j = 0; j < SliderImgs.length; j++) 947 { 948 BX.bind(SliderImgs[j], 'click', BX.delegate(this.ProductSelectSliderImg, this)); 949 } 950 } 951 if (!!this.product.slider.LEFT) 952 { 953 BX.bind(this.product.slider.LEFT, 'click', BX.delegate(this.ProductSliderRowLeft, this)); 954 BX.adjust(this.product.slider.LEFT, { style: this.sliderDisableArrow } ); 955 956 } 957 if (!!this.product.slider.RIGHT) 958 { 959 BX.bind(this.product.slider.RIGHT, 'click', BX.delegate(this.ProductSliderRowRight, this)); 960 BX.adjust(this.product.slider.RIGHT, { style: this.sliderEnableArrow } ); 961 } 962 this.setCurrentImg(this.product.sliderPict[0], true); 963 } 964 break; 965 case 3://sku 966 for(var key in this.skuVisualParams){ 967 var TreeItems = BX.findChildren(this.obTree, {tagName: this.skuVisualParams[key].TAG_BIND}, true); 968 if (!!TreeItems && 0 < TreeItems.length){ 969 for (i = 0; i < TreeItems.length; i++){ 970 $(TreeItems[i]).on(this.skuVisualParams[key].EVENT, BX.delegate(this.SelectOfferProp, this)); 971 //BX.bind(TreeItems[i], this.skuVisualParams[key].EVENT, BX.delegate(this.SelectOfferProp, this)); 972 } 973 } 974 } 975 for (i = 0; i < this.offers.length; i++) 976 { 977 this.offers[i].SLIDER_COUNT = parseInt(this.offers[i].SLIDER_COUNT, 10); 978 if (isNaN(this.offers[i].SLIDER_COUNT)) 979 { 980 this.offers[i].SLIDER_COUNT = 0; 981 } 982 if (0 === this.offers[i].SLIDER_COUNT) 983 { 984 this.sliders[i] = { 985 COUNT: this.offers[i].SLIDER_COUNT, 986 ID: '' 987 }; 988 } 989 else 990 { 991 for (j = 0; j < this.offers[i].SLIDER.length; j++) 992 { 993 this.offers[i].SLIDER[j].WIDTH = parseInt(this.offers[i].SLIDER[j].WIDTH, 10); 994 this.offers[i].SLIDER[j].HEIGHT = parseInt(this.offers[i].SLIDER[j].HEIGHT, 10); 995 } 996 this.sliders[i] = { 997 COUNT: this.offers[i].SLIDER_COUNT, 998 OFFER_ID: this.offers[i].ID, 999 ID: this.visual.SLIDER_CONT_OF_ID+this.offers[i].ID, 1000 CONT: BX(this.visual.SLIDER_CONT_OF_ID+this.offers[i].ID), 1001 LIST: BX(this.visual.SLIDER_LIST_OF_ID+this.offers[i].ID), 1002 CONT_M: BX(this.visual.SLIDER_CONT_OFM_ID+this.offers[i].ID), 1003 LIST_M: BX(this.visual.SLIDER_LIST_OFM_ID+this.offers[i].ID), 1004 LEFT: BX(this.visual.SLIDER_LEFT_OF_ID+this.offers[i].ID), 1005 RIGHT: BX(this.visual.SLIDER_RIGHT_OF_ID+this.offers[i].ID), 1006 START: 0 1007 }; 1008 SliderImgs = BX.findChildren(this.sliders[i].LIST, {tagName: 'li'}, true); 1009 if (!!SliderImgs && 0 < SliderImgs.length) 1010 { 1011 for (j = 0; j < SliderImgs.length; j++) 1012 { 1013 BX.bind(SliderImgs[j], 'click', BX.delegate(this.SelectSliderImg, this)); 1014 } 1015 } 1016 if (!!this.sliders[i].LEFT) 1017 { 1018 BX.bind(this.sliders[i].LEFT, 'click', BX.delegate(this.SliderRowLeft, this)); 1019 } 1020 if (!!this.sliders[i].RIGHT) 1021 { 1022 BX.bind(this.sliders[i].RIGHT, 'click', BX.delegate(this.SliderRowRight, this)); 1023 } 1024 } 1025 } 1026 this.SetCurrent(); 1027 1028 break; 1029 } 1030 1031 if (!!this.obBuyBtn) 1032 { 1033 BX.bind(this.obBuyBtn, 'click', BX.proxy(this.BuyBasket, this)); 1034 } 1035 if (!!this.obAddToBasketBtn) 1036 { 1037 BX.bind(this.obAddToBasketBtn, 'click', BX.proxy(this.Add2Basket, this)); 1038 } 1039 if (!!this.obCompare) 1040 { 1041 BX.bind(this.obCompare, 'click', BX.proxy(this.Compare, this)); 1042 } 1043 1044 this.setMainPictHandler(); 1045 setTimeout(function(){ 1046 $('.offers_img.wof').css('opacity', 1); 1047 },400); 1048 } 1049}; 1050 1051window.JCCatalogElement.prototype.initConfig = function() 1052{ 1053 this.productType = parseInt(this.params.PRODUCT_TYPE, 10); 1054 if (!!this.params.CONFIG && typeof(this.params.CONFIG) === 'object') 1055 { 1056 1057 if (this.params.CONFIG.USE_CATALOG !== 'undefined' && BX.type.isBoolean(this.params.CONFIG.USE_CATALOG)) 1058 { 1059 this.config.useCatalog = this.params.CONFIG.USE_CATALOG;
1060 } 1061 this.config.showQuantity = !!this.params.CONFIG.SHOW_QUANTITY; 1062 this.config.showPrice = !!this.params.CONFIG.SHOW_PRICE; 1063 this.config.showPercent = !!this.params.CONFIG.SHOW_DISCOUNT_PERCENT; 1064 this.config.showOldPrice = !!this.params.CONFIG.SHOW_OLD_PRICE; 1065 this.config.showSkuProps = !!this.params.CONFIG.SHOW_SKU_PROPS; 1066 this.config.showOfferGroup = !!this.params.CONFIG.OFFER_GROUP; 1067 this.config.useCompare = !!this.params.CONFIG.DISPLAY_COMPARE; 1068 this.config.showPercentNumber = (this.params.SHOW_DISCOUNT_PERCENT_NUMBER == "Y"); 1069 if (!!this.params.CONFIG.MAIN_PICTURE_MODE) 1070 { 1071 this.config.mainPictureMode = this.params.CONFIG.MAIN_PICTURE_MODE; 1072 } 1073 this.config.showBasisPrice = !!this.params.CONFIG.SHOW_BASIS_PRICE; 1074 if (!!this.params.CONFIG.ADD_TO_BASKET_ACTION) 1075 { 1076 this.config.basketAction = this.params.CONFIG.ADD_TO_BASKET_ACTION; 1077 } 1078 this.config.showClosePopup = !!this.params.CONFIG.SHOW_CLOSE_POPUP; 1079 } 1080 else 1081 { 1082 // old version 1083 if (this.params.USE_CATALOG !== 'undefined' && BX.type.isBoolean(this.params.USE_CATALOG)) 1084 { 1085 this.config.useCatalog = this.params.USE_CATALOG; 1086 } 1087 this.config.showQuantity = !!this.params.SHOW_QUANTITY; 1088 this.config.showPrice = !!this.params.SHOW_PRICE; 1089 this.config.showPercent = !!this.params.SHOW_DISCOUNT_PERCENT; 1090 this.config.showOldPrice = !!this.params.SHOW_OLD_PRICE; 1091 this.config.showSkuProps = !!this.params.SHOW_SKU_PROPS; 1092 this.config.showOfferGroup = !!this.params.OFFER_GROUP; 1093 this.config.useCompare = !!this.params.DISPLAY_COMPARE; 1094 if (!!this.params.MAIN_PICTURE_MODE) 1095 { 1096 this.config.mainPictureMode = this.params.MAIN_PICTURE_MODE; 1097 } 1098 this.config.showBasisPrice = !!this.params.SHOW_BASIS_PRICE; 1099 if (!!this.params.ADD_TO_BASKET_ACTION) 1100 { 1101 this.config.basketAction = this.params.ADD_TO_BASKET_ACTION; 1102 } 1103 this.config.showClosePopup = !!this.params.SHOW_CLOSE_POPUP; 1104 } 1105 1106 if (!this.params.VISUAL || typeof(this.params.VISUAL) !== 'object' || !this.params.VISUAL.ID) 1107 { 1108 this.errorCode = -1; 1109 return; 1110 } 1111 this.visual.ID = this.params.VISUAL.ID; 1112 this.basketLinkURL = this.params.BASKET.BASKET_URL; 1113 this.defaultCount = this.params.DEFAULT_COUNT; 1114 this.storeQuanity = BX(this.params.STORE_QUANTITY); 1115 this.initVisualParams('main'); 1116 if (this.config.showQuantity) 1117 { 1118 this.initVisualParams('quantity'); 1119 } 1120 if (this.config.showPrice) 1121 { 1122 this.initVisualParams('price'); 1123 } 1124 if (this.config.showOldPrice) 1125 { 1126 this.initVisualParams('oldPrice'); 1127 } 1128 if (this.config.showPercent) 1129 { 1130 this.initVisualParams('discountPerc'); 1131 } 1132 this.initVisualParams('basket'); 1133 if (this.config.mainPictureMode === 'MAGNIFIER') 1134 { 1135 this.initVisualParams('magnifier'); 1136 } 1137 if (this.config.useCompare) 1138 { 1139 this.initVisualParams('compare'); 1140 } 1141}; 1142 1143window.JCCatalogElement.prototype.initVisualParams = function(ID) 1144{ 1145 var i = 0, 1146 key = ''; 1147 1148 if (!this.listID[ID]) 1149 { 1150 this.errorCode = -1; 1151 return; 1152 } 1153 for (i = 0; i < this.listID[ID].length; i++) 1154 { 1155 key = this.listID[ID][i]; 1156 this.visual[key] = (!!this.params.VISUAL[key] ? this.params.VISUAL[key] : this.visual.ID+this.visualPostfix[key]); 1157 } 1158}; 1159 1160window.JCCatalogElement.prototype.initProductData = function() 1161{ 1162 var j = 0; 1163 this.initVisualParams('productSlider'); 1164 1165 if (!!this.params.PRODUCT && 'object' === typeof(this.params.PRODUCT)) 1166 { 1167 if (this.config.showQuantity) 1168 { 1169 this.product.checkQuantity = this.params.PRODUCT.CHECK_QUANTITY; 1170 this.product.isDblQuantity = this.params.PRODUCT.QUANTITY_FLOAT; 1171 1172 1173 if (this.product.checkQuantity) 1174 { 1175 this.product.maxQuantity = (this.product.isDblQuantity ? parseFloat(this.params.PRODUCT.MAX_QUANTITY) : parseInt(this.params.PRODUCT.MAX_QUANTITY, 10)); 1176 } 1177 this.product.stepQuantity = (this.product.isDblQuantity ? parseFloat(this.params.PRODUCT.STEP_QUANTITY) : parseInt(this.params.PRODUCT.STEP_QUANTITY, 10)); 1178 1179 this.checkQuantity = this.product.checkQuantity; 1180 this.isDblQuantity = this.product.isDblQuantity; 1181 this.maxQuantity = this.product.maxQuantity; 1182 this.stepQuantity = this.product.stepQuantity; 1183 if (this.isDblQuantity) 1184 { 1185 this.stepQuantity = Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor; 1186 } 1187 } 1188 1189 this.product.canBuy = this.params.PRODUCT.CAN_BUY; 1190 this.product.canSubscription = this.params.PRODUCT.SUBSCRIPTION; 1191 if (this.config.showPrice) 1192 { 1193 this.currentBasisPrice = this.params.PRODUCT.BASIS_PRICE; 1194 } 1195 1196 this.canBuy = this.product.canBuy; 1197 this.canSubscription = this.product.canSubscription; 1198 1199 this.product.name = this.params.PRODUCT.NAME; 1200 this.product.pict = this.params.PRODUCT.PICT; 1201 this.product.id = this.params.PRODUCT.ID; 1202 1203 if (!!this.params.PRODUCT.ADD_URL) 1204 { 1205 this.product.addUrl = this.params.PRODUCT.ADD_URL; 1206 } 1207 if (!!this.params.PRODUCT.BUY_URL) 1208 { 1209 this.product.buyUrl = this.params.PRODUCT.BUY_URL; 1210 } 1211 1212 if (!!this.params.PRODUCT.SLIDER_COUNT) 1213 { 1214 this.product.sliderCount = parseInt(this.params.PRODUCT.SLIDER_COUNT, 10); 1215 if (isNaN(this.product.sliderCount)) 1216 { 1217 this.product.sliderCount = 0; 1218 } 1219 if (0 < this.product.sliderCount && !!this.params.PRODUCT.SLIDER.length && 0 < this.params.PRODUCT.SLIDER.length) 1220 { 1221 for (j = 0; j < this.params.PRODUCT.SLIDER.length; j++) 1222 { 1223 this.product.useSlider = true; 1224 this.params.PRODUCT.SLIDER[j].WIDTH = parseInt(this.params.PRODUCT.SLIDER[j].WIDTH, 10); 1225 this.params.PRODUCT.SLIDER[j].HEIGHT = parseInt(this.params.PRODUCT.SLIDER[j].HEIGHT, 10); 1226 } 1227 this.product.sliderPict = this.params.PRODUCT.SLIDER; 1228 this.setCurrentImg(this.product.sliderPict[0], false); 1229 } 1230 } 1231 this.currentIsSet = true; 1232 } 1233 else 1234 { 1235 this.errorCode = -1; 1236 } 1237}; 1238 1239window.JCCatalogElement.prototype.initOffersData = function() 1240{ 1241 this.initVisualParams('offerSlider'); 1242 this.initVisualParams('offerSliderMobile'); 1243 this.initVisualParams('offers'); 1244 if (!!this.params.OFFERS && BX.type.isArray(this.params.OFFERS)) 1245 { 1246 this.offers = this.params.OFFERS; 1247 this.offerNum = 0; 1248 if (!!this.params.OFFER_SELECTED) 1249 { 1250 this.offerNum = parseInt(this.params.OFFER_SELECTED, 10); 1251 if('offers' in this) 1252 { 1253 if(this.offers.length) 1254 { 1255 var objUrl = parseUrlQuery(), 1256 sku_params = this.params.SKU_DETAIL_ID, 1257 sku_id = 0; 1258 if('oid' in objUrl) 1259 sku_id = objUrl.oid; 1260 if(sku_id) 1261 { 1262 for(var i in this.offers) 1263 { 1264 if(this.offers[i].ID == sku_id) 1265 this.offerNum = parseInt(i, 10); 1266 1267 } 1268 } 1269 } 1270 } 1271 } 1272 if (isNaN(this.offerNum)) 1273 { 1274 this.offerNum = 0; 1275 } 1276 if (!!this.params.TREE_PROPS) 1277 { 1278 this.treeProps = this.params.TREE_PROPS; 1279 } 1280 if (!!this.params.DEFAULT_PICTURE) 1281 { 1282 this.defaultPict.preview = this.params.DEFAULT_PICTURE.PREVIEW_PICTIRE; 1283 this.defaultPict.detail = this.params.DEFAULT_PICTURE.DETAIL_PICTURE; 1284 } 1285 if (!!this.params.PRODUCT && typeof(this.params.PRODUCT) === 'object') 1286 { 1287 this.product.id = parseInt(this.params.PRODUCT.ID, 10); 1288 this.product.name = this.params.PRODUCT.NAME; 1289 } 1290 } 1291 else 1292 { 1293 this.errorCode = -1; 1294 } 1295}; 1296 1297window.JCCatalogElement.prototype.initBasketData = function() 1298{ 1299 if (!!this.params.BASKET && 'object' === typeof(this.params.BASKET)) 1300 { 1301 if (1 === this.productType || 2 === this.productType) 1302 { 1303 this.basketData.useProps = !!this.params.BASKET.ADD_PROPS; 1304 this.basketData.emptyProps = !!this.params.BASKET.EMPTY_PROPS; 1305 } 1306 1307 if (!!this.params.BASKET.QUANTITY) 1308 { 1309 this.basketData.quantity = this.params.BASKET.QUANTITY; 1310 } 1311 if (!!this.params.BASKET.PROPS) 1312 { 1313 this.basketData.props = this.params.BASKET.PROPS; 1314 } 1315 if (!!this.params.BASKET.BASKET_URL) 1316 { 1317 this.basketData.basketUrl = this.params.BASKET.BASKET_URL; 1318 } 1319 if (3 === this.productType) 1320 { 1321 if (!!this.params.BASKET.SKU_PROPS) 1322 { 1323 this.basketData.sku_props = this.params.BASKET.SKU_PROPS; 1324 } 1325 } 1326 if (!!this.params.BASKET.ADD_URL_TEMPLATE) 1327 { 1328 this.basketData.add_url = this.params.BASKET.ADD_URL_TEMPLATE; 1329 } 1330 if (!!this.params.BASKET.BUY_URL_TEMPLATE) 1331 { 1332 this.basketData.buy_url = this.params.BASKET.BUY_URL_TEMPLATE; 1333 } 1334 if (this.basketData.add_url === '' && this.basketData.buy_url === '') 1335 { 1336 this.errorCode = -1024; 1337 } 1338 } 1339}; 1340 1341window.JCCatalogElement.prototype.initCompareData = function() 1342{ 1343 if (this.config.useCompare) 1344 { 1345 if (!!this.params.COMPARE && typeof(this.params.COMPARE) === 'object') 1346 { 1347 if (!!this.params.COMPARE.COMPARE_PATH) 1348 { 1349 this.compareData.comparePath = this.params.COMPARE.COMPARE_PATH; 1350 } 1351 if (!!this.params.COMPARE.COMPARE_URL_TEMPLATE_DEL) 1352 { 1353 this.compareData.compareUrlDel = this.params.COMPARE.COMPARE_URL_TEMPLATE_DEL; 1354 } 1355 if (!!this.params.COMPARE.COMPARE_URL_TEMPLATE) 1356 { 1357 this.compareData.compareUrl = this.params.COMPARE.COMPARE_URL_TEMPLATE; 1358 } 1359 else 1360 {
1361 this.config.useCompare = false; 1362 } 1363 } 1364 else 1365 { 1366 this.config.useCompare = false; 1367 } 1368 } 1369}; 1370 1371window.JCCatalogElement.prototype.setMainPictHandler = function() 1372{ 1373 switch (this.config.mainPictureMode) 1374 { 1375 case 'GALLERY': 1376 break; 1377 case 'MAGNIFIER': 1378 if(this.currentBigImg.src) 1379 { 1380 $(this.obPict).addClass('zoom_picture'); 1381 InitZoomPict(); 1382 } 1383 break; 1384 case 'POPUP': 1385 $(this.obPict).parent().addClass('fancy_offer'); 1386 break; 1387 default: 1388 break; 1389 } 1390}; 1391 1392window.JCCatalogElement.prototype.setCurrentImg = function(img, showImage) 1393{ 1394 showImage = !!showImage; 1395 if('SMALL' in img){ 1396 this.currentImg.src = img.SMALL.src; 1397 }else if ('SRC' in img) { 1398 this.currentImg.src = img.SRC 1399 }; 1400 if('BIG' in img){ 1401 this.currentBigImg.src = img.BIG.src; 1402 } 1403 if('WIDTH' in img){ 1404 this.currentImg.width = img.WIDTH; 1405 } 1406 if('HEIGHT' in img){ 1407 this.currentImg.height = img.HEIGHT; 1408 } 1409 if (showImage && !!this.obPict) 1410 { 1411 if (this.config.mainPictureMode === 'MAGNIFIER') 1412 { 1413 $(this.obPict).attr('data-large',this.currentBigImg.src); 1414 $(this.obPict).attr('xoriginal',this.currentBigImg.src); 1415 if('SMALL' in img) 1416 $(this.obPict).attr('xpreview',img.SMALL.src); 1417 } 1418 if('src' in this.currentImg){ 1419 if (this.currentImg.src){ 1420 BX.adjust(this.obPict, { props: { src: this.currentImg.src } }); 1421 } 1422 } 1423 if('src' in this.currentBigImg){ 1424 if (this.currentBigImg.src){ 1425 if(this.config.mainPictureMode === 'POPUP'){ 1426 $(this.obPict).parent().attr('href',this.currentBigImg.src); 1427 } 1428 $(this.obPict).parent().attr('title',img.TITLE); 1429 $(this.obPict).parent().attr('alt',img.ALT); 1430 $(this.obPict).attr('title',img.TITLE); 1431 $(this.obPict).attr('alt',img.ALT); 1432 } 1433 } 1434 1435 } 1436}; 1437 1438window.JCCatalogElement.prototype.scaleImg = function(src, dest) 1439{ 1440 var 1441 scaleX, 1442 scaleY, 1443 scale, 1444 result = {}; 1445 1446 if (dest.width >= src.width && dest.height >= src.height) 1447 { 1448 result.width = src.width; 1449 result.height = src.height; 1450 } 1451 else 1452 { 1453 scaleX = dest.width/src.width; 1454 scaleY = dest.height/src.height; 1455 scale = Math.min(scaleX, scaleY); 1456 result.width = Math.max(1, parseInt(scale*src.width , 10)); 1457 result.height = Math.max(1, parseInt(scale*src.height , 10)); 1458 } 1459 return result; 1460}; 1461 1462window.JCCatalogElement.prototype.showMagnifier = function(e) 1463{ 1464 if (!this.magnify.magnifyShow) 1465 { 1466 this.calcMagnifierParams(); 1467 this.calcMagnifyAreaSize(); 1468 this.calcMagnifyAreaPos(e); 1469 this.calcMagnifyPictSize(); 1470 this.calcMagnifyPictPos(); 1471 this.setMagnifyAreaParams(true); 1472 this.setMagnifyPictParams(true); 1473 this.setMagnifierParams(true); 1474 BX.bind(document, 'mousemove', BX.proxy(this.moveMagnifierArea, this)); 1475 } 1476}; 1477 1478window.JCCatalogElement.prototype.hideMagnifier = function() 1479{ 1480 if (!this.magnify.magnifyShow) 1481 { 1482 if (!!this.magnify.obMagnifier) 1483 { 1484 BX.adjust(this.magnify.obMagnifier, { style: { display: 'none' } }); 1485 } 1486 if (!!this.magnify.obMagnifyArea) 1487 { 1488 BX.adjust(this.magnify.obMagnifyArea, { style: { display: 'none' } }); 1489 } 1490 BX.unbind(document, 'mousemove', BX.proxy(this.moveMagnifierArea, this)); 1491 } 1492}; 1493 1494window.JCCatalogElement.prototype.moveMagnifierArea = function(e) 1495{ 1496 var 1497 currentPos = { 1498 X: 0, 1499 Y: 0 1500 }, 1501 posBigImg = BX.pos(this.obPict), 1502 intersect = {}, 1503 params = {}, 1504 paramsPict = {}; 1505 1506 currentPos = this.inRect(e, posBigImg); 1507 if (this.inBound(posBigImg, currentPos)) 1508 { 1509 intersect = this.intersectArea(currentPos, posBigImg); 1510 switch (intersect.X) 1511 { 1512 case -1: 1513 this.magnify.areaParams.left = this.currentImg.screenOffsetX; 1514 break; 1515 case 0: 1516 this.magnify.areaParams.left = this.currentImg.screenOffsetX + currentPos.X - (this.magnify.areaParams.width >>> 1); 1517 break; 1518 case 1: 1519 this.magnify.areaParams.left = this.currentImg.screenOffsetX + posBigImg.width - this.magnify.areaParams.width; 1520 break; 1521 } 1522 switch (intersect.Y) 1523 { 1524 case -1: 1525 this.magnify.areaParams.top = 0; 1526 break; 1527 case 0: 1528 this.magnify.areaParams.top = currentPos.Y - (this.magnify.areaParams.height >>> 1); 1529 break; 1530 case 1: 1531 this.magnify.areaParams.top = posBigImg.height - this.magnify.areaParams.height; 1532 break; 1533 } 1534 this.magnify.magnifyPictParams.marginLeft = -parseInt(((this.magnify.areaParams.left-this.currentImg.screenOffsetX)*this.currentImg.scale), 10); 1535 this.magnify.magnifyPictParams.marginTop = -parseInt(((this.magnify.areaParams.top)*this.currentImg.scale), 10); 1536 params.left = this.magnify.areaParams.left+'px'; 1537 params.top = this.magnify.areaParams.top+'px'; 1538 BX.adjust(this.magnify.obMagnifyArea, { style: params }); 1539 paramsPict.marginLeft = this.magnify.magnifyPictParams.marginLeft+'px'; 1540 paramsPict.marginTop = this.magnify.magnifyPictParams.marginTop+'px'; 1541 BX.adjust(this.magnify.obMagnifyPict, { style: paramsPict }); 1542 } 1543 else 1544 { 1545 this.outMagnifierArea(); 1546 this.hideMagnifier(); 1547 } 1548}; 1549 1550window.JCCatalogElement.prototype.onMagnifierArea = function() 1551{ 1552 this.magnify.magnifyShow = true; 1553}; 1554 1555window.JCCatalogElement.prototype.outMagnifierArea = function() 1556{ 1557 this.magnify.magnifyShow = false;
1558}; 1559 1560window.JCCatalogElement.prototype.calcMagnifierParams = function() 1561{ 1562 if (!!this.magnify.obBigImg) 1563 { 1564 var pos = BX.pos(this.magnify.obBigImg, true); 1565 1566 this.magnify.magnifierParams.width = pos.width; 1567 this.magnify.magnifierParams.height = pos.height; 1568 this.magnify.magnifierParams.top = pos.top; 1569 this.magnify.magnifierParams.left = pos.left + pos.width + 2; 1570 } 1571}; 1572 1573window.JCCatalogElement.prototype.setMagnifierParams = function(show) 1574{ 1575 if (!!this.magnify.obMagnifier) 1576 { 1577 show = !!show; 1578 var params = { 1579 top: this.magnify.magnifierParams.top+'px', 1580 left: this.magnify.magnifierParams.left+'px', 1581 width: this.magnify.magnifierParams.width+'px', 1582 height: this.magnify.magnifierParams.height+'px' 1583 }; 1584 if (show) 1585 { 1586 params.display = ''; 1587 } 1588 BX.adjust(this.magnify.obMagnifier, { style: params }); 1589 } 1590}; 1591 1592window.JCCatalogElement.prototype.setMagnifyAreaParams = function(show) 1593{ 1594 if (!!this.magnify.obMagnifier) 1595 { 1596 show = !!show; 1597 var params = { 1598 top: this.magnify.areaParams.top+'px', 1599 left: this.magnify.areaParams.left+'px', 1600 width: this.magnify.areaParams.width+'px', 1601 height: this.magnify.areaParams.height+'px' 1602 }; 1603 if (show) 1604 { 1605 params.display = ''; 1606 } 1607 BX.adjust(this.magnify.obMagnifyArea, { style: params }); 1608 } 1609}; 1610 1611window.JCCatalogElement.prototype.calcMagnifyAreaPos = function(e) 1612{ 1613 var currentPos, 1614 posBigImg, 1615 intersect; 1616 1617 posBigImg = BX.pos(this.obPict); 1618 currentPos = this.inRect(e, posBigImg); 1619 if (this.inBound(posBigImg, currentPos)) 1620 { 1621 intersect = this.intersectArea(currentPos, posBigImg); 1622 switch (intersect.X) 1623 { 1624 case -1: 1625 this.magnify.areaParams.left = this.currentImg.screenOffsetX; 1626 break; 1627 case 0: 1628 this.magnify.areaParams.left = this.currentImg.screenOffsetX + currentPos.X - (this.magnify.areaParams.width >>> 1); 1629 break; 1630 case 1: 1631 this.magnify.areaParams.left = this.currentImg.screenOffsetX + posBigImg.width - this.magnify.areaParams.width; 1632 break; 1633 } 1634 switch (intersect.Y) 1635 { 1636 case -1: 1637 this.magnify.areaParams.top = 0; 1638 break; 1639 case 0: 1640 this.magnify.areaParams.top = currentPos.Y - (this.magnify.areaParams.height >>> 1); 1641 break; 1642 case 1: 1643 this.magnify.areaParams.top = posBigImg.height - this.magnify.areaParams.height; 1644 break; 1645 } 1646 } 1647}; 1648 1649window.JCCatalogElement.prototype.inBound = function(rect, point) 1650{ 1651 return ((0 <= point.Y && rect.height >= point.Y) && (0 <= point.X && rect.width >= point.X)); 1652}; 1653 1654window.JCCatalogElement.prototype.inRect = function(e, rect) 1655{ 1656 var wndSize = BX.GetWindowSize(), 1657 currentPos = { 1658 X: 0, 1659 Y: 0, 1660 globalX: 0, 1661 globalY: 0 1662 }; 1663 1664 currentPos.globalX = e.clientX + wndSize.scrollLeft; 1665 currentPos.X = currentPos.globalX - rect.left; 1666 currentPos.globalY = e.clientY + wndSize.scrollTop; 1667 currentPos.Y = currentPos.globalY - rect.top; 1668 return currentPos; 1669}; 1670 1671window.JCCatalogElement.prototype.intersectArea = function(currentPos, rect) 1672{ 1673 var intersect = { 1674 X: 0, 1675 Y: 0 1676 }, 1677 halfX = this.magnify.areaParams.width >>> 1, 1678 halfY = this.magnify.areaParams.height >>> 1; 1679 1680 if (currentPos.X <= halfX) 1681 { 1682 intersect.X = -1; 1683 } 1684 else if (currentPos.X >= (rect.width - halfX)) 1685 { 1686 intersect.X = 1; 1687 } 1688 else 1689 { 1690 intersect.X = 0; 1691 } 1692 if (currentPos.Y <= halfY) 1693 { 1694 intersect.Y = -1; 1695 } 1696 else if (currentPos.Y >= (rect.height - halfY)) 1697 { 1698 intersect.Y = 1; 1699 } 1700 else 1701 { 1702 intersect.Y = 0; 1703 } 1704 1705 return intersect; 1706}; 1707 1708window.JCCatalogElement.prototype.calcMagnifyAreaSize = function() 1709{ 1710 var scaleX, 1711 scaleY, 1712 scale; 1713 1714 if ( 1715 this.magnify.magnifierParams.width < this.currentImg.width && 1716 this.magnify.magnifierParams.height < this.currentImg.height 1717 ) 1718 { 1719 scaleX = this.magnify.obBigImg.offsetWidth/this.currentImg.width; 1720 scaleY = this.magnify.obBigImg.offsetHeight/this.currentImg.height; 1721 scale = Math.min(scaleX, scaleY); 1722 this.currentImg.scale = 1/scale; 1723 this.magnify.areaParams.width = Math.max(1, parseInt(scale*this.magnify.magnifierParams.width , 10)); 1724 this.magnify.areaParams.height = Math.max(1, parseInt(scale*this.magnify.magnifierParams.height , 10)); 1725 this.magnify.areaParams.scaleFactor = this.magnify.magnifierParams.defaultScale; 1726 } 1727 else 1728 { 1729 scaleX = this.obPict.offsetWidth/this.magnify.obBigImg.offsetWidth; 1730 scaleY = this.obPict.offsetHeight/this.magnify.obBigImg.offsetHeight; 1731 scale = Math.min(scaleX, scaleY); 1732 this.currentImg.scale = 1/scale; 1733 this.magnify.areaParams.width = Math.max(1, parseInt(scale*this.magnify.magnifierParams.width , 10)); 1734 this.magnify.areaParams.height = Math.max(1, parseInt(scale*this.magnify.magnifierParams.height , 10)); 1735 1736 scaleX = this.magnify.magnifierParams.width/this.currentImg.width; 1737 scaleY = this.magnify.magnifierParams.height/this.currentImg.height; 1738 scale = Math.max(scaleX, scaleY); 1739 this.magnify.areaParams.scaleFactor = scale; 1740 } 1741}; 1742 1743window.JCCatalogElement.prototype.calcMagnifyPictSize = function() 1744{ 1745 this.magnify.magnifyPictParams.width = this.currentImg.width*this.magnify.areaParams.scaleFactor; 1746 this.magnify.magnifyPictParams.height = this.currentImg.height*this.magnify.areaParams.scaleFactor; 1747}; 1748
1749window.JCCatalogElement.prototype.calcMagnifyPictPos = function() 1750{ 1751 this.magnify.magnifyPictParams.marginLeft = -parseInt(((this.magnify.areaParams.left-this.currentImg.screenOffsetX)*this.currentImg.scale), 10); 1752 this.magnify.magnifyPictParams.marginTop = -parseInt(((this.magnify.areaParams.top)*this.currentImg.scale), 10); 1753}; 1754 1755window.JCCatalogElement.prototype.setMagnifyPictParams = function(show) 1756{ 1757 if (!!this.magnify.obMagnifier) 1758 { 1759 show = !!show; 1760 var params = { 1761 width: this.magnify.magnifyPictParams.width+'px', 1762 height: this.magnify.magnifyPictParams.height+'px', 1763 marginTop: this.magnify.magnifyPictParams.marginTop+'px', 1764 marginLeft: this.magnify.magnifyPictParams.marginLeft+'px' 1765 }; 1766 if (show) 1767 { 1768 params.display = ''; 1769 } 1770 BX.adjust(this.magnify.obMagnifyPict, { style: params, props: { src: this.currentImg.src } }); 1771 } 1772}; 1773 1774window.JCCatalogElement.prototype.ProductSliderRowLeft = function() 1775{ 1776 var target = BX.proxy_context; 1777 if (!!target) 1778 { 1779 if (this.sliderRowShowSize < this.product.slider.COUNT) 1780 { 1781 if (0 > this.product.slider.START) 1782 { 1783 this.product.slider.START++; 1784 BX.adjust(this.product.slider.LIST, { style: { marginLeft: this.product.slider.START*20+'%' }}); 1785 BX.adjust(this.product.slider.RIGHT, { style: this.sliderEnableArrow }); 1786 } 1787 1788 if (0 <= this.product.slider.START) 1789 { 1790 BX.adjust(this.product.slider.LEFT, { style: this.sliderDisableArrow }); 1791 } 1792 } 1793 } 1794}; 1795 1796window.JCCatalogElement.prototype.ProductSliderRowRight = function() 1797{ 1798 var target = BX.proxy_context; 1799 if (!!target) 1800 { 1801 if (this.sliderRowShowSize < this.product.slider.COUNT) 1802 { 1803 if ((this.sliderRowShowSize - this.product.slider.START) < this.product.slider.COUNT) 1804 { 1805 this.product.slider.START--; 1806 BX.adjust(this.product.slider.LIST, { style: { marginLeft: this.product.slider.START*20+'%' }}); 1807 BX.adjust(this.product.slider.LEFT, { style: this.sliderEnableArrow } ); 1808 } 1809 1810 if ((this.sliderRowShowSize - this.product.slider.START) >= this.product.slider.COUNT) 1811 { 1812 BX.adjust(this.product.slider.RIGHT, { style: this.sliderDisableArrow } ); 1813 } 1814 } 1815 } 1816}; 1817 1818window.JCCatalogElement.prototype.ProductSelectSliderImg = function() 1819{ 1820 var strValue = '', 1821 target = BX.proxy_context; 1822 if (!!target && target.hasAttribute('data-value')) 1823 { 1824 strValue = target.getAttribute('data-value'); 1825 this.SetProductMainPict(strValue); 1826 } 1827}; 1828 1829window.JCCatalogElement.prototype.SetProductMainPict = function(intPict) 1830{ 1831 var indexPict = -1, 1832 i = 0, 1833 j = 0, 1834 value = '', 1835 strValue = '', 1836 RowItems = null; 1837 if (0 < this.product.sliderCount) 1838 { 1839 for (j = 0; j < this.product.sliderPict.length; j++) 1840 { 1841 if (intPict === this.product.sliderPict[j].ID) 1842 { 1843 indexPict = j; 1844 break; 1845 } 1846 } 1847 if (-1 < indexPict) 1848 { 1849 if (!!this.product.sliderPict[indexPict]) 1850 { 1851 this.setCurrentImg(this.product.sliderPict[indexPict], true); 1852 } 1853 RowItems = BX.findChildren(this.product.slider.LIST, {tagName: 'li'}, false); 1854 if (!!RowItems && 0 < RowItems.length) 1855 { 1856 strValue = intPict; 1857 for (i = 0; i < RowItems.length; i++) 1858 { 1859 value = RowItems[i].getAttribute('data-value'); 1860 if (value === strValue) 1861 { 1862 BX.addClass(RowItems[i], 'active'); 1863 } 1864 else 1865 { 1866 BX.removeClass(RowItems[i], 'active'); 1867 } 1868 } 1869 } 1870 } 1871 } 1872}; 1873 1874window.JCCatalogElement.prototype.SliderRowLeft = function() 1875{ 1876 var strValue = '', 1877 index = -1, 1878 i, 1879 target = BX.proxy_context; 1880 if (!!target && target.hasAttribute('data-value')) 1881 { 1882 strValue = target.getAttribute('data-value'); 1883 for (i = 0; i < this.sliders.length; i++) 1884 { 1885 if (this.sliders[i].OFFER_ID === strValue) 1886 { 1887 index = i; 1888 break; 1889 } 1890 } 1891 if (-1 < index && this.sliderRowShowSize < this.sliders[index].COUNT) 1892 { 1893 if (0 > this.sliders[index].START) 1894 { 1895 this.sliders[index].START++; 1896 BX.adjust(this.sliders[index].LIST, { style: { marginLeft: this.sliders[index].START*20+'%' }}); 1897 BX.adjust(this.sliders[index].RIGHT, { style: this.sliderEnableArrow }); 1898 } 1899 1900 if (0 <= this.sliders[index].START) 1901 { 1902 BX.adjust(this.sliders[index].LEFT, { style: this.sliderDisableArrow }); 1903 } 1904 } 1905 } 1906}; 1907 1908window.JCCatalogElement.prototype.SliderRowRight = function() 1909{ 1910 var strValue = '', 1911 index = -1, 1912 i, 1913 target = BX.proxy_context; 1914 if (!!target && target.hasAttribute('data-value')) 1915 { 1916 strValue = target.getAttribute('data-value'); 1917 for (i = 0; i < this.sliders.length; i++) 1918 { 1919 if (this.sliders[i].OFFER_ID === strValue) 1920 { 1921 index = i; 1922 break; 1923 } 1924 } 1925 if (-1 < index && this.sliderRowShowSize < this.sliders[index].COUNT) 1926 { 1927 if ((this.sliderRowShowSize - this.sliders[index].START) < this.sliders[index].COUNT) 1928 { 1929 this.sliders[index].START--; 1930 BX.adjust(this.sliders[index].LIST, { style: { marginLeft: this.sliders[index].START*20+'%' }}); 1931 BX.adjust(this.sliders[index].LEFT, { style: this.sliderEnableArrow } ); 1932 } 1933 1934 if ((this.sliderRowShowSize - this.sliders[index].START) >= this.sliders[index].COUNT) 1935 { 1936 BX.adjust(this.sliders[index].RIGHT, { style: this.sliderDisableArrow } ); 1937 } 1938 } 1939 } 1940}; 1941 1942window.JCCatalogElement.prototype.SelectSliderImg = function() 1943{ 1944 var strValue = '', 1945 arItem = [], 1946 target = BX.proxy_context; 1947 if (!!target && target.hasAttribute('data-value')) 1948 { 1949 strValue = target.getAttribute('data-value'); 1950 arItem = strValue.split('_'); 1951 this.SetMainPict(arItem[0], arItem[1]); 1952 } 1953}; 1954 1955window.JCCatalogElement.prototype.SetMainPict = function(intSlider, intPict) 1956{ 1957 var index = -1, 1958 indexPict = -1, 1959 i, 1960 j, 1961 value = '', 1962 RowItems = null, 1963 strValue = ''; 1964 1965 for (i = 0; i < this.offers.length; i++) 1966 { 1967 if (intSlider === this.offers[i].ID) 1968 { 1969 index = i; 1970 break; 1971 } 1972 } 1973 1974 // $(window).resize(); 1975 $('.thumbs_navigation ul').addClass('hidden_block'); 1976 if(this.SliderImages>1){ 1977 $('.thumbs_navigation ul:eq('+index+')').removeClass('hidden_block'); 1978 } 1979 $('.thumbs_navigation').removeClass('hidden_block'); 1980 1981 $('.fancy_offer').addClass('hidden_block'); 1982 $(this.obPict).closest('.offers_img').css('opacity', 0); 1983 1984 if (-1 < index) 1985 { 1986 if (0 < this.offers[index].SLIDER_COUNT) 1987 { 1988 for (j = 0; j < this.offers[index].SLIDER.length; j++) 1989 { 1990 if (intPict === this.offers[index].SLIDER[j].ID) 1991 { 1992 indexPict = j; 1993 break; 1994 } 1995 } 1996 if (-1 < indexPict) 1997 { 1998 if (!!this.offers[index].SLIDER[indexPict]) 1999 { 2000 this.setCurrentImg(this.offers[index].SLIDER[indexPict], true); 2001 } 2002 2003 RowItems = BX.findChildren(this.sliders[index].LIST, {tagName: 'li'}, false); 2004 if (!!RowItems && 0 < RowItems.length) 2005 { 2006 strValue = intSlider+'_'+intPict; 2007 for (i = 0; i < RowItems.length; i++) 2008 { 2009 value = RowItems[i].getAttribute('data-value'); 2010 if (value === strValue) 2011 { 2012 BX.addClass(RowItems[i], 'current'); 2013 } 2014 else 2015 { 2016 BX.removeClass(RowItems[i], 'current'); 2017 } 2018 } 2019 } 2020 } 2021 } 2022 } 2023 setTimeout(function(){ 2024 $('.fancy_offer').removeClass('hidden_block'); 2025 $('.offers_img').css('opacity', 1); 2026 }, 200); 2027}; 2028 2029window.JCCatalogElement.prototype.SetMainPictFromItem = function(index) 2030{ 2031 if (!!this.obPict) 2032 { 2033 var boolSet = false, 2034 obNewPict = {}; 2035 2036 if (!!this.offers[index]) 2037 { 2038 if (!!this.offers[index].DETAIL_PICTURE) 2039 { 2040 obNewPict = this.offers[index].DETAIL_PICTURE; 2041 boolSet = true; 2042 } 2043 else if (!!this.offers[index].PREVIEW_PICTURE) 2044 { 2045 obNewPict = this.offers[index].PREVIEW_PICTURE; 2046 boolSet = true; 2047 } 2048 } 2049 if (!boolSet) 2050 { 2051 if (!!this.defaultPict.detail) 2052 { 2053 obNewPict = this.defaultPict.detail; 2054 boolSet = true; 2055 } 2056 else if (!!this.defaultPict.preview) 2057 { 2058 obNewPict = this.defaultPict.preview; 2059 boolSet = true; 2060 } 2061 } 2062 if (boolSet) 2063 { 2064 this.setCurrentImg(obNewPict, true); 2065 } 2066 } 2067}; 2068 2069window.JCCatalogElement.prototype.SetAdditionalGallery = function(index){ 2070 var $gallery = $('.galerys-block'); 2071 if($gallery.length){ 2072 var bHidden = $gallery.hasClass('hidden'); 2073 var bTypeBig = $gallery.find('.big_slider').length;
2074 var $slider = bTypeBig ? $gallery.find('.big_slider') : $gallery.find('.small_slider'); 2075 if($slider.length){ 2076 if($.hasData($slider[0])){ 2077 $.removeData($slider[0]); 2078 $slider.find('.flex-control-nav').remove(); 2079 $slider.find('.flex-direction-nav').remove(); 2080 } 2081 2082 var slides = ethumbs = ''; 2083 if(this.offers[index].ADDITIONAL_GALLERY.length){ 2084 for(var i in this.offers[index].ADDITIONAL_GALLERY){ 2085 var arPhoto = this.offers[index].ADDITIONAL_GALLERY[i]; 2086 if(bTypeBig){ 2087 slides += '<li class="col-md-12 item"><a href="' + arPhoto.DETAIL.SRC + '" class="fancy" rel="gallery" target="_blank" title="' + arPhoto.TITLE + '"><img src="' + arPhoto.PREVIEW.src + '" class="img-responsive inline" title="' + arPhoto.TITLE + '" alt="' + arPhoto.ALT + '" /><span class="zoom"></span></li>'; 2088 ethumbs += '<li class="item"><img class="img-responsive inline" border="0" src="' + arPhoto.THUMB.src + '" title="' + arPhoto.TITLE + '" alt="' + arPhoto.ALT + '" /></li>'; 2089 } 2090 else{ 2091 slides += '<li class="col-md-3 item visible"><div><img src="' + arPhoto.PREVIEW.src + '" class="img-responsive inline" title="' + arPhoto.TITLE + '" alt="' + arPhoto.ALT + '" /></div><a href="' + arPhoto.DETAIL.SRC + '" class="fancy dark_block_animate" rel="gallery" target="_blank" title="' + arPhoto.TITLE + '"></a></li>'; 2092 } 2093 } 2094 } 2095 $slider.find('.slides').html(slides); 2096 $slider.removeClass('flexslider-init'); 2097 2098 if(bTypeBig){ 2099 var $ethumbs = $gallery.find('.ethumbs'); 2100 if($ethumbs.length){ 2101 if($.hasData($ethumbs[0])){ 2102 $.removeData($ethumbs[0]); 2103 $ethumbs.find('.flex-control-nav').remove(); 2104 $ethumbs.find('.flex-direction-nav').remove(); 2105 } 2106 $ethumbs.find('.slides').html(ethumbs); 2107 $ethumbs.removeClass('flexslider-init'); 2108 } 2109 } 2110 2111 if(this.offers[index].ADDITIONAL_GALLERY.length){ 2112 if(bHidden){ 2113 $gallery.removeClass('hidden'); 2114 } 2115 InitFlexSlider(); 2116 var interval = setInterval(function(){ 2117 if($slider.find('.slides .item').attr('style').indexOf('height') === -1){ 2118 $(window).resize(); 2119 } 2120 else{ 2121 clearInterval(interval); 2122 } 2123 }, 100); 2124 } 2125 else{ 2126 $gallery.addClass('hidden'); 2127 } 2128 } 2129 } 2130}; 2131 2132window.JCCatalogElement.prototype.showMainPictPopup = function(e) 2133{ 2134 var pictContent = ''; 2135 2136 pictContent = '<div style="text-align: center;"><img src="'+ 2137 this.currentImg.src+ 2138 '" width="'+this.currentImg.width+'" height="'+this.currentImg.height+'" name=""></div>'; 2139 this.obPopupPict.setContent(pictContent); 2140 this.obPopupPict.show(); 2141 return BX.PreventDefault(e); 2142}; 2143 2144window.JCCatalogElement.prototype.QuantityUp = function() 2145{ 2146 var curValue = 0, 2147 boolSet = true, 2148 calcPrice; 2149 2150 if (0 === this.errorCode && this.config.showQuantity && this.canBuy) 2151 { 2152 curValue = (this.isDblQuantity ? parseFloat(this.obQuantity.value) : parseInt(this.obQuantity.value, 10)); 2153 if (!isNaN(curValue)) 2154 { 2155 curValue += this.stepQuantity; 2156 if (this.checkQuantity) 2157 { 2158 if (curValue > this.maxQuantity) 2159 { 2160 boolSet = false; 2161 } 2162 } 2163 2164 if (boolSet) 2165 { 2166 if (this.isDblQuantity) 2167 { 2168 curValue = Math.round(curValue*this.precisionFactor)/this.precisionFactor; 2169 } 2170 this.obQuantity.value = curValue; 2171 } 2172 } 2173 } 2174}; 2175 2176window.JCCatalogElement.prototype.QuantityDown = function() 2177{ 2178 var curValue = 0, 2179 boolSet = true, 2180 calcPrice; 2181 2182 if (0 === this.errorCode && this.config.showQuantity && this.canBuy) 2183 { 2184 curValue = (this.isDblQuantity ? parseFloat(this.obQuantity.value) : parseInt(this.obQuantity.value, 10)); 2185 if (!isNaN(curValue)) 2186 { 2187 curValue -= this.stepQuantity; 2188 if (curValue < this.stepQuantity) 2189 { 2190 boolSet = false; 2191 } 2192 if (boolSet) 2193 { 2194 if (this.isDblQuantity) 2195 { 2196 curValue = Math.round(curValue*this.precisionFactor)/this.precisionFactor; 2197 } 2198 this.obQuantity.value = curValue; 2199 } 2200 } 2201 } 2202}; 2203 2204window.JCCatalogElement.prototype.QuantityChange = function() 2205{ 2206 var curValue = 0, 2207 calcPrice, 2208 intCount, 2209 count; 2210 2211 if (0 === this.errorCode && this.config.showQuantity) 2212 { 2213 if (this.canBuy) 2214 { 2215 curValue = (this.isDblQuantity ? parseFloat(this.obQuantity.value) : parseInt(this.obQuantity.value, 10)); 2216 if (!isNaN(curValue)) 2217 { 2218 if (this.checkQuantity) 2219 { 2220 if (curValue > this.maxQuantity) 2221 { 2222 curValue = this.maxQuantity; 2223 } 2224 } 2225 if (curValue < this.stepQuantity) 2226 { 2227 curValue = this.stepQuantity; 2228 } 2229 else 2230 { 2231 count = Math.round((curValue*this.precisionFactor)/this.stepQuantity)/this.precisionFactor; 2232 intCount = parseInt(count, 10); 2233 if (isNaN(intCount)) 2234 { 2235 intCount = 1; 2236 count = 1.1; 2237 } 2238 if (count > intCount) 2239 { 2240 curValue = (intCount <= 1 ? this.stepQuantity : intCount*this.stepQuantity); 2241 curValue = Math.round(curValue*this.precisionFactor)/this.precisionFactor; 2242 } 2243 } 2244 this.obQuantity.value = curValue; 2245 } 2246 else 2247 {
2248 this.obQuantity.value = this.stepQuantity; 2249 } 2250 } 2251 else 2252 { 2253 this.obQuantity.value = this.stepQuantity; 2254 } 2255 } 2256}; 2257 2258window.JCCatalogElement.prototype.QuantitySet = function(index) 2259{ 2260 var basisPrice = '', 2261 strLimit; 2262 if (this.errorCode === 0) 2263 { 2264 this.canBuy = this.offers[index].CAN_BUY; 2265 2266 this.currentPriceMode = this.offers[index].ITEM_PRICE_MODE; 2267 this.currentPrices = this.offers[index].ITEM_PRICES; 2268 this.currentPriceSelected = this.offers[index].ITEM_PRICE_SELECTED; 2269 this.currentQuantityRanges = this.offers[index].ITEM_QUANTITY_RANGES; 2270 this.currentQuantityRangeSelected = this.offers[index].ITEM_QUANTITY_RANGE_SELECTED; 2271 2272 if (this.canBuy) 2273 { 2274 if (!!this.obBasketActions) 2275 { 2276 BX.style(this.obBasketActions, 'display', ''); 2277 } 2278 if (!!this.obNotAvail) 2279 { 2280 BX.style(this.obNotAvail, 'display', 'none'); 2281 } 2282 } 2283 else 2284 { 2285 if (!!this.obBasketActions) 2286 { 2287 //BX.style(this.obBasketActions, 'display', 'none'); 2288 BX.style(this.obBasketActions, 'opacity', '0'); 2289 BX.style(BX.findParent(BX(this.obQuantity), { 'class':'counter_block' }), 'display', 'none'); 2290 } 2291 if (!!this.obNotAvail) 2292 { 2293 BX.style(this.obNotAvail, 'display', ''); 2294 } 2295 } 2296 if (this.config.showQuantity) 2297 { 2298 this.isDblQuantity = this.offers[index].QUANTITY_FLOAT; 2299 this.checkQuantity = this.offers[index].CHECK_QUANTITY; 2300 if (this.isDblQuantity) 2301 { 2302 this.maxQuantity = parseFloat(this.offers[index].MAX_QUANTITY); 2303 this.stepQuantity = Math.round(parseFloat(this.offers[index].STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor; 2304 } 2305 else 2306 { 2307 this.maxQuantity = parseInt(this.offers[index].MAX_QUANTITY, 10); 2308 this.stepQuantity = parseInt(this.offers[index].STEP_QUANTITY, 10); 2309 } 2310 /*this.obQuantity.value = this.stepQuantity; 2311 this.obQuantity.disabled = !this.canBuy;*/ 2312 if (!!this.obMeasure) 2313 { 2314 if (!!this.offers[index].MEASURE) 2315 { 2316 BX.adjust(this.obMeasure, { html : this.offers[index].MEASURE}); 2317 } 2318 else 2319 { 2320 BX.adjust(this.obMeasure, { html : ''}); 2321 } 2322 } 2323 if (!!this.obQuantityLimit.all) 2324 { 2325 if (!this.checkQuantity) 2326 { 2327 BX.adjust(this.obQuantityLimit.value, { html: '' }); 2328 BX.adjust(this.obQuantityLimit.all, { style: {display: 'none'} }); 2329 } 2330 else 2331 { 2332 strLimit = this.offers[index].MAX_QUANTITY; 2333 if (!!this.offers[index].MEASURE) 2334 { 2335 strLimit += (' '+this.offers[index].MEASURE); 2336 } 2337 BX.adjust(this.obQuantityLimit.value, { html: strLimit}); 2338 BX.adjust(this.obQuantityLimit.all, { style: {display: ''} }); 2339 } 2340 } 2341 if (!!this.obBasisPrice) 2342 { 2343 if (!!this.offers[index].BASIS_PRICE) 2344 { 2345 basisPrice = BX.message('BASIS_PRICE_MESSAGE'); 2346 basisPrice = basisPrice.replace( 2347 '#PRICE#', 2348 BX.Currency.currencyFormat(this.offers[index].BASIS_PRICE.DISCOUNT_VALUE, this.offers[index].BASIS_PRICE.CURRENCY, true) 2349 ); 2350 basisPrice = basisPrice.replace('#MEASURE#', this.offers[index].MEASURE); 2351 BX.adjust(this.obBasisPrice, { style: { display: '' }, html: basisPrice }); 2352 } 2353 else 2354 { 2355 BX.adjust(this.obBasisPrice, { style: { display: 'none' }, html: '' }); 2356 } 2357 } 2358 } 2359 this.currentBasisPrice = this.offers[index].BASIS_PRICE; 2360 } 2361}; 2362 2363window.JCCatalogElement.prototype.SelectOfferProp = function() 2364{ 2365 var i = 0, 2366 strTreeValue = '', 2367 arTreeItem = [], 2368 RowItems = null, 2369 target = BX.proxy_context; 2370 if(typeof target.options !== 'undefined' && typeof target.options[target.selectedIndex] !== 'undefined') 2371 target = target.options[target.selectedIndex]; 2372 if (!!target && target.hasAttribute('data-treevalue')) 2373 { 2374 strTreeValue = target.getAttribute('data-treevalue'); 2375 propModes = target.getAttribute('data-showtype'); 2376 arTreeItem = strTreeValue.split('_'); 2377 2378 this.SearchOfferPropIndex(arTreeItem[0], arTreeItem[1]); 2379 RowItems = BX.findChildren(target.parentNode, {tagName: this.skuVisualParams[propModes.toUpperCase()].TAG}, false); 2380 if (!!RowItems && 0 < RowItems.length) 2381 { 2382 for (i = 0; i < RowItems.length; i++) 2383 { 2384 value = RowItems[i].getAttribute('data-onevalue'); 2385 2386 // for SELECTBOXES 2387 if(propModes == 'TEXT'){ 2388 if (value === arTreeItem[1]){ 2389 RowItems[i].setAttribute('selected', 'selected'); 2390 }else{ 2391 RowItems[i].removeAttribute('selected'); 2392 } 2393 }else{ 2394 if (value === arTreeItem[1]){ 2395 $(RowItems[i]).addClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS); 2396 }else{ 2397 $(RowItems[i]).removeClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS); 2398 } 2399 } 2400 } 2401 } 2402 } 2403}; 2404 2405window.JCCatalogElement.prototype.SearchOfferPropIndex = function(strPropID, strPropValue) 2406{ 2407 var strName = '', 2408 arShowValues = false, 2409 arCanBuyValues = [], 2410 allValues = [], 2411 index = -1, 2412 i, j, 2413 arFilter = {}, 2414 tmpFilter = []; 2415 2416 for (i = 0; i < this.treeProps.length; i++) 2417 { 2418 if (this.treeProps[i].ID === strPropID) 2419 { 2420 index = i; 2421 break; 2422 } 2423 } 2424 if (-1 < index) 2425 { 2426 for (i = 0; i < index; i++) 2427 { 2428 strName = 'PROP_'+this.treeProps[i].ID; 2429 arFilter[strName] = this.selectedValues[strName]; 2430 } 2431 strName = 'PROP_'+this.treeProps[index].ID; 2432 arFilter[strName] = strPropValue; 2433 2434 for (i = index+1; i < this.treeProps.length; i++) 2435 { 2436 strName = 'PROP_'+this.treeProps[i].ID; 2437 arShowValues = this.GetRowValues(arFilter, strName); 2438 2439 if (!arShowValues) 2440 { 2441 break; 2442 } 2443 allValues = []; 2444 if (this.config.showAbsent) 2445 { 2446 arCanBuyValues = []; 2447 tmpFilter = []; 2448 tmpFilter = BX.clone(arFilter, true); 2449 for (j = 0; j < arShowValues.length; j++) 2450 { 2451 tmpFilter[strName] = arShowValues[j]; 2452 allValues[allValues.length] = arShowValues[j]; 2453 if (this.GetCanBuy(tmpFilter)) 2454 { 2455 arCanBuyValues[arCanBuyValues.length] = arShowValues[j]; 2456 } 2457 } 2458 } 2459 else 2460 {
2461 arCanBuyValues = arShowValues; 2462 } 2463 2464 if (this.selectedValues[strName] && BX.util.in_array(this.selectedValues[strName], arCanBuyValues)) 2465 { 2466 arFilter[strName] = this.selectedValues[strName]; 2467 } 2468 else 2469 { 2470 if (this.config.showAbsent) 2471 { 2472 arFilter[strName] = (arCanBuyValues.length ? arCanBuyValues[0] : allValues[0]); 2473 } 2474 else 2475 { 2476 arFilter[strName] = arCanBuyValues[0]; 2477 } 2478 } 2479 2480 this.UpdateRow(i, arFilter[strName], arShowValues, arCanBuyValues); 2481 } 2482 this.selectedValues = arFilter; 2483 2484 this.ChangeInfo(); 2485 } 2486}; 2487 2488window.JCCatalogElement.prototype.RowLeft = function() 2489{ 2490 var strTreeValue = '', 2491 index = -1, 2492 i, 2493 target = BX.proxy_context; 2494 if (!!target && target.hasAttribute('data-treevalue')) 2495 { 2496 strTreeValue = target.getAttribute('data-treevalue'); 2497 for (i = 0; i < this.treeProps.length; i++) 2498 { 2499 if (this.treeProps[i].ID === strTreeValue) 2500 { 2501 index = i; 2502 break; 2503 } 2504 } 2505 if (-1 < index && this.treeRowShowSize < this.showCount[index]) 2506 { 2507 if (0 > this.showStart[index]) 2508 { 2509 this.showStart[index]++; 2510 BX.adjust(this.obTreeRows[index].LIST, { style: { marginLeft: this.showStart[index]*20+'%' }}); 2511 //BX.adjust(this.obTreeRows[index].RIGHT, { style: this.treeEnableArrow }); 2512 } 2513 2514 /*if (0 <= this.showStart[index]) 2515 { 2516 BX.adjust(this.obTreeRows[index].LEFT, { style: this.treeDisableArrow }); 2517 }*/ 2518 } 2519 } 2520}; 2521 2522window.JCCatalogElement.prototype.RowRight = function() 2523{ 2524 var strTreeValue = '', 2525 index = -1, 2526 i, 2527 target = BX.proxy_context; 2528 if (!!target && target.hasAttribute('data-treevalue')) 2529 { 2530 strTreeValue = target.getAttribute('data-treevalue'); 2531 for (i = 0; i < this.treeProps.length; i++) 2532 { 2533 if (this.treeProps[i].ID === strTreeValue) 2534 { 2535 index = i; 2536 break; 2537 } 2538 } 2539 if (-1 < index && this.treeRowShowSize < this.showCount[index]) 2540 { 2541 if ((this.treeRowShowSize - this.showStart[index]) < this.showCount[index]) 2542 { 2543 this.showStart[index]--; 2544 BX.adjust(this.obTreeRows[index].LIST, { style: { marginLeft: this.showStart[index]*20+'%' }}); 2545 //BX.adjust(this.obTreeRows[index].LEFT, { style: this.treeEnableArrow }); 2546 } 2547 2548 /*if ((this.treeRowShowSize - this.showStart[index]) >= this.showCount[index]) 2549 { 2550 BX.adjust(this.obTreeRows[index].RIGHT, { style: this.treeDisableArrow }); 2551 }*/ 2552 } 2553 } 2554}; 2555 2556window.JCCatalogElement.prototype.UpdateRow = function(intNumber, activeID, showID, canBuyID) 2557{ 2558 var i = 0, 2559 showI = 0, 2560 value = '', 2561 countShow = 0, 2562 strNewLen = '', 2563 obData = {}, 2564 obDataCont = {}, 2565 RowItems = null, 2566 pictMode = false, 2567 extShowMode = false, 2568 isCurrent = false, 2569 selectIndex = 0, 2570 obLeft = this.treeEnableArrow, 2571 obRight = this.treeEnableArrow, 2572 currentShowStart = 0; 2573 2574 if (-1 < intNumber && intNumber < this.obTreeRows.length) 2575 { 2576 propMode = this.treeProps[intNumber].DISPLAY_TYPE; 2577 RowItems = BX.findChildren(this.obTreeRows[intNumber].LIST, {tagName: this.skuVisualParams[propMode].TAG}, false); 2578 if (!!RowItems && 0 < RowItems.length) 2579 { 2580 selectMode = ('SELECT' === this.treeProps[intNumber].DISPLAY_TYPE); 2581 countShow = showID.length; 2582 obData = { 2583 style: {}, 2584 props: { 2585 disabled: '', 2586 selected: '', 2587 }, 2588 }; 2589 obDataCont = { 2590 style: {}, 2591 }; 2592 2593 for (i = 0; i < RowItems.length; i++){ 2594 value = RowItems[i].getAttribute('data-onevalue'); 2595 isCurrent = (value === activeID && value !=0); 2596 2597 if (BX.util.in_array(value, canBuyID)){ 2598 obData.props.className = (isCurrent ? this.skuVisualParams[propMode].ACTIVE_CLASS : ''); 2599 2600 }else{ 2601 obData.props.className = (isCurrent ? this.skuVisualParams[propMode].ACTIVE_CLASS+' '+this.skuVisualParams[propMode].HIDE_CLASS : this.skuVisualParams[propMode].HIDE_CLASS); 2602 2603 } 2604 // obData.props.className = (isCurrent ? this.skuVisualParams[propMode].ACTIVE_CLASS : ''); 2605 2606 if(selectMode){ 2607 obData.props.disabled = 'disabled'; 2608 obData.props.selected = (isCurrent ? 'selected' : ''); 2609 }else{ 2610 obData.style.display = 'none'; 2611 } 2612 2613 if (BX.util.in_array(value, showID)){ 2614 if(selectMode){ 2615 obData.props.disabled = ''; 2616 }else{ 2617 obData.style.display = ''; 2618 } 2619 if (isCurrent){ 2620 selectIndex = showI; 2621 } 2622 showI++; 2623 } 2624 BX.adjust(RowItems[i], obData); 2625 } 2626 2627 if(!showI) 2628 obDataCont.style.display = 'none'; 2629 else 2630 obDataCont.style.display = ''; 2631 BX.adjust(this.obTreeRows[intNumber].CONT, obDataCont); 2632 2633 if(selectMode){ 2634 if($(this.obTreeRows[intNumber].LIST).parent().hasClass('ik_select')) 2635 $(this.obTreeRows[intNumber].LIST).ikSelect('reset'); 2636 } 2637 2638 this.showCount[intNumber] = countShow; 2639 this.showStart[intNumber] = currentShowStart; 2640 } 2641 } 2642}; 2643 2644window.JCCatalogElement.prototype.GetRowValues = function(arFilter, index) 2645{ 2646 var arValues = [], 2647 i = 0, 2648 j = 0, 2649 boolSearch = false, 2650 boolOneSearch = true; 2651 2652 if (0 === arFilter.length) 2653 { 2654 for (i = 0; i < this.offers.length; i++) 2655 { 2656 if (!BX.util.in_array(this.offers[i].TREE[index], arValues)) 2657 { 2658 arValues[arValues.length] = this.offers[i].TREE[index]; 2659 } 2660 } 2661 boolSearch = true; 2662 } 2663 else 2664 { 2665 for (i = 0; i < this.offers.length; i++) 2666 { 2667 boolOneSearch = true; 2668 for (j in arFilter) 2669 { 2670 if (arFilter[j] !== this.offers[i].TREE[j]) 2671 { 2672 boolOneSearch = false;
2673 break; 2674 } 2675 } 2676 if (boolOneSearch) 2677 { 2678 if (!BX.util.in_array(this.offers[i].TREE[index], arValues)) 2679 { 2680 arValues[arValues.length] = this.offers[i].TREE[index]; 2681 } 2682 boolSearch = true; 2683 } 2684 } 2685 } 2686 return (boolSearch ? arValues : false); 2687}; 2688 2689window.JCCatalogElement.prototype.GetCanBuy = function(arFilter) 2690{ 2691 var i = 0, 2692 j = 0, 2693 boolOneSearch = true, 2694 boolSearch = false; 2695 2696 for (i = 0; i < this.offers.length; i++) 2697 { 2698 boolOneSearch = true; 2699 for (j in arFilter) 2700 { 2701 if (arFilter[j] !== this.offers[i].TREE[j]) 2702 { 2703 boolOneSearch = false; 2704 break; 2705 } 2706 } 2707 if (boolOneSearch) 2708 { 2709 if (this.offers[i].CAN_BUY) 2710 { 2711 boolSearch = true; 2712 break; 2713 } 2714 } 2715 } 2716 return boolSearch; 2717}; 2718 2719window.JCCatalogElement.prototype.SetCurrent = function() 2720{ 2721 var i = 0, 2722 j = 0, 2723 strName = '', 2724 arShowValues = false, 2725 arCanBuyValues = [], 2726 arFilter = {}, 2727 tmpFilter = [], 2728 current = this.offers[this.offerNum].TREE; 2729 2730 for (i = 0; i < this.treeProps.length; i++) 2731 { 2732 strName = 'PROP_'+this.treeProps[i].ID; 2733 arShowValues = this.GetRowValues(arFilter, strName); 2734 if (!arShowValues) 2735 { 2736 break; 2737 } 2738 if (BX.util.in_array(current[strName], arShowValues)) 2739 { 2740 arFilter[strName] = current[strName]; 2741 } 2742 else 2743 { 2744 arFilter[strName] = arShowValues[0]; 2745 this.offerNum = 0; 2746 } 2747 if (this.config.showAbsent) 2748 { 2749 arCanBuyValues = []; 2750 tmpFilter = []; 2751 tmpFilter = BX.clone(arFilter, true); 2752 for (j = 0; j < arShowValues.length; j++) 2753 { 2754 tmpFilter[strName] = arShowValues[j]; 2755 if (this.GetCanBuy(tmpFilter)) 2756 { 2757 arCanBuyValues[arCanBuyValues.length] = arShowValues[j]; 2758 } 2759 } 2760 } 2761 else 2762 { 2763 arCanBuyValues = arShowValues; 2764 } 2765 2766 this.UpdateRow(i, arFilter[strName], arShowValues, arCanBuyValues); 2767 } 2768 2769 this.selectedValues = arFilter; 2770 this.ChangeInfo(); 2771}; 2772 2773window.JCCatalogElement.prototype.ChangeInfo = function() 2774{ 2775 var index = -1, 2776 i = 0, 2777 j = 0, 2778 RowItems=null, 2779 boolOneSearch = true; 2780 2781 for (i = 0; i < this.offers.length; i++) 2782 { 2783 boolOneSearch = true; 2784 for (j in this.selectedValues) 2785 { 2786 if (this.selectedValues[j] !== this.offers[i].TREE[j]) 2787 { 2788 boolOneSearch = false; 2789 break; 2790 } 2791 } 2792 if (boolOneSearch) 2793 { 2794 index = i; 2795 break; 2796 } 2797 } 2798 if (-1 < index) 2799 { 2800 for (i = 0; i < this.offers.length; i++) 2801 { 2802 2803 if (this.config.showOfferGroup && this.offers[i].OFFER_GROUP) 2804 { 2805 if (i !== index) 2806 { 2807 if(!!BX(this.visual.OFFER_GROUP+this.offers[i].ID)) 2808 BX.adjust(BX(this.visual.OFFER_GROUP+this.offers[i].ID), { style: {display: 'none'} }); 2809 } 2810 } 2811 /*set slider*/ 2812 /*if (!!this.sliders[i].ID) 2813 { 2814 if (i === index) 2815 { 2816 this.sliders[i].START = 0; 2817 if(this.sliders[i].CONT){ 2818 2819 RowItems = $(this.sliders[i].CONT).find("li"); 2820 this.SliderImages=RowItems.length; 2821 if(this.SliderImages>1){ 2822 BX.adjust(this.sliders[i].CONT, {style: { display: ''}}); 2823 }else{ 2824 BX.adjust(this.sliders[i].CONT, {style: { display: 'none'}}); 2825 } 2826 } 2827 BX.adjust(this.sliders[i].CONT_M, {style: { display: ''}}); 2828 } 2829 else 2830 { 2831 if(this.sliders[i].CONT) 2832 BX.adjust(this.sliders[i].CONT, {style: { display: 'none'}}); 2833 BX.adjust(this.sliders[i].CONT_M, {style: { display: 'none'}}); 2834 } 2835 }*/ 2836 } 2837 2838 if (this.config.showOfferGroup && this.offers[index].OFFER_GROUP) 2839 { 2840 if(!!BX(this.visual.OFFER_GROUP+this.offers[index].ID)) 2841 BX.adjust(BX(this.visual.OFFER_GROUP+this.offers[index].ID), { style: {display: ''} }); 2842 } 2843 if (0 < this.offers[index].SLIDER_COUNT) 2844 { 2845 this.SetMainPict(this.offers[index].ID, this.offers[index].SLIDER[0].ID); 2846 } 2847 else 2848 { 2849 this.SetMainPictFromItem(index); 2850 } 2851 this.SetAdditionalGallery(index); 2852 2853 /*set slider images start*/ 2854 this.SetSliderPict(this.offers[index], this.offers[index].SLIDER, this.config); 2855 /*set slider images end*/ 2856 2857 /*set mobile slider images start*/ 2858 this.SetSliderPictMobile(this.offers[index], this.offers[index].SLIDER, this.config); 2859 /*set mobile slider images end*/ 2860 2861 if (this.config.showSkuProps && !!this.obSkuProps) 2862 { 2863 var html ='', 2864 display_type = this.offers[index].TYPE_PROP; 2865 if (!this.offers[index].DISPLAY_PROPERTIES || this.offers[index].DISPLAY_PROPERTIES.length === 0) 2866 { 2867 if(display_type == "TABLE") 2868 BX.adjust(this.obSkuProps, {style: {display: 'none'}, html: ''}); 2869 else 2870 $(this.obSkuProps).find('.sku_block_prop').remove(); 2871 } 2872 else 2873 {
2874 if(display_type != "TABLE") 2875 $(this.obSkuProps).find('.sku_block_prop').remove(); 2876 2877 for(var i in this.offers[index].DISPLAY_PROPERTIES) 2878 { 2879 var class_block = ((this.offers[index].DISPLAY_PROPERTIES[i].HINT && this.offers[index].DISPLAY_PROPERTIES[i].SHOW_HINTS == "Y") ? ' whint1' : ''), 2880 hint_block = ((this.offers[index].DISPLAY_PROPERTIES[i].HINT && this.offers[index].DISPLAY_PROPERTIES[i].SHOW_HINTS=="Y") ? '<div class="hint"><span class="icon"><i>?</i></span><div class="tooltip">' + this.offers[index].DISPLAY_PROPERTIES[i].HINT + '</div></div>' : ''); 2881 2882 if(display_type == "TABLE") 2883 html += '<tr><td class="char_name"><span class="'+class_block+'">'+hint_block+'<span>'+this.offers[index].DISPLAY_PROPERTIES[i].NAME+'</span></span></td><td class="char_value"><span>'+this.offers[index].DISPLAY_PROPERTIES[i].VALUE+'</span></td></tr>'; 2884 else 2885 { 2886 html = '<div class="char sku_block_prop"><div class="char_name"><span class="'+class_block+'">'+hint_block+'<span>'+this.offers[index].DISPLAY_PROPERTIES[i].NAME+'</span></span></div><div class="char_value"><span>'+this.offers[index].DISPLAY_PROPERTIES[i].VALUE+'</span></div></div>'; 2887 $(this.obSkuProps).append(html); 2888 } 2889 } 2890 2891 if(display_type == "TABLE") 2892 BX.adjust(this.obSkuProps, {style: {display: ''}, html: html}); 2893 } 2894 } 2895 if (this.config.showSkuProps && !!this.obSkuArticleProps) 2896 { 2897 if ('DISPLAY_PROPERTIES_CODE' in this.offers[index]) 2898 { 2899 if ('ARTICLE' in this.offers[index].DISPLAY_PROPERTIES_CODE) 2900 { 2901 if(this.offers[index].DISPLAY_PROPERTIES_CODE.ARTICLE.VALUE) 2902 BX.adjust(this.obSkuArticleProps, {style: {display: ''}, html: this.offers[index].DISPLAY_PROPERTIES_CODE.ARTICLE.VALUE_FORMAT}); 2903 2904 } 2905 else if(this.offers[index].SHOW_ARTICLE_SKU == 'Y' && this.offers[index].ARTICLE_SKU) 2906 BX.adjust(this.obSkuArticleProps, {style: {display: ''}, html: this.offers[index].ARTICLE_SKU}); 2907 else 2908 BX.adjust(this.obSkuArticleProps, {style: {display: 'none'}, html: ''}); 2909 } 2910 else if(this.offers[index].SHOW_ARTICLE_SKU == 'Y' && this.offers[index].ARTICLE_SKU) 2911 { 2912 BX.adjust(this.obSkuArticleProps, {style: {display: ''}, html: this.offers[index].ARTICLE_SKU}); 2913 } 2914 else 2915 { 2916 BX.adjust(this.obSkuArticleProps, {style: {display: 'none'}, html: ''}); 2917 } 2918 } 2919 2920 setLocationSKU(this.offers[index].ID); 2921 2922 $(this.obBasketActions).closest('.counter_wrapp').addClass('hidden_block'); 2923 2924 this.offerNum = index; 2925 this.QuantitySet(this.offerNum); 2926 this.setStoreBlock(this.offers[index].ID); 2927 this.setQuantityStore(this.offers[index].MAX_QUANTITY, this.offers[index].AVAILIABLE.TEXT); 2928 2929 this.incViewedCounter(); 2930 BX.onCustomEvent('onCatalogStoreProductChange', [this.offers[this.offerNum].ID]); 2931 $(this.obPict).parent().data('id', this.offers[index].ID); 2932 2933 var arPriceItem = this.offers[index].PRICE; 2934 if(this.offers[index].ITEM_PRICE_MODE == 'Q' && this.offers[index].ITEM_PRICES && this.offers[index].USE_PRICE_COUNT) 2935 { 2936 if(this.offers[index].USE_PRICE_COUNT && this.offers[index].PRICE_MATRIX) 2937 this.checkPriceRange(this.offers[index].CONFIG.MIN_QUANTITY_BUY); 2938 arPriceItem = this.currentPrices[this.currentPriceSelected]; 2939 2940 arPriceItem.DISCOUNT_VALUE = arPriceItem.PRICE; 2941 arPriceItem.PRINT_DISCOUNT_VALUE = getCurrentPrice(arPriceItem.PRICE, arPriceItem.CURRENCY, arPriceItem.PRINT_PRICE); 2942 arPriceItem.VALUE = arPriceItem.BASE_PRICE; 2943 arPriceItem.PRINT_VALUE = getCurrentPrice(arPriceItem.BASE_PRICE, arPriceItem.CURRENCY, arPriceItem.PRINT_BASE_PRICE); 2944 } 2945 2946 setViewedProduct(this.offers[index].ID, { 2947 'PRODUCT_ID': this.offers[index].PRODUCT_ID, 2948 'IBLOCK_ID': this.offers[index].IBLOCK_ID, 2949 'NAME': this.offers[index].NAME, 2950 'DETAIL_PAGE_URL': this.offers[index].URL, 2951 //'PICTURE_ID': this.offers[index].PREVIEW_PICTURE ? this.offers[index].PREVIEW_PICTURE.ID : (this.offers[index].SLIDER_COUNT ? this.offers[index].SLIDER[0].ID : false), 2952 'PICTURE_ID': this.offers[index].PREVIEW_PICTURE ? this.offers[index].PREVIEW_PICTURE.ID : (this.offers[index].PARENT_PICTURE ? this.offers[index].PARENT_PICTURE.ID : (this.offers[index].SLIDER_COUNT ? this.offers[index].SLIDER[0].ID : false)), 2953 'CATALOG_MEASURE_NAME': this.offers[index].MEASURE, 2954 'MIN_PRICE': arPriceItem, 2955 'CAN_BUY': this.offers[index].CAN_BUY ? 'Y' : 'N', 2956 'IS_OFFER': 'Y', 2957 'WITH_OFFERS': 'N' 2958 }); 2959 2960 var obj=this.offers[index], 2961 th=$(this.obProduct), 2962 _th = this; 2963 2964 if(typeof arBasketAspro !=="undefined"){ 2965 this.setActualDataBlock(th, obj); 2966 }else{ 2967 if(typeof window.frameCacheVars !== "undefined"){ 2968 BX.addCustomEvent("onFrameDataReceived", function(){ 2969 _th.setActualDataBlock(th, obj); 2970 }); 2971 } 2972 } 2973 2974 /*quantity discount start*/ 2975 2976 if($(this.obProduct).find('.quantity_block .values').length) 2977 $(this.obProduct).find('.quantity_block .values .item span.value').text(this.offers[index].MAX_QUANTITY).css({'opacity':'1'}); 2978 2979 if(this.offers[index].SHOW_DISCOUNT_TIME_EACH_SKU == 'Y') 2980 initCountdownTime($(this.obProduct), this.offers[index].DISCOUNT_ACTIVE); 2981 2982 /*quantity discount end*/ 2983 2984 if(arNextOptions['THEME']['CHANGE_TITLE_ITEM'] == 'Y') 2985 { 2986 $('h1').html(this.offers[index].NAME); 2987 document.title = $('h1').html()+''+this.offers[index].POSTFIX; 2988 ItemObj.TITLE = this.offers[index].NAME; 2989 ItemObj.WINDOW_TITLE = this.offers[index].NAME+''+this.offers[index].POSTFIX; 2990 } 2991 2992 $('.catalog_detail input[data-sid="PRODUCT_NAME"]').attr('value', $('h1').text()); 2993 } 2994}; 2995 2996window.JCCatalogElement.prototype.checkPriceRange = function(quantity) 2997{ 2998 if (typeof quantity === 'undefined'|| this.currentPriceMode != 'Q') 2999 return; 3000 3001 var range, found = false;
3002 for (var i in this.currentQuantityRanges) 3003 { 3004 if (this.currentQuantityRanges.hasOwnProperty(i)) 3005 { 3006 range = this.currentQuantityRanges[i]; 3007 3008 if ( 3009 parseInt(quantity) >= parseInt(range.SORT_FROM) 3010 && ( 3011 range.SORT_TO == 'INF' 3012 || parseInt(quantity) <= parseInt(range.SORT_TO) 3013 ) 3014 ) 3015 { 3016 found = true; 3017 this.currentQuantityRangeSelected = range.HASH; 3018 break; 3019 } 3020 } 3021 } 3022 3023 if (!found && (range = this.getMinPriceRange())) 3024 { 3025 this.currentQuantityRangeSelected = range.HASH; 3026 } 3027 3028 for (var k in this.currentPrices) 3029 { 3030 if (this.currentPrices.hasOwnProperty(k)) 3031 { 3032 if (this.currentPrices[k].QUANTITY_HASH == this.currentQuantityRangeSelected) 3033 { 3034 this.currentPriceSelected = k; 3035 break; 3036 } 3037 } 3038 } 3039}; 3040 3041window.JCCatalogElement.prototype.getMinPriceRange = function() 3042{ 3043 var range; 3044 3045 for (var i in this.currentQuantityRanges) 3046 { 3047 if (this.currentQuantityRanges.hasOwnProperty(i)) 3048 { 3049 if ( 3050 !range 3051 || parseInt(this.currentQuantityRanges[i].SORT_FROM) < parseInt(range.SORT_FROM) 3052 ) 3053 { 3054 range = this.currentQuantityRanges[i]; 3055 } 3056 } 3057 } 3058 3059 return range; 3060} 3061 3062/*set blocks start*/ 3063window.JCCatalogElement.prototype.setActualDataBlock = function(th, obj) 3064{ 3065 /*like block start*/ 3066 this.setLikeBlock(th, '.like_icons .wish_item', obj, 'DELAY'); 3067 this.setLikeBlock(th, '.like_icons .compare_item',obj, 'COMPARE'); 3068 /*like block end*/ 3069 3070 /*buy block start*/ 3071 this.setBuyBlock(th, obj); 3072 /*buy block end*/ 3073} 3074/*set blocks end*/ 3075 3076/*set slider offers*/ 3077window.JCCatalogElement.prototype.SetSliderPict = function(obj, slider, config) 3078{ 3079 var container=$('.wrapp_thumbs'), 3080 slideHtml=''; 3081 countPhoto=obj.SLIDER_COUNT; 3082 container.find('.thumbs').css({ 3083 'max-width':Math.ceil(((countPhoto <= 4 ? countPhoto : 4) * 64) - 10) 3084 }); 3085 3086 slideHtml='<ul class="slides_block">'; 3087 for(var i in slider){ 3088 if(typeof(slider[i]) == 'object'){ 3089 slideHtml+='<li data-big="'+slider[i].BIG.src+'">'+ 3090 '<span class="cnt"><img border="0" src="'+slider[i].THUMB.src+'" alt="'+slider[i].ALT+'" title="'+slider[i].TITLE+'" /></span>'+ 3091 '</li>'; 3092 } 3093 } 3094 slideHtml+='</ul>'; 3095 3096 3097 container.find('.thumbs').html(slideHtml); 3098 if(countPhoto>1){ 3099 container.show(); 3100 3101 if(container.find('.thumbs_navigation').length){ 3102 container.find('.thumbs_navigation').remove(); 3103 } 3104 container.find('.thumbs').append('<span class="thumbs_navigation custom_flex"></span>'); 3105 3106 /* init flexslider start */ 3107 container.find('.thumbs').removeData("flexslider"); 3108 container.find('.thumbs').flexslider({ 3109 animation: "slide", 3110 selector: ".slides_block > li", 3111 slideshow: false, 3112 animationSpeed: 600, 3113 directionNav: true, 3114 controlNav: false, 3115 pauseOnHover: true, 3116 itemWidth: 54, 3117 itemMargin: 10, 3118 animationLoop: true, 3119 controlsContainer: ".thumbs_navigation", 3120 }); 3121 /* init flexslider end */ 3122 container.find('.thumbs .slides_block li').first().addClass('current'); 3123 3124 var pict=$(this.obPict); 3125 container.find('.thumbs').delegate('li:not(.current):not(.flex-nav-next):not(.flex-nav-prev)', 'click', function(e){ 3126 var srcSmall='', 3127 srcBig='', 3128 width='', 3129 height='' 3130 index=$(this).index(); 3131 if(typeof slider[index] !== 'undefined') 3132 { 3133 if('SMALL' in slider[index]){ 3134 srcSmall = slider[index].SMALL.src; 3135 }else if ('SRC' in slider[index]) { 3136 srcSmall = slider[index].SRC 3137 }; 3138 if('BIG' in slider[index]){ 3139 srcBig = slider[index].BIG.src; 3140 } 3141 if('WIDTH' in slider[index]){ 3142 width = slider[index].WIDTH; 3143 } 3144 if('HEIGHT' in slider[index]){ 3145 height = slider[index].HEIGHT; 3146 } 3147 } 3148 3149 $(this).addClass('current').siblings().removeClass('current').parents('.item_slider').find('.slides li').fadeOut(333); 3150 $(this).parents('.item_slider').find('.slides li').eq(index).addClass('current').stop().fadeIn(333); 3151 3152 3153 if(srcSmall){ 3154 BX.adjust(pict[0], { props: { src: srcSmall } }); 3155 } 3156 pict.attr('data-large',''); 3157 3158 if(srcBig){ 3159 if(config.mainPictureMode === 'POPUP'){ 3160 pict.parent().attr('href',srcBig); 3161 } 3162 if(config.mainPictureMode === 'MAGNIFIER'){ 3163 pict.attr('data-large',srcBig); 3164 pict.attr('xoriginal',srcBig); 3165 } 3166 pict.parent().attr('title',slider[index].TITLE); 3167 pict.parent().attr('alt',slider[index].ALT); 3168 pict.attr('title',slider[index].TITLE); 3169 pict.attr('alt',slider[index].ALT); 3170 } 3171 }); 3172 3173 }else{ 3174 container.hide(); 3175 } 3176} 3177 3178/*set mobile slider offers*/ 3179window.JCCatalogElement.prototype.SetSliderPictMobile = function(obj, slider) 3180{ 3181 var container=$('.item_slider.flex'), 3182 slideHtml=''; 3183 countPhoto=obj.SLIDER_COUNT; 3184 3185 slideHtml='<ul class="slides">'; 3186 if(!slider.length){ 3187 slideHtml+='<li data-value="">'+ 3188 '<span data-fancybox-group="item_slider" class="fancy" title="'+obj.NAME+'"><img border="0" src="'+obj.NO_PHOTO.SRC+'" alt="'+obj.NAME+'" title="'+obj.NAME+'" /></span>'+ 3189 '</li>'; 3190 }else{ 3191 for(var i in slider){ 3192 if(typeof(slider[i]) == 'object'){ 3193 slideHtml+='<li data-value="'+obj.ID+'_'+slider[i].ID+'">'+ 3194 '<a href="'+slider[i].BIG.src+'" data-fancybox-group="item_slider" class="fancy popup_link" title="'+slider[i].TITLE+'"><img border="0" src="'+slider[i].SMALL.src+'" alt="'+slider[i].ALT+'" title="'+slider[i].TITLE+'" /><div class="zoom"></div></a>'+ 3195 '</li>'; 3196 } 3197 } 3198 } 3199 slideHtml+='</ul>'; 3200 3201 container.html(slideHtml); 3202 3203 /* init flexslider start */ 3204 container.removeData("flexslider"); 3205 container.flexslider({ 3206 animation: "slide", 3207 slideshow: false, 3208 slideshowSpeed: 10000, 3209 animationSpeed: 600,
3210 directionNav: false, 3211 pauseOnHover: true, 3212 animationLoop: false, 3213 }); 3214 /* init flexslider end */ 3215} 3216 3217/*set compare/wish*/ 3218window.JCCatalogElement.prototype.setLikeBlock = function(th, className, obj, type) 3219{ 3220 var block=th; 3221 if(type=="DELAY"){ 3222 if(obj.CAN_BUY){ 3223 block.find(className).css('display','block'); 3224 }else{ 3225 block.find(className).hide(); 3226 } 3227 } 3228 block.find(className).attr('data-item', obj.ID); 3229 3230 if(arBasketAspro[type]){ 3231 block.find(className).removeClass('added'); 3232 block.find(className).find('.value').css('display','block'); 3233 block.find(className).find('.value.added').hide(); 3234 3235 if(arBasketAspro[type][obj.ID]!==undefined){ 3236 block.find(className).addClass('added'); 3237 block.find(className).find('.value').hide(); 3238 block.find(className).find('.value.added').css('display','block'); 3239 } 3240 } 3241} 3242 3243/*set buy*/ 3244window.JCCatalogElement.prototype.setBuyBlock = function(th, obj) 3245{ 3246 var buyBlock=th.find('.offer_buy_block'), 3247 input_value = obj.CONFIG.MIN_QUANTITY_BUY; 3248 3249 if(buyBlock.find('.counter_wrapp .counter_block').length){ 3250 buyBlock.find('.counter_wrapp .counter_block').attr('data-item', obj.ID); 3251 } 3252 3253 if(this.offers[this.offerNum].offer_set_quantity) 3254 input_value = this.offers[this.offerNum].offer_set_quantity; 3255 3256 if(th.find('.cheaper_form').length) 3257 { 3258 var cheaper_form = th.find('.cheaper_form span'); 3259 cheaper_form.data('autoload-product_name', obj.NAME); 3260 cheaper_form.data('autoload-product_id', obj.ID); 3261 } 3262 3263 if((obj.CONFIG.OPTIONS.USE_PRODUCT_QUANTITY_DETAIL && obj.CONFIG.ACTION == "ADD") && obj.CAN_BUY){ 3264 var max=(obj.CONFIG.MAX_QUANTITY_BUY>0 ? "data-max='"+obj.CONFIG.MAX_QUANTITY_BUY+"'" : ""), 3265 counterHtml='<span class="minus">-</span>'+ 3266 '<input type="text" class="text" name="'+obj.PRODUCT_QUANTITY_VARIABLE+'" value="'+input_value+'" />'+ 3267 '<span class="plus" '+max+'>+</span>'; 3268 if(arBasketAspro["BASKET"] && arBasketAspro["BASKET"][obj.ID]!==undefined){ 3269 if(buyBlock.find('.counter_wrapp .counter_block').length){ 3270 buyBlock.find('.counter_wrapp .counter_block').hide(); 3271 }else{ 3272 buyBlock.find('.counter_wrapp').prepend('<div class="counter_block big_basket" data-item="'+obj.ID+'"></div>'); 3273 buyBlock.find('.counter_wrapp .counter_block').html(counterHtml).hide(); 3274 } 3275 }else{ 3276 if(buyBlock.find('.counter_wrapp .counter_block').length){ 3277 buyBlock.find('.counter_wrapp .counter_block').html(counterHtml).show(); 3278 }else{ 3279 buyBlock.find('.counter_wrapp').prepend('<div class="counter_block big_basket" data-item="'+obj.ID+'"></div>'); 3280 buyBlock.find('.counter_wrapp .counter_block').html(counterHtml); 3281 } 3282 } 3283 }else{ 3284 if(buyBlock.find('.counter_wrapp .counter_block').length){ 3285 buyBlock.find('.counter_wrapp .counter_block').hide(); 3286 } 3287 } 3288 3289 var className=((obj.CONFIG.ACTION == "ORDER") || !obj.CAN_BUY || !obj.CONFIG.OPTIONS.USE_PRODUCT_QUANTITY_DETAIL || (obj.CONFIG.ACTION == "SUBSCRIBE" && obj.CATALOG_SUBSCRIBE == "Y") ? "wide" : "" ), 3290 buyBlockBtn=$('<div class="button_block"></div>'); 3291 3292 if(buyBlock.find('.counter_wrapp').find('.button_block').length){ 3293 if(arBasketAspro["BASKET"] && arBasketAspro["BASKET"][obj.ID]!==undefined){ 3294 buyBlock.find('.counter_wrapp').find('.button_block').addClass('wide').html(obj.HTML); 3295 markProductAddBasket(obj.ID); 3296 }else{ 3297 if(className){ 3298 buyBlock.find('.counter_wrapp').find('.button_block').addClass('wide').html(obj.HTML); 3299 if(typeof arBasketAspro !=="undefined"){ 3300 if(arBasketAspro["SUBSCRIBE"] && arBasketAspro["SUBSCRIBE"][obj.ID]!==undefined){ 3301 markProductSubscribe(obj.ID); 3302 } 3303 } 3304 }else{ 3305 buyBlock.find('.counter_wrapp').find('.button_block').removeClass('wide').html(obj.HTML); 3306 } 3307 } 3308 }else{ 3309 buyBlock.find('.counter_wrapp').append('<div class="button_block '+className+'">'+obj.HTML+'</div>'); 3310 if(arBasketAspro["BASKET"] && arBasketAspro["BASKET"][obj.ID]!==undefined) 3311 markProductAddBasket(obj.ID); 3312 if(arBasketAspro["SUBSCRIBE"] && arBasketAspro["SUBSCRIBE"][obj.ID]!==undefined) 3313 markProductSubscribe(obj.ID); 3314 } 3315 3316 if(obj.CONFIG.ACTION !== "NOTHING"){ 3317 if(obj.CONFIG.ACTION == "ADD" && obj.CAN_BUY && obj.SHOW_ONE_CLICK_BUY!="N"){
3318 var ocb='<span class="transparent btn-lg type_block btn btn-default white one_click transition_bg" data-offers="Y" data-item="'+obj.ID+'" data-iblockID="'+obj.IBLOCK_ID+'" data-quantity="'+obj.CONFIG.MIN_QUANTITY_BUY+'" data-props="'+obj.OFFER_PROPS+'" onclick="oneClickBuy('+obj.ID+', '+obj.IBLOCK_ID+', this)">'+ 3319 '<span>'+obj.ONE_CLICK_BUY+'</span>'+ 3320 '</span>'; 3321 if(buyBlock.find('.wrapp_one_click').length){ 3322 buyBlock.find('.wrapp_one_click').html(ocb); 3323 }else{ 3324 buyBlock.append('<div class="wrapp_one_click">'+ocb+'</div>'); 3325 } 3326 }else{ 3327 if(buyBlock.find('.wrapp_one_click').length){ 3328 buyBlock.find('.wrapp_one_click').remove(); 3329 } 3330 } 3331 }else{ 3332 if(buyBlock.find('.wrapp_one_click').length){ 3333 buyBlock.find('.wrapp_one_click').remove(); 3334 } 3335 } 3336 3337 buyBlock.fadeIn(); 3338 3339 buyBlock.find('.counter_wrapp .counter_block input').data('product', 'ob'+this.obProduct.id); 3340 this.setPriceAction('', 'Y'); 3341} 3342 3343/*set store block*/ 3344window.JCCatalogElement.prototype.setStoreBlock = function(id) 3345{ 3346 $('.stores_tab .stores_wrapp > div').hide(); 3347 $('.stores_tab .sku_stores_'+id).show(); 3348} 3349 3350/*set store quantity*/ 3351window.JCCatalogElement.prototype.setQuantityStore = function(quantity, text) 3352{ 3353 if(parseFloat(quantity)>0){ 3354 $(this.storeQuanity).find('.icon').removeClass('order').addClass('stock'); 3355 }else{ 3356 $(this.storeQuanity).find('.icon').removeClass('stock').addClass('order'); 3357 } 3358 $(this.storeQuanity).find('.icon + span').html(text); 3359 if(!$(".stores_tab").length){ 3360 $('.item-stock .store_view').removeClass('store_view'); 3361 } 3362} 3363 3364/*get compare sku*/ 3365window.JCCatalogElement.prototype.CompareCountResult = function(result) 3366{ 3367 if(result.COMPARE_COUNT){ 3368 for(var i in result.ITEMS){ 3369 if(result.ITEMS[i]==this.offers[this.offerNum].ID){ 3370 this.offers[this.offerNum].COMPARE_ACTIVE=true; 3371 break; 3372 }else{ 3373 this.offers[this.offerNum].COMPARE_ACTIVE=false; 3374 } 3375 } 3376 if(this.offers[this.offerNum].COMPARE_ACTIVE){ 3377 $(this.obCompare).addClass('added'); 3378 $(this.obCompare).find('.value:not(.added)').hide(); 3379 $(this.obCompare).find('.value.added').css('display','block'); 3380 }else{ 3381 $(this.obCompare).removeClass('added'); 3382 $(this.obCompare).find('.value.added').hide(); 3383 $(this.obCompare).find('.value:not(.added)').css('display','block'); 3384 } 3385 } 3386} 3387 3388/*get item info*/ 3389window.JCCatalogElement.prototype.ItemInfoResult = function(result) 3390{ 3391 if(result.HTML){ 3392 $(this.obBasketActions).html(result.HTML); 3393 $(this.obBasketActions).show(); 3394 this.obAddToBasketBtn = BX(this.visual.BUY_ID); 3395 this.obBasketBtn = BX(this.visual.BASKET_LINK); 3396 this.obSubscribeBtn = BX(this.visual.SUBSCRIBE_ID); 3397 this.obSubscribedBtn = BX(this.visual.SUBSCRIBED_ID); 3398 BX.bind(this.obAddToBasketBtn, 'click', BX.delegate(this.Add2Basket, this)); 3399 $(this.obBasketActions).removeClass('wide'); 3400 this.ajax_type_item=result.BUYMISSINGGOODS; 3401 if(result.BUYMISSINGGOODS!="ADD" && !this.canBuy){ 3402 $(this.obBasketActions).addClass('wide'); 3403 }else{ 3404 $(this.obQuantity).css('display',''); 3405 } 3406 if(result.ONE_CLICK_HTML){ 3407 $('.wrapp_one_click').html(result.ONE_CLICK_HTML); 3408 } 3409 3410 } 3411 //if(this.canBuy){ 3412 basketParams = { 3413 ajax_action: 'Y' 3414 }; 3415 BX.ajax.loadJSON( 3416 arNextOptions['SITE_DIR']+'ajax/get_basket_count.php', 3417 basketParams, 3418 BX.delegate(this.BasketCountResult, this) 3419 ); 3420 //} 3421} 3422 3423/*get basket items*/ 3424window.JCCatalogElement.prototype.BasketCountResult = function(result) 3425{ 3426 //if(result.TOTAL_COUNT){ 3427 for(var i in result.ITEMS){ 3428 if(result.ITEMS[i].PRODUCT_ID==this.offers[this.offerNum].ID){ 3429 this.offers[this.offerNum].BASKET_ACTIVE=true; 3430 break; 3431 }else{ 3432 this.offers[this.offerNum].BASKET_ACTIVE=false; 3433 } 3434 } 3435 for(var i in result.SUBSCRIBE_ITEMS){ 3436 if(result.SUBSCRIBE_ITEMS[i].PRODUCT_ID==this.offers[this.offerNum].ID){ 3437 this.offers[this.offerNum].SUBSCRIBE_ACTIVE=true; 3438 break; 3439 }else{ 3440 this.offers[this.offerNum].SUBSCRIBE_ACTIVE=false; 3441 } 3442 } 3443 3444 this.BasketStateRefresh(); 3445 //} 3446} 3447 3448window.JCCatalogElement.prototype.BasketStateRefresh = function(buy_basket) 3449{ 3450 if(this.offers[this.offerNum].SUBSCRIBE_ACTIVE){ 3451 $(this.obBasketActions).addClass('wide'); 3452 $(this.obSubscribeBtn).hide(); 3453 $(this.obSubscribedBtn).show(); 3454 }else{ 3455 $(this.obBasketActions).addClass('wide'); 3456 $(this.obSubscribedBtn).hide(); 3457 $(this.obSubscribeBtn).show(); 3458 } 3459 3460 if(this.offers[this.offerNum].BASKET_ACTIVE){ 3461 $(this.obAddToBasketBtn).hide(); 3462 $(this.obQuantity).closest('.counter_wrapp').find('.counter_block').hide(); 3463 $(this.obBasketBtn).show(); 3464 $(this.obBasketActions).addClass('wide'); 3465 }else{ 3466 $(this.obBasketActions).removeClass('wide'); 3467 $(this.obBasketBtn).hide(); 3468 if(this.ajax_type_item=="ADD" || this.canBuy) 3469 $(this.obQuantity).closest('.counter_wrapp').find('.counter_block').show(); 3470 $(this.obAddToBasketBtn).show(); 3471 } 3472 if(!this.canBuy){ 3473 $(this.obBasketActions).addClass('wide'); 3474 } 3475 if(this.canBuy){ 3476 $('.one_click').removeClass('hidden_block').css('opacity', 1); 3477 } 3478 BX.style(this.obBasketActions, 'opacity', '1'); 3479 $(this.obBasketActions).closest('.counter_wrapp').removeClass('hidden_block').css('opacity',1); 3480 3481 if(buy_basket!== 'undefined' && buy_basket=="Y"){ 3482 if($("#basket_line .basket_fly").length && $(window).outerWidth()>768) 3483 { 3484 // preAnimateBasketFly($("#basket_line .basket_fly"), 200, 333); 3485 basketFly('open'); 3486 } 3487 else if($("#basket_line .cart").length) 3488 { 3489 if($("#basket_line .cart").is(".empty_cart")) 3490 { 3491 $("#basket_line .cart").removeClass("empty_cart").find(".cart_wrapp a.basket_link").removeAttr("href").addClass("cart-call"); 3492 touchBasket('.cart:not(.empty_cart) .basket_block .link'); 3493 } 3494 reloadTopBasket('add', $('#basket_line'), 200, 2000, 'Y'); 3495 /*if($(window).outerWidth() > 520){ 3496 //if(arNextOptions['THEME']['SHOW_BASKET_ONADDTOCART'] !== 'N'){ 3497 preAnimateBasketPopup('', $('.card_popup_frame'), 0, 200); 3498 //} 3499 };*/ 3500 } 3501 animateBasketLine(200); 3502 } 3503} 3504
3505window.JCCatalogElement.prototype.setPriceAction = function(change, sku) 3506{ 3507 var measure = this.offers[this.offerNum].MEASURE && this.offers[this.offerNum].SHOW_MEASURE=="Y" ? this.offers[this.offerNum].MEASURE : ''; 3508 var product = $(this.obProduct), 3509 check_quantity = '', 3510 is_sku = (typeof sku !== 'undefined' && sku == 'Y'); 3511 3512 this.offers[this.offerNum].offer_set_quantity = this.offers[this.offerNum].CONFIG.MIN_QUANTITY_BUY; 3513 if($(product).find('input[name=quantity]').length) 3514 this.offers[this.offerNum].offer_set_quantity = $(product).find('input[name=quantity]').val(); 3515 3516 if($(product).find('.price.discount').length) 3517 $(product).find('.price.discount').html(''); 3518 if($(product).find('.sale_block:not(.matrix)').length) 3519 $(product).find('.sale_block:not(.matrix)').html(''); 3520 3521 if(this.offers[this.offerNum].USE_PRICE_COUNT && this.offers[this.offerNum].PRICE_MATRIX) 3522 { 3523 this.checkPriceRange(this.offers[this.offerNum].offer_set_quantity); 3524 this.setPriceMatrix(this.offers[this.offerNum].PRICE_MATRIX); 3525 } 3526 else 3527 { 3528 if('PRICES' in this.offers[this.offerNum]) 3529 this.setPrice(this.offers[this.offerNum].PRICES, measure); 3530 } 3531 if(arNextOptions['THEME']['SHOW_TOTAL_SUMM'] == 'Y') 3532 { 3533 if(this.offers[this.offerNum].check_quantity) 3534 check_quantity = 'Y'; 3535 else 3536 { 3537 var check_quantity = ((typeof change !== 'undefined' && change == 'Y') ? change : ''); 3538 if(check_quantity) 3539 this.offers[this.offerNum].check_quantity = true; 3540 } 3541 if(typeof this.currentPrices[this.currentPriceSelected] !== 'undefined') 3542 { 3543 if(arNextOptions["THEME"]["SHOW_TOTAL_SUMM_TYPE"] == "ALWAYS") 3544 check_quantity = is_sku = ''; 3545 3546 setPriceItem(product, this.offers[this.offerNum].offer_set_quantity, this.currentPrices[this.currentPriceSelected].PRICE, check_quantity, is_sku); 3547 } 3548 } 3549} 3550 3551window.JCCatalogElement.prototype.setPriceMatrix = function(sPriceMatrix) 3552{ 3553 var prices = ''; 3554 if (!!this.obPrice.price) 3555 { 3556 var measure = this.offers[this.offerNum].MEASURE && this.offers[this.offerNum].SHOW_MEASURE=="Y" ? this.offers[this.offerNum].MEASURE : '', 3557 strPrice = ''; 3558 strPrice = getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_PRICE); 3559 if(measure) 3560 strPrice += '<span class="price_measure">/'+measure+'</span>'; 3561 $(this.obProduct).find('.not_matrix').hide(); 3562 $(this.obProduct).find('.with_matrix .price_value_block').html(strPrice); 3563 3564 if (this.config.showOldPrice) 3565 { 3566 if(parseFloat(this.currentPrices[this.currentPriceSelected].BASE_PRICE) > parseFloat(this.currentPrices[this.currentPriceSelected].PRICE)) 3567 { 3568 $(this.obProduct).find('.with_matrix .discount').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE)); 3569 $(this.obProduct).find('.with_matrix .discount').css('display', 'inline-block'); 3570 } 3571 else 3572 { 3573 $(this.obProduct).find('.with_matrix .discount').html(''); 3574 $(this.obProduct).find('.with_matrix .discount').css('display', 'none'); 3575 } 3576 } 3577 else 3578 { 3579 $(this.obProduct).find('.with_matrix .discount').html(''); 3580 $(this.obProduct).find('.with_matrix .discount').css('display', 'none'); 3581 } 3582 3583 if(this.currentPrices[this.currentPriceSelected].PERCENT > 0) 3584 { 3585 if(this.config.showPercentNumber) 3586 { 3587 if(this.currentPrices[this.currentPriceSelected].PERCENT > 0 && this.currentPrices[this.currentPriceSelected].PERCENT < 100) 3588 { 3589 if(!$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 3590 $('<div class="value"></div>').insertBefore($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .text')); 3591 3592 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').html('-<span>'+this.currentPrices[this.currentPriceSelected].PERCENT+'</span>%'); 3593 } 3594 else 3595 { 3596 if($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 3597 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').remove(); 3598 } 3599 } 3600 } 3601 3602 $(this.obProduct).find('.with_matrix .sale_block .text .values_wrapper').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT)); 3603 if(this.config.showPercent && parseFloat(this.currentPrices[this.currentPriceSelected].DISCOUNT)>0) 3604 $(this.obProduct).find('.with_matrix .sale_block').show(); 3605 else 3606 $(this.obProduct).find('.with_matrix .sale_block').hide(); 3607 $(this.obProduct).find('.with_matrix').show(); 3608 BX.adjust(this.obPrice.price, {html: sPriceMatrix}); 3609 3610 var eventdata = {product: $(this.obProduct), measure: measure, config: this.config, offer: this.offers[this.offerNum], obPrice: this.currentPrices[this.currentPriceSelected]}; 3611 BX.onCustomEvent('onAsproSkuSetPriceMatrix', [eventdata]) 3612 } 3613} 3614
3615window.JCCatalogElement.prototype.setPrice = function(obPrices, measure) 3616{ 3617 var prices = ''; 3618 if (!!this.obPrice.price) 3619 { 3620 var measure = this.offers[this.offerNum].MEASURE && this.offers[this.offerNum].SHOW_MEASURE=="Y" ? this.offers[this.offerNum].MEASURE : '', 3621 product = $(this.obProduct), 3622 obPrices = this.offers[this.offerNum].PRICES; 3623 if(typeof(obPrices) == 'object') 3624 { 3625 var strPrice = '', 3626 count = Object.keys(obPrices).length, 3627 arStikePrices = []; 3628 3629 if(arNextOptions['THEME']['DISCOUNT_PRICE']) 3630 { 3631 arStikePrices = arNextOptions['THEME']['DISCOUNT_PRICE'].split(','); 3632 } 3633 3634 strPrice = '<div class="offers_price_wrapper">'; 3635 $(this.obProduct).find('.with_matrix').hide(); 3636 $(this.obProduct).find('.not_matrix').show(); 3637 for(var j in obPrices) 3638 { 3639 if(obPrices[j] && obPrices[j].VALUE > 0) 3640 { 3641 if('GROUP_NAME' in obPrices[j]) 3642 { 3643 if(count > 1) 3644 { 3645 strPrice += '<div class="offers_price_title">'; 3646 strPrice += obPrices[j].GROUP_NAME; 3647 strPrice += '</div>'; 3648 } 3649 } 3650 strPrice += '<div class="offers_price'+(arStikePrices ? (BX.util.in_array(obPrice
3650s[j].PRICE_ID, arStikePrices) ? ' strike_block' : '') : '')+'">'; 3651 strPrice += '<span class="values_wrapper">'+getCurrentPrice(obPrices[j].DISCOUNT_VALUE, obPrices[j].CURRENCY, obPrices[j].PRINT_DISCOUNT_VALUE)+'</span>'; 3652 if(measure) 3653 strPrice += '<span class="price_measure">/'+measure+'</span>'; 3654 3655 strPrice += '</div>'; 3656 if (obPrices[j].DISCOUNT_VALUE !== obPrices[j].VALUE) 3657 { 3658 if(this.config.showOldPrice) 3659 { 3660 strPrice += '<div class="offers_price_old">'; 3661 strPrice += '<span class="values_wrapper">'+getCurrentPrice(obPrices[j].VALUE, obPrices[j].CURRENCY, obPrices[j].PRINT_VALUE)+'</span>'; 3662 strPrice += '</div>'; 3663 } 3664 if(this.config.showPercent) 3665 { 3666 if(!this.config.showPercentNumber || (this.config.showPercentNumber && (obPrices[j].DISCOUNT_DIFF_PERCENT <= 0 && obPrices[j].DISCOUNT_DIFF_PERCENT >= 100))) 3667 { 3668 strPrice += '<div class="sale_block matrix"><div class="sale_wrapper">'; 3669 strPrice += '<span class="title">'+BX.message('ITEM_ECONOMY')+'</span>'; 3670 strPrice += '<div class="text">'; 3671 strPrice += '<span class="values_wrapper">'+getCurrentPrice(obPrices[j].DISCOUNT_DIFF, obPrices[j].CURRENCY, obPrices[j].PRINT_DISCOUNT_DIFF)+'</span>'; 3672 strPrice += '</div>'; 3673 strPrice += '<div class="clearfix"></div></div></div>'; 3674 } 3675 else 3676 { 3677 strPrice += '<div class="sale_block matrix"><div class="sale_wrapper">'; 3678 strPrice += '<div class="value">-<span>'+obPrices[j].DISCOUNT_DIFF_PERCENT+'</span>%</div>'; 3679 strPrice += '<div class="text">'; 3680 strPrice += '<span class="title">'+BX.message('ITEM_ECONOMY')+'</span> '; 3681 strPrice += '<span class="values_wrapper">'+getCurrentPrice(obPrices[j].DISCOUNT_DIFF, obPrices[j].CURRENCY, obPrices[j].PRINT_DISCOUNT_DIFF)+'</span>'; 3682 strPrice += '</div>'; 3683 strPrice += '<div class="clearfix"></div></div></div>'; 3684 } 3685 } 3686 } 3687 else 3688 { 3689 if (this.config.showOldPrice) 3690 { 3691 if (!!this.obPrice.full) 3692 { 3693 BX.adjust(this.obPrice.full, {style: {display: 'none'}, html: ''}); 3694 } 3695 if (!!this.obPrice.discount) 3696 { 3697 BX.adjust(this.obPrice.discount, {style: {display: 'none'}, html: ''}); 3698 } 3699 } 3700 } 3701 $('.prices_block .cost.prices').show(); 3702 } 3703 else 3704 { 3705 $('.prices_block .cost.prices').hide(); 3706 } 3707 } 3708 if (this.config.showPercent) 3709 { 3710 if (!!this.obPrice.percent) 3711 { 3712 BX.adjust(this.obPrice.percent, {style: {display: 'none'}, html: ''}); 3713 } 3714 $(this.obPrice.full).closest('.cost').find('.sale_block:not(.matrix)').hide(); 3715 $(this.obPrice.full).closest('.cost').find('.sale_block:not(.matrix) .value').html(''); 3716 $(this.obPrice.full).closest('.cost').find('.sale_block:not(.matrix) .text span').html(''); 3717 } 3718 strPrice += '</div>'; 3719 BX.adjust(this.obPrice.price, {html: strPrice}); 3720 3721 $(this.obPrice.full).hide().html(''); 3722 if(this.showPercent) 3723 $(this.obPrice.full).closest('.cost').find('.sale_block').hide(); 3724 3725 var eventdata = {product: product, measure: measure, config: this.config, offer: this.offers[this.offerNum], obPrices: obPrices}; 3726 BX.onCustomEvent('onAsproSkuSetPrice', [eventdata]) 3727 } 3728 } 3729}; 3730 3731window.JCCatalogElement.prototype.Compare = function() 3732{ 3733 var compareParams, compareLink; 3734 if($(this.obCompare).find('.added').is(':visible')){ 3735 compareLink = this.compareData.compareUrlDel; 3736 this.compareData.Added = false; 3737 }else{ 3738 compareLink = this.compareData.compareUrl; 3739 this.compareData.Added = true; 3740 } 3741 if (!!compareLink){ 3742 switch (this.productType){ 3743 case 1://product 3744 case 2://set 3745 compareLink = compareLink.replace('#ID#', this.product.id.toString()); 3746 break; 3747 case 3://sku 3748 compareLink = compareLink.replace('#ID#', this.offers[this.offerNum].ID); 3749 break; 3750 } 3751 compareParams = { 3752 ajax_action: 'Y' 3753 }; 3754 BX.ajax.loadJSON( 3755 compareLink, 3756 compareParams, 3757 BX.proxy(this.CompareResult, this) 3758 ); 3759 } 3760}; 3761 3762window.JCCatalogElement.prototype.CompareResult = function(result) 3763{ 3764 var popupContent, popupButtons, popupTitle; 3765 3766 if (typeof result !== 'object') 3767 { 3768 return false;
3769 } 3770 if (result.STATUS === 'OK') 3771 { 3772 BX.onCustomEvent('OnCompareChange'); 3773 if(!this.compareData.Added){ 3774 $(this.obCompare).removeClass('added'); 3775 $(this.obCompare).find('.added').hide(); 3776 $(this.obCompare).find('.value:not(.added)').css('display','block'); 3777 } 3778 else{ 3779 $(this.obCompare).addClass('added'); 3780 $(this.obCompare).find('.value:not(.added)').hide(); 3781 $(this.obCompare).find('.added').css('display','block'); 3782 } 3783 jsAjaxUtil.InsertDataToNode(arNextOptions['SITE_DIR'] + 'ajax/show_compare_preview_top.php', 'compare_line', false); 3784 } 3785 else 3786 { 3787 console.log(BX.message('ADD_ERROR_COMPARE')); 3788 } 3789 return false; 3790}; 3791 3792window.JCCatalogElement.prototype.CompareRedirect = function() 3793{ 3794 if (!!this.compareData.comparePath) 3795 { 3796 location.href = this.compareData.comparePath; 3797 } 3798 else 3799 { 3800 this.obPopupWin.close(); 3801 } 3802}; 3803 3804window.JCCatalogElement.prototype.InitBasketUrl = function() 3805{ 3806 var product_url=''; 3807 this.basketUrl = (this.basketMode === 'ADD' ? this.basketData.add_url : this.basketData.buy_url); 3808 switch (this.productType) 3809 { 3810 case 1://product 3811 case 2://set 3812 this.basketUrl = this.basketUrl.replace('#ID#', this.product.id.toString()); 3813 product_url=this.product.id.toString(); 3814 break; 3815 case 3://sku 3816 this.basketUrl = this.basketUrl.replace('#ID#', this.offers[this.offerNum].ID); 3817 product_url=this.offers[this.offerNum].URL; 3818 break; 3819 } 3820 this.basketParams = { 3821 'ajax_basket': 'Y' 3822 }; 3823 if (this.config.showQuantity) 3824 { 3825 this.basketParams[this.basketData.quantity] = this.obQuantity.value; 3826 } 3827 if (!!this.basketData.sku_props) 3828 { 3829 this.basketParams[this.basketData.sku_props_var] = this.basketData.sku_props; 3830 } 3831 if (!!product_url) 3832 { 3833 this.basketParams["REQUEST_URI"] = product_url; 3834 } 3835}; 3836 3837window.JCCatalogElement.prototype.FillBasketProps = function() 3838{ 3839 if (!this.visual.BASKET_PROP_DIV) 3840 { 3841 return; 3842 } 3843 var 3844 i = 0, 3845 propCollection = null, 3846 foundValues = false, 3847 obBasketProps = null; 3848 if (this.basketData.useProps && !this.basketData.emptyProps) 3849 { 3850 if (!!this.obPopupWin && !!this.obPopupWin.contentContainer) 3851 { 3852 obBasketProps = this.obPopupWin.contentContainer; 3853 } 3854 } 3855 else 3856 { 3857 obBasketProps = BX(this.visual.BASKET_PROP_DIV); 3858 } 3859 if (!!obBasketProps) 3860 { 3861 propCollection = obBasketProps.getElementsByTagName('select'); 3862 if (!!propCollection && !!propCollection.length) 3863 { 3864 for (i = 0; i < propCollection.length; i++) 3865 { 3866 if (!propCollection[i].disabled) 3867 { 3868 switch(propCollection[i].type.toLowerCase()) 3869 { 3870 case 'select-one': 3871 this.basketParams[propCollection[i].name] = propCollection[i].value; 3872 foundValues = true; 3873 break; 3874 default: 3875 break; 3876 } 3877 } 3878 } 3879 } 3880 propCollection = obBasketProps.getElementsByTagName('input'); 3881 if (!!propCollection && !!propCollection.length) 3882 { 3883 for (i = 0; i < propCollection.length; i++) 3884 { 3885 if (!propCollection[i].disabled) 3886 { 3887 switch(propCollection[i].type.toLowerCase()) 3888 { 3889 case 'hidden': 3890 this.basketParams[propCollection[i].name] = propCollection[i].value; 3891 foundValues = true; 3892 break; 3893 case 'radio': 3894 if (propCollection[i].checked) 3895 { 3896 this.basketParams[propCollection[i].name] = propCollection[i].value; 3897 foundValues = true; 3898 } 3899 break; 3900 default: 3901 break; 3902 } 3903 } 3904 } 3905 } 3906 } 3907 if (!foundValues) 3908 { 3909 this.basketParams[this.basketData.props] = []; 3910 this.basketParams[this.basketData.props][0] = 0; 3911 } 3912}; 3913 3914window.JCCatalogElement.prototype.SendToBasket = function() 3915{ 3916 if (!this.canBuy) 3917 { 3918 return; 3919 } 3920 this.InitBasketUrl(); 3921 this.FillBasketProps(); 3922 BX.ajax.loadJSON( 3923 this.basketUrl, 3924 this.basketParams, 3925 BX.proxy(this.BasketResult, this) 3926 ); 3927}; 3928 3929window.JCCatalogElement.prototype.Add2Basket = function() 3930{ 3931 this.basketMode = 'ADD'; 3932 this.Basket(); 3933}; 3934 3935window.JCCatalogElement.prototype.BuyBasket = function() 3936{ 3937 this.basketMode = 'BUY'; 3938 this.Basket(); 3939}; 3940 3941window.JCCatalogElement.prototype.Basket = function() 3942{ 3943 var contentBasketProps = ''; 3944 if (!this.canBuy) 3945 { 3946 return; 3947 } 3948 this.SendToBasket(); 3949}; 3950 3951window.JCCatalogElement.prototype.BasketResult = function(arResult) 3952{ 3953 var popupContent, popupButtons, popupTitle, productPict; 3954 if (!!this.obPopupWin) 3955 { 3956 this.obPopupWin.close(); 3957 } 3958 if (typeof arResult !== 'object') 3959 { 3960 return false;
3961 } 3962 if (arResult.STATUS === 'OK' && this.basketMode === 'BUY') 3963 { 3964 this.BasketRedirect(); 3965 } 3966 else 3967 { 3968 // this.InitPopupWindow(); 3969 popupTitle = { 3970 content: BX.create('div', { 3971 style: { marginRight: '30px', whiteSpace: 'nowrap' }, 3972 text: (arResult.STATUS === 'OK' ? BX.message('TITLE_SUCCESSFUL') : BX.message('TITLE_ERROR')) 3973 }) 3974 }; 3975 if (arResult.STATUS === 'OK') 3976 { 3977 BX.onCustomEvent('OnBasketChange'); 3978 this.offers[this.offerNum].BASKET_ACTIVE=true; 3979 this.BasketStateRefresh("Y"); 3980 } 3981 else 3982 { 3983 console.log(BX.message('ADD_ERROR_BASKET')); 3984 } 3985 } 3986 return false; 3987}; 3988 3989window.JCCatalogElement.prototype.BasketRedirect = function() 3990{ 3991 location.href = (!!this.basketData.basketUrl ? this.basketData.basketUrl : BX.message('BASKET_URL')); 3992}; 3993 3994window.JCCatalogElement.prototype.InitPopupWindow = function() 3995{ 3996 if (!!this.obPopupWin) 3997 { 3998 return; 3999 } 4000 this.obPopupWin = BX.PopupWindowManager.create('CatalogElementBasket_'+this.visual.ID, null, { 4001 autoHide: false, 4002 offsetLeft: 0, 4003 offsetTop: 0, 4004 overlay : true, 4005 closeByEsc: true, 4006 titleBar: true, 4007 closeIcon: {top: '10px', right: '10px'} 4008 }); 4009}; 4010 4011window.JCCatalogElement.prototype.onPopupWindowShow = function(popup) 4012{ 4013 BX.bind(document, 'click', BX.proxy(this.popupWindowClick, this)); 4014}; 4015 4016window.JCCatalogElement.prototype.onPopupWindowClose = function(popup, event) 4017{ 4018 BX.unbind(document, 'click', BX.proxy(this.popupWindowClick, this)); 4019}; 4020 4021window.JCCatalogElement.prototype.popupWindowClick = function() 4022{ 4023 if (!!this.obPopupPict && typeof (this.obPopupPict) === 'object') 4024 { 4025 if (this.obPopupPict.isShown()) 4026 { 4027 this.obPopupPict.close(); 4028 } 4029 } 4030}; 4031 4032window.JCCatalogElement.prototype.incViewedCounter = function() 4033{ 4034 if (this.currentIsSet && !this.updateViewedCount) 4035 { 4036 4037 switch (this.productType) 4038 { 4039 case 1: 4040 case 2: 4041 this.viewedCounter.params.PRODUCT_ID = this.product.id; 4042 this.viewedCounter.params.PARENT_ID = this.product.id; 4043 break; 4044 case 3: 4045 this.viewedCounter.params.PARENT_ID = this.product.id; 4046 this.viewedCounter.params.PRODUCT_ID = this.offers[this.offerNum].ID; 4047 break; 4048 default: 4049 return; 4050 } 4051 this.viewedCounter.params.SITE_ID = BX.message('SITE_ID'); 4052 this.updateViewedCount = true; 4053 BX.ajax.post( 4054 this.viewedCounter.path, 4055 this.viewedCounter.params, 4056 BX.delegate(function(){ this.updateViewedCount = false; }, this) 4057 ); 4058 } 4059}; 4060 4061window.JCCatalogElement.prototype.allowViewedCount = function(update) 4062{ 4063 update = !!update; 4064 this.currentIsSet = true; 4065 if (update) 4066 { 4067 this.incViewedCounter(); 4068 } 4069}; 4070})(window); 4071/* End */ 4072; 4073; /* Start:"a:4:{s:4:"full";s:99:"/bitrix/templates/aspro_next/components/bitrix/sale.gift.product/main/script.min.js?172959400131307";s:6:"source";s:79:"/bitrix/templates/aspro_next/components/bitrix/sale.gift.product/main/script.
4073js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 4074function bx_sale_gift_product_load(i,t,e){t=t||{},e=e||{},BX.ajax({url:"/bitrix/components/bitrix/sale.gift.product/ajax.php",method:"POST",data:BX.merge(t,e),dataType:"html",processData:!1,start:!0,onsuccess:function(t){var e=BX.processHTML(t);BX(i).innerHTML=e.HTML,BX.ajax.processScripts(e.SCRIPT),initCountdown()}})}!function(h){if(h.JCCatalogSectionOnlyElement||(h.JCCatalogSectionOnlyElement=function(t){"object"==typeof t&&(this.params=t,this.obProduct=null,this.set_quantity=1,this.currentPriceMode="",this.currentPrices=[],this.currentPriceSelected=0,this.currentQuantityRanges=[],this.currentQuantityRangeSelected=0,this.params.MESS&&(this.mess=this.params.MESS),this.init())},h.JCCatalogSectionOnlyElement.prototype={init:function(){this.obProduct=BX(this.params.ID),this.obProduct&&($(this.obProduct).find(".counter_wrapp .counter_block input").data("product","ob"+this.obProduct.id+"el"),this.currentPriceMode=this.params.ITEM_PRICE_MODE,this.currentPrices=this.params.ITEM_PRICES,this.currentQuantityRanges=this.params.ITEM_QUANTITY_RANGES)},setPriceAction:function(){this.set_quantity=this.params.MIN_QUANTITY_BUY,$(this.obProduct).find("input[name=quantity]").length&&(this.set_quantity=$(this.obProduct).find("input[name=quantity]").val()),this.checkPriceRange(this.set_quantity),$(this.obProduct).find(".not_matrix").hide(),$(this.obProduct).find(".with_matrix .price_value_block").html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE,this.currentPrices[this.currentPriceSelected].CURRENCY,this.currentPrices[this.currentPriceSelected].PRINT_PRICE)),$(this.obProduct).find(".with_matrix .discount")&&$(this.obProduct).find(".with_matrix .discount").html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE,this.currentPrices[this.currentPriceSelected].CURRENCY,this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE)),"Y"==this.params.SHOW_DISCOUNT_PERCENT_NUMBER&&(0<this.currentPrices[this.currentPriceSelected].PERCENT&&this.currentPrices[this.currentPriceSelected].PERCENT<100?($(this.obProduct).find(".with_matrix .sale_block .sale_wrapper .value").length||$('<div class="value"></div>').insertBefore($(this.obProduct).find(".with_matrix .sale_block .sale_wrapper .text")),$(this.obProduct).find(".with_matrix .sale_block .sale_wrapper .value").html("-<span>"+this.currentPrices[this.currentPriceSelected].PERCENT+"</span>%")):$(this.obProduct).find(".with_matrix .sale_block .sale_wrapper .value").length&&$(this.obProduct).find(".with_matrix .sale_block .sale_wrapper .value").remove()),$(this.obProduct).find(".with_matrix .sale_block .text .values_wrapper").html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT,this.currentPrices[this.currentPriceSelected].CURRENCY,this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT)),$(this.obProduct).find(".with_matrix").show(),"Y"==arNextOptions.THEME.SHOW_TOTAL_SUMM&&setPriceItem($(this.obProduct),this.set_quantity,this.currentPrices[this.currentPriceSelected].PRICE)},checkPriceRange:function(t){if(void 0!==t&&"Q"==this.currentPriceMode){var e,i=!1;for(var s in this.currentQuantityRanges)if(this.currentQuantityRanges.hasOwnProperty(s)&&(e=this.currentQuantityRanges[s],parseInt(t)>=parseInt(e.SORT_FROM)&&("INF"==e.SORT_TO||parseInt(t)<=parseInt(e.SORT_TO)))){i=!0,this.currentQuantityRangeSelected=e.HASH;break}for(var o in!i&&(e=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=e.HASH),this.currentPrices)if(this.currentPrices.hasOwnProperty(o)&&this.currentPrices[o].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=o;break}}},getMinPriceRange:function(){var t;for(var e in this.currentQuantityRanges)this.currentQuantityRanges.hasOwnProperty(e)&&(!t||parseInt(this.currentQuantityRanges[e].SORT_FROM)<parseInt(t.SORT_FROM))&&(t=this.currentQuantityRanges[e]);return t}}),!h.JCSaleGiftProduct){var a=function(t){a.superclass.constructor.apply(this,arguments),this.nameNode=BX.create("span",{props:{className:"bx_medium bx_bt_button",id:this.id},text:t.text}),this.buttonNode=BX.create("span",{attrs:{className:t.ownerClass},style:{marginBottom:"0",borderBottom:"0 none transparent"},children:[this.nameNode],events:this.contextEvents}),BX.browser.IsIE()&&this.buttonNode.setAttribute("hideFocus","hidefocus")};BX.extend(a,BX.PopupWindowButton),h.JCSaleGiftProduct=function(t){if(this.skuVisualParams={SELECT:{TAG_BIND:"select",TAG:"option",ACTIVE_CLASS:"active",HIDE_CLASS:"hidden",EVENT:"change"},LI:{TAG_BIND:"li",TAG:"li",ACTIVE_CLASS:"active",HIDE_CLASS:"missing",EVENT:"click"}}
4074,this.productType=0,this.showQuantity=!0,this.showAbsent=!0,this.secondPict=!1,this.showOldPrice=!1,this.showPercent=!1,this.showSkuProps=!1,this.showPercentNumber=!1,this.visual={ID:"",PICT_ID:"",SECOND_PICT_ID:"",QUANTITY_ID:"",QUANTITY_UP_ID:"",QUANTITY_DOWN_ID:"",PRICE_ID:"",DSC_PERC:"",SECOND_DSC_PERC:"",DISPLAY_PROP_DIV:"",BASKET_PROP_DIV:""},this.product={checkQuantity:!1,maxQuantity:0,stepQuantity:1,isDblQuantity:!1,canBuy:!0,canSubscription:!0,name:"",pict:{},id:0,addUrl:"",buyUrl:""},this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:""},this.defaultPict={pict:null,secondPict:null},this.checkQuantity=!1,this.maxQuantity=0,this.stepQuantity=1,this.isDblQuantity=!1,this.canBuy=!0,this.canSubscription=!0,this.precision=6,this.precisionFactor=Math.pow(10,this.precision),this.currentPriceMode="",this.currentPrices=[],this.currentPriceSelected=0,this.currentQuantityRanges=[],this.currentQuantityRangeSelected=0,this.offers=[],this.offerNum=0,this.treeProps=[],this.obTreeRows=[],this.showCount=[],this.showStart=[],this.selectedValues={},this.obProduct=null,this.obQuantity=null,this.obQuantityUp=null,this.obQuantityDown=null,this.obPict=null,this.obSecondPict=null,this.obPrice=null,this.obTree=null,this.obBuyBtn=null,this.obDscPerc=null,this.obSecondDscPerc=null,this.obSkuProps=null,this.obMeasure=null,this.obPopupWin=null,this.basketUrl="",this.basketParams={},this.treeRowShowSize=5,this.treeEnableArrow={display:"",cursor:"pointer",opacity:1},this.treeDisableArrow={display:"",cursor:"default",opacity:.2},this.lastElement=!1,this.containerHeight=0,this.errorCode=0,"object"==typeof t){switch(this.productType=parseInt(t.PRODUCT_TYPE,10),this.showQuantity=t.SHOW_QUANTITY,this.showAbsent=t.SHOW_ABSENT,this.secondPict=!!t.SECOND_PICT,this.showOldPrice=!!t.SHOW_OLD_PRICE,this.showPercent=!!t.SHOW_DISCOUNT_PERCENT,this.showSkuProps=!!t.SHOW_SKU_PROPS,this.showPercentNumber="Y"==t.SHOW_DISCOUNT_PERCENT_NUMBER,this.visual=t.VISUAL,this.productType){case 1:case 2:t.PRODUCT&&"object"==typeof t.PRODUCT?(this.showQuantity&&(this.product.checkQuantity=t.PRODUCT.CHECK_QUANTITY,this.product.isDblQuantity=t.PRODUCT.QUANTITY_FLOAT,this.product.checkQuantity&&(this.product.maxQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.MAX_QUANTITY):parseInt(t.PRODUCT.MAX_QUANTITY,10)),this.product.stepQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.STEP_QUANTITY):parseInt(t.PRODUCT.STEP_QUANTITY,10),this.checkQuantity=this.product.checkQuantity,this.isDblQuantity=this.product.isDblQuantity,this.maxQuantity=this.product.maxQuantity,this.stepQuantity=this.product.stepQuantity,this.isDblQuantity&&(this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor)),this.product.canBuy=t.PRODUCT.CAN_BUY,this.product.canSubscription=t.PRODUCT.SUBSCRIPTION,this.canBuy=this.product.canBuy,this.canSubscription=this.product.canSubscription,this.product.name=t.PRODUCT.NAME,this.product.pict=t.PRODUCT.PICT,this.product.id=t.PRODUCT.ID,t.PRODUCT.ADD_URL&&(this.product.addUrl=t.PRODUCT.ADD_URL),t.PRODUCT.BUY_URL&&(this.product.buyUrl=t.PRODUCT.BUY_URL),t.BASKET&&"object"==typeof t.BASKET&&(this.basketData.useProps=!!t.BASKET.ADD_PROPS,this.basketData.emptyProps=!!t.BASKET.EMPTY_PROPS)):this.errorCode=-1;break;case 3:t.OFFERS&&BX.type.isArray(t.OFFERS)?(t.PRODUCT&&"object"==typeof t.PRODUCT&&(this.product.name=t.PRODUCT.NAME,this.product.id=t.PRODUCT.ID),this.offers=t.OFFERS,this.offerNum=0,t.OFFER_SELECTED&&(this.offerNum=parseInt(t.OFFER_SELECTED,10)),isNaN(this.offerNum)&&(this.offerNum=0),t.TREE_PROPS&&(this.treeProps=t.TREE_PROPS),t.DEFAULT_PICTURE&&(this.defaultPict.pict=t.DEFAULT_PICTURE.PICTURE,this.defaultPict.secondPict=t.DEFAULT_PICTURE.PICTURE_SECOND)):this.errorCode=-1;break;default:this.errorCode=-1}t.BASKET&&"object"==typeof t.BASKET&&(t.BASKET.QUANTITY&&(this.basketData.quantity=t.BASKET.QUANTITY),t.BASKET.PROPS&&(this.basketData.props=t.BASKET.PROPS),t.BASKET.BASKET_URL&&(this.basketData.basketUrl=t.BASKET.BASKET_URL)),this.lastElement=!!t.LAST_ELEMENT&&"Y"===t.LAST_ELEMENT}0===this.errorCode&&BX.ready(BX.delegate(this.Init,this))},h.JCSaleGiftProduct.prototype.Init=function(){var t=0,e="",i=null;if(this.obProduct=BX(this.visual.ID),this.obProduct||(this.errorCode=-1),this.obPict=BX(this.visual.PICT_ID),this.obPict||(this.errorCode=-2),this.secondPict&&this.visual.SECOND_PICT_ID&&(this.obSecondPict=BX(this.visual.SECOND_PICT_ID)),this.storeQuanity=BX(this.visual.STORE_QUANTITY),this.obPrice=BX(this.visual.PRICE_ID),this.obPriceOld=BX(this.visual.PRICE_OLD_ID),this.obPrice||(this.errorCode=-16),this.showQuantity&&this.visual.QUANTITY_ID&&(this.obQuantity=BX(this.visual.QUANTITY_ID),this.visual.QUANTITY_UP_ID&&(this.obQuantityUp=BX(this.visual.QUANTITY_UP_ID)),this.visual.QUANTITY_DOWN_ID&&(this.obQuantityDown=BX(this.visual.QUANTITY_DOWN_ID))),3===this.productType){if(this.visual.TREE_ID)for(this.obTree=BX(this.visual.TREE_ID),this.obTree||(this.errorCode=-256),e=this.visual.TREE_ITEM_ID,t=0;t<this.treeProps.length;t++)if(this.obTreeRows[t]={LIST:BX(e+this.treeProps[t].ID+"_list"),CONT:BX(e+this.treeProps[t].ID+"_cont")},!this.obTreeRows[t].LIST||!this.obTreeRows[t].CONT){this.errorCode=-512;break}this.visual.QUANTITY_MEASURE&&(this.obMeasure=BX(this.visual.QUANTITY_MEASURE))}if(this.visual.BUY_ID&&(this.obBuyBtn=BX(this.visual.BUY_ID)),this.showPercent&&(this.visual.DSC_PERC&&(this.obDscPerc=BX(this.visual.DSC_PERC)),this.secondPict&&this.visual.SECOND_DSC_PERC&&(this.obSecondDscPerc=BX(this.visual.SECOND_DSC_PERC))),this.showSkuProps&&this.visual.DISPLAY_PROP_DIV&&(this.obSkuProps=BX(this.visual.DISPLAY_PROP_DIV)),0===this.errorCode){switch(this.showQuantity&&(this.obQuantityUp&&BX.bind(this.obQuantityUp,"click",BX.delegate(this.QuantityUp,this)),this.obQuantityDown&&BX.bind(this.obQuantityDown,"click",BX.delegate(this.QuantityDown,this)),this.obQuantity&&BX.bind(this.obQuantity,"change",BX.delegate(this.QuantityChange,this))),this.productType){case 1:break;case 3:for(var s in this.skuVisualParams){if((i=BX.findChildren(this.obTree,{tagName:this.skuVisualParams[s].TAG_BIND},!0))&&0<i.length)for(t=0;t<i.length;t++)$(i[t]).on(this.skuVisualParams[s].EVENT,BX.delegate(this.SelectOfferProp,this))}this.SetCurrent()}this.obBuyBtn&&BX.bind(this.obBuyBtn,"click",BX.delegate(this.Basket,this))}},h.JCSaleGiftProduct.prototype.checkHeight=function(){this.containerHeight=parseInt(this.obProduct.parentNode.offsetHeight,10),isNaN(this.containerHeight)&&(this.containerHeight=0)},h.JCSaleGiftProduct.prototype.setHeight=function(){0<this.containerHeight&&BX.adjust(this.obProduct.parentNode,{style:{height:this.containerHeight+"px"}})},h.JCSaleGiftProduct.prototype.clearHeight=function(){BX.adjust(this.obProduct.parentNode,{style:{height:"auto"}})},h.JCSaleGiftProduct.prototype.QuantityUp=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&this.canBuy&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t+=this.stepQuantity,this.checkQuantity&&t>this.maxQuantity&&(e=!1),e&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t)))},h.JCSaleGiftProduct.prototype.QuantityDown=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&this.canBuy&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||((t-=this.stepQuantity)<this.stepQuantity&&(e=!1),e&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t)))},h.JCSaleGiftProduct.prototype.QuantityChange=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&(this.canBuy?(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)?this.obQuantity.value=this.stepQuantity:(this.checkQuantity&&(t>this.maxQuantity?(e=!1,t=this.maxQuantity):t<this.stepQuantity&&(e=!1,t=this.stepQuantity)),e||(this.obQuantity.value=t))):this.obQuantity.value=this.stepQuantity)},h.JCSaleGiftProduct.prototype.QuantitySet=function(t){0===this.errorCode&&(this.canBuy=this.offers[t].CAN_BUY,this.currentPriceMode=this.offers[t].ITEM_PRICE_MODE,this.currentPrices=this.offers[t].ITEM_PRICES,this.currentPriceSelected=this.offers[t].ITEM_PRICE_SELECTED,this.currentQuantityRanges=this.offers[t].ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=this.offers[t].ITEM_QUANTITY_RANGE_SELECTED,this.canBuy?(this.obBasketActions&&BX.style(this.obBasketActions,"dis
4074play",""),this.obNotAvail&&BX.style(this.obNotAvail,"display","none")):(this.obBasketActions&&(BX.style(this.obBasketActions,"opacity","0"),BX.style(BX.findParent(BX(this.obQuantity),{class:"counter_block"}),"display","none")),this.obNotAvail&&BX.style(this.obNotAvail,"display","")),this.showQuantity&&(this.isDblQuantity=this.offers[t].QUANTITY_FLOAT,this.checkQuantity=this.offers[t].CHECK_QUANTITY,this.isDblQuantity?(this.maxQuantity=parseFloat(this.offers[t].MAX_QUANTITY),this.stepQuantity=Math.round(parseFloat(this.offers[t].STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor):(this.maxQuantity=parseInt(this.offers[t].MAX_QUANTITY,10),this.stepQuantity=parseInt(this.offers[t].STEP_QUANTITY,10)),this.obQuantity&&(this.obQuantity.value=this.defaultCount,this.obQuantity.disabled=!this.canBuy),this.obMeasure&&(this.offers[t].MEASURE?BX.adjust(this.obMeasure,{html:this.offers[t].MEASURE}):BX.adjust(this.obMeasure,{html:""}))),this.currentBasisPrice=this.offers[t].BASIS_PRICE)},h.JCSaleGiftProduct.prototype.SelectOfferProp=function(){var t=0,e="",i="",s=[],o=null,r=BX.proxy_context;if(r&&r.hasAttribute("data-treevalue")&&(i=r.getAttribute("data-treevalue"),propModes=r.getAttribute("data-showtype"),s=i.split("_"),this.SearchOfferPropIndex(s[0],s[1])&&(o=BX.findChildren(r.parentNode,{tagName:this.skuVisualParams[propModes.toUpperCase()].TAG},!1))&&0<o.length))for(t=0;t<o.length;t++)e=o[t].getAttribute("data-onevalue"),"TEXT"==propModes?e===s[1]?o[t].setAttribute("selected","selected"):o[t].removeAttribute("selected"):e===s[1]?$(o[t]).addClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS):$(o[t]).removeClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS)},h.JCSaleGiftProduct.prototype.SearchOfferPropIndex=function(t,e){var i,s,o="",r=!1,a=[],n=-1,h={},u=[];for(i=0;i<this.treeProps.length;i++)if(this.treeProps[i].ID===t){n=i;break}if(-1<n){for(i=0;i<n;i++)h[o="PROP_"+this.treeProps[i].ID]=this.selectedValues[o];if(o="PROP_"+this.treeProps[n].ID,!(r=this.GetRowValues(h,o)))return!1;if(!BX.util.in_array(e,r))return!1;for(h[o]=e,i=n+1;i<this.treeProps.length;i++){if(o="PROP_"+this.treeProps[i].ID,!(r=this.GetRowValues(h,o)))return!1;if(this.showAbsent)for(a=[],u=[],u=BX.clone(h,!0),s=0;s<r.length;s++)u[o]=r[s],this.GetCanBuy(u)&&(a[a.length]=r[s]);else a=r;this.selectedValues[o]&&BX.util.in_array(this.selectedValues[o],a)?h[o]=this.selectedValues[o]:h[o]=a[0],this.UpdateRow(i,h[o],r,a)}this.selectedValues=h,this.ChangeInfo()}return!0},h.JCSaleGiftProduct.prototype.RowLeft=function(){var t=0,e="",i=-1,s=BX.proxy_context;if(s&&s.hasAttribute("data-treevalue")){for(e=s.getAttribute("data-treevalue"),t=0;t<this.treeProps.length;t++)if(this.treeProps[t].ID===e){i=t;break}-1<i&&this.treeRowShowSize<this.showCount[i]&&(this.showStart[i]<0&&(this.showStart[i]++,BX.adjust(this.obTreeRows[i].LIST,{style:{marginLeft:20*this.showStart[i]+"%"}}),BX.adjust(this.obTreeRows[i].RIGHT,{style:this.treeEnableArrow})),0<=this.showStart[i]&&BX.adjust(this.obTreeRows[i].LEFT,{style:this.treeDisableArrow}))}},h.JCSaleGiftProduct.prototype.RowRight=function(){var t=0,e="",i=-1,s=BX.proxy_context;if(s&&s.hasAttribute("data-treevalue")){for(e=s.getAttribute("data-treevalue"),t=0;t<this.treeProps.length;t++)if(this.treeProps[t].ID===e){i=t;break}-1<i&&this.treeRowShowSize<this.showCount[i]&&(this.treeRowShowSize-this.showStart[i]<this.showCount[i]&&(this.showStart[i]--,BX.adjust(this.obTreeRows[i].LIST,{style:{marginLeft:20*this.showStart[i]+"%"}}),BX.adjust(this.obTreeRows[i].LEFT,{style:this.treeEnableArrow})),this.treeRowShowSize-this.showStart[i]>=this.showCount[i]&&BX.adjust(this.obTreeRows[i].RIGHT,{style:this.treeDisableArrow}))}},h.JCSaleGiftProduct.prototype.UpdateRow=function(t,e,i,s){var o=0,r=0,a="",n=0,h={},u=!1,c=(this.treeEnableArrow,this.treeEnableArrow,null);if(-1<t&&t<this.obTreeRows.length&&(propMode=this.treeProps[t].DISPLAY_TYPE,(c=BX.findChildren(this.obTreeRows[t].LIST,{tagName:this.skuVisualParams[propMode].TAG},!1))&&0<c.length)){for(selectMode="SELECT"===this.treeProps[t].DISPLAY_TYPE,n=i.length,h={style:{},props:{disabled:"",selected:""}},o=0;o<c.length;o++)u=(a=c[o].getAttribute("data-onevalue"))===e&&0!=a,BX.util.in_array(a,s)?h.props.className=u?this.skuVisualParams[propMode].ACTIVE_CLASS:"":h.props.className=u?this.skuVisualParams[propMode].ACTIVE_CLASS+" "+this.skuVisualParams[propMode].HI
4074DE_CLASS:this.skuVisualParams[propMode].HIDE_CLASS,selectMode?(h.props.disabled="disabled",h.props.selected=u?"selected":""):h.style.display="none",BX.util.in_array(a,i)&&(selectMode?h.props.disabled="":h.style.display="",u&&r,r++),BX.adjust(c[o],h);selectMode&&$(this.obTreeRows[t].LIST).parent().hasClass("ik_select")&&$(this.obTreeRows[t].LIST).ikSelect("reset"),this.showCount[t]=n,this.showStart[t]=0}},h.JCSaleGiftProduct.prototype.GetRowValues=function(t,e){var i,s=0,o=[],r=!1,a=!0;if(0===t.length){for(s=0;s<this.offers.length;s++)BX.util.in_array(this.offers[s].TREE[e],o)||(o[o.length]=this.offers[s].TREE[e]);r=!0}else for(s=0;s<this.offers.length;s++){for(i in a=!0,t)if(t[i]!==this.offers[s].TREE[i]){a=!1;break}a&&(BX.util.in_array(this.offers[s].TREE[e],o)||(o[o.length]=this.offers[s].TREE[e]),r=!0)}return!!r&&o},h.JCSaleGiftProduct.prototype.GetCanBuy=function(t){var e,i=0,s=!1,o=!0;for(i=0;i<this.offers.length;i++){for(e in o=!0,t)if(t[e]!==this.offers[i].TREE[e]){o=!1;break}if(o&&this.offers[i].CAN_BUY){s=!0;break}}return s},h.JCSaleGiftProduct.prototype.SetCurrent=function(){var t=0,e=0,i=[],s="",o=!1,r={},a=[],n=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(s="PROP_"+this.treeProps[t].ID,o=this.GetRowValues(r,s));t++){if(BX.util.in_array(n[s],o)?r[s]=n[s]:(r[s]=o[0],this.offerNum=0),this.showAbsent)for(i=[],a=[],a=BX.clone(r,!0),e=0;e<o.length;e++)a[s]=o[e],this.GetCanBuy(a)&&(i[i.length]=o[e]);else i=o;this.UpdateRow(t,r[s],o,i)}this.selectedValues=r,this.ChangeInfo()},h.JCSaleGiftProduct.prototype.ChangeInfo=function(){var t,e=0,i=-1,s={},o=!0;for(e=0;e<this.offers.length;e++){for(t in o=!0,this.selectedValues)if(this.selectedValues[t]!==this.offers[e].TREE[t]){o=!1;break}if(o){i=e;break}}if(-1<i){if(this.obPict){s={attrs:{}};this.offers[i].PREVIEW_PICTURE?s.attrs.src=this.offers[i].PREVIEW_PICTURE.SRC:s.attrs.src=this.defaultPict.pict.SRC,BX.adjust(BX.findChild(this.obPict,{tag:"img"}),s)}this.showSkuProps&&this.obSkuProps&&(0===this.offers[i].DISPLAY_PROPERTIES.length?BX.adjust(this.obSkuProps,{style:{display:"none"},html:""}):BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[i].DISPLAY_PROPERTIES})),this.setQuantityStore(this.offers[i].MAX_QUANTITY,this.offers[i].AVAILIABLE.TEXT),this.offerNum=i,this.QuantitySet(this.offerNum),$(this.obProduct).find(".quantity_block .values").length&&$(this.obProduct).find(".quantity_block .values .item span").text(this.offers[i].MAX_QUANTITY).css({opacity:"1"});var r=this.offers[i],a=$(this.obProduct),n=this;"undefined"!=typeof arBasketAspro?this.setActualDataBlock(a,r):void 0!==h.frameCacheVars&&BX.addCustomEvent("onFrameDataReceived",function(){n.setActualDataBlock(a,r)})}},h.JCSaleGiftProduct.prototype.setActualDataBlock=function(t,e){this.setLikeBlock(t,".like_icons .wish_item_button",e,"DELAY"),this.setLikeBlock(t,".like_icons .compare_item_button",e,"COMPARE"),this.setBuyBlock(t,e)},h.JCSaleGiftProduct.prototype.setLikeBlock=function(t,e,i,s){var o=t;"DELAY"==s&&(i.CAN_BUY?o.find(e).css("display","block"):o.find(e).hide()),o.find(e).attr("data-item",i.ID),o.find(e).find("span").attr("data-item",i.ID),arBasketAspro[s]&&(o.find(e).find(".to").removeClass("added").css("display","block"),o.find(e).find(".in").hide(),void 0!==arBasketAspro[s][i.ID]&&(o.find(e).find(".to").hide(),o.find(e).find(".in").css("display","block")))},h.JCSaleGiftProduct.prototype.setBuyBlock=function(t,e){var i=t.find(".offer_buy_block"),s=e.CONFIG.MIN_QUANTITY_BUY;if(i.find(".counter_wrapp .counter_block").length&&i.find(".counter_wrapp .counter_block").attr("data-item",e.ID),this.offers[this.offerNum].offer_set_quantity&&(s=this.offers[this.offerNum].offer_set_quantity),e.CONFIG.OPTIONS.USE_PRODUCT_QUANTITY_DETAIL&&"ADD"==e.CONFIG.ACTION&&e.CAN_BUY){var o=0<e.CONFIG.MAX_QUANTITY_BUY?"data-max='"+e.CONFIG.MAX_QUANTITY_BUY+"'":"",r='<span class="minus">-</span><input type="text" class="text" name="'+e.PRODUCT_QUANTITY_VARIABLE+'" value="'+s+'" /><span class="plus" '+o+">+</span>";arBasketAspro.BASKET&&void 0!==arBasketAspro.BASKET[e.ID]?i.find(".counter_wrapp .counter_block").length?i.find(".counter_wrapp .counter_block").hide():(i.find(".counter_wrapp").prepend('<div class="counter_block" data-item="'+e.ID+'"></div>'),i.find(".counter_wrapp .counter_block").html(r).hide()):i.find(".counter_wrapp .counter_block").length?i.find(".counter_wrapp .counter_block").html(r).show():(i.find(".counter_wrapp").prepend('<div class="counter_block" data-item="'+e.ID+'"></div>'),i.find(".counter_wrapp .counter_block").html(r))}else i.find(".counter_wrapp .counter_block").length&&i.find(".counter_wrapp .counter_block").hide();
4074var a="ORDER"==e.CONFIG.ACTION||!e.CAN_BUY||!e.CONFIG.OPTIONS.USE_PRODUCT_QUANTITY_DETAIL||"SUBSCRIBE"==e.CONFIG.ACTION&&"Y"==e.CATALOG_SUBSCRIBE?"wide":"";$('<div class="button_block"></div>');if(i.find(".counter_wrapp").find(".button_block").length?arBasketAspro.BASKET&&void 0!==arBasketAspro.BASKET[e.ID]?(i.find(".counter_wrapp").find(".button_block").addClass("wide").html(e.HTML),markProductAddBasket(e.ID)):a?(i.find(".counter_wrapp").find(".button_block").addClass("wide").html(e.HTML),arBasketAspro.SUBSCRIBE&&void 0!==arBasketAspro.SUBSCRIBE[e.ID]&&markProductSubscribe(e.ID)):i.find(".counter_wrapp").find(".button_block").removeClass("wide").html(e.HTML):(i.find(".counter_wrapp").append('<div class="button_block '+a+'">'+e.HTML+"</div>"),arBasketAspro.BASKET&&void 0!==arBasketAspro.BASKET[e.ID]&&markProductAddBasket(e.ID),arBasketAspro.SUBSCRIBE&&void 0!==arBasketAspro.SUBSCRIBE[e.ID]&&markProductSubscribe(e.ID)),"NOTHING"!==e.CONFIG.ACTION)if("ADD"==e.CONFIG.ACTION&&e.CAN_BUY&&"N"!=e.SHOW_ONE_CLICK_BUY){var n='<span class="transparent big_btn type_block button one_click" data-offers="Y" data-item="'+e.ID+'" data-iblockID="'+e.IBLOCK_ID+'" data-quantity="'+e.CONFIG.MIN_QUANTITY_BUY+'" data-props="'+e.OFFER_PROPS+'" onclick="oneClickBuy('+e.ID+", "+e.IBLOCK_ID+', this)"><span>'+e.ONE_CLICK_BUY+"</span></span>";i.find(".wrapp_one_click").length?i.find(".wrapp_one_click").html(n):i.append('<div class="wrapp_one_click">'+n+"</div>")}else i.find(".wrapp_one_click").length&&i.find(".wrapp_one_click").remove();else i.find(".wrapp_one_click").length&&i.find(".wrapp_one_click").remove();i.fadeIn(),i.find(".counter_wrapp .counter_block input").data("product","ob"+this.obProduct.id),this.setPriceAction("","Y"),"Y"==arNextOptions.THEME.CHANGE_TITLE_ITEM&&$(this.obProduct).find(".item-title a").text(e.NAME)},h.JCSaleGiftProduct.prototype.setPriceAction=function(t,e){$(this.obProduct);(this.setPrice(),"Y"==arNextOptions.THEME.SHOW_TOTAL_SUMM)&&(this.offers[this.offerNum].check_quantity||(void 0!==t&&"Y"==t?t:"")&&(this.offers[this.offerNum].check_quantity=!0))},h.JCSaleGiftProduct.prototype.setPrice=function(t,e){var i;if(this.obPrice){e=this.offers[this.offerNum].MEASURE&&"Y"==this.offers[this.offerNum].SHOW_MEASURE?this.offers[this.offerNum].MEASURE:"";var s=$(this.obProduct),o=this.offers[this.offerNum].PRICE;this.offers[this.offerNum].offer_set_quantity=this.offers[this.offerNum].CONFIG.MIN_QUANTITY_BUY,$(s).find("input[name=quantity]").length&&(this.offers[this.offerNum].offer_set_quantity=$(s).find("input[name=quantity]").val()),i='<span class="values_wrapper">'+getCurrentPrice(o.VALUE,o.CURRENCY,o.PRINT_VALUE)+"</span>",BX.adjust($(this.obPrice).closest(".cost").find(".price.discount")[0],{html:i}),newPrice='<span class="values_wrapper">'+getCurrentPrice(o.DISCOUNT_VALUE,o.CURRENCY,o.PRINT_DISCOUNT_VALUE)+"</span>",e&&(newPrice+="/"+e),BX.adjust(this.obPrice,{html:newPrice}),o.DISCOUNT_VALUE!==o.VALUE&&this.showOldPrice&&0<o.DISCOUNT_VALUE?(price_value=BX.Currency.currencyFormat(o.VALUE*this.offers[this.offerNum].offer_set_quantity,o.CURRENCY),price_value_old=BX.Currency.currencyFormat(o.VALUE,o.CURRENCY),$(this.obPriceOld).find("strike").show().html('<span class="values_wrapper">'+o.PRINT_VALUE.replace(price_value_old,price_value)+"</span>"),this.showPercent&&o.DISCOUNT_VALUE&&($(this.obPriceOld).closest(".cost").find(".sale_block").show(),$(this.obPriceOld).closest(".cost").find(".value").html(o.DISCOUNT_DIFF_PERCENT_RAW),$(this.obPriceOld).closest(".cost").find(".text span").html(BX.Currency.currencyFormat(o.DISCOUNT_DIFF,o.CURRENCY,!0)))):($(this.obPriceOld).find("strike").hide().html(""),this.showPercent&&$(this.obPrice).closest(".cost").find(".sale_block").hide());var r={product:s,measure:e,config:this.config,offer:this.offers[this.offerNum],obPrice:o};BX.onCustomEvent("onAsproSkuSetPrice",[r])}},h.JCSaleGiftProduct.prototype.setQuantityStore=function(t,e){0<parseFloat(t)?$(this.storeQuanity).find(".icon").removeClass("order").addClass("stock"):$(this.storeQuanity).find(".icon").removeClass("stock").addClass("order"),$(this.storeQuanity).find(".icon + span").html(e)},h.JCSaleGiftProduct.prototype.InitBasketUrl=function(){switch(this.productType){case 1:case 2:this.basketUrl=this.product.addUrl;break;case 3:this.basketUrl=this.offers[this.offerNum].ADD_URL}this.basketParams={ajax_basket:"Y"},this.showQuantity&&(this.basketParams[this.basketData.quantity]=this.obQuantity.value)},h.JCSaleGiftProduct.prototype.FillBasketProps=function(){if(this.visual.BASKET_PROP_DIV){var t=0,e=null,i=!1,s=null;if(this.basketData.useProps&&!this.basketData.emptyProps?this.obPopupWin&&this.obPopupWin.contentContainer&&(s=this.obPopupWin.contentContainer):s=BX(this.visual.BASKET_PROP_DIV),s){if((e
4074=s.getElementsByTagName("select"))&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled)switch(e[t].type.toLowerCase()){case"select-one":this.basketParams[e[t].name]=e[t].value,i=!0}if((e=s.getElementsByTagName("input"))&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled)switch(e[t].type.toLowerCase()){case"hidden":this.basketParams[e[t].name]=e[t].value,i=!0;break;case"radio":e[t].checked&&(this.basketParams[e[t].name]=e[t].value,i=!0)}i||(this.basketParams[this.basketData.props]=[],this.basketParams[this.basketData.props][0]=0)}}},h.JCSaleGiftProduct.prototype.SendToBasket=function(){this.canBuy&&(this.InitBasketUrl(),this.FillBasketProps(),BX.ajax.loadJSON(this.basketUrl,this.basketParams,BX.delegate(this.BasketResult,this)))},h.JCSaleGiftProduct.prototype.Basket=function(){var t="";if(this.canBuy)switch(this.productType){case 1:case 2:this.basketData.useProps&&!this.basketData.emptyProps?(this.InitPopupWindow(),this.obPopupWin.setTitleBar({content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:BX.message("CVP_TITLE_BASKET_PROPS")})}),BX(this.visual.BASKET_PROP_DIV)&&(t=BX(this.visual.BASKET_PROP_DIV).innerHTML),this.obPopupWin.setContent(t),this.obPopupWin.setButtons([new a({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CVP_BTN_MESSAGE_SEND_PROPS"),events:{click:BX.delegate(this.SendToBasket,this)}})]),this.obPopupWin.show()):this.SendToBasket();break;case 3:this.SendToBasket()}},h.JCSaleGiftProduct.prototype.BasketResult=function(t){var e,i="",s="",o="",r=[];if(this.obPopupWin&&this.obPopupWin.close(),"object"!=typeof t)return!1;if(e="OK"===t.STATUS){switch(BX.onCustomEvent("OnBasketChange"),s=this.product.name,this.productType){case 1:case 2:o=this.product.pict.SRC;break;case 3:o=this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC}i='<div style="width: 96%; margin: 10px 2%; text-align: center;"><img src="'+o+'" height="130" style="max-height:130px"><p>'+s+"</p></div>",r=[new a({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CVP_BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("CVP_BASKET_URL")},this)}})]}else i=t.MESSAGE?t.MESSAGE:BX.message("CVP_BASKET_UNKNOWN_ERROR"),r=[new a({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CVP_BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})];this.InitPopupWindow(),this.obPopupWin.setTitleBar({content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:e?BX.message("CVP_TITLE_SUCCESSFUL"):BX.message("CVP_TITLE_ERROR")})}),this.obPopupWin.setContent(i),this.obPopupWin.setButtons(r),this.obPopupWin.show()},h.JCSaleGiftProduct.prototype.InitPopupWindow=function(){this.obPopupWin||(this.obPopupWin=BX.PopupWindowManager.create("CatalogSectionBasket_"+this.visual.ID,null,{autoHide:!1,offsetLeft:0,offsetTop:0,overlay:!0,closeByEsc:!0,titleBar:!0,closeIcon:{top:"10px",right:"10px"}}))}}}(window),BX.addCustomEvent("onSlideInit",function(t){try{if(ignoreResize.push(!0),t)if(t.slider.hasClass("tab")){var e=1*$(".bx_item_list_you_looked_horizontal.detail .all_wrapp .flex-viewport").height()+20,i=0;$(document).find(".bx_item_list_you_looked_horizontal.detail .footer_button").length&&($(document).find(".bx_item_list_you_looked_horizontal.detail .footer_button").css("height","auto"),i=$(document).find(".bx_item_list_you_looked_horizontal.detail .footer_button").height(),$(document).find(".bx_item_list_you_looked_horizontal.detail .footer_button").css("height",""));var s=e+i+50;$(".bx_item_list_you_looked_horizontal.detail .slides").equalize({children:".item-title"}),$(".bx_item_list_you_looked_horizontal.detail .slides").equalize({children:".item_info"}),$(".bx_item_list_you_looked_horizontal.detail .slides").equalize({children:".catalog_item"}),$(".bx_item_list_you_looked_horizontal.detail .all_wrapp .content_inner").attr("data-unhover",e),$(".bx_item_list_you_looked_horizontal.detail .all_wrapp .content_inner").attr("data-hover",s),$(".bx_item_list_you_looked_horizontal.detail .all_wrapp").height(e),$(".bx_item_list_you_looked_horizontal.detail .all_wrapp .content_inner").addClass("absolute")}}catch(t){}finally{ignoreResize.pop()}}); 4075/* End */ 4076; 4077; /* Start:"a:4:{s:4:"full";s:104:"/bitrix/templates/aspro_next/components/bitrix/sale.gift.main.products/main/script.min.js?17295940002564";s:6:"source";
4077s:85:"/bitrix/templates/aspro_next/components/bitrix/sale.gift.main.products/main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 4078BX.namespace("BX.Sale"),BX.Sale.GiftMainProductsClass=function(){var t=function(t){this.ajaxUrl="/bitrix/components/bitrix/sale.gift.main.products/ajax.php",this.contextAjaxData=t.contextAjaxData||{},this.mainProductState=t.mainProductState||null,this.injectId=t.injectId||null,this.isGift=!!t.isGift,this.productId=t.productId,this.offerId=t.offerId,this.offers=t.offers||[],this.setEvents(),document.location.hash.match(/as_gift/g)&&(this.isGift?this.enableGift():this.raiseNonGiftEvent()),BX.bindDelegate(BX(this.injectId),"click",{tagName:"a"},BX.proxy(this.clickNavLink,this))};return t.prototype.clickNavLink=function(t){return this.onPageNavigationByLink(BX.proxy_context)?BX.PreventDefault(t):void 0},t.prototype.setEvents=function(){BX.addCustomEvent("onCatalogStoreProductChange",BX.proxy(this.onCatalogStoreProductChange,this)),BX.addCustomEvent("onAddToBasketMainProduct",BX.proxy(this.onAddToBasketMainProduct,this))},t.prototype.unsubscribeEvents=function(){BX.removeCustomEvent("onCatalogStoreProductChange",BX.proxy(this.onCatalogStoreProductChange,this))},t.prototype.onAddToBasketMainProduct=function(t){this.enableGift()},t.prototype.onCatalogStoreProductChange=function(t){t!=this.offerId&&$(this.injectId).length&&BX.ajax({url:this.ajaxUrl,method:"POST",data:BX.merge(this.contextAjaxData,{offerId:t,mainProductState:this.mainProductState,SITE_ID:BX.message("SITE_ID")}),dataType:"html",processData:!1,start:!0,onsuccess:BX.delegate(function(e){this.offerId=t;var i=BX.processHTML(e);return i.HTML?(this.unsubscribeEvents(),BX(this.injectId).innerHTML=i.HTML,void BX.ajax.processScripts(i.SCRIPT)):void(document.location.hash.match(/as_gift/g)&&(this.isGift?this.raiseGiftEvent():this.raiseNonGiftEvent()))},this)})},t.prototype.onPageNavigationByLink=function(t){var e=BX.delegate(function(t){return BX.type.isElementNode(t)&&t.href?t.href.indexOf(this.ajaxUrl)>=0?!0:-1!==t.href.indexOf("PAGEN_"):!1},this);return e(t)?(BX.ajax({url:t.href,method:"POST",data:BX.merge(this.contextAjaxData,{SITE_ID:BX.message("SITE_ID")}),dataType:"html",processData:!1,start:!0,onsuccess:BX.delegate(function(t){var e=BX.processHTML(t);e.HTML&&(this.unsubscribeEvents(),BX(this.injectId).innerHTML=e.HTML,BX.ajax.processScripts(e.SCRIPT))},this)}),!0):!1},t.prototype.enableGift=function(){this.isGift=!0,this.raiseGiftEvent()},t.prototype.raiseGiftEvent=function(){BX.onCustomEvent("onSaleProductIsGift",[this.productId,this.offerId])},t.prototype.raiseNonGiftEvent=function(){BX.onCustomEvent("onSaleProductIsNotGift",[this.productId,this.offerId])},t}(); 4079/* End */ 4080; 4081; /* Start:"a:4:{s:4:"full";s:69:"/bitrix/templates/aspro_next/js/jquery.history.min.js?172959399121571";s:6:"source";s:49:"/bitrix/templates/aspro_next/js/jquery.history.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 4082window.JSON||(window.JSON={}),function(){function f(a){return a<10?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];
4082return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";return e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g,e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));return e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g,e}}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var JSON=window.JSON,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(!b||typeof b=="function"||typeof b=="object"&&typeof b.length=="number")return str("",{"":a});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCo
4082deAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(a,b){"use strict";var c=a.History=a.History||{},d=a.jQuery;if(typeof c.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");c.Adapter={bind:function(a,b,c){d(a).bind(b,c)},trigger:function(a,b,c){d(a).trigger(b,c)},extractEventData:function(a,c,d){var e=c&&c.originalEvent&&c.originalEvent[a]||d&&d[a]||b;return e},onDomLoad:function(a){d(a)}},typeof c.init!="undefined"&&c.init()}(window),function(a,b){"use strict";var c=a.document,d=a.setTimeout||d,e=a.clearTimeout||e,f=a.setInterval||f,g=a.History=a.History||{};if(typeof g.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");g.initHtml4=function(){if(typeof g.initHtml4.initialized!="undefined")return!1;g.initHtml4.initialized=!0,g.enabled=!0,g.savedHashes=[],g.isLastHash=function(a){var b=g.getHashByIndex(),c;return c=a===b,c},g.saveHash=function(a){return g.isLastHash(a)?!1:(g.savedHashes.push(a),!0)},g.getHashByIndex=function(a){var b=null;return typeof a=="undefined"?b=g.savedHashes[g.savedHashes.length-1]:a<0?b=g.savedHashes[g.savedHashes.length+a]:b=g.savedHashes[a],b},g.discardedHashes={},g.discardedStates={},g.discardState=function(a,b,c){var d=g.getHashByState(a),e;return e={discardedState:a,backState:c,forwardState:b},g.discardedStates[d]=e,!0},g.discardHash=function(a,b,c){var d={discardedHash:a,backState:c,forwardState:b};return g.discardedHashes[a]=d,!0},g.discardedState=function(a){var b=g.getHashByState(a),c;return c=g.discardedStates[b]||!1,c},g.discardedHash=function(a){var b=g.discardedHashes[a]||!1;return b},g.recycleState=function(a){var b=g.getHashByState(a);return g.discardedState(a)&&delete g.discardedStates[b],!0},g.emulated.hashChange&&(g.hashChangeInit=function(){g.checkerFunction=null;var b="",d,e,h,i;return g.isInternetExplorer()?(d="historyjs-iframe",e=c.createElement("iframe"),e.setAttribute("id",d),e.style.display="none",c.body.appendChild(e),e.contentWindow.document.open(),e.contentWindow.document.close(),h="",i=!1,g.checkerFunction=function(){if(i)return!1;i=!0;var c=g.getHash()||"",d=g.unescapeHash(e.contentWindow.document.location.hash)||"";return c!==b?(b=c,d!==c&&(h=d=c,e.contentWindow.document.open(),e.contentWindow.document.close(),e.contentWindow.document.location.hash=g.escapeHash(c)),g.Adapter.trigger(a,"hashchange")):d!==h&&(h=d,g.setHash(d,!1)),i=!1,!0}):g.checkerFunction=function(){var c=g.getHash();return c!==b&&(b=c,g.Adapter.trigger(a,"hashchange")),!0},g.intervalList.push(f(g.checkerFunction,g.options.hashChangeInterval)),!0},g.Adapter.onDomLoad(g.hashChangeInit)),g.emulated.pushState&&(g.onHashChange=function(b){var d=b&&b.newURL||c.location.href,e=g.getHashByUrl(d),f=null,h=null,i=null,j;return g.isLastHash(e)?(g.busy(!1),!1):(g.doubleCheckComplete(),g.saveHash(e),e&&g.isTraditionalAnchor(e)?(g.Adapter.trigger(a,"anchorchange"),g.busy(!1),!1):(f=g.extractState(g.getFullUrl(e||c.location.href,!1),!0),g.isLastSavedState(f)?(g.busy(!1),!1):(h=g.getHashByState(f),j=g.discardedState(f),j?(g.getHashByIndex(-2)===g.getHashByState(j.forwardState)?g.back(!1):g.forward(!1),!1):(g.pushState(f.data,f.title,f.url,!1),!0))))},g.Adapter.bind(a,"hashchange",g.onHashChange),g.pushState=function(b,d,e,f){if(g.getHashByUrl(e))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&g.busy())return g.pushQueue({scope:g,callback:g.pushState,args:arguments,queue:f}),!1;g.busy(!0);var h=g.createStateObject(b,d,e),i=g.getHashByState(h),j=g.getState(!1),k=g.getHashByState(j),l=g.getHash();return g.storeState(h),g.expectedStateId=h.id,g.recycleState(h),g.setTitle(h),i===k?(g.busy(!1),!1):i!==l&&i!==g.getShortUrl(c.location.href)?(g.setHash(i,!1),!1):(g.saveState(h),g.Adapter.trigger(a,"statechange"),g.busy(!1),!0)},g.replaceState=function(a,b,c,d){if(g.getHashByUrl(c))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(d!==!1&&g.busy())return g.pushQueue({scope:g,callback:g.replaceState,args:arguments,queue:d}),!1;g.busy(!0);var e=g.createStateObject(a,b,c),f=g.getState(!1),h=g.getStateByIndex(-2);return g.discardState(f,e,h),g.pushState(e.data,e.title,e.url,!1),!0}),g.emulated.pushState&&g.getHash()&&!g.emulated.hashChange&&g.Adapter.onDomLoad(function(){g.Adapter.trigger(a,"hashchange")})},typeof g.init!="undefined"&&g.init()}(window),function(a,b){"use strict";var c=a.console||b,d=a.document,e=a.navigator,f=a.sessionStorage||!1,g=a.setTimeout,h=a.clearTimeout,i=a.setInterval,j=a.clearInterval,k=a.JSON,l=a.alert,m=a.History=a.History||{},n=a.history;k.stringify=k.stringify||k.encode,k.parse=k.parse||k.decode;if(typeof m.init!="undefined")throw new Error("History.js Core has already been loaded...");m.init=function(){return typeof m.Adapter=="undefined"?!1:(typeof m.initCore!="undefined"&&m.initCore(),typeof m.initHtml4!="undefined"&&m.initHtml4(),!0)},m.initCore=function(){if(typeof m.initCore.initialized!="undefined")return!1;m.initCore.initialized=!0,m.options=m.options||{}
4082,m.options.hashChangeInterval=m.options.hashChangeInterval||100,m.options.safariPollInterval=m.options.safariPollInterval||500,m.options.doubleCheckInterval=m.options.doubleCheckInterval||500,m.options.storeInterval=m.options.storeInterval||1e3,m.options.busyDelay=m.options.busyDelay||250,m.options.debug=m.options.debug||!1,m.options.initialTitle=m.options.initialTitle||d.title,m.intervalList=[],m.clearAllIntervals=function(){var a,b=m.intervalList;if(typeof b!="undefined"&&b!==null){for(a=0;a<b.length;a++)j(b[a]);m.intervalList=null}},m.debug=function(){(m.options.debug||!1)&&m.log.apply(m,arguments)},m.log=function(){var a=typeof c!="undefined"&&typeof c.log!="undefined"&&typeof c.log.apply!="undefined",b=d.getElementById("log"),e,f,g,h,i;a?(h=Array.prototype.slice.call(arguments),e=h.shift(),typeof c.debug!="undefined"?c.debug.apply(c,[e,h]):c.log.apply(c,[e,h])):e="\n"+arguments[0]+"\n";for(f=1,g=arguments.length;f<g;++f){i=arguments[f];if(typeof i=="object"&&typeof k!="undefined")try{i=k.stringify(i)}catch(j){}e+="\n"+i+"\n"}return b?(b.value+=e+"\n-----\n",b.scrollTop=b.scrollHeight-b.clientHeight):a||l(e),!0},m.getInternetExplorerMajorVersion=function(){var a=m.getInternetExplorerMajorVersion.cached=typeof m.getInternetExplorerMajorVersion.cached!="undefined"?m.getInternetExplorerMajorVersion.cached:function(){var a=3,b=d.createElement("div"),c=b.getElementsByTagName("i");while((b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a}
4082,m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;
4082if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}
4082m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()}(window) 4083/* End */ 4084;; /* /bitrix/templates/aspro_next/components/bitrix/catalog/main/script.
4084js?17298632751357*/ 4085; /* /bitrix/templates/aspro_next/js/slick/slick.min.js?172959399141953*/ 4086; /* /bitrix/templates/aspro_next/components/bitrix/catalog.element/main/script.js?1775643055112634*/ 4087; /* /bitrix/templates/aspro_next/components/bitrix/sale.gift.product/main/script.min.js?172959400131307*/ 4088; /* /bitrix/templates/aspro_next/components/bitrix/sale.gift.main.products/main/script.min.js?17295940002564*/ 4089; /* /bitrix/templates/aspro_next/js/jquery.history.min.js?172959399121571*/
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.