function resetSearchParameters(){var n=getUrlParameters(),t=["startDate","endDate"];t.forEach(function(t){n[t]!=undefined&&delete n[t]}),location.search=$.param(n)}function getUrlParameters(){for(var t={},i=location.search.substring(1),r=/([^&=]+)=([^&]*)/g,n;n=r.exec(i);)t[decodeURIComponent(n[1])]=decodeURIComponent(n[2]);return t}function dateIsoToLocal(n){var t=n.split("-");return[t[1],t[2],t[0]].join("/")}function dateLocalToIso(n){var t=n.split("/");return[t[2],t[0],t[1]].join("-")}function endsWith(n,t){return n.indexOf(t,n.length-t.length)!==-1}function LogAutoComplete(n,t,i){i||(i=""),t=t||function(){},n.processor="logautocomplete",jQuery.ajax({cache:!1,url:i+"/Ajax.ashx",dataType:"json",data:n,success:function(){t()}})}function AddCountToPageTitle(n){document.title.indexOf(")")==-1||document.title.indexOf(")")>4?document.title="("+n+") "+document.title:(RemoveCountFromPageTitle(),AddCountToPageTitle(n))}function RemoveCountFromPageTitle(){if(document.title.indexOf(")")<5&&document.title.indexOf(")")>-1){var n=document.title.indexOf(")")+1,t=document.title.length-n;document.title=document.title.substr(n,t)}}function AddTopMenuCount(n){$("#top-bar-notifications-count").text(n)}function AddTopDropdownCount(n){$("#top-bar-dropdown-notifications-count").show(),$("#top-bar-dropdown-notifications-count").text(n)}function RemoveTopMenuCount(){$("#top-bar-notifications-count").text("")}function RemoveTopDropdownCount(){$("#top-bar-dropdown-notifications-count").text(""),$("#top-bar-dropdown-notifications-count").hide()}function hideValidationMessage(){$(".field-validation-error[data-valmsg-for=CategoriesAutosuggest]").hide()}function submitenter(n,t,i){var r;if(window.event)r=window.event.keyCode;else if(t)r=t.which;else return!0;return r==13?(i.click(),!1):!0}function RegisterView(){try{jQuery.ajax({url:"/Generic/RegisterPageView",async:!0,context:document.body})}catch(n){}}function GetUrlParameter(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.href);return t==null?"":t[1]}function GetRadioValue(n){var i,t;if(!n)return"";if(i=n.length,i==undefined)return n.checked?n.value:"";for(t=0;t<i;t++)if(n[t].checked)return n[t].value;return""}function getWindowData(n,t){var u=typeof window.screenX!="undefined"?window.screenX:window.screenLeft,f=typeof window.screenY!="undefined"?window.screenY:window.screenTop,e=typeof window.outerWidth!="undefined"?window.outerWidth:document.documentElement.clientWidth,o=typeof window.outerHeight!="undefined"?window.outerHeight:document.documentElement.clientHeight-22,i=n,r=t,s=parseInt(u+(e-i)/2,10),h=parseInt(f+(o-r)/2.5,10);return"width="+i+",height="+r+",left="+s+",top="+h}function openPopup(n,t,i){var r=getWindowData(t,i);w=window.open(n,"popupwindow",r+"scrollbars=no,resizable=no")}function closePopup(){w!=null&&w.close()}function CommentFocus(){var n,t;document.location.href.indexOf("#commentsList")>-1&&(n=document.location.href.substring(document.location.href.indexOf("#")+1),n=n.replace("Link",""),t=document.getElementById(n),t.style.display="block")}function showComments(n){var t=document.getElementById(n);t.style.display="block"}function gotoUrl(n){document.location=n}function createCookie(n,t,i){var u="",r;i&&(r=new Date,r.setTime(r.getTime()+i*36e5),u="; expires="+r.toGMTString()),document.cookie=n+"="+t+u+"; path=/"}function readCookie(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return null}function deleteCookie(n){createCookie(n,"",-24)}var UPH,AutoSuggestProducts,AnthemUrl,w;(function(n){if(typeof define=="function"&&define.amd)define(n);else if(typeof exports=="object")module.exports=n();else{var i=window.Cookies,t=window.Cookies=n();t.noConflict=function(){return window.Cookies=i,t}}})(function(){function n(){for(var n=0,r={},t,i;n<arguments.length;n++){t=arguments[n];for(i in t)r[i]=t[i]}return r}function t(i){function r(t,u,f){var o,s;if(arguments.length>1){f=n({path:"/"},r.defaults,f),typeof f.expires=="number"&&(s=new Date,s.setMilliseconds(s.getMilliseconds()+f.expires*864e5),f.expires=s);try{o=JSON.stringify(u),/^[\{\[]/.test(o)&&(u=o)}catch(y){}return u=encodeURIComponent(String(u)),u=u.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",u,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}t||(o={});for(var l=document.cookie?document.cookie.split("; "):[],a=/(%[0-9A-Z]{2})+/g,h=0;h<l.length;h++){var v=l[h].split("="),c=v[0].replace(a,decodeURIComponent),e=v.slice(1).join("=");e.charAt(0)==='"'&&(e=e.slice(1,-1));try{if(e=i&&i(e,c)||e.replace(a,decodeURIComponent),this.json)try{e=JSON.parse(e)}catch(y){}if(t===c){o=e;break}t||(o[c]=e)}catch(y){}}return o}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,i){r(t,"",n(i,{expires:-1}))},r.withConverter=t,r}return t()}),function(n){function r(n,t,r){var u="("+r.replace(i,"\\$1")+")";return n.replace(new RegExp(u,"gi"),"<strong>$1<\/strong>")}function t(t,i){this.el=n(t),this.el.attr("autocomplete","off"),this.suggestions=[],this.data=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.el.val(),this.intervalId=0,this.cachedResponse=[],this.onChangeInterval=null,this.ignoreValueChange=!1,this.serviceUrl=i.serviceUrl,this.isLocal=!1,this.options={autoSubmit:!1,minChars:1,maxHeight:370,deferRequestBy:0,width:0,highlight:!0,params:{},fnFormatResult:r,delimiter:null,zIndex:9999,bottomRowHtml:"",guid:""},this.initialize(),this.setOptions(i)}var i=new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","g");n.fn.autocompletedb=function(i){return new t(this.get(0)||n("<input />"),i)},t.prototype={killerFn:null,initialize:function(){var t,i,r;t=this,i=Math.floor(Math.random()*1048576).toString(16),r="Autocomplete_"+i,this.killerFn=function(i){n(i.target).parents(".autocomplete").size()===0&&(t.killSuggestions(),t.disableKillerFn())},this.options.width||(this.options.width=this.el.width()),this.mainContainerId="AutocompleteContainter_"+i,n('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="'+r+'" style="display:none; width:300px;"><\/div><\/div><\/div>').appendTo("body"),this.container=n("#"+r),this.fixPosition(),window.opera?this.el.keypress(function(n){t.onKeyPress(n)}):this.el.keydown(function(n){t.onKeyPress(n)}),this.el.keyup(function(n){t.onKeyUp(n)}),this.el.blur(function(){t.enableKillerFn()}),this.el.focus(function(){t.fixPosition()})},setOptions:function(t){var i=this.options;n.extend(i,t),i.lookup&&(this.isLocal=!0,n.isArray(i.lookup)&&(i.lookup={suggestions:i.lookup,data:[]})),n("#"+this.mainContainerId).css({zIndex:i.zIndex}),this.container.css({maxHeight:i.maxHeight+"px",width:i.width})},clearCache:function(){this.cachedResponse=[],this.badQueries=[]},disable:function(){this.disabled=!0},enable:function(){this.disabled=!1},fixPosition:function(){var t=this.el.offset();n("#"+this.mainContainerId).css({top:t.top+this.el.innerHeight()+"px",left:t.left+"px"})},enableKillerFn:function(){var t=this;n(document).bind("click",t.killerFn)},disableKillerFn:function(){var t=this;n(document).unbind("click",t.killerFn)},killSuggestions:function(){var n=this;this.stopKillSuggestions(),this.intervalId=window.setInterval(function(){n.hide(),n.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(n){if(!this.disabled&&this.enabled){switch(n.keyCode){case 27:this.el.val(this.currentValue),this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}if(this.select(this.selectedIndex),n.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}n.stopImmediatePropagation(),n.preventDefault()}},onKeyUp:function(n){if(!this.disabled){switch(n.keyCode){case 38:case 40:return}if(clearInterval(this.onChangeInterval),this.currentValue!==this.el.val())if(this.options.deferRequestBy>0){var t=this;this.onChangeInterval=setInterval(function(){t.onValueChange()},this.options.deferRequestBy)}else this.onValueChange()}},onValueChange:function(){clearInterval(this.onChangeInterval),this.currentValue=this.el.val().toLowerCase();var n=this.getQuery(this.currentValue);if(this.selectedIndex=-1,this.ignoreValueChange){this.ignoreValueChange=!1;return}n===""||n.length<this.options.minChars?this.hide():this.getSuggestions(n)},getQuery:function(t){var i,r;return(i=this.options.delimiter,!i)?n.trim(t):(r=t.split(i),n.trim(r[r.length-1]))},getSuggestionsLocal:function(n){var i,r,f,u,t;for(r=this.options.lookup,f=r.suggestions.length,i={suggestions:[],data:[]},n=n.toLowerCase(),t=0;t<f;t++)u=r.suggestions[t],u.toLowerCase().indexOf(n)===0&&(i.suggestions.push(u),i.data.push(r.data[t]));return i},getSuggestions:function(t){var i,r;i=this.isLocal?this.getSuggestionsLocal(t):this.cachedResponse[t],i&&n.isArray(i.suggestions)?(this.suggestions=i.suggestions,this.data=i.data,this.suggest()):this.isBadQuery(t)||(r=this,r.options.params.query=t,n.get(this.serviceUrl,r.options.params,function(n){r.processResponse(n)},"text"))},isBadQuery:function(n){for(var t=this.badQueries.length;t--;)if(n.indexOf(this.badQueries[t])===0)return!0;return!1},hide:function(){this.enabled=!1,this.selectedIndex=-1,this.container.hide()},suggest:function(){if(this.suggestions.length===0){this.hide();return}var i,f,r,e,o,t,u,s,h;for(i=this,f=this.suggestions.length,e=this.options.fnFormatResult,o=this.getQuery(this.currentValue),s=function(n){return function(){i.activate(n)}},h=function(n){return function(){i.select(n)}},this.container.hide().empty(),t=0;t<f;t++)u=this.suggestions[t],r=n((i.selectedIndex===t?'<div class="selected"':"<div")+' title="'+u+'">'+e(u,this.data[t],o)+"<\/div>"),r.mouseover(s(t)),r.click(h(t)),this.container.append(r);this.options.bottomRowHtml!=""&&this.container.append(this.options.bottomRowHtml),this.enabled=!0,this.container.show()},processResponse:function(text){var response,d,g;try{response=eval("("+text+")")}catch(err){return}n.isArray(response.data)||(response.data=[]),this.options.noCache||(this.cachedResponse[response.query]=response,response.suggestions.length===0&&this.badQueries.push(response.query)),response.query===this.getQuery(this.currentValue)&&(this.suggestions=response.suggestions,d=response.data,g=this.options.guid,n.each(d,function(n,t){d[n]=t+"?qid="+g}),this.data=response.data,this.suggest())},activate:function(t){var i,r;return i=this.container.children(),this.selectedIndex!==-1&&i.length>this.selectedIndex&&n(i.get(this.selectedIndex)).removeClass(),this.selectedIndex=t,this.selectedIndex!==-1&&i.length>this.selectedIndex&&(r=i.get(this.selectedIndex),n(r).addClass("selected")),r},deactivate:function(n,t){n.className="",this.selectedIndex===t&&(this.selectedIndex=-1)},select:function(n){var t,i;if(t=this.suggestions[n],t){this.onPreSelect(this.el.val());this.el.val(t),this.options.autoSubmit&&(i=this.el.parents("form"),i.length>0&&i.get(0).submit()),this.ignoreValueChange=!0,this.hide();this.onSelect(n)}},moveUp:function(){if(this.selectedIndex!==-1){if(this.selectedIndex===0){this.container.children().get(0).className="",this.selectedIndex=-1,this.el.val(this.currentValue);return}this.adjustScroll(this.selectedIndex-1)}},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(n){var r,t,i,u;r=this.activate(n),t=r.offsetTop,i=this.container.scrollTop(),u=i+this.options.maxHeight-25,t<i?this.container.scrollTop(t):t>u&&this.container.scrollTop(t-this.options.maxHeight+25),this.el.val(this.getValue(this.suggestions[n]))},onSelect:function(t){var i,r,u,f;i=this,r=i.options.onSelect,u=i.suggestions[t],f=i.data[t],i.el.val(i.getValue(u)),n.isFunction(r)&&r(u,f,i.el)},onPreSelect:function(t){var r,i;r=this,i=r.options.onPreSelect,n.isFunction(i)&&i(t)},getValue:function(n){var r,t,i,u;return(u=this,r=u.options.delimiter,!r)?n:(t=u.currentValue,i=t.split(r),i.length===1)?n:t.substr(0,t.length-i[i.length-1].length)+n}}}(jQuery),$(document).ready(function(){var n,r,u,t,i;$().datepicker&&($("#start-date-filter").datepicker(),$("#end-date-filter").datepicker(),n=getUrlParameters(),n.startDate!=null&&n.endDate!=null?(t=$("#date-filter option[value='"+n.startDate+":"+n.endDate+"']:first"),t.length==0&&(t=$("#date-filter option[value='custom']"),r=n.startDate,u=n.endDate,$("#start-date-filter").val(dateIsoToLocal(r)),$("#end-date-filter").val(dateIsoToLocal(u)),$("#date-filter-custom").show()),t.prop("selected",!0)):(t=$("#date-filter option[value='']"),t.prop("selected",!0))),$("#listTypeSelect").change(function(){var n=$("option:selected",this),t=n.attr("data-url");window.location.href=t}),i=$(".listTabs ul.main").clone().removeClass("main"),$("li",i).remove(".first, .last").removeClass("hide-for-mobile hide-for-tablet"),$("#mobile-menu-items").append(i);$(document).on("click","#mobile-menu-expand",function(){$("#mobile-menu-dropdown").show(),$("#mobile-menu-collapse").show()});$(document).on("click","#mobile-menu-collapse",function(){$("#mobile-menu-collapse").hide(),$("#mobile-menu-dropdown").hide()});$(".show-versions").click(function(n){var t=$(n.target.closest("div")).find(".versions-table");$(t).is(":visible")?($(t).hide(200),$(n.target).parent().find("[name='show']").show(),$(n.target).parent().find("[name='hide']").hide()):($(t).show(200),$(n.target).parent().find("[name='show']").hide(),$(n.target).parent().find("[name='hide']").show())}),$(".show-filters").click(function(){$("#list-filters").toggle(100)}),$("#date-filter").change(function(n){$(n.target).val()=="custom"?$("#date-filter-custom").show():$("#date-filter-custom").hide()}),$("#filter").click(function(){var r,u,t=$("#date-filter").val(),i;if(t==""){resetSearchParameters();return}t!="custom"?(r=t.split(":")[0],u=t.split(":")[1]):(r=dateLocalToIso($("#start-date-filter").val()),u=dateLocalToIso($("#end-date-filter").val())),i=getUrlParameters(),i.startDate=r,i.endDate=u,location.search=$.param(i)}),$("#filter-clear").click(function(){resetSearchParameters()})}),$(function(){$("#subscriptionButton").click(function(){var n=$(this);return n.attr("disabled")=="disabled"?!1:($.get(this.href,function(t){t.Subscribed==!0?(n.fadeOut(function(){$(this).text(local._ListHeader_SubscribedButton).attr("disabled","disabled").fadeIn()}),setTimeout(function(){n.fadeOut(function(){$(this).text(local._ListHeader_UnsubscribeButton).attr("href",$(this).attr("href").replace("Subscribe","Unsubscribe")).removeAttr("disabled").fadeIn(2e3)})},5e3)):n.fadeOut(function(){$(this).text(local._ListHeader_SubscribeButton).attr("href",$(this).attr("href").replace("Unsubscribe","Subscribe")).fadeIn()})}),!1)})}),$(document).ready(function(){$("#pageSize").bind("change",function(){createCookie("pageSize",$(this).val(),24);var n=window.document.location.href;n.indexOf("#")>-1&&(n=n.substring(0,n.indexOf("#"))),window.document.location.href=n})}),UPH={debug:!1,Init:function(){jQuery(".userpopuplink").on("mouseover",function(n){var i,t,r;$(window).width()<=500||(i=jQuery(this),t=i.attr("href"),t.toLowerCase().indexOf(global.PublicSiteUrl.toLowerCase())!=-1||t.substr(0,1)=="/")&&(endsWith(t,"/")&&(t=t.substring(0,t.length-1)),r=t.substr(t.lastIndexOf("/")+1),UPH.debug&&console.log(r),i.qtip({overwrite:!1,suppress:!1,content:{text:function(n,t){return $.ajax({url:global.PublicSiteUrl+"/UserPopupIframe.aspx?username="+r}).then(function(n){t.set("content.text",n)}),local.UserPopup_LoadingMessage}},show:{event:n.type,delay:300,ready:!0},style:{tip:!1,classes:"ui-tooltip-userpopup qtip-light"},hide:{delay:500,fixed:!0}},n))})}},jQuery(document).ready(function(){UPH.Init()}),AutoSuggestProducts=AutoSuggestProducts||{},$.extend(AutoSuggestProducts,{MaxProducts:1,NewTermBox:function(n,t,i){var r='<li>    <span class="radius secondary label">        <input class="product-added" id="Id" name="Id" type="hidden" value="{0}">        <input class="product-name" id="PathName" name="PathName" type="hidden" value="{2}">        <a href="#" class="products-autosuggest-remove">×<\/a>        <span title="&gt;&nbsp;{3}" class="name">{1}<\/span>    <\/span><\/li>';return r.replace("{0}",n).replace("{1}",t).replace("{2}",i).replace("{3}",i)},AppendNewTermBox:function(n){$("#current-products-autosuggest").append(this.NewTermBox(n.value,n.label,n.desc)),$(".product-added").length===AutoSuggestProducts.MaxProducts&&$(".product-autosuggest:not(.navigate)").hide(),AutoSuggestProducts.SelectedCategoryList.push(n.value)},FullCategoryList:[],SelectedCategoryList:[],Bind:function(){$(".product-autosuggest").bind("keydown",function(n){n.keyCode===$.ui.keyCode.TAB&&$(this).autocomplete("instance").menu.active&&n.preventDefault(),hideValidationMessage()}).autocomplete({minLength:0,source:function(n,t){var f=function(t){if(!t.length&&n.term.length>0){var i,r=this.element.attr("data-no-results-id");i=r?$("#"+r).html():"No results.",t=[{value:"0",label:i,desc:""}]}return t},i,r,e,u;if(n.term.length==0){if(i=AutoSuggestProducts.FullCategoryList,AutoSuggestProducts.SelectedCategoryList.length)for(i=i.slice(),r=i.length;r--;)AutoSuggestProducts.SelectedCategoryList.indexOf(i[r].value)>=0&&i.splice(r,1);i=f.call(this,i),t(i)}else e=this,u=[],$(".product-added").each(function(){u.push(this.value)}),$.ajax({traditional:!0,url:baseurl+"/BrowseByTopic/AutoSuggestProducts",data:{term:n.term,excludeIds:u},success:function(n){n=f.call(e,n),t(n)}})},open:function(){$(this).data("uiAutocomplete").menu.element.addClass("categories")},focus:function(){return!1},select:function(n,t){if($(this).hasClass("navigate")){if(t.item.value!=="0"){var i=baseurl+"/topic/"+t.item.term+"/"+t.item.value;document.location=i}}else this.value="",$("#CategoryId").val(t.item.value),AutoSuggestProducts.AppendNewTermBox(t.item),$(this).blur();return!1}}).focus(function(){$(this).autocomplete("search",$(this).val())}).each(function(){$(this).data("ui-autocomplete")._renderItem=function(n,t){var r='<li class="categories-autosuggest-message">    {0}<\/li>',u='<li class="categories-autosuggest-item">    <a>{0}        <span>&gt;&nbsp;{1}<\/span>    <\/a><\/li>',f='<li class="categories-autosuggest-item">    <a>{0}<\/a><\/li>',i="";return i=t.value!="0"?t.desc.length>0?u:f:r,i=i.replace("{0}",t.label).replace("{1}",t.desc),$(i).appendTo(n)}})}}),$(function(){function n(){var n=$(".product-added").length<AutoSuggestProducts.MaxProducts;$(".product-autosuggest:not(.navigate)").toggle(n)}$.ajax({traditional:!0,url:baseurl+"/BrowseByTopic/AutoSuggestProducts",data:{term:""},success:function(n){n&&n.length&&(AutoSuggestProducts.FullCategoryList=n),AutoSuggestProducts.Bind()}});$(document).on("click",".products-autosuggest-remove",function(t){var i;t.preventDefault();var r=$(this).closest("li"),u=r.find(".product-added"),f=parseInt(u.val());r.remove(),hideValidationMessage(),n(),i=AutoSuggestProducts.SelectedCategoryList.indexOf(f),i>=0&&AutoSuggestProducts.SelectedCategoryList.splice(i,1)})}),AnthemUrl="",jQuery(function(){typeof Sys!="undefined"&&Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version===10&&(Sys.WebForms.PageRequestManager.getInstance()._onFormElementActive=function(n,t,i){var r,u;n.disabled||(this._activeElement=n,this._postBackSettings=this._getPostBackSettings(n,n.name),n.name&&(r=n.tagName.toUpperCase(),r==="INPUT"?(u=n.type,u==="submit"?this._additionalInput=encodeURIComponent(n.name)+"="+encodeURIComponent(n.value):u==="image"&&(this._additionalInput=encodeURIComponent(n.name)+".x="+Math.floor(t)+"&"+encodeURIComponent(n.name)+".y="+Math.floor(i))):r==="BUTTON"&&n.name.length!==0&&n.type==="submit"&&(this._additionalInput=encodeURIComponent(n.name)+"="+encodeURIComponent(n.value))))})})