if($j(window).width()>760){var isPDPPage=!1,isComparePage=!1;$j(document).ready(function(){var i,r;isPDPPage=$j("#hdnIsProductDetailPage").length>0&&$j("#hdnIsProductDetailPage").val().toLowerCase().trim()=="true";isComparePage=$j("#hdnIsComparePage").length>0&&$j("#hdnIsComparePage").val().toLowerCase().trim()=="true";location.href.indexOf("/pl/")>-1?(i=sessionStorage.getItem("ListingPageStateDetails"),i!=null&&JSON.parse(i).ListingURL.toLowerCase().trim()==location.href.toLowerCase().trim()?sessionStorage.getItem("DocumentReferrer")!=null&&sessionStorage.getItem("DocumentReferrer").toString().indexOf("/pl/")>-1||$j("#comparePagePath").length>0&&sessionStorage.getItem("DocumentReferrer")!=null&&sessionStorage.getItem("DocumentReferrer").toString().toLowerCase().indexOf($j("#comparePagePath").val().toLowerCase())>-1?(i=JSON.parse(i),typeof isLoadedFromSession!="undefined"&&isLoadedFromSession!=undefined&&(isLoadedFromSession=!0),i.AppliedFiltering.length>0?(r=$j.Deferred().resolve(),$j.when.apply($j,$j.map(i.AppliedFiltering,function(n){return r=r.then(function(){var t=$j("#"+n);if(t!=undefined&&t!=null)return t.prop("checked",!0),chkClicked(t.get(0))})})).then(function(){var n=$j('.first-row-facet input:checkbox[id^="refinement_"]:checked'),r;n!=null&&n!=undefined&&n.length>0&&(r="",guidedremoved||(r=document.getElementById("viewLessText").value),$j(".view_more_list").html(r),$j(".second-row-facet-container").addClass("displayblock").removeClass("displaynone"),$j(".first-row-facet .checkbox").addClass("displayblock").removeClass("displaynone"),$j(".second-row-facet-container .checkbox").addClass("displayblock").removeClass("displaynone"));t(i)})):t(i)):n():n()):n()});function t(t){var u,r,f;$j("#ddlSort")!=undefined&&$j("#ddlSort").length>0?(u=["Sorting"],r=$j.Deferred().resolve(),$j.when.apply($j,$j.map(u,function(n){return r=r.then(function(){if(n=="Sorting"){$j("#ddlSort").prop("selectedIndex",t.SelectedSortOptionIndex);var i=$j("#ddlSort option:selected").text(),r=$j("#ddlSort option:selected").val();return getSortedProducts(r,"TotalResults",i)}})})).then(function(){$j("#ddlSort").prop("selectedIndex",t.SelectedSortOptionIndex)}).then(function(){if(t.CurrentPage>1){var n=$j(".product-listing-container .sync-pagination")!=undefined&&$j(".product-listing-container .sync-pagination").length>0?$j(".product-listing-container .sync-pagination"):$j("#hardware-listings .sync-pagination");n.twbsPagination("show",t.CurrentPage)}}).then(function(){n()})):(f=$j(".product-listing-container .sync-pagination")!=undefined&&$j(".product-listing-container .sync-pagination").length>0?$j(".product-listing-container .sync-pagination"):$j("#hardware-listings .sync-pagination"),f.twbsPagination("show",t.CurrentPage),n());i(t.CurrentScrollPosition);typeof isLoadedFromSession!="undefined"&&isLoadedFromSession!=undefined&&(isLoadedFromSession=!1)}function i(n){$j("body,html").animate({scrollTop:n},1e3)}function n(){sessionStorage.getItem("ListingPageStateDetails")!=null&&sessionStorage.getItem("ListingPageStateDetails")!=undefined&&(document.referrer.indexOf("/pl/")>-1||isComparePage||localStorage.getItem("CompareProductsListingPage")!=null&&localStorage.getItem("CompareProductsListingPage")!=undefined||sessionStorage.removeItem("ListingPageStateDetails"));sessionStorage.getItem("DocumentReferrer")!=null&&sessionStorage.getItem("DocumentReferrer")!=undefined&&(document.referrer.indexOf("/pl/")>-1||isComparePage||localStorage.getItem("CompareProductsListingPage")!=null&&localStorage.getItem("CompareProductsListingPage")!=undefined||sessionStorage.removeItem("DocumentReferrer"))}window.onbeforeunload=function(){var n,s,i,u,o,t,f,e,h;if(location.href.indexOf("/pl/")>-1){let c={ListingURL:"",PageNavigationURL:"",CurrentPage:1,SelectedSortOptionIndex:0,AppliedFiltering:[],CurrentScrollPosition:document.documentElement.scrollTop};if(n=getBrowserNav(),n.lastIndexOf("/")==0&&(n=$j("#hdnPromoNav").val()),firstload||refNavState==""||(n=refNavState),refNavState==""&&($j(".chkNumber").length>0&&$j(".chkNumber")[0].attributes["data-navstate"]!=undefined?(i=$j(".chkNumber")[0].attributes["data-navstate"].value,s=i.split("?"),i="?"+s[1],n=n+i):$j(".selectBox-dropdown").length>0&&(i="?"+$j($j($j(".selectBox-dropdown option")[0].attributes.value.value.split("?"))[1].split("&"))[0],n=n+i)),u="",o=0,respUI||(u=document.getElementById("ddlSort"),u!=null&&(o=u.selectedIndex)),t=$j('input:checkbox[id^="refinement_"]:checked'),f=[],t!=null&&t!=undefined&&t.length>0)for(t.length>1&&t.sort(function(n,t){return $j(t).data("order")<$j(n).data("order")?1:-1}),e=0;e<t.length;e++)f.push(t[e].id);else f=[];h=$j(".product-listing-container .sync-pagination").find("li.page.active a")!=undefined&&$j(".product-listing-container .sync-pagination").find("li.page.active a").length>0?$j(".product-listing-container .sync-pagination").find("li.page.active a"):$j("#hardware-listings .sync-pagination").find("li.page.active a");c.ListingURL=location.href;c.PageNavigationURL=n;c.CurrentPage=r(h.text(),1);c.SelectedSortOptionIndex=o;c.AppliedFiltering=f;sessionStorage.setItem("ListingPageStateDetails",JSON.stringify(c));sessionStorage.removeItem("DocumentReferrer")}else isPDPPage||isComparePage?sessionStorage.setItem("DocumentReferrer",document.referrer):sessionStorage.removeItem("DocumentReferrer")};function r(n,t){var i=t;return n!==null&&n.length>0&&(isNaN(n)||(i=parseInt(n))),i}}