function CheckProgramSelected(n,t){if(n==="all"){toastr.remove();toastr.error(selectProgramsFirst,"",{positionClass:"toast-top-right"});return}if(n==="allprograms"){toastr.remove();toastr.error(selectProgramsFirstAllProgramsPrint,"",{positionClass:"toast-top-right"});return}$("#modal-select-loader").attr("aria-hidden","false");$.ajax({url:t,contentType:"applicationhttps://www.microsoft.com/json; charset=utf-8",type:"post",success:function(n){$("#modal-select-loader").attr("aria-hidden","true");$("#printDialog").html(n).dialog()},error:function(n,t,i){alert(i)}})}function FeatureComingSoon(){toastr.info("Feature coming soon.");return}function InitializeDatePicker(n){function r(t){for(var i=0;i<\/input>"+updatedTerms+"<\/div>").appendTo(n);$("
"+goToPresentDayTerms+"<\/div>").on("click",function(){window.location="/licensing/terms/Program/PresentDayTermSelect"}).appendTo(n)},1)}var t=$("#hiddenField").val();$("#hiddenField").datepicker({showOn:"button",buttonText:t===""?presentDayTerms:t,beforeShowDay:r,showButtonPanel:!0,beforeShow:i,onChangeMonthYear:i,onSelect:function(n){$(this).datepicker("option","buttonText",n);window.location="/licensing/terms/Program/PresentDayTermSelect?date="+n},regional:languageCode})}function ScrollCheck(){var t,r;window.pageYOffset>150?($(sideSelector).addClass("sidebar-fixed"),$(mainSelector).removeClass("content-container"),$(mainSelector).addClass("content-container-fixed")):window.pageYOffset<=150&&($(sideSelector).removeClass("sidebar-fixed"),$(mainSelector).addClass("content-container"),$(mainSelector).removeClass("content-container-fixed"));window.pageYOffset>navTop?$("#backToTop").show():window.pageYOffset<=navTop&&$("#backToTop").hide();window.pageYOffset>=navTop&&headerSticky!==!0?($(navSelector).addClass("sticky"),headerSticky=!0,$(".in-page-navigation.with-tooltip").hide(),$(".in-page-navigation.without-tooltip").show()):window.pageYOffset=sectionClauseNavTop&§ionClauseSticky!==!0?($(sectionClauseNavSelector).addClass("sticky"),sectionClauseSticky=!0):window.pageYOffsetf&&i0&&(navTop=$tmpNav.offset().top);sectionClauseSticky=!1;sectionClauseNavTop=100;$tmpNav=$(sectionClauseNavSelector);$tmpNav.length>0&&(sectionClauseNavTop=$tmpNav.offset().top);$(window).scroll(function(){scrolling=!0});setInterval(function(){scrolling&&(scrolling=!1,ScrollCheck())},250);$(navSelector+" a").on("click",SmoothScroll);$(".clause-product-list .expandable").on("click",function(){$(this).closest(".product-list-container").toggleClass("collapsed")});$(".program-selection").change(function(){var n=$(this).val();n.trim()!==""&&(window.location.href=n)});$(".language-menu-toggle").on("click",ToggleLanguageMenu);$(".language-menu-item").on("click",function(n){n.preventDefault();var t=$(this).attr("href");$.ajax({type:"POST",url:"/licensing/terms/common/SetCurrentCulture",data:{cultureCode:$(this).attr("languageCode")},success:function(){location.href=t}})});$(".filter-menu-button").on("click",ToggleFilterMenu);document.addEventListener("click",function(n){filterMenuOpen&&($target=$(n.target),$target.closest(".filter-menu-container").length||ToggleFilterMenu());languageMenuOpen&&($target=$(n.target),$target.closest(".language-container").length||ToggleLanguageMenu())});$.widget("custom.catcomplete",$.ui.autocomplete,{_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)")},_renderMenu:function(n,t){var r=this,i="";$.each(t,function(t,u){var f;u.category!=i&&(n.append("
"),n.append("
  • "+u.category+"<\/li>"),n.append("
    "),i=u.category);f=r._renderItemData(n,u);u.category&&f.attr("aria-label",u.category+" : "+u.label)})},_renderItem:function(n,t){var i="";return i=t.category==$("#search-products-text").val().toUpperCase()?"icon--product.png":"icon--search.png",$("
  • ").append("
    "+i+" image<\/div>").append($("
    ").text(t.label)).appendTo(n)}});$("#searchInput").catcomplete({minLength:2,source:function(n,t){var i=$("#searchInput").val();$.ajax({url:"/licensing/terms/search/autocomplete?term="+i,dataType:"json",success:function(n){var r=[];$.each(n.products,function(n,t){r.push({label:t.Name,category:$("#search-products-text").val().toUpperCase(),url:"/licensing/terms/productoffering/"+t.Moniker})});$.each(n.searchTerms,function(n,t){var u=i.split(" "),f=t.Text;u.length>1&&(u.pop(),f=u.join(" ")+" "+t.Text);r.push({label:f,category:$("#search-terms-text").val().toUpperCase(),url:"/licensing/terms/search?term="+f})});t(r)},error:function(n){console.log(n)}})},select:function(n,t){location.href=t.item.url}});$("#programInput").keydown(function(n){toastr.remove();toastr.error($("#inputSearchErrorMessage").val().replace("\\","").replace("\\",""),"",{positionClass:"toast-top-left"});n.preventDefault()});$("#searchPageInput").catcomplete({minLength:2,source:function(n,t){var i=$("#searchPageInput").val();$.ajax({url:"/licensing/terms/search/autocomplete?term="+i,dataType:"json",success:function(n){var r=[];$.each(n.products,function(n,t){r.push({label:t.Name,category:$("#search-products-text").val().toUpperCase(),url:"/licensing/terms/productoffering/"+t.Moniker})});$.each(n.searchTerms,function(n,t){var u=i.split(" "),f=t.Text;u.length>1&&(u.pop(),f=u.join(" ")+" "+t.Text);r.push({label:f,category:$("#search-terms-text").val().toUpperCase(),url:"/licensing/terms/search?term="+f})});t(r)},error:function(n){console.log(n)}})},select:function(n,t){location.href=t.item.url}});$(".accordion-label").on("click",function(){var n=$(this).closest(".accordion-container");n.toggleClass("expanded");n.attr("aria-expanded",!(n.attr("aria-expanded")=="true"))});if($("#SectionClauseInPageNavigation").length){$(".clause-heading").each(function(n,t){var r=$(t).text(),u=r.replace(/\s/g,""),i;$(t).attr("id",u);i='';i+=''+r+"<\/span>";i+="<\/a>";$("#SectionClauseInPageNavigation").append(i)});$(".section-clause-in-page-navigation-link").on("click",function(n){n.preventDefault();var t=this.hash;$("#SectionClauseInPageNavigation a").removeClass("active");$('a[href^="'+t+'"]').addClass("active");$("html, body").stop().animate({scrollTop:$(t).offset().top-40},600)})}})