function DeviceDetectionBase(){var n=navigator.userAgent.match(/iPhone|Android|BlackBerry|Windows Phone|webOS/i);tablet=!1;mobile=!1;windowwidth<=1024&&(tablet=!0,mobile=!1,windowwidth<=812&&(windowwidth/windowheight<1&&(windowwidth<=480?(mobile=!0,tablet=!1):(tablet=!0,mobile=!1)),windowwidth/windowheight>1&&(windowheight<=480?(mobile=!0,tablet=!1):(tablet=!0,mobile=!1))));n!=null&&tablet==!0}function HeightCentring(n){var i=$(n).height(),r=$(n).css("padding-top"),t=0,o=$(".logo-base").height(),u=parseInt($(".top-menu").height())+parseInt($(".top-menu").css("padding-top").replace("px",""))+parseInt($(".top-menu").css("padding-bottom").replace("px","")),f=$(n).parents(".margin-top-extralarge").css("margin-top"),e;$.browser.chrome&&(t=$(n).css("border-width"));$(".logo-base").length===0?(e=(innerHeight-(i+parseInt(r)*2+parseInt(t)*2+u+parseInt(f)))/2+"px",$(n).css("margin-top",e)):$(n).css("margin-top",(innerHeight-(i+parseInt(r)*2+parseInt(t)*2+u+parseInt(f))-(o+20))/2+"px")}function SettingThumb(){try{var n=0;n=$(".thumb-opera").parent().hasClass("record-opera")?$(".thumb-opera").width()/3*2:$(".thumb-opera").width();mobile?$(".thumb-opera").parent().hasClass("record-opera")&&($(".thumb-opera:not(.image-list)").height(n),$(".thumb-opera:not(.image-list)").children("a").height(n)):($(".thumb-opera:not(.image-list)").height(n),$(".thumb-opera:not(.image-list)").children("a").height(n),$(".image-list").each(function(){var n=$(this).children("img").width(),t=$(this).children("img").height(),i="100%";$(this).height($(".thumb-opera").width());n/t>=1&&$(this).children("img").height(i).width("auto");n/t<1&&$(this).children("img").width(i).height("auto")}))}catch(t){}}function SettingCarouselHome(){try{mobile?$(".main-banner").height(innerWidth):tablet?$(".main-banner").height(innerHeight/100*65):$(".main-banner").height(innerHeight/100*55)}catch(n){}}function SetList(){var n=innerHeight/3,t,i;mobile||tablet?(n=innerHeight/5*3,$(".image-block").each(function(){var t=$(this).children("a").children("img").width()/$(this).children("a").children("img").height();t<1&&n*t<=$(this).parent().width()&&($(this).children("a").height(n),$(this).children("a").children("img").height(n).addClass("width-auto"))})):($(".image-block a").height(n),$(".image-block img").height(n));t=0;i=0;$(".awk-list").each(function(){if(t++,$(this).hasClass("more-awk"))$(this).width($(this).children().children().height());else{var n=$(this).children().children("h3").width()+$(this).children().children("h5").width()+20,i=$(this).children(".actions-wrapper").children(".btn").width()+$(this).children(".actions-wrapper").children(".wish-btn").width()+30;mobile||($(this).hasClass("width-fixed")?($(this).width($(this).parent().width()/3-$(this).parent().width()/50),t%3==0&&$(this).addClass("no-margin-right")):(n>$(this).children(".cover-opera").children("a").width()?$(this).width(n):$(this).width($(this).children(".cover-opera").children("a").width()),i>n&&i>$(this).children(".cover-opera").children("a").width()&&$(this).width(i)))}})}function SetCover(){var n=innerHeight/4;mobile||tablet?(n=innerHeight/2,$(".awk-view-cover").each(function(){$(this).children(".cover-opera").children("a").children("img").width()/$(this).children(".cover-opera").children("a").children("img").height()<1&&($(this).children(".cover-opera").children("a").height(n),$(this).children(".cover-opera").children("a").children("img").height(n).addClass("width-auto"))})):($(".awk-view-cover .cover-opera a").height(n),$(".awk-view-cover .cover-opera img").height(n))}function CartSideSetting(){var n=$(".cart-summary-wrapper").css("right");$(".cart-link-container").click(function(){$(".cart-summary-wrapper").toggleClass("display-none");$(".cart-summary-wrapper").hasClass("display-none")?$(this).removeClass("selected"):($(this).addClass("selected"),AwkImgHeight());$(".cart-summary-wrapper").height()>=innerHeight-$(".top-menu").height()-parseInt($(".top-menu").css("padding-top"))*2-parseInt($(".top-menu").css("margin-bottom"))&&($(".cart-summary-wrapper").addClass("content"),mobile||tablet?innerWidth>991?$(".cart-summary-wrapper").height(innerHeight/6*5-$(".top-menu").height()-parseInt($(".top-menu").css("padding-top"))*2-parseInt($(".top-menu").css("margin-bottom"))):$(".cart-summary-wrapper").height(innerHeight):$(".cart-summary-wrapper").height(innerHeight/5*4-$(".top-menu").height()-parseInt($(".top-menu").css("padding-top"))*2-parseInt($(".top-menu").css("margin-bottom"))),CustomScroller())})}function CustomScroller(){!mobile&&(!tablet||innerWidth>=1024)&&$(".content").mCustomScrollbar({mouseWheel:!0,theme:"light"});(mobile||tablet||innerWidth<1024)&&$(".content-mob").height(innerHeight)}function AwkImgHeight(){$(".awk-summary .thumb").each(function(){$(this).height($(this).width())})}function paddingsibling(n){var r=0,t=12,i=0;try{t=$(".reminder-conferma").height()+12;i=$(".reminder-conferma").length}catch(u){}(mobile||tablet)&&(r=10);i>0?($(".top-menu").css("top",t),$(".top-menu").css("margin-bottom",t),$("#carouselHome").length>0||mobile&&$(".awk-view-cover .gallery").css("padding-top",n+parseInt($(".top-menu").css("padding-top"))*2+2+t)):$("#carouselHome").length>0||mobile&&$(".awk-view-cover .gallery").css("padding-top",n+parseInt($(".top-menu").css("padding-top"))*2+2)}function positionRC(){try{if(!mobile){var n=$(".main-footer").children("footer").height();n>0&&$(".grecaptcha-badge").css("bottom",n+20+24+24+"px")}}catch(t){}}function footerBottom(){var n=$(".main-footer").height();!mobile&&$(".body-content").height()+n<innerHeight&&($(".body-content").css("margin-bottom",n*-1+"px"),$(".body-content").addClass("min-height-100"),$(".pushfooter").height(n+parseInt($(".main-body").css("padding-top"))))}function SetColors(){$(".color .selection-tab").height($(".color .selection-tab").width());$(".color [class^='icon-'], .color [class*=' icon-']").css("line-height",$(".color .selection-tab").width()+"px")}function NSLBlock(){$("#MN_container .validation-summary-errors").length>0&&($(".main").removeClass("display-none"),$("#MN_container").addClass("open-block"),$("#MN_container #openBlockMN").removeClass("icon-arrow-up9").addClass("icon-arrow-down9"));$("#MN_container #Email").on("focusin",function(){$("#MN_container .main").hasClass("display-none")&&($("#openBlockMN").trigger("click"),setCookie("mn_show_temp","1",1))});$("#MNLangSelect").on("focusin",function(){$("#MN_container .main").hasClass("display-none")&&($("#openBlockMN").trigger("click"),setCookie("mn_show_temp","1",1))});mobile&&($("#MN_container").addClass("dispNone"),getCookie("mn_show")!="1"&&setTimeout(function(){$("#MN_container").removeClass("display-none")},3e4),$("#MN_container #closeBlockMN").click(function(){$("#MN_container").addClass("display-none");setCookie("mn_show","1",7)}));$("#openBlockMN").click(function(){$("#MN_container .main").toggleClass("display-none");$("#MN_container").toggleClass("open-block");$("#MN_container").toggleClass("animate");$("#MN_container .main").hasClass("display-none")?($("#openBlockMN").removeClass("icon-arrow-down9").addClass("icon-arrow-up9"),setCookie("mn_show","0")):($("#openBlockMN").removeClass("icon-arrow-up9").addClass("icon-arrow-down9"),setCookie("mn_show_temp","1",1))})}function setCookie(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i);u=escape(t)+(i==null?"":"; expires="+r.toUTCString()+"; path=/");document.cookie=n+"="+u}function getCookie(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return unescape(u)}function fitImage(){if($(".fit-image-container").parents("#fullpage").length>0)$(".fit-image-container").each(function(){var n=1;parseFloat($(this).attr("hdiv"))>1&&(n=parseFloat($(this).attr("hdiv")));!mobile||innerWidth>480?$(this).height((innerHeight-$(".header").height()-72-48*(n-1)-24)/n):$(this).hasClass("news")||($(this).parents(".flexslider").hasClass("projects-slider")?$(this).height(innerWidth-30):$(this).height((innerHeight-$(".header").height()-72-48*(n-1)-24)/n))});else{mobile?$(".fit-image-container").each(function(){$(this).hasClass("square-mob")||$(this).hasClass("square")?($(this).width($(this).parent().width()),$(this).height($(this).width())):$(this).height(innerWidth/3)}):($(".fit-image-container").each(function(){$(this).hasClass("square")?($(this).width($(this).parent().width()),$(this).height($(this).width())):$(this).height(innerWidth/6)}),$(".fit-image-container").parents(".wrapCat").children().children(".display-flex").height(innerWidth/6),!tablet&&innerWidth>1366?$(".fit-image-container").parent(".element").height($(".fit-image-container").height()):$(".fit-image-container").parent(".element:not(.news)").height($(".fit-image-container").height()));try{(!mobile||innerWidth>480)&&$(".height-fix").each(function(){$(this).height($(this).children(".col-sm-12").children().height())})}catch(n){}}isExplorer&&($(".fit-image-container, .news .img-ambiente").css("text-align","center"),$(".fit-image-container, .news .img-ambiente").css("display","block"),$(".fit-image-container, .news .img-ambiente").children("img").css("width","auto"));$(".fit-image-container-prod").height(innerHeight*3/5)}function checkFiltri(){var n="?";for(x=0;x<fList.length;x++)n+=(x>0?"&":"")+fList[x].replace("#","")+"="+$(fList[x]).val();fList.length>0&&($("#FilterBTNDelete").removeClass("display-none"),$("#FilterBTNDelete2").removeClass("display-none"));$("#FilterBTN").attr("href",n)}function wsh(n){$.ajax({url:n.toLowerCase()}).done(function(n){try{var t=parseInt(n);isNaN(t)?window.location.href=n:($(".wishlist .notifica span").html(t),$(".wishlist .notifica").hasClass("display-none")&&t>0&&$(".wishlist .notifica").removeClass("display-none"),t==0&&$(".wishlist .notifica").addClass("display-none"))}catch(i){}})}function InitWish(){$.ajax({url:"/it-it/WishList/Count",context:document.body}).done(function(n){try{var t=parseInt(n);t>0?($(".wishlist .notifica").removeClass("display-none"),$(".wishlist .notifica span").html(t)):$(".wishlist .notifica").addClass("display-none")}catch(i){}})}function InitCart(){$.ajax({url:"/it-it/Cart/Count",context:document.body}).done(function(n){try{var t=parseInt(n);$(".cart .notifica span").html(t)}catch(i){}})}var fList=["#Status"];$(window).scroll(function(){var n=$(window).scrollTop();n===0});$(document).ready(function(){var n,i,t,u;try{footerBottom()}catch(o){}InitWish();InitCart();try{var r=$("[data-toggle=collapse-side]"),f=r.attr("data-target"),e=r.attr("data-target-2");r.click(function(){$(f).toggleClass("in");$(e).toggleClass("out");$("body").toggleClass("overflow-hidden");$("html").toggleClass("overflow-hidden")})}catch(o){console.log("error slider sider")}if(SettingCarouselHome(),!mobile&&innerWidth>768){try{$(".blocco-testo").height($(".blocco-testo").height());$(".blocco-testo").parent().hasClass("home-testo")&&$(".blocco-testo").height(innerHeight*3/10)}catch(o){}$(".blocco-testo").parent().hasClass("home-testo")||(HeightCentring(".blocco-testo"),HeightCentring(".wrapper-box"));HeightCentring(".logo-home");HeightCentring(".btn-wrapper")}mobile||$(".awk-list").children(".cover-opera").children("a").width($(".awk-list").children(".cover-opera").width()).height($(".awk-list").children(".cover-opera").width()/4*5);SettingThumb();try{$(".gallery").featherlightGallery({previousIcon:"",nextIcon:"",galleryFadeIn:300,openSpeed:300})}catch(o){}try{mobile||tablet||$(".mandatory").mouseenter(function(){$(".add-note#"+$(this).attr("id2")).addClass("open")}).mouseleave(function(){$(".add-note#"+$(this).attr("id2")).removeClass("open")});$(".mandatory").click(function(){$(".add-note#"+$(this).attr("id2")).toggleClass("open")})}catch(o){}try{mobile||tablet&&innerWidth<1024?$(".filters-btn-mob, .filters-btn.close-btn").click(function(){$(".filter-sidebar").toggleClass("open-mob")}):($(".pagination .filters-btn").click(function(){$(".filter-sidebar").toggleClass("open");$(".pagination .filters-btn").toggleClass("btn-highlight");mobile||tablet?$("body").toggleClass("no-overflow"):SetColors();$(this).parents(".pagination").hasClass("bottom")&&(document.body.scrollTop=0,document.documentElement.scrollTop=0)}),$(".filters-btn.close-btn").click(function(){$(".filter-sidebar").toggleClass("open")}))}catch(o){}try{n=0;i=0;$(".counter").each(function(){i=$(this).parent().parent().children(".counterarea").val().length;n=$(this).attr("dmax");$(this).text(n-i)});$(".counterarea").on("change keyup",function(){var t=$(this).val().length;n=$(this).parent().children().children(".counter").attr("dmax");$(this).parent().children().children(".counter").text(n-t);n-t<0&&($str=$(this).val(),$str=$str.substring(0,n),$(this).val($str),$(this).parent().children(".counter").text(0))})}catch(o){}for(t=0;t<fList.length;t++)$(fList[t]).change(function(){checkFiltri()});($("#Status").val()!=""||$("#Status2").val()!="")&&($("#FilterBTNDelete").removeClass("display-none"),$("#FilterBTNDelete2").removeClass("display-none"));$("#FilterBTNDelete, #FilterBTNDelete2").click(function(){var n=window.location.href.split("?");window.location.href=n[0]});u=document.querySelectorAll(".input-file");Array.prototype.forEach.call(u,function(n){var t=n.nextElementSibling,i=t.innerHTML;n.addEventListener("change",function(n){var r="";r=this.files&&this.files.length>1?(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):n.target.value.split("\\").pop();r?t.querySelector("span").innerHTML=r:t.innerHTML=i})});AwkImgHeight();tablet&&$(".user-menu-container, .submenu-wrapper").click(function(){$(this).children(".submenu").toggleClass("display-none")});$(".like-btn").click(function(){$(this).toggleClass("selected");msa("arl","en-US","1","ZOOM","::1")});$(".wish-btn").click(function(){$(this).toggleClass("selected")});CartSideSetting();$(".btn-close").click(function(){$(".cart-summary-wrapper").toggleClass("display-none");$(".cart-link-container").removeClass("selected")});$(".tip-wrapper").click(function(){$(this).hasClass("selected")?$(this).children(".tip").addClass("display-block"):$(this).children(".tip").removeClass("display-block")});$(".info-service").mouseenter(function(){$(this).children(".info-tip").removeClass("display-none")}).mouseleave(function(){$(this).children(".info-tip").addClass("display-none")}).click(function(){$(this).children(".info-tip").toggleClass("display-none")});try{$(".icon-view-list").click(function(){$(".feather-wrapper").parents(".featherlight").addClass("featherlight-small")})}catch(o){}try{$(".excerpt.click").click(function(){$(this).toggleClass("open")})}catch(o){}});$(window).resize(function(){if(windowheight=$(window).height(),windowwidth=$(window).width(),DeviceDetectionBase(),SettingCarouselHome(),!mobile&&windowwidth>768&&$(".min-height-full").css("min-height",windowheight/100*87),!mobile&&innerWidth>768){try{$(".blocco-testo").height()>innerHeight/2?$(".blocco-testo").height(innerHeight/2):$(".blocco-testo").height($(".blocco-testo").height());$(".blocco-testo").parent().hasClass("home-testo")&&$(".blocco-testo").height(innerHeight*3/10)}catch(n){}$(".blocco-testo").parent().hasClass("home-testo")||(HeightCentring(".blocco-testo"),HeightCentring(".wrapper-box"));HeightCentring(".logo-home");HeightCentring(".btn-wrapper")}});$(window).on("load",function(){try{window.scrollTo(0)}catch(n){}try{paddingsibling($(".top-menu").height())}catch(t){}try{footerBottom()}catch(t){}try{positionRC()}catch(t){}CustomScroller();$(".user-menu-container").mouseenter(function(){$(".user-menu-list").removeClass("display-none")});$(".user-menu-list").mouseleave(function(){$(".user-menu-list").addClass("display-none")});$(".cart-link-container, .search-link-container, .top-menu form > .btn-like").mouseenter(function(){$(".user-menu-list").addClass("display-none")});$(".search-wrapper .search").keypress(function(n){if(n.which===13)return $(this).closest("form").submit(),!1})})