
; /* Start:"a:4:{s:4:"full";s:105:"/bitrix/templates/aspro_next/components/bitrix/catalog.section/catalog_list/script.min.js?160724408642533";s:6:"source";s:85:"/bitrix/templates/aspro_next/components/bitrix/catalog.section/catalog_list/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
$(document).ready(function(){SelectOfferProp=function(){var t=$(this),e={},s={},r=parseUrlQuery(),o="",a=!!t.hasClass("list_values_wrapper"),n=t.closest(".bx_catalog_item_scu");e={PARAMS:t.closest(".js_wrapper_items").data("params"),ID:n.data("offer_id"),SITE_ID:n.data("site_id"),LINK_ID:n.data("id"),IBLOCK_ID:n.data("offer_iblockid"),PROPERTY_ID:n.data("propertyid"),DEPTH:t.closest(".item_wrapper").index(),VALUE:a?t.find("option:selected").data("onevalue"):t.data("onevalue"),PICTURE:t.closest(".list_item_wrapp").find(".thumb img").attr("src"),ARTICLE_NAME:t.closest(".list_item_wrapp").find(".article_block").data("name"),ARTICLE_VALUE:t.closest(".list_item_wrapp").find(".article_block").data("value")},"clear_cache"in r&&"Y"==r.clear_cache&&(o+="?clear_cache=Y");for(i=0;i<e.DEPTH+1;i++)strName="PROP_"+n.find(".item_wrapper:eq("+i+") > div").data("id"),n.find(".item_wrapper:eq("+i+") select").length?(s[strName]=n.find(".item_wrapper:eq("+i+") select option:selected").data("onevalue"),e[strName]=n.find(".item_wrapper:eq("+i+") select option:selected").data("onevalue")):(s[strName]=n.find(".item_wrapper:eq("+i+") li.item.active").data("onevalue"),e[strName]=n.find(".item_wrapper:eq("+i+") li.item.active").data("onevalue"));a||(t.siblings().removeClass("active"),t.addClass("active")),$.ajax({url:arNextOptions.SITE_DIR+"ajax/js_item_detail.php"+o,type:"POST",data:e}).success(function(t){var e=BX.processHTML(t);BX.ajax.processScripts(e.SCRIPT)})},$(document).on("click",".bx_catalog_item_scu li.item",SelectOfferProp),$(document).on("change",".bx_catalog_item_scu select.list_values_wrapper",SelectOfferProp)}),function(h){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)),"NOT_SHOW"in this.params&&"Y"!=this.params.NOT_SHOW&&$(this.obProduct).find(".with_matrix").show(),"Y"==arNextOptions.THEME.SHOW_TOTAL_SUMM&&void 0!==this.currentPrices[this.currentPriceSelected]&&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 r in!i&&(e=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=e.HASH),this.currentPrices)if(this.currentPrices.hasOwnProperty(r)&&this.currentPrices[r].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=r;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.JCCatalogSection||(h.JCCatalogSection=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"}},this.productType=0,this.showQuantity=!0,this.showAbsent=!0,this.secondPict=!1,this.showOldPrice=!1,this.showPercent=!1,this.showSkuProps=!1,this.basketAction="ADD",this.basketLinkURL="",this.showClosePopup=!1,this.useCompare=!1,this.showPercentNumber=!1,this.visual={ID:"",PICT_ID:"",SECOND_PICT_ID:"",QUANTITY_ID:"",QUANTITY_UP_ID:"",QUANTITY_DOWN_ID:"",STORE_QUANTITY:"",PRICE_ID:"",PRICE_OLD_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.basketMode="",this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:"",sku_props:"",sku_props_var:"basket_props",add_url:"",buy_url:""},this.compareData={compareUrl:"",comparePath:""},this.defaultPict={pict:null,secondPict:null},this.checkQuantity=!1,this.maxQuantity=0,this.stepQuantity=1,this.defaultCount=1,this.isDblQuantity=!1,this.canBuy=!0,this.currentBasisPrice={},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.obBasketBtn=null,this.obBasketActions=null,this.obNotAvail=null,this.obDscPerc=null,this.obSecondDscPerc=null,this.obSkuProps=null,this.obMeasure=null,this.obCompare=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,t.ADD_TO_BASKET_ACTION&&(this.basketAction=t.ADD_TO_BASKET_ACTION),this.showClosePopup=!!t.SHOW_CLOSE_POPUP,this.useCompare=!!t.DISPLAY_COMPARE,this.showPercentNumber="Y"==t.SHOW_DISCOUNT_PERCENT_NUMBER,this.visual=t.VISUAL,this.defaultCount=t.DEFAULT_COUNT,this.basketLinkURL=t.BASKET_URL,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,t.PRODUCT.BASIS_PRICE&&(this.currentBasisPrice=t.PRODUCT.BASIS_PRICE),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),3===this.productType&&t.BASKET.SKU_PROPS&&(this.basketData.sku_props=t.BASKET.SKU_PROPS),t.BASKET.ADD_URL_TEMPLATE&&(this.basketData.add_url=t.BASKET.ADD_URL_TEMPLATE),t.BASKET.BUY_URL_TEMPLATE&&(this.basketData.buy_url=t.BASKET.BUY_URL_TEMPLATE),""===this.basketData.add_url&&""===this.basketData.buy_url&&(this.errorCode=-1024)),this.useCompare&&(t.COMPARE&&"object"==typeof t.COMPARE?(t.COMPARE.COMPARE_PATH&&(this.compareData.comparePath=t.COMPARE.COMPARE_PATH),t.COMPARE.COMPARE_URL_TEMPLATE_DEL&&(this.compareData.compareUrlDel=t.COMPARE.COMPARE_URL_TEMPLATE_DEL),t.COMPARE.COMPARE_URL_TEMPLATE?this.compareData.compareUrl=t.COMPARE.COMPARE_URL_TEMPLATE:this.useCompare=!1):this.useCompare=!1),this.lastElement=!!t.LAST_ELEMENT&&"Y"===t.LAST_ELEMENT}0===this.errorCode&&BX.ready(BX.delegate(this.Init,this))},h.JCCatalogSection.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.obBasketActions=BX(this.visual.BASKET_ACTIONS_ID),this.obBasketActions&&(this.visual.BUY_ID&&(this.obBuyBtn=BX(this.visual.BUY_ID)),this.visual.BASKET_LINK&&(this.obBasketBtn=BX(this.visual.BASKET_LINK))),this.obNotAvail=BX(this.visual.NOT_AVAILABLE_MESS),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.obProduct).find(".read_more.to-cart").on("click",BX.delegate(this.Add2Basket,this)),this.obBuyBtn&&("ADD"===this.basketAction||BX.bind(this.obBuyBtn,"click",BX.delegate(this.BuyBasket,this))),this.useCompare&&(this.obCompare=BX(this.visual.COMPARE_LINK_ID))}},h.JCCatalogSection.prototype.checkHeight=function(){this.containerHeight=parseInt(this.obProduct.parentNode.offsetHeight,10),isNaN(this.containerHeight)&&(this.containerHeight=0)},h.JCCatalogSection.prototype.setHeight=function(){0<this.containerHeight&&BX.adjust(this.obProduct.parentNode,{style:{height:this.containerHeight+"px"}})},h.JCCatalogSection.prototype.clearHeight=function(){BX.adjust(this.obProduct.parentNode,{style:{height:"auto"}})},h.JCCatalogSection.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.JCCatalogSection.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.JCCatalogSection.prototype.QuantityChange=function(){var t,e,i=0;0===this.errorCode&&this.showQuantity&&(this.canBuy?(i=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(i)?this.obQuantity.value=this.stepQuantity:(this.checkQuantity&&i>this.maxQuantity&&(i=this.maxQuantity),i<this.stepQuantity?i=this.stepQuantity:(e=i/this.stepQuantity,t=parseInt(e,10),isNaN(t)&&(t=1,e=1.1),t<e&&(i=t<=1?this.stepQuantity:t*this.stepQuantity,i=Math.round(i*this.precisionFactor)/this.precisionFactor)),this.obQuantity.value=i)):this.obQuantity.value=this.stepQuantity)},h.JCCatalogSection.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,"display",""),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.JCCatalogSection.prototype.SelectOfferProp=function(){var t=0,e="",i="",s=[],r=null,o=BX.proxy_context;if(void 0!==o.options&&void 0!==o.options[o.selectedIndex]&&(o=o.options[o.selectedIndex]),o&&o.hasAttribute("data-treevalue")&&(i=o.getAttribute("data-treevalue"),propModes=o.getAttribute("data-showtype"),s=i.split("_"),this.SearchOfferPropIndex(s[0],s[1])&&(r=BX.findChildren(o.parentNode,{tagName:this.skuVisualParams[propModes.toUpperCase()].TAG},!1))&&0<r.length))for(t=0;t<r.length;t++)e=r[t].getAttribute("data-onevalue"),"TEXT"==propModes?e===s[1]?r[t].setAttribute("selected","selected"):r[t].removeAttribute("selected"):e===s[1]?$(r[t]).addClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS):$(r[t]).removeClass(this.skuVisualParams[propModes.toUpperCase()].ACTIVE_CLASS)},h.JCCatalogSection.prototype.SearchOfferPropIndex=function(t,e){var i,s,r="",o=!1,a=[],n=[],h=-1,c={},u=[];for(i=0;i<this.treeProps.length;i++)if(this.treeProps[i].ID===t){h=i;break}if(-1<h){for(i=0;i<h;i++)c[r="PROP_"+this.treeProps[i].ID]=this.selectedValues[r];if(r="PROP_"+this.treeProps[h].ID,!(o=this.GetRowValues(c,r)))return!1;if(!BX.util.in_array(e,o))return!1;for(c[r]=e,i=h+1;i<this.treeProps.length&&(r="PROP_"+this.treeProps[i].ID,o=this.GetRowValues(c,r));i++){if(n=[],this.showAbsent)for(a=[],u=[],u=BX.clone(c,!0),s=0;s<o.length;s++)u[r]=o[s],n[n.length]=o[s],this.GetCanBuy(u)&&(a[a.length]=o[s]);else a=o;this.selectedValues[r]&&BX.util.in_array(this.selectedValues[r],a)?c[r]=this.selectedValues[r]:this.showAbsent?c[r]=a.length?a[0]:n[0]:c[r]=a[0],this.UpdateRow(i,c[r],o,a)}this.selectedValues=c,this.ChangeInfo()}return!0},h.JCCatalogSection.prototype.UpdateRow=function(t,e,i,s){var r=0,o=0,a="",n=0,h={},c={},u=!1,l=(this.treeEnableArrow,this.treeEnableArrow,null);if(-1<t&&t<this.obTreeRows.length&&(propMode=this.treeProps[t].DISPLAY_TYPE,(l=BX.findChildren(this.obTreeRows[t].LIST,{tagName:this.skuVisualParams[propMode].TAG},!1))&&0<l.length)){for(selectMode="SELECT"===this.treeProps[t].DISPLAY_TYPE,n=i.length,h={style:{},props:{disabled:"",selected:""}},c={style:{}},r=0;r<l.length;r++)u=(a=l[r].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].HIDE_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&&o,o++),BX.adjust(l[r],h);c.style.display=o?"":"none",BX.adjust(this.obTreeRows[t].CONT,c),selectMode&&$(this.obTreeRows[t].LIST).parent().hasClass("ik_select")&&$(this.obTreeRows[t].LIST).ikSelect("reset"),this.showCount[t]=n,this.showStart[t]=0}},h.JCCatalogSection.prototype.GetRowValues=function(t,e){var i,s=0,r=[],o=!1,a=!0;if(0===t.length){for(s=0;s<this.offers.length;s++)BX.util.in_array(this.offers[s].TREE[e],r)||(r[r.length]=this.offers[s].TREE[e]);o=!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],r)||(r[r.length]=this.offers[s].TREE[e]),o=!0)}return!!o&&r},h.JCCatalogSection.prototype.GetCanBuy=function(t){var e,i=0,s=!1,r=!0;for(i=0;i<this.offers.length;i++){for(e in r=!0,t)if(t[e]!==this.offers[i].TREE[e]){r=!1;break}if(r&&this.offers[i].CAN_BUY){s=!0;break}}return s},h.JCCatalogSection.prototype.SetCurrent=function(){var t=0,e=0,i=[],s="",r=!1,o={},a=[],n=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(s="PROP_"+this.treeProps[t].ID,r=this.GetRowValues(o,s));t++){if(BX.util.in_array(n[s],r)?o[s]=n[s]:(o[s]=r[0],this.offerNum=0),this.showAbsent)for(i=[],a=[],a=BX.clone(o,!0),e=0;e<r.length;e++)a[s]=r[e],this.GetCanBuy(a)&&(i[i.length]=r[e]);else i=r;this.UpdateRow(t,o[s],r,i)}this.selectedValues=o,this.ChangeInfo()},h.JCCatalogSection.prototype.ChangeInfo=function(){var t,e=0,i=-1,s=!0;for(e=0;e<this.offers.length;e++){for(t in s=!0,this.selectedValues)if(this.selectedValues[t]!==this.offers[e].TREE[t]){s=!1;break}if(s){i=e;break}}if(-1<i){if(this.obPict){var r={attrs:{}};this.offers[i].PREVIEW_PICTURE?r.attrs.src=this.offers[i].PREVIEW_PICTURE.SRC:r.attrs.src=this.defaultPict.pict.SRC,BX.adjust(BX.findChild(this.obPict,{tag:"img"}),r)}this.secondPict&&this.obSecondPict&&(this.offers[i].PREVIEW_PICTURE_SECOND?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.offers[i].PREVIEW_PICTURE_SECOND.SRC+")"}}):this.offers[i].PREVIEW_PICTURE.SRC?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.offers[i].PREVIEW_PICTURE.SRC+")"}}):this.defaultPict.secondPict?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.defaultPict.secondPict.SRC+")"}}):BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.defaultPict.pict.SRC+")"}})),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.obBuyBtn).data("item",this.offers[i].ID),$(this.obBasketBtn).data("item",this.offers[i].ID),$(this.obBasketActions).closest(".counter_wrapp").css("opacity",0),this.setQuantityStore(this.offers[i].MAX_QUANTITY,this.offers[i].AVAILIABLE.TEXT),this.offerNum=i,this.QuantitySet(this.offerNum),$(this.obProduct).find(".item-title a").attr("href",this.offers[this.offerNum].URL),$(this.obProduct).find(".image_wrapper_block > a").attr("href",this.offers[this.offerNum].URL),$(this.obProduct).find(".quantity_block .values").length&&$(this.obProduct).find(".quantity_block .values .item span.value").text(this.offers[i].MAX_QUANTITY).css({opacity:"1"}),"Y"==this.offers[i].SHOW_DISCOUNT_TIME_EACH_SKU&&initCountdownTime($(this.obProduct),this.offers[i].DISCOUNT_ACTIVE);var o=this.offers[i],a=$(this.obProduct),n=this;this.setArticle(a.find(".article_block"),o),"undefined"!=typeof arBasketAspro?this.setActualDataBlock(a,o):void 0!==h.frameCacheVars&&BX.addCustomEvent("onFrameDataReceived",function(){n.setActualDataBlock(a,o)})}},h.JCCatalogSection.prototype.setArticle=function(t,e){e.ARTICLE?t.html(e.ARTICLE):"Y"==e.SHOW_ARTICLE_SKU&&e.ARTICLE_SKU?t.html(e.ARTICLE_SKU):t.html("")},h.JCCatalogSection.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.JCCatalogSection.prototype.setLikeBlock=function(t,e,i,s){var r=t;"DELAY"==s&&(i.CAN_BUY?r.find(e).css("display","inline-block"):r.find(e).hide()),r.find(e).attr("data-item",i.ID),r.find(e).find("span").attr("data-item",i.ID),arBasketAspro[s]&&(r.find(e).find(".to").removeClass("added").css("display","block"),r.find(e).find(".in").hide(),void 0!==arBasketAspro[s][i.ID]&&(r.find(e).find(".to").hide(),r.find(e).find(".in").addClass("added").css("display","block")))},h.JCCatalogSection.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 r=0<e.CONFIG.MAX_QUANTITY_BUY?"data-max='"+e.CONFIG.MAX_QUANTITY_BUY+"'":"",o='<span class="minus">-</span><input type="text" class="text" name="'+e.PRODUCT_QUANTITY_VARIABLE+'" value="'+s+'" /><span class="plus" '+r+">+</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(o).hide()):i.find(".counter_wrapp .counter_block").length?i.find(".counter_wrapp .counter_block").html(o).show():(i.find(".counter_wrapp").prepend('<div class="counter_block" data-item="'+e.ID+'"></div>'),i.find(".counter_wrapp .counter_block").html(o))}else i.find(".counter_wrapp .counter_block").length&&i.find(".counter_wrapp .counter_block").hide();var 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(),"Y"==arNextOptions.THEME.CHANGE_TITLE_ITEM&&$(this.obProduct).find(".item-title a").html(e.NAME),i.find(".counter_wrapp .counter_block input").data("product","ob"+this.obProduct.id),this.setPriceAction("","Y")},h.JCCatalogSection.prototype.CompareCountResult=function(t){if(t.COMPARE_COUNT){for(var e in t.ITEMS){if(t.ITEMS[e]==this.offers[this.offerNum].ID){this.offers[this.offerNum].COMPARE_ACTIVE=!0;break}this.offers[this.offerNum].COMPARE_ACTIVE=!1}this.offers[this.offerNum].COMPARE_ACTIVE?($(this.obCompare).find(".compare_item.to").hide(),$(this.obCompare).find(".compare_item.added").show()):($(this.obCompare).find(".compare_item.added").hide(),$(this.obCompare).find(".compare_item.to").show())}},h.JCCatalogSection.prototype.ItemInfoResult=function(t){t.HTML&&($(this.obBasketActions).html(t.HTML),$(this.obBasketActions).show(),this.obBuyBtn=BX(this.visual.BUY_ID),this.obBasketBtn=BX(this.visual.BASKET_LINK),this.obSubscribeBtn=BX(this.visual.SUBSCRIBE_ID),this.obSubscribedBtn=BX(this.visual.SUBSCRIBED_ID),BX.bind(this.obBuyBtn,"click",BX.delegate(this.Add2Basket,this)),$(this.obBasketActions).removeClass("wide"),this.ajax_type_item=t.BUYMISSINGGOODS,"ADD"==t.BUYMISSINGGOODS||this.canBuy?$(this.obQuantity).css("display",""):$(this.obBasketActions).addClass("wide")),basketParams={ajax_action:"Y"},BX.ajax.loadJSON(arOptimusOptions.SITE_DIR+"ajax/get_basket_count.php",basketParams,BX.delegate(this.BasketCountResult,this))},h.JCCatalogSection.prototype.BasketCountResult=function(t){for(var e in t.ITEMS){if(t.ITEMS[e].PRODUCT_ID==this.offers[this.offerNum].ID){this.offers[this.offerNum].BASKET_ACTIVE=!0;break}this.offers[this.offerNum].BASKET_ACTIVE=!1}for(var e in t.SUBSCRIBE_ITEMS){if(t.SUBSCRIBE_ITEMS[e].PRODUCT_ID==this.offers[this.offerNum].ID){this.offers[this.offerNum].SUBSCRIBE_ACTIVE=!0;break}this.offers[this.offerNum].SUBSCRIBE_ACTIVE=!1}this.BasketStateRefresh()},h.JCCatalogSection.prototype.BasketStateRefresh=function(t){this.offers[this.offerNum].SUBSCRIBE_ACTIVE?($(this.obProduct).find(".hover_block .o_"+this.offers[this.offerNum].ID+" .to-subscribe").hide(),$(this.obProduct).find(".hover_block .o_"+this.offers[this.offerNum].ID+" .in-subscribe").show()):($(this.obProduct).find(".hover_block .o_"+this.offers[this.offerNum].ID+" .to-subscribe").show(),$(this.obProduct).find(".hover_block .o_"+this.offers[this.offerNum].ID+" .in-subscribe").hide()),this.offers[this.offerNum].BASKET_ACTIVE?($(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID).addClass("wide"),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .button_block").addClass("wide"),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .to-cart").hide(),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .in-cart").show(),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .counter_block").hide()):($(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID).removeClass("wide"),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .button_block").removeClass("wide"),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .to-cart").show(),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .in-cart").hide(),$(this.obProduct).find(".information_wrapp .o_"+this.offers[this.offerNum].ID+" .counter_block").show()),BX.style(this.obBasketActions,"opacity","1"),$(this.obBasketActions).closest(".counter_wrapp").css("opacity",1),"undefined"!==t&&"Y"==t&&($("#basket_line .basket_fly").length&&768<$(h).outerWidth()?basketFly("open"):$("#basket_line .cart").length&&($("#basket_line .cart").is(".empty_cart")&&($("#basket_line .cart").removeClass("empty_cart").find(".cart_wrapp a.basket_link").removeAttr("href").addClass("cart-call"),touchBasket(".cart:not(.empty_cart) .basket_block .link")),reloadTopBasket("add",$("#basket_line"),200,2e3,"Y")),animateBasketLine(200))},h.JCCatalogSection.prototype.setPriceAction=function(t,e){var i=this.offers[this.offerNum].MEASURE&&"Y"==this.offers[this.offerNum].SHOW_MEASURE?this.offers[this.offerNum].MEASURE:"",s=$(this.obProduct),r="",o=void 0!==e&&"Y"==e;if(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()),this.offers[this.offerNum].USE_PRICE_COUNT&&this.offers[this.offerNum].PRICE_MATRIX?(this.checkPriceRange(this.offers[this.offerNum].offer_set_quantity),this.setPriceMatrix(this.offers[this.offerNum].PRICE_MATRIX)):"PRICES"in this.offers[this.offerNum]&&this.offers[this.offerNum].PRICES&&this.setPrice(this.offers[this.offerNum].PRICES,i),"Y"==arNextOptions.THEME.SHOW_TOTAL_SUMM){if(this.offers[this.offerNum].check_quantity)r="Y";else(r=void 0!==t&&"Y"==t?t:"")&&(this.offers[this.offerNum].check_quantity=!0);void 0!==this.currentPrices[this.currentPriceSelected]&&("ALWAYS"==arNextOptions.THEME.SHOW_TOTAL_SUMM_TYPE&&(r=o=""),setPriceItem(s,this.offers[this.offerNum].offer_set_quantity,this.currentPrices[this.currentPriceSelected].PRICE,r,o))}},h.JCCatalogSection.prototype.setPriceMatrix=function(t){if(this.obPrice){var e=this.offers[this.offerNum].MEASURE&&"Y"==this.offers[this.offerNum].SHOW_MEASURE?this.offers[this.offerNum].MEASURE:"",i="";i=getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE,this.currentPrices[this.currentPriceSelected].CURRENCY,this.currentPrices[this.currentPriceSelected].PRINT_PRICE),e&&(i+='<span class="price_measure">/'+e+"</span>"),$(this.obProduct).find(".not_matrix").hide(),$(this.obProduct).find(".with_matrix .price_value_block").html(i),this.showOldPrice&&parseFloat(this.currentPrices[this.currentPriceSelected].BASE_PRICE)>parseFloat(this.currentPrices[this.currentPriceSelected].PRICE)?($(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)),$(this.obProduct).find(".with_matrix .discount").css("display","inline-block")):($(this.obProduct).find(".with_matrix .discount").html(""),$(this.obProduct).find(".with_matrix .discount").css("display","none")),0<this.currentPrices[this.currentPriceSelected].PERCENT?(this.showPercentNumber&&(0<this.currentPrices[this.currentPriceSelected].PERCENT&&this.currentPrices[this.currentPriceSelected].PERCENT<100?($(this.obProduct).find(".with_matrix .sale_block .value").length||$('<div class="value"></div>').insertBefore($(this.obProduct).find(".with_matrix .sale_block .text")),$(this.obProduct).find(".with_matrix .sale_block .value").html("-<span>"+this.currentPrices[this.currentPriceSelected].PERCENT+"</span>%")):$(this.obProduct).find(".with_matrix .sale_block .value").length&&$(this.obProduct).find(".with_matrix .sale_block .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 .sale_block").show()):$(this.obProduct).find(".with_matrix .sale_block").hide(),$(this.obProduct).find(".sale_block.normal").hide(),$(this.obProduct).find(".with_matrix").show(),this.showPercent&&($(this.obPrice).closest(".cost").find(".sale_block:not(.matrix)").hide(),$(this.obPrice).closest(".cost").find(".sale_block:not(.matrix) .text span").html("")),this.showOldPrice&&$(this.obPrice).closest(".cost").find(".price.discount").hide(),BX.adjust(this.obPrice,{html:t});var s={product:$(this.obProduct),measure:e,config:this.config,offer:this.offers[this.offerNum],obPrice:this.currentPrices[this.currentPriceSelected]};BX.onCustomEvent("onAsproSkuSetPriceMatrix",[s])}},h.JCCatalogSection.prototype.setPrice=function(t,e){if(this.obPrice){e=this.offers[this.offerNum].MEASURE&&"Y"==this.offers[this.offerNum].SHOW_MEASURE?this.offers[this.offerNum].MEASURE:"";var i=$(this.obProduct);if("object"==typeof(t=this.offers[this.offerNum].PRICES)){var s="",r=Object.keys(t).length,o=[];for(var a in arNextOptions.THEME.DISCOUNT_PRICE&&(o=arNextOptions.THEME.DISCOUNT_PRICE.split(",")),s='<div class="offers_price_wrapper">',$(this.obProduct).find(".with_matrix").hide(),$(this.obProduct).find(".not_matrix").show(),t)t[a]&&0<t[a].VALUE?("GROUP_NAME"in t[a]&&1<r&&(s+='<div class="offers_price_title">',s+=t[a].GROUP_NAME,s+="</div>"),s+='<div class="offers_price'+(o&&BX.util.in_array(t[a].PRICE_ID,o)?" strike_block":"")+'">',s+='<span class="values_wrapper">'+getCurrentPrice(t[a].DISCOUNT_VALUE,t[a].CURRENCY,t[a].PRINT_DISCOUNT_VALUE)+"</span>",e&&(s+='<span class="price_measure">/'+e+"</span>"),s+="</div>",t[a].DISCOUNT_VALUE!==t[a].VALUE&&(this.showOldPrice&&(s+='<div class="offers_price_old">',s+='<span class="values_wrapper">'+getCurrentPrice(t[a].VALUE,t[a].CURRENCY,t[a].PRINT_VALUE)+"</span>",s+="</div>"),this.showPercent&&(!this.showPercentNumber||this.showPercentNumber&&t[a].DISCOUNT_DIFF_PERCENT<=0&&100<=t[a].DISCOUNT_DIFF_PERCENT?(s+='<div class="sale_block matrix"><div class="sale_wrapper">',s+='<span class="title">'+BX.message("ITEM_ECONOMY")+"</span>",s+='<div class="text">'):(s+='<div class="sale_block matrix"><div class="sale_wrapper">',s+='<div class="value">-<span>'+t[a].DISCOUNT_DIFF_PERCENT+"</span>%</div>",s+='<div class="text">',s+='<span class="title">'+BX.message("ITEM_ECONOMY")+"</span> "),s+='<span class="values_wrapper">'+getCurrentPrice(t[a].DISCOUNT_DIFF,t[a].CURRENCY,t[a].PRINT_DISCOUNT_DIFF)+"</span>",s+="</div>",s+='<div class="clearfix"></div></div></div>')),$(".prices_block .cost.prices").show()):$(".prices_block .cost.prices").hide();this.showPercent&&($(this.obPrice).closest(".cost").find(".sale_block:not(.matrix)").hide(),$(this.obPrice).closest(".cost").find(".sale_block:not(.matrix) .value").html(""),$(this.obPrice).closest(".cost").find(".sale_block:not(.matrix) .text span").html("")),this.showOldPrice&&$(this.obPrice).closest(".cost").find(".price.discount").hide(),s+="</div>",BX.adjust(this.obPrice,{html:s});var n={product:i,measure:e,config:this.config,offer:this.offers[this.offerNum],obPrices:t};BX.onCustomEvent("onAsproSkuSetPrice",[n])}}},h.JCCatalogSection.prototype.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 r in!i&&(e=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=e.HASH),this.currentPrices)if(this.currentPrices.hasOwnProperty(r)&&this.currentPrices[r].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=r;break}}},h.JCCatalogSection.prototype.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.JCCatalogSection.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.JCCatalogSection.prototype.Compare=function(){var t,e;if($(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).data("changed","Y"),$(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).find(".compare_item.added").is(":visible")?(e=this.compareData.compareUrlDel,this.compareData.Added=!1):(e=this.compareData.compareUrl,this.compareData.Added=!0),e){switch(this.productType){case 1:case 2:e=e.replace("#ID#",this.product.id.toString());break;case 3:e=e.replace("#ID#",this.offers[this.offerNum].ID)}t={ajax_action:"Y"},BX.ajax.loadJSON(e,t,BX.proxy(this.CompareResult,this))}},h.JCCatalogSection.prototype.CompareResult=function(t){return"object"!=typeof t||("OK"===t.STATUS?(BX.onCustomEvent("OnCompareChange"),this.compareData.Added?($(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).find(".to").hide(),$(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).find(".in").show()):($(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).find(".in").hide(),$(this.obProduct).find(".like_icons .o_"+this.offers[this.offerNum].ID).find(".to").show()),jsAjaxUtil.InsertDataToNode(arOptimusOptions.SITE_DIR+"ajax/show_compare_preview_top.php","compare_line",!1)):console.log(BX.message("ADD_ERROR_COMPARE"))),!1},h.JCCatalogSection.prototype.CompareRedirect=function(){this.compareData.comparePath?location.href=this.compareData.comparePath:this.obPopupWin.close()},h.JCCatalogSection.prototype.InitBasketUrl=function(){switch(this.basketUrl="ADD"===this.basketMode?this.basketData.add_url:this.basketData.buy_url,this.productType){case 1:case 2:this.basketUrl=this.basketUrl.replace("#ID#",this.product.id.toString());break;case 3:this.basketUrl=this.basketUrl.replace("#ID#",this.offers[this.offerNum].ID)}this.basketParams={ajax_basket:"Y"},this.showQuantity&&(this.basketParams[this.basketData.quantity]=$(this.obProduct).find(".counter_wrapp.o_"+this.offers[this.offerNum].ID).find(".counter_block .text").val()),this.basketData.sku_props&&(this.basketParams[this.basketData.sku_props_var]=this.basketData.sku_props)},h.JCCatalogSection.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=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.JCCatalogSection.prototype.Add2Basket=function(){this.basketMode="ADD",this.Basket()},h.JCCatalogSection.prototype.BuyBasket=function(){this.basketMode="BUY",this.Basket()},h.JCCatalogSection.prototype.SendToBasket=function(){this.canBuy&&(this.InitBasketUrl(),this.FillBasketProps(),BX.ajax.loadJSON(this.basketUrl,this.basketParams,BX.delegate(this.BasketResult,this)))},h.JCCatalogSection.prototype.Basket=function(){this.canBuy&&this.SendToBasket()},h.JCCatalogSection.prototype.BasketResult=function(t){var e;if(this.obPopupWin&&this.obPopupWin.close(),"object"!=typeof t)return!1;(e="OK"===t.STATUS)&&"BUY"===this.basketAction?this.BasketRedirect():e?(BX.onCustomEvent("OnBasketChange"),this.offers[this.offerNum].BASKET_ACTIVE=!0,this.BasketStateRefresh("Y"),$(this.obProduct).find(".hover_block .o_"+this.offers[this.offerNum].ID).data("changed","Y")):console.log(BX.message("ADD_ERROR_BASKET"))},h.JCCatalogSection.prototype.BasketRedirect=function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")})}(window);
/* End */
;; /* /bitrix/templates/aspro_next/components/bitrix/catalog.section/catalog_list/script.min.js?160724408642533*/
