function resetLeftNav(){if($(window).width()>1024){var n=$("#mobileNav");n.hasClass("visible")&&(n.animate({left:"-300px"},"300").removeClass("visible"),$("body").animate({marginLeft:"+=-300px"}),$("body").removeClass("bodyFixed"),$("header").animate({left:"+=-300"}),$(".commonOverlay").fadeOut())}}function menuWidth(){var n=$(window).width()-50,t=(n-270)/2-2;$(".leftMainNav, .rightMainNav").css("width",t);jQuery("header nav#desktopNav li span").css("opacity","1")}function bodyWidth(){var n=$(".dropDownNavCol").width(),t=$(window).width(),i=t/n;return i.toString().split(".")[0]}function mobileMenu(){jQuery("#mobileNav .subnavBlock ul li a").on("click",function(){jQuery(this).parent("ul").stop().slideUp();jQuery(this).parent().siblings().find("ul").stop().slideUp();jQuery(this).siblings().find(".dropDownContainer").stop.slideUp()});jQuery("#mobileNav .subnavBlock h2").on("click",function(){$(this).toggleClass("active");$(this).parents(".subnavBlock").siblings().find("h2").removeClass("active");jQuery(this).siblings("ul").slideToggle();jQuery(this).closest(".dropDownNavCol").siblings().find("ul").slideUp();jQuery(this).parent().siblings().find("ul").slideUp();jQuery(this).parent().siblings().find("h2 span.toggle.plus").show();jQuery(this).parent().siblings().find("h2 span.toggle.minus").hide();jQuery(this).hasClass("active")?(jQuery(this).find("span.toggle.plus").hide(),jQuery(this).find("span.toggle.minus").show()):(jQuery(this).find("span.toggle.plus").show(),jQuery(this).find("span.toggle.minus").hide(),jQuery(this).parent().siblings().find("span.toggle.plus").show(),jQuery(this).parent().siblings().find("span.toggle.minus").hide())});jQuery("#mobileNav .second_level li").on("click",function(){$(this).toggleClass("active");$(this).closest("li").siblings().find("h2").removeClass("active");$(this).closest("li").siblings().find("h2 span.toggle.plus").show("");$(this).closest("li").siblings().find("h2 span.toggle.minus").hide("");jQuery(this).siblings("ul").slideToggle();jQuery(this).closest(".dropDownNavCol").siblings().find("ul").slideUp();jQuery(this).parent().siblings().find("ul").slideUp();jQuery(this).closest("li").siblings().find("ul.third_level").slideUp();jQuery(document).find(".single_line").length===0&&jQuery("#mobileNav .second_level li, #mobileNav .third_level li").each(function(){jQuery(this).height()>41?jQuery(this).addClass("double_line"):jQuery(this).addClass("single_line")})});$("#mobileNav ul li a").on("click",function(){$("#mobileNav .subnavBlock h2").removeClass("active");jQuery(this).parent().siblings().find("h2 span.toggle.plus").show();jQuery(this).parent().siblings().find("h2 span.toggle.minus").hide();jQuery(this).parents("li").find(".dropDownContainer").slideToggle();jQuery(this).parents("li").siblings().find(".dropDownContainer").is(":visible")&&(jQuery(this).parents("li").siblings().find(".dropDownContainer").slideUp(),jQuery(this).parents("li").siblings().find(".dropDownContainer").find("ul").slideUp());jQuery(this).parents("li").find(".dropDownContainer").find("ul").slideUp()});jQuery("ul.mainMobileNav > li > h2").on("click",function(){jQuery(this).toggleClass("active");jQuery(this).closest("li").siblings().find("h2").removeClass("active");jQuery(this).hasClass("active")?(jQuery(this).find("span.toggle.plus").first().hide(),jQuery(this).find("span.toggle.minus").first().show(),jQuery(this).parent().siblings().find("h2 span.toggle.plus").first().show(),jQuery(this).parent().siblings().find("h2 span.toggle.minus").first().hide()):(jQuery(this).closest("li").siblings().find("h2").removeClass("active"),jQuery(this).closest("li").find("span.toggle.plus").first().show(),jQuery(this).closest("li").find("span.toggle.minus").first().hide())})}function leftNavShow(){if($(window).width()<1024){var n=$("#mobileNav");n.hasClass("visible")?(n.animate({left:"-300px"},"300").removeClass("visible"),$("body").animate({marginLeft:"+=-300px"}),setTimeout(function(){$("body").removeClass("bodyFixed")},500),$("header").animate({left:"+=-300"}),$(".commonOverlay").fadeOut()):(n.animate({left:"0px"},"300").addClass("visible"),$("body").addClass("bodyFixed").animate({marginLeft:"+=+300px"}),$("header").animate({left:"+=+300"}),$(".commonOverlay").fadeIn())}else $("body").animate({marginLeft:"0px"})}function correctNavHeight(){var n=jQuery(window).width();n<580&&jQuery("#mobileNav .dropDown").height("auto")}function initThirdNav(){var n;jQuery(".dropDownWrapper").css("top",0);jQuery("#desktopNav").on("mouseenter","span",function(){jQuery(this).find(".dropDown").find(".dropDownWrapper").each(function(){jQuery(this).hasClass("show")?jQuery(this).parent().find(".dropDown").height(jQuery(this).parent().find(".dropDown .dropDownWrapper.show").height()-10):jQuery(this).find(".dropDown").height(jQuery(this).parent().find(".dropDown .dropDownWrapper").first().height()-10)})});jQuery(".expanded_dropdown").hide();jQuery(".dropDown .dropDownWrapper a").on("click",function(){var r,t,i;jQuery(this).closest(".dropDownWrapper").hasClass("show")||(r=jQuery(this).data("handle"),jQuery(".expanded_dropdown").each(function(){var t=jQuery(this).data("handle");if(r==jQuery(this).data("handle"))return jQuery(".expanded_dropdown").removeClass("show"),jQuery(this).addClass("show"),jQuery(this).removeClass("hide"),n=1,!1;jQuery(this).addClass("hide");jQuery(this).removeClass("show");n=0}),jQuery(".expanded_dropdown").hide(),jQuery(".expanded_dropdown.show").show(),n!=1||jQuery(this).parents(".dropDownWrapper").hasClass("show")||(t=jQuery(this).closest(".dropDown").find(".dropDownWrapper").height(),i=jQuery(this).closest(".dropDown").find(".dropDownWrapper.show").height(),jQuery(".dropDownWrapper").css("top",-t),t>i?jQuery(this).closest(".dropDown").height(t):jQuery(this).closest(".dropDown").height(i)))});jQuery(".expanded_dropdown img.go_back").on("click",function(){var n=parseInt(jQuery(this).parents(".dropDown").find(".dropDownWrapper").css("top"));jQuery(".dropDownWrapper").css("top",Math.abs(parseInt(jQuery(this).parents(".dropDown").find(".dropDownWrapper").css("top"))-n));jQuery(this).closest(".dropDown").height(jQuery(this).parents(".dropDown").find(".dropDownWrapper").first().height()-10)});jQuery(".go_back").mouseenter(function(){jQuery(this).animate({opacity:0},{duration:50})});jQuery(".go_back").mouseleave(function(){jQuery(this).animate({opacity:1},{duration:50})});jQuery(document).on("mouseleave",".dropDown",function(){jQuery(".expanded_dropdown.dropDownWrapper.hide,.dropDownWrapper").css("top",0);jQuery(".expanded_dropdown").hide()})}function mobileNavH(){var n=$(window).height();$("#mobileNav").css("height",n)}function checkWindowWidth(){$(window).width()>=1024&&($("body").css({left:"0px"}),$("nav#mobileNav").css("left",-300))}function languageSectionActive(){var n=window.location.pathname.split("/")[1];(n===null||n===""||n.length!=2)&&(n="EN");$(".languageSection li a").each(function(){$(this).text()==n.toUpperCase()&&$(this).parent("li").addClass("active")})}function lanugageHrefs(){jQuery(".languageSection a").each(function(){var n=window.location.pathname.split("/");n[1]=jQuery(this).text().toLowerCase();jQuery(this).attr("href",n.join("/"))})}(function(){if(window.location.href.indexOf("#")>0){var n=window.location.hash.split("#")[1];$.ajax({type:"POST",url:"/Public/RedirectOldWebsiteURL",contentType:"application/json;charset=utf-8",cache:!1,data:JSON.stringify({oldWebsiteUrl:n}),success:function(n){n!=""&&(window.location.href=n)}})}})();var classes=["columns-4","columns-5"],oldValue=0;$(document).ready(function(){var n,t,i;if(navigator.userAgent.indexOf("iPad")>0){jQuery("#home_page .container .floating_title .main_heading span").css("pointer-events","none");jQuery("#desktopNav .dropDown").siblings("a").each(function(){jQuery(this).attr("data-link-value",jQuery(this).attr("href"));jQuery(this).attr("href","javascript:void(0);")});n=0;t=0;jQuery("#desktopNav a[title='Fabrics']").on("click",function(){n=0;t++;t>1?window.location.href=jQuery(this).data("link-value"):console.log("Fabrics : "+t+" | Products : "+n+" | Do nothing")});jQuery("#desktopNav a[title='Products']").on("click",function(){t=0;n++;n>1?window.location.href=jQuery(this).data("link-value"):console.log("Fabrics : "+t+" | Products : "+n+" | Do nothing")})}window.location.href.indexOf("product")>0?jQuery("#desktopNav ul li a[title='Products']").addClass("selected"):window.location.href.indexOf("fabric")>0?jQuery("#desktopNav ul li a[title='Fabrics']").addClass("selected"):window.location.href.indexOf("installation")>0?jQuery("#desktopNav ul li a[title='Installations']").addClass("selected"):window.location.href.indexOf("library")>0&&jQuery("#desktopNav ul li a[title='Library']").addClass("selected");jQuery("header .logo .page_title").length==1?jQuery(".logoMedium").hide():jQuery(window).width()<1024&&jQuery(".logoMedium").show();jQuery(window).on("scroll",function(){$(this).scrollTop()==0?jQuery("header .logo .page_title").length==1&&jQuery(window).width()<1024?console.log("show title, no change"):jQuery("header .logo .page_title").length==0&&jQuery(window).width()<1024?(jQuery(".logoMedium").show(),jQuery(".logoFull").hide()):jQuery(window).width()>=1024&&(jQuery(".logoMedium").hide(),jQuery(".logoFull").show()):jQuery("header .logo .page_title").length==1&&jQuery(window).width()>=1024?(jQuery(".logoMedium").show(),jQuery(".logoFull").hide()):jQuery("header .logo .page_title").length==0&&jQuery(window).width()>=1024&&(jQuery(".logoMedium").show(),jQuery(".logoFull").hide())});menuWidth();mobileMenu();mobileNavH();checkWindowWidth();languageSectionActive();lanugageHrefs();initThirdNav();i=bodyWidth();i!=oldValue&&(oldValue=i,$("html").addClass(classes[i-1]));$(".dropDownNavCol").width();$("header .logo img.mobileMenu, #closeMobileNav,#openMobileNav").on("click",function(){leftNavShow()});jQuery(".languageSection ul li a").on("click",function(n){n.preventDefault();var i=jQuery(this).text(),t=window.location.pathname.split("/"),u=t[1]=i.toLowerCase(),r=t.join("/");window.location=r})});$(window).resize(function(){jQuery("header .logo .page_title").length==1&&jQuery(window).width()<1024||(jQuery("header .logo .page_title").length==0&&jQuery(window).width()<1024?(jQuery(".logoMedium").show(),jQuery(".logoFull").hide()):jQuery(window).width()>=1024&&(jQuery(".logoMedium").hide(),jQuery(".logoFull").show()));correctNavHeight();menuWidth();checkWindowWidth();mobileNavH();var n=bodyWidth();n!=oldValue&&($("html").removeClass(classes[oldValue-1]),oldValue=n,$("html").addClass(classes[n-1]));resetLeftNav()})