diff --git a/js/custom.js b/js/custom.js
index b6a4c85..71218d9 100644
--- a/js/custom.js
+++ b/js/custom.js
@@ -1,545 +1,545 @@
-jQuery(document).ready(function($) {
-
- // News Stories Pagination
- function paginateNews(){
- $('#news-stories').css('visibility', 'hidden')
- // change the perPage variable to the number of items you want per page.
- var perPage = 10
- var stories = $('.news-archive-list li')
- var numStories = stories.length
- //console.log('numStories'+numStories)
- var totalPages = Math.ceil(numStories/perPage)
-
-
- // only run this function if we need to.
- if (totalPages > 1) {
- $('#news-pagination').show();
- var currentPage = 1
- function assignPageNums(){
- var pageCount = 1
- var storyCount = 1
- stories.each(function() {
- $(this).addClass('page'+pageCount)
- var x = storyCount / perPage
- if(Math.floor(x) == x && $.isNumeric(x)) {
- pageCount++
- }
- storyCount++
- })
- }
- function drawPage() {
- // only display items from current page
- stories.hide()
- $('.news-archive-list li.page'+ currentPage).show()
- // insert pagination numbered links
- $('.page-link-item').remove()
- for (i=1; i<=totalPages; i++){
- var li = $('
')
- li.addClass('page-link-item')
- var a = $('')
- a.attr('href', '#')
- a.attr('page', i)
- a.addClass('page-link')
- a.append(i)
- li.append(a)
- if (i == currentPage){
- li.addClass('active')
- }
- $('#news-next').parent('li').before(li)
- }
- // disable back/next on first/last pages.
- if (currentPage == 1){
- $('#news-back').parent('li').addClass('disabled')
- } else if (currentPage > 1 && currentPage < totalPages) {
- $('#news-next').parent('li').removeClass('disabled')
- $('#news-back').parent('li').removeClass('disabled')
- } else if (currentPage == totalPages){
- $('#news-next').parent('li').addClass('disabled')
- }
- // bind click event to new a tags.
- $('.page-link').on('click', function(e){
- e.preventDefault()
- var page = $(this).attr('page')
- currentPage = page
- drawPage()
- })
- }
-
- assignPageNums()
- drawPage()
-
- $('#news-next').on('click', function(e){
- e.preventDefault()
- if (currentPage < totalPages){
- currentPage++
- drawPage()
- }
- })
- $('#news-back').on('click', function(e){
- e.preventDefault()
- if (currentPage >= 2){
- currentPage--
- drawPage()
- }
- })
- } else {
- // if we don't need pagination, hide the controls.
- $('#news-pagination').hide()
- }
- $('#news-stories').css('visibility', 'visible')
-
- }
-
- if( $('.news-archive-list').length > 0 ){
- paginateNews();
-
- var state = History.getState();
- History.options.initialTitle = 'News Archive';
- History.options.disableSuid = true;
-
- String.prototype.capitalize = function() {
- return this.charAt(0).toUpperCase() + this.slice(1);
- };
-
- String.prototype.slugToClean = function(){
- var str = this.toString();
- str = str.toLowerCase().replace(/(-)/g, ' ').replace(/\b[a-z]/g, function(letter) {
- return letter.toUpperCase();
- });
- return str;
- };
-
- String.prototype.decodeEntities = function(){
- var element = document.createElement('div'); //this prevents any overhead from creating the object each time
-
- var str = this.toString();
- if(str && typeof str === 'string') {
- // strip script/html tags
- str = str.replace(/