PageSourceSearch

https://legion-miniatures.com/t/v1656/images/shop_main.js

js legion-miniatures.com collected 2026-09-28 01:25:10 UTC 41,595 bytes, 1,467 lines download raw bytes

1shop2.queue.discounts = function() {
2	
3	$('.shop2-product-amount input[type=text]').on('change', function() {
4      if ($(this).val() < 1) {
5        $(this).val(1);
6      }
7    });
8
9	$(document).on('click', '.shop2-product-actions dt', function(e) {
10		var $this = $(this),
11			win = $this.next(),
12			maxWidth = $this.outerWidth() - 20,
13			left = $this.position().left;
14
15		e.stopPropagation();
16
17		if (win.is(':hidden')) {
18			$('.shop2-product-actions dd').hide();
19			win.show();
20			win.css('left', left);
21			win.css('maxWidth', maxWidth);
22		} else {
23			win.hide();
24		}
25
26	});
27
28	$(document).on('click', '.close-desc-action', function(e) {
29		var $this = $(this),
30			win = $this.closest('dd');
31
32		e.stopPropagation();
33
34		win.hide();
35	});
36
37	$(document).on('click', function() {
38		$('.shop2-product-actions dd').hide();
39	});
40
41}
42shop2.queue.product = function() {
43
44	shop2.product._reload = function(node) {
45
46		var $node = $(node);
47		var kinds = shop2.product.getNodeData(node, 'kinds', true);
48		var paramName = shop2.product.getNodeData(node, 'name');
49		var paramValue = shop2.product.getNodeData(node, 'value');
50		var $form = $node.closest('form');
51		var form = $form.get(0);
52		var meta;
53		var kind_id;
54		var product_id;
55		var keys = {};
56
57		if (kinds && $.type(paramName) !== 'undefined' && $.type(paramValue) !== 'undefined' && form) {
58
59			meta = $form.find('input[name=meta]').val();
60
61			product_id = $form.find('input[name=product_id]').val();
62
63			$form.find('[name=submit]').prop('disabled', true);
64
65			$form.find('select.shop2-cf>option, li.shop2-cf, li.shop2-color-ext-selected, ul.shop2-color-ext-list>li').each(function() {
66				var name = $(this).data('name');
67				if (name) {
68					keys[name] = true;
69				}
70			});
71
72			kind_id = shop2.product.findKindId(product_id, kinds, paramName, paramValue, meta, keys);
73
74			if (shop2.mode == 'product') {
75
76				if (shop2.uri) {
77					document.location = shop2.uri + '/product/' + kind_id;
78				} else {
79					document.location = document.location.href.replace(/\/product\/.+/, '/product/' + kind_id);
80				}
81
82			} else {
83
84				shop2.product.getProductListItem(product_id, kind_id, function(d, status) {
85					var cont, newCont, body;
86					if (status === 'success') {
87
88						cont = $node.closest('.shop2-item-product');
89						cont.hide();
90
91						body = $.trim(d.data.body);
92						newCont = $(body).insertBefore(cont);
93
94						cont.remove();
95
96						shop2.queue.heights();
97					}
98
99				});
100
101			}
102		}
103		setTimeout(function() {
104			if ($('.product-list').hasClass('product-list-thumbs')) {
105		    	$('.shop2-item-product.product-thumb-item').each(function(){
106					var $this = $(this);
107		
108					if ($this.find('.shop-product-btn.type-2').length) return;
109					$this.find('.shop2-product-amount button').hide();
110					$this.find('.shop-product-order-btn.type-3').css('float', 'right');
111				});
112			} else if ($('.pricelist-shop2').length) {
113				$('.shop2-item-product.shop2-product-price').each(function(){
114					var $this = $(this);
115		
116					if ($this.find('.shop-product-btn.type-1').length) return;
117					$this.find('.shop-product-order-btn.type-3').css('width', 56);
118				});
119			}
120		}, 1500);
121
122	};
123
124	
125	$.on('select.shop2-cf', {
126		change: function() {
127			shop2.product._reload(this);
128			setTimeout(function() {
129				$('.product-options select').styler();
130			}, 3500);
131		}
132	});
133
134	$.on('li.shop2-cf:not(.active-color, .active-texture)', {
135		click: function() {
136			shop2.product._reload(this);
137			
138			setTimeout(function() {
139				$('.product-options select').styler();
140			}, 800);
141		}
142	});
143
144}
145shop2.queue.question = function() {
146	var cls = '.price-old.question, .shop-cart-total .question';
147	
148	if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || /[\?&]panel_fake_mobile=1(&|$)/.test(document.location.search)){
149		$('.price-old.question, .shop-cart-total .question').on('click', function(event) {
150			var $this = $(this),
151				win = $this.next().show(),
152				position = $this.position(),
153				height = win.outerHeight(true);
154			
155			if (!$this.next().hasClass('classThis')) {
156				$this.next().addClass('classThis');
157				win.css({
158					top: position.top - height - 5,
159					left: position.left
160				});
161			} else {
162				var $this = $(this),
163					win = $this.next();
164					
165				$this.next().removeClass('classThis');
166				
167				win.hide();
168			}
169		});
170	} else {
171		$(document).on('mouseenter', cls, function() {
172			var $this = $(this),
173				win = $this.next().show(),
174				position = $this.position(),
175				height = win.outerHeight(true);
176	
177			win.css({
178				top: position.top - height - 5,
179				left: position.left
180			});
181	
182		}).on('mouseleave', cls, function() {
183	
184			var $this = $(this),
185				win = $this.next();
186	
187			win.hide();
188	
189		});
190	}
191
192}
193shop2.queue.filter = function() {
194
195	var wrap = $('.shop-filter'),
196		result = $('.result');
197
198	shop2.filter.init();
199
200	shop2.on('afterGetSearchMatches', function (d, status) {
201
202		if (d.data.total_found === 0) {
203
204			result.addClass('no-result');
205		} else {
206			result.removeClass('no-result');
207		}
208
209		$('#filter-result').html(d.data.total_found);
210
211		result.removeClass('hide');
212	});
213
214	wrap.find('.param-val').on('click', function(e) {
215		var $this = $(this),
216			name = $this.data('name'),
217			value = $this.data('value');
218
219		e.preventDefault();
220
221		$this.toggleClass('active-val');
222		shop2.filter.toggle(name, value);
223		shop2.filter.count();
224	});
225
226	wrap.find('select').on('change', function() {
227		var $this = $(this),
228			name = this.name,
229			value = $this.val();
230
231		shop2.filter.add(name, value);
232		shop2.filter.count();
233	});
234
235	wrap.find('input:text').keyup(function() {
236		var $this = $(this),
237			name = $this.attr('name');
238
239		$.s3throttle('filter: ' + name, function() {
240			var value = $this.val();
241
242			shop2.filter.add(name, value);
243			shop2.filter.count();
244		}, 500);
245	});
246	wrap.find('.input_range_slider').on('slide', function(e){
247        var $this = $(this),
248            $parent = $this.closest('.range_slider_wrapper'),
249            $input = $parent.find('input:text');
250            
251        $.each($input, function(i, elem) {
252            var name = $(elem).attr('name');
253
254            $.s3throttle('filter: ' + name, function() {
255                var value = $(elem).val();
256        
257                shop2.filter.add(name, value);
258                shop2.filter.count();
259            }, 500);
260        });
261    });
262
263	wrap.find('.shop-filter-go').on('click', function(e) {
264		e.preventDefault();
265		shop2.filter.go();
266	});
267
268}
269shop2.filter.sort = function(name, elem) {
270	var re = new RegExp(this.escape('s[sort_by]') + '=([^&]*)'),
271		params = this.str.match(re),
272		desc = name + ' desc',
273		asc = name + ' asc',
274		isDesc = (elem.is('.sort-param-desc'));
275
276
277	params = (params && params.length > 1) ? params[1] : '';
278	
279	params = (isDesc) ? desc : asc;
280
281	// if (params.indexOf(desc) !== -1) {
282	// 	params = params.replace(desc, asc);
283	// } else if (params.indexOf(asc) !== -1) {
284	// 	params = params.replace(asc, desc);
285	// } else if (params !== '') {
286	// 	params += ',' + desc;
287	// } else {
288	// 	params = asc;
289	// }
290
291	this.remove('s[sort_by]');
292	this.add('s[sort_by]', params);
293	return this;
294}
295shop2.queue.sort = function() {
296	var wrap = $('.sorting');
297
298	wrap.find('.sort-param').on('click', function(e) {
299		var $this = $(this),
300			name = $this.data('name');
301
302		e.preventDefault();
303		shop2.filter.sort(name, $this);
304		shop2.filter.go();
305	});
306
307	wrap.find('.sort-reset').on('click', function(e) {
308		e.preventDefault();
309		shop2.filter.remove('s[sort_by]');
310		shop2.filter.go();
311	});
312}
313shop2.queue.views = function() {
314	$('.view-shop a').on('click', function(e) {
315		var $this = $(this),
316			value = $this.data('value');
317
318		e.preventDefault();
319		if (!($this.hasClass('active-view'))) {
320			shop2.filter.remove('view');
321			shop2.filter.add('view', value);
322			shop2.filter.go();
323		}
324
325	});
326}
327shop2.queue.cart = function() {
328
329	var updateBtn = $('.shop2-cart-update'),
330		cartTable = $('.shop2-cart-wrapper'),
331		form = $('#shop2-cart');
332
333	shop2.on('afterCartRemoveItem, afterCartUpdate', function() {
334		document.location.reload();
335	});
336
337	function updateBtnShow() {
338		updateBtn.show();
339	}
340
341	cartTable.find('input:text').on('keypress', function(e) {
342		if (e.keyCode == 13) {
343			shop2.cart.update(form);
344		} else {
345			updateBtnShow();
346		}
347	});
348
349	cartTable.find('.amount-minus, .amount-plus').on('click', updateBtnShow);
350
351	updateBtn.on('click', function(e) {
352		e.preventDefault();
353		shop2.cart.update(form);
354		return false;
355	});
356
357
358	$('.cart-delete a').on('click', function(e) {
359		var $this = $(this),
360			id = $this.data('id');
361
362		e.preventDefault();
363
364		shop2.cart.remove(id);
365
366	});
367
368}
369shop2.queue.delivery = function() {
370
371	var options = $('.option-label'),
372		groups = $('.option-type'),
373		details = options.next();
374
375	options.on('click', function() {
376		var $this = $(this),
377			index = $this.parent().index();
378
379		groups.removeClass('active-type').eq(index).addClass('active-type');
380		details.find('input, textarea, select').prop('disabled', true);
381		$this.next().find('input, textarea, select').prop('disabled', false);
382
383		$this.next().find('select').styler();
384
385	});
386
387	$('#shop2-ems-calc, #shop2-edost-calc').on('click', function(e) {
388		var $this = $(this),
389			attach_id = $this.data('attach-id'),
390			to = $('select[name=' + attach_id + '\\[to\\]]'),
391			zip = $('input[name=' + attach_id + '\\[zip\\]]');
392
393		if (to.length == 0) {
394			to = $('#shop2-edost2-to');
395		}
396
397		e.preventDefault();
398
399		to = to.get(0)? to.val() : '';
400		zip = zip.get(0)? zip.val() : '';
401
402		shop2.delivery.calc(attach_id, 'to=' + to + '&zip=' + zip, function(d) {
403			if (!d.data && d.errstr) {
404				shop2.alert(d.errstr);
405				$('#delivery-' + attach_id + '-cost').html(0);
406			} else {
407				$('#delivery-' + attach_id + '-cost').html(d.data.cost);
408
409				if (d.data.html) {
410					$('#delivery-' + attach_id + '-html').html(d.data.html);
411					shop2.queue.edost();
412				}
413			}
414
415		});
416
417	});
418}
419shop2.queue.addToCart = function() {
420$(document).on('click', '.shop-product-btn', function(e) {
421
422	var $this = $(this),
423		$form = $this.closest('form'),
424		form = $form.get(0),
425		adds = $form.find('.additional-cart-params'),
426		len = adds.length,
427		i, el,
428		a4 = form.amount.value,
429		kind_id = form.kind_id.value;
430
431	e.preventDefault();
432
433	if (len) {
434		a4 = {
435			amount: a4
436		};
437
438		for (i = 0; i < len; i += 1) {
439			el = adds[i];
440			if (el.value) {
441				a4[el.name] = el.value;
442			}
443		}
444	}
445	
446	if ( $this.hasClass('shop-product-btn-modifed') ) {
447    	$this = $('.painted-btn-js');
448    }
449
450	shop2.cart.add(kind_id, a4, function(d) {
451
452		$('#shop2-cart-preview').replaceWith(d.data);
453
454		if (d.errstr) {
455			shop2.msg(d.errstr, $this);
456		} else {
457			shop2.msg(window._s3Lang.JS_ADDED, $this);
458		}
459
460		if (d.panel) {
461			$('#shop2-panel').replaceWith(d.panel);
462		}
463	});
464
465});
466
467}
468$(function() {
469	$('table').wrap('<div class="table-wrapper"></div>');
470
471	var isMobile = (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/i.test(navigator.userAgent) || $(window).width() <= 768),
472		goUpFalse = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
473		clickStart = (isMobile) ? 'tap' : 'click.respons',
474		clickStart2 = (isMobile) ? 'touchstart' : 'click.respons',
475		scrollUpBut = $(".go_up"),
476		scroll_to = $(document).height(),
477		speed = 800;
478
479	//GO-UP
480
481	scrollUpBut.on(clickStart, function(){
482		$('body,html').animate({ scrollTop: 0}, speed);
483	return false;
484	});
485	
486    if (goUpFalse == false){
487		$(window).scroll(function() {
488			 if ($(document).scrollTop() >= 400) {
489	            $('.go_up').fadeIn(600);
490	            
491			 } else {
492			 	$('.go_up').fadeOut(100);
493	        }
494	    });
495    }
496
497    //Top-panel
498    function topPanel() {
499	    var offsetTop = $(document).scrollTop();
500
501	    $(document).scroll(function(e) {
502			if ($('.folder-top-wr, .search-block-wr, .login-block-wr').hasClass('opened')) return;
503
504		    if ($(document).scrollTop() >= 40) {
505			    var offsetTopScroll = $(document).scrollTop();
506
507
508			    if (offsetTopScroll > offsetTop) {
509			    	$('.top-line-wr').css({
510			    		'opacity' : '0',
511			    		'visibility' : 'hidden',
512			    		'height' : '0'
513			    	});
514			    } else {
515			    	$('.top-line-wr').css({
516			    		'opacity' : '1',
517			    		'visibility' : 'visible',
518			    		'height' : 'auto'
519			    	});
520			    }
521			    if (offsetTopScroll >= 80) {
522			    	$('.top-line-wr').addClass('boxShadows');
523			    } else {
524			    	$('.top-line-wr').removeClass('boxShadows');
525			    }
526			    offsetTop = offsetTopScroll;
527			}
528	    });
529    }
530    topPanel();
531
532	$(this).keydown(function(eventObject){
533        if (eventObject.which == 36){
534	    	$('.top-line-wr').css({
535	    		'opacity' : '1',
536	    		'visibility' : 'visible',
537	    		'height' : 'auto'
538	    	});
539		}
540    });
541    
542	$('.shop-product-btn').on('click', function(event) {
543    	$('.top-line-wr').css({
544    		'opacity' : '1',
545    		'visibility' : 'visible',
546    		'height' : 'auto'
547    	});
548	});
549    
550	  
551	//MAIN_SLIDER
552
553	$('.slider-block-wr .slider').removeClass('displayNone');
554
555	(function() {
556		var slider = $('.slider').bxSlider({
557			mode: 'horizontal',
558			auto: true,
559			controls: false,
560			pager: true,
561			minSlides: 1,
562			adaptiveHeight: false,
563			maxSlides: 1,
564			slideWidth: 944,
565			slideMargin: 0,
566			useCSS: false,
567			preloadImages: 'all',
568			onSlideAfter: function(){
569				if(this.auto){
570					slider.startAuto();
571				}
572			}
573		});
574	})();
575
576	//NEWS-SLIDER
577    var $owl = $('.news-slider');
578
579    $owl.owlCarousel ({
580        margin: 40,
581        loop: false,
582        autoplay: 0,
583        responsive: {
584          0: {
585            items: 1
586          },
587          640: {
588            items: 2
589          },
590          1000: {
591            items: 3
592          }
593        }
594    })
595
596	if (isMobile) {
597	    $('.login-link, .search-link, .folder-link').on(clickStart2, function(event) {
598	    	$('.overlay-bg').addClass('active');
599			
600			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
601				$('html, body').addClass('overflowHidden');
602			} else if (isMobile) {
603				$(document.documentElement).addClass('overflowHidden');
604			}
605		});
606		$('.login-block-wr, .search-block-wr').addClass('mobileAppear');
607
608		$('.cart-click-btn, .cart-wr .close-btn').on(clickStart, function(event) {
609			if ($(window).width() <= 470) {
610				event.preventDefault();
611				$('.overlay-bg').addClass('active');
612
613				if ($('.cart-block-appear').hasClass('opened')){
614					$('.cart-block-appear').removeClass('opened')
615					$('.overlay-bg').removeClass('active');
616
617					if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
618						$('html, body').removeClass('overflowHidden');
619					} else if (isMobile) {
620						$(document.documentElement).removeClass('overflowHidden');
621					}
622				} else {
623					$('.cart-block-appear').addClass('opened');
624				
625					if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
626						$('html, body').addClass('overflowHidden');
627					} else if (isMobile) {
628						$(document.documentElement).addClass('overflowHidden');
629					}
630				}
631			}
632		});
633		$('.cart-disabled a').on(clickStart, function(event) {
634				event.preventDefault();
635		});
636	}
637	$('.login-form .login-form-title').on(clickStart2, function(event) {
638		if ($('.login-form').hasClass('opened')){
639			$('.login-form').removeClass('opened');
640			$('.login-form .block-body').slideUp('300');
641	    	
642			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
643				$('html, body').removeClass('overflowHidden');
644			} else if (isMobile) {
645				$(document.documentElement).removeClass('overflowHidden');
646			}
647		} else {
648			$('.login-form').addClass('opened');
649			$('.login-form .block-body').slideDown('300');
650			
651		}
652	});
653	$('.search-link, .search-block .close-btn').on(clickStart2, function(event) {
654				
655		if ($('.search-block-wr').hasClass('opened')){
656			$('.search-block-wr').removeClass('opened');
657	    	$('.overlay-bg').removeClass('active');
658	    	
659			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
660				$('html, body').removeClass('overflowHidden');
661			} else if (isMobile) {
662				$(document.documentElement).removeClass('overflowHidden');
663			}
664		} else {
665			$('.search-block-wr').addClass('opened');
666		}
667	});
668	$('.search-online-store .block-title').on(clickStart2, function(event) {
669		$('.search-online-store').toggleClass('opened');
670		$('.search-online-store .block-body').slideToggle('300');
671		
672		if ($('.search-online-store').hasClass('opened')){
673			$('.search-block').css('bottom', 0);
674		} else {
675			$('.search-block').css('bottom', '');
676			
677			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
678				$('html, body').removeClass('overflowHidden');
679			} else if (isMobile) {
680				$(document.documentElement).removeClass('overflowHidden');
681			}
682		}
683	});
684	
685	
686	
687	if (isMobile) {
688		$('.folder-top-wr').addClass('folder-top-mobile');
689		setTimeout(function() {
690			$('.folder-top-block').css('opacity', 1);
691		}, 2000);
692	}
693	$('.folder-link, .folder-top-block .close-btn').on(clickStart2, function(event) {
694		var	folderMaxHeight = $(window).height() - ((isMobile) ? 0 : 40);
695
696		if ($('.folder-top-wr').hasClass('opened')){
697			$('.folder-top-wr').removeClass('opened');
698	    	$('.overlay-bg').removeClass('active');
699	    	
700	    	if (!isMobile) {
701				var ftLiHeight = $('.folders-top').outerHeight(true);
702	    		if (folderMaxHeight < ftLiHeight) {
703	    			$('.folder-top-block').css('overflow-y', 'initial');
704	    			$('.folders-block-wr .folders-ul.folders-top.folders-desktop > li > ul').css({
705			    		'position' : 'absolute',
706			    		'width' : 194
707			    	});
708	    		}
709	    	}
710			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
711				$('html, body').removeClass('overflowHidden');
712			} else if (isMobile) {
713				$(document.documentElement).removeClass('overflowHidden');
714			}
715		} else {
716			$('.folder-top-wr').addClass('opened');
717			$('.folder-top-block').css('maxHeight', folderMaxHeight);
718			
719	    	if (!isMobile) {
720				var ftLiHeight = $('.folders-top').outerHeight(true);
721	    		if (folderMaxHeight < ftLiHeight) {
722	    			$('.folder-top-block').css('overflow-y', 'auto')
723	    			$('.folders-block-wr .folders-ul.folders-top.folders-desktop > li > ul').css({
724			    		'position' : 'static',
725			    		'width' : 'auto'
726			    	});
727	    		}
728	    	}
729		}
730	});
731
732	$(document).on(clickStart, function(event) {
733			if ($(event.target).closest('.cart-click-btn, .search-block-wr, .login-block-wr, .folder-top-wr, .baron-wrapper, .shop-product-order-btn, .classThis').length) return;
734			if ($(window).width() <= 470) {
735				if ($(event.target).closest('.cart-wr').length) return;
736			}
737			$('.classThis').hide();
738			$('div').removeClass('classThis');
739
740			$('.folder-top-wr').removeClass('opened');
741	    	$('.overlay-bg').removeClass('active');
742			$('.cart-block-appear').removeClass('opened')
743
744		$('.closeBtnForm').click(function(event) {
745			$('.product-includeForm').removeClass('active');
746			
747			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
748				$('html, body').removeClass('overflowHidden');
749			} else {
750				$(document.documentElement).removeClass('overflowHidden');
751			}
752		});
753		if ($('.product-includeForm').hasClass('active')) {
754			if ($(event.target).closest('.gr-form-wrap, .gr-form, .buy-one-click > a').length) return;
755			$('.product-includeForm').removeClass('active');
756		}
757		
758		if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
759			$('html, body').removeClass('overflowHidden');
760		} else {
761			$(document.documentElement).removeClass('overflowHidden');
762		}
763	});
764
765	$(this).keydown(function(eventObject){
766        if (eventObject.which == 27) {
767	    	$('.product-includeForm').removeClass('active');
768	    	$('.login-block-wr').removeClass('opened');
769	    	$('.folder-top-wr').removeClass('opened');
770	    	$('.search-block-wr').removeClass('opened');
771	    	// $('.search-online-store').removeClass('opened');
772			
773			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
774	            $('html, body').removeClass('overflowHidden');
775	        } else {
776	            $(document.documentElement).removeClass('overflowHidden');
777	        }
778        }
779	})
780
781
782
783	var not_selector = [];
784	    not_selector.push('.anketa-wrapper input[type="checkbox"]');
785	    not_selector.push('.anketa-wrapper input[type="radio"]');
786	    not_selector.push('.product-compare input[type="checkbox"]');
787
788	$('.shop2-product-options  select, .shop-filter select, input[type="radio"], input[type="checkbox"]')
789	.not(not_selector.join(','))
790        .styler({selectPlaceholder: 'Все'});
791
792	$.ajaxSetup({
793		complete: function(){
794			$('.search-online-store input[type=checkbox], .search-online-store input[type=radio], .search-online-store select').styler({selectPlaceholder: 'Все'})
795		}
796	});
797	$('.search-block select').styler({selectPlaceholder: 'Все'});
798  	
799	
800	//
801
802	// main-tabs
803    
804    var $owl2 = $('.owl-slider-tab');
805    
806	function tabSlider() {
807	    $owl2.each(function(){
808	      var $this = $(this);
809	          slideCount = $this.find('.shop2-item-product').length;
810	          
811		    $this.owlCarousel ({
812		        margin: 16,
813		        loop: (slideCount > 1) ? 1 : 0,
814		        autoplay: 1,
815		        dots: 1,
816		        responsive: {
817		          0: {
818		            items: 1
819		          },
820		          580: {
821		            items: 2
822		          },
823		          760: {
824		            items: 3
825		          },
826		          1000: {
827		            items: 4
828		          }
829		        }
830		    });
831	    });
832	}
833	tabSlider();
834
835    //
836	(function(){
837		$('.main-block-tab-wr li:first, .main-tabs:first').addClass('active');
838		$('.main-block-tab-wr li').on(clickStart, function(e) {
839			e.preventDefault();
840
841			if($(this).hasClass('active')) return;
842
843			$(this).addClass('active').siblings('li').removeClass('active');
844			$('.main-tabs[data-tab-index="' + $(this).data('tab-index') + '"]').addClass('active').siblings('.main-tabs').removeClass('active');
845		});
846	})();
847	
848    $(window).load(function() {
849		$('.main-new-block').each(function(){
850	    	var heights = [],
851	    		maxHeight,
852	    		myPaddingTop,
853				slideCount = $(this).find('.owl-item').length;
854				
855			if (slideCount <= 4) {
856				$(this).find('.owl-controls').hide();
857			}
858		    $(this).find('.owl-item .product-thumb-item').each(function(){
859		        heights.push($(this).height());
860		    });
861		    maxHeight = Math.max.apply(null, heights);
862		    
863		    $(this).find('.owl-item .product-thumb-item').each(function(){
864			    myPaddingTop = (maxHeight - $(this).height() + 15);
865	
866				$(this).find('.product-bot').css('paddingTop', myPaddingTop);
867		    });
868		});
869    });
870	//
871	
872	$('.shop2-kinds-group-slider').each(function(){
873		var	marginTopEl,
874			priceOld;
875		
876	    $(this).find('.shop2-item-product').css('marginBottom', 3);
877		
878		$(this).find('.shop2-item-product').each(function(){
879	    	var priceOld = $(this).find('.price-old').length;
880	    	
881	    	if (priceOld) {
882		    	marginTopEl = $(this).find('.price-old').outerHeight(true) + 11;
883	    	}
884	    });
885	    
886	    $(this).find('.shop2-item-product').each(function(){
887	    	var priceOld = $(this).find('.price-old').length;
888	    	
889	    	$(this).find('.product-bot').css('marginTop', marginTopEl);
890	        if (priceOld) {
891	        	$(this).find('.product-bot').css('marginTop', 0);
892	        }
893	    });
894	});
895	
896	//
897	
898	(function(){
899		if(!$('.buy-one-click').length) return;
900		
901		var $form = $('<div class="product-includeForm" />');
902		
903		$form.appendTo($('body'));
904		
905		
906		$('.buy-one-click > a').on("click", function(e){
907			e.preventDefault();
908			var url = $(this).attr('href'),
909				productLink = (shop2.mode!=="product") ? (document.location.origin)+$(this).closest('.shop2-item-product').find('.product-name > a').attr('href') : (document.location.href),
910				productName = (shop2.mode!=="product") ? $(this).closest('.shop2-product-mode-wr').find('.product-name > a').html() + (' Количество:' + $(this).closest('.shop2-item-product').find('.shop2-product-amount input[type="text"]').val()) : $(this).closest('.block-11').find('h1').html() + (' Количество:' + $(this).closest('.product-r-side').find('.shop2-product-amount input[type="text"]').val());
911			
912			$form.s3IncludeForm(url, 'comment');
913			
914			$('.product-includeForm').addClass('active');
915			setTimeout(function() {
916				$('.product-includeForm input.productName').val(productName);
917				$('.product-includeForm input.productLink').val(productLink);
918			}, 800);
919			
920			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
921				$('html, body').addClass('overflowHidden');
922			} else {
923				$(document.documentElement).addClass('overflowHidden');
924			}
925		})
926	})();
927	(function(){
928		if(!$('.shop-product-order-btn').length) return;
929		
930		var $form = $('<div class="product-includeForm" />');
931		
932		$form.appendTo($('body'));
933		
934		$('.shop-product-order-btn').on('click', function(e){
935			e.preventDefault();
936			var url = $(this).attr('href'),
937				productLink = (!$(this).closest('.product-r-side').length) ? (document.location.origin)+$(this).closest('.shop2-item-product').find('.product-name > a').attr('href') : (document.location.href),
938				productName = (!$(this).closest('.product-r-side').length) ? $(this).closest('.shop2-item-product').find('.product-name > a').html() + (' Количество:' + $(this).closest('.shop2-item-product').find('.shop2-product-amount input[type="text"]').val()) : $(this).closest('.site-main__inner').find('h1').html() + (' Количество:' + $(this).closest('.product-r-side').find('.shop2-product-amount input[type="text"]').val());
939				
940			$form.s3IncludeForm(url, 'comment');
941			
942			$('.product-includeForm').addClass('active');
943			setTimeout(function() {
944				$('.product-includeForm input.productName').val(productName);
945				$('.product-includeForm input.productLink').val(productLink);
946			}, 500);
947			
948			if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
949				$('html, body').addClass('overflowHidden');
950			} else {
951				$(document.documentElement).addClass('overflowHidden');
952			}
953		})
954	})();
955	// folder-block
956
957	var mainFolderFlag = 1;
958	
959	function mainFolder() {
960		if (($(window).width() >= 480)) {
961			if ($('.folders-li-wr').length){
962				$('.folders-li').unwrap();
963			}
964			$('.main-folder-shared').removeClass('mobile-folder-block');
965			
966			var folderItemWidth = $('.folders-li').outerWidth(true),
967				contentWidth = $('.site-container').width(),
968				folderItemCount = Math.floor(contentWidth/folderItemWidth),
969				$folderView = $('.view-more-folder');
970	
971				$folderView.removeClass('displayNone');
972				
973			if ($('.folders-js-controler .folders-li').length) {
974				while(($children = $(':not(.folders-li-wr)>.folders-li:lt(' + folderItemCount + ')')).length) {
975					$children.parent().append(
976						$('<div class="folders-li-wr"></div>').append($children.remove())
977					);
978				}
979			}
980	
981			var folderOpen = $('.folders-li-wr'),
982				folderItemWrCount = $('.folders-li-wr').length;
983	
984			if ($('.folders-li').length <= 8 && ($(window).width() >= 940) && mainFolderFlag == 1) {
985				$('.folders-li-wr + .folders-li-wr').css('display', 'none');
986			}
987			if (mainFolderFlag == 2){
988			    $('.folders-li-wr').css('display', 'block');
989			}
990	
991			if ($('.folders-li-wr').last().is(':hidden') && mainFolderFlag == 1) {
992				$folderView.removeClass('disabled');
993				$folderView.on(clickStart2, function(e) {
994					e.preventDefault();
995					folderOpen.slideDown('slow');
996	
997					if ($('.folders-li-wr').last().is(':visible')) {
998						$folderView.addClass('disabled');
999					}
1000					mainFolderFlag = 2;
1001				});
1002			} else {
1003				$folderView.addClass('disabled');
1004			}
1005		} else {
1006			$('.main-folder-shared').addClass('mobile-folder-block');
1007		}
1008	}
1009	$(window).on('resize', mainFolder).trigger('resize');
1010
1011	//Sorting
1012
1013	var $sortingBtn = $('.shop2-panel-sorting .sorting-wrap .sort-title'),
1014		$sortingBlock = $('.shop2-panel-sorting .sorting-wrap .sorting-block'),
1015		sortingParamLink = $('.shop2-panel-sorting .sorting-wrap .sort-param.active'),
1016		$filterWr = $('.shop-filter'),
1017		$filterTitle = $('.shop-filter .shop2-filter-btn'),
1018		$filterBlock = $('.shop-filter .shop2-filter-block');
1019
1020
1021		$filterTitle.on('click', function(event) {
1022				$filterWr.toggleClass('opened');
1023				$filterBlock.slideToggle('300');
1024		});
1025		$sortingBtn.on('click', function(event) {
1026				$('.sorting-wrap').toggleClass('opened');
1027				$sortingBlock.slideToggle('300');
1028		});
1029
1030		// $(document).on(clickStart, function(event) {
1031		// 	if ($('.sorting-wrap').hasClass('opened')) {
1032		// 		if ($(event.target).closest('.sorting-wrap').length) return;
1033		// 		$('.sorting-wrap').removeClass('opened');
1034		// 		$sortingBlock.slideToggle('300');
1035		// 	}
1036		// 	if ($filterWr.hasClass('opened')) {
1037		// 		if ($(event.target).closest('#shop2-color-ext-popup, .shop-filter').length) return;
1038		// 		$filterWr.removeClass('opened');
1039		// 		$filterBlock.slideToggle('300');
1040		// 	}
1041		// });
1042
1043		function sortingTitle() {
1044			var paramClone = sortingParamLink.first().clone().addClass('clone');
1045
1046			$sortingBtn.html(paramClone);
1047
1048			$('.shop2-panel-sorting .sorting-wrap .sort-param.clone').on(clickStart, function(event) {
1049				event.preventDefault();
1050			});
1051		}
1052		if (sortingParamLink.hasClass('active')){
1053			sortingTitle();
1054		}
1055
1056	//Thumbs-lots
1057	function hoverThumbs() {
1058		var clearTimeoutThumbs;
1059		$('.product-thumb-item').hover(function() {
1060			var $this = $(this),
1061				thumbsHeight = $this.height();
1062
1063			clearTimeoutThumbs = setTimeout(function() {
1064				$this.css('height', thumbsHeight);
1065				$this.find('.product-thumb-item-in').css('minHeight', thumbsHeight);
1066				$this.find('.table-wrapper').slideDown('slow');
1067				$this.find('.table-wrapper').css('display', 'block');
1068				$this.css({
1069					display: 'block',
1070					zIndex: '99'
1071				});
1072			}, 500);
1073
1074		}, function() {
1075			var $this = $(this);
1076
1077			$this.find('.table-wrapper').slideUp('slow');
1078			setTimeout(function() {
1079				$this.find('.product-thumb-item-in').css('minHeight', '');
1080				$this.css({
1081					display: '',
1082					zIndex: ''
1083				});
1084			}, 500);
1085			clearInterval(clearTimeoutThumbs);
1086		});
1087	}
1088	// if (isMobile == false){
1089	// 	hoverThumbs();
1090	// }
1091
1092	//Views-shop-btn
1093
1094	function viewBtnMobile() {
1095		if ($(window).width() <= 630) {
1096			var $viewBtnActive = $('.shop2-panel-sorting .view-shop a.active-view');
1097
1098			$viewBtnActive.on(clickStart, function(event) {
1099				event.preventDefault();
1100				$('.view-shop').addClass('opened');
1101			});
1102
1103			$viewBtnActive.prependTo('.shop2-panel-sorting .view-shop')
1104
1105			$(document).on(clickStart, function(event) {
1106				if ($(event.target).closest('.view-shop').length) return;
1107				$('.view-shop').removeClass('opened');
1108			});
1109		}
1110	}
1111	$(window).on('resize', viewBtnMobile).trigger('resize');
1112
1113	//Amount-minus-disabled
1114
1115	$('.shop2-cart-product, .shop2-item-product, .product-r-side').each(function(index) {
1116		var $this = $(this),
1117			$amountInput = $this.find('.shop2-product-amount input[type="text"]'),
1118			amountInputValue = $amountInput.val();
1119
1120		function amounMinus() {
1121			if (amountInputValue >= 2) {
1122				$this.find('.shop2-product-amount button.amount-minus').removeClass('disabled');
1123			} else {
1124				$this.find('.shop2-product-amount button.amount-minus').addClass('disabled');
1125			}
1126		}
1127		amounMinus();
1128
1129		$this.find('.shop2-product-amount button').on(clickStart, function(e) {
1130			setTimeout(function() {
1131				amountInputValue = $amountInput.val();
1132
1133				amounMinus();
1134			}, 100);
1135		});
1136		$this.find('.shop2-product-amount input').on('keyup', function(e) {
1137			setTimeout(function() {
1138				amountInputValue = $amountInput.val();
1139
1140				amounMinus();
1141			}, 100);
1142		});
1143	});
1144
1145	//Option-hide-price
1146
1147	$('.shop2-hide-options-btn').on('click', function(event) {
1148		$(this).closest('.shop2-product-price').find('.table-wrapper').slideToggle('slow');
1149		$(this).toggleClass('opened');
1150		if ($('.shop2-hide-options-btn').hasClass('opened')){
1151			$(this).html('Свернуть параметры');
1152		} else {
1153			$(this).html('Все параметры');
1154		}
1155	});
1156	//Option-hide-cart
1157
1158	$('.cart-param-btn').on('click', function(event) {
1159		$(this).closest('.cart-product-details').find('.cart-product-param-wr').slideToggle('slow');
1160		$(this).toggleClass('opened');
1161		if ($('.cart-param-btn').hasClass('opened')){
1162			$(this).html('Свернуть параметры');
1163		} else {
1164			$(this).html('Все параметры');
1165		}
1166	});
1167
1168	//Coupon-hide
1169	var couponFlag = 1;
1170
1171	$('.coupon-open-btn').on('click', function(event) {
1172		$('.shop2-coupon-wr').slideToggle('slow');
1173	});
1174
1175	function couponHide() {
1176		if (($(window).width() > 659) && couponFlag == 1) {
1177			$('.shop2-coupon-wr').css('display', 'block');
1178			couponFlag = 2;
1179		} else if (($(window).width() <= 659) && couponFlag == 2) {
1180			$('.shop2-coupon-wr').css('display', 'none');
1181			couponFlag = 1;
1182		}
1183	}
1184	$(window).on('resize', couponHide).trigger('resize');
1185
1186
1187
1188	//Product-pic
1189
1190	 $('.product-image-slick').slick({
1191		slidesToShow: 1,
1192		slidesToScroll: 1,
1193		arrows: false,
1194		fade: true,
1195		asNavFor: '.slick-slider-product'
1196	});
1197	$('.slick-slider-product').slick({
1198		slidesToShow: 3,
1199		slidesToScroll: 1,
1200		asNavFor: '.product-image-slick',
1201		dots: isMobile ? true : false,
1202		arrows: isMobile ? false : true,
1203		centerMode: false,
1204		focusOnSelect: true
1205	});
1206
1207	if (isMobile) {
1208		$('.shop2-product-mode-wr .slick-slider-product').css({
1209			marginLeft: 0,
1210			marginRight: 0
1211		});
1212	}
1213	$('.slick-slider-product').css({
1214		opacity: 1,
1215		height: 'auto',
1216		visibility: 'visible'
1217	});
1218	$('.product-image-slick').css({
1219		height: 'auto'
1220	});
1221
1222// настройки хайслайда на странице товара
1223    (function() {
1224        if (shop2.mode!=="product") return;
1225            hs.align = 'center';
1226            hs.transitions = ['expand', 'crossfade'];
1227            hs.outlineType = 'rounded-white';
1228            hs.fadeInOut = true;
1229            hs.dimmingOpacity = 0.75; 
1230            hs.registerOverlay({
1231            thumbnailId: null,
1232            overlayId: 'controlbar',
1233            position: 'bottom right',
1234            hideOnMouseOut: true
1235        });
1236        hs.dimmingOpacity = 0.5;
1237        hs.align = 'center';
1238
1239        hs.addSlideshow({
1240            slideshowGroup: 'gr1',
1241            interval: 5000, //интервал слайд-шоу в мс
1242            repeat: false,
1243            useControls: true,
1244            fixedControls: true,
1245
1246            overlayOptions: {
1247                opacity: .6,
1248                position: 'bottom center'
1249            }
1250        });
1251    })();
1252
1253	//Colection-slider
1254	var flag = 1;
1255
1256	function collectionSlider() {
1257		if ($(window).width() >= 711) {
1258			var ThumbWidth = 31.81818,
1259				ThumbMargin = 2.272727272727273;
1260		} else if(($(window).width() <= 710) && ($(window).width() > 490)) {
1261			var ThumbWidth = 48.71795,
1262				ThumbMargin = 2.564102564102564;
1263		} else if($(window).width() < 490) {
1264			var ThumbWidth = 100,
1265				ThumbMargin = 3;
1266		}
1267		var wrapperWidth = $('.shop2-kinds-group').width(),
1268			collectionThumbWidth = Math.floor((wrapperWidth/100)*ThumbWidth),
1269			collectionThumbMargin = Math.floor((wrapperWidth/100)*ThumbMargin);
1270
1271		$('.shop2-kinds-group').each(function() {
1272			var $frame  = $(this).find('.shop2-kinds-group-in'),
1273				$slidee = $frame.children('.shop2-kinds-group-slider').eq(0),
1274				$wrap   = $frame.parent();
1275
1276			$(this).find('.product-thumb-item').css({
1277				'width': collectionThumbWidth,
1278				'marginLeft': collectionThumbMargin
1279			});;
1280
1281			if (flag == 1) {
1282				$frame.sly({
1283				    horizontal: 1,
1284				    itemNav: 'basic',
1285				    smart: 1,
1286				    activateOn: 'click',
1287				    mouseDragging: 1,
1288				    touchDragging: 1,
1289				    releaseSwing: 1,
1290				    startAt: 0,
1291				    scrollBar: $wrap.find('.scrollbar'),
1292				    scrollBy: 1,
1293				    pagesBar: $wrap.find('.pages'),
1294				    activatePageOn: 'click',
1295				    speed: 300,
1296				    elasticBounds: 1,
1297				    dragHandle: 1,
1298				    dynamicHandle: 1,
1299				    clickBar: 1,
1300				    prevPage: $wrap.find('.prevPage'),
1301				    nextPage: $wrap.find('.nextPage')
1302				});
1303			}
1304
1305			$(window).on('resize load', function(){
1306				$frame.sly('reload');
1307			});
1308		});
1309
1310		if (flag == 1) {
1311			if (isMobile) {
1312				$('.shop2-kinds-group .scrollbar').hide();
1313				$('.shop2-kinds-group .sly-slide-btn').hide();
1314			} else {
1315				$('.shop2-kinds-group .pages').hide();
1316			}
1317		}
1318		flag = 0;
1319	}
1320	$(window).on('resize', collectionSlider).trigger('resize');
1321
1322	//Tabs
1323
1324	var $tabs = $('#product_tabs');
1325
1326        $tabs.responsiveTabs({
1327            rotate: false,
1328            startCollapsed: 'accordion',
1329            collapsible: 'accordion',
1330            animation: 'slide',
1331            setHash: true,
1332			scrollToAccordion: true,
1333			scrollToAccordionOffset: 40
1334        });
1335
1336    $('#reg-password').focus(function() {
1337    	$('.form-registration-left .reg-password').hide();
1338    });
1339    $('#reg-password').blur(function() {
1340    	$('.form-registration-left .reg-password').show();
1341    });
1342
1343    
1344    if ($('.product-list').hasClass('product-list-thumbs')) {
1345    	$('.shop2-item-product.product-thumb-item').each(function(){
1346			var $this = $(this);
1347
1348			if ($this.find('.shop-product-btn.type-2').length) return;
1349			$this.find('.shop2-product-amount button').hide();
1350			$this.find('.shop-product-order-btn.type-3').css('float', 'right');
1351		});
1352    } else if ($('.pricelist-shop2').length) {
1353		$('.shop2-item-product.shop2-product-price').each(function(){
1354			var $this = $(this);
1355
1356			if ($this.find('.shop-product-btn.type-1').length) return;
1357			$this.find('.shop-product-order-btn.type-3').css('width', 56);
1358		});
1359    }
1360
1361    	$('.shop2-kinds-group .shop2-item-product.product-thumb-item').each(function(){
1362			var $this = $(this);
1363
1364			if ($this.find('.shop-product-btn.type-2').length) return;
1365			$this.find('.shop2-product-amount button').hide();
1366			$this.find('.shop-product-order-btn.type-3').css('float', 'right');
1367		});
1368
1369
1370	
1371	//bind image load
1372
1373    $.fn.bindImageLoad = function (callback) {
1374      function isImageLoaded(img) {
1375          if (!img.complete) {
1376              return false;
1377          }
1378          if (typeof img.naturalWidth !== "undefined" && img.naturalWidth === 0) {
1379              return false;
1380          }
1381          return true;
1382      }
1383
1384      return this.each(function () {
1385          var ele = $(this);
1386          if (ele.is("img") && $.isFunction(callback)) {
1387              ele.one("load", callback);
1388              if (isImageLoaded(this)) {
1389                  ele.trigger("load");
1390              }
1391          }
1392      });
1393    };
1394    
1395    //----Product-Collection
1396    function mainCollectionHeight() {
1397    	
1398    	
1399				$('.shop2-kinds-group').each(function(){
1400			    	var heights = [],
1401			    		maxHeight,
1402			    		myPaddingTop = 0,
1403			    		productPaddingTop= 0;
1404					
1405					$(this).find('.shop2-item-product .product-bot').css('paddingTop', 0);
1406					$(this).find('.shop2-item-product .product-bot').css('marginTop', 0);
1407
1408					if ($(window).width() > 480) {
1409					    $(this).find('.shop2-item-product').each(function(){
1410					        heights.push($(this).height());
1411					    });
1412					    maxHeight = Math.max.apply(null, heights);
1413					    
1414					    $(this).find('.shop2-item-product').each(function(){
1415						    myPaddingTop = (maxHeight - $(this).height() + 10);
1416						    
1417							$(this).find('.product-bot').css('paddingTop', myPaddingTop);
1418					    });
1419				    }
1420				});
1421    }
1422$(window).load(function() {
1423    mainCollectionHeight();
1424});
1425$('.site-container').css('opacity', '1');
1426
1427	//Float
1428
1429 $('.input_range_slider').each(function(index, el) {
1430		if ($(this).closest('.range_slider_wrapper').find('input.small.hight').attr('data-max')){
1431			var inputRangeMax = parseInt($(this).closest('.range_slider_wrapper').find('input.small.hight').data('max'));
1432		} else {
1433			var inputRangeMax = parseInt(40000);
1434		}
1435        var $this = $(this),
1436            $lower = $this.closest('.range_slider_wrapper').find('.low'),
1437            $upper = $this.closest('.range_slider_wrapper').find('.hight'),
1438            priceMin = 0,
1439            priceMax = 1000000,
1440            arr = [0,inputRangeMax];
1441            
1442        var slider = $this.noUiSlider({
1443            start: [$lower.attr('value'), $upper.attr('value')],
1444            connect: true,
1445            behaviour: 'drag-tap',
1446            range: {
1447                'min': [ arr[0] ],
1448                'max': [ arr[1] ]
1449            }
1450        });
1451
1452        slider.Link('lower').to($lower);
1453        slider.Link('upper').to($upper);
1454    });
1455});
1456$(function(){
1457	$('.search-online-store .block-title').on('click', function(){
1458		setTimeout(function(){
1459			$('.search-online-store .block-body').find('select').styler();
1460		},100)
1461	});
1462	
1463	$('.painted-btn-js').on('click', function(){
1464		$('.kinds-hidden .shop-product-btn').trigger('click');
1465	});
1466	
1467});

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.