'); document.write(''); if (appimageswitcher == 1 && productimageswitcher == 1) { /*************** Prestige Theme ************/ var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); var flag = ''; var flkty; if ($('.Product__Slideshow .previous').length == 1) { } else { flag = 1; } setTimeout(function () { window.scrollTo(0, 0); jQuery(window).on("orientationchange", function (event) { if (is_iPad || getiPadModel()) { location.reload(); } }); jQuery(document).on("click", ".single-option-selector", function (e) { cleverMapper(); }); jQuery(document).on("click", ".Popover__Value", function (e) { cleverMapper(); }); // previous $('.Product__SlideshowMobileNav .Product__SlideshowNavArrow--previous').on('click', function () { flkty.previous(); }); // next $('.Product__Gallery .Product__SlideshowMobileNav .Product__SlideshowNavArrow--next').click(function () { flkty.next(); }); if (isMobile || is_iPad) { jQuery(document).on("click", ".Product__SlideshowNavImage", function (e) { var index = 0; if (jQuery('.Product__Slideshow') == undefined) { return false; } var jQuerycarousel = jQuery('.Product__Slideshow').flickity(); jQuerycarousel.flickity('select', index); jQuery('.flickity-page-dots').find('.is-selected').removeClass('is-selected'); jQuery(this).addClass('is-selected'); }); } else { jQuery(document).on("click", ".Product__SlideshowNavImage", function (e) { var index = jQuery(this).index(); //if(jQuery('.Product__Slideshow') == undefined){ if (jQuery('.Product__Slideshow').find('.flickity-slider').length == 0) { return false; } var jQuerycarousel = jQuery('.Product__Slideshow').flickity(); jQuerycarousel.flickity('select', index); jQuery('.Product__SlideshowNavScroller').find('.is-selected').removeClass('is-selected'); jQuery(this).addClass('is-selected'); }); } jQuery(window).scroll(function () { var imagesize = jQuery('.Product__SlideItem').height(); var scrollDistance = jQuery(window).scrollTop(); var bottom = jQuery('.Product__Gallery').position().top + jQuery('.Product__Gallery').outerHeight(true); var diff = bottom - scrollDistance; jQuery('.Product__Slideshow .Product__SlideItem').each(function (i) { var currLink = jQuery(this); if ((currLink.position().top) <= scrollDistance) { jQuery(".Product__SlideshowNavScroller").find('.is-selected').removeClass('is-selected'); jQuery(".Product__SlideshowNavDot").find('.is-selected').removeClass('is-selected'); if (jQuery('.Product__SlideshowNavImage').length == 0) { jQuery(".Product__SlideshowNavDot:eq(" + i + ")").addClass('is-selected'); } else if ($('.Product__Slideshow').hasClass('flickity-enabled')) { //************ when scroller is thumbnail var $carousel = $('.Product__Slideshow').flickity(); var flkty = $carousel.data('flickity'); var j = flkty.selectedIndex; jQuery(".Product__SlideshowNavImage:eq(" + j + ")").addClass('is-selected'); } else { //************ when scroller is thumbnail jQuery(".Product__SlideshowNavImage:eq(" + i + ")").addClass('is-selected'); } if ($('.Product__SlideshowNav--dots a').children().length == 0) { jQuery(".Product__SlideshowNavDot:eq(" + i + ")").addClass('is-selected'); } } }); }); if (jQuery('.Product__Slideshow').find('.flickity-slider').length == 0) { var slideimages = jQuery('.Product__Slideshow').children().clone(); } var flickimages = jQuery('.Product__Slideshow').children().clone(); if (jQuery('.Product__Slideshow').find('.flickity-slider').length == 0) { // ******* when there is dots for stack desktop view // console.log('test1'); var sliderdots = jQuery('.Product__SlideshowNavScroller a').clone(); } else if ((jQuery('.Product__SlideshowNavScroller span').length != 0) || (jQuery('.Product__SlideshowNav--thumbnails').length == 0) || (jQuery('.Product__Slideshow').find('.flickity-slider').length != 0)) { // console.log('test2'); var sliderdots = jQuery('.Product__SlideshowNavScroller span').clone(); var flickimages = jQuery('.flickity-slider').html(); } else { // console.log('test3'); var sliderdots = jQuery('.Product__SlideshowNavScroller a').clone(); } // *************** when there is thumbnail in place of dots for stack desktop view if (jQuery('.Product__SlideshowNavImage').length != 0) { // console.log('test4'); var sliderdots = jQuery('.Product__SlideshowNavScroller .Product__SlideshowNavImage').clone(); } if (getiPadModel()) { if ($('.Product__SlideshowNav--dots a').children().length == 0) { var sliderdots = jQuery('.Product__SlideshowNavScroller').children().clone(); } } var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); var is_iPad = navigator.userAgent.match(/iPad/i) != null; if ((is_iPad) && jQuery('.Product__Slideshow').find('.flickity-slider').length != 0) { var slideimages = jQuery('.flickity-slider').html(); } var gallery = ''; jQuery(document).on("click", ".pswp__button--next", function (e) { gallery.next(); selectedindex = gallery.getCurrentIndex(); //totalslides = gallery.options.getNumItemsFn(); totalslides = $('.Product__Slideshow .Product__SlideItem').length; if (selectedindex == 0) { $('.pswp__button--prev').hide(); } else { $('.pswp__button--prev').show(); } if (selectedindex == (totalslides - 1)) { $('.pswp__button--next').hide(); } else { $('.pswp__button--next').show(); } }); jQuery(document).on("click", ".pswp__button--prev", function (e) { //console.log('clicked'); gallery.prev(); selectedindex = gallery.getCurrentIndex(); //totalslides = gallery.options.getNumItemsFn(); totalslides = $('.Product__Slideshow .Product__SlideItem').length; if (selectedindex == 0) { $('.pswp__button--prev').hide(); } else { $('.pswp__button--prev').show(); } if (selectedindex == (totalslides - 1)) { $('.pswp__button--next').hide(); } else { $('.pswp__button--next').show(); } }); jQuery(document).on("click", '.Product__SlideItem, [data-action="open-product-zoom"]:eq(0)', function (event) { if ($(this).find('video').length > 0 || $(this).find('.ModelWrapper').length > 0) { return false; } event.preventDefault(); jQuery('.pswp').remove(); var slideitem = $(this); jQuery('