$(document).ready(function(){function i(){let t=[...document.querySelectorAll(".lazy-load")];t.forEach(t=>n(t))}function n(n){n.src.includes("svg+xml")&&(n.src=n.dataset.src)}$("main").on("click tap",".thumb-swap",function(){var n=$(this);$(n.data("target")).attr("src",n.data("image"));n.siblings().removeClass("active");n.addClass("active")});$("main").on("mouseenter",".img-container",function(){var n,t;screen.availWidth>991&&(n=$(this),n.data("hasback")!=undefined&&(t=n.find(".product-image"),n.data("originalimgsrc",t.attr("src")),t.attr("src",n.data("backimgsrc"))))});$("main").on("mouseleave",".img-container",function(){if(screen.availWidth>991){var n=$(this);n.data("hasback")!=undefined&&n.find(".product-image").attr("src",n.data("originalimgsrc"))}});$("body").on("click",".quickview",function(n){n.preventDefault();var i=$(this).data("productid"),r=$(this).data("detailurl"),t=$("#quickview .modal-content");t.html('
Loading product data');$("#quickview").modal("show");$.get("/products/get-product-quickview/"+i,function(n){n.IsError?$("#quickview").modal("hide"):(t.html(n.Data),t.find(".quickview-detail-url").attr("href",r))})});$("body").on("click",".grid-wishlist",function(){var n=$(this),t=n.data("id");$.post("/cart/toggle-wishlist-item",{productId:n.data("id"),productName:n.data("name")},function(t){t.Data.InList===!0?n.addClass("in-wishlist"):n.removeClass("in-wishlist");t.Data.ShowWishlistPopup?($("#first-wishlist-item-title").html(t.Message),$("#first-wishlist-item-scanId").html(t.Data.ScanId),$("#first-wishlist-item-modal").modal("show")):$.sticky(t.Message,{classList:"success",autoclose:2e3});$("#wishlist-count-big").html(t.Data.WishlistCount);$("#wishlist-count-small").html(t.Data.WishlistCount)})});let t=200;window.lazyLoadImages=function(){let i=[...document.querySelectorAll(".lazy-load")];i.forEach(i=>{i.offsetTop