PageSourceSearch

https://www.conservatoriobraga.it/js/custom.js?id=10:08:54%20AM

js conservatoriobraga.it collected 2026-09-25 08:09:22 UTC 76,087 bytes, 2,994 lines download raw bytes

1var $j = jQuery.noConflict();
2
3function setProductSize(grid,width) {
4			productW = width;
5            var productCount = 0;
6			var marginW = 0;
7            if (grid.hasClass('row-view')) {
8                var list_width = parseInt(grid.width());
9                productW = list_width;
10				productCount = 1;
11            }
12			else {
13				var marginW = parseInt(grid.find('.product-preview-wrapper:first-child').css("margin-right"));
14				var gridW = parseInt(grid.width());
15				while (productW >= width) {
16					productCount++;
17					productW = gridW / productCount
18				}
19				if (productCount > 1) productCount = productCount - 1;
20			}
21            count_visible_items = productCount;
22            productW = parseInt(gridW / productCount);
23            grid.find('.product-preview-wrapper').css("width", productW - marginW);
24			if (!grid.hasClass('row-view')) {
25				grid.find('.product-preview').each(function() {
26					setProductHeight()
27				});
28			}
29			else {
30				grid.find('.product-preview').each(function() {
31					$j(this).find('.product-preview__image').css({
32						'margin-bottom': ''
33					})
34				});
35			}
36}
37function setProductHeight() {
38	$j('.product-preview').each(function() {
39		var infoH = $j(this).find('.product-preview__info').outerHeight();
40		$j(this).find('.product-preview__image').css({
41			'margin-bottom': infoH + 'px'
42		})
43	});
44}
45
46function debouncer(func, timeout) {
47    var timeoutID, timeout = timeout || 500;
48    return function() {
49        var scope = this,
50            args = arguments;
51        clearTimeout(timeoutID);
52        timeoutID = setTimeout(function() {
53            func.apply(scope, Array.prototype.slice.call(args));
54        }, timeout);
55    }
56}
57
58//Set product height
59
60jQuery(function($j) {
61
62    "use strict";
63	
64	var windowW = window.innerWidth || $j(window).width();
65
66	if (windowW > 767) {
67		setProductHeight()
68	}
69
70});
71
72// MENU HOVER
73
74jQuery(function($j) {
75
76  "use strict";
77 
78  var windowW = window.innerWidth || $j(window).width();
79   
80  function menuIni(windowW) {
81
82	  if (windowW > 768) {
83		$j('ul.navbar-nav > li').addClass('hovernav');
84		$j('ul.navbar-nav > li.hovernav').hover(
85			function(){
86				$j(this).addClass("open")
87			},
88			function(){
89				$j(this).removeClass("open")
90			}
91		);
92		$j('ul.navbar-nav > li li').hover(
93			function(){
94			  if ($j(this).children('ul.level-menu__dropdown').length) {
95				$j(this).addClass('active');
96				$j(this).children('ul.level-menu__dropdown').show().css({'opacity' : 0, 'left' : $j(this).width()})
97				var off = $j(this).children('ul.level-menu__dropdown').offset();
98				var l = off.left;
99				var w = $j(this).children('ul.level-menu__dropdown').width();
100				var docW = $j(".container").width();
101				var isEntirelyVisible = (l + w <= docW);
102							
103				if (!isEntirelyVisible) {
104					$j(this).children('ul.level-menu__dropdown').show().css({'opacity' : 1, 'right' : $j(this).width(), 'left' : 'auto'})
105				} else {
106					$j(this).children('ul.level-menu__dropdown').show().css({'opacity' : 1, 'left' : $j(this).width()})
107				}
108					  
109			  }
110			},
111			function(){
112			  if ($j(this).children('ul.level-menu__dropdown').length) {
113				$j(this).removeClass('active');
114				$j(this).children('ul.level-menu__dropdown').hide().css({'left':'auto', 'right':'auto'})
115			  }
116			}
117	  );
118	  } else {
119		$j('ul.navbar-nav > li').removeClass('hovernav');
120		$j('ul.navbar-nav > li li').unbind('mouseenter mouseleave');
121		$j('.touch ul.navbar-nav > li > a').click(function( e ) {
122			e.preventDefault();
123		})
124		$j('.touch ul.navbar-nav > li a span.caret').click(function() {
125		  $j(this).parent().parent('li').toggleClass('open');
126		});
127		$j('.touch ul.navbar-nav > li a span.link-name').click(function() {
128		  var  url = $j(this).parent('a').attr("href");
129		  window.location = url;
130		});
131		
132	  };
133  
134  }
135  
136  menuIni(windowW);
137  
138  $j('.no-touch .hovernav a').click(function () {
139    window.location = this.href;
140  });
141  
142  var   prevW = windowW;
143    
144	$j(window).resize(debouncer(function(e) {
145
146			var currentW = window.innerWidth || $j(window).width();
147			if (currentW != prevW) {
148				// start resize events					
149					menuIni(currentW);
150				// end resize events		
151			}
152			prevW = window.innerWidth || $j(window).width();
153	}));
154		
155  
156});
157
158// Slide menu small Header
159
160jQuery(function($j) {
161
162    "use strict";
163
164    $j("#openSlidemenu").click(function() {
165        $j(".header--small #slidemenu").slideToggle(250, function() {
166			$j(".header--small #slidemenu").toggleClass('open')
167		});
168        return false;
169    });
170	
171	var prevW = window.innerWidth || $j(window).width();
172
173    $j(window).resize(debouncer(function(e) {
174			var currentW = window.innerWidth || $j(window).width();
175			if (currentW != prevW) {
176				// start resize events	
177				if (currentW < 767) {
178					$j(".header--small #slidemenu").show().removeClass('open');
179				}
180				else {
181					$j(".header--small #slidemenu").hide()
182				}
183				// end resize events		
184			}
185			prevW = window.innerWidth || $j(window).width();
186    }));
187
188});
189
190
191// Price Slider initialize
192
193jQuery(function($j) {
194
195    "use strict";
196	
197	if ($j('.price-slider').length) {
198	
199	var priceSlider = document.getElementById('priceSlider');
200
201	noUiSlider.create(priceSlider, {
202		start: [200, 800],
203		connect: true,
204		step: 1,
205		range: {
206			'min': 0,
207			'max': 1000
208		}
209	});
210	var tipHandles = priceSlider.getElementsByClassName('noUi-handle'),
211		tooltips = [];
212
213	// Add divs to the slider handles.
214	for ( var i = 0; i < tipHandles.length; i++ ){
215		tooltips[i] = document.createElement('div');
216		tipHandles[i].appendChild(tooltips[i]);
217	}
218
219	tooltips[0].className += 'tooltip top';
220	tooltips[0].innerHTML = '<div class="tooltip-inner"><span></span><div class="tooltip-arrow"></div></div>';
221	tooltips[0] = tooltips[0].getElementsByTagName('span')[0];
222	tooltips[1].className += 'tooltip top';
223	tooltips[1].innerHTML = '<div class="tooltip-inner"><span></span><div class="tooltip-arrow"></div></div>';
224	tooltips[1] = tooltips[1].getElementsByTagName('span')[0];
225
226	// When the slider changes, write the value to the tooltips.
227	priceSlider.noUiSlider.on('update', function( values, handle ){
228		tooltips[handle].innerHTML = Math.round(values[handle]);
229	});
230	}
231
232});
233
234// Back to top button
235
236jQuery(function($j) {
237
238    "use strict";
239
240	var windowH = $j(window).height();
241	var backPos;
242	if ($j("footer .back-to-top").length) {
243		var backPos = $j("footer .back-to-top").offset();
244		if (backPos.top < windowH) {
245			$j("footer .back-to-top").hide();
246		}	
247	}
248
249    $j("a[href='#top']").click(function() {
250        $j("html, body").animate({
251            scrollTop: 0
252        }, "slow");
253        return false;
254    });
255
256});
257
258// show newsletter Modal
259
260jQuery(function($j) {
261
262    "use strict";
263	if ($j('#newsletterModal').length) {
264		var pause = $j('#newsletterModal').attr('data-pause');
265		setTimeout(function() {
266			$j('#newsletterModal').modal('show');
267		}, pause);
268	}
269
270})
271
272
273// If Header line not exists
274
275jQuery(function($j) {
276
277    "use strict";
278    if (!$j('.header-line').length) {
279        //$j('.header').addClass('header--no-line');
280    }
281
282});
283
284// Categories menu mobile
285
286jQuery(function($j) {
287
288    "use strict";
289	
290	var windowW = window.innerWidth || $j(window).width();
291
292	$j("#categoriesMenu").click(function() {
293		$j(".navbar-nav--vertical").slideToggle(250, function() {
294			$j("#categoriesMenu").toggleClass('open');
295			$j(".navbar-nav--vertical").toggleClass('open')
296		});
297		return false;
298	});	
299	
300})
301
302// Slide menu mobile
303
304jQuery(function($j) {
305
306    "use strict";
307
308    var windowW = window.innerWidth || $j(window).width();
309
310    if (windowW < 768) {
311        $j('#slidemenu').css({
312            'height': $j(window).height()
313        });
314    }
315    var toggler = '.navbar-toggle';
316    var pagewrapper = '#pageContent';
317    var footer = '.footer';
318    var navigationwrapper = '.navbar-header';
319    var menuwidth = '100%';
320    var slidewidth = '80%';
321    var menuneg = '-100%';
322
323	$j("#slidemenu .slidemenu-close").on("click", function(e) {
324	
325		$j('body').removeClass('modal-open');
326		
327		if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
328			$j('#slidemenu').stop().animate({
329				right: menuneg
330			});
331		} else {
332			$j('#slidemenu').stop().animate({
333				left: menuneg
334			});
335		}		
336    });
337	
338    $j("#navbar").on("click", toggler, function(e) {
339	
340		$j('body').addClass('modal-open');
341
342        var selected = $j(this).hasClass('slide-active');
343
344		
345		if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
346			$j('#slidemenu').stop().show().animate({
347				right: selected ? menuneg : '0px'
348			});
349		} else {
350			$j('#slidemenu').stop().show().animate({
351				left: selected ? menuneg : '0px'
352			});
353		}	
354
355    });
356
357    var windowW = window.innerWidth || $j(window).width();
358
359    var   prevW = windowW;
360
361
362    $j(window).resize(function() {
363        var currentW = window.innerWidth || $j(window).width();
364
365        if (currentW != prevW) {
366            // start resize events
367        if (currentW > 767) {
368            $j('#slidemenu').css({
369                'height': ''
370            });
371			$j('body').removeClass('modal-open');
372			$j('#slidemenu').stop().animate({
373				left: menuneg
374			});
375        } else {
376            $j('#slidemenu').css({
377                'height': $j(window).height()
378            });
379        }			
380			
381            // end resize events		
382        }
383        prevW = window.innerWidth || $j(window).width();
384
385
386    });
387});
388
389
390// Listing page - mobile version - Filters slide
391
392jQuery(function($j) {
393
394    "use strict";
395
396    var windowW = window.innerWidth || $j(window).width();
397
398    if (windowW < 768) {
399        $j('#filtersCol').css({
400            'height': $j(window).height()
401        });
402    }
403
404    var filterneg = '-100%';
405
406    $j("#showFilterMobile").click(function() {
407
408        var active = $j('#filtersCol').hasClass('filter-active');
409		
410		$j('body').toggleClass('modal-open');
411
412        $j('#filtersCol').stop().animate({
413            right: active ? filterneg : '0px'
414        });
415
416        $j('#filtersCol').toggleClass('filter-active');
417
418    });
419	
420	$j("#filtersColClose").click(function() {
421
422        $j('#filtersCol').stop().animate({
423            right: filterneg
424        });
425		
426		$j('body').removeClass('modal-open');
427		
428        $j('#filtersCol').toggleClass('filter-active');
429
430    });
431	
432
433});
434
435
436// Custom select initialized
437
438jQuery(function($j) {
439
440    "use strict";
441    if ($j('.selectpicker').length) {
442        $j('.selectpicker').selectpicker({
443            showSubtext: true
444        });
445    }
446})
447
448// Without zoom previews switcher
449
450jQuery(function($j) {
451			
452
453	if (!$j('.product-zoom').length) {
454	
455		$j('#mainProductImg').css({'min-height': $j('#mainProductImg img').height(), 'min-width': $j('#mainProductImg img').width() })		
456			
457
458		$j('#smallGallery a').click(function(e){
459			e.preventDefault();
460			$j('#smallGallery a').removeClass('active');
461			$j(this).addClass('active');
462			var targ = $j(this).parent('li').index();
463			var curImg = $j('#mainProductImg').find('div.product-main-image__item.active');
464			var cur = curImg.index();
465			if (targ == cur) {
466				return false;
467			}
468			else {
469				var newImg = $j('#mainProductImg').find('div.product-main-image__item:nth-child('+ (targ+1) +')');
470				curImg.removeClass('active');
471				newImg.addClass('active')
472			}
473		})
474		
475	}
476
477	var prevW = window.innerWidth || $j(window).width();
478		
479		$j(window).resize(debouncer(function(e) {
480	
481				var currentW = window.innerWidth || $j(window).width();
482				if (currentW != prevW) {
483					// start resize events						
484					if (!$j('.product-zoom').length) {
485	
486						$j('#mainProductImg').css({'min-height': '', 'min-width': '' })	
487						$j('#mainProductImg').css({'min-height': $j('#mainProductImg img').height(), 'min-width': $j('#mainProductImg img').width() })		
488
489					}		
490					// end resize events		
491				}
492				prevW = window.innerWidth || $j(window).width();
493		}));
494		
495})
496
497// Magnific Popup on Product Image click
498
499jQuery(function($j) {
500
501	if ($j('#mainProductImg .zoom-link').length) {
502		$j('#mainProductImg').magnificPopup({
503          disableOn: 767,
504		  delegate: '.zoom-link',
505          type: 'image',
506          mainClass: 'mfp-fade',
507          preloader: true,
508          fixedContentPos: false,
509		  gallery: {
510            enabled: true,
511            navigateByImgClick: true,
512            preload: [0,1] // Will preload 0 - before current, and 1 after the current image
513          }
514        });
515	}
516})
517
518// Elevate Zoom
519
520jQuery(function($j) {
521
522    var windowW = window.innerWidth || document.documentElement.clientWidth;
523	$j('.product-zoom').imagesLoaded(function() {
524    if ($j('.product-zoom').length) {
525		var zoomPosition
526		if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
527			zoomPosition = 11;
528		}
529		else {
530			zoomPosition = 1
531		}
532        if (windowW > 767) {
533            $j('.product-zoom').elevateZoom({
534                zoomWindowHeight: $j('.product-zoom').height(),
535                gallery: "smallGallery",
536				galleryActiveClass: 'active',
537				zoomWindowPosition	: zoomPosition
538            })
539        } else {
540            $j(".product-zoom").elevateZoom({
541                gallery: "smallGallery",
542                zoomType: "inner",
543				galleryActiveClass: 'active',
544				zoomWindowPosition	: zoomPosition
545            });
546        }
547    }
548	})
549	
550	
551	$j('.product-main-image > .product-main-image__zoom ').bind('click', function(){
552	
553		
554			galleryObj = [];
555			current = 0;
556			itemN = 0;
557			
558		if ($j('#smallGallery').length){
559			$j('#smallGallery li a').not('.video-link').each(function() {
560				if ($j(this).hasClass('active')) {
561					current = itemN;
562				}
563				itemN++;
564				var src = $j(this).data('zoom-image'),
565					type = 'image';
566					image = {};
567					image ["src"] = src;
568					image ["type"] = type;
569
570				galleryObj.push(image);
571			});
572		}
573		
574		else {
575				itemN++;
576				var src = $j(this).parent().find('.product-zoom').data('zoom-image'),
577					type = 'image';
578					image = {};
579					image ["src"] = src;
580					image ["type"] = type;
581
582				galleryObj.push(image);
583		}
584
585	    $j.magnificPopup.open({
586			items: galleryObj,
587			gallery: {
588				enabled: true,
589			}
590		}, current);
591		
592	});
593	
594    var  prevW = windowW;
595
596
597    $j(window).resize(debouncer(function(e) {
598        var currentW = window.innerWidth || $j(window).width();
599
600        if (currentW != prevW) {
601            // start resize events
602
603	        $j('.zoomContainer').remove();
604			$j('.elevatezoom').removeData('elevateZoom');
605
606			if ($j('.product-zoom').length) {
607				if (currentW > 767) {
608					$j('.product-zoom').elevateZoom({
609						zoomWindowHeight: $j('.product-zoom').height(),
610						gallery: "smallGallery"
611					})
612				} else {
613					$j(".product-zoom").elevateZoom({
614						gallery: "smallGallery",
615						zoomType: "inner"
616					});
617				}
618			}		
619			
620			
621            // end resize events		
622        }
623
624
625        prevW = window.innerWidth || $j(window).width();
626
627
628    }));
629})
630
631// Show rev slider when page loaded
632
633jQuery(function($j) {
634
635    "use strict";
636
637    if ($j(".tp-banner-container").length) {
638
639        $j(".tp-banner-container").css({
640            height: 'auto'
641        }).animate({
642            "opacity": "1"
643        }, 500);
644
645    }
646
647});
648
649jQuery(function($j) {
650
651    "use strict";
652
653    $j(".scroll-to-content").click(function() {
654        $j('html, body').animate({
655            scrollTop: $j(window).height() - $j('header .navbar').height() 
656        }, 500);
657        $j(".scroll-to-content").hide(200);
658    });
659
660});
661
662jQuery(function($j) {
663
664    "use strict";
665	
666	var slideIndex = 0;
667	
668	function addToCompare(button) {
669		var image = button.closest('.product-preview').find('.product-preview__image img').attr('src');
670		var link = button.closest('.product-preview').find('.product-preview__image a').attr('href');
671		var list = $j('.compare-box__items__list')
672		slideIndex++;
673		var addRow = '<div class="compare-box__items__list__item__delete"><a href="'+link+'" class="icon icon-clear"></a></div><a href="#"><img src="'+image+'" alt=""/></a>';
674		if (list.find('.empty').length){
675			list.find('.empty:first').html(addRow).removeClass('empty');
676		}
677	}
678
679	function removeAllFromCompare() {
680		var item = $j('.compare-box__items__list__item');
681		var list = $j('.compare-box__items__list');
682		var addEmptyRow = '<li class="compare-box__items__list__item empty"><div class="compare-box__items__list__item__num"></div><img src="images/products/product-empty.png" alt=""/></li>';
683		item.each(function() {
684			if (!$j(this).hasClass('empty')) {
685				$j(this).remove()
686				list.append(addEmptyRow);
687			}
688		})
689	}
690	
691	function removeFromCompare(button) {
692		var item = button.parent('.compare-box__items__list__item');
693		var list = $j('.compare-box__items__list');
694		item.remove();
695		var addEmptyRow = '<li class="compare-box__items__list__item empty"><div class="compare-box__items__list__item__num"></div><img src="images/products/product-empty.png" alt=""/></li>';
696		list.append(addEmptyRow);
697		var empty = 0;
698		list.find('li').each(function() {
699			var thisCount = $j(this).index() + 1;
700			$j(this).find('.compare-box__items__list__item__num').text(thisCount);
701			if (!$j(this).hasClass('empty')) {
702				empty = 1;
703			}
704		})
705		if (empty == 0) {
706			$j('#compareBox').stop(true, false).removeClass('minimize').removeClass('open');
707			$j('body').removeClass('compare-minimize');			
708		}
709	}
710	
711    $j(document).on('click','.compare-box__items__list__item__delete', function(e) {
712        e.preventDefault();
713		removeFromCompare($j(this));
714    });
715
716    $j(document).on('click','#removeAllCompare', function(e) {
717        e.preventDefault();
718		removeAllFromCompare($j(this));
719		$j('#compareBox').stop(true, false).removeClass('minimize').removeClass('open');
720		$j('body').removeClass('compare-minimize');
721    });
722	
723		$j('.compare-link').click(function(e) {
724			e.preventDefault();
725			addToCompare($j(this))
726			$j('#compareBox').stop(true, false).removeClass('minimize').addClass('open');
727			$j('body').removeClass('compare-minimize');
728		});
729
730		$j('.hide-compare').click(function(e) {
731			e.preventDefault();
732			$j('#compareBox').stop(true, false).removeClass('open').addClass('minimize');
733			$j('body').addClass('compare-minimize');
734		});
735
736		$j('.show-compare').click(function(e) {
737			e.preventDefault();
738			$j('#compareBox').stop(true, false).removeClass('minimize').addClass('open');
739			$j('body').removeClass('compare-minimize');
740		});
741		
742		$j('.close-compare').click(function(e) {
743			e.preventDefault();
744			$j('#compareBox').stop(true, false).removeClass('minimize').removeClass('open');
745			$j('body').removeClass('compare-minimize');
746		});
747		
748});
749
750// Sticky Header
751
752jQuery(function($j) {
753
754    "use strict";
755		
756    if ($j('header').length) {
757		if ($j(document).scrollTop() > 150) {
758			$j('header .navbar').addClass('stuck--smaller');
759		}
760
761		if ($j('header.header--max.header--sticky').length) {
762			var sticky = new Waypoint.Sticky({
763				element: $j('header #slidemenu')[0],
764				offset: -1
765			})
766		}
767		else {
768			if($j('header.header--sticky .navbar').length) {
769        var $toSticky = $j('.header__dropdowns-container');
770				var sticky = new Waypoint.Sticky({
771					element: $j('header .navbar')[0],
772					offset: -1,
773          handler: function(direction) {  
774            if (direction == 'down'){
775               var $toStickyCopy = $toSticky.detach();
776               $toStickyCopy.appendTo("#navbar");            
777            } else {
778              var $toStickyCopy = $toSticky.detach();
779               $toStickyCopy.insertBefore(".sticky-wrapper");            
780            }
781          }
782				})
783			}
784		}
785    };       
786	
787	$j("body").on("touchend", function(){
788		if ($j(document).scrollTop() > 150) {
789			if(!$j('header .navbar').hasClass('stuck--smaller')) {
790				setTimeout(function() {
791					$j('header .navbar').addClass('stuck--smaller');
792				}, 300);
793			}
794		} else {
795			$j('header .navbar').removeClass('stuck--smaller');
796		}
797	});
798
799	
800	var waypoints = $j('.no-touch header .navbar').waypoint(function(direction) {
801        if (direction === 'down') {
802			$j('.no-touch header .navbar').addClass('stuck--smaller');
803        }
804    }, {
805        offset: -350
806    })
807	var waypoints = $j('.no-touch header .navbar').waypoint(function(direction) {
808        if (direction === 'up') {
809			$j('.no-touch header .navbar').removeClass('stuck--smaller');
810        }
811    }, {
812        offset: -350
813    })
814	
815	var prevW = window.innerWidth || $j(window).width();
816
817	$j(window).resize(function() {
818        var currentW = window.innerWidth || $j(window).width();
819
820        if (currentW != prevW) {
821            // start resize events
822			if ($j(document).scrollTop() > 50) {
823				$j('header .navbar').addClass('stuck--smaller');
824			}        
825            // end resize events
826        }
827
828        prevW = window.innerWidth || $j(window).width();
829
830    });
831	
832	
833});
834
835// Product sticky navigation
836
837jQuery(function($j) {
838	
839    "use strict";
840	
841	var windowW = window.innerWidth || $j(window).width();
842	
843	if (windowW > 767){
844		if ($j('.nav-product').length){
845			$j('.nav-product ul li a').click(function(e) {
846				e.preventDefault();
847				var targ = $j(this).attr('href');
848				var posTop = $j(targ).offset().top - $j('.nav-product ul').outerHeight();
849				$j('body,html').animate({
850					'scrollTop': posTop
851				});
852			});
853			var waypoints = $j('.product-additional__box').waypoint(function(direction) {
854				if (direction === 'down') {
855					var panel;
856					panel = this.element.id;
857					
858					$j('.nav-product ul li.active').removeClass('active');
859					$j(".nav-product ul li[data-target ='"+panel+"']").addClass('active');
860				}
861			}, {
862				offset: $j('.nav-product').outerHeight() + 1
863			})
864			var waypoints = $j('.product-additional__box').waypoint(function(direction) {
865				if (direction === 'up') {
866					var panel;
867					panel = this.element.id;
868					$j('.nav-product ul li.active').removeClass('active');
869					$j('.nav-product ul li[data-target ="'+panel+'"]').addClass('active');
870				}
871			}, {
872				offset: -1
873			})
874			var stickyProduct = new Waypoint.Sticky({
875				element: $j('.nav-product')[0]
876			})
877			if ($j('header.header--sticky').length) {
878				var waypointsH = $j('#navProduct').waypoint(function(direction) {
879					if (direction === 'down') {
880						$j('header .navbar').css({'opacity': 0, 'top': '-100%'});
881					}
882				}, {
883					offset: 50
884				})
885				var waypointsH = $j('#navProduct').waypoint(function(direction) {
886					if (direction === 'up') {
887						$j('header .navbar').css({'opacity': 1, 'top': ''});
888					}
889				}, {
890					offset: 50
891				})
892			}
893		}
894	}
895});
896
897
898
899// Wave effect
900
901jQuery(function($j) {
902
903    "use strict";
904
905    Waves.attach('button.wave');
906    Waves.attach('.wave-block');
907    Waves.init();
908
909});
910
911// Mobile footer collapse
912
913jQuery(function($j) {
914
915    "use strict";
916
917
918    $j('.mobile-collapse__title').click(function(e) {
919        e.preventDefault;
920        $j(this).parent('.mobile-collapse').toggleClass('open');
921    })
922
923
924});
925
926// Filter collapse
927
928jQuery(function($j) {
929
930    "use strict";
931
932
933    $j('.filters-col__collapse__title').click(function(e) {
934        e.preventDefault;
935        $j(this).parent('.filters-col__collapse').toggleClass('open');
936    })
937
938
939});
940
941// Box collapse - shopping cart
942
943jQuery(function($j) {
944
945    "use strict";
946
947
948    $j('.card--collapse .card-title').click(function(e) {
949        e.preventDefault;
950        $j(this).parent('.card').toggleClass('open');
951    })
952
953
954});
955
956jQuery(function($j) {
957
958    "use strict";
959
960	// Product carousel Start	
961    $j('.product-carousel.three-in-row').slick({
962        infinite: true,
963        dots: false,
964        lazyLoad: 'ondemand',
965        slidesToShow: 3,
966        slidesToScroll: 3,
967        responsive: [{
968            breakpoint: 992,
969            settings: {
970                slidesToShow: 3,
971                slidesToScroll: 3
972            }
973        }, {
974            breakpoint: 768,
975            settings: {
976                slidesToShow: 2,
977                slidesToScroll: 2
978            }
979        }, {
980            breakpoint: 560,
981            settings: {
982                slidesToShow: 1,
983                slidesToScroll: 1
984            }
985        }, {
986            breakpoint: 321,
987            settings: {
988                slidesToShow: 1,
989                slidesToScroll: 1,
990                centerMode: true,
991                centerPadding: '20px'
992            }
993        }]
994    });
995
996    $j('.product-carousel.four-in-row').slick({
997        infinite: true,
998        dots: false,
999        lazyLoad: 'ondemand',
1000        slidesToShow: 4,
1001        slidesToScroll: 4,
1002        responsive: [{
1003            breakpoint: 992,
1004            settings: {
1005                slidesToShow: 3,
1006                slidesToScroll: 3
1007            }
1008        }, {
1009            breakpoint: 768,
1010            settings: {
1011                slidesToShow: 2,
1012                slidesToScroll: 2
1013            }
1014        }, {
1015            breakpoint: 560,
1016            settings: {
1017                slidesToShow: 1,
1018                slidesToScroll: 1
1019            }
1020        }, {
1021            breakpoint: 321,
1022            settings: {
1023                slidesToShow: 1,
1024                slidesToScroll: 1,
1025                centerMode: true,
1026                centerPadding: '20px'
1027            }
1028        }]
1029    });
1030	
1031	$j('.product-carousel.five-in-row').slick({
1032        infinite: true,
1033        dots: false,
1034        lazyLoad: 'ondemand',
1035        slidesToShow: 5,
1036        slidesToScroll: 5,
1037        responsive: [{
1038            breakpoint: 992,
1039            settings: {
1040                slidesToShow: 4,
1041                slidesToScroll: 4
1042            }
1043        }, {
1044            breakpoint: 768,
1045            settings: {
1046                slidesToShow: 2,
1047                slidesToScroll: 2
1048            }
1049        }, {
1050            breakpoint: 560,
1051            settings: {
1052                slidesToShow: 1,
1053                slidesToScroll: 1
1054            }
1055        }, {
1056            breakpoint: 321,
1057            settings: {
1058                slidesToShow: 1,
1059                slidesToScroll: 1,
1060                centerMode: true,
1061                centerPadding: '20px'
1062            }
1063        }]
1064    });
1065	// Product carousel End	
1066	
1067	// Category carousel Start	
1068    $j('.product-category-carousel').slick({
1069        infinite: true,
1070        dots: false,
1071        lazyLoad: 'ondemand',
1072        slidesToShow: 5,
1073        slidesToScroll: 5,
1074        responsive: [{
1075            breakpoint: 992,
1076            settings: {
1077                slidesToShow: 3,
1078                slidesToScroll: 3
1079            }
1080        }, {
1081//            breakpoint: 768,
1082            breakpoint: 821,
1083            settings: {
1084                slidesToShow: 2,
1085                slidesToScroll: 2
1086            }
1087        }, {
1088            breakpoint: 560,
1089            settings: {
1090                slidesToShow: 2,
1091                slidesToScroll: 2
1092            }
1093        }, {
1094            breakpoint: 480,
1095            settings: {
1096                slidesToShow: 1,
1097                slidesToScroll: 1,
1098                centerMode: true,
1099                centerPadding: '40px'
1100            }
1101        }]
1102    });
1103	// Category carousel End		
1104	
1105	// Category carousel Start	
1106    $j('.product-category-carousel-aside').slick({
1107        infinite: true,
1108        dots: false,
1109        lazyLoad: 'ondemand',
1110        slidesToShow: 4,
1111        slidesToScroll: 4,
1112        responsive: [{
1113            breakpoint: 992,
1114            settings: {
1115                slidesToShow: 3,
1116                slidesToScroll: 3
1117            }
1118        }, {
1119            breakpoint: 768,
1120            settings: {
1121                slidesToShow: 2,
1122                slidesToScroll: 2
1123            }
1124        }, {
1125            breakpoint: 560,
1126            settings: {
1127                slidesToShow: 2,
1128                slidesToScroll: 2
1129            }
1130        }, {
1131            breakpoint: 480,
1132            settings: {
1133                slidesToShow: 1,
1134                slidesToScroll: 1,
1135                centerMode: true,
1136                centerPadding: '40px'
1137            }
1138        }]
1139    });
1140	// Category carousel End	
1141	
1142	// Events carousel Start	
1143/*     $j('.events-category-carousel').slick({
1144        infinite: true,
1145        dots: false,
1146        lazyLoad: 'ondemand',
1147        slidesToShow: 4,
1148        slidesToScroll: 4,
1149        responsive: [{
1150            breakpoint: 992,
1151            settings: {
1152                slidesToShow: 4,
1153                slidesToScroll: 4
1154            }
1155        }, {
1156            breakpoint: 768,
1157            settings: {
1158                slidesToShow: 3,
1159                slidesToScroll: 3
1160            }
1161        }, {
1162            breakpoint: 560,
1163            settings: {
1164                slidesToShow: 2,
1165                slidesToScroll: 2
1166            }
1167        }, {
1168            breakpoint: 480,
1169            settings: {
1170                slidesToShow: 1,
1171                slidesToScroll: 1,
1172                centerMode: true,
1173                centerPadding: '40px'
1174            }
1175        }]
1176    });
1177 */	// Events carousel End		
1178
1179
1180
1181
1182
1183
1184
1185
1186	// Events carousel Start	
1187	if ($j('.events-category-carousel').closest('.dx-column').length) {
1188		$j('.events-category-carousel').slick({
1189			autoplay: true,
1190			infinite: true,
1191			dots: false,
1192			lazyLoad: 'ondemand',
1193			slidesToShow: 1,
1194			slidesToScroll: 1,
1195			responsive: [{
1196				breakpoint: 992,
1197				settings: {
1198					slidesToShow: 1,
1199					slidesToScroll: 1
1200				}
1201			}, {
1202				breakpoint: 768,
1203				settings: {
1204					slidesToShow: 1,
1205					slidesToScroll: 1
1206				}
1207			}, {
1208				breakpoint: 560,
1209				settings: {
1210					slidesToShow: 1,
1211					slidesToScroll: 1
1212				}
1213			}, {
1214				breakpoint: 480,
1215				settings: {
1216					slidesToShow: 1,
1217					slidesToScroll: 1,
1218					centerMode: true,
1219					centerPadding: '50px'
1220				}
1221			}]
1222		});
1223	}
1224	else {
1225		$j('.events-category-carousel').slick({
1226			autoplay: true,
1227			infinite: true,
1228			dots: false,
1229			lazyLoad: 'ondemand',
1230			slidesToShow: 4,
1231			slidesToScroll: 4,
1232			responsive: [{
1233				breakpoint: 992,
1234				settings: {
1235					slidesToShow: 3,
1236					slidesToScroll: 3
1237				}
1238			}, {
1239				breakpoint: 768,
1240				settings: {
1241					slidesToShow: 2,
1242					slidesToScroll: 2
1243				}
1244			}, {
1245				breakpoint: 560,
1246				settings: {
1247					slidesToShow: 2,
1248					slidesToScroll: 2
1249				}
1250			}, {
1251				breakpoint: 480,
1252				settings: {
1253					slidesToShow: 1,
1254					slidesToScroll: 1,
1255					centerMode: true,
1256					centerPadding: '50px'
1257				}
1258			}]
1259		});
1260	}
1261	// Events carousel End	
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272	// Brand carousel Start	
1273	if ($j('.brands-carousel').closest('.dx-column').length) {
1274		$j('.brands-carousel').slick({
1275			autoplay: true,
1276			infinite: true,
1277			dots: false,
1278			lazyLoad: 'ondemand',
1279			slidesToShow: 1,
1280			slidesToScroll: 1,
1281			responsive: [{
1282				breakpoint: 992,
1283				settings: {
1284					slidesToShow: 1,
1285					slidesToScroll: 1
1286				}
1287			}, {
1288				breakpoint: 768,
1289				settings: {
1290					slidesToShow: 1,
1291					slidesToScroll: 1
1292				}
1293			}, {
1294				breakpoint: 560,
1295				settings: {
1296					slidesToShow: 1,
1297					slidesToScroll: 1
1298				}
1299			}, {
1300				breakpoint: 480,
1301				settings: {
1302					slidesToShow: 1,
1303					slidesToScroll: 1,
1304					centerMode: true,
1305					centerPadding: '50px'
1306				}
1307			}]
1308		});
1309	}
1310	else {
1311		$j('.brands-carousel').slick({
1312			autoplay: true,
1313			infinite: true,
1314			dots: false,
1315			lazyLoad: 'ondemand',
1316			slidesToShow: 3,
1317			slidesToScroll: 3,
1318			responsive: [{
1319				breakpoint: 992,
1320				settings: {
1321					slidesToShow: 3,
1322					slidesToScroll: 3
1323				}
1324			}, {
1325				breakpoint: 768,
1326				settings: {
1327					slidesToShow: 2,
1328					slidesToScroll: 2
1329				}
1330			}, {
1331				breakpoint: 560,
1332				settings: {
1333					slidesToShow: 2,
1334					slidesToScroll: 2
1335				}
1336			}, {
1337				breakpoint: 480,
1338				settings: {
1339					slidesToShow: 1,
1340					slidesToScroll: 1,
1341					centerMode: true,
1342					centerPadding: '50px'
1343				}
1344			}]
1345		});
1346	}
1347	// Brand carousel End	
1348	
1349	// Blog carousel Start	
1350	var blogCarousel = $j('.blog-carousel');
1351	
1352	if (blogCarousel.hasClass('show-2')) {
1353		blogCarousel.slick({
1354			infinite: true,
1355			dots: false,
1356			slidesToShow: 2,
1357			slidesToScroll: 2,
1358			responsive: [{
1359				breakpoint: 768,
1360				settings: {
1361					dots: true
1362				}
1363			}, {
1364				breakpoint: 480,
1365				settings: {
1366					slidesToShow: 1,
1367					slidesToScroll: 1
1368				}
1369			}]
1370		}); 
1371	}
1372	else if (blogCarousel.hasClass('show-3')) {
1373		blogCarousel.slick({
1374			infinite: true,
1375			dots: false,
1376			slidesToShow: 3,
1377			slidesToScroll: 2,
1378			responsive: [{
1379				breakpoint: 992,
1380				settings: {
1381					slidesToShow: 2,
1382					slidesToScroll: 2,
1383					dots: true
1384				}
1385			}, {
1386				breakpoint: 480,
1387				settings: {
1388					slidesToShow: 1,
1389					slidesToScroll: 1
1390				}
1391			}]
1392		}); 
1393	}	
1394	else if (blogCarousel.hasClass('show-4')) {
1395		blogCarousel.slick({
1396			infinite: true,
1397			dots: false,
1398			slidesToShow: 4,
1399			slidesToScroll: 2,
1400			responsive: [{
1401				breakpoint: 1200,
1402				settings: {
1403					slidesToShow: 3,
1404					slidesToScroll: 2,
1405					dots: true
1406				}
1407			},{
1408				breakpoint: 992,
1409				settings: {
1410					slidesToShow: 2,
1411					slidesToScroll: 2,
1412					dots: true
1413				}
1414			}, {
1415				breakpoint: 480,
1416				settings: {
1417					slidesToShow: 1,
1418					slidesToScroll: 1
1419				}
1420			}]
1421		}); 
1422	}
1423	else {
1424		blogCarousel.slick({
1425			infinite: true,
1426			dots: false,
1427			slidesToShow: 1,
1428			slidesToScroll: 1,
1429			responsive: [{
1430				breakpoint: 768,
1431				settings: {
1432					dots: true
1433				}
1434			}]
1435		});
1436	}
1437	// Blog carousel End
1438	
1439	// Testimonials carousel Start
1440    $j('.testimonials-carousel').slick({
1441        infinite: true,
1442        slidesToShow: 1,
1443        slidesToScroll: 1,
1444		arrows: false,
1445		dots: true
1446    });
1447	// Testimonials carousel End
1448	
1449	// Vertical products carousel Start
1450	
1451	if ($j('.products-widget-carousel').closest('.filters-col__collapse').length){
1452
1453		var state = 0;
1454				
1455		if (!$j('.products-widget-carousel').closest('.filters-col__collapse').hasClass('open')) {
1456			var state = 1;
1457			$j('.products-widget-carousel').closest('.filters-col__collapse').addClass('open');
1458		}
1459		$j('.products-widget-carousel').on('init', function(event, slick){
1460			if (state == 1) {
1461			setTimeout(function() {
1462				$j('.products-widget-carousel').closest('.filters-col__collapse').removeClass('open');
1463			}, 1000);
1464			}
1465		});
1466		$j('.products-widget-carousel').slick({
1467			vertical: true,
1468			infinite: true,
1469			slidesToShow: 2,
1470			slidesToScroll: 2,
1471			verticalSwiping: true,
1472			arrows: false,
1473			dots: true
1474		});
1475		
1476	}
1477	else {
1478		$j('.products-widget-carousel').slick({
1479			vertical: true,
1480			infinite: true,
1481			slidesToShow: 3,
1482			slidesToScroll: 3,
1483			verticalSwiping: true,
1484			arrows: false,
1485			dots: true,
1486			responsive: [{
1487				breakpoint: 992,
1488				settings: {
1489					slidesToShow: 3,
1490					slidesToScroll: 3
1491				}
1492			}]
1493		});
1494	}
1495	// Vertical products carousel End
1496	
1497	// Product thumbnails carousel Start	
1498    $j('.product-images-carousel ul').slick({
1499        infinite: false,
1500        dots: false,
1501        slidesToShow: 5,
1502        slidesToScroll: 1,
1503        responsive: [{
1504            breakpoint: 1200,
1505            settings: {
1506                slidesToShow: 3,
1507                slidesToScroll: 1
1508            }
1509        },{
1510            breakpoint: 992,
1511            settings: {
1512                slidesToShow: 2,
1513                slidesToScroll: 1
1514            }
1515        }]
1516    });
1517	// Product thumbnails carousel End	
1518	
1519	// Product mobile slider Start	
1520    $j('#singleGallery').slick({
1521        infinite: false,
1522        dots: true,
1523        arrows: false,
1524        slidesToShow: 1,
1525        slidesToScroll: 1
1526    });
1527	// Product mobile slider End
1528
1529	// Product vertical product slider Start
1530	if ($j('#singleGalleryVertical').length) {
1531	$j('#singleGalleryVertical').on('init', function(event, slick){
1532		$j('#singleGalleryVertical').css({'opacity': 1})
1533	});
1534    $j('#singleGalleryVertical').css({'opacity': 0}).slick({
1535        infinite: false,
1536		vertical: true,
1537		verticalScrolling: true,
1538        dots: true,
1539        arrows: false,
1540        slidesToShow: 1,
1541        slidesToScroll: 1
1542    }).mousewheel(function(e) {
1543		e.preventDefault();
1544
1545		if (e.deltaY < 0) {
1546			$j(this).slick('slickNext')
1547		}
1548		else {
1549			$j(this).slick('slickPrev')
1550		}
1551	});
1552	}
1553	// Product vertical product slider End	
1554	
1555	// Simple slider Start
1556
1557	window.setTimeout(function() {
1558        $j('.single-slider').css({
1559			'opacity': '1'
1560		})
1561    },500);
1562	
1563	$j('.single-slider > ul').slick({
1564        infinite: false,
1565        dots: false,
1566        arrows: true,
1567        slidesToShow: 1,
1568        slidesToScroll: 1,
1569		responsive: [{
1570            breakpoint: 768,
1571            settings: {
1572                arrows: false,
1573                dots: true
1574            }
1575        }]
1576    });
1577	// Simple slider End
1578
1579});
1580
1581
1582// Quick view
1583
1584jQuery(function($j) {
1585
1586    "use strict";
1587	
1588	$j('#quickView').on('hidden.bs.modal', function () {
1589	  $j(this).removeData('bs.modal').find('.modal-content').empty();;
1590	});
1591	
1592    $j('.btn-quickview').click(function(e) {
1593		$j('#modalLoader-wrapper').show();
1594        e.preventDefault();
1595        var $jthis = $j(this),
1596            url = $jthis.attr("href");
1597        $j.ajax({
1598            url: url,
1599            cache: false,
1600            success: function(data) {
1601                var $jdata = $j(data);
1602                $j('#quickview .modal-content').empty().append($jdata);
1603            },
1604            complete: function() {
1605                setTimeout(function() {
1606				$j('#modalLoader-wrapper').fadeOut();
1607                    $j('.product-images-carousel ul').on('init', function(e) {
1608                            $j('.product-images-carousel').addClass('loaded');
1609                        })
1610                        .slick({
1611                            infinite: false,
1612                            dots: false,
1613                            slidesToShow: 5,
1614                            slidesToScroll: 1
1615                        });
1616                }, 1000);
1617            },
1618            error: function(jqXHR, textStatus, errorThrown) {
1619                return false;
1620            }
1621        })
1622    });
1623});
1624
1625// Parallax
1626
1627jQuery(function($j) {
1628
1629    "use strict";
1630	if ($j('.content--parallax').length) {
1631		$j('.content--parallax').each(function() {
1632			var attr = $j(this).attr('data-image');		
1633			$j(this).css({'background-image': 'url('+attr+')'}).parallax("50%", 0.01);
1634		})
1635	}
1636	
1637	if ($j('.parallax').length) {
1638		$j('.parallax').each(function() {
1639			var attr = $j(this).attr('data-image');		
1640			$j(this).css({'background-image': 'url('+attr+')'}).parallax("50%", 0);
1641		})
1642	}
1643
1644});
1645
1646// Image background
1647
1648jQuery(function($j) {
1649
1650    "use strict";
1651	if ($j('.image-bg').length) {
1652		$j('.image-bg').each(function() {
1653			var attr = $j(this).attr('data-image');		
1654			$j(this).css({'background-image': 'url('+attr+')'});
1655		})
1656	}
1657
1658});
1659
1660jQuery(function($j) {
1661
1662    "use strict";
1663
1664    $j('#productOther > li').hover(function() {
1665        $j(this).toggleClass('show-image');
1666    });
1667
1668});
1669
1670jQuery(function($j) {
1671
1672    "use strict";
1673	
1674    $j('.header__search input').focus(function() {
1675
1676        $j('.search-focus-fade').stop().animate({
1677            "opacity": "0"
1678        }, 200);
1679
1680    }).blur(function() {
1681
1682        $j('.search-focus-fade').stop().animate({
1683            "opacity": "1"
1684        }, 200);
1685
1686    });
1687
1688})
1689
1690
1691jQuery(function($j) {
1692
1693    "use strict";
1694
1695    function onScrollInit(items, container) {
1696        items.each(function() {
1697            var element = $j(this),
1698                animationClass = element.attr('data-animation'),
1699                animationDelay = element.attr('data-animation-delay');
1700
1701            element.css({
1702                '-webkit-animation-delay': animationDelay,
1703                '-moz-animation-delay': animationDelay,
1704                'animation-delay': animationDelay
1705            });
1706
1707            var trigger = (container) ? container : element;
1708
1709            trigger.waypoint(function() {
1710                element.addClass('animated').addClass(animationClass);
1711            }, {
1712                triggerOnce: true,
1713                offset: '90%'
1714            });
1715        });
1716    }
1717
1718    onScrollInit($j('.animation'));
1719    onScrollInit($j('.staggered-animation'), $j('.staggered-animation-container'));
1720});
1721
1722// Countdown ini
1723
1724jQuery(function ($) {
1725
1726	if ($j("#countdown1").length > 0){$j('#countdown1').countdown({until: new Date(2016, 02, 1)});}
1727
1728});
1729
1730
1731//Isotope
1732
1733jQuery(function($j) {
1734
1735    "use strict";
1736	
1737	var windowW = window.innerWidth || $(window).width();
1738	
1739	if ($j('.products-isotope').length){
1740		$j('.products-isotope').imagesLoaded(function() {
1741			
1742				$j('.products-isotope').isotope({
1743				  itemSelector: '.product-preview-wrapper',
1744				  layoutMode: 'fitRows'
1745				})
1746		
1747		});	
1748	}
1749	
1750	
1751	var minW =  parseInt($j('.products-col').find('.product-preview-wrapper:first-child').width());
1752	if ($j('.products-isotope').hasClass('two-in-row')){
1753			minW = minW-200;
1754	}
1755	
1756	if ($j('.products-col').parent().parent().hasClass('open')) {
1757		
1758		if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
1759			$j('.products-col').stop(true,false).animate({marginRight: '280px'}, 200, 
1760				function() { 
1761					setProductSize($j('.products-col'),minW);
1762					$j('.products-isotope').isotope().isotope('layout');
1763			});
1764		
1765		}
1766		else {
1767			$j('.products-col').stop(true,false).animate({marginLeft: '280px'}, 200, 
1768				function() { 
1769					setProductSize($j('.products-col'),minW);
1770					$j('.products-isotope').isotope().isotope('layout');
1771			});
1772		}
1773	}
1774
1775	
1776	
1777	$j('#showFilter').click(function(e) {
1778        e.preventDefault();
1779		
1780		var minW =  parseInt($j('.products-col').find('.product-preview-wrapper:first-child').width());
1781		if ($j('.products-isotope').hasClass('two-in-row')){
1782				minW = minW-200;
1783		}
1784		if (!$j('.products-col').parent().parent().hasClass('open')) {
1785			$j('.products-col').parent().parent().addClass('open');
1786			if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
1787				$j('.products-col').stop(true,false).animate({marginRight: '280px'}, 200, 
1788					function() { 
1789						setProductSize($j('.products-col'),minW);
1790						$j('.products-isotope').isotope().isotope('layout');
1791				});
1792			
1793			}
1794			else {
1795				$j('.products-col').stop(true,false).animate({marginLeft: '280px'}, 200, 
1796					function() { 
1797						setProductSize($j('.products-col'),minW);
1798						$j('.products-isotope').isotope().isotope('layout');
1799				});
1800			}
1801		}
1802		else {
1803			$j('.products-col').parent().parent().removeClass('open');
1804
1805			$j('.products-col').stop(true,false).animate({marginLeft: '0', marginRight: '0'}, 200, 
1806				function() {
1807					
1808					if ($j('.products-isotope').hasClass('two-in-row')){
1809						if (windowW > 560) {
1810							minW = $j('.products-isotope').width()/2;
1811						} else {
1812							minW = $j('.products-isotope').width()/1;
1813						}
1814					} else if ($j('.products-isotope').hasClass('three-in-row')){
1815						if (windowW > 560) {
1816							minW = $j('.products-isotope').width()/3;
1817						} else {
1818							minW = $j('.products-isotope').width()/1;
1819						}
1820					} else if ($j('.products-isotope').hasClass('four-in-row')){
1821						if (windowW > 767) {
1822							minW = $j('.products-isotope').width()/4;
1823						} else if (windowW > 560) {
1824							minW = $j('.products-isotope').width()/3;
1825						} else {
1826							minW = $j('.products-isotope').width()/1;
1827						}
1828					} else if ($j('.products-isotope').hasClass('five-in-row')){
1829						if (windowW > 991) {
1830							minW = $j('.products-isotope').width()/5;
1831						} else if (windowW > 767) {
1832							minW = $j('.products-isotope').width()/4;
1833						} else if (windowW > 560) {
1834							minW = $j('.products-isotope').width()/3;
1835						} else {
1836							minW = $j('.products-isotope').width()/1;
1837						}
1838					} else if ($j('.products-isotope').hasClass('six-in-row')){
1839						if (windowW > 1199) {
1840							minW = $j('.products-isotope').width()/6;
1841						} else if (windowW > 991) {
1842							minW = $j('.products-isotope').width()/5;
1843						} else if (windowW > 767) {
1844							minW = $j('.products-isotope').width()/4;
1845						} else if (windowW > 560) {
1846							minW = $j('.products-isotope').width()/3;
1847						} else {
1848							minW = $j('.products-isotope').width()/1;
1849						}
1850					} else if ($j('.products-isotope').hasClass('seven-in-row')){
1851						if (windowW > 1600) {
1852							minW = $j('.products-isotope').width()/7;
1853						} else if (windowW > 1199) {
1854							minW = $j('.products-isotope').width()/6;
1855						} else if (windowW > 991) {
1856							minW = $j('.products-isotope').width()/5;
1857						} else if (windowW > 767) {
1858							minW = $j('.products-isotope').width()/4;
1859						} else if (windowW > 560) {
1860							minW = $j('.products-isotope').width()/2;
1861						} else {
1862							minW = $j('.products-isotope').width()/1;
1863						}
1864					} else if ($j('.products-isotope').hasClass('eight-in-row')){
1865						if (windowW > 1600) {
1866							minW = $j('.products-isotope').width()/8;
1867						} else if (windowW > 1199) {
1868							minW = $j('.products-isotope').width()/6;
1869						} else if (windowW > 991) {
1870							minW = $j('.products-isotope').width()/5;
1871						} else if (windowW > 767) {
1872							minW = $j('.products-isotope').width()/4;
1873						} else if (windowW > 560) {
1874							minW = $j('.products-isotope').width()/2;
1875						} else {
1876							minW = $j('.products-isotope').width()/1;
1877						}
1878					}
1879					
1880					setProductSize($j('.products-col'),minW);
1881					$j('.products-isotope.products-col').isotope().isotope('layout');
1882			});		
1883		}
1884	})
1885
1886	var prevW = window.innerWidth || $j(window).width();
1887	
1888	$j(window).resize(function() {
1889        var currentW = window.innerWidth || $j(window).width();
1890
1891        if (currentW != prevW) {
1892            // start resize events
1893			if($j('.products-isotope').length) {
1894				if ($j('.products-col').parent().parent().hasClass('open')) {
1895					$j('.products-col').stop(true,false).animate({marginLeft: '0'}, 0);
1896					$j('.products-col').find('.product-preview-wrapper').css("width", "");
1897					var minW =  parseInt($j('.products-col').find('.product-preview-wrapper:first-child').width());
1898					if ($j('.products-isotope').hasClass('two-in-row')){
1899						minW = minW-200;
1900					}
1901					if ( $j('html').css('direction').toLowerCase() == 'rtl' ) {
1902						$j('.products-col').stop(true,false).animate({marginRight: '280px'}, 200, 
1903							function() { 
1904								setProductSize($j('.products-col'),minW);
1905								$j('.products-isotope').isotope().isotope('layout');
1906						});
1907					
1908					}
1909					else {
1910						$j('.products-col').stop(true,false).animate({marginLeft: '280px'}, 200, 
1911							function() { 
1912								setProductSize($j('.products-col'),minW);
1913								$j('.products-isotope').isotope().isotope('layout');
1914						});
1915					}	
1916				}
1917				else {
1918					$j('.products-col').find('.product-preview-wrapper').css("width", "");
1919					setProductSize($j('.products-col'),minW);
1920					$j('.products-isotope.products-col').isotope().isotope('layout');
1921				}
1922			}
1923
1924
1925            // end resize events
1926        }
1927
1928        prevW = window.innerWidth || $j(window).width();
1929
1930    });
1931
1932});
1933
1934// Isotope Filters (for index-original.html)
1935
1936jQuery(function ($) {
1937    "use strict";
1938    var hoverfold = $j(".products-isotope");
1939    if (hoverfold.length != 0) {
1940        var container = hoverfold;
1941        var optionSets = $j(".filters-by-category .option-set"),
1942            optionLinks = optionSets.find("a");
1943        optionLinks.click(function () {
1944            var thisLink = $(this);
1945            if (thisLink.hasClass("selected")) return false;
1946            var optionSet = thisLink.parents(".option-set");
1947            optionSet.find(".selected").removeClass("selected");
1948            thisLink.addClass("selected");
1949            var options = {},
1950                key = optionSet.attr("data-option-key"),
1951                value = thisLink.attr("data-option-value");
1952            value = value === "false" ? false : value;
1953            options[key] = value;
1954            if (key === "layoutMode" && typeof changeLayoutMode === "function") changeLayoutMode($this, options);
1955            else container.isotope(options);
1956            return false
1957        })
1958    }
1959});
1960
1961
1962// Grid / Row listing view
1963
1964jQuery(function($j) {
1965
1966    "use strict";
1967	
1968	$j('.products-isotope.products-col').on( 'layoutComplete',  function() {
1969		window.setTimeout(function() {
1970            $j('.products-isotope.products-col').removeClass('no-transition');
1971         },1000);
1972	})
1973
1974	$j('a.link-row-view').click(function(e) {
1975		var windowW = window.innerWidth || $(window).width();
1976        e.preventDefault();
1977		$j(this).addClass('active');
1978		$j('a.link-grid-view').removeClass('active');
1979		$j('.products-listing').addClass('row-view');
1980		$j('.products-col').find('.product-preview-wrapper').css("width", "");
1981			if ($j('.outer').hasClass('open')) {
1982				$j('.products-isotope.products-col').addClass('no-transition');
1983				$j('.products-col').stop(true,false).animate({marginLeft: '0'}, 0);
1984				var minW =  parseInt($j('.products-col').find('.product-preview-wrapper:first-child').width());
1985				$j('.products-col').stop(true,false).animate({marginLeft: '280px'}, 0, 
1986					function() { 
1987						setProductSize($j('.products-col'),minW);
1988						$j('.products-isotope.products-col').isotope('layout');
1989				});			
1990			}
1991			else {
1992				$j('.products-isotope.products-col').addClass('no-transition').isotope('layout');
1993			}	})
1994	
1995	$j('a.link-grid-view').click(function(e) {
1996		var windowW = window.innerWidth || $(window).width();
1997        e.preventDefault();
1998		$j(this).addClass('active');
1999		$j('a.link-row-view').removeClass('active');
2000		$j('.products-listing').removeClass('row-view');
2001		$j('.products-col').find('.product-preview-wrapper').css("width", "");
2002			if ($j('.outer').hasClass('open')) {
2003				$j('.products-isotope.products-col').addClass('no-transition');
2004				$j('.products-col').stop(true,false).animate({marginLeft: '0'}, 0);
2005				$j('.products-col').find('.product-preview-wrapper').css("width", "");
2006				var minW =  parseInt($j('.products-col').find('.product-preview-wrapper:first-child').width());
2007				if ($j('.products-isotope').hasClass('two-in-row')){
2008					minW = minW-200;
2009				}
2010				$j('.products-col').stop(true,false).animate({marginLeft: '280px'}, 0, 
2011					function() {
2012						setProductSize($j('.products-col'),minW);
2013						$j('.products-isotope.products-col').isotope('layout');
2014				});			
2015			}
2016			else {
2017				$j('.products-isotope.products-col').addClass('no-transition').isotope('layout');
2018			}	})	
2019})
2020
2021
2022jQuery(function($j) {
2023
2024    "use strict";
2025
2026    var posts = $j('.posts-isotope');
2027	
2028	if (posts.length) {
2029		posts.isotope({
2030			itemSelector: '.post',
2031			masonry: {
2032				isFitWidth: true
2033			}
2034		});
2035		posts.imagesLoaded(function() {
2036			setPostSize();
2037		});	
2038	}
2039    function setPostSize() {
2040        var windowW = window.innerWidth || $(window).width(),
2041            itemsInRow = 1;
2042        if (windowW > 1199) {
2043            itemsInRow = 5;
2044        } else if (windowW > 991) {
2045            itemsInRow = 4;
2046        } else if (windowW > 767) {
2047            itemsInRow = 3;
2048        } else if (windowW > 480) {
2049            itemsInRow = 2;
2050        }
2051        var containerW = posts.parent('.container').width(),
2052            postW = Math.floor(containerW / itemsInRow);
2053        posts.find('.post').each(function() {
2054            $j(this).css({
2055                width: postW + 'px'
2056            });
2057        });
2058        posts.isotope('layout');
2059    }
2060	
2061	$j('.view-more').on( 'click', function() {
2062  
2063	  var item;
2064	  var target =  $j(this).attr('data-load');
2065	  
2066	  $j(this).hide();
2067  
2068  	  $j.ajax({
2069		  url: target,
2070		  success: function( data ) {
2071		  $j('#postPreload').append(data);  	  
2072		  
2073		  $j('#postPreload > div').each(function() {
2074			item = $j(this);
2075			posts.append(item).isotope('appended', item);
2076			setPostSize();
2077		  });
2078
2079
2080		 }
2081	  });
2082	  
2083    })
2084  
2085    var prevW = window.innerWidth || $j(window).width();
2086
2087    $j(window).resize(debouncer(function(e) {
2088		if (posts.length) {			
2089			var currentW = window.innerWidth || $j(window).width();
2090			if (currentW != prevW) {
2091				// start resize events	
2092				setPostSize();
2093				// end resize events		
2094			}
2095			prevW = window.innerWidth || $j(window).width();
2096		}
2097    }));
2098})
2099
2100jQuery(function($j) {
2101
2102    "use strict";
2103	var gallery = $j('.gallery');
2104	
2105	
2106	gallery.imagesLoaded(function() {
2107		if (gallery.length) {
2108			gallery.isotope({
2109				itemSelector: '.gallery__item',
2110				isResizeBound: false,
2111				masonry: {
2112					isFitWidth: true
2113				}
2114			});
2115			setGallerySize();
2116		}	
2117	})
2118	
2119
2120    function setGallerySize() {
2121        var windowW = window.innerWidth || $(window).width(),
2122            itemsInRow = 1;
2123        if (windowW > 1199) {
2124            itemsInRow = 5;
2125        } else if (windowW > 991) {
2126            itemsInRow = 4;
2127        } else if (windowW > 767) {
2128            itemsInRow = 3;
2129        } else if (windowW > 480) {
2130            itemsInRow = 2;
2131        }
2132        var containerW = gallery.parent('.container').width(),
2133            galleryW = containerW / itemsInRow;
2134			
2135		gallery.find('.gallery__item').each(function() {
2136			if ($j(this).hasClass('gallery__item--double') && windowW > 767 ) {
2137				$j(this).css({
2138					width: galleryW*2 + 'px',
2139				});
2140			}
2141			else {
2142				$j(this).css({
2143					width: galleryW + 'px'
2144				});
2145			}
2146        });
2147		var galleryH = gallery.find('.gallery__item:not(.gallery__item--double)').height();
2148			gallery.find('.gallery__item').each(function() {
2149			$j(this).css({
2150					height: ''
2151			});
2152			if ($j(this).hasClass('gallery__item--double') && windowW > 767) {
2153				$j(this).css({
2154					height: galleryH*2 + 'px'
2155				});
2156			}
2157        });
2158		gallery.isotope('layout');
2159    }
2160	
2161	$j('.view-more-gallery').on( 'click', function() {
2162  
2163	  var item;
2164	  var target =  $j(this).attr('data-load');
2165	  
2166	  $j(this).hide();
2167  
2168  	  $j.ajax({
2169		  url: target,
2170		  success: function( data ) {
2171		  $j('#galleryPreload').append(data);  	  
2172		  
2173		  $j('#galleryPreload > div').each(function() {
2174			item = $j(this);
2175			gallery.append(item).isotope('appended', item);
2176			setGallerySize();
2177		  });
2178
2179
2180		 }
2181	  });
2182	  
2183    })
2184  
2185		var prevW = window.innerWidth || $j(window).width();
2186		
2187		$j(window).resize(debouncer(function(e) {
2188			if (gallery.length) {			
2189				var currentW = window.innerWidth || $j(window).width();
2190				if (currentW != prevW) {
2191					// start resize events	
2192					setGallerySize();
2193					// end resize events		
2194				}
2195				prevW = window.innerWidth || $j(window).width();
2196			}
2197		}));
2198
2199	
2200})
2201// Art Catalogue
2202
2203jQuery(function($j) {
2204
2205    "use strict";
2206	var gallery = $j('.art-catalogue');
2207	
2208	 var windowW = window.innerWidth || $(window).width();
2209	 var containerW = gallery.width(),
2210         columnW = containerW / 4;
2211			
2212	if (gallery.length) {
2213		gallery.isotope({
2214			itemSelector: '.art-catalogue__item',
2215			isResizeBound: false,
2216			percentPosition: true,
2217			masonry: {
2218			  columnWidth: '.art-catalogue__item:not(.art-catalogue__item--double)'
2219			}
2220		});
2221		gallery.imagesLoaded(function() {
2222			setGallerySize();
2223		});	
2224	}
2225    function setGallerySize() {
2226        var windowW = window.innerWidth || $(window).width(),
2227            itemsInRow = 1;
2228        if (windowW > 1199) {
2229            itemsInRow = 4;
2230        } else if (windowW > 991) {
2231            itemsInRow = 4;
2232        } else if (windowW > 767) {
2233            itemsInRow = 2;
2234        } else if (windowW > 480) {
2235            itemsInRow = 2;
2236        }
2237        var containerW = gallery.parent('.container').width(),
2238            galleryW = containerW / itemsInRow;
2239			gallery.find('.art-catalogue__item').each(function() {
2240			if ($j(this).hasClass('art-catalogue__item--double') && windowW > 767 ) {
2241				$j(this).css({
2242					width: galleryW*2 + 'px',
2243				});
2244			}
2245			else {
2246				$j(this).css({
2247					width: galleryW + 'px'
2248				});
2249			}
2250        });
2251		gallery.isotope('layout');
2252    }		
2253		var prevW = window.innerWidth || $j(window).width();
2254		
2255		$j(window).resize(debouncer(function(e) {
2256			var gallery = $j('.art-catalogue');
2257			if (gallery.length) {			
2258				var currentW = window.innerWidth || $j(window).width();
2259				if (currentW != prevW) {
2260					// start resize events	
2261					
2262					setGallerySize();
2263					
2264					// end resize events		
2265				}
2266				prevW = window.innerWidth || $j(window).width();
2267			}
2268		}));
2269
2270	
2271})
2272// 	Vertical Menu
2273
2274jQuery(function($j) {
2275
2276    "use strict";
2277	var windowW = window.innerWidth || $j(window).width();
2278
2279	
2280	function setMenuSize(winW) {
2281		var vMenu = $j('.navbar-nav--vertical'),
2282		vMenuW = vMenu.innerWidth()-2,
2283		vMenuH = vMenu.innerHeight()+2,
2284		containerW = vMenu.closest('div[class^="container"]').width();		
2285		if (vMenu.length){
2286			if (winW > 991){
2287				vMenu.children('li').children('.dropdown-menu').css({'margin-left': vMenuW+'px'});		
2288				vMenu.find('.dropdown-menu.megamenu').css({"width": (containerW-vMenuW)+'px', "min-height": vMenuH +'px'});		
2289			}
2290			else {
2291				vMenu.children('li').children('.dropdown-menu').css({'margin-left': '', 'width': ''});	
2292			}
2293		}
2294	}
2295	
2296	setMenuSize(windowW);
2297	
2298	var prevW = windowW;
2299	
2300	$j(window).resize(debouncer(function(e) {
2301			var currentW = window.innerWidth || $j(window).width();
2302			if (currentW != prevW) {
2303				// start resize events
2304				setMenuSize(currentW);
2305				// end resize events		
2306			}
2307			prevW = window.innerWidth || $j(window).width();
2308	}));
2309});
2310
2311// Blog Post button extend
2312
2313jQuery(function($j) {
2314
2315    "use strict";
2316	
2317	$j('.btn-plus > a').on('click', function(e){ 
2318		e.preventDefault() // prevent default action - hash doesn't appear in url
2319   		$j(this).parent().find( 'div' ).toggleClass( 'btn-plus__links--active' );
2320		$j(this).toggleClass('expanded');
2321    });
2322  
2323});
2324
2325// tooltip ini
2326
2327jQuery(function($j) {
2328
2329    "use strict";
2330    $j('.tooltip-link').tooltip();
2331
2332});
2333
2334// open menu button small Header
2335
2336jQuery(function($j) {
2337
2338    "use strict";
2339    $j('#openMenu').on('click', function(e){
2340		
2341	})
2342
2343});
2344
2345
2346
2347// bootstrap minus and plus
2348
2349jQuery(function($j) {
2350
2351    "use strict";
2352    
2353    $j('.btn-number').click(function(e) {
2354        e.preventDefault();
2355        var type = $j(this).attr('data-type');
2356        var input = $j(this).closest('.input-group-qty').find('input.input-qty');
2357        var currentVal = parseInt(input.val());
2358        if (!isNaN(currentVal)) {
2359            if (type == 'minus') {
2360			if (currentVal > input.attr('min')) {
2361                    input.val(currentVal - 1).change();
2362                }
2363                if (parseInt(input.val()) == input.attr('min')) {
2364                    $j(this).attr('disabled', true);
2365                }
2366
2367            } else if (type == 'plus') {
2368
2369                if (currentVal < input.attr('max')) {
2370                    input.val(currentVal + 1).change();
2371                }
2372                if (parseInt(input.val()) == input.attr('max')) {
2373                    $j(this).attr('disabled', true);
2374                }
2375            }
2376        } else {
2377            input.val(0);
2378        }
2379    });
2380    $j('.input-number').focusin(function() {
2381        $j(this).data('oldValue', $j(this).val());
2382    });
2383    $j('.input-number').change(function() {
2384
2385        var minValue = parseInt($j(this).attr('min'));
2386        var maxValue = parseInt($j(this).attr('max'));
2387        var valueCurrent = parseInt($j(this).val());
2388
2389        var name = $j(this).attr('name');
2390        if (valueCurrent >= minValue) {
2391            $j(this).closest('.input-group-qty').find(".btn-number[data-type='minus']").removeAttr('disabled')
2392        } else {
2393            alert('Sorry, the minimum value was reached');
2394            $j(this).val($j(this).data('oldValue'));
2395        }
2396        if (valueCurrent <= maxValue) {
2397            $j(this).closest('.input-group-qty').find(".btn-number[data-type='plus']").removeAttr('disabled')
2398        } else {
2399            alert('Sorry, the maximum value was reached');
2400            $j(this).val($j(this).data('oldValue'));
2401        }
2402
2403
2404    });
2405	
2406});
2407
2408// landing category
2409
2410jQuery(function($j) {
2411
2412    "use strict";
2413	var categoryImg = $j('.category-block__image');
2414	var categoryList = $j('.no-touch .category-block__list');
2415	var categoryListT = $j('.touch .category-block__list');
2416	
2417    categoryList.find('a').hover(function(e){
2418		e.preventDefault();
2419		$j(this).closest('.category-block__list').find('a').removeClass('active');
2420		$j(this).addClass('active');
2421		var targ = $j(this).parent('li').index();
2422		var curImg = $j(this).closest('.category-block').find('.category-block__image > img.active');
2423		var cur = curImg.index();
2424		if (targ == cur) {
2425			return false;
2426		}
2427		else {
2428			var newImg = $j(this).closest('.category-block').find('.category-block__image > img:nth-child('+ (targ+1) +')');
2429			curImg.removeClass('active');
2430			newImg.addClass('active')
2431		}
2432	})
2433	
2434	categoryListT.find('a').click(function(e){
2435		e.preventDefault();
2436		$j(this).closest('.category-block__list').find('a').removeClass('active');
2437		$j(this).addClass('active');
2438		var targ = $j(this).parent('li').index();
2439		var curImg = $j(this).closest('.category-block').find('.category-block__image > img.active');
2440		var cur = curImg.index();
2441		if (targ == cur) {
2442			window.location = this.href;
2443		}
2444		else {
2445			var newImg = $j(this).closest('.category-block').find('.category-block__image > img:nth-child('+ (targ+1) +')');
2446			curImg.removeClass('active');
2447			newImg.addClass('active')
2448		}
2449	})
2450
2451});
2452
2453/*!
2454 * classie - class helper functions
2455 * from bonzo https://github.com/ded/bonzo
2456 * 
2457 * classie.has( elem, 'my-class' ) -> true/false
2458 * classie.add( elem, 'my-new-class' )
2459 * classie.remove( elem, 'my-unwanted-class' )
2460 * classie.toggle( elem, 'my-class' )
2461 */
2462
2463/*jshint browser: true, strict: true, undef: true */
2464/*global define: false */
2465
2466( function( window ) {
2467
2468'use strict';
2469
2470// class helper functions from bonzo https://github.com/ded/bonzo
2471
2472function classReg( className ) {
2473  return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
2474}
2475
2476// classList support for class management
2477// altho to be fair, the api sucks because it won't accept multiple classes at once
2478var hasClass, addClass, removeClass;
2479
2480if ( 'classList' in document.documentElement ) {
2481  hasClass = function( elem, c ) {
2482    return elem.classList.contains( c );
2483  };
2484  addClass = function( elem, c ) {
2485    elem.classList.add( c );
2486  };
2487  removeClass = function( elem, c ) {
2488    elem.classList.remove( c );
2489  };
2490}
2491else {
2492  hasClass = function( elem, c ) {
2493    return classReg( c ).test( elem.className );
2494  };
2495  addClass = function( elem, c ) {
2496    if ( !hasClass( elem, c ) ) {
2497      elem.className = elem.className + ' ' + c;
2498    }
2499  };
2500  removeClass = function( elem, c ) {
2501    elem.className = elem.className.replace( classReg( c ), ' ' );
2502  };
2503}
2504
2505function toggleClass( elem, c ) {
2506  var fn = hasClass( elem, c ) ? removeClass : addClass;
2507  fn( elem, c );
2508}
2509
2510var classie = {
2511  // full names
2512  hasClass: hasClass,
2513  addClass: addClass,
2514  removeClass: removeClass,
2515  toggleClass: toggleClass,
2516  // short names
2517  has: hasClass,
2518  add: addClass,
2519  remove: removeClass,
2520  toggle: toggleClass
2521};
2522
2523// transport
2524if ( typeof define === 'function' && define.amd ) {
2525  // AMD
2526  define( classie );
2527} else {
2528  // browser global
2529  window.classie = classie;
2530}
2531
2532})( window );
2533
2534
2535
2536// Modal Search Popup
2537
2538
2539jQuery(function($j) {
2540	
2541	if ($j('.overlay').length && $j('.search-open').length) {
2542	
2543    var triggerBttn = $j('.search-open'),
2544        overlay = document.querySelector('div.overlay'),
2545        closeBttn = overlay.querySelector('button.overlay-close');
2546		transEndEventNames = {
2547            'WebkitTransition': 'webkitTransitionEnd',
2548            'MozTransition': 'transitionend',
2549            'OTransition': 'oTransitionEnd',
2550            'msTransition': 'MSTransitionEnd',
2551            'transition': 'transitionend'
2552        },
2553        transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
2554        support = {
2555            transitions: Modernizr.csstransitions
2556        };
2557
2558    function toggleOverlay() {
2559        if (classie.has(overlay, 'open')) {
2560			$j('body').removeClass('modal-open');
2561            classie.remove(overlay, 'open');
2562            classie.add(overlay, 'close');
2563            var onEndTransitionFn = function(ev) {
2564                if (support.transitions) {
2565                    if (ev.propertyName !== 'visibility') return;
2566                    this.removeEventListener(transEndEventName, onEndTransitionFn);
2567                }
2568                classie.remove(overlay, 'close');
2569            };
2570            if (support.transitions) {
2571                overlay.addEventListener(transEndEventName, onEndTransitionFn);
2572            } else {
2573                onEndTransitionFn();
2574            }
2575        } else if (!classie.has(overlay, 'close')) {
2576            classie.add(overlay, 'open');
2577			$j('body').addClass('modal-open');
2578        }
2579
2580		return false;
2581    }
2582
2583    triggerBttn.on('click', toggleOverlay);
2584    closeBttn.addEventListener('click', toggleOverlay);
2585	}
2586});
2587
2588
2589// Landing content page
2590
2591jQuery(function($j) {
2592	
2593    "use strict";
2594	function isiPad(){
2595		return (navigator.platform.indexOf("iPad") != -1);
2596	}
2597	
2598	function setChapterHeight() {
2599		var windowH = $j(window).height();
2600		if(isiPad()) {
2601			windowH+=80
2602		}
2603		$j('.chapter').each(function() {
2604			$j(this).css({'min-height': windowH+'px'});
2605		})
2606		$j('.chapter__title').each(function() {
2607			$j(this).css({'min-height': windowH+'px'})
2608		})
2609		$j('.chapter__content').each(function() {
2610			$j(this).css({'min-height': windowH+'px'})
2611		})
2612		$j('.chapter__content .category-big-banner, .chapter__content .category-big-banner__image').each(function() {
2613			$j(this).css({'min-height': windowH+'px'})
2614		})
2615	}
2616	function addChapterEnd() {
2617		$j('.chapter').each(function() {
2618			var row_str = '<div class="chapter__end">chapter END</div>';
2619			$j(this).append(row_str);
2620		})
2621	}
2622	function setChapterWaypoint() {
2623			var waypoints = $j('.chapter').waypoint(function(direction) {
2624				if (direction === 'down') {
2625					$j('.chapter__title').removeClass('title--fixed').removeClass('title--bottom');
2626					$j('.chapter__title').removeClass('title--fixed');				
2627					$j(this.element).find('.chapter__title').addClass('title--fixed');
2628				}
2629			}, {
2630				offset: 0
2631			})
2632			var waypoints = $j('.chapter').waypoint(function(direction) {
2633				if (direction === 'up') {
2634					$j('.chapter__title').removeClass('title--fixed').removeClass('title--bottom');				
2635				}
2636			}, {
2637				offset: 0
2638			})
2639			var waypointsEnd = $j('.chapter__end').waypoint(function(direction) {
2640				if (direction === 'down') {
2641					$j('.chapter__title').removeClass('title--fixed').removeClass('title--bottom');				
2642					$j(this.element).parent().find('.chapter__title').addClass('title--bottom');
2643					var panel;
2644					panel = $j(this.element).parent().attr('id');
2645				}
2646			}, {
2647				offset: $j(window).height()
2648			})
2649			var waypointsEnd = $j('.chapter__end').waypoint(function(direction) {
2650				if (direction === 'up') {
2651					$j('.chapter__title').removeClass('title--fixed').removeClass('title--bottom');				
2652					$j(this.element).parent().find('.chapter__title').addClass('title--bottom');
2653				}
2654			}, {
2655				offset: 0
2656			})
2657			var waypointsEndB = $j('.chapter__end').waypoint(function(direction) {
2658				if (direction === 'up') {
2659					$j('.chapter__title').removeClass('title--fixed').removeClass('title--bottom');				
2660					$j(this.element).parent().find('.chapter__title').addClass('title--fixed');
2661				}
2662			}, {
2663				offset: $j(window).height()
2664			})				
2665
2666	}
2667		
2668	var windowW = window.innerWidth || $j(window).width();
2669	
2670	if ($j('#landingContent').length) {
2671	
2672	if (windowW > 991){
2673			
2674			setChapterHeight();
2675			addChapterEnd();
2676			setChapterWaypoint();
2677			
2678		}
2679		else {
2680			setChapterHeight();
2681		}
2682	}
2683
2684		$j(window).resize(debouncer(function(e) {
2685		var windowW = window.innerWidth || $j(window).width();
2686	
2687	if ($j('#landingContent').length) {
2688		
2689		if (windowW > 991){
2690			
2691			setChapterHeight();
2692			addChapterEnd();
2693			setChapterWaypoint();
2694			
2695		}
2696		else {
2697			setChapterHeight();
2698			Waypoint.disableAll()
2699		}	
2700	
2701	}
2702		
2703	}));
2704
2705});
2706
2707
2708
2709jQuery(function($j) {
2710	
2711    "use strict";
2712	
2713	 $j('.ajax-to-cart').click(function(e){
2714		e.preventDefault();
2715		 $j(this).addClass('btn--wait');
2716		 $j.ajax({url: "ajax.php", success: function(result){
2717			 $j('.ajax-to-cart').removeClass('btn--wait');
2718			 $j('#modalAddToCart').modal("toggle");
2719			}});
2720	});
2721	 $j('.ajax-to-wishlist').click(function(e){
2722		e.preventDefault();
2723		$j('#modalAddToWishlist').modal("toggle");		
2724		$j('#modalAddToWishlist .loading').show();
2725		$j('#modalAddToWishlist .success').hide();		
2726		$j.ajax({url: "ajax.php", success: function(result){
2727			$j('#modalAddToWishlist .loading').hide();
2728			$j('#modalAddToWishlist .success').show();
2729
2730			}});
2731	});
2732});
2733
2734
2735// MD inputs label
2736
2737jQuery(function($j) {
2738	
2739    "use strict";
2740
2741  $j('.input-group--wd > input, .input-group--wd > textarea ').blur(function() {
2742    var $this = $j(this);
2743    if ($this.val())
2744      $this.addClass('used');
2745    else
2746      $this.removeClass('used');
2747  });
2748  
2749 });
2750 
2751// Remove Loader
2752
2753jQuery(function($j) {
2754	
2755	"use strict";
2756	$j('body').addClass('loaded');
2757 
2758});
2759
2760// Gallery Popup
2761
2762jQuery(function($j) {
2763	
2764    "use strict";
2765	if ($j('#gallery').length) {
2766	$j('#gallery a.btn').magnificPopup({
2767		type:'image',
2768		gallery:{
2769			enabled:true
2770		}
2771	});
2772	}
2773	
2774});
2775
2776// Video Popup
2777
2778jQuery(function($j) {
2779	
2780
2781    "use strict";
2782
2783	if ($j('.video-link').length) {
2784		$j('.video-link').magnificPopup({
2785          disableOn: 767,
2786          type: 'iframe',
2787          mainClass: 'mfp-fade',
2788          removalDelay: 160,
2789          preloader: true,
2790          fixedContentPos: false
2791        });
2792	}
2793	
2794});
2795
2796
2797// Set carousel nav position
2798
2799jQuery(function($j) {
2800
2801    "use strict";
2802	
2803	var prevW = window.innerWidth || $j(window).width();
2804
2805	if ($j('body').hasClass('boxed')) {
2806		$j('.aside-column .slick-slider.slick-initialized').each(function() {
2807			if (!$j(this).hasClass('nav-top') && !$j(this).hasClass('nav-dot')) {
2808					$j(this).addClass('nav-inside');
2809			}
2810		})
2811	}
2812	
2813	if ($j('body').hasClass('fullwidth')) {
2814		$j('.slick-slider.slick-initialized').each(function() {
2815			if (!$j(this).hasClass('nav-top') && !$j(this).hasClass('nav-dot')) {
2816					$j(this).addClass('nav-inside');
2817			}
2818		})
2819	}
2820	else {
2821		$j('.slick-slider.slick-initialized').each(function() {
2822			if (!$j(this).closest('.single-slider').length) {
2823				
2824				if ($j('body').hasClass('boxed') && !$j(this).hasClass('blog-carousel')) {
2825					var outerW = prevW;
2826				}
2827				else var outerW = $j(this).closest('section').width();
2828				
2829				if ((outerW - $j(this).width()) * 0.5 < 45) {
2830					$j(this).addClass('nav-inside');
2831					$j('.slick-initialized').slick('setPosition');
2832				}
2833				
2834			}
2835		});
2836	}
2837
2838    $j(window).resize(debouncer(function(e) {
2839        var currentW = window.innerWidth || $j(window).width();
2840        if (currentW != prevW) {
2841            // start resize events		
2842		
2843		$j('.slick-slider.slick-initialized').each(function() {
2844			if (!$j(this).closest('.single-slider').length) {
2845				
2846				if ($j('body').hasClass('boxed') && !$j(this).hasClass('blog-carousel')) {
2847					var outerW = currentW;
2848				}
2849				else var outerW = $j(this).closest('section').width();
2850				
2851				if ((outerW - $j(this).width()) * 0.5 < 45) {
2852					$j(this).addClass('nav-inside');
2853					$j('.slick-initialized').slick('setPosition');
2854				}
2855				else {
2856					$j(this).removeClass('nav-inside');
2857				}
2858				
2859			}
2860		});
2861			
2862            // end resize events		
2863        }
2864        prevW = window.innerWidth || $j(window).width();
2865
2866    }));
2867
2868});
2869
2870// double click fo touch devices
2871
2872jQuery(function($j) {
2873
2874    "use strict";
2875	
2876	var windowW = window.innerWidth || $j(window).width();
2877	
2878	$j('.touch category-block__list a').doubleTapToGo();
2879	if (windowW > 767) {
2880		$j('.touch ul.navbar-nav > li').each(function() {
2881			if ($j(this).find('a').hasClass('dropdown-toggle')) {
2882				$j(this).doubleTapToGo()
2883			}
2884		})
2885	}
2886    $j('.touch .product-preview').doubleTapToGo();
2887	
2888});
2889
2890// Add active class to opened accordion panel
2891
2892jQuery(function($j) {
2893	
2894    "use strict";
2895	
2896	$j('.panel-group')
2897	  .on('show.bs.collapse', function(e) {
2898		$j(e.target).prev('.panel-heading').addClass('active');
2899	  })
2900	  .on('hide.bs.collapse', function(e) {
2901		$j(e.target).prev('.panel-heading').removeClass('active');
2902	});
2903
2904});
2905
2906// Contact page form
2907
2908jQuery(function($) {
2909    $j('#contactform').validate({
2910        rules: {
2911			name: {
2912                required: true,
2913                minlength: 2
2914            },
2915			message: {
2916                required: true,
2917                minlength: 20
2918            },
2919            email: {
2920                required: true,
2921                email: true
2922            }
2923
2924        },
2925        messages: {
2926            name: {
2927                required: "Please enter your name",
2928                minlength: "Your name must consist of at least 2 characters"
2929            },
2930            message: {
2931                required: "Please enter message",
2932                minlength: "Your message must consist of at least 20 characters"
2933            },
2934			email: {
2935                required: "Please enter your email"
2936            }
2937        },
2938        submitHandler: function(form) {
2939            $j(form).ajaxSubmit({
2940                type:"POST",
2941                data: $j(form).serialize(),
2942                url:"process-contact.php",
2943                success: function() {
2944                      $j('#success').fadeIn();
2945					  $j('#contactform' ).each(function(){this.reset();});
2946                },
2947                error: function() {
2948						$j('#contactform').fadeTo( "slow", 0, function() {
2949						$j('#error').fadeIn();
2950                    });
2951                }
2952            });
2953        }
2954    });
2955});
2956// Newsletter subscribe form
2957
2958jQuery(function($j) {
2959	
2960    "use strict";
2961	
2962	if($j('#subscribe-form').length){
2963		$j('#subscribe-form').validate({
2964			rules: {
2965				subscribemail: {
2966					required: true,
2967					email: true
2968				}
2969	
2970			},
2971			messages: {
2972				subscribemail: {
2973					required: "Please enter your email"
2974				}
2975			},
2976			submitHandler: function(form) {
2977				$j(form).ajaxSubmit({
2978					type:"POST",
2979					data: $j(form).serialize(),
2980					url:"process-subscribe.php",
2981					success: function() {
2982						  $j('#subscribeSuccess').fadeIn();
2983						  $j('#subscribe-form').each(function(){this.reset();});
2984					},
2985					error: function() {
2986						$j('#subscribe-form').fadeTo( "slow", 0, function() {
2987							$j('#subscribeError').fadeIn();
2988						});
2989					}
2990				});
2991			}
2992		});
2993	}
2994});

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.