%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.139.87.61
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/catalog.element/templates/store_v3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/catalog.element/templates/store_v3//script.min.js
(function(t){"use strict";if(t.JCCatalogElement)return;var i=function(t){i.superclass.constructor.apply(this,arguments);this.buttonNode=BX.create("SPAN",{props:{className:"btn btn-primary btn-buy btn-sm",id:this.id},style:typeof t.style==="object"?t.style:{},text:t.text,events:this.contextEvents});if(BX.browser.IsIE()){this.buttonNode.setAttribute("hideFocus","hidefocus")}};BX.extend(i,BX.PopupWindowButton);t.JCCatalogElement=function(t){this.productType=0;this.config={useCatalog:true,showQuantity:true,showPrice:true,showAbsent:true,showOldPrice:false,showPercent:false,showSkuProps:false,showOfferGroup:false,useCompare:false,useStickers:false,useSubscribe:false,usePopup:false,useMagnifier:false,usePriceRanges:false,basketAction:["BUY"],showClosePopup:false,templateTheme:"",showSlider:false,sliderInterval:5e3,useEnhancedEcommerce:false,dataLayerName:"dataLayer",brandProperty:false,alt:"",title:"",magnifierZoomPercent:200};this.checkQuantity=false;this.maxQuantity=0;this.minQuantity=0;this.stepQuantity=1;this.isDblQuantity=false;this.canBuy=true;this.isGift=false;this.canSubscription=true;this.currentIsSet=false;this.currentPriceMode="";this.currentPrices=[];this.currentPriceSelected=0;this.currentQuantityRanges=[];this.currentQuantityRangeSelected=0;this.precision=6;this.precisionFactor=Math.pow(10,this.precision);this.visual={};this.basketMode="";this.product={checkQuantity:false,maxQuantity:0,stepQuantity:1,startQuantity:1,isDblQuantity:false,canBuy:true,canSubscription:true,name:"",pict:{},id:0,addUrl:"",buyUrl:"",slider:{},sliderCount:0,useSlider:false,sliderPict:[]};this.mess={};this.basketData={useProps:false,emptyProps:false,quantity:"quantity",props:"prop",basketUrl:"",sku_props:"",sku_props_var:"basket_props",add_url:"",buy_url:""};this.compareData={compareUrl:"",compareDeleteUrl:"",comparePath:""};this.defaultPict={preview:null,detail:null};this.offers=[];this.offerNum=0;this.treeProps=[];this.selectedValues={};this.mouseTimer=null;this.isTouchDevice=BX.hasClass(document.documentElement,"bx-touch");this.touch=null;this.slider={interval:null,progress:null,paused:null,pager:[],controls:[]};this.quantityDelay=null;this.quantityTimer=null;this.obProduct=null;this.obQuantity=null;this.obQuantityUp=null;this.obQuantityDown=null;this.obPrice={price:null,full:null,discount:null,percent:null,total:null,blockOldPrice:null};this.obTree=null;this.obPriceRanges=null;this.obBuyBtn=null;this.obAddToBasketBtn=null;this.obBasketActions=null;this.obNotAvail=null;this.obSubscribe=null;this.obSkuProps=null;this.obDescription=null;this.obMainSkuProps=null;this.obBigSlider=null;this.obMeasure=null;this.obQuantityLimit={all:null,value:null};this.obQuantityCounter=null;this.obCompare=null;this.obTabsPanel=null;this.node={};this.smallCardNodes={};this.magnify={enabled:false,obBigImg:null,obBigSlider:null,height:0,width:0,timer:0};this.currentImg={id:0,src:"",width:0,height:0};this.obPopupWin=null;this.basketUrl="";this.basketParams={};this.errorCode=0;if(typeof t==="object"){this.params=t;this.initConfig();if(this.params.MESS){this.mess=this.params.MESS}switch(this.productType){case 0:case 1:case 2:this.initProductData();break;case 3:this.initOffersData();break;default:this.errorCode=-1}this.initBasketData();this.initCompareData();this.isFacebookConversionCustomizeProductEventEnabled=this.params.IS_FACEBOOK_CONVERSION_CUSTOMIZE_PRODUCT_EVENT_ENABLED}if(this.errorCode===0){BX.ready(BX.delegate(this.init,this))}this.params={};BX.addCustomEvent("onSaleProductIsGift",BX.delegate(this.onSaleProductIsGift,this));BX.addCustomEvent("onSaleProductIsNotGift",BX.delegate(this.onSaleProductIsNotGift,this))};t.JCCatalogElement.prototype={getEntity:function(t,i,s){if(!t||!i)return null;s=s||"";return t.querySelector(s+'[data-entity="'+i+'"]')},getEntities:function(t,i,s){if(!t||!i)return{length:0};s=s||"";return t.querySelectorAll(s+'[data-entity="'+i+'"]')},onSaleProductIsGift:function(t,i){if(i&&this.offers&&this.offers[this.offerNum].ID==i){this.setGift()}},onSaleProductIsNotGift:function(t,i){if(i&&this.offers&&this.offers[this.offerNum].ID==i){this.restoreSticker();this.isGift=false;this.setPrice()}},reloadGiftInfo:function(){if(this.productType===3){this.checkQuantity=true;this.maxQuantity=1;this.setPrice();this.redrawSticker({text:BX.message("PRODUCT_GIFT_LABEL")})}},setGift:function(){if(this.productType===3){this.isGift=true}if(this.productType===1||this.productType===2){this.isGift=true}if(this.productType===0){this.isGift=false}this.reloadGiftInfo()},setOffer:function(t){this.offerNum=parseInt(t);this.setCurrent()},init:function(){var i=0,s=0,e=null;this.obProduct=BX(this.visual.ID);if(!this.obProduct){this.errorCode=-1}this.obBigSlider=BX(this.visual.BIG_SLIDER_ID);this.node.imageContainer=this.getEntity(this.obProduct,"images-container");this.node.imageSliderBlock=this.getEntity(this.obProduct,"images-slider-block");this.node.sliderProgressBar=this.getEntity(this.obProduct,"slider-progress-bar");this.node.sliderControlLeft=this.getEntity(this.obBigSlider,"slider-control-left");this.node.sliderControlRight=this.getEntity(this.obBigSlider,"slider-control-right");if(!this.obBigSlider||!this.node.imageContainer||!this.node.imageContainer){this.errorCode=-2}if(this.config.showPrice){this.obPrice.price=BX(this.visual.PRICE_ID);if(!this.obPrice.price&&this.config.useCatalog){this.errorCode=-16}else{this.obPrice.total=BX(this.visual.PRICE_TOTAL);if(this.config.showOldPrice){this.obPrice.full=BX(this.visual.OLD_PRICE_ID);this.obPrice.discount=BX(this.visual.DISCOUNT_PRICE_ID);this.obPrice.blockOldPrice=BX(this.visual.BLOCK_PRICE_OLD);if(!this.obPrice.blockOldPrice||!this.obPrice.full||!this.obPrice.discount){this.config.showOldPrice=false}}if(this.config.showPercent){this.obPrice.percent=BX(this.visual.DISCOUNT_PERCENT_ID);if(!this.obPrice.percent){this.config.showPercent=false}}}this.obBasketActions=BX(this.visual.BASKET_ACTIONS_ID);if(this.obBasketActions){if(BX.util.in_array("BUY",this.config.basketAction)){this.obBuyBtn=BX(this.visual.BUY_LINK)}if(BX.util.in_array("ADD",this.config.basketAction)){this.obAddToBasketBtn=BX(this.visual.ADD_BASKET_LINK)}}this.obNotAvail=BX(this.visual.NOT_AVAILABLE_MESS)}if(this.config.showQuantity){this.obQuantity=BX(this.visual.QUANTITY_ID);this.obQuantityCounter=BX(this.visual.QUANTITY_COUNTER_ID);this.node.quantity=this.getEntity(this.obProduct,"quantity-block");if(this.visual.QUANTITY_UP_ID){this.obQuantityUp=BX(this.visual.QUANTITY_UP_ID)}if(this.visual.QUANTITY_DOWN_ID){this.obQuantityDown=BX(this.visual.QUANTITY_DOWN_ID)}}if(this.productType===3){if(this.visual.TREE_ID){this.obTree=BX(this.visual.TREE_ID);if(!this.obTree){this.errorCode=-256}}if(this.visual.QUANTITY_MEASURE){this.obMeasure=BX(this.visual.QUANTITY_MEASURE)}if(this.visual.QUANTITY_MEASURE_CONTAINER){this.obMeasureContainer=BX(this.visual.QUANTITY_MEASURE_CONTAINER)}if(this.visual.QUANTITY_LIMIT&&this.config.showMaxQuantity!=="N"){this.obQuantityLimit.all=BX(this.visual.QUANTITY_LIMIT);if(this.obQuantityLimit.all){this.obQuantityLimit.value=this.getEntity(this.obQuantityLimit.all,"quantity-limit-value");if(!this.obQuantityLimit.value){this.obQuantityLimit.all=null}}}if(this.config.usePriceRanges){this.obPriceRanges=this.getEntity(this.obProduct,"price-ranges-block")}}if(this.config.showSkuProps){this.obSkuProps=BX(this.visual.DISPLAY_PROP_DIV);this.obMainSkuProps=BX(this.visual.DISPLAY_MAIN_PROP_DIV)}if(this.config.showSkuDescription==="Y"){this.obDescription=BX(this.visual.DESCRIPTION_ID)}if(this.config.useCompare){this.obCompare=BX(this.visual.COMPARE_LINK)}if(this.config.useSubscribe){this.obSubscribe=BX(this.visual.SUBSCRIBE_LINK)}this.obTabs=BX(this.visual.TABS_ID);this.obTabContainers=BX(this.visual.TAB_CONTAINERS_ID);this.obTabsPanel=BX(this.visual.TABS_PANEL_ID);this.smallCardNodes.panel=BX(this.visual.SMALL_CARD_PANEL_ID);if(this.smallCardNodes.panel){this.smallCardNodes.picture=this.getEntity(this.smallCardNodes.panel,"panel-picture");this.smallCardNodes.title=this.getEntity(this.smallCardNodes.panel,"panel-title");this.smallCardNodes.price=this.getEntity(this.smallCardNodes.panel,"panel-price");this.smallCardNodes.sku=this.getEntity(this.smallCardNodes.panel,"panel-sku-container");this.smallCardNodes.oldPrice=this.getEntity(this.smallCardNodes.panel,"panel-old-price");this.smallCardNodes.buyButton=this.getEntity(this.smallCardNodes.panel,"panel-buy-button");this.smallCardNodes.addButton=this.getEntity(this.smallCardNodes.panel,"panel-add-button");this.smallCardNodes.notAvailableButton=this.getEntity(this.smallCardNodes.panel,"panel-not-available-button");this.smallCardNodes.aligner=this.getEntity(this.obProduct,"main-button-container")}this.initPopup();this.initTabs();if(this.smallCardNodes.panel){this.smallCardNodes.picture&&BX.bind(this.smallCardNodes.picture.parentNode,"click",BX.proxy(this.scrollToProduct,this));this.smallCardNodes.title&&BX.bind(this.smallCardNodes.title,"click",BX.proxy(this.scrollToProduct,this));this.smallCardNodes.sku&&BX.bind(this.smallCardNodes.sku,"click",BX.proxy(this.scrollToProduct,this))}if(this.obTabsPanel||this.smallCardNodes.panel){this.checkTopPanels();BX.bind(t,"scroll",BX.proxy(this.checkTopPanels,this))}if(this.errorCode===0){if(this.config.showSlider&&!this.isTouchDevice){BX.bind(this.obBigSlider,"mouseenter",BX.proxy(this.stopSlider,this));BX.bind(this.obBigSlider,"mouseleave",BX.proxy(this.cycleSlider,this))}if(this.isTouchDevice){BX.bind(this.node.imageContainer,"touchstart",BX.proxy(this.touchStartEvent,this));BX.bind(this.node.imageContainer,"touchend",BX.proxy(this.touchEndEvent,this));BX.bind(this.node.imageContainer,"touchcancel",BX.proxy(this.touchEndEvent,this))}BX.bind(this.node.sliderControlLeft,"click",BX.proxy(this.slidePrev,this));BX.bind(this.node.sliderControlRight,"click",BX.proxy(this.slideNext,this));if(this.config.showQuantity){var a=this.isTouchDevice?"touchstart":"mousedown";var r=this.isTouchDevice?"touchend":"mouseup";if(this.obQuantityUp){BX.bind(this.obQuantityUp,a,BX.proxy(this.startQuantityInterval,this));BX.bind(this.obQuantityUp,r,BX.proxy(this.clearQuantityInterval,this));BX.bind(this.obQuantityUp,"mouseout",BX.proxy(this.clearQuantityInterval,this));BX.bind(this.obQuantityUp,"click",BX.delegate(this.quantityUp,this))}if(this.obQuantityDown){BX.bind(this.obQuantityDown,a,BX.proxy(this.startQuantityInterval,this));BX.bind(this.obQuantityDown,r,BX.proxy(this.clearQuantityInterval,this));BX.bind(this.obQuantityDown,"mouseout",BX.proxy(this.clearQuantityInterval,this));BX.bind(this.obQuantityDown,"click",BX.delegate(this.quantityDown,this))}if(this.obQuantity){BX.bind(this.obQuantity,"change",BX.delegate(this.quantityChange,this));BX.bind(this.obQuantity,"input",BX.delegate(this.quantityInput,this))}}switch(this.productType){case 0:case 1:case 2:if(this.product.useSlider){this.product.slider={ID:this.visual.SLIDER_CONT_ID,CONT:BX(this.visual.SLIDER_CONT_ID),COUNT:this.product.sliderCount};this.product.slider.ITEMS=this.getEntities(this.product.slider.CONT,"slider-control");for(s=0;s<this.product.slider.ITEMS.length;s++){BX.bind(this.product.slider.ITEMS[s],"mouseenter",BX.delegate(this.onSliderControlHover,this));BX.bind(this.product.slider.ITEMS[s],"mouseleave",BX.delegate(this.onSliderControlLeave,this));BX.bind(this.product.slider.ITEMS[s],"click",BX.delegate(this.selectSliderImg,this))}this.setCurrentImg(this.product.sliderPict[0],true,true);this.checkSliderControls(this.product.sliderCount);if(this.product.slider.ITEMS.length>1){this.initSlider()}}this.checkQuantityControls();this.fixFontCheck();this.setAnalyticsDataLayer("showDetail");break;case 3:e=this.obTree.querySelectorAll("li");for(i=0;i<e.length;i++){BX.bind(e[i],"click",BX.delegate(this.selectOfferProp,this))}for(i=0;i<this.offers.length;i++){this.offers[i].SLIDER_COUNT=parseInt(this.offers[i].SLIDER_COUNT,10)||0;if(this.offers[i].SLIDER_COUNT===0){this.slider.controls[i]={ID:"",COUNT:this.offers[i].SLIDER_COUNT,ITEMS:[]}}else{for(s=0;s<this.offers[i].SLIDER.length;s++){this.offers[i].SLIDER[s].WIDTH=parseInt(this.offers[i].SLIDER[s].WIDTH,10);this.offers[i].SLIDER[s].HEIGHT=parseInt(this.offers[i].SLIDER[s].HEIGHT,10)}this.slider.controls[i]={ID:this.visual.SLIDER_CONT_OF_ID+this.offers[i].ID,OFFER_ID:this.offers[i].ID,CONT:BX(this.visual.SLIDER_CONT_OF_ID+this.offers[i].ID),COUNT:this.offers[i].SLIDER_COUNT};this.slider.controls[i].ITEMS=this.getEntities(this.slider.controls[i].CONT,"slider-control");for(s=0;s<this.slider.controls[i].ITEMS.length;s++){BX.bind(this.slider.controls[i].ITEMS[s],"mouseenter",BX.delegate(this.onSliderControlHover,this));BX.bind(this.slider.controls[i].ITEMS[s],"mouseleave",BX.delegate(this.onSliderControlLeave,this));BX.bind(this.slider.controls[i].ITEMS[s],"click",BX.delegate(this.selectSliderImg,this))}this.slider.pager[i]={ID:this.visual.SLIDER_PAGER_OF_ID+this.offers[i].ID,OFFER_ID:this.offers[i].ID,CONT:BX(this.visual.SLIDER_PAGER_OF_ID+this.offers[i].ID),COUNT:this.offers[i].SLIDER_COUNT};this.slider.pager[i].ITEMS=this.getEntities(this.slider.pager[i].CONT,"slider-control");for(s=0;s<this.slider.pager[i].ITEMS.length;s++){BX.bind(this.slider.pager[i].ITEMS[s],"mouseenter",BX.delegate(this.onSliderControlHover,this));BX.bind(this.slider.pager[i].ITEMS[s],"mouseleave",BX.delegate(this.onSliderControlLeave,this));BX.bind(this.slider.pager[i].ITEMS[s],"click",BX.delegate(this.selectSliderImg,this))}}}this.setCurrent();break}this.obBuyBtn&&BX.bind(this.obBuyBtn,"click",BX.proxy(this.buyBasket,this));this.smallCardNodes.buyButton&&BX.bind(this.smallCardNodes.buyButton,"click",BX.proxy(this.buyBasket,this));this.obAddToBasketBtn&&BX.bind(this.obAddToBasketBtn,"click",BX.proxy(this.add2Basket,this));this.smallCardNodes.addButton&&BX.bind(this.smallCardNodes.addButton,"click",BX.proxy(this.add2Basket,this));if(this.obCompare){BX.bind(this.obCompare,"click",BX.proxy(this.compare,this));BX.addCustomEvent("onCatalogDeleteCompare",BX.proxy(this.checkDeletedCompare,this))}}},initConfig:function(){if(this.params.PRODUCT_TYPE){this.productType=parseInt(this.params.PRODUCT_TYPE,10)}if(this.params.CONFIG.USE_CATALOG!=="undefined"&&BX.type.isBoolean(this.params.CONFIG.USE_CATALOG)){this.config.useCatalog=this.params.CONFIG.USE_CATALOG}this.config.showQuantity=this.params.CONFIG.SHOW_QUANTITY;this.config.showPrice=this.params.CONFIG.SHOW_PRICE;this.config.showPercent=this.params.CONFIG.SHOW_DISCOUNT_PERCENT;this.config.showOldPrice=this.params.CONFIG.SHOW_OLD_PRICE;this.config.showSkuProps=this.params.CONFIG.SHOW_SKU_PROPS;this.config.showOfferGroup=this.params.CONFIG.OFFER_GROUP;this.config.useCompare=this.params.CONFIG.DISPLAY_COMPARE;this.config.useStickers=this.params.CONFIG.USE_STICKERS;this.config.useSubscribe=this.params.CONFIG.USE_SUBSCRIBE;this.config.showMaxQuantity=this.params.CONFIG.SHOW_MAX_QUANTITY;this.config.relativeQuantityFactor=parseInt(this.params.CONFIG.RELATIVE_QUANTITY_FACTOR);this.config.usePriceRanges=this.params.CONFIG.USE_PRICE_COUNT;this.config.showSkuDescription=this.params.CONFIG.SHOW_SKU_DESCRIPTION;this.config.displayPreviewTextMode=this.params.CONFIG.DISPLAY_PREVIEW_TEXT_MODE;if(this.params.CONFIG.MAIN_PICTURE_MODE){this.config.usePopup=BX.util.in_array("POPUP",this.params.CONFIG.MAIN_PICTURE_MODE);this.config.useMagnifier=BX.util.in_array("MAGNIFIER",this.params.CONFIG.MAIN_PICTURE_MODE)}if(this.params.CONFIG.ADD_TO_BASKET_ACTION){this.config.basketAction=this.params.CONFIG.ADD_TO_BASKET_ACTION}this.config.showClosePopup=this.params.CONFIG.SHOW_CLOSE_POPUP;this.config.templateTheme=this.params.CONFIG.TEMPLATE_THEME||"";this.config.showSlider=this.params.CONFIG.SHOW_SLIDER==="Y";if(this.config.showSlider&&!this.isTouchDevice){this.config.sliderInterval=parseInt(this.params.CONFIG.SLIDER_INTERVAL)||5e3}else{this.config.sliderInterval=false}this.config.useEnhancedEcommerce=this.params.CONFIG.USE_ENHANCED_ECOMMERCE==="Y";this.config.dataLayerName=this.params.CONFIG.DATA_LAYER_NAME;this.config.brandProperty=this.params.CONFIG.BRAND_PROPERTY;this.config.alt=this.params.CONFIG.ALT||"";this.config.title=this.params.CONFIG.TITLE||"";this.config.magnifierZoomPercent=parseInt(this.params.CONFIG.MAGNIFIER_ZOOM_PERCENT)||200;if(!this.params.VISUAL||typeof this.params.VISUAL!=="object"||!this.params.VISUAL.ID){this.errorCode=-1;return}this.visual=this.params.VISUAL},initProductData:function(){var t=0;if(this.params.PRODUCT&&typeof this.params.PRODUCT==="object"){if(this.config.showPrice){this.currentPriceMode=this.params.PRODUCT.ITEM_PRICE_MODE;this.currentPrices=this.params.PRODUCT.ITEM_PRICES;this.currentPriceSelected=this.params.PRODUCT.ITEM_PRICE_SELECTED;this.currentQuantityRanges=this.params.PRODUCT.ITEM_QUANTITY_RANGES;this.currentQuantityRangeSelected=this.params.PRODUCT.ITEM_QUANTITY_RANGE_SELECTED}if(this.config.showQuantity){this.product.checkQuantity=this.params.PRODUCT.CHECK_QUANTITY;this.product.isDblQuantity=this.params.PRODUCT.QUANTITY_FLOAT;if(this.product.checkQuantity){this.product.maxQuantity=this.product.isDblQuantity?parseFloat(this.params.PRODUCT.MAX_QUANTITY):parseInt(this.params.PRODUCT.MAX_QUANTITY,10)}this.product.stepQuantity=this.product.isDblQuantity?parseFloat(this.params.PRODUCT.STEP_QUANTITY):parseInt(this.params.PRODUCT.STEP_QUANTITY,10);this.checkQuantity=this.product.checkQuantity;this.isDblQuantity=this.product.isDblQuantity;this.stepQuantity=this.product.stepQuantity;this.maxQuantity=this.product.maxQuantity;this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity;if(this.isDblQuantity){this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor}}this.product.canBuy=this.params.PRODUCT.CAN_BUY;this.canSubscription=this.product.canSubscription=this.params.PRODUCT.SUBSCRIPTION;this.product.name=this.params.PRODUCT.NAME;this.product.pict=this.params.PRODUCT.PICT;this.product.id=this.params.PRODUCT.ID;this.product.category=this.params.PRODUCT.CATEGORY;if(this.params.PRODUCT.ADD_URL){this.product.addUrl=this.params.PRODUCT.ADD_URL}if(this.params.PRODUCT.BUY_URL){this.product.buyUrl=this.params.PRODUCT.BUY_URL}if(this.params.PRODUCT.SLIDER_COUNT){this.product.sliderCount=parseInt(this.params.PRODUCT.SLIDER_COUNT,10)||0;if(this.product.sliderCount>0&&this.params.PRODUCT.SLIDER.length){for(t=0;t<this.params.PRODUCT.SLIDER.length;t++){this.product.useSlider=true;this.params.PRODUCT.SLIDER[t].WIDTH=parseInt(this.params.PRODUCT.SLIDER[t].WIDTH,10);this.params.PRODUCT.SLIDER[t].HEIGHT=parseInt(this.params.PRODUCT.SLIDER[t].HEIGHT,10)}this.product.sliderPict=this.params.PRODUCT.SLIDER;this.setCurrentImg(this.product.sliderPict[0],false)}}this.currentIsSet=true}else{this.errorCode=-1}},initOffersData:function(){if(this.params.OFFERS&&BX.type.isArray(this.params.OFFERS)){this.offers=this.params.OFFERS;this.offerNum=0;if(this.params.OFFER_SELECTED){this.offerNum=parseInt(this.params.OFFER_SELECTED,10)||0}if(this.params.TREE_PROPS){this.treeProps=this.params.TREE_PROPS}if(this.params.DEFAULT_PICTURE){this.defaultPict.preview=this.params.DEFAULT_PICTURE.PREVIEW_PICTURE;this.defaultPict.detail=this.params.DEFAULT_PICTURE.DETAIL_PICTURE}if(this.params.PRODUCT&&typeof this.params.PRODUCT==="object"){this.product.id=parseInt(this.params.PRODUCT.ID,10);this.product.name=this.params.PRODUCT.NAME;this.product.category=this.params.PRODUCT.CATEGORY;this.product.detailText=this.params.PRODUCT.DETAIL_TEXT;this.product.detailTextType=this.params.PRODUCT.DETAIL_TEXT_TYPE;this.product.previewText=this.params.PRODUCT.PREVIEW_TEXT;this.product.previewTextType=this.params.PRODUCT.PREVIEW_TEXT_TYPE}}else{this.errorCode=-1}},initBasketData:function(){if(this.params.BASKET&&typeof this.params.BASKET==="object"){if(this.productType===1||this.productType===2){this.basketData.useProps=this.params.BASKET.ADD_PROPS;this.basketData.emptyProps=this.params.BASKET.EMPTY_PROPS}if(this.params.BASKET.QUANTITY){this.basketData.quantity=this.params.BASKET.QUANTITY}if(this.params.BASKET.PROPS){this.basketData.props=this.params.BASKET.PROPS}if(this.params.BASKET.BASKET_URL){this.basketData.basketUrl=this.params.BASKET.BASKET_URL}if(this.productType===3){if(this.params.BASKET.SKU_PROPS){this.basketData.sku_props=this.params.BASKET.SKU_PROPS}}if(this.params.BASKET.ADD_URL_TEMPLATE){this.basketData.add_url=this.params.BASKET.ADD_URL_TEMPLATE}if(this.params.BASKET.BUY_URL_TEMPLATE){this.basketData.buy_url=this.params.BASKET.BUY_URL_TEMPLATE}if(this.basketData.add_url===""&&this.basketData.buy_url===""){this.errorCode=-1024}}},initCompareData:function(){if(this.config.useCompare){if(this.params.COMPARE&&typeof this.params.COMPARE==="object"){if(this.params.COMPARE.COMPARE_PATH){this.compareData.comparePath=this.params.COMPARE.COMPARE_PATH}if(this.params.COMPARE.COMPARE_URL_TEMPLATE){this.compareData.compareUrl=this.params.COMPARE.COMPARE_URL_TEMPLATE}else{this.config.useCompare=false}if(this.params.COMPARE.COMPARE_DELETE_URL_TEMPLATE){this.compareData.compareDeleteUrl=this.params.COMPARE.COMPARE_DELETE_URL_TEMPLATE}else{this.config.useCompare=false}}else{this.config.useCompare=false}}},initSlider:function(){if(this.node.sliderProgressBar){if(this.slider.progress){this.resetProgress()}else{this.slider.progress=new BX.easing({transition:BX.easing.transitions.linear,step:BX.delegate(function(t){this.node.sliderProgressBar.style.width=t.width/10+"%"},this)})}}this.cycleSlider()},setAnalyticsDataLayer:function(i){if(!this.config.useEnhancedEcommerce||!this.config.dataLayerName)return;var s={},e={},a=[],r,o,n,h,l,u;switch(this.productType){case 0:case 1:case 2:s={id:this.product.id,name:this.product.name,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,category:this.product.category,brand:BX.type.isArray(this.config.brandProperty)?this.config.brandProperty.join("/"):this.config.brandProperty};break;case 3:for(r in this.offers[this.offerNum].TREE){if(this.offers[this.offerNum].TREE.hasOwnProperty(r)){h=r.substring(5);l=this.offers[this.offerNum].TREE[r];for(o in this.treeProps){if(this.treeProps.hasOwnProperty(o)&&this.treeProps[o].ID==h){for(n in this.treeProps[o].VALUES){u=this.treeProps[o].VALUES[n];if(u.ID==l){a.push(u.NAME);break}}}}}}s={id:this.offers[this.offerNum].ID,name:this.offers[this.offerNum].NAME,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,category:this.product.category,brand:BX.type.isArray(this.config.brandProperty)?this.config.brandProperty.join("/"):this.config.brandProperty,variant:a.join("/")};break}switch(i){case"showDetail":e={ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",detail:{products:[{name:s.name||"",id:s.id||"",price:s.price||0,brand:s.brand||"",category:s.category||"",variant:s.variant||""}]}}};break;case"addToCart":e={ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",add:{products:[{name:s.name||"",id:s.id||"",price:s.price||0,brand:s.brand||"",category:s.category||"",variant:s.variant||"",quantity:this.config.showQuantity&&this.obQuantity?this.obQuantity.value:1}]}}};break}t[this.config.dataLayerName]=t[this.config.dataLayerName]||[];t[this.config.dataLayerName].push(e)},initTabs:function(){var t=this.getEntities(this.obTabs,"tab"),i=this.getEntities(this.obTabsPanel,"tab");var s,e,a=false;if(t.length!==i.length)return;for(var r in t){if(t.hasOwnProperty(r)&&BX.type.isDomNode(t[r])){s=t[r].getAttribute("data-value");if(s){e=this.obTabContainers.querySelector('[data-value="'+s+'"]');if(BX.type.isDomNode(e)){BX.bind(t[r],"click",BX.proxy(this.changeTab,this));BX.bind(i[r],"click",BX.proxy(this.changeTab,this));if(!a){BX.addClass(t[r],"active");BX.addClass(i[r],"active");BX.show(e);a=true}else{BX.removeClass(t[r],"active");BX.removeClass(i[r],"active");BX.hide(e)}}}}}},checkTouch:function(t){if(!t||!t.changedTouches)return false;return t.changedTouches[0].identifier===this.touch.identifier},touchStartEvent:function(t){if(t.touches.length!=1)return;this.touch=t.changedTouches[0]},touchEndEvent:function(t){if(!this.checkTouch(t))return;var i=this.touch.pageX-t.changedTouches[0].pageX,s=this.touch.pageY-t.changedTouches[0].pageY;if(Math.abs(i)>=Math.abs(s)+10){if(i>0){this.slideNext()}if(i<0){this.slidePrev()}}},cycleSlider:function(t){t||(this.slider.paused=false);this.slider.interval&&clearInterval(this.slider.interval);if(this.config.sliderInterval&&!this.slider.paused){if(this.slider.progress){this.slider.progress.stop();var i=parseInt(this.node.sliderProgressBar.style.width);this.slider.progress.options.duration=this.config.sliderInterval*(100-i)/100;this.slider.progress.options.start={width:i*10};this.slider.progress.options.finish={width:1e3};this.slider.progress.options.complete=BX.delegate(function(){this.slider.interval=true;this.slideNext()},this);this.slider.progress.animate()}else{this.slider.interval=setInterval(BX.proxy(this.slideNext,this),this.config.sliderInterval)}}},stopSlider:function(t){t||(this.slider.paused=true);this.slider.interval&&(this.slider.interval=clearInterval(this.slider.interval));if(this.slider.progress){this.slider.progress.stop();var i=parseInt(this.node.sliderProgressBar.style.width);this.slider.progress.options.duration=this.config.sliderInterval*i/200;this.slider.progress.options.start={width:i*10};this.slider.progress.options.finish={width:0};this.slider.progress.options.complete=null;this.slider.progress.animate()}},resetProgress:function(){this.slider.progress&&this.slider.progress.stop();this.node.sliderProgressBar.style.width=0},slideNext:function(){return this.slide("next")},slidePrev:function(){return this.slide("prev")},slide:function(t){if(!this.product.slider||!this.product.slider.CONT)return;var i=this.getEntity(this.product.slider.CONT,"slider-control",".active"),s=this.getItemForDirection(t,i);BX.removeClass(i,"active");this.selectSliderImg(s);this.slider.interval&&this.cycleSlider()},getItemForDirection:function(t,i){var s=this.getItemIndex(i),e=t==="prev"?-1:1,a=(s+e)%this.product.slider.COUNT;return this.eq(this.product.slider.ITEMS,a)},getItemIndex:function(t){return BX.util.array_values(this.product.slider.ITEMS).indexOf(t)},eq:function(t,i){var s=t.length,e=+i+(i<0?s:0);return e>=0&&e<s?t[e]:{}},scrollToProduct:function(){var i=BX.GetWindowScrollPos().scrollTop,s=BX.pos(this.obProduct).top-30;if(i>s){new BX.easing({duration:500,start:{scroll:i},finish:{scroll:s},transition:BX.easing.makeEaseOut(BX.easing.transitions.quint),step:BX.delegate(function(i){t.scrollTo(0,i.scroll)},this)}).animate()}},checkTopPanels:function(){var t=BX.GetWindowScrollPos().scrollTop,i;if(this.smallCardNodes.panel){i=BX.pos(this.smallCardNodes.aligner).bottom-50;if(t>i){BX.addClass(this.smallCardNodes.panel,"active")}else if(BX.hasClass(this.smallCardNodes.panel,"active")){BX.removeClass(this.smallCardNodes.panel,"active")}}if(this.obTabsPanel){i=BX.pos(this.obTabs).top;if(t+73>i){BX.addClass(this.obTabsPanel,"active")}else if(BX.hasClass(this.obTabsPanel,"active")){BX.removeClass(this.obTabsPanel,"active")}}},changeTab:function(i){BX.PreventDefault(i);var s=BX.proxy_context&&BX.proxy_context.getAttribute("data-value"),e,a,r;if(!BX.hasClass(BX.proxy_context,"active")&&s){e=this.getEntities(this.obTabContainers,"tab-container");for(var o in e){if(e.hasOwnProperty(o)&&BX.type.isDomNode(e[o])){if(e[o].getAttribute("data-value")===s){BX.show(e[o])}else{BX.hide(e[o])}}}a=this.getEntities(this.obTabs,"tab");r=this.getEntities(this.obTabsPanel,"tab");for(o in a){if(a.hasOwnProperty(o)&&BX.type.isDomNode(a[o])){if(a[o].getAttribute("data-value")===s){BX.addClass(a[o],"active");BX.addClass(r[o],"active")}else{BX.removeClass(a[o],"active");BX.removeClass(r[o],"active")}}}}var n=BX.GetWindowScrollPos().scrollTop,h=BX.pos(this.obTabContainers).top;if(n+150>h){new BX.easing({duration:500,start:{scroll:n},finish:{scroll:h-150},transition:BX.easing.makeEaseOut(BX.easing.transitions.quint),step:BX.delegate(function(i){t.scrollTo(0,i.scroll)},this)}).animate()}},initPopup:function(){if(this.config.usePopup){this.node.imageContainer.style.cursor="zoom-in";BX.bind(this.node.imageContainer,"click",BX.delegate(this.toggleMainPictPopup,this));BX.bind(document,"keyup",BX.proxy(this.closeByEscape,this));BX.bind(this.getEntity(this.obBigSlider,"close-popup"),"click",BX.proxy(this.hideMainPictPopup,this))}},checkSliderControls:function(t){var i=t>1?"":"none";this.node.sliderControlLeft&&(this.node.sliderControlLeft.style.display=i);this.node.sliderControlRight&&(this.node.sliderControlRight.style.display=i)},setCurrentImg:function(t,i,s){var e,a;this.currentImg.id=t.ID;this.currentImg.src=t.SRC;this.currentImg.width=t.WIDTH;this.currentImg.height=t.HEIGHT;if(i&&this.node.imageContainer){e=this.getEntities(this.node.imageContainer,"image");a=e.length;while(a--){if(e[a].getAttribute("data-id")==t.ID){if(!BX.hasClass(e[a],"active")){this.node.sliderProgressBar&&this.resetProgress()}BX.addClass(e[a],"active")}else if(BX.hasClass(e[a],"active")){BX.removeClass(e[a],"active")}}}if(s&&this.smallCardNodes.picture){this.smallCardNodes.picture.setAttribute("src",this.currentImg.src)}if(this.config.useMagnifier&&!this.isTouchDevice){this.setMagnifierParams();if(i){this.disableMagnifier(true)}}},setMagnifierParams:function(){var t=this.getEntities(this.node.imageContainer,"image"),i=t.length,s;while(i--){s=t[i].querySelector("img");s.setAttribute("data-title",s.getAttribute("title")||"");s.removeAttribute("title");if(t[i].getAttribute("data-id")==this.currentImg.id){BX.unbind(this.currentImg.node,"mouseover",BX.proxy(this.enableMagnifier,this));this.currentImg.node=s;this.currentImg.node.style.backgroundImage="url('"+this.currentImg.src+"')";this.currentImg.node.style.backgroundSize="100% auto";BX.bind(this.currentImg.node,"mouseover",BX.proxy(this.enableMagnifier,this))}}},enableMagnifier:function(){BX.bind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this))},disableMagnifier:function(t){if(!this.magnify.enabled)return;clearTimeout(this.magnify.timer);BX.removeClass(this.obBigSlider,"magnified");this.magnify.enabled=false;this.currentImg.node.style.backgroundSize="100% auto";if(t){this.currentImg.node.style.height=this.magnify.height+"px";this.currentImg.node.style.width=this.magnify.width+"px";this.magnify.timer=setTimeout(BX.delegate(function(){this.currentImg.node.src=this.currentImg.src;this.currentImg.node.style.height="";this.currentImg.node.style.width=""},this),250)}else{this.currentImg.node.src=this.currentImg.src;this.currentImg.node.style.height="";this.currentImg.node.style.width=""}BX.unbind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this))},moveMagnifierArea:function(t){var i=BX.pos(this.currentImg.node),s=this.inRect(t,i);if(this.inBound(i,s)){var e=s.X/this.currentImg.node.width*100,a=s.Y/this.currentImg.node.height*100,r,o,n,h,l;this.currentImg.node.style.backgroundPosition=e+"% "+a+"%";if(!this.magnify.enabled){clearTimeout(this.magnify.timer);BX.addClass(this.obBigSlider,"magnified");this.currentImg.node.style.height=(this.magnify.height=this.currentImg.node.clientHeight)+"px";this.currentImg.node.style.width=(this.magnify.width=this.currentImg.node.offsetWidth)+"px";r=this.currentImg.width/this.currentImg.height;o=this.obBigSlider.offsetWidth;if(o>this.currentImg.width&&!BX.hasClass(this.obBigSlider,"popup")){n=o;h=n/r;l=100}else{n=this.currentImg.width;h=this.currentImg.height;l=this.config.magnifierZoomPercent>100?this.config.magnifierZoomPercent:100}this.currentImg.node.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQI12P4zwAAAgEBAKrChTYAAAAASUVORK5CYII=";this.currentImg.node.style.backgroundSize=l+"% auto";this.magnify.timer=setTimeout(BX.delegate(function(){this.currentImg.node.style.height=h+"px";this.currentImg.node.style.width=n+"px"},this),10)}this.magnify.enabled=true}else{this.disableMagnifier(true)}},inBound:function(t,i){return i.Y>=0&&t.height>=i.Y&&(i.X>=0&&t.width>=i.X)},inRect:function(t,i){var s=BX.GetWindowSize(),e={X:0,Y:0,globalX:0,globalY:0};e.globalX=t.clientX+s.scrollLeft;if(t.offsetX&&t.offsetX<0){e.globalX-=t.offsetX}e.X=e.globalX-i.left;e.globalY=t.clientY+s.scrollTop;if(t.offsetY&&t.offsetY<0){e.globalY-=t.offsetY}e.Y=e.globalY-i.top;return e},setProductMainPict:function(t){var i=-1,s=0,e=0,a="";if(this.product.sliderCount){for(e=0;e<this.product.sliderPict.length;e++){if(t===this.product.sliderPict[e].ID){i=e;break}}if(i>-1){if(this.product.sliderPict[i]){this.setCurrentImg(this.product.sliderPict[i],true)}for(s=0;s<this.product.slider.ITEMS.length;s++){a=this.product.slider.ITEMS[s].getAttribute("data-value");if(a===t){BX.addClass(this.product.slider.ITEMS[s],"active")}else if(BX.hasClass(this.product.slider.ITEMS[s],"active")){BX.removeClass(this.product.slider.ITEMS[s],"active")}}}}},onSliderControlHover:function(){var t=BX.proxy_context;this.mouseTimer=setTimeout(BX.delegate(function(){this.selectSliderImg(t)},this),2)},onSliderControlLeave:function(){clearTimeout(this.mouseTimer);this.mouseTimer=null},selectSliderImg:function(t){var i="",s=[];t=BX.type.isDomNode(t)?t:BX.proxy_context;if(t&&t.hasAttribute("data-value")){i=t.getAttribute("data-value");if(i.indexOf("_")!==-1){s=i.split("_");this.setMainPict(s[0],s[1])}else{this.setProductMainPict(i)}}},setMainPict:function(t,i,s){var e=-1,a=-1,r,o,n="",h="";for(r=0;r<this.offers.length;r++){if(t===this.offers[r].ID){e=r;break}}if(e>-1){if(this.offers[e].SLIDER_COUNT>0){for(o=0;o<this.offers[e].SLIDER.length;o++){if(i===this.offers[e].SLIDER[o].ID){a=o;break}}if(a>-1){if(this.offers[e].SLIDER[a]){this.setCurrentImg(this.offers[e].SLIDER[a],true,s)}h=t+"_"+i;for(r=0;r<this.product.slider.ITEMS.length;r++){n=this.product.slider.ITEMS[r].getAttribute("data-value");if(n===h){BX.addClass(this.product.slider.ITEMS[r],"active")}else if(BX.hasClass(this.product.slider.ITEMS[r],"active")){BX.removeClass(this.product.slider.ITEMS[r],"active")}}}}}},setMainPictFromItem:function(t){if(this.node.imageContainer){var i=false,s={};if(this.offers[t]){if(this.offers[t].DETAIL_PICTURE){s=this.offers[t].DETAIL_PICTURE;i=true}else if(this.offers[t].PREVIEW_PICTURE){s=this.offers[t].PREVIEW_PICTURE;i=true}}if(!i){if(this.defaultPict.detail){s=this.defaultPict.detail;i=true}else if(this.defaultPict.preview){s=this.defaultPict.preview;i=true}}if(i){this.setCurrentImg(s,true,true)}}},toggleMainPictPopup:function(){if(BX.hasClass(this.obBigSlider,"popup")){this.hideMainPictPopup()}else{this.showMainPictPopup()}},showMainPictPopup:function(){this.config.useMagnifier&&this.disableMagnifier(false);BX.addClass(this.obBigSlider,"popup");this.node.imageContainer.style.cursor="";document.body.style.overflow="hidden"},hideMainPictPopup:function(){this.config.useMagnifier&&this.disableMagnifier(false);BX.removeClass(this.obBigSlider,"popup");this.node.imageContainer.style.cursor="zoom-in";document.body.style.overflow=""},closeByEscape:function(i){i=i||t.event;if(i.keyCode==27){this.hideMainPictPopup()}},startQuantityInterval:function(){var t=BX.proxy_context;var i=t.id===this.visual.QUANTITY_DOWN_ID?BX.proxy(this.quantityDown,this):BX.proxy(this.quantityUp,this);this.quantityDelay=setTimeout(BX.delegate(function(){this.quantityTimer=setInterval(i,150)},this),300)},clearQuantityInterval:function(){clearTimeout(this.quantityDelay);clearInterval(this.quantityTimer)},quantityUp:function(){var t=0,i=true;if(this.errorCode===0&&this.config.showQuantity&&this.canBuy&&!this.isGift){t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10);if(!isNaN(t)){t+=this.stepQuantity;t=this.checkQuantityRange(t,"up");if(this.checkQuantity&&t>this.maxQuantity){i=false}if(i){if(this.isDblQuantity){t=Math.round(t*this.precisionFactor)/this.precisionFactor}this.obQuantity.value=t;this.obQuantityCounter.innerText=t;this.setPrice()}}}},quantityDown:function(){var t=0,i=true;if(this.errorCode===0&&this.config.showQuantity&&this.canBuy&&!this.isGift){t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10);if(!isNaN(t)){t-=this.stepQuantity;t=this.checkQuantityRange(t,"down");if(t<this.minQuantity){i=false}if(i){if(this.isDblQuantity){t=Math.round(t*this.precisionFactor)/this.precisionFactor}this.obQuantity.value=t;this.obQuantityCounter.innerText=t;this.setPrice()}}}},quantityChange:function(){var t=0,i;if(this.errorCode===0&&this.config.showQuantity){if(this.canBuy){t=this.isDblQuantity?parseFloat(this.obQuantity.value):Math.round(this.obQuantity.value);if(!isNaN(t)){t=this.checkQuantityRange(t);if(this.checkQuantity){if(t>this.maxQuantity){t=this.maxQuantity}}this.checkPriceRange(t);i=Math.floor(Math.round(t*this.precisionFactor/this.stepQuantity)/this.precisionFactor)||1;t=i<=1?this.stepQuantity:i*this.stepQuantity;t=Math.round(t*this.precisionFactor)/this.precisionFactor;if(t<this.minQuantity){t=this.minQuantity}this.obQuantity.value=t;this.obQuantityCounter.innerText=t}else{this.obQuantity.value=this.minQuantity;this.obQuantityCounter.innerText=this.minQuantity}}else{this.obQuantity.value=this.minQuantity;this.obQuantityCounter.innerText=this.minQuantity}this.setPrice()}},quantityInput:function(){var t=0,i;if(this.errorCode===0&&this.config.showQuantity){if(this.canBuy){t=this.isDblQuantity?parseFloat(this.obQuantity.value):Math.round(this.obQuantity.value);if(!isNaN(t)){t=this.checkQuantityRange(t);if(this.checkQuantity){if(t>this.maxQuantity){t=this.maxQuantity}}this.checkPriceRange(t);i=Math.floor(Math.round(t*this.precisionFactor/this.stepQuantity)/this.precisionFactor)||1;t=i<=1?this.stepQuantity:i*this.stepQuantity;t=Math.round(t*this.precisionFactor)/this.precisionFactor;if(t<this.minQuantity){t=this.minQuantity}this.obQuantityCounter.innerText=t}}}},quantitySet:function(t){var i,s;var e=this.offers[t],a=this.offers[this.offerNum];if(this.errorCode===0){this.canBuy=e.CAN_BUY;this.currentPriceMode=e.ITEM_PRICE_MODE;this.currentPrices=e.ITEM_PRICES;this.currentPriceSelected=e.ITEM_PRICE_SELECTED;this.currentQuantityRanges=e.ITEM_QUANTITY_RANGES;this.currentQuantityRangeSelected=e.ITEM_QUANTITY_RANGE_SELECTED;if(this.canBuy){this.node.quantity&&BX.style(this.node.quantity,"display","");this.obBasketActions&&BX.style(this.obBasketActions,"display","");this.smallCardNodes.buyButton&&BX.style(this.smallCardNodes.buyButton,"display","");this.smallCardNodes.addButton&&BX.style(this.smallCardNodes.addButton,"display","");this.obNotAvail&&BX.style(this.obNotAvail,"display","none");this.smallCardNodes.notAvailableButton&&BX.style(this.smallCardNodes.notAvailableButton,"display","none");this.obSubscribe&&BX.style(this.obSubscribe,"display","none")}else{this.node.quantity&&BX.style(this.node.quantity,"display","none");this.obBasketActions&&BX.style(this.obBasketActions,"display","none");this.smallCardNodes.buyButton&&BX.style(this.smallCardNodes.buyButton,"display","none");this.smallCardNodes.addButton&&BX.style(this.smallCardNodes.addButton,"display","none");this.obNotAvail&&BX.style(this.obNotAvail,"display","");this.smallCardNodes.notAvailableButton&&BX.style(this.smallCardNodes.notAvailableButton,"display","");if(this.obSubscribe){if(e.CATALOG_SUBSCRIBE==="Y"){BX.style(this.obSubscribe,"display","");this.obSubscribe.setAttribute("data-item",e.ID);BX(this.visual.SUBSCRIBE_LINK+"_hidden").click()}else{BX.style(this.obSubscribe,"display","none")}}}this.isDblQuantity=e.QUANTITY_FLOAT;this.checkQuantity=e.CHECK_QUANTITY;if(this.isDblQuantity){this.stepQuantity=Math.round(parseFloat(e.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor;this.maxQuantity=parseFloat(e.MAX_QUANTITY);this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity}else{this.stepQuantity=parseInt(e.STEP_QUANTITY,10);this.maxQuantity=parseInt(e.MAX_QUANTITY,10);this.minQuantity=this.currentPriceMode==="Q"?parseInt(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity}if(this.config.showQuantity){var r=a.ITEM_PRICES.length&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED]&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED].MIN_QUANTITY!=this.minQuantity;if(this.isDblQuantity){s=Math.round(parseFloat(a.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor!==this.stepQuantity||r||a.MEASURE!==e.MEASURE||this.checkQuantity&&parseFloat(a.MAX_QUANTITY)>this.maxQuantity&&parseFloat(this.obQuantity.value)>this.maxQuantity}else{s=parseInt(a.STEP_QUANTITY,10)!==this.stepQuantity||r||a.MEASURE!==e.MEASURE||this.checkQuantity&&parseInt(a.MAX_QUANTITY,10)>this.maxQuantity&&parseInt(this.obQuantity.value,10)>this.maxQuantity}this.obQuantity.disabled=!this.canBuy;if(s){this.obQuantity.value=this.minQuantity;this.obQuantityCounter.innerText=this.minQuantity}if(this.obMeasure){if(e.MEASURE){BX.adjust(this.obMeasure,{html:e.MEASURE})}else{BX.adjust(this.obMeasure,{html:""})}}}if(this.obQuantityLimit.all){if(!this.checkQuantity||this.maxQuantity==0){BX.adjust(this.obQuantityLimit.value,{html:""});BX.adjust(this.obQuantityLimit.all,{style:{display:"none"}})}else{if(this.config.showMaxQuantity==="M"){i=this.maxQuantity/this.stepQuantity>=this.config.relativeQuantityFactor?BX.message("RELATIVE_QUANTITY_MANY"):BX.message("RELATIVE_QUANTITY_FEW")}else{i=this.maxQuantity;if(e.MEASURE){i+=" "+e.MEASURE}}BX.adjust(this.obQuantityLimit.value,{html:i});BX.adjust(this.obQuantityLimit.all,{style:{display:""}})}}if(this.config.usePriceRanges&&this.obPriceRanges){if(this.currentPriceMode==="Q"&&e.PRICE_RANGES_HTML){var o=this.getEntity(this.obPriceRanges,"price-ranges-body"),n=this.getEntity(this.obPriceRanges,"price-ranges-ratio-header");if(o){o.innerHTML=e.PRICE_RANGES_HTML}if(n){n.innerHTML=e.PRICE_RANGES_RATIO_HTML}this.obPriceRanges.style.display=""}else{this.obPriceRanges.style.display="none"}}}},selectOfferProp:function(){var t=0,i="",s=[],e=null,a=BX.proxy_context,r;if(a&&a.hasAttribute("data-treevalue")){if(BX.hasClass(a,"selected"))return;if(typeof document.activeElement==="object"){document.activeElement.blur()}i=a.getAttribute("data-treevalue");s=i.split("_");this.searchOfferPropIndex(s[0],s[1]);e=BX.findChildren(a.parentNode,{tagName:"li"},false);if(e&&e.length){for(t=0;t<e.length;t++){BX.removeClass(e[t],"selected")}}BX.addClass(a,"selected");if(this.smallCardNodes.panel){r=this.smallCardNodes.panel.querySelector('[data-treevalue="'+i+'"]');if(r){e=this.smallCardNodes.panel.querySelectorAll('[data-sku-line="'+r.getAttribute("data-sku-line")+'"]');for(t=0;t<e.length;t++){e[t].style.display="none"}r.style.display=""}}if(this.isFacebookConversionCustomizeProductEventEnabled&&BX.Type.isArrayFilled(this.offers)&&BX.Type.isObject(this.offers[this.offerNum])){BX.ajax.runAction("sale.facebookconversion.customizeProduct",{data:{offerId:this.offers[this.offerNum]["ID"]}})}}},searchOfferPropIndex:function(t,i){var s="",e=false,a=[],r=[],o=-1,n,h,l={},u=[];for(n=0;n<this.treeProps.length;n++){if(this.treeProps[n].ID===t){o=n;break}}if(o>-1){for(n=0;n<o;n++){s="PROP_"+this.treeProps[n].ID;l[s]=this.selectedValues[s]}s="PROP_"+this.treeProps[o].ID;l[s]=i;for(n=o+1;n<this.treeProps.length;n++){s="PROP_"+this.treeProps[n].ID;e=this.getRowValues(l,s);if(!e)break;r=[];if(this.config.showAbsent){a=[];u=[];u=BX.clone(l,true);for(h=0;h<e.length;h++){u[s]=e[h];r[r.length]=e[h];if(this.getCanBuy(u))a[a.length]=e[h]}}else{a=e}if(this.selectedValues[s]&&BX.util.in_array(this.selectedValues[s],a)){l[s]=this.selectedValues[s]}else{if(this.config.showAbsent){l[s]=a.length?a[0]:r[0]}else{l[s]=a[0]}}this.updateRow(n,l[s],e,a)}this.selectedValues=l;this.changeInfo()}},updateRow:function(t,i,s,e){var a=0,r="",o=false,n=null;var h=this.getEntities(this.obTree,"sku-line-block");if(t>-1&&t<h.length){n=h[t].querySelectorAll("li");for(a=0;a<n.length;a++){r=n[a].getAttribute("data-onevalue");o=r===i;if(o){BX.addClass(n[a],"selected")}else{BX.removeClass(n[a],"selected")}if(BX.util.in_array(r,e)){BX.removeClass(n[a],"notallowed")}else{BX.addClass(n[a],"notallowed")}n[a].style.display=BX.util.in_array(r,s)?"":"none";if(o){h[t].style.display=r==0&&e.length==1?"none":""}}if(this.smallCardNodes.panel){n=this.smallCardNodes.panel.querySelectorAll('[data-sku-line="'+t+'"]');for(a=0;a<n.length;a++){r=n[a].getAttribute("data-onevalue");o=r===i;if(o){n[a].style.display=""}else{n[a].style.display="none"}if(BX.util.in_array(r,e)){BX.removeClass(n[a],"notallowed")}else{BX.addClass(n[a],"notallowed")}if(o){n[a].style.display=r==0&&e.length==1?"none":""}}}}},getRowValues:function(t,i){var s=[],e=0,a=0,r=false,o=true;if(t.length===0){for(e=0;e<this.offers.length;e++){if(!BX.util.in_array(this.offers[e].TREE[i],s)){s[s.length]=this.offers[e].TREE[i]}}r=true}else{for(e=0;e<this.offers.length;e++){o=true;for(a in t){if(t[a]!==this.offers[e].TREE[a]){o=false;break}}if(o){if(!BX.util.in_array(this.offers[e].TREE[i],s)){s[s.length]=this.offers[e].TREE[i]}r=true}}}return r?s:false},getCanBuy:function(t){var i,s=0,e=true,a=false;for(i=0;i<this.offers.length;i++){e=true;for(s in t){if(t[s]!==this.offers[i].TREE[s]){e=false;break}}if(e){if(this.offers[i].CAN_BUY){a=true;break}}}return a},setCurrent:function(){var t,i=0,s="",e=false,a=[],r={},o=[],n=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length;t++){s="PROP_"+this.treeProps[t].ID;e=this.getRowValues(r,s);if(!e)break;if(BX.util.in_array(n[s],e)){r[s]=n[s]}else{r[s]=e[0];this.offerNum=0}if(this.config.showAbsent){a=[];o=[];o=BX.clone(r,true);for(i=0;i<e.length;i++){o[s]=e[i];if(this.getCanBuy(o)){a[a.length]=e[i]}}}else{a=e}this.updateRow(t,r[s],e,a)}this.selectedValues=r;this.changeInfo()},changeInfo:function(){var t=-1,i=0,s=true,e={currentId:this.offerNum>-1?this.offers[this.offerNum].ID:0,newId:0};var a,r;for(a=0;a<this.offers.length;a++){s=true;for(i in this.selectedValues){if(this.selectedValues[i]!==this.offers[a].TREE[i]){s=false;break}}if(s){t=a;break}}if(t>-1){if(t!=this.offerNum){this.isGift=false}this.drawImages(this.offers[t].SLIDER);this.checkSliderControls(this.offers[t].SLIDER_COUNT);for(a=0;a<this.offers.length;a++){if(this.config.showOfferGroup&&this.offers[a].OFFER_GROUP){if(r=BX(this.visual.OFFER_GROUP+this.offers[a].ID)){r.style.display=a==t?"":"none"}}if(this.slider.controls[a].ID){if(a===t){this.product.slider=this.slider.controls[a];if(this.slider.controls[a].CONT){this.slider.controls[a].CONT.style.display="";this.slider.controls[a].CONT&&BX.addClass(this.slider.controls[a].CONT,"selected")}if(this.slider.pager[a].CONT){this.slider.pager[a].CONT.style.display="";this.slider.pager[a].CONT&&BX.addClass(this.slider.pager[a].CONT,"selected")}}else{if(this.slider.controls[a].CONT){this.slider.controls[a].CONT&&BX.removeClass(this.slider.controls[a].CONT,"selected");this.slider.controls[a].CONT&&BX.hide(this.slider.controls[a].CONT)}if(this.slider.pager[a].CONT){this.slider.pager[a].CONT&&BX.removeClass(this.slider.pager[a].CONT,"selected");this.slider.pager[a].CONT&&BX.hide(this.slider.pager[a].CONT)}}}else if(a===t){this.product.slider={}}}if(this.offers[t].SLIDER_COUNT>0){this.setMainPict(this.offers[t].ID,this.offers[t].SLIDER[0].ID,true)}else{this.setMainPictFromItem(t)}if(this.offers[t].SLIDER_COUNT>1){this.initSlider()}else{this.stopSlider()}if(this.obDescription&&this.config.showSkuDescription==="Y"){this.changeSkuDescription(t)}if(this.config.showSkuProps){if(this.obSkuProps){if(!this.offers[t].DISPLAY_PROPERTIES){BX.adjust(this.obSkuProps,{style:{display:"none"},html:""})}else{BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[t].DISPLAY_PROPERTIES})}}if(this.obMainSkuProps){if(!this.offers[t].DISPLAY_PROPERTIES_MAIN_BLOCK){BX.adjust(this.obMainSkuProps,{style:{display:"none"},html:""})}else{BX.adjust(this.obMainSkuProps,{style:{display:""},html:this.offers[t].DISPLAY_PROPERTIES_MAIN_BLOCK})}}}this.quantitySet(t);this.setPrice();this.setCompared(this.offers[t].COMPARED);this.offerNum=t;this.fixFontCheck();this.setAnalyticsDataLayer("showDetail");this.incViewedCounter();e.newId=this.offers[this.offerNum].ID;BX.onCustomEvent("onCatalogStoreProductChange",[this.offers[this.offerNum].ID]);BX.onCustomEvent("onCatalogElementChangeOffer",[e]);e=null}},changeSkuDescription:function(t){var i="";var s="";var e="";if(this.offers[t].DETAIL_TEXT!==""){i=this.offers[t].DETAIL_TEXT_TYPE==="html"?this.offers[t].DETAIL_TEXT:"<p>"+this.offers[t].DETAIL_TEXT+"</p>"}else if(this.product.detailText!==""){i=this.product.detailTextType==="html"?this.product.detailText:"<p>"+this.product.detailText+"</p>"}if(this.offers[t].PREVIEW_TEXT!==""){s=this.offers[t].PREVIEW_TEXT_TYPE==="html"?this.offers[t].PREVIEW_TEXT:"<p>"+this.offers[t].PREVIEW_TEXT+"</p>"}else if(this.product.previewText!==""){s=this.product.previewTextType==="html"?this.product.previewText:"<p>"+this.product.previewText+"</p>"}if(s!==""&&(this.config.displayPreviewTextMode==="S"||this.config.displayPreviewTextMode==="E"&&i)){e+=s}if(i!==""){e+=i}BX.adjust(this.obDescription,{html:e})},drawImages:function(t){if(!this.node.imageContainer)return;var i,s,e=this.getEntities(this.node.imageContainer,"image");for(i in e){if(e.hasOwnProperty(i)&&BX.type.isDomNode(e[i])){BX.remove(e[i])}}for(i=0;i<t.length;i++){s=BX.create("IMG",{props:{src:t[i].SRC,alt:this.config.alt,title:this.config.title}});if(i==0){s.setAttribute("itemprop","image")}this.node.imageContainer.appendChild(BX.create("DIV",{attrs:{"data-entity":"image","data-id":t[i].ID},props:{className:"product-detail-slider-image"+(i==0?" active":"")},children:[s,BX.create("div",{props:{className:"product-detail-slider-image-overlay"},style:{backgroundImage:"url("+t[i].SRC+")"}})]}))}},restoreSticker:function(){if(this.previousStickerText){this.redrawSticker({text:this.previousStickerText})}else{this.hideSticker()}},hideSticker:function(){BX.hide(BX(this.visual.STICKER_ID))},redrawSticker:function(t){t=t||{};var i=t.text||"";var s=BX(this.visual.STICKER_ID);if(!s)return;BX.show(s);var e=s.getAttribute("title");if(e&&e!=i){this.previousStickerText=e}BX.adjust(s,{text:i,attrs:{title:i}})},checkQuantityRange:function(t,i){if(typeof t==="undefined"||this.currentPriceMode!=="Q"){return t}t=parseFloat(t);var s=t;var e,a,r,o,n,h;for(var l in this.currentQuantityRanges){if(this.currentQuantityRanges.hasOwnProperty(l)){e=this.currentQuantityRanges[l];if(parseFloat(t)>=parseFloat(e.SORT_FROM)&&(e.SORT_TO==="INF"||parseFloat(t)<=parseFloat(e.SORT_TO))){s=t;break}else{a=parseFloat(e.SORT_FROM)-t;r=Math.abs(a);o=parseFloat(e.SORT_TO)-t;n=Math.abs(o);if(h===undefined||h>r){if(i===undefined||i==="up"&&a>0||i==="down"&&a<0){h=r;s=parseFloat(e.SORT_FROM)}}if(h===undefined||h>n){if(i===undefined||i==="up"&&a>0||i==="down"&&a<0){h=n;s=parseFloat(e.SORT_TO)}}}}}return s},checkPriceRange:function(t){if(typeof t==="undefined"||this.currentPriceMode!=="Q"){return}var i,s=false;for(var e in this.currentQuantityRanges){if(this.currentQuantityRanges.hasOwnProperty(e)){i=this.currentQuantityRanges[e];if(parseFloat(t)>=parseFloat(i.SORT_FROM)&&(i.SORT_TO==="INF"||parseFloat(t)<=parseFloat(i.SORT_TO))){s=true;this.currentQuantityRangeSelected=i.HASH;break}}}if(!s&&(i=this.getMinPriceRange())){this.currentQuantityRangeSelected=i.HASH}for(var a in this.currentPrices){if(this.currentPrices.hasOwnProperty(a)){if(this.currentPrices[a].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=a;break}}}},getMinPriceRange:function(){var t;for(var i in this.currentQuantityRanges){if(this.currentQuantityRanges.hasOwnProperty(i)){if(!t||parseInt(this.currentQuantityRanges[i].SORT_FROM)<parseInt(t.SORT_FROM)){t=this.currentQuantityRanges[i]}}}return t},checkQuantityControls:function(){if(!this.obQuantity)return;var t=this.checkQuantity&&parseFloat(this.obQuantity.value)+this.stepQuantity>this.maxQuantity,i=parseFloat(this.obQuantity.value)-this.stepQuantity<this.minQuantity;if(t){BX.addClass(this.obQuantityUp,"product-item-amount-field-btn-disabled")}else if(BX.hasClass(this.obQuantityUp,"product-item-amount-field-btn-disabled")){BX.removeClass(this.obQuantityUp,"product-item-amount-field-btn-disabled")}if(i){BX.addClass(this.obQuantityDown,"product-item-amount-field-btn-disabled")}else if(BX.hasClass(this.obQuantityDown,"product-item-amount-field-btn-disabled")){BX.removeClass(this.obQuantityDown,"product-item-amount-field-btn-disabled")}if(t&&i){this.obQuantity.setAttribute("disabled","disabled")}else{this.obQuantity.removeAttribute("disabled")}},setPrice:function(){var t="",i;if(this.obQuantity){this.checkPriceRange(this.obQuantity.value)}this.checkQuantityControls();i=this.currentPrices[this.currentPriceSelected];if(this.isGift){i.PRICE=0;i.DISCOUNT=i.BASE_PRICE;i.PERCENT=100}if(this.obPrice.price){if(i){BX.adjust(this.obPrice.price,{html:BX.Currency.currencyFormat(i.RATIO_PRICE,i.CURRENCY,true)});this.smallCardNodes.price&&BX.adjust(this.smallCardNodes.price,{html:BX.Currency.currencyFormat(i.RATIO_PRICE,i.CURRENCY,true)})}else{BX.adjust(this.obPrice.price,{html:""});this.smallCardNodes.price&&BX.adjust(this.smallCardNodes.price,{html:""})}if(i&&i.RATIO_PRICE!==i.RATIO_BASE_PRICE){if(this.config.showOldPrice){this.obPrice.full&&BX.adjust(this.obPrice.full,{style:{display:""},html:BX.Currency.currencyFormat(i.RATIO_BASE_PRICE,i.CURRENCY,true)});this.smallCardNodes.oldPrice&&BX.adjust(this.smallCardNodes.oldPrice,{style:{display:""},html:BX.Currency.currencyFormat(i.RATIO_BASE_PRICE,i.CURRENCY,true)});if(this.obPrice.blockOldPrice){if(this.obPrice.discount){t=BX.message("ECONOMY_INFO_MESSAGE");t=t.replace("#ECONOMY#",BX.Currency.currencyFormat(i.RATIO_DISCOUNT,i.CURRENCY,true));BX.adjust(this.obPrice.discount,{html:t})}BX.adjust(this.obPrice.blockOldPrice,{style:{display:""}})}}if(this.config.showPercent){this.obPrice.percent&&BX.adjust(this.obPrice.percent,{style:{display:""},html:-i.PERCENT+"%"})}}else{if(this.config.showOldPrice){this.obPrice.full&&BX.adjust(this.obPrice.full,{style:{display:"none"},html:""});this.smallCardNodes.oldPrice&&BX.adjust(this.smallCardNodes.oldPrice,{style:{display:"none"},html:""});if(this.obPrice.blockOldPrice){if(this.obPrice.discount){BX.adjust(this.obPrice.discount,{html:""})}BX.adjust(this.obPrice.blockOldPrice,{style:{display:"none"}})}}if(this.config.showPercent){this.obPrice.percent&&BX.adjust(this.obPrice.percent,{style:{display:"none"},html:""})}}if(this.obPrice.total){if(i&&this.obQuantity&&this.obQuantity.value!=this.stepQuantity){if(this.obMeasureContainer){BX.adjust(this.obMeasureContainer,{style:{"text-align":"right",left:"auto"}})}BX.adjust(this.obPrice.total,{html:BX.message("PRICE_TOTAL_PREFIX")+" <span>"+BX.Currency.currencyFormat(i.PRICE*this.obQuantity.value,i.CURRENCY,true)+"</span>",style:{display:""}})}else{BX.adjust(this.obPrice.total,{html:"",style:{display:"none"}});if(this.obMeasureContainer){BX.adjust(this.obMeasureContainer,{style:{"text-align":"",left:0}})}}}}},compare:function(t){var i=this.obCompare.querySelector('[data-entity="compare-checkbox"]'),s=BX.getEventTarget(t),e=true;if(i){e=s===i?i.checked:!i.checked}var a=e?this.compareData.compareUrl:this.compareData.compareDeleteUrl,r;if(a){if(s!==i){BX.PreventDefault(t);this.setCompared(e)}switch(this.productType){case 0:case 1:case 2:r=a.replace("#ID#",this.product.id.toString());break;case 3:r=a.replace("#ID#",this.offers[this.offerNum].ID);break}BX.ajax({method:"POST",dataType:e?"json":"html",url:r+(r.indexOf("?")!==-1?"&":"?")+"ajax_action=Y",onsuccess:e?BX.proxy(this.compareResult,this):BX.proxy(this.compareDeleteResult,this)})}},compareResult:function(t){var s,e;if(this.obPopupWin){this.obPopupWin.close()}if(!BX.type.isPlainObject(t))return;this.initPopupWindow();if(this.offers.length>0){this.offers[this.offerNum].COMPARED=t.STATUS==="OK"}if(t.STATUS==="OK"){BX.onCustomEvent("OnCompareChange");s='<div style="width: 100%; margin: 0; text-align: center;"><p>'+BX.message("COMPARE_MESSAGE_OK")+"</p></div>";if(this.config.showClosePopup){e=[new i({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)},style:{marginRight:"10px"}}),new i({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}else{e=[new i({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)}})]}}else{s='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("COMPARE_UNKNOWN_ERROR"))+"</p></div>";e=[new i({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}this.obPopupWin.setTitleBar(BX.message("COMPARE_TITLE"));this.obPopupWin.setContent(s);this.obPopupWin.setButtons(e);this.obPopupWin.show()},compareDeleteResult:function(){BX.onCustomEvent("OnCompareChange");if(this.offers&&this.offers.length){this.offers[this.offerNum].COMPARED=false}},setCompared:function(t){if(!this.obCompare)return;var i=this.getEntity(this.obCompare,"compare-checkbox");if(i){i.checked=t}},setCompareInfo:function(t){if(!BX.type.isArray(t))return;for(var i in this.offers){if(this.offers.hasOwnProperty(i)){this.offers[i].COMPARED=BX.util.in_array(this.offers[i].ID,t)}}},compareRedirect:function(){if(this.compareData.comparePath){location.href=this.compareData.comparePath}else{this.obPopupWin.close()}},checkDeletedCompare:function(t){switch(this.productType){case 0:case 1:case 2:if(this.product.id==t){this.setCompared(false)}break;case 3:var i=this.offers.length;while(i--){if(this.offers[i].ID==t){this.offers[i].COMPARED=false;if(this.offerNum==i){this.setCompared(false)}break}}}},initBasketUrl:function(){this.basketUrl=this.basketMode==="ADD"?this.basketData.add_url:this.basketData.buy_url;switch(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);break}this.basketParams={ajax_basket:"Y"};if(this.config.showQuantity){this.basketParams[this.basketData.quantity]=this.obQuantity.value}if(this.basketData.sku_props){this.basketParams[this.basketData.sku_props_var]=this.basketData.sku_props}},fillBasketProps:function(){if(!this.visual.BASKET_PROP_DIV)return;var t=0,i=null,s=false,e=null;if(this.basketData.useProps&&!this.basketData.emptyProps){if(this.obPopupWin&&this.obPopupWin.contentContainer){e=this.obPopupWin.contentContainer}}else{e=BX(this.visual.BASKET_PROP_DIV)}if(e){i=e.getElementsByTagName("select");if(i&&i.length){for(t=0;t<i.length;t++){if(!i[t].disabled){switch(i[t].type.toLowerCase()){case"select-one":this.basketParams[i[t].name]=i[t].value;s=true;break;default:break}}}}i=e.getElementsByTagName("input");if(i&&i.length){for(t=0;t<i.length;t++){if(!i[t].disabled){switch(i[t].type.toLowerCase()){case"hidden":this.basketParams[i[t].name]=i[t].value;s=true;break;case"radio":if(i[t].checked){this.basketParams[i[t].name]=i[t].value;s=true}break;default:break}}}}}if(!s){this.basketParams[this.basketData.props]=[];this.basketParams[this.basketData.props][0]=0}},sendToBasket:function(){if(!this.canBuy)return;this.initBasketUrl();this.fillBasketProps();BX.ajax({method:"POST",dataType:"json",url:this.basketUrl,data:this.basketParams,onsuccess:BX.proxy(this.basketResult,this)})},add2Basket:function(){this.basketMode="ADD";this.basket()},buyBasket:function(){console.log(this.obBuyBtn);BX.addClass(this.obBuyBtn,"btn-wait");this.basketMode="BUY";this.basket()},basket:function(){var t="";if(!this.canBuy)return;switch(this.productType){case 1:case 2:if(this.basketData.useProps&&!this.basketData.emptyProps){this.initPopupWindow();this.obPopupWin.setTitleBar(BX.message("TITLE_BASKET_PROPS"));if(BX(this.visual.BASKET_PROP_DIV)){t=BX(this.visual.BASKET_PROP_DIV).innerHTML}this.obPopupWin.setContent(t);this.obPopupWin.setButtons([new i({text:BX.message("BTN_SEND_PROPS"),events:{click:BX.delegate(this.sendToBasket,this)}})]);this.obPopupWin.show()}else{this.sendToBasket()}break;case 3:this.sendToBasket();break}},basketResult:function(t){var s,e,a;if(this.obPopupWin){this.obPopupWin.close()}if(!BX.type.isPlainObject(t))return;if(t.STATUS==="OK"){this.setAnalyticsDataLayer("addToCart")}if(t.STATUS==="OK"&&this.basketMode==="BUY"){this.basketRedirect()}else{this.initPopupWindow();if(t.STATUS==="OK"){BX.onCustomEvent("OnBasketChange");switch(this.productType){case 1:case 2:a=this.product.pict.SRC;break;case 3:a=this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC;break}s='<div style="width: 100%; margin: 0; text-align: center;">'+'<img src="'+a+'" height="130" style="max-height:130px"><p>'+this.product.name+"</p></div>";if(this.config.showClosePopup){e=[new i({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)},style:{marginRight:"10px"}}),new i({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}else{e=[new i({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)}})]}}else{s='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("BASKET_UNKNOWN_ERROR"))+"</p></div>";e=[new i({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}this.obPopupWin.setTitleBar(t.STATUS==="OK"?BX.message("TITLE_SUCCESSFUL"):BX.message("TITLE_ERROR"));this.obPopupWin.setContent(s);this.obPopupWin.setButtons(e);this.obPopupWin.show()}},basketRedirect:function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")},initPopupWindow:function(){if(this.obPopupWin)return;this.obPopupWin=BX.PopupWindowManager.create("CatalogElementBasket_"+this.visual.ID,null,{autoHide:false,offsetLeft:0,offsetTop:0,overlay:true,closeByEsc:true,titleBar:true,closeIcon:true,contentColor:"white",className:this.config.templateTheme?"bx-"+this.config.templateTheme:""})},incViewedCounter:function(){if(this.currentIsSet){var t={};switch(this.productType){case 1:case 2:t.productId=this.product.id;t.skuId=this.product.id;break;case 3:t.productId=this.product.id;t.skuId=this.offers[this.offerNum].ID;break;default:return}t.siteId=BX.message("SITE_ID");BX.ajax.runComponentAction("bitrix:catalog.item","addViewedProduct",{mode:"ajax",data:t})}},allowViewedCount:function(t){this.currentIsSet=true;if(t){this.incViewedCounter()}},fixFontCheck:function(){if(BX.type.isDomNode(this.obPrice.price)){BX.FixFontSize&&BX.FixFontSize.init({objList:[{node:this.obPrice.price,maxFontSize:28,smallestValue:false,scaleBy:this.obPrice.price.parentNode}],onAdaptiveResize:true})}}}})(window);
//# sourceMappingURL=script.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit