function resizeUlSelect(){var n=window.outerWidth;n>768&&$("#filters .ul-select").each(function(){var n=$(this).outerWidth(),t=$(this).children("ul").css("width",n)})}function positionCategoryHeader(){$(window).width()<767?$(".cat-header").insertBefore("#filters"):$(".cat-header").insertAfter("#filters .clearfix")}function settingTrianglePosition(n,t,i){n.length!=0&&t.lenght!=0&&($menuitem=n.find("img"),$leftmov=$menuitem.position().left+i,t.css("left",$leftmov))}function reloadScrollBars(){document.documentElement.style.overflow="auto";document.body.scroll="yes";$("html, body").css("height","").css("overflow","auto")}function unloadScrollBars(){document.documentElement.style.overflow="hidden";document.body.scroll="no";$("html, body").css("height","100vh").css("overflow","hidden")}function resizeMenuContainer(){var t=$(window).height(),i=$(".mobile-navbar-cont").height(),n=t-i-15;$("nav #menu-mobile-container").height(n);n=n-20;$("#mincart-mobile").height(n);$("#miniwish-mobile").height(n);$("#login-miniform-mobile").height(n)}function toogleOverflowPage(n){var t=document.documentElement.style.overflow,i=document.body.scroll;t=="hidden"||i=="no"||n=="yes"?reloadScrollBars():n=="no"?unloadScrollBars():unloadScrollBars()}function setOverflowPageByTrigger(n){setTimeout(function(){var t=n.css("display");t=="block"?toogleOverflowPage("no"):t=="none"?toogleOverflowPage("yes"):toogleOverflowPage("yes")},500)}function settingMenuPosition(n){$idmenu=n.index();$leftmov=n.position().left;$idmenu<4?n.children("div").children("div").css("padding-left",$leftmov).css("left",0):($rightposition=$(document).width()-n.offset().left-$("li.subTrigger").width()-20,n.children("div").children("div").css("padding-right",$rightposition).css("text-align","right"),n.children("div").children("div").children(".listMenu").children(".subSubNav1").addClass("subSubNavRight"))}function subscribeNewsletterValidation(n){var t=n.data("formValidation");return t.validate(),t.isValid()}function GTMProductNext(){dataLayer.push({event:"navigationNext",EventCategory:"Navigation",EventAction:"Next",Eventlabel:""})}function GTMProductPrev(){dataLayer.push({event:"navigationPrev",EventCategory:"Navigation",EventAction:"Prev",Eventlabel:""})}function GTMProductDetailAddToCart(n){setTimeout(function(){var t=angular.element("#"+n).scope();t!=null?t.prdVm.selectedVariantId!=0?dataLayer.push({event:"addToCart",ecommerce:{currencyCode:"EUR",add:{products:[{name:t.prdVm.productDetail.Name,id:t.prdVm.productDetail.Code,price:t.prdVm.productDetail.CurrentVariant.CP,brand:"TwinSet",category:t.prdVm.productDetail.CategoryInfo.CultureNeutralName,variant:$.grep(t.prdVm.productDetail.CurrentVariant.Attribs,function(n){return n.AttribCode.indexOf("COL")!==-1})[0].CultureNeutralValue,quantity:1}]}}}):GTMProductDetailAddToCart(n):GTMProductDetailAddToCart(n)},500)}jQuery(function(n){var i=function(){var t=this;t.scroll=function(t){n("html, body").animate({scrollTop:t.offset().top},300)};t.to=function(n){t.scroll(n)}},t;n.fn.passwordVisibility=function(t){var i=this,r=n.extend({previousItem:n(this).prev(),previousItemType:n(this).prev().attr("type")},t);return i.isInput=function(){console.log(i.settings.previousItemType)},i.show=function(){element.find("show").hide();element.find("hide").show()},i.hide=function(){element.find("hide").hide();element.find("show").show()},function(){n(i).on("click",function(n){n.preventDefault();i.isInput()})}};t=new i;n(".profileAddressAdd").on("click",function(){n("html, body").animate({scrollTop:n("#profileAddressForm-0").offset().top},300);n(".profileShippingAddressBook, .profileBillingAddressBook").hide()});n(document).on("click","#profileAddressCancel",function(){t.to(n("#profileAddressForm-0"));n(".profileShippingAddressBook, .profileBillingAddressBook").show()});n(".show-password").passwordVisibility()});$("#back-to-top").click(function(n){return n.preventDefault(),$("html, body").animate({scrollTop:0},800),!1});$(document).ready(function(){"use strict";jQuery(function(n){n(document).on("click",".header-summary",function(){var t=n(this).parents(".as-accordion")})})});$(document).on("click",".ul-select",function(){var r=$(".ul-select").not(this),n,t,i;r.each(function(){var t=$(this).find("ul"),n;t.slideUp();t.removeClass("ul-opened");n=$(this).find("p i");n.hasClass("fa-rotate-180")&&n.removeClass("fa-rotate-180")});n=$(this).find("ul");t=$(this).find("i.fa-angle-down");n.slideToggle(180).toggleClass("ul-opened");i=n.is(".ul-opened");i===!0?t.addClass("fa-rotate-180"):t.removeClass("fa-rotate-180")});$(document).on("click",".ul-select-color",function(){});$(document).on("click",".ul-select-taglia",function(){});$(window).on("load",function(){resizeUlSelect()});$(window).on("resize",function(){resizeUlSelect()});$(window).on("load",function(){positionCategoryHeader()});$(window).on("resize",function(){positionCategoryHeader()});$(document).ready(function(){$(document).on("click","#newsletterHomeSubmitMobile",function(){return $("#emailNewsletterPopUp")[0].value=$("#emailAddressHomeMobile")[0].value,!0});$(document).on("click","#newsletterHomeSubmit",function(){return $("#emailNewsletterPopUp")[0].value=$("#emailAddressHome")[0].value,!0});$("#currentLangMobile").on("click",function(){$("#containerLangMobile").slideToggle();$("html, body").animate({scrollTop:$("#containerLangMobile").offset().top},300)})});$(window).on("load",function(){$("#login-miniform input").hover(function(n){n.stopPropagation()},function(n){n.stopPropagation()});$(".view-box").hover(function(n){var t=$(this).children(".dialog-box"),i=$(this).children(".triangle-dialog-box");i.stop().fadeIn(200);t.stop().fadeIn(200);n.stopPropagation()},function(n){var t=$(this).children(".triangle-dialog-box");$(this).children(".dialog-box").stop().delay(500).fadeOut(200);t.stop().delay(500).fadeOut(200);n.stopPropagation()});$(".view-box-child").click(function(n){var t=$(this).siblings(".dialog-box"),i=$(this).siblings(".triangle-dialog-box");i.stop().fadeToggle(200);t.stop().fadeToggle(200);n.stopPropagation()});$(".view-box").on("touchstart",function(n){n.stopPropagation()})});$(window).on("load",function(){resizeMenuContainer();$(".minicart-mobile").click(function(n){var t,i,r;n.preventDefault();t=$("#mincart-mobile");i=$(".triangle-nav-mobile-minicart");settingTrianglePosition($(".minicart-mobile"),$(".triangle-nav-mobile-minicart"),-2);$("#login-miniform-mobile, #menu-mobile-container, .finder-mobile, #miniwish-mobile").hide();$(".triangle-nav-mobile-login, .triangle-nav-mobile-wishlist").hide();t.toggleClass("mob-opened");r=t.hasClass("mob-opened");r===!0?(t.fadeIn(),i.fadeIn()):(i.fadeOut(),t.fadeOut());setOverflowPageByTrigger($("#mincart-mobile"))});$(".WishListMobile").click(function(){$("#mincart-mobile, .triangle-nav-mobile-minicart").hide();$("#login-miniform-mobile, .triangle-nav-mobile-login").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened")});$(".trigger-finder").click(function(){var n=$(".finder-mobile");$("#login-miniform-mobile, #menu-mobile-container, #miniwish-mobile, #mincart-mobile").hide();$(".triangle-nav-mobile-login, .triangle-nav-mobile-wishlist, .triangle-nav-mobile-minicart").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened");n.slideToggle();toogleOverflowPage("yes")});$("#trigger-menu").click(function(n){n.preventDefault();var t=$("#menu-mobile-container");$("#login-miniform-mobile, #mincart-mobile, #miniwish-mobile, .finder-mobile").hide();$(".triangle-nav-mobile-login, .triangle-nav-mobile-wishlist, .triangle-nav-mobile-minicart").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened");t.fadeToggle();setOverflowPageByTrigger(t)});$(".trigger-user").click(function(){var n=$("#login-miniform-mobile"),t=$(".triangle-nav-mobile-login");settingTrianglePosition($(".trigger-user"),$(".triangle-nav-mobile-login"),-2);$("#menu-mobile-container, #mincart-mobile, #miniwish-mobile, .finder-mobile").hide();$(".triangle-nav-mobile-wishlist, .triangle-nav-mobile-minicart").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened");n.fadeToggle();t.fadeToggle();setOverflowPageByTrigger(n)});$(".trigger-user-logged").click(function(){$("#menu-mobile-container, #mincart-mobile, #miniwish-mobile, .finder-mobile, #login-miniform-mobile").hide();$(".triangle-nav-mobile-wishlist, .triangle-nav-mobile-minicart").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened")});$(".trigger-miniwish-mobile").click(function(){var n=$("#miniwish-mobile"),t=$(".triangle-nav-mobile-wishlist");settingTrianglePosition($(".trigger-miniwish-mobile"),$(".triangle-nav-mobile-wishlist"),-2);$("#menu-mobile-container, #login-miniform-mobile, #mincart-mobile, .finder-mobile").hide();$(".triangle-nav-mobile-login, .triangle-nav-mobile-minicart").hide();$(".triangle-nav-mobile-minicart").removeClass("mob-opened");n.fadeToggle();t.fadeToggle();setOverflowPageByTrigger(n)});$("#finder-input").keypress(function(n){if(n.which==13){n.preventDefault();var t=$("#finder-input").val();t.length>0&&goToSearch(t)}});$(".f-level, .s-level").click(function(){var n=$(this).find("i");n.hasClass("fa-rotate-180")?n.removeClass("fa-rotate-180"):n.addClass("fa-rotate-180")})});$(window).on("resize",function(){settingTrianglePosition($(".trigger-user"),$(".triangle-nav-mobile-login"),-4);settingTrianglePosition($(".trigger-miniwish-mobile"),$(".triangle-nav-mobile-wishlist"),-2);resizeMenuContainer();var n=window.outerWidth;n>768?($("#login-miniform-mobile, #menu-mobile-container, #mincart-mobile, #miniwish-mobile, .finder-mobile").hide(),$(".triangle-nav-mobile-login, .triangle-nav-mobile-wishlist, .triangle-nav-mobile-minicart").hide(),$(".triangle-nav-mobile-minicart").removeClass("mob-opened"),toogleOverflowPage("yes")):resizeMenuContainer()});jQuery(window).scroll(function(){var n=$(window).width();n<768&&(jQuery(this).scrollTop()>0?jQuery("nav.fixed-menu-mobile").addClass("border-bottom"):jQuery("nav.fixed-menu-mobile").removeClass("border-bottom"))});$(window).on("load",function(){setTimeout(function(){$(".navbar-nav > li > a").mouseenter(function(){settingMenuPosition($(this).parent());$(this).parent().children("div").slideDown(250)});$(".navbar-nav > li").mouseleave(function(){$(this).children("div").fadeOut(200)});$(document).on("touchstart",function(n){$(n.target).closest(".navbar-nav > li").length||$(".navbar-nav > li").each(function(){$(this).children("div").fadeOut(200)})});$(".sbn-trigger").on("mouseover",function(){$idcat=$(this).data("idcat");$(".subNav-content").each(function(){$this=$(this);$idcat2=$this.data("idcat");$idcat!=$idcat2?$this.hide():$this.show()})})},1e3)});$(window).on("resize",function(){$(".navbar-nav>li").each(function(){settingMenuPosition($(this))})});jQuery(function(n){"use strict";var t=".mobile-content-handler",i=n(t),r=i.find(".mobile-nav-items"),u=r.find(".mobile-nav-item"),f=i.find(".block-content");u.click(function(i){i.preventDefault();var r=n(this),u=r.data(),f=n("#"+u.content);f.fadeIn();r.closest(t).toggleClass("show-nav")});n("#mobile-nav-content-back").click(function(i){i.preventDefault();n(this).closest(t).toggleClass("show-nav");f.delay(350).hide()})});$(document).ready(function(){function n(){var n=$("input[name='umbracoNlMail']").val();$("#popUpNewsletter").modal("show");$("#popUpNewsletter form input[name='Email']").val(n)}$(document).on("click","#umbracoNlRegistration",n);$("#popUpNewsletter").on("hide.bs.modal",function(){$("#Newsletter")[0].reset();$("#Newsletter").data("formValidation").resetForm()})});submitNewsletterFormCmsPage=function(n){var t,r,i;return($(".birthDateError").html(""),$(".genericError").html(""),$(".newsletterError").html(""),t=this.form,t==null&&(t=n.currentTarget),!subscribeNewsletterValidation($(t)))?!1:(n!=null&&n.preventDefault(),r=$(t),i="https://"+location.hostname,knAppConfig.SSLPort!=null&&(i+=":"+knAppConfig.SSLPort),i+="/Account/SubscribeNewsletterCmsPage",$.ajax({url:i,method:"POST",xhrFields:{withCredentials:!0},async:!0,data:r.serialize(),complete:function(){},success:function(n){if(n.success)$("#popUpNewsletter").modal("hide"),$("#popUpThankYouNewsletter").modal("show"),n.gtmData!=null&&dataLayer.push(n.gtmData);else switch(n.errorField){case"birthDate":$(".birthDateError").html(n.errorMessage);break;case"generic":$(".genericError").html(n.errorMessage);break;case"newsletter":$(".newsletterError").html(n.errorMessage)}},error:function(){}}),!1)};submitNewsletterForm=function(n){var t,r,i;return($(".birthDateError").html(""),$(".genericError").html(""),$(".newsletterError").html(""),t=this.form,t==null&&(t=n.currentTarget),!subscribeNewsletterValidation($(t)))?!1:(n!=null&&n.preventDefault(),r=$(t),i="https://"+location.hostname,knAppConfig.SSLPort!=null&&(i+=":"+knAppConfig.SSLPort),i+="/Account/SubscribeNewsletter",$.ajax({url:i,method:"POST",xhrFields:{withCredentials:!0},async:!0,data:r.serialize(),complete:function(){},success:function(n){if(n.success)$("#popUpNewsletter").modal("hide"),$("#popUpThankYouNewsletter").modal("show"),n.gtmData!=null&&dataLayer.push(n.gtmData);else switch(n.errorField){case"birthDate":$(".birthDateError").html(n.errorMessage);break;case"generic":$(".genericError").html(n.errorMessage);break;case"newsletter":$(".newsletterError").html(n.errorMessage)}},error:function(){}}),!1)};$(document).on("click","#nextProd",function(){GTMProductNext()});$(document).on("click","#nextProdMobile",function(){GTMProductNext()});$(document).on("click","#prevProd",function(){GTMProductPrev()});$(document).on("click","#prevProdMobile",function(){GTMProductPrev()});$(document).ready(function(){$(document).on("click","#addVariantCart",function(){GTMProductDetailAddToCart("productDetailController");jQuery("html, body").animate({scrollTop:0},"600","swing");$("#mincart-form").addClass("user-open");setTimeout(function(){$("#mincart-form").removeClass("user-open")},3e3)})}),function(n){n(function(){var t=n(".custom-tooltip","a,span"),r=t.attr("data-tootltip-message"),i="custom-tooltip-message",u=t.find("."+i);t.on("mouseenter",function(){n(this).prepend('<span class="'+i+'">'+r+"<\/span>").fadeIn("fast")});t.on("mouseleave",function(){n(this).find("."+i).fadeOut("fast",function(){n(this).remove()})})})}(window.jQuery,window,document);$(document).ready(function(){$(document).on("click","#addWishList",function(){$("#minwish-form").addClass("user-open");jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").removeClass("user-open")},3e3)});$(document).on("click","#addWishListCartItem",function(){$("#minwish-form").addClass("user-open");jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").removeClass("user-open")},3e3)});$(document).on("click","#addWishListCartItemMobile",function(){$("#minwish-form").addClass("user-open");jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").removeClass("user-open")},3e3)});$(document).on("click","#cmsAddToWishListEnable",function(){$("#minwishminwish-form").addClass("user-open");jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").removeClass("user-open")},3e3)});$(document).on("click","#cmsAddToWishListEnableMobile",function(){$("#mincart-mobile").addClass("user-open");jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").removeClass("user-open")},3e3)});$(document).on("click","#addWishListMobile",function(){$("#miniwish-mobile").slideDown();jQuery("html, body").animate({scrollTop:0},"600","swing");setTimeout(function(){$("#minwish-form").slideUp()},3e3)});$(document).on("click","#addToWishListRemove",function(){$("#addWishListOk").show()});$(document).on("click","#addToWishListModal",function(){$("#addWishListOkModal").show()});$(document).on("click","#addToWishListMobile",function(){$("#addWishListOkMobile").show()});$(document).on("click",".removeModal",function(){$("#addWishListOk").hide();$("#removeProductModal").modal("show")});$(document).on("click","#cartProductDetailPopUp",function(){$("#addWishListOkModal").hide();$(window).width()>767?setTimeout(function(){$("#cartProductDetail").modal("show");$("#cmsAddToCart").hide();$("#cmsAddToCartEnable").show()},300):$("#cartProductDetailMobile").modal("show")})});$(document).ready(function(){$(document).on("click",".gallery-close",function(){$("#myModalGallery").modal("hide")});$(document).on("click",".ZoomGalleryImg",function(){function n(){var t,i,n=new Image;n.src=$(".img-gallery-content").css("background-image").replace("url(","").replace(")","").replace('"',"").replace('"',"");$(n).on("load",function(){t=n.width;i=n.height;var r=$(window).height();$(".img-gallery-content").css("height",r+"px");$(".img-gallery-content").css("background-position","50% 0%")})}if(!isBrowserMobile()){var t=$(this).attr("big-link"),i=$(this).attr("thumb-link");$(".img-gallery-content").css("background-image","url('"+t+"')");$("#myModalGallery").modal("show");$(".selettore-thumb ul").html("");$("#ZoomGallery").find("img").each(function(){var t=$(this).attr("big-link"),n=$(this).attr("thumb-link");n==i?$(".selettore-thumb ul").append('<li><img class="selected" src="'+n+'" big-link="'+t+'"/>'):$(".selettore-thumb ul").append('<li><img src="'+n+'" big-link="'+t+'"/>')});n();$(document).on("mousemove",".img-gallery-content",function(n){var f="( "+n.pageX+", "+n.pageY+" )",e="( "+n.clientX+", "+n.clientY+" )",t=$(".img-gallery-content").height(),i=n.clientY/t*100,r=$(".img-gallery-content").width(),u=n.clientX/r*100;$(this).css("background-position",+u+"0%"+i+"%")});$(".selettore-thumb").find("img").click(function(){$(".selettore-thumb").find("img").each(function(){$(this).hasClass("selected")&&$(this).removeClass("selected")});$(this).addClass("selected");var t=$(this).attr("big-link");$(".img-gallery-content").css("background-image","url('"+t+"')");n()})}})})