PageSourceSearch

https://izumclub.ru/local/templates/izum/js/custom.js?167032404474949

js izumclub.ru collected 2026-10-07 18:01:05 UTC 74,949 bytes, 2,205 lines download raw bytes

1(function() {
2    [].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
3        new SelectFx(el, {
4        	onChange: function (val) {
5				$(el).trigger('change');
6            }
7		});
8    } );
9    $.ajaxSetup({
10        complete: function () {
11            $('select.cs-select:not(.cs-select-init)').each(function () {
12                var el = $(this).get(0);
13
14                new SelectFx(el, {
15                    onChange: function (val) {
16                        $(el).trigger('change');
17                    }
18                });
19            });
20        }
21    })
22})();
23
24
25var $date_new = [];
26// День X (месяцы: Jan, Feb, Mar, Apr, May, June, July, Aug, Sept, Oct, Nov, Dec)
27//$date_new[$date_new.length] = "June 26,2018 00:00";
28
29
30(function ($) {
31    var BasketButton = function(params)
32    {
33        BasketButton.superclass.constructor.apply(this, arguments);
34        this.buttonNode = BX.create('span', {
35            props: {className: 'purple_btn', id: this.id},
36            style: typeof params.style === 'object' ? params.style : {},
37            text: params.text,
38            events: this.contextEvents
39        });
40
41        if (BX.browser.IsIE())
42        {
43            this.buttonNode.setAttribute("hideFocus", "hidefocus");
44        }
45    };
46    BX.extend(BasketButton, BX.PopupWindowButton);
47
48	$(function(){
49
50        $(document).delegate('.order-payment-list select', 'change', function() {
51            var $row = $(this).parents('.order-row');
52            $row.addClass('load');
53
54            var $form = $(this).parents('form'),
55                rowId = $row.data('id');
56            $.ajax({
57                url: $form.attr('action'),
58                type: 'post',
59                data: $form.serialize(),
60                success: function() {
61                     $.ajax({
62                        type: 'get',
63                        success: function(html) {
64                            let $rowNew = $(html).find('.order-row-' + rowId),
65                                $rowOld = $('.order-row-' + rowId);
66
67                            $rowOld.find('.order-products').replaceWith($rowNew.find('.order-products'));
68                            $rowOld.find('.final-price').replaceWith($rowNew.find('.final-price'));
69                            $row.removeClass('load');
70                        }
71                    });
72                }
73            });
74        });
75
76        // var popup_sale = $.cookie('popup-sale');
77        // if(typeof popup_sale == 'undefined') {
78        //     setTimeout(function(){
79        //         $('.popup-sale').addClass('active');
80        //         $.cookie('popup-sale', true, {path: '/', expires: 14});
81        //     }, 3000);
82        // }
83
84        $('.popup-sale .popup-sale__close, .popup-sale .popup-sale__bg, .popup-sale .popup-sale__button').click(function(){
85            $('.popup-sale').removeClass('active');
86            $.cookie('popup-sale', true, {path: '/', expires: 14});
87        });
88
89
90
91        $(window).scroll(function() {
92            if ($(this).scrollTop() > 100) {
93                if ($('#up-button').is(':hidden')) {
94                    $('#up-button').css({opacity : 1}).fadeIn('slow');
95                }
96            } else {
97                $('#up-button').stop(true, false).fadeOut('fast');
98            }
99        });
100
101        $('#up-button').click(function() {
102            $('html, body').stop().animate({scrollTop : 0}, 300);
103        });
104
105        var $div = $(".phon-num-info-block");
106	    $('#top-logo-block .phone-block .phone-num-info, .top-logo-block .phone-block-f .phone-num-info').click(function () {
107             //$(this).siblings('.phon-num-info-block').fadeIn(500);
108             $div.fadeIn(500);
109        });
110	    $('.phon-num-info-block .block-close').click(function () {
111             //$(this).parents('.phon-num-info-block').fadeOut(500);
112             $div.fadeOut(500);
113        });
114
115        $(document).mouseup(function (e){ // событие клика по веб-документу
116            if (!$div.is(e.target) // если клик был не по нашему блоку
117                && $div.has(e.target).length === 0) { // и не по его дочерним элементам
118                $div.fadeOut(500);
119            }
120        });
121
122	    var positionHeader = $('header').outerHeight(true) + $('header').offset().top;
123
124	    function fixedHeader() {
125            if(positionHeader < $(window).scrollTop()) {
126                $('#fixed-header').addClass('active');
127            } else {
128                $('#fixed-header').removeClass('active');
129            }
130        }
131
132	    $(window).scroll(fixedHeader)
133        fixedHeader();
134
135
136        var tooltip_params = {
137            theme: 'tooltipster-shadow',
138            contentCloning: true,
139            trackerInterval: 15,
140            trackOrigin: true
141        };
142
143        $('body').on('mouseenter', '.tltip:not(.tooltipstered)', function(){
144            $(this).tooltipster(tooltip_params).tooltipster('open');
145        });
146
147        $('.tltip').tooltipster(tooltip_params);
148
149        $('.products_of_day').slick({
150            slidesToShow: 1,
151            slidesToScroll: 1,
152            autoplay: false,
153            autoplaySpeed: 3000,
154            dots: false,
155            arrows: true,
156			prevArrow: '<div class="prev"></div>',
157			nextArrow: '<div class="next"></div>',
158        });
159
160	    var tooltip_params_noclone = {
161            theme: 'tooltipster-shadow',
162            contentCloning: false,
163            trackerInterval: 15,
164            interactive: true,
165            trackOrigin: true
166        };
167
168        $('body').on('mouseenter', '.tltip_noclone:not(.tooltipstered)', function(){
169            $(this).tooltipster(tooltip_params_noclone).tooltipster('open');
170        });
171
172        $('.tltip_noclone').tooltipster(tooltip_params_noclone);
173
174        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
175            $('.slick-initialized').slick('setPosition');
176
177        });
178
179        $('.contact-stock-list a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
180            setTimeout(function () {
181                BX.fireEvent(BX('body'), 'tab_change');
182            }, 500);
183        });
184
185		$("body").delegate(".heart_icon:not(.icon), #main_item_block .heart_icon", "click", function (event) {
186			event.preventDefault();
187
188			var id = $(this).data('id'),
189				task = $(this).hasClass('active') ? "del" : "add",
190				refresh = $(this).data('refresh'),
191				$el = $(this);
192
193			if(typeof id !== 'undefined' && parseInt(id) > 0) {
194				$.ajax({
195					url: "/local/ajax/favorite.php",
196					data: {"ID": id, "TASK": task},
197					type: "POST",
198					dataType: "json",
199					success: function (data) {
200						if('success' in data) {
201                            if (data.success && task == "add") {
202                                $el.addClass('active');
203
204                                var popup = new BX.PopupWindow(
205                                    "add_success",
206                                    null,
207                                    {
208                                        autoHide: true,
209                                        offsetLeft: 0,
210                                        offsetTop: 0,
211                                        overlay : true,
212                                        closeByEsc: true,
213                                        closeIcon: true,
214                                        contentColor: 'white',
215                                        content: '<div style="width: 100%; margin: 0; text-align: center;"><p>Товар добавлен в избранное</p></div>',
216                                        titleBar: "Избранные товары",
217                                        buttons: [
218                                            new BasketButton({
219                                                text: "Перейти в избранные товары",
220                                                events: {
221                                                    click: function(){
222                                                        window.location.href = "/favorite/";
223                                                    }
224                                                },
225                                                style: {marginRight: '10px'}
226                                            }),
227                                            new BasketButton({
228                                                text: "Продолжить покупки",
229                                                events: {
230                                                    click: function(){
231                                                        this.popupWindow.close();
232                                                    }
233                                                }
234                                            })
235                                        ]
236                                    }
237                                );
238
239                                popup.show();
240                            } else {
241                                $el.removeClass('active');
242                            }
243
244                            if(data.success) {
245                            	if($('.heart_icon_block .green_circle').length) {
246                            		if(parseInt(data.count) > 0) {
247                                        $('.heart_icon_block .green_circle').each(function () {
248                                           $(this).text(data.count);
249                                        });
250                                    } else {
251                                        $('.heart_icon_block .green_circle').remove();
252									}
253								} else {
254                                    if(parseInt(data.count) > 0) {
255                                        $('.heart_icon_block').each(function () {
256                                            $(this).append("<div class='green_circle'>" + data.count + "</div>");
257                                        });
258                                    }
259								}
260							}
261                        }
262                        if(refresh == "Y") {
263							window.location.reload();
264						}
265                    }
266				});
267			}
268
269			return false;
270        });
271	});
272}(jQuery));
273
274
275(function($) {
276
277    window.pageItems = window.pageItems ? window.pageItems : [];
278
279    //$('#request_call').iziModal();
280
281    $('#search-addresses input[type=submit]').click(function (e) {
282        e.preventDefault();
283
284        $('#search-addresses input[name="search-addresses"]').trigger('input');
285        return false;
286    });
287
288    $('#search-addresses input[name="search-addresses"]').bind('input', function () {
289        var search = $(this).val();
290
291        $('.address-list li, .map-container .marker-info').each(function () {
292            var address = $(this).data('address');
293
294            if(address.toLowerCase().indexOf(search.toLowerCase()) < 0) {
295                $(this).addClass('hidden');
296            } else {
297                $(this).removeClass('hidden');
298            }
299        });
300    });
301
302    var modal_forgot = $('#popup-forgot').iziModal();
303    $('#popup-forgot').on('submit','form',function(){
304
305        var form_action = $(this).attr('action');
306        var form_backurl = $(this).find('input[name="backurl"]').val();
307
308        modal_forgot.iziModal('startLoading');
309        $.ajax({
310            type: "POST",
311            url: '/local/ajax/actions.php',
312            data: $(this).serialize(),
313            timeout: 3000,
314            error: function(request,error) {
315                /*if (error == "timeout") {
316                    alert('timeout');
317                } else {
318                    alert('Error! Please try again!');
319                }*/
320            },
321            success: function(data) {
322                $('#popup-forgot .iziModal-content').html(data);
323                Recaptchafree.reset();
324                modal_forgot.iziModal('stopLoading');
325
326                $('#popup-forgot form').attr('action',form_action);
327                $('#popup-forgot input[name=backurl]').val(form_backurl);
328            }
329        });
330
331        return false;
332    });
333
334    var modal_reg = $('#popup-reg').iziModal();
335    $('#popup-reg').on('submit','form',function(){
336
337        var form_action = $(this).attr('action');
338        var form_backurl = $(this).find('input[name="backurl"]').val();
339
340        modal_reg.iziModal('startLoading');
341        $.ajax({
342            type: "POST",
343            url: '/local/ajax/actions.php',
344            data: $(this).serialize(),
345            timeout: 3000,
346            error: function(request,error) {
347                /*if (error == "timeout") {
348                    alert('timeout');
349                } else {
350                    alert('Error! Please try again!');
351                }*/
352            },
353            success: function(data) {
354                $('#popup-reg .iziModal-content').html(data);
355                Recaptchafree.reset();
356                $('#popup-reg .cardID').mask( '9999 9999 9999 9999',{ "placeholder": "" } );
357                modal_reg.iziModal('stopLoading');
358
359                $('#popup-reg form').attr('action',form_action);
360                $('#popup-reg input[name=backurl]').val(form_backurl);
361            }
362        });
363
364        return false;
365    });
366
367    var modal_auth = $('#popup-auth').iziModal();
368    $('#popup-auth').on('submit','form',function(){
369
370        var form_action = $(this).attr('action');
371        var form_backurl = $(this).find('input[name="backurl"]').val();
372
373        modal_auth.iziModal('startLoading');
374        $.ajax({
375            type: "POST",
376            url: '/local/ajax/actions.php',
377            data: $(this).serialize(),
378            timeout: 3000,
379            error: function(request,error) {
380                /*if (error == "timeout") {
381                    alert('timeout');
382                }
383                else {
384                    alert('Error! Please try again!');
385                }*/
386            },
387            success: function(data) {
388                $('#popup-auth .iziModal-content').html(data);
389                Recaptchafree.reset();
390                modal_auth.iziModal('stopLoading');
391
392                $('#popup-auth form').attr('action',form_action);
393                $('#popup-auth input[name=backurl]').val(form_backurl);
394            }
395        });
396
397        return false;
398    });
399
400	$("#request_call").iziModal({
401
402		onOpening: function(modal){
403
404			modal.startLoading();
405
406			$.get('/ajax/callback.php', function(data) {
407				$("#request_call .iziModal-content").html(data);
408
409				modal.stopLoading();
410			});
411		}
412
413	});
414
415
416    $( '.request_call' ).click( function(){
417       $( '#request_call' ).iziModal('open');
418
419    });
420
421
422
423
424    window.cartAccessories = function (ID, PRODUCT_ID, select) {
425		$.ajax({
426			url: "/local/ajax/cart_accessories.php",
427            data: {ID: PRODUCT_ID, CATEGORY_ID: select.value},
428            dataType: 'html',
429            type: "POST",
430            success: function (html) {
431                BX.cleanNode(BX(ID));
432                $(BX(ID)).html(html);
433
434
435                $(BX(ID)).find( '.accessories-slider' ).slick({
436                    slidesToShow: 5,
437                    slidesToScroll: 1,
438                    arrows: true,
439                    fade: false,
440                    infinite: false,
441                    responsive: [
442                        {
443                            breakpoint: 1500,
444                            settings: {
445                                slidesToShow: 4
446                            }
447                        },
448                        {
449                            breakpoint: 1200,
450                            settings: {
451                                slidesToShow: 5
452                            }
453                        },
454                        {
455                            breakpoint: 992,
456                            settings: {
457                                slidesToShow: 3
458                            }
459                        },
460                        {
461                            breakpoint: 769,
462                            settings: {
463                                slidesToShow: 1,
464                                dots: true
465                            }
466                        }
467                    ]
468                });
469
470                $(BX(ID)).find( '.accessories-slider' ).each( function(){
471                    $accessoriesSlideNumber = $(this).find( '.accessories-slide' ).length;
472                    $(this).after( '<span class="number-of-slides">/' + $accessoriesSlideNumber + '</span>' );
473                });
474            }
475		})
476    };
477
478	$(document).ready(function() {
479
480	    $('.btn-pay').click(function (e) {
481	        e.preventDefault();
482            $(this).parent().find('form').submit();
483            return false;
484        });
485
486	    $('.order-row .top-line').click(function () {
487            var $parent = $(this).parents('.order-row');
488
489            $parent.find('.helper').addClass('active');
490            $parent.find('.order-row-hidden').slideToggle();
491        });
492
493	    window.initFastOrder = function () {
494            $('#fast_order_form').submit(function(e) {
495                e.preventDefault();
496
497                if ($(this).find('input.error').length > 0 ) {
498                    return false;
499                }
500
501                var $form = $(this);
502                $form.addClass('load')
503                $.ajax({
504                    url: $form.attr('action'),
505                    type: 'post',
506                    data: $form.serialize(),
507                    dataType: 'html',
508                    success: function (content) {
509                        var fast_order_html =  $(content).find('#fast_order_form').html();
510                        $form.html(fast_order_html);
511
512                        Recaptchafree.reset();
513                    }
514                });
515
516                return false;
517            });
518        };
519
520        $("#fast_order").iziModal({
521            onOpening: function(modal){
522                modal.startLoading();
523
524                var obj = $('#fast_order').data('obname'),
525                    element = window[obj],
526                    id = false;
527
528                switch (element.productType)
529                {
530                    case 1: // product
531                    case 2: // set
532                        id = element.product.id.toString();
533                        break;
534                    case 3: // sku
535                        id = element.offers[element.offerNum].ID;
536                        break;
537                }
538
539                $.get('/local/ajax/fast_order.php?PRODUCT_ID=' + id, function(data) {
540                    $("#fast_order .iziModal-content").html(data);
541                    Recaptchafree.reset();
542
543                    modal.stopLoading();
544                });
545            }
546        });
547
548	    $('.fast_order').click(function () {
549            $("#fast_order").iziModal('open');
550        });
551
552	    $('.address-list > li.row').click(function () {
553            $(this).find('input[name="address"]').prop('checked', true).trigger('change');
554        });
555
556	    $('#main_cart_two_block input[name="address"]').change(function () {
557	        var id = $(this).val();
558
559	        $('.address_selected').removeClass('address_selected');
560
561	        $('[data-id="' + id + '"]').addClass('address_selected').find('input[name=address_map]').prop('checked', true);
562	        $('#ORDER_ADDRESS').val(id);
563        });
564
565	    $('#main_cart_two_block input[name="address_map"]').change(function () {
566	        var id = $(this).val();
567            $('#main_cart_two_block input[name="address"]').filter('[value="' + id + '"]').prop('checked', true).trigger('change');
568        });
569
570	    $('.add_comment').click(function () {
571            $(this).parent().find('.comment-block').fadeIn(300);
572	        $(this).remove();
573        });
574
575	    $('#fav_buy_all').click(function () {
576            window.addCount = 0;
577            $('#main_favorites_block').addClass('load');
578	        $.each(window.pageItems, function (i, item) {
579                item.sendToBasketSilent();
580            });
581            var inter = setInterval(function () {
582                if(window.addCount == window.pageItems.length) {
583                    clearInterval(inter);
584                    BX.onCustomEvent('OnBasketChange');
585
586                    var popup = new BX.PopupWindow(
587                        "add_success",
588                        null,
589                        {
590                            autoHide: true,
591                            offsetLeft: 0,
592                            offsetTop: 0,
593                            overlay : true,
594                            closeByEsc: true,
595                            closeIcon: true,
596                            content: "Все товары успешно добавлены",
597                            titleBar: "Удачно",
598                            buttons: [
599                                new BX.PopupWindowButton({
600                                    text: "Закрыть" ,
601                                    className: "purple_btn" ,
602                                    events: {
603                                        click: function(){
604                                            this.popupWindow.close();
605                                        }
606                                    }
607                                })
608                            ]
609                        }
610                    );
611
612                    popup.show();
613                    $('#main_favorites_block').removeClass('load');
614                }
615            }, 500);
616        });
617
618		$('body').delegate('.personal-data-list .pencil-icon', 'click', function () {
619			var $parent = $(this).parent();
620            $parent.find('span').remove();
621            $parent.find('input').fadeIn(500);
622            $(this).remove();
623        });
624
625        var url = document.location.toString();
626        if (url.match('#') && $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').length) {
627            $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
628            $('html, body').animate({
629                scrollTop: $("#" + url.split('#')[1]).offset().top
630            }, 500);
631        }
632
633        $(window).bind('hashchange', function() {
634            var url = document.location.toString();
635            if (url.match('#')) {
636                var hash = url.split('#')[1];
637
638                    $('.bx-catalog-element .nav-tabs a[href="#' + hash + '"]').trigger('click');
639
640                if($('#' + hash).length) {
641                    $('html, body').animate({
642                        scrollTop: $("#" + hash).offset().top
643                    }, 500);
644                }
645            }
646        });
647
648        $('#main_item_block a').click(function () {
649            var url = $(this).attr('href');
650            if (url.match('#')) {
651                var hash = url.split('#')[1];
652                if($('#' + hash).length) {
653                    if($('.nav-tabs a[href="#' + url.split('#')[1] + '"]').length)
654                        $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
655
656                    $('html, body').animate({
657                        scrollTop: $("#" + hash).offset().top
658                    }, 500);
659                }
660            }
661        });
662
663		/*if( $( '#main_cart_two_block' ).length > 0 ){
664			$heightOfContentBlocks = 0;
665			$( '#main_cart_two_block .row .main-content-col > div' ).each( function(){
666				if( !$(this).hasClass( 'tab-content' ) ){
667					$heightOfContentBlocks += $(this).outerHeight();
668				}
669			});
670			$sidebarHeight = 0
671			$( '.right-sidebar-col > div' ).each( function(){
672				$sidebarHeight += $(this).outerHeight();
673			});
674			$mapsTabHeight = $( '.main-content-col .tab-content .nav-tabs' ).outerHeight();
675
676			$heightDifference = $sidebarHeight - $heightOfContentBlocks - $mapsTabHeight;
677			$( '.map-container' ).each( function(){
678				$(this).height($heightDifference);
679			});
680		}*/
681
682		$( '#on-map .nav-left-panel .marker-info .top-block .arrow' ).click( function(){
683			$(this).parents( '.marker-info' ).children( '.bottom-block' ).slideToggle();
684			$(this).toggleClass( 'active' );
685		});
686
687		/* matchHeight */
688		//$( ".product-preview" ).matchHeight();
689		$( ".product-preview .title" ).matchHeight();
690		$(window).resize(function () {
691            $( ".product-preview .title" ).matchHeight();
692        });
693
694		$windowWidth = $(window).width();
695		$itemRating =  $( "#item_short_info .last-short-comment .stars-and-comments-block" );
696		$addToCartBlock = $( "#add-to-cart-block" );
697		$footnote = $( "#item_short_info_block .footnote" );
698		$itemRightInfoBlock = $( "#item_short_info .right_info_block" );
699		$mostImportantContentTitle = $( "span.most-important-comment" );
700		$itemGift = $( '#item-short_gift' );
701
702		function makeSelectMenu( $elem, $activeWidth ){
703			if( $( $elem ).length > 0 ){
704				$( $elem ).click( function(){
705					$(this).parent('div').children('ul').slideToggle();
706				});
707				$nameOfSelectedElem = $( $elem ).parent('div').children('ul').children( 'li.active' ).children( 'a' ).html();
708				$( $elem ).children( 'span' ).html( $nameOfSelectedElem );
709				$( $elem ).parent('div').children('ul').children( 'li' ).children( 'a' ).click( function(){
710					if( $windowWidth < $activeWidth ){
711						$(this).parent( 'li' ).parent( 'ul' ).slideUp();
712					}
713					$nameOfSelectedElem = $(this).html();
714					$( $elem ).children( 'span' ).html( $nameOfSelectedElem );
715				});
716			}
717		}
718		makeSelectMenu( '.mobile-select-block.left-menu', 576 );
719		makeSelectMenu( '.orders-lists-mobile', 768 );
720
721		if( $( '#mailing-settings' ).length > 0 ){
722			$( '#tumbler' ).click( function(){
723				if( $(this).children( 'input' ).prop( 'checked' ) ){
724					$( '.mailing-option input' ).each( function(){
725						$(this).removeAttr( "disabled", true);
726						$(this).prop( "checked", true );
727					});
728				} else {
729					$( '.mailing-option input' ).each( function(){
730						$(this).attr( "disabled", true);
731						$(this).prop( "checked", false );
732					});
733				}
734			});
735		}
736
737		function style_block_height_auto(){
738			if( $( '.style_block' ).length > 0 ){
739				if($windowWidth < 768){
740					$( '.style_block' ).each( function(){
741						$fullHeight = $(this).children( '.content' ).height() + 40;
742						$(this).height( $fullHeight );
743					});
744				}
745			}
746		}
747		style_block_height_auto();
748
749		function squareThumb( $elem ){
750			if( $( $elem ).length > 0 ){
751				$( $elem ).each( function(){
752					$(this).height( $(this).width() );
753				});
754			}
755		}
756
757		function squareThumbAndMatchHeight( $elem ){
758			if( $( $elem ).length > 0 ){
759				$( $elem ).each( function(){
760					$(this).height( $(this).width() );
761				});
762				$parentBlock = $( $elem ).parent().parent()
763				$parentBlock.children( '.under_thumb' ).matchHeight();
764				$parentBlock.matchHeight();
765			}
766		}
767
768		squareThumb( '#main_news_inside_block .content_row > div > .news_inside > .thumb' );
769		squareThumbAndMatchHeight( '#main_news_block .news_preview .thumb' );
770		squareThumbAndMatchHeight( '#main_news_inside_block .news_preview .thumb' );
771
772		squareThumb( '#main_review_inside_block .review_inside .thumb' );
773		squareThumbAndMatchHeight( '#main_reviews_block .news_preview .thumb' );
774		squareThumbAndMatchHeight( '#main_reviews_inside_block .news_preview .thumb' );
775
776		squareThumb( '#main_review_inside_block .right-sidebar .product-preview .top-block' );
777
778		if( $( '#main_contacts_block' ).length > 0 ){
779			var scr = $("#map-block");
780			scr.mousedown(function () {
781				var startX = this.scrollLeft + event.pageX;
782				var startY = this.scrollTop + event.pageY;
783				scr.mousemove(function () {
784					this.scrollLeft = startX - event.pageX;
785					this.scrollTop = startY - event.pageY;
786					return false;
787				});
788			});
789			$(window).mouseup(function () {
790				scr.off("mousemove");
791			});
792/*
793			$(window).click( function(){
794				setTimeout(function(){
795					if( $( '#map' ).is(':visible') ) {
796						if( $( '#map' ).children().length >= 0 ){
797							console.log( 'карту видно' );
798							var map;
799							DG.then(function () {
800								map = DG.map('map', {
801									center: [54.989988,73.367949],
802									zoom: 11
803								});
804
805								DG.marker([54.989988,73.367949]).addTo(map).bindPopup('Вы кликнули по мне!');
806							});
807						}
808					} else {
809						console.log( 'карту НЕ видно' );
810					}
811				}, 500);
812			});
813*/
814		}
815
816		if( $( '#main_cart_one_block' ).length > 0 ){
817
818			$( '.accessories-slider' ).slick({
819				slidesToShow: 5,
820				slidesToScroll: 1,
821				arrows: true,
822				fade: false,
823				infinite: false,
824				responsive: [{
825					breakpoint: 1500,
826					settings: {
827						slidesToShow: 4,
828					}},
829					{breakpoint: 1200,
830					settings: {
831						slidesToShow: 5,
832					}},
833					{breakpoint: 992,
834					settings: {
835						slidesToShow: 3,
836					}},
837					{breakpoint: 769,
838					settings: {
839						slidesToShow: 1,
840						dots: true,
841					}}
842				]
843			});
844
845			$( '.accessories-slider' ).each( function(){
846				$accessoriesSlideNumber = $(this).find( '.accessories-slide' ).length;
847				$(this).after( '<span class="number-of-slides">/' + $accessoriesSlideNumber + '</span>' );
848			});
849		}
850
851		/*
852		if( $( '#check-balance' ).length > 0 ){
853			$( '#check-balance input[type="text"]' ).mask( '9999 9999 9999 9999',{ "placeholder": "" } );
854		}
855		*/
856
857		/*if( $( '#reg-form' ).length > 0 ){
858			$( '#reg-form .cardID' ).mask( '9999 9999 9999 9999',{ "placeholder": "" } );
859		}*/
860        $( '.cardID' ).mask( '9999 9999 9999 9999',{ "placeholder": "" } );
861
862		$( "#left-sidebar-for-mobile" ).on( "click", ".arrow_right_icon", function(){
863			//$(this).parent( "li" ).toggleClass( "active" );
864			//$(this).parent( "li" ).siblings().removeClass( "active" );
865			$(this).parent( "li" ).siblings().children( 'ul' ).slideUp();
866			$(this).parent( 'li' ).children( 'ul' ).slideToggle();
867		});
868
869		if( $( '#main_item_block' ).length > 0 ){
870			if( $windowWidth < 576 ){
871				$iconBlock = $( '#main_item_block .top-block-content' ).children( '.icon_block' );
872				$( '#main_item_block .top-block-content' ).children( '.icon_block' ).remove();
873				$( '#main_item_block #item_short_info .left_info_block' ).append( $iconBlock );
874			}
875		}
876
877		if( $( '#manufacturers' ).length > 0 ){
878			$( '#manufacturers' ).slick({
879				slidesToShow: 8,
880				slidesToScroll: 1,
881				arrows: false,
882				fade: false,
883				infinite: true,
884				responsive: [{
885					breakpoint: 1200,
886					settings: {
887						slidesToShow: 4,
888						arrows: true,
889						fade: false,
890					}},{
891					breakpoint: 992,
892					settings: {
893						slidesToShow: 3,
894						arrows: true,
895						fade: false,
896					}},{
897					breakpoint: 576,
898					settings: {
899						slidesToShow: 2,
900						arrows: true,
901						fade: false,
902					}},{
903					breakpoint: 420,
904					settings: {
905						slidesToShow: 1,
906						arrows: true,
907						fade: false,
908					}}
909				]
910			});
911		}
912
913		if( $( '#main_about_block .fourth_row .list-elem' ).length > 0 ){
914			if( $windowWidth > 992 ){
915				$elemHeight = $( '#main_about_block .fourth_row .list-elem.first' ).height();
916				$( '#main_about_block .fourth_row .list-elem.third' ).height( $elemHeight );
917			}
918		}
919
920
921		if( $( '#main_compare_block' ) ){
922
923			$showDifferences = $( '.main-col .line1 #tumbler' );
924
925			$linesNum = $( '.main-col .line' ).length;
926
927			setTimeout( sameLineHeight(), 2000 );
928			function sameLineHeight( $a ){
929                $a = $a ? $a : 0;
930				$( '.line' ).height( 'auto' );
931				for( $i = 1; $i <= $linesNum; $i++ ){
932					$maxHeight = 0;
933					$( '.line' + $i ).each( function(){
934						if( $(this).height() > $maxHeight ){
935							$maxHeight = $(this).height();
936						};
937					});
938
939					$( '.line' + $i ).each( function(){
940						$(this).height( $maxHeight + $a );
941					});
942				}
943				if( $windowWidth < 992 ){
944					$firstLineHeight = $( '.main-col .line1' ).height();
945					$margin = $firstLineHeight + 31;
946					$( '.main-col .line1' ).hide();
947					$( '.main-col' ).css({'margin-top':$margin})
948				} else {
949					$( '.main-col .line1' ).show();
950					$( '.main-col' ).css({'margin-top':'0'});
951				}
952			}
953
954			$numberOfLine = 5; // пропускаем первые 4 строки, начинаем с пятой
955			function findeDifferences(){
956				if( $numberOfLine <= $linesNum ){
957					$numColInThisLine = $( '.one-col .line' + $numberOfLine ).length;
958					$arr = [];
959					$( '.one-col .line' + $numberOfLine + ' .light-text' ).each( function(){
960						$arr.push( $(this).html() );
961					});
962					$j = 0;
963					findeDifferencesInLine();
964					function findeDifferencesInLine(){
965						if( ( $j < ( $numColInThisLine - 1 ) ) ){
966							if( $arr[$j] == $arr[$j+1] ){
967								$j++;
968								findeDifferencesInLine();
969							} else {
970								$( '.line' + $numberOfLine ).addClass( 'differences' );
971								return false;
972							}
973						}
974					}
975					$numberOfLine++;
976					findeDifferences();
977				}
978			}
979
980			$( '#main_compare_block' ).on( 'click', '.toggle-btn.off', function(){
981				findeDifferences();
982                $('.toggle-btn').removeClass( 'off' );
983				$('.toggle-btn').addClass( 'on' );
984			});
985
986			$( '#main_compare_block' ).on( 'click', '.toggle-btn.on', function(){
987                $('.toggle-btn').removeClass( 'on' );
988                $('.toggle-btn').addClass( 'off' );
989				$('.line').removeClass( 'differences' );
990				$numberOfLine = 5;
991			});
992
993			window.compareInit = function () {
994                $( '.products-cols' ).on('init', function(event, slick){
995                    sameLineHeight()
996                }).slick({
997                    slidesToShow: 4,
998                    slidesToScroll: 1,
999                    arrows: true,
1000                    fade: false,
1001                    infinite: false,
1002                    draggable: false,
1003                    responsive: [{
1004                        breakpoint: 1200,
1005                        settings: {
1006                            slidesToShow: 3,
1007                        }},{
1008                        breakpoint: 992,
1009                        settings: {
1010                            slidesToShow: 2,
1011                        }}
1012                    ]
1013                });
1014            };
1015            compareInit();
1016
1017			function takeColNumber(){
1018				$colNumber = $( '.products-cols .one-col' ).length;
1019				$firstColNum = $( '.products-cols .one-col.slick-current' ).data( "slickIndex" ) + 1;
1020				if( $colNumber > 1 ){
1021					$secondColNum = $firstColNum + 1;
1022					$showColNum = $firstColNum + ', ' + $secondColNum;
1023					$( '.colNumber' ).html( $showColNum + ' / ' + $colNumber );
1024				} else if( $colNumber == 1 ) {
1025					$( '.colNumber' ).html( '1 / 1' );
1026				} else {
1027					$( '.colNumber' ).html('');
1028				}
1029			}
1030
1031			$( '.line1 .close_btn' ).on( 'click', function(){
1032				$slideIndex = $(this).parent( '.line' ).parent( '.one-col' ).data('slickIndex');
1033				$( '.products-cols' ).slick( 'slickRemove', $slideIndex );
1034				if ( $slideIndex !== 0){
1035					$slideIndex--;
1036				}
1037				$( '.products-cols' ).slick('refresh');
1038				takeColNumber();
1039			});
1040
1041			takeColNumber();
1042
1043			$( '.products-cols' ).on( 'click', '.slick-arrow', function(){
1044				takeColNumber();
1045			});
1046
1047			if( $windowWidth < 1200 ){
1048				$( '.main-col .line1 #tumbler' ).remove();
1049				$( '.page_title_row h1' ).after( $showDifferences );
1050			}
1051		}
1052
1053
1054		$( '#line-with-tabs ul li a' ).each( function(){
1055			$(this).click( function(){
1056				$( '#line-with-tabs ul li' ).removeClass( 'active' );
1057				$(this).parent( 'li' ).addClass( 'active' );
1058				$link = $(this).attr('href');
1059				$elemId = $link.substring(1, $link.length);
1060				$( "#big-info-block .tab-content-custom > a").each( function(){
1061					if( $(this).attr('href') != $link ){
1062						$(this).removeClass('active');
1063					} else {
1064						$(this).addClass('active');
1065					}
1066				});
1067				$( '#big-info-block .tab-content-custom > .tab-pane' ).each( function(){
1068					if( $(this).attr('id') != $elemId ){
1069						$(this).removeClass('active');
1070					} else {
1071						/*$heightOfThis = $(this).height();
1072						if( $(this).attr( 'id' ) == 'item-accessories' ){
1073							if( $windowWidth > 992 ){
1074								$(this).parent( '.tab-content-custom' ).height( $heightOfThis + 64 );
1075							}
1076						} else {
1077							if( $windowWidth > 992 ){
1078								$(this).parent( '.tab-content-custom' ).height( $heightOfThis + 84 );
1079							}
1080						}*/
1081					}
1082				});
1083				$($link).addClass('active');
1084
1085				return false;
1086			});
1087		});
1088
1089		$( "#big-info-block .tab-content-custom > a").each( function(){
1090			$(this).click( function(){
1091				setTimeout( reviewHeightFunc, 10 );
1092				function reviewHeightFunc(){
1093					$( "#item-review .one-review" ).matchHeight();
1094				}
1095				$( '#item-accessories .all-accessories .slick-prev' ).click();
1096				$( "#big-info-block .tab-content-custom > a").not(this).removeClass('active');
1097				$(this).toggleClass( 'active' );
1098				$link = $(this).attr("href");
1099				$elemId = $link.substring(1, $link.length);
1100				$( '#line-with-tabs ul li a' ).each( function(){
1101					if( $(this).attr('href') != $link ){
1102						$(this).parent( 'li' ).removeClass('active');
1103					} else {
1104						$(this).parent( 'li' ).addClass('active');
1105					}
1106				});
1107				$( "#big-info-block .tab-content-custom > div" ).not( $link ).removeClass('active');
1108				$( $link ).toggleClass('active');
1109				return false;
1110			});
1111		});
1112
1113		/*if( $windowWidth > 992 ){
1114			$itemInfoContentHeight = $( '#big-info-block .tab-content-custom .tab-pane.active' ).height();
1115			$( '#big-info-block .tab-content-custom' ).height( $itemInfoContentHeight + 84 );
1116		} else {
1117			$( '#big-info-block .tab-content-custom' ).height('auto');
1118		}*/
1119
1120		/*if( $windowWidth < 1200 ){
1121			$( "#item_short_info .last-short-comment .stars-and-comments-block" ).remove();
1122			$( "#main_item_block .top_block" ).append( $itemRating );
1123			$( "#add-to-cart-block" ).remove();
1124			$( "#item_short_info .left_info_block ul li:first-child" ).after( $addToCartBlock );
1125			$( "#item_short_info_block .footnote" ).remove();
1126			$( "#item_short_info .left_info_block ul #add-to-cart-block" ).after( $footnote );
1127			$( "#item_short_info .right_info_block" ).remove();
1128			$( "#item_short_info .left_info_block ul .footnote" ).after( $itemRightInfoBlock );
1129		}
1130        */
1131
1132		/* send form after choose select options */
1133		$( '#top-result-line .custom-select .cs-options li span' ).click( function() {
1134			setTimeout( function(){
1135				$( '#sort-and-show-btn' ).click();
1136			}, 500);
1137		});
1138
1139		$( ".left-sidebar .close_btn" ).click( function(){
1140			$( ".left-sidebar" ).slideUp();
1141		});
1142
1143		$( "#header-hamburger" ).click( function(){
1144			$( "#left-sidebar-for-mobile" ).slideToggle();
1145			$(this).children( '.social_btn' ).toggleClass( 'active' );
1146		});
1147		$( '#left-sidebar-for-mobile .close_btn' ).click( function(){
1148			$( "#left-sidebar-for-mobile" ).slideUp();
1149		});
1150
1151		$( '#top-logo-block .social_btn.search' ).click( function(){
1152			$( '#bg_search_popup_for_mobile' ).fadeIn();
1153		});
1154		$( "#bg_search_popup_for_mobile .close_btn" ).click( function(){
1155			$( "#bg_search_popup_for_mobile" ).fadeOut();
1156		});
1157
1158		/*$( "#main_block .block-with-checkbox .body label" ).click( function(){
1159			$(this).toggleClass("active");
1160			if( $(this).hasClass("active") ){
1161				$labelText = $(this).html();
1162				$inputID = $(this).attr("for");
1163				$( "#bottom-result-line ul" ).append( '<li class="filter-result-options ' + $inputID + '" data-parent-input="' + $inputID + '"><span>' + $labelText + '</span></li>' );
1164				if( !$( "#bottom-result-line" ).children( ".remove-all-options" ).length > 0 ){
1165					$( "#bottom-result-line" ).append( '<div class="remove-all-options">Сбросить фильтры</div>' );
1166				}
1167			} else {
1168				$inputID = $(this).attr("for");
1169				$( "#bottom-result-line li.filter-result-options." + $inputID ).remove();
1170				if( !$( "#bottom-result-line ul" ).children( "li" ).length > 0 ){
1171					$( "#bottom-result-line .remove-all-options" ).remove();
1172				}
1173			}
1174		});*/
1175
1176		$( '#top-menu-line .second_menu_title' ).click( function(){
1177			$( '#top-menu-line .show-more' ).slideToggle();
1178			$( '.catalog_menu' ).slideUp();
1179		});
1180
1181		$( '.top-menu-line .second_menu_title' ).click( function(){
1182			$( '#top-menu-line .show-more' ).slideToggle();
1183			$( '.catalog_menu' ).slideUp();
1184		});
1185
1186		$( '#top-menu-line ul.show-more li' ).each( function(){
1187			if( $(this).children( 'ul' ).length > 0 ){
1188				$(this).children( 'a' ).after( '<div class="arrow_down_icon icon"></div>' );
1189			}
1190		});
1191
1192		$( '.top-menu-line ul.show-more li' ).each( function(){
1193			if( $(this).children( 'ul' ).length > 0 ){
1194				$(this).children( 'a' ).after( '<div class="arrow_down_icon icon"></div>' );
1195			}
1196		});
1197
1198		$( '#top-menu-line .second_menu' ).children( '.show-more' ).children( 'li' ).each( function(){
1199			$(this).hover( function(){
1200				$( '.catalog_menu li' ).removeClass( 'active' );
1201				if( $(this).children( 'ul' ).length > 0 ){
1202					//$( '#top-menu-line .second_menu .show-more li' ).not(this).children( 'ul' ).hide();
1203					$(this).children( 'ul' ).show();
1204					if( $( "body" ).hasClass( "home-page" ) && ( $windowWidth >= 1200 ) ){
1205						$( '.catalog_menu' ).show();
1206					}
1207				}
1208			}, function() {
1209              //  $( '.catalog_menu li' ).addClass( 'active' );
1210                $(this).children( 'ul' ).hide();
1211            });
1212		});
1213
1214		$( '.top-menu-line .second_menu' ).children( '.show-more' ).children( 'li' ).each( function(){
1215			$(this).hover( function(){
1216				$( '.catalog_menu li' ).removeClass( 'active' );
1217				if( $(this).children( 'ul' ).length > 0 ){
1218					$( '#top-menu-line .second_menu .show-more li' ).not(this).children( 'ul' ).slideUp();
1219					$(this).children( 'ul' ).slideToggle();
1220					if( !$( "body" ).hasClass( "home-page" ) && ( $windowWidth >= 1200 ) ){
1221						$( '.catalog_menu' ).slideUp();
1222					}
1223				}
1224			});
1225		});
1226
1227		$( "#bottom-result-line ul" ).on( "click", "span", function(){
1228			if( $(this).parent().hasClass("price") ){
1229				$( "#main_block .block-with-two-input .body input#min-price" ).val("");
1230				$( "#main_block .block-with-two-input .body input#max-price" ).val("");
1231			} else if( $(this).parent().hasClass("diagonal") ){
1232				$( "#main_block .block-with-two-input .body input#min-diagonal" ).val("");
1233				$( "#main_block .block-with-two-input .body input#max-diagonal" ).val("");
1234			} else {
1235				$parentID = $(this).parent().data( "parentInput" );
1236				$( '[for = ' + $parentID + ']' ).first().removeClass("active");
1237				$( "#" + $parentID ).click();
1238			}
1239			$(this).parent().remove();
1240			if( !$( "#bottom-result-line ul" ).children( "li" ).length > 0 ){
1241				$( "#bottom-result-line .remove-all-options" ).remove();
1242			}
1243		});
1244
1245		$( "#bottom-result-line" ).on( "click", ".remove-all-options", function(){
1246			$( "#bottom-result-line li" ).remove();
1247			$( "#main_block .block-with-checkbox .body label.active" ).each( function(){
1248				$inputID = $(this).attr("for");
1249				$( "#" + $inputID ).click();
1250			});
1251			$( "#main_block .block-with-checkbox .body label.active" ).removeClass("active");
1252			$( "#main_block .block-with-two-input .body input#min-price" ).val("");
1253			$( "#main_block .block-with-two-input .body input#max-price" ).val("");
1254			$( "#main_block .block-with-two-input .body input#min-diagonal" ).val("");
1255			$( "#main_block .block-with-two-input .body input#max-diagonal" ).val("");
1256			$(this).remove();
1257		});
1258
1259		$( "body" ).delegate("#main_block .left-sidebar-filter li .title", "click", function(){
1260			$(this).parent().children(".body").slideToggle();
1261			$(this).children( '.arrow_down' ).toggleClass('rotate');
1262		});
1263
1264		if( $( '#main_search_block' ).length > 0 ){
1265			$( "#main_search_block .left-sidebar-filter li .title" ).click( function(){
1266				$(this).parent().children(".body").slideToggle();
1267				$(this).children( '.arrow_down' ).toggleClass('rotate');
1268			});
1269		}
1270
1271		if( $( '#main_izumstyle_block' ).length > 0 ){
1272			$( "#main_izumstyle_block .left-sidebar-filter li .title" ).click( function(){
1273				$(this).parent().children(".body").slideToggle();
1274				$(this).children( '.arrow_down' ).toggleClass('rotate');
1275			});
1276		}
1277
1278		function customSubmit( $form ){
1279			$minPrice = $( "input[name='min-price']" ).val();
1280			$maxPrice = $( "input[name='max-price']" ).val();
1281			$minDiagonal = $( "input[name='min-diagonal']" ).val();
1282			$maxDiagonal = $( "input[name='max-diagonal']" ).val();
1283			if( !$minPrice ){
1284				$( "input[name='min-price']" ).val(1);
1285				$minPrice = 1;
1286			}
1287			if( !$minDiagonal ){
1288				$( "input[name='min-diagonal']" ).val(1);
1289				$minDiagonal = 1;
1290			}
1291			if( ($maxPrice < $minPrice) || (!$maxPrice) ){
1292				$( "input[name='max-price']" ).val( $minPrice );
1293			}
1294			if( ($maxDiagonal < $minDiagonal) || (!$maxDiagonal) ){
1295				$( "input[name='max-diagonal']" ).val( $minDiagonal );
1296			}
1297			$( $form ).submit();
1298		}
1299
1300        /* function for add option from filter to the top of the page */
1301		function twoInputOption( $min, $max, $type, $postfix){
1302            $postfix = $postfix ? $postfix : '';
1303
1304			if( !$( "#bottom-result-line ul" ).children( "li." + $type ).length > 0 ){
1305				$( "#bottom-result-line ul" ).append( '<li class="filter-result-options ' + $type + '" data-parent-input="' + $type + '"><span>' + $min + $postfix + ' - ' + $max + $postfix + '</span></li>' );
1306				if( !$( "#bottom-result-line" ).children( ".remove-all-options" ).length > 0 ){
1307					$( "#bottom-result-line" ).append( '<div class="remove-all-options">Сбросить фильтры</div>' );
1308				}
1309				/*customSubmit( "#main_block .left-sidebar form");*/
1310			} else {
1311				$( "#bottom-result-line ul li." + $type ).remove();
1312				$( "#bottom-result-line ul" ).append( '<li class="filter-result-options ' + $type + '" data-parent-input="' + $type + '"><span>' + $min + $postfix + ' - ' + $max + $postfix + '</span></li>' );
1313				if( !$( "#bottom-result-line" ).children( ".remove-all-options" ).length > 0 ){
1314					$( "#bottom-result-line" ).append( '<div class="remove-all-options">Сбросить фильтры</div>' );
1315				}
1316				/*customSubmit( "#main_block .left-sidebar form");*/
1317			}
1318		}
1319
1320		$( '#main_block .left-sidebar-filter li.block-with-two-input .body input' ).focusout( function(){
1321			$min = '';
1322			$max = '';
1323			$inputID = $(this).attr("id");
1324			$inputVal = $(this).val();
1325			if( $inputID == "min-price" ){
1326				if( !$inputVal ){
1327					if( !$( "input[name='max-price']" ).val() ){
1328						$min = 1;
1329						$max = 999999;
1330						twoInputOption( $min, $max, "price", " р." );
1331					} else {
1332						$min = 1;
1333						$max = $( "input[name='max-price']" ).val();
1334						twoInputOption( $min, $max, "price", " р." );
1335					}
1336				} else {
1337					if( !$( "input[name='max-price']" ).val() ){
1338						$min = $inputVal;
1339						$max = 999999;
1340						twoInputOption( $min, $max, "price", " р." );
1341					} else {
1342						$min = $inputVal;
1343						$max = $( "input[name='max-price']" ).val();
1344						if( Number($min) > Number($max) ){
1345							$max = $min;
1346							$( "input[name='max-price']" ).val($max);
1347							twoInputOption( $min, $max, "price", " р." );
1348						} else {
1349							twoInputOption( $min, $max, "price", " р." );
1350						}
1351					}
1352				}
1353			} else if( $inputID == "max-price" ){
1354				if( !$inputVal ){
1355					if( !$( "input[name='min-price']" ).val() ){
1356						$min = 1;
1357						$max = 999999;
1358						twoInputOption( $min, $max, "price", " р." );
1359					} else {
1360						$min = $( "input[name='min-price']" ).val();
1361						$max = 999999;
1362						twoInputOption( $min, $max, "price", " р." );
1363					}
1364				} else {
1365					if( !$( "input[name='min-price']" ).val() ){
1366						$min = 1;
1367						$max = $inputVal;
1368						twoInputOption( $min, $max, "price", " р." );
1369					} else {
1370						$min = $( "input[name='min-price']" ).val();
1371						$max = $inputVal;
1372						if( Number($min) > Number($max) ){
1373							$min = $max;
1374							$( "input[name='min-price']" ).val($min);
1375							twoInputOption( $min, $max, "price", " р." );
1376						} else {
1377							twoInputOption( $min, $max, "price", " р." );
1378						}
1379					}
1380				}
1381			} else if( $inputID == "min-diagonal" ){
1382				if( !$inputVal ){
1383					if( !$( "input[name='max-diagonal']" ).val() ){
1384						$min = 1;
1385						$max = 6.8;
1386						twoInputOption( $min, $max, "diagonal", "\"" );
1387					} else {
1388						$min = 1;
1389						$max = $( "input[name='max-diagonal']" ).val();
1390						twoInputOption( $min, $max, "diagonal", "\"" );
1391					}
1392				} else {
1393					if( !$( "input[name='max-diagonal']" ).val() ){
1394						$min = $inputVal;
1395						$max = 6.8;
1396						if( parseFloat($min) > 6.8 ){
1397							$min = 6.8;
1398							$( "input[name='min-diagonal']" ).val($min);
1399							twoInputOption( $min, $max, "diagonal", "\"" );
1400						} else {
1401							twoInputOption( $min, $max, "diagonal", "\"" );
1402						}
1403					} else {
1404						$min = $inputVal;
1405						$max = $( "input[name='max-diagonal']" ).val();
1406						if( parseFloat($min) > 6.8 ){
1407							$min = 6.8;
1408							$max = $min;
1409							$( "input[name='max-diagonal']" ).val($max);
1410							$( "input[name='min-diagonal']" ).val($min);
1411							twoInputOption( $min, $max, "diagonal", "\"" );
1412						} else if( parseFloat($min) > parseFloat($max) ){
1413							$max = $min;
1414							$( "input[name='max-diagonal']" ).val($max);
1415							twoInputOption( $min, $max, "diagonal", "\"" );
1416						} else {
1417							twoInputOption( $min, $max, "diagonal", "\"" );
1418						}
1419					}
1420				}
1421			} else if( $inputID == "max-diagonal" ){
1422				if( !$inputVal ){
1423					if( !$( "input[name='min-diagonal']" ).val() ){
1424						$min = 1;
1425						$max = 6.8;
1426						twoInputOption( $min, $max, "diagonal", "\"" );
1427					} else {
1428						$min = $( "input[name='min-diagonal']" ).val();
1429						$max = 6.8;
1430						twoInputOption( $min, $max, "diagonal", "\"" );
1431					}
1432				} else {
1433					if( !$( "input[name='min-diagonal']" ).val() ){
1434						$min = 1;
1435						$max = $inputVal;
1436						if( parseFloat($max) > 6.8 ){
1437							$max = 6.8;
1438							$( "input[name='max-diagonal']" ).val($max);
1439							twoInputOption( $min, $max, "diagonal", "\"" );
1440						} else {
1441							twoInputOption( $min, $max, "diagonal", "\"" );
1442						}
1443					} else {
1444						$min = $( "input[name='min-diagonal']" ).val();
1445						$max = $inputVal;
1446						if( parseFloat($max) > 6.8 ){
1447							$max = 6.8;
1448							$( "input[name='max-diagonal']" ).val($max);
1449							twoInputOption( $min, $max, "diagonal", "\"" );
1450						} else if( parseFloat($min) > parseFloat($max) ){
1451							$min = $max;
1452							$( "input[name='min-diagonal']" ).val($min);
1453							twoInputOption( $min, $max, "diagonal", "\"" );
1454						} else {
1455							twoInputOption( $min, $max, "diagonal", "\"" );
1456						}
1457					}
1458				}
1459			}
1460
1461		});
1462
1463		/* SLIDER */
1464		function createSliderByClassOrID( $a, number = 3 ){
1465			$( $a ).slick({
1466				infinite: false,
1467				slidesToShow: number,
1468				slidesToScroll: 1,
1469				dots: false,
1470				responsive: [{
1471					breakpoint: 1200,
1472					settings: {
1473						slidesToShow: 2,
1474					}},{
1475					breakpoint: 577,
1476					settings: {
1477						dots: false,
1478						slidesToShow: 1,
1479					}}
1480				]
1481			});
1482		}
1483
1484        $( '.slider-viewed' ).each(function () {
1485            var $this = $(this);
1486            $numberOfSlides = $this.find('.product-preview').length;
1487            num = parseInt($numberOfSlides) > 3 ? 4 : 3;
1488            createSliderByClassOrID( $this, num );
1489            $this.after( '<span class="number-of-slides">' + $numberOfSlides + '</span>' );
1490        });
1491
1492
1493		 $( '.slider-simular' ).each(function () {
1494            var $this = $(this);
1495
1496			$this.slick({
1497				infinite: false,
1498				slidesToShow: 4,
1499				slidesToScroll: 1,
1500				dots: false,
1501				responsive: [{
1502					breakpoint: 1200,
1503					settings: {
1504						slidesToShow: 3,
1505					}},
1506
1507					{
1508					breakpoint: 991,
1509					settings: {
1510						slidesToShow: 2,
1511					}},
1512
1513					{
1514					breakpoint: 577,
1515					settings: {
1516						/* dots: true, */
1517						slidesToShow: 1,
1518					}}
1519				]
1520			});
1521
1522        });
1523
1524		$('a[data-toggle="tab"]').filter('[href="#item-simular"]').on('click', function (e) {
1525
1526			setTimeout(function(){
1527				$('.slider-simular').slick('setPosition');
1528			}, 100)
1529
1530
1531		})
1532
1533
1534		$( ".home-page-top-banner" ).slick({
1535			infinite: true,
1536			slidesToShow: 1,
1537			slidesToScroll: 1,
1538			arrows: true,
1539			dots: true,
1540			autoplay: true,
1541			autoplaySpeed: 5000,
1542			pauseOnFocus: false,
1543			prevArrow: '<div class="prev"></div>',
1544			nextArrow: '<div class="next"></div>',
1545            responsive: [{
1546                breakpoint: 576,
1547                settings: {
1548                    arrows: false,
1549                }}
1550            ]
1551		});
1552
1553		$itemSliders = $( "#item_photo_slider" ).html();
1554		$( "#item_photo_slider_nav" ).append( $itemSliders );
1555
1556		$( "#item_photo_slider" ).slick({
1557			slidesToShow: 1,
1558			slidesToScroll: 1,
1559			arrows: false,
1560			fade: true,
1561			asNavFor: '#item_photo_slider_nav',
1562			responsive: [{
1563				breakpoint: 1200,
1564				settings: {
1565					dots: true,
1566				}}
1567			]
1568		});
1569		$('#item_photo_slider_nav').slick({
1570			slidesToShow: 4,
1571			slidesToScroll: 1,
1572			vertical: true,
1573			verticalSwiping: true,
1574			centerPadding: 0,
1575			asNavFor: '#item_photo_slider',
1576			dots: false,
1577			focusOnSelect: true,
1578			centerMode: true,
1579		});
1580
1581		$( "#main_block .block-with-checkbox .body input[type='checkbox']" ).on( 'change', function(){
1582			/*customSubmit( "#main_block .left-sidebar form");*/
1583		});
1584
1585		$( "#top-logo-block .social_btn.search" ).click( function(){
1586
1587		});
1588
1589		$( ".catalog_menu li" ).each( function(){
1590			if( $(this).children( "ul" ).length > 0 ){
1591				$(this).children( "a" ).after( '<span class="arrow_right_icon icon"></span>' );
1592			}
1593		});
1594
1595		$( ".catalog" ).on( "click", ".arrow_right_icon", function(){
1596			$(this).parent( "li" ).toggleClass( "active" );
1597			$(this).parent( "li" ).siblings().removeClass( "active" );
1598			$( "#top-menu-line .second_menu .show-more li ul" ).slideUp();
1599		});
1600
1601		$( '#top-menu-line .catalog' ).hover( function(){
1602			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1603				$( '.catalog_menu' ).show();
1604				$( '#header-hamburger .social_btn' ).toggleClass( 'active' );
1605				if( $windowWidth < 1200 ){
1606					$( '#top-menu-line .show-more' ).show();
1607					$( '.top-menu-line .show-more' ).show();
1608				} else {
1609					$( '#top-menu-line .show-more ul' ).hide();
1610					$( '.top-menu-line .show-more ul' ).hide();
1611				}
1612			}
1613		}, function(){
1614            if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1615                $( '.catalog_menu' ).hide();
1616            }
1617        });
1618
1619
1620		$( '.body-of-the-page' ).click( function(){
1621			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1622				$( '.catalog_menu' ).slideUp();
1623				$( '.top-menu-line .catalog_menu' ).slideUp();
1624				$( '.second_menu .sub-menu' ).slideUp();
1625				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1626				if( $windowWidth < 1200 ){
1627					$( '#top-menu-line .show-more' ).slideUp();
1628					$( '.top-menu-line .show-more' ).slideUp();
1629				} else {
1630					$( '#top-menu-line .show-more ul' ).slideUp();
1631					$( '.top-menu-line .show-more ul' ).slideUp();
1632				}
1633			}
1634		});
1635
1636		$( '#fixed-header .top-logo-block' ).click( function(){
1637			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1638				$( '.catalog_menu' ).slideUp();
1639				$( '.top-menu-line .catalog_menu' ).slideUp();
1640				$( '.second_menu .sub-menu' ).slideUp();
1641				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1642				if( $windowWidth < 1200 ){
1643					$( '#top-menu-line .show-more' ).slideUp();
1644					$( '.top-menu-line .show-more' ).slideUp();
1645				} else {
1646					$( '#top-menu-line .show-more ul' ).slideUp();
1647					$( '.top-menu-line .show-more ul' ).slideUp();
1648				}
1649			}
1650		});
1651
1652		$( 'footer' ).click( function(){
1653			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1654				$( '.catalog_menu' ).slideUp();
1655				$( '.top-menu-line .catalog_menu' ).slideUp();
1656				$( '.second_menu .sub-menu' ).slideUp();
1657				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1658				if( $windowWidth < 1200 ){
1659					$( '#top-menu-line .show-more' ).slideUp();
1660					$( '.top-menu-line .show-more' ).slideUp();
1661				} else {
1662					$( '#top-menu-line .show-more ul' ).slideUp();
1663					$( '.top-menu-line .show-more ul' ).slideUp();
1664				}
1665			}
1666		});
1667
1668		$( '#top-logo-block' ).click( function(){
1669			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1670				$( '.catalog_menu' ).slideUp();
1671				$( '.top-menu-line .catalog_menu' ).slideUp();
1672				$( '.second_menu .sub-menu' ).slideUp();
1673				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1674				if( $windowWidth < 1200 ){
1675					$( '#top-menu-line .show-more' ).slideUp();
1676					$( '.top-menu-line .show-more' ).slideUp();
1677				} else {
1678					$( '#top-menu-line .show-more ul' ).slideUp();
1679					$( '.top-menu-line .show-more ul' ).slideUp();
1680				}
1681			}
1682		});
1683
1684		$( '#top-partner-line' ).click( function(){
1685			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1686				$( '.catalog_menu' ).slideUp();
1687				$( '.top-menu-line .catalog_menu' ).slideUp();
1688				$( '.second_menu .sub-menu' ).slideUp();
1689				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1690				if( $windowWidth < 1200 ){
1691					$( '#top-menu-line .show-more' ).slideUp();
1692					$( '.top-menu-line .show-more' ).slideUp();
1693				} else {
1694					$( '#top-menu-line .show-more ul' ).slideUp();
1695					$( '.top-menu-line .show-more ul' ).slideUp();
1696				}
1697			}
1698		});
1699
1700		$( '.top-menu-line .catalog' ).hover( function(){
1701
1702            $( '.top-menu-line .catalog_menu' ).slideToggle();
1703            $( '#header-hamburger .social_btn' ).toggleClass( 'active' );
1704            if( $windowWidth < 1200 ){
1705                $( '#top-menu-line .show-more' ).slideUp();
1706                $( '.top-menu-line .show-more' ).slideUp();
1707            } else {
1708                $( '.top-menu-line .show-more ul' ).slideUp();
1709                $( '#top-menu-line .show-more ul' ).slideUp();
1710            }
1711		});
1712
1713		$( '.second_menu .second_menu_item a' ).click( function(){
1714			if( !$( 'body' ).hasClass( 'home-page' ) || ( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth <=1200 ) ) ){
1715				$( '.catalog_menu' ).slideUp();
1716				$( '.top-menu-line .catalog_menu' ).slideUp();
1717				$( '.second_menu .sub-menu' ).slideUp();
1718				$( '#header-hamburger .social_btn' ).removeClass( 'active' );
1719				if( $windowWidth < 1200 ){
1720					$( '#top-menu-line .show-more' ).slideUp();
1721					$( '.top-menu-line .show-more' ).slideUp();
1722				} else {
1723					$( '#top-menu-line .show-more ul' ).slideUp();
1724					$( '.top-menu-line .show-more ul' ).slideUp();
1725				}
1726			}
1727		});
1728
1729		$( '.body-of-the-page' ).click( function(){
1730			$( '.second_menu .sub-menu' ).slideUp();
1731		});
1732
1733		$( '#top-partner-line' ).click( function(){
1734			$( '.second_menu .sub-menu' ).slideUp();
1735		});
1736
1737		$( '#top-logo-block' ).click( function(){
1738			$( '.second_menu .sub-menu' ).slideUp();
1739		});
1740
1741		$( 'footer' ).click( function(){
1742			$( '.second_menu .sub-menu' ).slideUp();
1743		});
1744
1745		$( '#fixed-header .top-logo-block' ).click( function(){
1746			$( '.second_menu .sub-menu' ).slideUp();
1747		});
1748
1749
1750		if( $windowWidth < 1200 ){
1751			$moveBlock = $( '.privacy_policy' );
1752			$( '.privacy_policy' ).remove();
1753			$( '.copyright' ).before( $moveBlock );
1754			$mapPoint = $( '.points_of_issue_block' );
1755			$( '.points_of_issue_block' ).remove();
1756			$( '.partners-block' ).after( $mapPoint );
1757		}
1758
1759		if( $( "#item-accessories" ) && ( $windowWidth < 992 ) ) {
1760			$( "#item-accessories .all-accessories .accessories-block" ).slick({
1761				slidesToShow: 1,
1762				slidesToScroll: 1,
1763				dots: true,
1764				infinite: false,
1765				centerPadding: 0,
1766			});
1767			$numOfAccessoriesSlides = $( "#item-accessories .all-accessories .slick-track .slick-slide" ).length;
1768			$( "#item-accessories .all-accessories .accessories-block").append( '<span class="number-of-slides-accessories"> / ' + $numOfAccessoriesSlides + '</span>' );
1769		}
1770
1771		if( $windowWidth <= 992 ){
1772			$phoneBlock = $( '.phone-block' );
1773			//$( '.phone-block' ).remove();
1774			$( '#top-logo-block .social_btns' ).prepend( $phoneBlock );
1775			$searchForm = $( '#top-logo-block .search_form form' );
1776			$( '#top-logo-block .search_form form' ).remove();
1777			$( '#search-popup' ).append( $searchForm );
1778
1779			$( "span.most-important-comment" ).remove();
1780			$( "#item-comment .comment-block" ).prepend( $mostImportantContentTitle );
1781
1782			//$( '#big-info-block .tab-content-custom .tab-pane' ).hide();
1783		} else {
1784			$searchForm = $( '#search-popup form' );
1785			$( '#search-popup form' ).remove();
1786			$( '#top-logo-block .search_form' ).append( $searchForm );
1787		}
1788
1789		$( '#left-sidebar-for-mobile ul' ).each( function(){
1790			$(this).children( 'li' ).each( function(){
1791				if( $(this).children( "ul" ).length > 0 ){
1792					$(this).children( "ul" ).slideUp();
1793					$(this).children( "a" ).after( '<span class="arrow_right_icon icon"></span>' );
1794				}
1795			});
1796		});
1797
1798		if( $windowWidth <= 576 ){
1799			$breadcrumbs = $( ".breadcrumbs" );
1800			$( ".breadcrumbs" ).remove();
1801			$( "#top-logo-block .row" ).last().after( $breadcrumbs );
1802
1803			$( '#item-short_gift' ).remove();
1804			$( '#item_short_info .left_info_block ul .footnote' ).after( $itemGift );
1805		} else {
1806			$breadcrumbs = $( ".breadcrumbs" );
1807			$( "#top-logo-block .container" ).children( ".breadcrumbs" ).remove();
1808			$( ".page_title_block" ).prepend( $breadcrumbs );
1809			$( '#item-short_gift' ).remove();
1810			$( '#item_short_info_block form' ).prepend( $itemGift );
1811		}
1812
1813		$( '#open-param-window-btn' ).click( function(){
1814			$( '.left-sidebar' ).slideToggle();
1815		});
1816
1817		window.recommendationsInit = function () {
1818            if( $( '#recommendations' ).length > 0 ){
1819                $( '.left-sidebar-menu ul li a[href="#recommendations"]' ).click( function(){
1820                    $( '#recommendations' ).children( '.product-block' ).children( '.slick-prev' ).click();
1821                });
1822            }
1823
1824            if( $( '#recommendations' ).length > 0 ){
1825                $( '#recommendations .product-block' ).slick({
1826                    slidesToShow: 3,
1827                    slidesToScroll: 1,
1828                    arrows: true,
1829                    fade: false,
1830                    infinite: false,
1831                    dots: true,
1832                    responsive: [
1833                        {
1834                            breakpoint: 1500,
1835                            settings: {
1836                                slidesToShow: 2,
1837                            }
1838                        },
1839                        {
1840                            breakpoint: 992,
1841                            settings: {
1842                                slidesToShow: 1,
1843                            }
1844                        },
1845                        {
1846                            breakpoint: 768,
1847                            settings: {
1848                                slidesToShow: 1,
1849                            }
1850                        }
1851                    ]
1852                });
1853
1854                $numberOfRecomendationSlides = $( '#recommendations .product-block.slick-slider .slick-slide' ).length;
1855                $( '#recommendations .product-block.slick-slider' ).after( '<span class="number-of-recomendation-slides"> / ' + $numberOfRecomendationSlides + '</span>' );
1856            }
1857        };
1858        recommendationsInit();
1859
1860		$(window).resize( function(){
1861
1862			$windowWidth = $(window).width();
1863			$moveBlock = $('.privacy_policy');
1864			$mapPoint = $( '.points_of_issue_block' );
1865			$phoneBlock = $( '.phone-block' );
1866
1867			style_block_height_auto();
1868
1869			squareThumb( '#main_news_inside_block .content_row > div > .news_inside > .thumb' );
1870			squareThumbAndMatchHeight( '#main_news_block .news_preview .thumb' );
1871			squareThumbAndMatchHeight( '#main_news_inside_block .news_preview .thumb' );
1872
1873			squareThumb( '#main_review_inside_block .review_inside .thumb' );
1874			squareThumbAndMatchHeight( '#main_reviews_block .news_preview .thumb' );
1875			squareThumbAndMatchHeight( '#main_reviews_inside_block .news_preview .thumb' );
1876
1877			squareThumb( '#main_review_inside_block .right-sidebar .product-preview .top-block' );
1878
1879			if( $windowWidth > 768 ){
1880				$( '.orders-lists ul' ).show();
1881			} else {
1882				$( '.orders-lists ul' ).hide();
1883			}
1884
1885			if( $windowWidth > 576 ){
1886				$( "#left-sidebar-for-mobile" ).slideUp();
1887				$( '.left-sidebar-menu ul.nav' ).show();
1888			} else {
1889				$( '.left-sidebar-menu ul.nav' ).hide();
1890			}
1891
1892			if( $( '#main_item_block' ).length > 0 ){
1893				if( $windowWidth < 576 ){
1894					$iconBlock = $( '#main_item_block .top-block-content' ).children( '.icon_block' );
1895					$( '#main_item_block .top-block-content' ).children( '.icon_block' ).remove();
1896					$( '#main_item_block #item_short_info .left_info_block' ).append( $iconBlock );
1897				} else {
1898					$iconBlock = $( '#main_item_block #item_short_info .left_info_block' ).children( '.icon_block' );
1899					$( '#main_item_block #item_short_info .left_info_block' ).children( '.icon_block' ).remove();
1900					$( '#main_item_block .top-block-content' ).append( $iconBlock );
1901				}
1902			}
1903
1904			if( $( '#main_about_block .fourth_row .list-elem' ).length > 0 ){
1905				if( $windowWidth > 992 ){
1906					$elemHeight = $( '#main_about_block .fourth_row .list-elem.first' ).height();
1907					$( '#main_about_block .fourth_row .list-elem.third' ).height( $elemHeight );
1908				} else {
1909					$( '#main_about_block .fourth_row .list-elem.third' ).height( 'auto' );
1910				}
1911			}
1912
1913			//$( ".product-preview" ).matchHeight();
1914			//$( ".product-preview .title" ).matchHeight();
1915			$( "#item-review .one-review" ).matchHeight();
1916
1917			if( $( '#main_compare_block' ) ){
1918				setTimeout( sameLineHeight(), 500 );
1919
1920				/*
1921                if( $windowWidth < 1200 ){
1922					$( '.main-col .line1 #tumbler' ).remove();
1923					$( '.page_title_row h1' ).after( $showDifferences );
1924				} else {
1925					$( '.page_title_row h1 #tumbler' ).remove();
1926					$( '.main-col .line1' ).append( $showDifferences );
1927				}
1928				*/
1929			}
1930
1931			/*if( $windowWidth < 1200 ){
1932				$( "#item_short_info .last-short-comment .stars-and-comments-block" ).remove();
1933				$( "#main_item_block .top_block" ).append( $itemRating );
1934				$( "#add-to-cart-block" ).remove();
1935				$( "#item_short_info .left_info_block ul li:first-child" ).after( $addToCartBlock );
1936				$( "#item_short_info_block .footnote" ).remove();
1937				$( "#item_short_info .left_info_block ul #add-to-cart-block" ).after( $footnote );
1938				$( "#item_short_info .right_info_block" ).remove();
1939				$( "#item_short_info .left_info_block ul .footnote" ).after( $itemRightInfoBlock );
1940			} else {
1941				$( "#main_item_block .top_block .stars-and-comments-block" ).remove();
1942				$( "#item_short_info .last-short-comment" ).prepend( $itemRating );
1943				$( "#item_short_info .left_info_block ul #add-to-cart-block" ).remove();
1944				$( "#item_short_info" ).after( $addToCartBlock );
1945				$( "#item_short_info .left_info_block ul .footnote" ).remove();
1946				$( "#item_short_info_block form" ).append( $footnote );
1947				$( "#item_short_info .left_info_block ul .right_info_block" ).remove();
1948				$( "#item_short_info" ).append( $itemRightInfoBlock );
1949			}*/
1950
1951			if( $( 'body' ).hasClass( 'home-page' ) && ( $windowWidth > 1200 ) ){
1952				$( '.catalog_menu' ).show();
1953			}
1954			if( $windowWidth < 1200 ){
1955				//$( '.left-sidebar' ).hide();
1956				$('.privacy_policy').remove();
1957				$( ".copyright" ).before( $moveBlock );
1958				$( '#top-menu-line .show-more' ).hide();
1959				$( '.points_of_issue_block' ).remove();
1960				$( '.partners-block' ).after( $mapPoint );
1961			} else {
1962				//$( '.left-sidebar' ).show();
1963				$('.privacy_policy').remove();
1964				$( ".developers_link" ).before( $moveBlock );
1965				$( '#top-menu-line .show-more' ).show();
1966				$( '.points_of_issue_block' ).remove();
1967				$( '#top-logo-block .search_form' ).before( $mapPoint );
1968			}
1969
1970			if( $( "#item-accessories" ) && ( $windowWidth > 992 ) ){
1971				if( $( "#item-accessories .all-accessories .accessories-block" ).hasClass("slick-slider") ){
1972					$( "#item-accessories .all-accessories .accessories-block" ).slick("unslick");
1973				}
1974				if( $( "#item-accessories .all-accessories .number-of-slides-accessories" ) ){
1975					$( "#item-accessories .all-accessories .number-of-slides-accessories" ).remove();
1976				}
1977			} else {
1978				if( !$( "#item-accessories .all-accessories .accessories-block" ).hasClass("slick-slider") ){
1979					$( "#item-accessories .all-accessories .accessories-block" ).slick({
1980						slidesToShow: 1,
1981						slidesToScroll: 1,
1982						dots: true,
1983						infinite: false,
1984						centerPadding: 0,
1985					});
1986				}
1987				if( !$( "span" ).is( ".number-of-slides-accessories" ) ){
1988					$numOfAccessoriesSlides = $( "#item-accessories .all-accessories .slick-track .slick-slide" ).length;
1989					$( "#item-accessories .all-accessories .accessories-block").append( '<span class="number-of-slides-accessories"> / ' + $numOfAccessoriesSlides + '</span>' );
1990				}
1991			}
1992
1993			if( $windowWidth <= 992 ){
1994				//$( '.phone-block' ).remove();
1995				$( '#top-logo-block .social_btns' ).prepend( $phoneBlock );
1996				$searchForm = $( '#top-logo-block .search_form form' );
1997				$( '#top-logo-block .search_form form' ).remove();
1998				$( '#search-popup' ).append( $searchForm );
1999
2000				$( "span.most-important-comment" ).remove();
2001				$( "#item-comment .comment-block" ).prepend( $mostImportantContentTitle );
2002
2003				//$( '#big-info-block .tab-content-custom .tab-pane' ).hide();
2004			} else {
2005				//$( '.phone-block' ).remove();
2006				$( '#top-logo-block .social_btns' ).append( $phoneBlock );
2007				$searchForm = $( '#search-popup form' );
2008				$( '#search-popup form' ).remove();
2009				$( '#top-logo-block .search_form' ).append( $searchForm );
2010				$( '#bg_search_popup_for_mobile' ).fadeOut();
2011
2012				$( "#item-comment .comment-block span.most-important-comment" ).remove();
2013				$( "#item-comment .comment-block" ).before( $mostImportantContentTitle );
2014
2015				/*$( '#big-info-block .tab-content-custom .tab-pane' ).show();
2016
2017				if( !$( '#big-info-block .tab-content-custom .tab-pane' ).hasClass( 'active' ) ){
2018					$idOfActiveElem = $( '#line-with-tabs ul li.active a' ).attr('href');
2019					$( '#big-info-block .tab-content-custom .tab-pane' + $idOfActiveElem ).addClass('active');
2020				}*/
2021			}
2022
2023			/*if( $windowWidth > 992 ){
2024				setTimeout(makeHeight, 200);
2025				function makeHeight(){
2026					$( '#line-with-tabs ul li.active a' ).click();
2027				}
2028			} else {
2029				$( '#big-info-block .tab-content-custom' ).height( 'auto' );
2030			}*/
2031
2032			$( '.request_call' ).click( function(){
2033				$( '#bg_request_call_popup' ).fadeIn();
2034			});
2035
2036			if( $windowWidth <= 576 ){
2037                $( ".breadcrumbs" ).remove();
2038				$( "#top-logo-block .row" ).last().after( $breadcrumbs );
2039
2040				if( !$( "span" ).is( ".number-of-slides" ) ){
2041					$numberOfSlides = $( ".slider-viewed .slick-list .slick-track .product-preview" ).length;
2042					$( ".slider-viewed ul.slick-dots" ).after( '<span class="number-of-slides">' + $numberOfSlides + '</span>' );
2043				}
2044
2045				$( '#item-short_gift' ).remove();
2046				$( '#item_short_info .left_info_block ul .footnote' ).after( $itemGift );
2047			} else {
2048				//$breadcrumbs = $( ".breadcrumbs" );
2049				$( "#top-logo-block .container" ).children( ".breadcrumbs" ).remove();
2050				$( ".page_title_block" ).prepend( $breadcrumbs );
2051
2052				$( '#item-short_gift' ).remove();
2053				$( '#item_short_info_block form' ).prepend( $itemGift );
2054			}
2055		});
2056
2057	});
2058
2059    $(function(){
2060        if($('#main_compare_block .static-table').length) {
2061            var offset_head = $( '#main_compare_block .static-table .one-col:first-child .line1' ).offset().top + $( '#main_compare_block .static-table .one-col:first-child .line1:first-child' ).outerHeight();
2062
2063            function fixedCompareHead() {
2064
2065                if($(window).scrollTop() > offset_head) {
2066                    $( '#main_compare_block #compare_fixed_head').addClass('active');
2067                } else {
2068                    $( '#main_compare_block #compare_fixed_head').removeClass('active');
2069                }
2070            }
2071
2072            $(window).scroll(fixedCompareHead);
2073        }
2074
2075        $('.ion-slider').each(function() {
2076            var steps = $(this).data('steps'),
2077                start = $(this).data('start'),
2078                end = $(this).data('end'),
2079                inputs = $(this).parents('.body').find('input[type=checkbox]');
2080
2081            $(this).ionRangeSlider({
2082                skin: "sharp",
2083                type: "double",
2084                grid: false,
2085                //from: start,
2086                //to: end,
2087                values: steps,
2088                onFinish: function(e) {
2089                    var last = false;
2090                    if(e.from_value == start && e.to_value == end) {
2091                        inputs.prop('checked', false);
2092                        last = inputs.last();
2093                    } else {
2094                        inputs.each(function(){
2095                            var value = $(this).data('value');
2096                            if(value >= e.from_value && value <= e.to_value) {
2097                                last = $(this).prop('checked', true);
2098                            } else {
2099                                $(this).prop('checked', false);
2100                            }
2101                        });
2102                    }
2103                    if(last) {
2104                        smartFilter.keyup(last.get(0));
2105                    }
2106                }
2107            });
2108        });
2109    })
2110
2111
2112
2113
2114})(jQuery);
2115
2116
2117var statusUpdateServices = false;
2118
2119$(function() {
2120
2121	$(document).on('click', 'input[data-basket="service"]', function(e){
2122
2123		if(statusUpdateServices){
2124			e.preventDefault();
2125			return false;
2126		}
2127
2128	});
2129
2130
2131   $(document).on('change', 'input[data-basket="service"]', function(){
2132
2133	   statusUpdateServices = true;
2134
2135		var elem = $(this),
2136			product = elem.attr('data-id'),
2137			service = elem.val(),
2138			action = elem.prop('checked') ? 'add' : 'remove';
2139
2140			if(product && service){
2141
2142				$.ajax({
2143				url: '/ajax/basket.php',
2144				type: 'post',
2145				data: {"product": product, "service": service, 'action': action},
2146				success: function() {
2147					 updateBasket();
2148					 statusUpdateServices = false;
2149				}
2150			});
2151
2152		}
2153
2154
2155
2156	})
2157
2158    $(document).ready(function (){
2159        let $inner_li = $('#top-menu-line li[aria-current="location"], .top-menu-line li[aria-current="location"]');
2160
2161        if ($inner_li.length) {
2162            $inner_li.each(function (index, element){
2163                $(this).parent().closest('li').attr('aria-current', 'location')
2164            });
2165        }
2166
2167    });
2168
2169   $(document).ready(function (){
2170       let $additional_stock_slider = $('.additional-stocks__slider');
2171
2172       if ($additional_stock_slider.length) {
2173           $additional_stock_slider.slick({
2174               infinite: false,
2175               slidesToShow: 4,
2176               slidesToScroll: 1,
2177               arrows: true,
2178               dots: false,
2179               responsive: [
2180                   {
2181                       breakpoint: 992,
2182                       settings: {
2183                           slidesToShow: 3,
2184                       }
2185                   },
2186                   {
2187                       breakpoint: 768,
2188                       settings: {
2189                           slidesToShow: 2,
2190                       }
2191                   },
2192                   {
2193                       breakpoint: 576,
2194                       settings: {
2195                           slidesToShow: 1,
2196                       }
2197                   }
2198               ]
2199           });
2200       }
2201   });
2202
2203
2204
2205});

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.