(function($){$.autoScroll=function(a_currentSectionName,a_homeSectionName,a_maxScrollHeight,a_viewportThresholdHeight,a_blackListedSections,a_bodyHideClass){var isScrollable=true;if(a_homeSectionName===a_currentSectionName){var currentUrl=window.location.href;var lastSlashIdx=currentUrl.lastIndexOf("/");var queryString=currentUrl.substr(lastSlashIdx+1);if(queryString.indexOf(".")==-1&&queryString.indexOf("?")==-1){isScrollable=false;}}if(jQuery.inArray(a_currentSectionName,a_blackListedSections)>-1){isScrollable=false;}if(isScrollable){var scrollPosition=jQuery.cookie("scrollPosition");var viewPortHeight=jQuery(window).height();if(scrollPosition>a_maxScrollHeight||viewPortHeight<=a_viewportThresholdHeight){scrollPosition=a_maxScrollHeight;}if(scrollPosition){if(a_bodyHideClass){jQuery("body").removeClass(a_bodyHideClass);}jQuery(document).scrollTop(scrollPosition);}}jQuery("a").click(function(){var currentScrollPosition=jQuery(document).scrollTop();jQuery.cookie("scrollPosition",currentScrollPosition,{path:"/",expires:365});});};})(jQuery);
