1(function(t){if(!!t.JCCatalogElement){return}var i=function(t){i.superclass.constructor.apply(this,arguments);this.nameNode=BX.create("span",{props:{className:"bx_medium bx_bt_button",id:this.id},style:typeof t.style==="object"?t.style:{},text:t.text});this.buttonNode=BX.create("span",{attrs:{className:t.ownerClass},children:[this.nameNode],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,mainPictureMode:"IMG",showBasisPrice:false,basketAction:["BUY"],showClosePopup:false};this.checkQuantity=false;this.maxQuantity=0;this.stepQuantity=1;this.isDblQuantity=false;this.canBuy=true;this.isGift=false;this.currentBasisPrice={};this.canSubscription=true;this.currentIsSet=false;this.updateViewedCount=false;this.precision=6;this.precisionFactor=Math.pow(10,this.precision);this.listID={main:["PICT_ID","BIG_SLIDER_ID","BIG_IMG_CONT_ID"],stickers:["STICKER_ID"],productSlider:["SLIDER_CONT","SLIDER_LIST","SLIDER_LEFT","SLIDER_RIGHT"],offerSlider:["SLIDER_CONT_OF_ID","SLIDER_LIST_OF_ID","SLIDER_LEFT_OF_ID","SLIDER_RIGHT_OF_ID"],offers:["TREE_ID","TREE_ITEM_ID","DISPLAY_PROP_DIV","OFFER_GROUP"],quantity:["QUANTITY_ID","QUANTITY_UP_ID","QUANTITY_DOWN_ID","QUANTITY_MEASURE","QUANTITY_LIMIT","BASIS_PRICE"],price:["PRICE_ID"],oldPrice:["OLD_PRICE_ID","DISCOUNT_VALUE_ID"],discountPerc:["DISCOUNT_PERC_ID"],basket:["BASKET_PROP_DIV","BUY_ID","ADD_BASKET_ID","BASKET_ACTIONS_ID","NOT_AVAILABLE_MESS"],magnifier:["MAGNIFIER_ID","MAGNIFIER_AREA_ID"],compare:["COMPARE_LINK_ID"]};this.visualPostfix={PICT_ID:"_pict",BIG_SLIDER_ID:"_big_slider",BIG_IMG_CONT_ID:"_bigimg_cont",STICKER_ID:"_sticker",SLIDER_CONT:"_slider_cont",SLIDER_LIST:"_slider_list",SLIDER_LEFT:"_slider_left",SLIDER_RIGHT:"_slider_right",SLIDER_CONT_OF_ID:"_slider_cont_",SLIDER_LIST_OF_ID:"_slider_list_",SLIDER_LEFT_OF_ID:"_slider_left_",SLIDER_RIGHT_OF_ID:"_slider_right_",TREE_ID:"_skudiv",TREE_ITEM_ID:"_prop_",DISPLAY_PROP_DIV:"_sku_prop",QUANTITY_ID:"_quantity",QUANTITY_UP_ID:"_quant_up",QUANTITY_DOWN_ID:"_quant_down",QUANTITY_MEASURE:"_quant_measure",QUANTITY_LIMIT:"_quant_limit",BASIS_PRICE:"_basis_price",PRICE_ID:"_price",OLD_PRICE_ID:"_old_price",DISCOUNT_VALUE_ID:"_price_discount",DISCOUNT_PERC_ID:"_dsc_pict",BASKET_PROP_DIV:"_basket_prop",BUY_ID:"_buy_link",ADD_BASKET_ID:"_add_basket_link",BASKET_ACTIONS_ID:"_basket_actions",NOT_AVAILABLE_MESS:"_not_avail",MAGNIFIER_ID:"_magnifier",MAGNIFIER_AREA_ID:"_magnifier_area",OFFER_GROUP:"_set_group_",COMPARE_LINK_ID:"_compare_link"};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:"",comparePath:""};this.defaultPict={preview:null,detail:null};this.offers=[];this.offerNum=0;this.treeProps=[];this.obTreeRows=[];this.showCount=[];this.showStart=[];this.selectedValues={};this.sliders=[];this.obProduct=null;this.obQuantity=null;this.obQuantityUp=null;this.obQuantityDown=null;this.obBasisPrice=null;this.obPict=null;this.obPictAligner=null;this.obPrice={price:null,full:null,discount:null,percent:null};this.obTree=null;this.obBuyBtn=null;this.obAddToBasketBtn=null;this.obBasketActions=null;this.obNotAvail=null;this.obSkuProps=null;this.obSlider=null;this.obMeasure=null;this.obQuantityLimit={all:null,value:null};this.obCompare=null;this.viewedCounter={path:"/bitrix/components/bitrix/catalog.element/ajax.php",params:{AJAX:"Y",SITE_ID:"",PRODUCT_ID:0,PARENT_ID:0}};this.currentImg={src:"",width:0,height:0,screenWidth:0,screenHeight:0,screenOffsetX:0,screenOffsetY:0,scale:1};this.obPopupWin=null;this.basketUrl="";this.basketParams={};this.obPopupPict=null;this.magnify={obMagnifier:null,obMagnifyPict:null,obMagnifyArea:null,obBigImg:null,obBigSlider:null,magnifyShow:false,areaParams:{width:100,height:130,left:0,top:0,scaleFactor:1,globalLeft:0,globalTop:0,globalRight:0,globalBottom:0},magnifierParams:{top:0,left:0,width:0,height:0,ratioX:10,ratioY:13,defaultScale:1},magnifyPictParams:{marginTop:0,marginLeft:0,width:0,height:0}};this.treeRowShowSize=5;this.treeEnableArrow={display:"",cursor:"pointer",opacity:1};this.treeDisableArrow={display:"",cursor:"default",opacity:.2};this.sliderRowShowSize=5;this.sliderEnableArrow={display:"",cursor:"pointer",opacity:1};this.sliderDisableArrow={display:"",cursor:"default",opacity:.2};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()}if(0===this.errorCode){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.onSaleProductIsGift=function(t,i){var s=function(t,i){for(var s=0;s<t.length;s++){if(t[s]&&t[s].ID==i){return t[s]}}return null};if(!!i&&this.offers&&this.offers[this.offerNum].ID==i){this.setGift()}};t.JCCatalogElement.prototype.onSaleProductIsNotGift=function(t,i){if(!!i&&this.offers&&this.offers[this.offerNum].ID==i){this.restoreSticker();this.isGift=false;this.setPrice(BX.clone(this.offers[this.offerNum].PRICE,true))}};t.JCCatalogElement.prototype.reloadGiftInfo=function(){if(this.productType===3){this.checkQuantity=true;this.maxQuantity=1;this.setPrice(BX.clone(this.offers[this.offerNum].PRICE,true));BX.hide(this.obBasisPrice);this.redrawSticker({text:BX.message("PRODUCT_GIFT_LABEL")})}};t.JCCatalogElement.prototype.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()};t.JCCatalogElement.prototype.Init=function(){var t=0,i=0,s="",e=null,a=null;this.obProduct=BX(this.visual.ID);if(!this.obProduct){this.errorCode=-1}this.obPict=BX(this.visual.PICT_ID);if(!this.obPict){this.errorCode=-2}else{this.obPictAligner=this.obPict.parentNode}if(this.config.showPrice){this.obPrice.price=BX(this.visual.PRICE_ID);if(!this.obPrice.price&&this.config.useCatalog){this.errorCode=-16}else{if(this.config.showOldPrice){this.obPrice.full=BX(this.visual.OLD_PRICE_ID);this.obPrice.discount=BX(this.visual.DISCOUNT_VALUE_ID);if(!this.obPrice.full||!this.obPrice.discount){this.config.showOldPrice=false}}if(this.config.showPercent){this.obPrice.percent=BX(this.visual.DISCOUNT_PERC_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_ID)}if(BX.util.in_array("ADD",this.config.basketAction)){this.obAddToBasketBtn=BX(this.visual.ADD_BASKET_ID)}}this.obNotAvail=BX(this.visual.NOT_AVAILABLE_MESS)}if(this.config.showQuantity){this.obQuantity=BX(this.visual.QUANTITY_ID);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.config.showBasisPrice){this.obBasisPrice=BX(this.visual.BASIS_PRICE)}}if(3===this.productType){if(!!this.visual.TREE_ID){this.obTree=BX(this.visual.TREE_ID);if(!this.obTree){this.errorCode=-256}s=this.visual.TREE_ITEM_ID;for(t=0;t<this.treeProps.length;t++){this.obTreeRows[t]={LEFT:BX(s+this.treeProps[t].ID+"_left"),RIGHT:BX(s+this.treeProps[t].ID+"_right"),LIST:BX(s+this.treeProps[t].ID+"_list"),CONT:BX(s+this.treeProps[t].ID+"_cont")};if(!this.obTreeRows[t].LEFT||!this.obTreeRows[t].RIGHT||!this.obTreeRows[t].LIST||!this.obTreeRows[t].CONT){this.errorCode=-512;break}}}if(!!this.visual.QUANTITY_MEASURE){this.obMeasure=BX(this.visual.QUANTITY_MEASURE)}if(!!this.visual.QUANTITY_LIMIT){this.obQuantityLimit.all=BX(this.visual.QUANTITY_LIMIT);if(!!this.obQuantityLimit.all){this.obQuantityLimit.value=BX.findChild(this.obQuantityLimit.all,{tagName:"span"},false,false);
1if(!this.obQuantityLimit.value){this.obQuantityLimit.all=null}}}}if(this.config.showSkuProps){if(!!this.visual.DISPLAY_PROP_DIV){this.obSkuProps=BX(this.visual.DISPLAY_PROP_DIV)}}if(this.config.useCompare){this.obCompare=BX(this.visual.COMPARE_LINK_ID)}if(0===this.errorCode){if(this.config.showQuantity){if(!!this.obQuantityUp){BX.bind(this.obQuantityUp,"click",BX.delegate(this.QuantityUp,this))}if(!!this.obQuantityDown){BX.bind(this.obQuantityDown,"click",BX.delegate(this.QuantityDown,this))}if(!!this.obQuantity){BX.bind(this.obQuantity,"change",BX.delegate(this.QuantityChange,this))}}switch(this.productType){case 0:case 1:case 2:if(this.product.useSlider){this.product.slider={COUNT:this.product.sliderCount,ID:this.visual.SLIDER_CONT,CONT:BX(this.visual.SLIDER_CONT),LIST:BX(this.visual.SLIDER_LIST),LEFT:BX(this.visual.SLIDER_LEFT),RIGHT:BX(this.visual.SLIDER_RIGHT),START:0};e=BX.findChildren(this.product.slider.LIST,{tagName:"li"},true);if(!!e&&0<e.length){for(i=0;i<e.length;i++){BX.bind(e[i],"click",BX.delegate(this.ProductSelectSliderImg,this))}}if(!!this.product.slider.LEFT){BX.bind(this.product.slider.LEFT,"click",BX.delegate(this.ProductSliderRowLeft,this));BX.adjust(this.product.slider.LEFT,{style:this.sliderDisableArrow})}if(!!this.product.slider.RIGHT){BX.bind(this.product.slider.RIGHT,"click",BX.delegate(this.ProductSliderRowRight,this));BX.adjust(this.product.slider.RIGHT,{style:this.sliderEnableArrow})}this.setCurrentImg(this.product.sliderPict[0],true)}break;case 3:a=BX.findChildren(this.obTree,{tagName:"li"},true);if(!!a&&0<a.length){for(t=0;t<a.length;t++){BX.bind(a[t],"click",BX.delegate(this.SelectOfferProp,this))}}for(t=0;t<this.obTreeRows.length;t++){BX.bind(this.obTreeRows[t].LEFT,"click",BX.delegate(this.RowLeft,this));BX.bind(this.obTreeRows[t].RIGHT,"click",BX.delegate(this.RowRight,this))}for(t=0;t<this.offers.length;t++){this.offers[t].SLIDER_COUNT=parseInt(this.offers[t].SLIDER_COUNT,10);if(isNaN(this.offers[t].SLIDER_COUNT)){this.offers[t].SLIDER_COUNT=0}if(0===this.offers[t].SLIDER_COUNT){this.sliders[t]={COUNT:this.offers[t].SLIDER_COUNT,ID:""}}else{for(i=0;i<this.offers[t].SLIDER.length;i++){this.offers[t].SLIDER[i].WIDTH=parseInt(this.offers[t].SLIDER[i].WIDTH,10);this.offers[t].SLIDER[i].HEIGHT=parseInt(this.offers[t].SLIDER[i].HEIGHT,10)}this.sliders[t]={COUNT:this.offers[t].SLIDER_COUNT,OFFER_ID:this.offers[t].ID,ID:this.visual.SLIDER_CONT_OF_ID+this.offers[t].ID,CONT:BX(this.visual.SLIDER_CONT_OF_ID+this.offers[t].ID),LIST:BX(this.visual.SLIDER_LIST_OF_ID+this.offers[t].ID),LEFT:BX(this.visual.SLIDER_LEFT_OF_ID+this.offers[t].ID),RIGHT:BX(this.visual.SLIDER_RIGHT_OF_ID+this.offers[t].ID),START:0};e=BX.findChildren(this.sliders[t].LIST,{tagName:"li"},true);if(!!e&&0<e.length){for(i=0;i<e.length;i++){BX.bind(e[i],"click",BX.delegate(this.SelectSliderImg,this))}}if(!!this.sliders[t].LEFT){BX.bind(this.sliders[t].LEFT,"click",BX.delegate(this.SliderRowLeft,this))}if(!!this.sliders[t].RIGHT){BX.bind(this.sliders[t].RIGHT,"click",BX.delegate(this.SliderRowRight,this))}}}this.SetCurrent();break}if(!!this.obBuyBtn){BX.bind(this.obBuyBtn,"click",BX.proxy(this.BuyBasket,this))}if(!!this.obAddToBasketBtn){BX.bind(this.obAddToBasketBtn,"click",BX.proxy(this.Add2Basket,this))}if(!!this.obCompare){BX.bind(this.obCompare,"click",BX.proxy(this.Compare,this))}this.setMainPictHandler()}};t.JCCatalogElement.prototype.initConfig=function(){this.productType=parseInt(this.params.PRODUCT_TYPE,10);if(!!this.params.CONFIG&&typeof this.params.CONFIG==="object"){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;if(!!this.params.CONFIG.MAIN_PICTURE_MODE){this.config.mainPictureMode=this.params.CONFIG.MAIN_PICTURE_MODE}this.config.showBasisPrice=!!this.params.CONFIG.SHOW_BASIS_PRICE;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}else{if(this.params.USE_CATALOG!=="undefined"&&BX.type.isBoolean(this.params.USE_CATALOG)){this.config.useCatalog=this.params.USE_CATALOG}this.config.showQuantity=!!this.params.SHOW_QUANTITY;this.config.showPrice=!!this.params.SHOW_PRICE;this.config.showPercent=!!this.params.SHOW_DISCOUNT_PERCENT;this.config.showOldPrice=!!this.params.SHOW_OLD_PRICE;this.config.showSkuProps=!!this.params.SHOW_SKU_PROPS;this.config.showOfferGroup=!!this.params.OFFER_GROUP;this.config.useCompare=!!this.params.DISPLAY_COMPARE;if(!!this.params.MAIN_PICTURE_MODE){this.config.mainPictureMode=this.params.MAIN_PICTURE_MODE}this.config.showBasisPrice=!!this.params.SHOW_BASIS_PRICE;if(!!this.params.ADD_TO_BASKET_ACTION){this.config.basketAction=this.params.ADD_TO_BASKET_ACTION}this.config.showClosePopup=!!this.params.SHOW_CLOSE_POPUP}if(!this.params.VISUAL||typeof this.params.VISUAL!=="object"||!this.params.VISUAL.ID){this.errorCode=-1;return}this.visual.ID=this.params.VISUAL.ID;this.initVisualParams("main");if(this.config.showQuantity){this.initVisualParams("quantity")}if(this.config.showPrice){this.initVisualParams("price")}if(this.config.showOldPrice){this.initVisualParams("oldPrice")}if(this.config.showPercent){this.initVisualParams("discountPerc")}this.initVisualParams("basket");if(this.config.mainPictureMode==="MAGNIFIER"){this.initVisualParams("magnifier")}if(this.config.useCompare){this.initVisualParams("compare")}if(this.config.useStickers){this.initVisualParams("stickers")}};t.JCCatalogElement.prototype.initVisualParams=function(t){var i=0,s="";if(!this.listID[t]){this.errorCode=-1;return}for(i=0;i<this.listID[t].length;i++){s=this.listID[t][i];this.visual[s]=!!this.params.VISUAL[s]?this.params.VISUAL[s]:this.visual.ID+this.visualPostfix[s]}};t.JCCatalogElement.prototype.initProductData=function(){var t=0;this.initVisualParams("productSlider");if(!!this.params.PRODUCT&&"object"===typeof this.params.PRODUCT){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.maxQuantity=this.product.maxQuantity;this.stepQuantity=this.product.stepQuantity;if(this.isDblQuantity){this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor}}this.product.canBuy=this.params.PRODUCT.CAN_BUY;this.product.canSubscription=this.params.PRODUCT.SUBSCRIPTION;if(this.config.showPrice){this.currentBasisPrice=this.params.PRODUCT.BASIS_PRICE}this.canBuy=this.product.canBuy;this.canSubscription=this.product.canSubscription;this.product.name=this.params.PRODUCT.NAME;this.product.pict=this.params.PRODUCT.PICT;this.product.id=this.params.PRODUCT.ID;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);if(isNaN(this.product.sliderCount)){this.product.sliderCount=0}if(0<this.product.sliderCount&&!!this.params.PRODUCT.SLIDER.length&&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}};t.JCCatalogElement.prototype.initOffersData=function(){this.initVisualParams("offerSlider");this.initVisualParams("offers");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)}if(isNaN(this.offerNum)){this.offerNum=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_PICTIRE;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}}else{this.errorCode=-1}};t.JCCatalogElement.prototype.initBasketData=function(){if(!!this.params.BASKET&&"object"===typeof this.params.BASKET){if(1===this.productType||2===this.productType){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(3===this.productType){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}}};t.JCCatalogElement.prototype.initCompareData=function(){if(this.config.useCompare){if(!!this.params.COMPARE&&t
1ypeof 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}}else{this.config.useCompare=false}}};t.JCCatalogElement.prototype.setMainPictHandler=function(){switch(this.config.mainPictureMode){case"GALLERY":break;case"MAGNIFIER":this.magnify.obBigImg=BX(this.visual.BIG_IMG_CONT_ID);this.magnify.obBigSlider=BX(this.visual.BIG_SLIDER_ID);if(!!this.magnify.obBigImg&&!!this.magnify.obBigSlider){this.magnify.obMagnifyArea=this.obPictAligner.appendChild(BX.create("DIV",{props:{id:this.visual.MAGNIFIER_AREA_ID,className:"bx_item_slider_lupe_small"},style:{display:"none",top:0,left:0,width:"100px",height:"130px"},events:{mouseover:BX.delegate(this.onMagnifierArea,this),mouseout:BX.delegate(function(){this.outMagnifierArea();this.hideMagnifier()},this)}}));this.magnify.obMagnifier=this.magnify.obBigSlider.appendChild(BX.create("DIV",{props:{id:this.visual.MAGNIFIER_ID,className:"bx_item_slider_lupe"},style:{display:"none"}}));this.magnify.obMagnifyPict=this.magnify.obMagnifier.appendChild(BX.create("IMG",{props:{src:this.currentImg.src}}));BX.bind(this.obPict,"mouseover",BX.delegate(this.showMagnifier,this))}break;case"POPUP":this.obPopupPict=new BX.PopupWindow("CatalogElementPopup_"+this.visual.ID,null,{autoHide:false,offsetLeft:0,offsetTop:0,overlay:false,closeByEsc:true,titleBar:true,closeIcon:{top:"10px",right:"10px"}});BX.bind(this.obPict,"click",BX.delegate(this.showMainPictPopup,this));BX.adjust(this.obPict,{style:{cursor:"pointer"}});BX.addCustomEvent(this.obPopupPict,"onAfterPopupShow",BX.proxy(this.onPopupWindowShow,this));BX.addCustomEvent(this.obPopupPict,"onPopupClose",BX.proxy(this.onPopupWindowClose,this));break;default:break}};t.JCCatalogElement.prototype.setCurrentImg=function(t,i){i=!!i;this.currentImg.src=t.SRC;this.currentImg.width=t.WIDTH;this.currentImg.height=t.HEIGHT;if(i&&!!this.obPict){if(this.config.mainPictureMode==="MAGNIFIER"){this.outMagnifierArea();this.hideMagnifier()}BX.adjust(this.obPict,{props:{src:this.currentImg.src}});var s={width:parseInt(this.obPictAligner.offsetWidth,10),height:parseInt(this.obPictAligner.offsetHeight,10)},e,a;e=this.scaleImg(this.currentImg,s);a=e.height<s.height?s.height-e.height>>>1:0;if(a!==this.currentImg.screenOffsetY){BX.style(this.obPictAligner,"marginTop",a+"px");this.currentImg.screenOffsetY=a}this.currentImg.screenOffsetX=e.width<s.width?s.width-e.width>>>1:0;this.currentImg.screenWidth=e.width;this.currentImg.screenHeight=e.height}};t.JCCatalogElement.prototype.scaleImg=function(t,i){var s,e,a,r={};if(i.width>=t.width&&i.height>=t.height){r.width=t.width;r.height=t.height}else{s=i.width/t.width;e=i.height/t.height;a=Math.min(s,e);r.width=Math.max(1,parseInt(a*t.width,10));r.height=Math.max(1,parseInt(a*t.height,10))}return r};t.JCCatalogElement.prototype.showMagnifier=function(t){if(!this.magnify.magnifyShow){this.calcMagnifierParams();this.calcMagnifyAreaSize();this.calcMagnifyAreaPos(t);this.calcMagnifyPictSize();this.calcMagnifyPictPos();this.setMagnifyAreaParams(true);this.setMagnifyPictParams(true);this.setMagnifierParams(true);BX.bind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this))}};t.JCCatalogElement.prototype.hideMagnifier=function(){if(!this.magnify.magnifyShow){if(!!this.magnify.obMagnifier){BX.adjust(this.magnify.obMagnifier,{style:{display:"none"}})}if(!!this.magnify.obMagnifyArea){BX.adjust(this.magnify.obMagnifyArea,{style:{display:"none"}})}BX.unbind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this))}};t.JCCatalogElement.prototype.moveMagnifierArea=function(t){var i,s=BX.pos(this.obPict),e={},a={},r={};i=this.inRect(t,s);if(this.inBound(s,i)){e=this.intersectArea(i,s);switch(e.X){case-1:this.magnify.areaParams.left=this.currentImg.screenOffsetX;break;case 0:this.magnify.areaParams.left=this.currentImg.screenOffsetX+i.X-(this.magnify.areaParams.width>>>1);break;case 1:this.magnify.areaParams.left=this.currentImg.screenOffsetX+s.width-this.magnify.areaParams.width;break}switch(e.Y){case-1:this.magnify.areaParams.top=0;break;case 0:this.magnify.areaParams.top=i.Y-(this.magnify.areaParams.height>>>1);break;case 1:this.magnify.areaParams.top=s.height-this.magnify.areaParams.height;break}this.magnify.magnifyPictParams.marginLeft=-parseInt((this.magnify.areaParams.left-this.currentImg.screenOffsetX)*this.currentImg.scale,10);this.magnify.magnifyPictParams.marginTop=-parseInt(this.magnify.areaParams.top*this.currentImg.scale,10);a.left=this.magnify.areaParams.left+"px";a.top=this.magnify.areaParams.top+"px";BX.adjust(this.magnify.obMagnifyArea,{style:a});r.marginLeft=this.magnify.magnifyPictParams.marginLeft+"px";r.marginTop=this.magnify.magnifyPictParams.marginTop+"px";BX.adjust(this.magnify.obMagnifyPict,{style:r})}else{this.outMagnifierArea();this.hideMagnifier()}};t.JCCatalogElement.prototype.onMagnifierArea=function(){this.magnify.magnifyShow=true};t.JCCatalogElement.prototype.outMagnifierArea=function(){this.magnify.magnifyShow=false};t.JCCatalogElement.prototype.calcMagnifierParams=function(){if(!!this.magnify.obBigImg){var t=BX.pos(this.magnify.obBigImg,true);this.magnify.magnifierParams.width=t.width;this.magnify.magnifierParams.height=t.height;this.magnify.magnifierParams.top=t.top;this.magnify.magnifierParams.left=t.left+t.width+2}};t.JCCatalogElement.prototype.setMagnifierParams=function(t){if(!!this.magnify.obMagnifier){t=!!t;var i={top:this.magnify.magnifierParams.top+"px",left:this.magnify.magnifierParams.left+"px",width:this.magnify.magnifierParams.width+"px",height:this.magnify.magnifierParams.height+"px"};if(t){i.display=""}BX.adjust(this.magnify.obMagnifier,{style:i})}};t.JCCatalogElement.prototype.setMagnifyAreaParams=function(t){if(!!this.magnify.obMagnifier){t=!!t;var i={top:this.magnify.areaParams.top+"px",left:this.magnify.areaParams.left+"px",width:this.magnify.areaParams.width+"px",height:this.magnify.areaParams.height+"px"};if(t){i.display=""}BX.adjust(this.magnify.obMagnifyArea,{style:i})}};t.JCCatalogElement.prototype.calcMagnifyAreaPos=function(t){var i,s,e;s=BX.pos(this.obPict);i=this.inRect(t,s);if(this.inBound(s,i)){e=this.intersectArea(i,s);switch(e.X){case-1:this.magnify.areaParams.left=this.currentImg.screenOffsetX;break;case 0:this.magnify.areaParams.left=this.currentImg.screenOffsetX+i.X-(this.magnify.areaParams.width>>>1);break;case 1:this.magnify.areaParams.left=this.currentImg.screenOffsetX+s.width-this.magnify.areaParams.width;break}switch(e.Y){case-1:this.magnify.areaParams.top=0;break;case 0:this.magnify.areaParams.top=i.Y-(this.magnify.areaParams.height>>>1);break;case 1:this.magnify.areaParams.top=s.height-this.magnify.areaParams.height;break}}};t.JCCatalogElement.prototype.inBound=function(t,i){return 0<=i.Y&&t.height>=i.Y&&(0<=i.X&&t.width>=i.X)};t.JCCatalogElement.prototype.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};t.JCCatalogElement.prototype.intersectArea=function(t,i){var s={X:0,Y:0},e=this.magnify.areaParams.width>>>1,a=this.magnify.areaParams.height>>>1;
1if(t.X<=e){s.X=-1}else if(t.X>=i.width-e){s.X=1}else{s.X=0}if(t.Y<=a){s.Y=-1}else if(t.Y>=i.height-a){s.Y=1}else{s.Y=0}return s};t.JCCatalogElement.prototype.calcMagnifyAreaSize=function(){var t,i,s;if(this.magnify.magnifierParams.width<this.currentImg.width&&this.magnify.magnifierParams.height<this.currentImg.height){t=this.magnify.obBigImg.offsetWidth/this.currentImg.width;i=this.magnify.obBigImg.offsetHeight/this.currentImg.height;s=Math.min(t,i);this.currentImg.scale=1/s;this.magnify.areaParams.width=Math.max(1,parseInt(s*this.magnify.magnifierParams.width,10));this.magnify.areaParams.height=Math.max(1,parseInt(s*this.magnify.magnifierParams.height,10));this.magnify.areaParams.scaleFactor=this.magnify.magnifierParams.defaultScale}else{t=this.obPict.offsetWidth/this.magnify.obBigImg.offsetWidth;i=this.obPict.offsetHeight/this.magnify.obBigImg.offsetHeight;s=Math.min(t,i);this.currentImg.scale=1/s;this.magnify.areaParams.width=Math.max(1,parseInt(s*this.magnify.magnifierParams.width,10));this.magnify.areaParams.height=Math.max(1,parseInt(s*this.magnify.magnifierParams.height,10));t=this.magnify.magnifierParams.width/this.currentImg.width;i=this.magnify.magnifierParams.height/this.currentImg.height;s=Math.max(t,i);this.magnify.areaParams.scaleFactor=s}};t.JCCatalogElement.prototype.calcMagnifyPictSize=function(){this.magnify.magnifyPictParams.width=this.currentImg.width*this.magnify.areaParams.scaleFactor;this.magnify.magnifyPictParams.height=this.currentImg.height*this.magnify.areaParams.scaleFactor};t.JCCatalogElement.prototype.calcMagnifyPictPos=function(){this.magnify.magnifyPictParams.marginLeft=-parseInt((this.magnify.areaParams.left-this.currentImg.screenOffsetX)*this.currentImg.scale,10);this.magnify.magnifyPictParams.marginTop=-parseInt(this.magnify.areaParams.top*this.currentImg.scale,10)};t.JCCatalogElement.prototype.setMagnifyPictParams=function(t){if(!!this.magnify.obMagnifier){t=!!t;var i={width:this.magnify.magnifyPictParams.width+"px",height:this.magnify.magnifyPictParams.height+"px",marginTop:this.magnify.magnifyPictParams.marginTop+"px",marginLeft:this.magnify.magnifyPictParams.marginLeft+"px"};if(t){i.display=""}BX.adjust(this.magnify.obMagnifyPict,{style:i,props:{src:this.currentImg.src}})}};t.JCCatalogElement.prototype.ProductSliderRowLeft=function(){var t=BX.proxy_context;if(!!t){if(this.sliderRowShowSize<this.product.slider.COUNT){if(0>this.product.slider.START){this.product.slider.START++;BX.adjust(this.product.slider.LIST,{style:{marginLeft:this.product.slider.START*20+"%"}});BX.adjust(this.product.slider.RIGHT,{style:this.sliderEnableArrow})}if(0<=this.product.slider.START){BX.adjust(this.product.slider.LEFT,{style:this.sliderDisableArrow})}}}};t.JCCatalogElement.prototype.ProductSliderRowRight=function(){var t=BX.proxy_context;if(!!t){if(this.sliderRowShowSize<this.product.slider.COUNT){if(this.sliderRowShowSize-this.product.slider.START<this.product.slider.COUNT){this.product.slider.START--;BX.adjust(this.product.slider.LIST,{style:{marginLeft:this.product.slider.START*20+"%"}});BX.adjust(this.product.slider.LEFT,{style:this.sliderEnableArrow})}if(this.sliderRowShowSize-this.product.slider.START>=this.product.slider.COUNT){BX.adjust(this.product.slider.RIGHT,{style:this.sliderDisableArrow})}}}};t.JCCatalogElement.prototype.ProductSelectSliderImg=function(){var t="",i=BX.proxy_context;if(!!i&&i.hasAttribute("data-value")){t=i.getAttribute("data-value");this.SetProductMainPict(t)}};t.JCCatalogElement.prototype.SetProductMainPict=function(t){var i=-1,s=0,e=0,a="",r="",o=null;if(0<this.product.sliderCount){for(e=0;e<this.product.sliderPict.length;e++){if(t===this.product.sliderPict[e].ID){i=e;break}}if(-1<i){if(!!this.product.sliderPict[i]){this.setCurrentImg(this.product.sliderPict[i],true)}o=BX.findChildren(this.product.slider.LIST,{tagName:"li"},false);
1if(!!o&&0<o.length){r=t;for(s=0;s<o.length;s++){a=o[s].getAttribute("data-value");if(a===r){BX.addClass(o[s],"bx_active")}else{BX.removeClass(o[s],"bx_active")}}}}}};t.JCCatalogElement.prototype.SliderRowLeft=function(){var t="",i=-1,s,e=BX.proxy_context;if(!!e&&e.hasAttribute("data-value")){t=e.getAttribute("data-value");for(s=0;s<this.sliders.length;s++){if(this.sliders[s].OFFER_ID===t){i=s;break}}if(-1<i&&this.sliderRowShowSize<this.sliders[i].COUNT){if(0>this.sliders[i].START){this.sliders[i].START++;BX.adjust(this.sliders[i].LIST,{style:{marginLeft:this.sliders[i].START*20+"%"}});BX.adjust(this.sliders[i].RIGHT,{style:this.sliderEnableArrow})}if(0<=this.sliders[i].START){BX.adjust(this.sliders[i].LEFT,{style:this.sliderDisableArrow})}}}};t.JCCatalogElement.prototype.SliderRowRight=function(){var t="",i=-1,s,e=BX.proxy_context;if(!!e&&e.hasAttribute("data-value")){t=e.getAttribute("data-value");for(s=0;s<this.sliders.length;s++){if(this.sliders[s].OFFER_ID===t){i=s;break}}if(-1<i&&this.sliderRowShowSize<this.sliders[i].COUNT){if(this.sliderRowShowSize-this.sliders[i].START<this.sliders[i].COUNT){this.sliders[i].START--;BX.adjust(this.sliders[i].LIST,{style:{marginLeft:this.sliders[i].START*20+"%"}});BX.adjust(this.sliders[i].LEFT,{style:this.sliderEnableArrow})}if(this.sliderRowShowSize-this.sliders[i].START>=this.sliders[i].COUNT){BX.adjust(this.sliders[i].RIGHT,{style:this.sliderDisableArrow})}}}};t.JCCatalogElement.prototype.SelectSliderImg=function(){var t="",i=[],s=BX.proxy_context;if(!!s&&s.hasAttribute("data-value")){t=s.getAttribute("data-value");i=t.split("_");this.SetMainPict(i[0],i[1])}};t.JCCatalogElement.prototype.SetMainPict=function(t,i){var s=-1,e=-1,a,r,o="",h=null,n="";for(a=0;a<this.offers.length;a++){if(t===this.offers[a].ID){s=a;break}}if(-1<s){if(0<this.offers[s].SLIDER_COUNT){ 2for(r=0;r<this.offers[s].SLIDER.length;r++){if(i===this.offers[s].SLIDER[r].ID){e=r;break}}if(-1<e){if(!!this.offers[s].SLIDER[e]){this.setCurrentImg(this.offers[s].SLIDER[e],true)}h=BX.findChildren(this.sliders[s].LIST,{tagName:"li"},false);
2if(!!h&&0<h.length){n=t+"_"+i;for(a=0;a<h.length;a++){o=h[a].getAttribute("data-value");if(o===n){BX.addClass(h[a],"bx_active")}else{BX.removeClass(h[a],"bx_active")}}}}}}};t.JCCatalogElement.prototype.SetMainPictFromItem=function(t){if(!!this.obPict){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)}}};t.JCCatalogElement.prototype.showMainPictPopup=function(t){var i="";i='<div style="text-align: center;"><img src="'+this.currentImg.src+'" width="'+this.currentImg.width+'" height="'+this.currentImg.height+'" name=""></div>';this.obPopupPict.setContent(i);this.obPopupPict.show();return BX.PreventDefault(t)};t.JCCatalogElement.prototype.QuantityUp=function(){var t=0,i=true,s;if(0===this.errorCode&&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;if(this.checkQuantity){if(t>this.maxQuantity){i=false}}if(i){if(this.isDblQuantity){t=Math.round(t*this.precisionFactor)/this.precisionFactor}this.obQuantity.value=t;s={DISCOUNT_VALUE:this.currentBasisPrice.DISCOUNT_VALUE*t,VALUE:this.currentBasisPrice.VALUE*t,DISCOUNT_DIFF:this.currentBasisPrice.DISCOUNT_DIFF*t,DISCOUNT_DIFF_PERCENT:this.currentBasisPrice.DISCOUNT_DIFF_PERCENT,CURRENCY:this.currentBasisPrice.CURRENCY};this.setPrice(s)}}}};t.JCCatalogElement.prototype.QuantityDown=function(){var t=0,i=true,s;if(0===this.errorCode&&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;if(t<this.stepQuantity){i=false}if(i){if(this.isDblQuantity){t=Math.round(t*this.precisionFactor)/this.precisionFactor}this.obQuantity.value=t;s={DISCOUNT_VALUE:this.currentBasisPrice.DISCOUNT_VALUE*t,VALUE:this.currentBasisPrice.VALUE*t,DISCOUNT_DIFF:this.currentBasisPrice.DISCOUNT_DIFF*t,DISCOUNT_DIFF_PERCENT:this.currentBasisPrice.DISCOUNT_DIFF_PERCENT,CURRENCY:this.currentBasisPrice.CURRENCY};this.setPrice(s)}}}};t.JCCatalogElement.prototype.QuantityChange=function(){var t=0,i,s,e;if(0===this.errorCode&&this.config.showQuantity){if(this.canBuy){t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10);if(!isNaN(t)){if(this.checkQuantity){if(t>this.maxQuantity){t=this.maxQuantity}}if(t<this.stepQuantity){t=this.stepQuantity}else{e=Math.round(t*this.precisionFactor/this.stepQuantity)/this.precisionFactor;s=parseInt(e,10);if(isNaN(s)){s=1;e=1.1}if(e>s){t=s<=1?this.stepQuantity:s*this.stepQuantity;t=Math.round(t*this.precisionFactor)/this.precisionFactor}}this.obQuantity.value=t}else{this.obQuantity.value=this.stepQuantity}}else{this.obQuantity.value=this.stepQuantity}i={DISCOUNT_VALUE:this.currentBasisPrice.DISCOUNT_VALUE*this.obQuantity.value,VALUE:this.currentBasisPrice.VALUE*this.obQuantity.value,DISCOUNT_DIFF:this.currentBasisPrice.DISCOUNT_DIFF*this.obQuantity.value,DISCOUNT_DIFF_PERCENT:this.currentBasisPrice.DISCOUNT_DIFF_PERCENT,CURRENCY:this.currentBasisPrice.CURRENCY};this.setPrice(i)}};t.JCCatalogElement.prototype.QuantitySet=function(t){var i="",s;if(this.errorCode===0){this.canBuy=this.offers[t].CAN_BUY;if(this.canBuy){if(!!this.obBasketActions){BX.style(this.obBasketActions,"display","")}if(!!this.obNotAvail){BX.style(this.obNotAvail,"display","none")}}else{if(!!this.obBasketActions){BX.style(this.obBasketActions,"display","none")}if(!!this.obNotAvail){BX.style(this.obNotAvail,"display","")}}if(this.config.showQuantity){this.isDblQuantity=this.offers[t].QUANTITY_FLOAT;this.checkQuantity=this.offers[t].CHECK_QUANTITY;if(this.isDblQuantity){this.maxQuantity=parseFloat(this.offers[t].MAX_QUANTITY);this.stepQuantity=Math.round(parseFloat(this.offers[t].STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor}else{this.maxQuantity=parseInt(this.offers[t].MAX_QUANTITY,10);this.stepQuantity=parseInt(this.offers[t].STEP_QUANTITY,10)}this.obQuantity.value=this.stepQuantity;this.obQuantity.disabled=!this.canBuy;if(!!this.obMeasure){if(!!this.offers[t].MEASURE){BX.adjust(this.obMeasure,{html:this.offers[t].MEASURE})}else{BX.adjust(this.obMeasure,{html:""})}}if(!!this.obQuantityLimit.all){if(!this.checkQuantity){BX.adjust(this.obQuantityLimit.value,{html:""});BX.adjust(this.obQuantityLimit.all,{style:{display:"none"}})}else{s=this.offers[t].MAX_QUANTITY;if(!!this.offers[t].MEASURE){s+=" "+this.offers[t].MEASURE}BX.adjust(this.obQuantityLimit.value,{html:s});BX.adjust(this.obQuantityLimit.all,{style:{display:""}})}}if(!!this.obBasisPrice){if(!!this.offers[t].BASIS_PRICE){i=BX.message("BASIS_PRICE_MESSAGE");i=i.replace("#PRICE#",BX.Currency.currencyFormat(this.offers[t].BASIS_PRICE.DISCOUNT_VALUE,this.offers[t].BASIS_PRICE.CURRENCY,true));i=i.replace("#MEASURE#",this.offers[t].MEASURE);BX.adjust(this.obBasisPrice,{style:{display:""},html:i})}else{BX.adjust(this.obBasisPrice,{style:{display:"none"},html:""})}}}this.currentBasisPrice=this.offers[t].BASIS_PRICE}};t.JCCatalogElement.prototype.SelectOfferProp=function(){var t=0,i="",s=[],e=null,a=BX.proxy_context;if(!!a&&a.hasAttribute("data-treevalue")){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);
2if(!!e&&0<e.length){for(t=0;t<e.length;t++){BX.removeClass(e[t],"bx_active")}}BX.addClass(a,"bx_active")}};t.JCCatalogElement.prototype.SearchOfferPropIndex=function(t,i){var s="",e=false,a=[],r=[],o=-1,h,n,l={},f=[];for(h=0;h<this.treeProps.length;h++){if(this.treeProps[h].ID===t){o=h;break}}if(-1<o){for(h=0;h<o;h++){s="PROP_"+this.treeProps[h].ID;l[s]=this.selectedValues[s]}s="PROP_"+this.treeProps[o].ID;l[s]=i;for(h=o+1;h<this.treeProps.length;h++){s="PROP_"+this.treeProps[h].ID;e=this.GetRowValues(l,s);if(!e){break}r=[];if(this.config.showAbsent){a=[];f=[];f=BX.clone(l,true);for(n=0;n<e.length;n++){f[s]=e[n];r[r.length]=e[n];if(this.GetCanBuy(f))a[a.length]=e[n]}}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>0?a[0]:r[0];else l[s]=a[0]}this.UpdateRow(h,l[s],e,a)}this.selectedValues=l;this.ChangeInfo()}};t.JCCatalogElement.prototype.RowLeft=function(){var t="",i=-1,s,e=BX.proxy_context;if(!!e&&e.hasAttribute("data-treevalue")){t=e.getAttribute("data-treevalue");for(s=0;s<this.treeProps.length;s++){if(this.treeProps[s].ID===t){i=s;break}}if(-1<i&&this.treeRowShowSize<this.showCount[i]){if(0>this.showStart[i]){this.showStart[i]++;BX.adjust(this.obTreeRows[i].LIST,{style:{marginLeft:this.showStart[i]*20+"%"}});BX.adjust(this.obTreeRows[i].RIGHT,{style:this.treeEnableArrow})}if(0<=this.showStart[i]){BX.adjust(this.obTreeRows[i].LEFT,{style:this.treeDisableArrow})}}}};t.JCCatalogElement.prototype.RowRight=function(){var t="",i=-1,s,e=BX.proxy_context;if(!!e&&e.hasAttribute("data-treevalue")){t=e.getAttribute("data-treevalue");for(s=0;s<this.treeProps.length;s++){if(this.treeProps[s].ID===t){i=s;break}}if(-1<i&&this.treeRowShowSize<this.showCount[i]){if(this.treeRowShowSize-this.showStart[i]<this.showCount[i]){this.showStart[i]--;BX.adjust(this.obTreeRows[i].LIST,{style:{marginLeft:this.showStart[i]*20+"%"}});BX.adjust(this.obTreeRows[i].LEFT,{style:this.treeEnableArrow})}if(this.treeRowShowSize-this.showStart[i]>=this.showCount[i]){BX.adjust(this.obTreeRows[i].RIGHT,{style:this.treeDisableArrow})}}}};t.JCCatalogElement.prototype.UpdateRow=function(t,i,s,e){var a=0,r=0,o="",h=0,n="",l={},f=null,u=false,c=false,p=false,d=0,m=this.treeEnableArrow,g=this.treeEnableArrow,I=0;if(-1<t&&t<this.obTreeRows.length){f=BX.findChildren(this.obTreeRows[t].LIST,{tagName:"li"},false);
2if(!!f&&0<f.length){u="PICT"===this.treeProps[t].SHOW_MODE;h=s.length;c=this.treeRowShowSize<h;n=this.treeRowShowSize<h?100/h+"%":"20%";l={props:{className:""},style:{width:n}};if(u){l.style.paddingTop=n}for(a=0;a<f.length;a++){o=f[a].getAttribute("data-onevalue");p=o===i;if(BX.util.in_array(o,e)){l.props.className=p?"bx_active":""}else{l.props.className=p?"bx_active bx_missing":"bx_missing"}l.style.display="none";if(BX.util.in_array(o,s)){l.style.display="";if(p){d=r}r++}BX.adjust(f[a],l)}l={style:{width:(c?20*h:100)+"%",marginLeft:"0%"}};if(u){BX.adjust(this.obTreeRows[t].CONT,{props:{className:c?"bx_item_detail_scu full":"bx_item_detail_scu"}})}else{BX.adjust(this.obTreeRows[t].CONT,{props:{className:c<h?"bx_item_detail_size full":"bx_item_detail_size"}})}if(c){if(d+1===h){g=this.treeDisableArrow}if(this.treeRowShowSize<=d){I=this.treeRowShowSize-d-1;l.style.marginLeft=I*20+"%"}if(0===I){m=this.treeDisableArrow}BX.adjust(this.obTreeRows[t].LEFT,{style:m});BX.adjust(this.obTreeRows[t].RIGHT,{style:g})}else{BX.adjust(this.obTreeRows[t].LEFT,{style:{display:"none"}});BX.adjust(this.obTreeRows[t].RIGHT,{style:{display:"none"}})}BX.adjust(this.obTreeRows[t].LIST,l);this.showCount[t]=h;this.showStart[t]=I}}};t.JCCatalogElement.prototype.GetRowValues=function(t,i){var s=[],e=0,a=0,r=false,o=true;if(0===t.length){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};t.JCCatalogElement.prototype.GetCanBuy=function(t){var i=0,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};t.JCCatalogElement.prototype.SetCurrent=function(){var t=0,i=0,s="",e=false,a=[],r={},o=[],h=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(h[s],e)){r[s]=h[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()};t.JCCatalogElement.prototype.ChangeInfo=function(){var t=-1,i,s=0,e=true,a={currentId:this.offerNum>-1?this.offers[this.offerNum].ID:0,newId:0};for(i=0;i<this.offers.length;i++){e=true;for(s in this.selectedValues){if(this.selectedValues[s]!==this.offers[i].TREE[s]){e=false;break}}if(e){t=i;break}}if(-1<t){if(t!=this.offerNum){this.isGift=false}this.setPrice(this.offers[t].PRICE);for(i=0;i<this.offers.length;i++){if(this.config.showOfferGroup&&this.offers[i].OFFER_GROUP){if(i!==t){BX.adjust(BX(this.visual.OFFER_GROUP+this.offers[i].ID),{style:{display:"none"}})}}if(!!this.sliders[i].ID){if(i===t){this.sliders[i].START=0;BX.adjust(this.sliders[i].LIST,{style:{marginLeft:"0%"}});BX.adjust(this.sliders[i].CONT,{style:{display:""}});BX.adjust(this.sliders[i].LEFT,{style:this.sliderDisableArrow});BX.adjust(this.sliders[i].RIGHT,{style:this.sliderEnableArrow})}else{BX.adjust(this.sliders[i].CONT,{style:{display:"none"}})}}}if(this.config.showOfferGroup&&this.offers[t].OFFER_GROUP){BX.adjust(BX(this.visual.OFFER_GROUP+this.offers[t].ID),{style:{display:""}})}if(0<this.offers[t].SLIDER_COUNT){this.SetMainPict(this.offers[t].ID,this.offers[t].SLIDER[0].ID)}else{this.SetMainPictFromItem(t)}if(this.config.showSkuProps&&!!this.obSkuProps){if(!this.offers[t].DISPLAY_PROPERTIES||this.offers[t].DISPLAY_PROPERTIES.length===0){BX.adjust(this.obSkuProps,{style:{display:"none"},html:""})}else{BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[t].DISPLAY_PROPERTIES})}}this.offerNum=t;this.QuantitySet(this.offerNum);this.incViewedCounter();a.newId=this.offers[this.offerNum].ID;BX.onCustomEvent("onCatalogStoreProductChange",[this.offers[this.offerNum].ID]);BX.onCustomEvent("onCatalogElementChangeOffer",a);a=null}};t.JCCatalogElement.prototype.restoreSticker=function(){if(this.previousStickerText){this.redrawSticker({text:this.previousStickerText})}else{this.hideSticker()}};t.JCCatalogElement.prototype.hideSticker=function(){BX.hide(BX(this.visual.STICKER_ID))};t.JCCatalogElement.prototype.redrawSticker=function(t){t=t||{};var i=t.text||"";var s=BX(this.visual.STICKER_ID);if(!s){return}BX.show(BX(this.visual.STICKER_ID),"block");var e=s.getAttribute("title");if(e&&e!=i){this.previousStickerText=e}BX.adjust(s,{text:i,attrs:{title:i}})};t.JCCatalogElement.prototype.setPrice=function(t){var i="";if(this.isGift){t.DISCOUNT_VALUE=0;t.DISCOUNT_DIFF=t.VALUE;t.DISCOUNT_DIFF_PERCENT=-100}if(!!this.obPrice.price){BX.adjust(this.obPrice.price,{html:BX.Currency.currencyFormat(t.DISCOUNT_VALUE,t.CURRENCY,true)});if(t.DISCOUNT_VALUE!==t.VALUE){if(this.config.showOldPrice){if(!!this.obPrice.full){BX.adjust(this.obPrice.full,{style:{display:""},html:BX.Currency.currencyFormat(t.VALUE,t.CURRENCY,true)})}if(!!this.obPrice.discount){i=BX.message("ECONOMY_INFO_MESSAGE");i=i.replace("#ECONOMY#",BX.Currency.currencyFormat(t.DISCOUNT_DIFF,t.CURRENCY,true));BX.adjust(this.obPrice.discount,{style:{display:""},html:i})}}if(this.config.showPercent){if(!!this.obPrice.percent){BX.adjust(this.obPrice.percent,{style:{display:""},html:t.DISCOUNT_DIFF_PERCENT+"%"})}}}else{if(this.config.showOldPrice){if(!!this.obPrice.full){BX.adjust(this.obPrice.full,{style:{display:"none"},html:""})}if(!!this.obPrice.discount){BX.adjust(this.obPrice.discount,{style:{display:"none"},html:""})}}if(this.config.showPercent){if(!!this.obPrice.percent){BX.adjust(this.obPrice.percent,{style:{display:"none"},html:""})}}}}};t.JCCatalogElement.prototype.Compare=function(){var t,i;if(!!this.compareData.compareUrl){switch(this.productType){case 0:case 1:case 2:i=this.compareData.compareUrl.replace("#ID#",this.product.id.toString());break;case 3:i=this.compareData.compareUrl.replace("#ID#",this.offers[this.offerNum].ID);break}t={ajax_action:"Y"};BX.ajax.loadJSON(i,t,BX.proxy(this.CompareResult,this))}};t.JCCatalogElement.prototype.CompareResult=function(t){var s,e,a;if(!!this.obPopupWin)this.obPopupWin.close();if(typeof t!=="object")return false;this.InitPopupWindow();a={content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:BX.message("COMPARE_TITLE")})};if(t.STATUS==="OK"){BX.onCustomEvent("OnCompareChange");s='<div style="width: 96%; margin: 10px 2%; text-align: center;"><p>'+BX.message("COMPARE_MESSAGE_OK")+"</p></div>";if(this.config.showClosePopup){e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.CompareRedirect,this)},style:{marginRight:"10px"}}),new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}else{e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.CompareRedirect,this)}})]}}else{s='<div style="width: 96%; margin: 10px 2%; text-align: center;"><p>'+(!!t.MESSAGE?t.MESSAGE:BX.message("COMPARE_UNKNOWN_ERROR"))+"</p></div>";e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}this.obPopupWin.setTitleBar(a);this.obPopupWin.setContent(s);this.obPopupWin.setButtons(e);this.obPopupWin.show();return false};t.JCCatalogElement.prototype.CompareRedirect=function(){if(!!this.compareData.comparePath)location.href=this.compareData.comparePath;else this.obPopupWin.close()};t.JCCatalogElement.prototype.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}};t.JCCatalogElement.prototype.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}};t.JCCatalogElement.prototype.SendToBasket=function(){if(!this.canBuy)return;this.InitBasketUrl();this.FillBasketProps();
2BX.ajax.loadJSON(this.basketUrl,this.basketParams,BX.proxy(this.BasketResult,this))};t.JCCatalogElement.prototype.Add2Basket=function(){this.basketMode="ADD";this.Basket()};t.JCCatalogElement.prototype.BuyBasket=function(){this.basketMode="BUY";this.Basket()};t.JCCatalogElement.prototype.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({content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text: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({ownerClass:this.obProduct.className,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}};t.JCCatalogElement.prototype.BasketResult=function(t){var s,e,a,r;if(!!this.obPopupWin)this.obPopupWin.close();if(typeof t!=="object")return false;if(t.STATUS==="OK"&&this.basketMode==="BUY"){this.BasketRedirect()}else{this.InitPopupWindow();a={content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:t.STATUS==="OK"?BX.message("TITLE_SUCCESSFUL"):BX.message("TITLE_ERROR")})};if(t.STATUS==="OK"){BX.onCustomEvent("OnBasketChange");switch(this.productType){case 1:case 2:r=this.product.pict.SRC;break;case 3:r=!!this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC;break}s='<div style="width: 96%; margin: 10px 2%; text-align: center;"><img src="'+r+'" height="130" style="max-height:130px"><p>'+this.product.name+"</p></div>";if(this.config.showClosePopup){e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.BasketRedirect,this)},style:{marginRight:"10px"}}),new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}else{e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.BasketRedirect,this)}})]}}else{s='<div style="width: 96%; margin: 10px 2%; text-align: center;"><p>'+(!!t.MESSAGE?t.MESSAGE:BX.message("BASKET_UNKNOWN_ERROR"))+"</p></div>";e=[new i({ownerClass:this.obProduct.className,text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]}this.obPopupWin.setTitleBar(a);this.obPopupWin.setContent(s);this.obPopupWin.setButtons(e);this.obPopupWin.show()}return false};t.JCCatalogElement.prototype.BasketRedirect=function(){location.href=!!this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")};t.JCCatalogElement.prototype.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:{top:"10px",right:"10px"}})};t.JCCatalogElement.prototype.onPopupWindowShow=function(t){BX.bind(document,"click",BX.proxy(this.popupWindowClick,this))};t.JCCatalogElement.prototype.onPopupWindowClose=function(t,i){BX.unbind(document,"click",BX.proxy(this.popupWindowClick,this))};t.JCCatalogElement.prototype.popupWindowClick=function(){if(!!this.obPopupPict&&typeof this.obPopupPict==="object"){if(this.obPopupPict.isShown())this.obPopupPict.close()}};t.JCCatalogElement.prototype.incViewedCounter=function(){if(this.currentIsSet&&!this.updateViewedCount){switch(this.productType){case 1:case 2:this.viewedCounter.params.PRODUCT_ID=this.product.id;this.viewedCounter.params.PARENT_ID=this.product.id;break;case 3:this.viewedCounter.params.PARENT_ID=this.product.id;this.viewedCounter.params.PRODUCT_ID=this.offers[this.offerNum].ID;break;default:return}this.viewedCounter.params.SITE_ID=BX.message("SITE_ID");this.updateViewedCount=true;BX.ajax.post(this.viewedCounter.path,this.viewedCounter.params,BX.delegate(function(){this.updateViewedCount=false},this))}};t.JCCatalogElement.prototype.allowViewedCount=function(t){t=!!t;this.currentIsSet=true;if(t)this.incViewedCounter()}})(window); 3//# sourceMappingURL=script.map.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.