function LoadMoreNewsArticles(n,t){newsArticleShowCount=$(".NewsArticleCategoryAll").size();var i=$(t),f=i.text(),r=i.attr("data-id"),u=window.location.pathname.split("/"),e=u[u.length-1],o="/"+r+".xml/loadmorearticles/"+e+"?showCount="+newsArticleShowCount+"&numLoad="+GetArticleCount()+"&pageId="+r;n==null&&(n=".NewsThreeColumnGrid");$.ajax({type:"GET",url:o,beforeSend:function(){i.text("Loading...")},success:function(t){var i=$.trim(t);i?$(n).append(t):$(".NewsLoadMore").css("display","none");$("#articleLoadOnRefresh").attr("value",newsArticleShowCount)},error:function(){console.log("Error loading more articles");$(".NewsLoadMore").css("display","none")},complete:function(){i.text(f);newsArticleShowCount=$(".NewsArticleCategoryAll").size();window.history.replaceState({},"",setUrlParameter(window.location.href,"articlesLoaded",newsArticleShowCount))}})}function setUrlParameter(n,t,i){var f,e;t=encodeURIComponent(t);i=encodeURIComponent(i);var o=n.split("?")[0],u=t+"="+i,r="?"+u;return urlQueryString=n.split("?")[1]===undefined?"":"?"+n.split("?")[1],urlQueryString&&(f=new RegExp("([?&])"+t+"=[^&]*"),e=new RegExp("([?&])"+t+"=[^&;]+[&;]?"),i===undefined||i===null||i===""?(r=urlQueryString.replace(e,"$1"),r=r.replace(/[&;]$/,"")):r=urlQueryString.match(f)!==null?urlQueryString.replace(f,"$1"+u):urlQueryString==""?"?"+u:urlQueryString+"&"+u),r=r==="?"?"":r,o+r}var newsArticleShowCount;$(document).ready(function(){$("#HomeRotator").simplebanner()}),function(n){"use strict";var t=function(t,i){this.element=t;this._paused=!1;this._timer={};this._currentBanner={};this._newBanner={};this._bannerAnimationRunning=!1;this._bannerWidth=0;this._bannerCount=0;this._bannerPosition=0;this.options=n.extend({arrows:!0,indicators:!0,pauseOnHover:!0,autoRotate:!0,maxRotations:null,rotateTimeout:5e3,animTime:800},i);this.init()};t.prototype.init=function(){var n=this.element.find(".bannerList li");this._bannerCount=n.length;this._bannerWidth=n.outerWidth();this._rotationCount=0;this._bannerPosition=0;this._bannerAnimationRunning=!1;this._bannerWidth||(this._bannerWidth=this.element.width());this._currentBanner=n.eq(1).addClass("current");this.element.find(".bannerList").css("marginLeft","-920px");this.options.indicators?this.buildIndicators():this.element.addClass("hiddenIndicators");this.options.arrows||this.element.addClass("hiddenArrows");this._bannerCount>1&&this.options.autoRotate&&this.toggleTimer();this.bindEvents()};t.prototype.bindEvents=function(){var t=this;if(t.options.indicators)t.element.find(".bannerIndicator").on({click:function(){var r=n(this),i;r.hasClass("active")||(i=r.index()+1,t._newBanner=t.element.find(".bannerList li:eq("+i+")"),t._bannerPosition=i-1,t.goToBanner(i))}});if(t.options.arrows)t.element.find(".bannerControlsWpr").on({click:function(){t._bannerAnimationRunning||(n(this).hasClass("bannerControlsPrev")?(t._bannerAnimationRunning=!0,t.previousBanner()):(t._bannerAnimationRunning=!0,t.nextBanner()))}});if(t.options.pauseOnHover&&t.options.autoRotate)t.element.on({mouseenter:function(){t.toggleTimer(!0)},mouseleave:function(){t.toggleTimer(!1)}})};t.prototype.nextBanner=function(){this._bannerPosition++;this._newBanner=this._currentBanner.next();this.goToBanner(this._newBanner.index())};t.prototype.previousBanner=function(){this._bannerPosition--;this._newBanner=this._currentBanner.prev();this.goToBanner(this._newBanner.index())};t.prototype.goToBanner=function(n){var t=this;t._currentBanner.removeClass("current");t.element.find(".bannerIndicators .current").removeClass("current");t._currentBanner=t._newBanner;t._currentBanner.addClass("current");t.element.find(".bannerIndicators li:eq("+(n-1)+")").addClass("current");t.element.find(".bannerList").stop(!1,!0).animate({marginLeft:-n*t._bannerWidth},t.options.animTime,function(){t._bannerPosition<0?(t._currentBanner.removeClass("current"),t.element.find(".bannerIndicators .current").removeClass("current"),t._currentBanner=t.element.find(".bannerList li").eq(t._bannerCount-2),t._currentBanner.addClass("current"),t.element.find(".bannerIndicators li:eq("+(t._bannerCount-3)+")").addClass("current"),document.getElementById("HomePageBannerList").style.marginLeft=""+(t._bannerCount-2)*-1*t._bannerWidth+"px",t._bannerPosition=t._bannerCount-3):t._bannerPosition>=t._bannerCount-2&&(t._currentBanner.removeClass("current"),t.element.find(".bannerIndicators .current").removeClass("current"),t._currentBanner=t.element.find(".bannerList li").eq(1),t._currentBanner.addClass("current"),t.element.find(".bannerIndicators li:eq(0)").addClass("current"),document.getElementById("HomePageBannerList").style.marginLeft="-920px",t._rotationCount++,t._bannerPosition=0);t._bannerAnimationRunning=!1})};t.prototype.buildIndicators=function(){var t=this,n=t.element.find(".bannerIndicators ul");t.element.find(".bannerList li").each(function(){n.append('<li class="bannerIndicator"><\/li>')});n.find("li:first").remove();n.find("li:last").remove();n.find("li:first").addClass("current")};t.prototype.toggleTimer=function(n){var t=this;clearTimeout(t._timer);!n&&(this.options.maxRotations===null||this._rotationCount<this.options.maxRotations)&&(t._timer=setTimeout(function(){t.nextBanner();t.toggleTimer(!1)},t.options.rotateTimeout))};n.fn.simplebanner=function(i){var f=!1,r=!1,u=[];return typeof i=="string"&&(u=[].slice.call(arguments,0)),this.each(function(){var o=n(this),e=o.data("bannerInstance");if(o.attr("id")||o.attr("id","simpleBanner-"+(n.fn.simplebanner._instances.length+1)),e&&i)if(typeof i=="object")r=n.extend(e.options,i);else if(i==="options")r=e.options;else if(typeof e[i]=="function")r=e[i].apply(e,u.slice(1));else throw new Error('Simple Banner has no option/method named "'+f+'"');else e=new t(o,i||{}),o.data("bannerInstance",e),n.fn.simplebanner._instances.push(e)}),r||this};n.fn.simplebanner._instances=[]}(jQuery,window)