{"version":3,"names":[],"mappings":"","sources":["main.js"],"sourcesContent":["/*! ScrollMagic v2.0.7 | (c) 2019 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */\n!function(e,t){\"function\"==typeof define&&define.amd?define(t):\"object\"==typeof exports?module.exports=t():e.ScrollMagic=t()}(this,function(){\"use strict\";var _=function(){};_.version=\"2.0.7\",window.addEventListener(\"mousewheel\",function(){});var P=\"data-scrollmagic-pin-spacer\";_.Controller=function(e){var n,r,i=\"REVERSE\",t=\"PAUSED\",o=z.defaults,s=this,a=R.extend({},o,e),l=[],c=!1,f=0,u=t,d=!0,h=0,p=!0,g=function(){0t.scrollOffset()?1:-1}),t};return this.addScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.addScene(e)});else if(e instanceof _.Scene)if(e.controller()!==s)e.addTo(s);else if(l.indexOf(e)<0)for(var t in l.push(e),l=x(l),e.on(\"shift.controller_sort\",function(){l=x(l)}),a.globalSceneOptions)e[t]&&e[t].call(e,a.globalSceneOptions[t]);return s},this.removeScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.removeScene(e)});else{var t=l.indexOf(e);-1=a.start?1:0,d.trigger(\"update\",{startPos:a.start,endPos:a.end,scrollPos:n}),d.progress(t)}else m&&p===f&&C(!0);else l.updateScene(d,!1);return d},this.refresh=function(){return o(),y(),d},this.progress=function(e){if(arguments.length){var t=!1,n=p,r=l?l.info(\"scrollDirection\"):\"PAUSED\",i=h.reverse||g<=e;if(0===h.duration?(t=g!=e,p=0===(g=e<1&&i?0:1)?c:f):e<0&&p!==c&&i?(p=c,t=!(g=0)):0<=e&&e<1&&i?(g=e,p=f,t=!0):1<=e&&p!==u?(g=1,p=u,t=!0):p!==f||i||C(),t){var o={progress:g,state:p,scrollDirection:r},s=p!=n,a=function(e){d.trigger(e,o)};s&&n!==f&&(a(\"enter\"),a(n===c?\"start\":\"end\")),a(\"progress\"),s&&p!==f&&(a(p===c?\"start\":\"end\"),a(\"leave\"))}return d}return g};var m,w,t=function(){a={start:v+h.offset},l&&h.triggerElement&&(a.start-=l.info(\"size\")*h.triggerHook),a.end=a.start+h.duration},o=function(e){if(n){var t=\"duration\";x(t,n.call(d))&&!e&&(d.trigger(\"change\",{what:t,newval:h[t]}),d.trigger(\"shift\",{reason:t}))}},y=function(e){var t=0,n=h.triggerElement;if(l&&(n||0' + $text + '');\n }\n if ($existing_hx !== \"\") {\n $controls.find($existing_hx + ':first-child').attr('tabindex', 0);\n }\n if (typeof $href !== \"undefined\" && $href !== \"\" && $href !== \"#\") {\n $this.attr({\n \"aria-controls\": $href.replace(\"#\", \"\"),\n \"tabindex\": -1,\n \"aria-selected\": \"false\"\n });\n }\n\n $this.removeAttr(\"href\");\n\n });\n });\n\n /* Tabs content ---------------------------------------------------------------------------------------------------- */\n $(\".js-tabcontent\").attr({\n \"role\": \"tabpanel\", // contents\n \"aria-hidden\": \"true\" // all hidden\n //\"tabindex\": 0\n })\n .each(function() {\n var $this = $(this),\n $this_id = $this.attr(\"id\"),\n $prefix_attribute = $(\"#label_\" + $this_id).closest('.js-tablist').attr('data-tabs-prefix-class'),\n $tabs_prefix_classes = typeof $prefix_attribute !== 'undefined' ? $prefix_attribute + '-' : '';\n // label by link\n $this.attr(\"aria-labelledby\", \"label_\" + $this_id);\n\n $this.addClass($tabs_prefix_classes + 'tabs__content');\n });\n\n // search if hash is ON not disabled tab\n if (hash !== \"\" && $(\"#\" + hash + \".js-tabcontent\").length !== 0) {\n if ($(\"#label_\" + hash + \".js-tablist__link:not([aria-disabled='true'])\").length) {\n // display not disabled\n $(\"#\" + hash + \".js-tabcontent\").removeAttr(\"aria-hidden\");\n // selection menu\n $(\"#label_\" + hash + \".js-tablist__link\").attr({\n \"aria-selected\": \"true\",\n \"tabindex\": 0\n });\n }\n\n }\n // search if hash is IN not disabled tab\n if (hash !== \"\" && $(\"#\" + hash).parents('.js-tabcontent').length) {\n var $this_hash = $(\"#\" + hash),\n $tab_content_parent = $this_hash.parents('.js-tabcontent'),\n $tab_content_parent_id = $tab_content_parent.attr('id');\n\n if ($(\"#label_\" + $tab_content_parent_id + \".js-tablist__link:not([aria-disabled='true'])\").length) {\n $tab_content_parent.removeAttr(\"aria-hidden\");\n // selection menu\n $(\"#label_\" + $tab_content_parent_id + \".js-tablist__link\").attr({\n \"aria-selected\": \"true\",\n \"tabindex\": 0\n });\n }\n }\n\n // search if data-selected=\"1\" is on a not disabled tab for each tab system\n $tabs.each(function() {\n var $this = $(this),\n $tab_selected = $this.find('.js-tablist__link[aria-selected=\"true\"]'),\n $tab_data_selected = $this.find('.js-tablist__link[data-selected=\"1\"]:not([aria-disabled=\"true\"]):first'),\n $tab_data_selected_content = $('#' + $tab_data_selected.attr('aria-controls'));\n\n if ($tab_selected.length === 0 && $tab_data_selected.length !== 0) {\n $tab_data_selected.attr({\n \"aria-selected\": \"true\",\n \"tabindex\": 0\n });\n $tab_data_selected_content.removeAttr(\"aria-hidden\");\n }\n });\n\n // if no selected => select first not disabled\n $tabs.each(function() {\n var $this = $(this),\n $tab_selected = $this.find('.js-tablist__link[aria-selected=\"true\"]'),\n $first_link = $this.find('.js-tablist__link:not([aria-disabled=\"true\"]):first'),\n $first_content = $('#' + $first_link.attr('aria-controls'));\n\n if ($tab_selected.length === 0) {\n $first_link.attr({\n \"aria-selected\": \"true\",\n \"tabindex\": 0\n });\n $first_content.removeAttr(\"aria-hidden\");\n }\n });\n\n /* Events ---------------------------------------------------------------------------------------------------------- */\n /* click on a tab link */\n $body.on(\"click\", \".js-tablist__link[aria-disabled='true']\", function() {\n return false;\n });\n $body.on(\"click\", \".js-tablist__link:not([aria-disabled='true'])\", function(event) {\n var $this = $(this),\n $hash_to_update = $this.attr(\"aria-controls\"),\n $tab_content_linked = $(\"#\" + $this.attr(\"aria-controls\")),\n $parent = $this.closest(\".js-tabs\"),\n options = $parent.data(),\n tabs_disable_fragments = typeof options.tabsDisableFragment !== 'undefined' ? true : false,\n $all_tab_links = $parent.find(\".js-tablist__link\"),\n $all_tab_contents = $parent.find(\".js-tabcontent\");\n\n // aria selected false on all links\n $all_tab_links.attr({\n \"tabindex\": -1,\n \"aria-selected\": \"false\"\n });\n\n // add aria selected on $this\n $this.attr({\n \"aria-selected\": \"true\",\n \"tabindex\": 0\n });\n\n // add aria-hidden on all tabs contents\n $all_tab_contents.attr(\"aria-hidden\", \"true\");\n\n // remove aria-hidden on tab linked\n $tab_content_linked.removeAttr(\"aria-hidden\");\n\n // add fragment (timeout for transitions)\n if (tabs_disable_fragments === false) {\n setTimeout(function() {\n history.pushState(null, null, location.pathname + location.search + '#' + $hash_to_update)\n }, 1000);\n }\n\n event.preventDefault();\n })\n /* Key down in tabs */\n .on(\"keydown\", \".js-tablist\", function(event) {\n\n var $parent = $(this).closest('.js-tabs'),\n $activated = $parent.find('.js-tablist__link[aria-selected=\"true\"]').parent(),\n $last_link = $parent.find('.js-tablist__item:last-child .js-tablist__link'),\n $first_link = $parent.find('.js-tablist__item:first-child .js-tablist__link'),\n $focus_on_tab_only = false,\n $prev = $activated,\n $next = $activated;\n\n // search valid previous \n do {\n // if we are on first => activate last\n if ($prev.is(\".js-tablist__item:first-child\")) {\n $prev = $last_link.parent();\n }\n // else previous\n else {\n $prev = $prev.prev();\n }\n }\n while ($prev.children('.js-tablist__link').attr('aria-disabled') === 'true' && $prev !== $activated);\n\n // search valid next\n do {\n // if we are on last => activate first\n if ($next.is(\".js-tablist__item:last-child\")) {\n $next = $first_link.parent();\n }\n // else previous\n else {\n $next = $next.next();\n }\n }\n while ($next.children('.js-tablist__link').attr('aria-disabled') === 'true' && $next !== $activated);\n\n // some event should be activated only if the focus is on tabs (not on tabpanel)\n if ($(document.activeElement).is($parent.find('.js-tablist__link'))) {\n $focus_on_tab_only = true;\n }\n\n // catch keyboard event only if focus is on tab\n if ($focus_on_tab_only && !event.ctrlKey) {\n // strike up or left in the tab\n if (event.keyCode == 37 || event.keyCode == 38) {\n\n $prev.children(\".js-tablist__link\").click().focus();\n\n event.preventDefault();\n }\n // strike down or right in the tab\n else if (event.keyCode == 40 || event.keyCode == 39) {\n\n $next.children(\".js-tablist__link\").click().focus();\n\n event.preventDefault();\n } else if (event.keyCode == 36) {\n // activate first tab\n $first_link.click().focus();\n event.preventDefault();\n } else if (event.keyCode == 35) {\n // activate last tab\n $last_link.click().focus();\n event.preventDefault();\n }\n\n }\n\n })\n .on(\"keydown\", \".js-tabcontent\", function(event) {\n\n var $this = $(this),\n $selector_tab_to_focus = $this.attr('aria-labelledby'),\n $tab_to_focus = $(\"#\" + $selector_tab_to_focus),\n $parent_item = $tab_to_focus.parent(),\n $parent_list = $parent_item.parent(),\n $first_item = $parent_list.find('.js-tablist__item:first-child'),\n $last_item = $parent_list.find('.js-tablist__item:last-child'),\n $prev_item = $parent_item,\n $next_item = $parent_item;\n\n // CTRL up/Left\n if ((event.keyCode == 37 || event.keyCode == 38) && event.ctrlKey) {\n $tab_to_focus.focus();\n event.preventDefault();\n }\n // CTRL PageUp\n if (event.keyCode == 33 && event.ctrlKey) {\n //$tab_to_focus.focus();\n\n // search valid previous \n do {\n // if we are on first => last\n if ($prev_item.is(\".js-tablist__item:first-child\")) {\n $prev_item = $last_item;\n }\n // else previous\n else {\n $prev_item = $prev_item.prev();\n }\n }\n while ($prev_item.children('.js-tablist__link').attr('aria-disabled') === 'true' && $prev_item !== $parent_item);\n\n $prev_item.children(\".js-tablist__link\").click().focus();\n\n event.preventDefault();\n }\n // CTRL PageDown\n if (event.keyCode == 34 && event.ctrlKey) {\n $tab_to_focus.focus();\n\n // search valid next \n do {\n // if we are on last => first\n if ($next_item.is(\".js-tablist__item:last-child\")) {\n $next_item = $first_item;\n }\n // else previous\n else {\n $next_item = $next_item.next();\n }\n }\n while ($next_item.children('.js-tablist__link').attr('aria-disabled') === 'true' && $next_item !== $parent_item);\n\n $next_item.children(\".js-tablist__link\").click().focus();\n\n event.preventDefault();\n }\n\n })\n /* click on a tab link */\n .on(\"click\", \".js-link-to-tab\", function() {\n var $this = $(this),\n $tab_to_go = $($this.attr('href')),\n $button_to_click = $('#' + $tab_to_go.attr('aria-labelledby'));\n\n if ($button_to_click.attr('aria-disabled') !== 'true') {\n // activate tabs\n $button_to_click.click();\n // give focus to the good button\n setTimeout(function() {\n $button_to_click.focus()\n }, 10);\n }\n\n });\n\n }\n\n});\n\n/**\n * bxSlider v4.2.12\n * Copyright 2013-2015 Steven Wanderski\n * Written while drinking Belgian ales and listening to jazz\n * Licensed under MIT (http://opensource.org/licenses/MIT)\n */\n\n;(function($) {\n\n var defaults = {\n\n // GENERAL\n mode: 'horizontal',\n slideSelector: '',\n infiniteLoop: true,\n hideControlOnEnd: false,\n speed: 500,\n easing: null,\n slideMargin: 0,\n startSlide: 0,\n randomStart: false,\n captions: false,\n ticker: false,\n tickerHover: false,\n adaptiveHeight: false,\n adaptiveHeightSpeed: 500,\n video: false,\n useCSS: true,\n preloadImages: 'visible',\n responsive: true,\n slideZIndex: 50,\n wrapperClass: 'bx-wrapper',\n\n // TOUCH\n touchEnabled: true,\n swipeThreshold: 50,\n oneToOneTouch: true,\n preventDefaultSwipeX: true,\n preventDefaultSwipeY: false,\n\n // ACCESSIBILITY\n ariaLive: true,\n ariaHidden: true,\n\n // KEYBOARD\n keyboardEnabled: false,\n\n // PAGER\n pager: true,\n pagerType: 'full',\n pagerShortSeparator: ' / ',\n pagerSelector: null,\n buildPager: null,\n pagerCustom: null,\n\n // CONTROLS\n controls: true,\n nextText: 'Next',\n prevText: 'Prev',\n nextSelector: null,\n prevSelector: null,\n autoControls: false,\n startText: 'Start',\n stopText: 'Stop',\n autoControlsCombine: false,\n autoControlsSelector: null,\n\n // AUTO\n auto: false,\n pause: 4000,\n autoStart: true,\n autoDirection: 'next',\n stopAutoOnClick: false,\n autoHover: false,\n autoDelay: 0,\n autoSlideForOnePage: false,\n\n // CAROUSEL\n minSlides: 1,\n maxSlides: 1,\n moveSlides: 0,\n slideWidth: 0,\n shrinkItems: false,\n\n // CALLBACKS\n onSliderLoad: function() { return true; },\n onSlideBefore: function() { return true; },\n onSlideAfter: function() { return true; },\n onSlideNext: function() { return true; },\n onSlidePrev: function() { return true; },\n onSliderResize: function() { return true; }\n };\n\n $.fn.bxSlider = function(options) {\n\n if (this.length === 0) {\n return this;\n }\n\n // support multiple elements\n if (this.length > 1) {\n this.each(function() {\n $(this).bxSlider(options);\n });\n return this;\n }\n\n // create a namespace to be used throughout the plugin\n var slider = {},\n // set a reference to our slider element\n el = this,\n // get the original window dimens (thanks a lot IE)\n windowWidth = $(window).width(),\n windowHeight = $(window).height();\n\n // Return if slider is already initialized\n if ($(el).data('bxSlider')) { return; }\n\n /**\n * ===================================================================================\n * = PRIVATE FUNCTIONS\n * ===================================================================================\n */\n\n /**\n * Initializes namespace settings to be used throughout plugin\n */\n var init = function() {\n // Return if slider is already initialized\n if ($(el).data('bxSlider')) { return; }\n // merge user-supplied options with the defaults\n slider.settings = $.extend({}, defaults, options);\n // parse slideWidth setting\n slider.settings.slideWidth = parseInt(slider.settings.slideWidth);\n // store the original children\n slider.children = el.children(slider.settings.slideSelector);\n // check if actual number of slides is less than minSlides / maxSlides\n if (slider.children.length < slider.settings.minSlides) { slider.settings.minSlides = slider.children.length; }\n if (slider.children.length < slider.settings.maxSlides) { slider.settings.maxSlides = slider.children.length; }\n // if random start, set the startSlide setting to random number\n if (slider.settings.randomStart) { slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); }\n // store active slide information\n slider.active = { index: slider.settings.startSlide };\n // store if the slider is in carousel mode (displaying / moving multiple slides)\n slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false;\n // if carousel, force preloadImages = 'all'\n if (slider.carousel) { slider.settings.preloadImages = 'all'; }\n // calculate the min / max width thresholds based on min / max number of slides\n // used to setup and update carousel slides dimensions\n slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);\n slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);\n // store the current state of the slider (if currently animating, working is true)\n slider.working = false;\n // initialize the controls object\n slider.controls = {};\n // initialize an auto interval\n slider.interval = null;\n // determine which property to use for transitions\n slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';\n // determine if hardware acceleration can be used\n slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() {\n // create our test div element\n var div = document.createElement('div'),\n // css transition properties\n props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];\n // test for each property\n for (var i = 0; i < props.length; i++) {\n if (div.style[props[i]] !== undefined) {\n slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();\n slider.animProp = '-' + slider.cssPrefix + '-transform';\n return true;\n }\n }\n return false;\n }());\n // if vertical mode always make maxSlides and minSlides equal\n if (slider.settings.mode === 'vertical') { slider.settings.maxSlides = slider.settings.minSlides; }\n // save original style data\n el.data('origStyle', el.attr('style'));\n el.children(slider.settings.slideSelector).each(function() {\n $(this).data('origStyle', $(this).attr('style'));\n });\n\n // perform all DOM / CSS modifications\n setup();\n };\n\n /**\n * Performs all DOM and CSS modifications\n */\n var setup = function() {\n var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible)\n\n // wrap el in a wrapper\n el.wrap('
');\n // store a namespace reference to .bx-viewport\n slider.viewport = el.parent();\n\n // add aria-live if the setting is enabled and ticker mode is disabled\n if (slider.settings.ariaLive && !slider.settings.ticker) {\n slider.viewport.attr('aria-live', 'polite');\n }\n // add a loading div to display while images are loading\n slider.loader = $('
');\n slider.viewport.prepend(slider.loader);\n // set el to a massive width, to hold any needed slides\n // also strip any margin and padding from el\n el.css({\n width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',\n position: 'relative'\n });\n // if using CSS, add the easing property\n if (slider.usingCSS && slider.settings.easing) {\n el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);\n // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)\n } else if (!slider.settings.easing) {\n slider.settings.easing = 'swing';\n }\n // make modifications to the viewport (.bx-viewport)\n slider.viewport.css({\n width: '100%',\n overflow: 'hidden',\n position: 'relative'\n });\n slider.viewport.parent().css({\n maxWidth: getViewportMaxWidth()\n });\n // apply css to all slider children\n slider.children.css({\n float: slider.settings.mode === 'horizontal' ? 'left' : 'none',\n listStyle: 'none',\n position: 'relative'\n });\n // apply the calculated width after the float is applied to prevent scrollbar interference\n slider.children.css('width', getSlideWidth());\n // if slideMargin is supplied, add the css\n if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) { slider.children.css('marginRight', slider.settings.slideMargin); }\n if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) { slider.children.css('marginBottom', slider.settings.slideMargin); }\n // if \"fade\" mode, add positioning and z-index CSS\n if (slider.settings.mode === 'fade') {\n slider.children.css({\n position: 'absolute',\n zIndex: 0,\n display: 'none'\n });\n // prepare the z-index on the showing element\n slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});\n }\n // create an element to contain all slider controls (pager, start / stop, etc)\n slider.controls.el = $('
');\n // if captions are requested, add them\n if (slider.settings.captions) { appendCaptions(); }\n // check if startSlide is last slide\n slider.active.last = slider.settings.startSlide === getPagerQty() - 1;\n // if video is true, set up the fitVids plugin\n if (slider.settings.video) { el.fitVids(); }\n if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { preloadSelector = slider.children; }\n // only check for control addition if not in \"ticker\" mode\n if (!slider.settings.ticker) {\n // if controls are requested, add them\n if (slider.settings.controls) { appendControls(); }\n // if auto is true, and auto controls are requested, add them\n if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); }\n // if pager is requested, add it\n if (slider.settings.pager) { appendPager(); }\n // if any control option is requested, add the controls wrapper\n if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); }\n // if ticker mode, do not allow a pager\n } else {\n slider.settings.pager = false;\n }\n loadElements(preloadSelector, start);\n };\n\n var loadElements = function(selector, callback) {\n var total = selector.find('img:not([src=\"\"]), iframe').length,\n count = 0;\n if (total === 0) {\n callback();\n return;\n }\n selector.find('img:not([src=\"\"]), iframe').each(function() {\n $(this).one('load error', function() {\n if (++count === total) { callback(); }\n }).each(function() {\n if (this.complete) { $(this).trigger('load'); }\n });\n });\n };\n\n /**\n * Start the slider\n */\n var start = function() {\n // if infinite loop, prepare additional slides\n if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) {\n var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides,\n sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'),\n slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone');\n if (slider.settings.ariaHidden) {\n sliceAppend.attr('aria-hidden', true);\n slicePrepend.attr('aria-hidden', true);\n }\n el.append(sliceAppend).prepend(slicePrepend);\n }\n // remove the loading DOM element\n slider.loader.remove();\n // set the left / top position of \"el\"\n setSlidePosition();\n // if \"vertical\" mode, always use adaptiveHeight to prevent odd behavior\n if (slider.settings.mode === 'vertical') { slider.settings.adaptiveHeight = true; }\n // set the viewport height\n slider.viewport.height(getViewportHeight());\n // make sure everything is positioned just right (same as a window resize)\n el.redrawSlider();\n // onSliderLoad callback\n slider.settings.onSliderLoad.call(el, slider.active.index);\n // slider has been fully initialized\n slider.initialized = true;\n // bind the resize call to the window\n if (slider.settings.responsive) { $(window).bind('resize', resizeWindow); }\n // if auto is true and has more than 1 page, start the show\n if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); }\n // if ticker is true, start the ticker\n if (slider.settings.ticker) { initTicker(); }\n // if pager is requested, make the appropriate pager link active\n if (slider.settings.pager) { updatePagerActive(slider.settings.startSlide); }\n // check for any updates to the controls (like hideControlOnEnd updates)\n if (slider.settings.controls) { updateDirectionControls(); }\n // if touchEnabled is true, setup the touch events\n if (slider.settings.touchEnabled && !slider.settings.ticker) { initTouch(); }\n // if keyboardEnabled is true, setup the keyboard events\n if (slider.settings.keyboardEnabled && !slider.settings.ticker) {\n $(document).keydown(keyPress);\n }\n };\n\n /**\n * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value\n */\n var getViewportHeight = function() {\n var height = 0;\n // first determine which children (slides) should be used in our height calculation\n var children = $();\n // if mode is not \"vertical\" and adaptiveHeight is false, include all children\n if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) {\n children = slider.children;\n } else {\n // if not carousel, return the single active child\n if (!slider.carousel) {\n children = slider.children.eq(slider.active.index);\n // if carousel, return a slice of children\n } else {\n // get the individual slide index\n var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();\n // add the current slide to the children\n children = slider.children.eq(currentIndex);\n // cycle through the remaining \"showing\" slides\n for (i = 1; i <= slider.settings.maxSlides - 1; i++) {\n // if looped back to the start\n if (currentIndex + i >= slider.children.length) {\n children = children.add(slider.children.eq(i - 1));\n } else {\n children = children.add(slider.children.eq(currentIndex + i));\n }\n }\n }\n }\n // if \"vertical\" mode, calculate the sum of the heights of the children\n if (slider.settings.mode === 'vertical') {\n children.each(function(index) {\n height += $(this).outerHeight();\n });\n // add user-supplied margins\n if (slider.settings.slideMargin > 0) {\n height += slider.settings.slideMargin * (slider.settings.minSlides - 1);\n }\n // if not \"vertical\" mode, calculate the max height of the children\n } else {\n height = Math.max.apply(Math, children.map(function() {\n return $(this).outerHeight(false);\n }).get());\n }\n\n if (slider.viewport.css('box-sizing') === 'border-box') {\n height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +\n parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));\n } else if (slider.viewport.css('box-sizing') === 'padding-box') {\n height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));\n }\n\n return height;\n };\n\n /**\n * Returns the calculated width to be used for the outer wrapper / viewport\n */\n var getViewportMaxWidth = function() {\n var width = '100%';\n if (slider.settings.slideWidth > 0) {\n if (slider.settings.mode === 'horizontal') {\n width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);\n } else {\n width = slider.settings.slideWidth;\n }\n }\n return width;\n };\n\n /**\n * Returns the calculated width to be applied to each slide\n */\n var getSlideWidth = function() {\n var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width\n wrapWidth = slider.viewport.width(); // get the current viewport width\n // if slide width was not supplied, or is larger than the viewport use the viewport width\n if (slider.settings.slideWidth === 0 ||\n (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||\n slider.settings.mode === 'vertical') {\n newElWidth = wrapWidth;\n // if carousel, use the thresholds to determine the width\n } else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') {\n if (wrapWidth > slider.maxThreshold) {\n return newElWidth;\n } else if (wrapWidth < slider.minThreshold) {\n newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;\n } else if (slider.settings.shrinkItems) {\n newElWidth = Math.floor((wrapWidth + slider.settings.slideMargin) / (Math.ceil((wrapWidth + slider.settings.slideMargin) / (newElWidth + slider.settings.slideMargin))) - slider.settings.slideMargin);\n }\n }\n return newElWidth;\n };\n\n /**\n * Returns the number of slides currently visible in the viewport (includes partially visible slides)\n */\n var getNumberSlidesShowing = function() {\n var slidesShowing = 1,\n childWidth = null;\n if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) {\n // if viewport is smaller than minThreshold, return minSlides\n if (slider.viewport.width() < slider.minThreshold) {\n slidesShowing = slider.settings.minSlides;\n // if viewport is larger than maxThreshold, return maxSlides\n } else if (slider.viewport.width() > slider.maxThreshold) {\n slidesShowing = slider.settings.maxSlides;\n // if viewport is between min / max thresholds, divide viewport width by first child width\n } else {\n childWidth = slider.children.first().width() + slider.settings.slideMargin;\n slidesShowing = Math.floor((slider.viewport.width() +\n slider.settings.slideMargin) / childWidth);\n }\n // if \"vertical\" mode, slides showing will always be minSlides\n } else if (slider.settings.mode === 'vertical') {\n slidesShowing = slider.settings.minSlides;\n }\n return slidesShowing;\n };\n\n /**\n * Returns the number of pages (one full viewport of slides is one \"page\")\n */\n var getPagerQty = function() {\n var pagerQty = 0,\n breakPoint = 0,\n counter = 0;\n // if moveSlides is specified by the user\n if (slider.settings.moveSlides > 0) {\n if (slider.settings.infiniteLoop) {\n pagerQty = Math.ceil(slider.children.length / getMoveBy());\n } else {\n // when breakpoint goes above children length, counter is the number of pages\n while (breakPoint < slider.children.length) {\n ++pagerQty;\n breakPoint = counter + getNumberSlidesShowing();\n counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();\n }\n }\n // if moveSlides is 0 (auto) divide children length by sides showing, then round up\n } else {\n pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());\n }\n return pagerQty;\n };\n\n /**\n * Returns the number of individual slides by which to shift the slider\n */\n var getMoveBy = function() {\n // if moveSlides was set by the user and moveSlides is less than number of slides showing\n if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) {\n return slider.settings.moveSlides;\n }\n // if moveSlides is 0 (auto)\n return getNumberSlidesShowing();\n };\n\n /**\n * Sets the slider's (el) left or top position\n */\n var setSlidePosition = function() {\n var position, lastChild, lastShowingIndex;\n // if last slide, not infinite loop, and number of children is larger than specified maxSlides\n if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {\n if (slider.settings.mode === 'horizontal') {\n // get the last child's position\n lastChild = slider.children.last();\n position = lastChild.position();\n // set the left position\n setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);\n } else if (slider.settings.mode === 'vertical') {\n // get the last showing index's position\n lastShowingIndex = slider.children.length - slider.settings.minSlides;\n position = slider.children.eq(lastShowingIndex).position();\n // set the top position\n setPositionProperty(-position.top, 'reset', 0);\n }\n // if not last slide\n } else {\n // get the position of the first showing slide\n position = slider.children.eq(slider.active.index * getMoveBy()).position();\n // check for last slide\n if (slider.active.index === getPagerQty() - 1) { slider.active.last = true; }\n // set the respective position\n if (position !== undefined) {\n if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }\n else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }\n }\n }\n };\n\n /**\n * Sets the el's animating property position (which in turn will sometimes animate el).\n * If using CSS, sets the transform property. If not using CSS, sets the top / left property.\n *\n * @param value (int)\n * - the animating property's value\n *\n * @param type (string) 'slide', 'reset', 'ticker'\n * - the type of instance for which the function is being\n *\n * @param duration (int)\n * - the amount of time (in ms) the transition should occupy\n *\n * @param params (array) optional\n * - an optional parameter containing any variables that need to be passed in\n */\n var setPositionProperty = function(value, type, duration, params) {\n var animateObj, propValue;\n // use CSS transform\n if (slider.usingCSS) {\n // determine the translate3d value\n propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';\n // add the CSS transition-duration\n el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');\n if (type === 'slide') {\n // set the property value\n el.css(slider.animProp, propValue);\n if (duration !== 0) {\n // bind a callback method - executes when CSS transition completes\n el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {\n //make sure it's the correct one\n if (!$(e.target).is(el)) { return; }\n // unbind the callback\n el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');\n updateAfterSlideTransition();\n });\n } else { //duration = 0\n updateAfterSlideTransition();\n }\n } else if (type === 'reset') {\n el.css(slider.animProp, propValue);\n } else if (type === 'ticker') {\n // make the transition use 'linear'\n el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');\n el.css(slider.animProp, propValue);\n if (duration !== 0) {\n el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {\n //make sure it's the correct one\n if (!$(e.target).is(el)) { return; }\n // unbind the callback\n el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');\n // reset the position\n setPositionProperty(params.resetValue, 'reset', 0);\n // start the loop again\n tickerLoop();\n });\n } else { //duration = 0\n setPositionProperty(params.resetValue, 'reset', 0);\n tickerLoop();\n }\n }\n // use JS animate\n } else {\n animateObj = {};\n animateObj[slider.animProp] = value;\n if (type === 'slide') {\n el.animate(animateObj, duration, slider.settings.easing, function() {\n updateAfterSlideTransition();\n });\n } else if (type === 'reset') {\n el.css(slider.animProp, value);\n } else if (type === 'ticker') {\n el.animate(animateObj, duration, 'linear', function() {\n setPositionProperty(params.resetValue, 'reset', 0);\n // run the recursive loop after animation\n tickerLoop();\n });\n }\n }\n };\n\n /**\n * Populates the pager with proper amount of pages\n */\n var populatePager = function() {\n var pagerHtml = '',\n linkContent = '',\n pagerQty = getPagerQty();\n // loop through each pager item\n for (var i = 0; i < pagerQty; i++) {\n linkContent = '';\n // if a buildPager function is supplied, use it to get pager link value, else use index + 1\n if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) {\n linkContent = slider.settings.buildPager(i);\n slider.pagerEl.addClass('bx-custom-pager');\n } else {\n linkContent = i + 1;\n slider.pagerEl.addClass('bx-default-pager');\n }\n // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;\n // add the markup to the string\n pagerHtml += '';\n }\n // populate the pager element with pager links\n slider.pagerEl.html(pagerHtml);\n };\n\n /**\n * Appends the pager to the controls element\n */\n var appendPager = function() {\n if (!slider.settings.pagerCustom) {\n // create the pager DOM element\n slider.pagerEl = $('
');\n // if a pager selector was supplied, populate it with the pager\n if (slider.settings.pagerSelector) {\n $(slider.settings.pagerSelector).html(slider.pagerEl);\n // if no pager selector was supplied, add it after the wrapper\n } else {\n slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);\n }\n // populate the pager\n populatePager();\n } else {\n slider.pagerEl = $(slider.settings.pagerCustom);\n }\n // assign the pager click binding\n slider.pagerEl.on('click touchend', 'a', clickPagerBind);\n };\n\n /**\n * Appends prev / next controls to the controls element\n */\n var appendControls = function() {\n slider.controls.next = $('' + slider.settings.nextText + '');\n slider.controls.prev = $('' + slider.settings.prevText + '');\n // bind click actions to the controls\n slider.controls.next.bind('click touchend', clickNextBind);\n slider.controls.prev.bind('click touchend', clickPrevBind);\n // if nextSelector was supplied, populate it\n if (slider.settings.nextSelector) {\n $(slider.settings.nextSelector).append(slider.controls.next);\n }\n // if prevSelector was supplied, populate it\n if (slider.settings.prevSelector) {\n $(slider.settings.prevSelector).append(slider.controls.prev);\n }\n // if no custom selectors were supplied\n if (!slider.settings.nextSelector && !slider.settings.prevSelector) {\n // add the controls to the DOM\n slider.controls.directionEl = $('
');\n // add the control elements to the directionEl\n slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);\n // slider.viewport.append(slider.controls.directionEl);\n slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);\n }\n };\n\n /**\n * Appends start / stop auto controls to the controls element\n */\n var appendControlsAuto = function() {\n slider.controls.start = $('');\n slider.controls.stop = $('');\n // add the controls to the DOM\n slider.controls.autoEl = $('
');\n // bind click actions to the controls\n slider.controls.autoEl.on('click', '.bx-start', clickStartBind);\n slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);\n // if autoControlsCombine, insert only the \"start\" control\n if (slider.settings.autoControlsCombine) {\n slider.controls.autoEl.append(slider.controls.start);\n // if autoControlsCombine is false, insert both controls\n } else {\n slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);\n }\n // if auto controls selector was supplied, populate it with the controls\n if (slider.settings.autoControlsSelector) {\n $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);\n // if auto controls selector was not supplied, add it after the wrapper\n } else {\n slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);\n }\n // update the auto controls\n updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');\n };\n\n /**\n * Appends image captions to the DOM\n */\n var appendCaptions = function() {\n // cycle through each child\n slider.children.each(function(index) {\n // get the image title attribute\n var title = $(this).find('img:first').attr('title');\n // append the caption\n if (title !== undefined && ('' + title).length) {\n $(this).append('
' + title + '
');\n }\n });\n };\n\n /**\n * Click next binding\n *\n * @param e (event)\n * - DOM event object\n */\n var clickNextBind = function(e) {\n e.preventDefault();\n if (slider.controls.el.hasClass('disabled')) { return; }\n // if auto show is running, stop it\n if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }\n el.goToNextSlide();\n };\n\n /**\n * Click prev binding\n *\n * @param e (event)\n * - DOM event object\n */\n var clickPrevBind = function(e) {\n e.preventDefault();\n if (slider.controls.el.hasClass('disabled')) { return; }\n // if auto show is running, stop it\n if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }\n el.goToPrevSlide();\n };\n\n /**\n * Click start binding\n *\n * @param e (event)\n * - DOM event object\n */\n var clickStartBind = function(e) {\n el.startAuto();\n e.preventDefault();\n };\n\n /**\n * Click stop binding\n *\n * @param e (event)\n * - DOM event object\n */\n var clickStopBind = function(e) {\n el.stopAuto();\n e.preventDefault();\n };\n\n /**\n * Click pager binding\n *\n * @param e (event)\n * - DOM event object\n */\n var clickPagerBind = function(e) {\n var pagerLink, pagerIndex;\n e.preventDefault();\n if (slider.controls.el.hasClass('disabled')) {\n return;\n }\n // if auto show is running, stop it\n if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }\n pagerLink = $(e.currentTarget);\n if (pagerLink.attr('data-slide-index') !== undefined) {\n pagerIndex = parseInt(pagerLink.attr('data-slide-index'));\n // if clicked pager link is not active, continue with the goToSlide call\n if (pagerIndex !== slider.active.index) { el.goToSlide(pagerIndex); }\n }\n };\n\n /**\n * Updates the pager links with an active class\n *\n * @param slideIndex (int)\n * - index of slide to make active\n */\n var updatePagerActive = function(slideIndex) {\n // if \"short\" pager type\n var len = slider.children.length; // nb of children\n if (slider.settings.pagerType === 'short') {\n if (slider.settings.maxSlides > 1) {\n len = Math.ceil(slider.children.length / slider.settings.maxSlides);\n }\n slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len);\n return;\n }\n // remove all pager active classes\n slider.pagerEl.find('a').removeClass('active');\n // apply the active class for all pagers\n slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });\n };\n\n /**\n * Performs needed actions after a slide transition\n */\n var updateAfterSlideTransition = function() {\n // if infinite loop is true\n if (slider.settings.infiniteLoop) {\n var position = '';\n // first slide\n if (slider.active.index === 0) {\n // set the new position\n position = slider.children.eq(0).position();\n // carousel, last slide\n } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) {\n position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();\n // last slide\n } else if (slider.active.index === slider.children.length - 1) {\n position = slider.children.eq(slider.children.length - 1).position();\n }\n if (position) {\n if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }\n else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }\n }\n }\n // declare that the transition is complete\n slider.working = false;\n // onSlideAfter callback\n slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);\n };\n\n /**\n * Updates the auto controls state (either active, or combined switch)\n *\n * @param state (string) \"start\", \"stop\"\n * - the new state of the auto show\n */\n var updateAutoControls = function(state) {\n // if autoControlsCombine is true, replace the current control with the new state\n if (slider.settings.autoControlsCombine) {\n slider.controls.autoEl.html(slider.controls[state]);\n // if autoControlsCombine is false, apply the \"active\" class to the appropriate control\n } else {\n slider.controls.autoEl.find('a').removeClass('active');\n slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');\n }\n };\n\n /**\n * Updates the direction controls (checks if either should be hidden)\n */\n var updateDirectionControls = function() {\n if (getPagerQty() === 1) {\n slider.controls.prev.addClass('disabled');\n slider.controls.next.addClass('disabled');\n } else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {\n // if first slide\n if (slider.active.index === 0) {\n slider.controls.prev.addClass('disabled');\n slider.controls.next.removeClass('disabled');\n // if last slide\n } else if (slider.active.index === getPagerQty() - 1) {\n slider.controls.next.addClass('disabled');\n slider.controls.prev.removeClass('disabled');\n // if any slide in the middle\n } else {\n slider.controls.prev.removeClass('disabled');\n slider.controls.next.removeClass('disabled');\n }\n }\n };\n\n /**\n * Initializes the auto process\n */\n var initAuto = function() {\n // if autoDelay was supplied, launch the auto show using a setTimeout() call\n if (slider.settings.autoDelay > 0) {\n var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);\n // if autoDelay was not supplied, start the auto show normally\n } else {\n el.startAuto();\n\n //add focus and blur events to ensure its running if timeout gets paused\n $(window).focus(function() {\n el.startAuto();\n }).blur(function() {\n el.stopAuto();\n });\n }\n // if autoHover is requested\n if (slider.settings.autoHover) {\n // on el hover\n el.hover(function() {\n // if the auto show is currently playing (has an active interval)\n if (slider.interval) {\n // stop the auto show and pass true argument which will prevent control update\n el.stopAuto(true);\n // create a new autoPaused value which will be used by the relative \"mouseout\" event\n slider.autoPaused = true;\n }\n }, function() {\n // if the autoPaused value was created be the prior \"mouseover\" event\n if (slider.autoPaused) {\n // start the auto show and pass true argument which will prevent control update\n el.startAuto(true);\n // reset the autoPaused value\n slider.autoPaused = null;\n }\n });\n }\n };\n\n /**\n * Initializes the ticker process\n */\n var initTicker = function() {\n var startPosition = 0,\n position, transform, value, idx, ratio, property, newSpeed, totalDimens;\n // if autoDirection is \"next\", append a clone of the entire slider\n if (slider.settings.autoDirection === 'next') {\n el.append(slider.children.clone().addClass('bx-clone'));\n // if autoDirection is \"prev\", prepend a clone of the entire slider, and set the left position\n } else {\n el.prepend(slider.children.clone().addClass('bx-clone'));\n position = slider.children.first().position();\n startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top;\n }\n setPositionProperty(startPosition, 'reset', 0);\n // do not allow controls in ticker mode\n slider.settings.pager = false;\n slider.settings.controls = false;\n slider.settings.autoControls = false;\n // if autoHover is requested\n if (slider.settings.tickerHover) {\n if (slider.usingCSS) {\n idx = slider.settings.mode === 'horizontal' ? 4 : 5;\n slider.viewport.hover(function() {\n transform = el.css('-' + slider.cssPrefix + '-transform');\n value = parseFloat(transform.split(',')[idx]);\n setPositionProperty(value, 'reset', 0);\n }, function() {\n totalDimens = 0;\n slider.children.each(function(index) {\n totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);\n });\n // calculate the speed ratio (used to determine the new speed to finish the paused animation)\n ratio = slider.settings.speed / totalDimens;\n // determine which property to use\n property = slider.settings.mode === 'horizontal' ? 'left' : 'top';\n // calculate the new speed\n newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value))));\n tickerLoop(newSpeed);\n });\n } else {\n // on el hover\n slider.viewport.hover(function() {\n el.stop();\n }, function() {\n // calculate the total width of children (used to calculate the speed ratio)\n totalDimens = 0;\n slider.children.each(function(index) {\n totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);\n });\n // calculate the speed ratio (used to determine the new speed to finish the paused animation)\n ratio = slider.settings.speed / totalDimens;\n // determine which property to use\n property = slider.settings.mode === 'horizontal' ? 'left' : 'top';\n // calculate the new speed\n newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));\n tickerLoop(newSpeed);\n });\n }\n }\n // start the ticker loop\n tickerLoop();\n };\n\n /**\n * Runs a continuous loop, news ticker-style\n */\n var tickerLoop = function(resumeSpeed) {\n var speed = resumeSpeed ? resumeSpeed : slider.settings.speed,\n position = {left: 0, top: 0},\n reset = {left: 0, top: 0},\n animateProperty, resetValue, params;\n\n // if \"next\" animate left position to last child, then reset left to 0\n if (slider.settings.autoDirection === 'next') {\n position = el.find('.bx-clone').first().position();\n // if \"prev\" animate left position to 0, then reset left to first non-clone child\n } else {\n reset = slider.children.first().position();\n }\n animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top;\n resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top;\n params = {resetValue: resetValue};\n setPositionProperty(animateProperty, 'ticker', speed, params);\n };\n\n /**\n * Check if el is on screen\n */\n var isOnScreen = function(el) {\n var win = $(window),\n viewport = {\n top: win.scrollTop(),\n left: win.scrollLeft()\n },\n bounds = el.offset();\n\n viewport.right = viewport.left + win.width();\n viewport.bottom = viewport.top + win.height();\n bounds.right = bounds.left + el.outerWidth();\n bounds.bottom = bounds.top + el.outerHeight();\n\n return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));\n };\n\n /**\n * Initializes keyboard events\n */\n var keyPress = function(e) {\n var activeElementTag = document.activeElement.tagName.toLowerCase(),\n tagFilters = 'input|textarea',\n p = new RegExp(activeElementTag,['i']),\n result = p.exec(tagFilters);\n\n if (result == null && isOnScreen(el)) {\n if (e.keyCode === 39) {\n clickNextBind(e);\n return false;\n } else if (e.keyCode === 37) {\n clickPrevBind(e);\n return false;\n }\n }\n };\n\n /**\n * Initializes touch events\n */\n var initTouch = function() {\n // initialize object to contain all touch values\n slider.touch = {\n start: {x: 0, y: 0},\n end: {x: 0, y: 0}\n };\n slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart);\n\n //for browsers that have implemented pointer events and fire a click after\n //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not\n slider.viewport.on('click', '.bxslider a', function(e) {\n if (slider.viewport.hasClass('click-disabled')) {\n e.preventDefault();\n slider.viewport.removeClass('click-disabled');\n }\n });\n };\n\n /**\n * Event handler for \"touchstart\"\n *\n * @param e (event)\n * - DOM event object\n */\n var onTouchStart = function(e) {\n //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls\n slider.controls.el.addClass('disabled');\n\n if (slider.working) {\n e.preventDefault();\n slider.controls.el.removeClass('disabled');\n } else {\n // record the original position when touch starts\n slider.touch.originalPos = el.position();\n var orig = e.originalEvent,\n touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];\n // record the starting touch x, y coordinates\n slider.touch.start.x = touchPoints[0].pageX;\n slider.touch.start.y = touchPoints[0].pageY;\n\n if (slider.viewport.get(0).setPointerCapture) {\n slider.pointerId = orig.pointerId;\n slider.viewport.get(0).setPointerCapture(slider.pointerId);\n }\n // bind a \"touchmove\" event to the viewport\n slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove);\n // bind a \"touchend\" event to the viewport\n slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd);\n slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel);\n }\n };\n\n /**\n * Cancel Pointer for Windows Phone\n *\n * @param e (event)\n * - DOM event object\n */\n var onPointerCancel = function(e) {\n /* onPointerCancel handler is needed to deal with situations when a touchend\n doesn't fire after a touchstart (this happens on windows phones only) */\n setPositionProperty(slider.touch.originalPos.left, 'reset', 0);\n\n //remove handlers\n slider.controls.el.removeClass('disabled');\n slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel);\n slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);\n slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);\n if (slider.viewport.get(0).releasePointerCapture) {\n slider.viewport.get(0).releasePointerCapture(slider.pointerId);\n }\n };\n\n /**\n * Event handler for \"touchmove\"\n *\n * @param e (event)\n * - DOM event object\n */\n var onTouchMove = function(e) {\n var orig = e.originalEvent,\n touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],\n // if scrolling on y axis, do not prevent default\n xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x),\n yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y),\n value = 0,\n change = 0;\n\n // x axis swipe\n if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) {\n e.preventDefault();\n // y axis swipe\n } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) {\n e.preventDefault();\n }\n if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) {\n // if horizontal, drag along x axis\n if (slider.settings.mode === 'horizontal') {\n change = touchPoints[0].pageX - slider.touch.start.x;\n value = slider.touch.originalPos.left + change;\n // if vertical, drag along y axis\n } else {\n change = touchPoints[0].pageY - slider.touch.start.y;\n value = slider.touch.originalPos.top + change;\n }\n setPositionProperty(value, 'reset', 0);\n }\n };\n\n /**\n * Event handler for \"touchend\"\n *\n * @param e (event)\n * - DOM event object\n */\n var onTouchEnd = function(e) {\n slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);\n //enable slider controls as soon as user stops interacing with slides\n slider.controls.el.removeClass('disabled');\n var orig = e.originalEvent,\n touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],\n value = 0,\n distance = 0;\n // record end x, y positions\n slider.touch.end.x = touchPoints[0].pageX;\n slider.touch.end.y = touchPoints[0].pageY;\n // if fade mode, check if absolute x distance clears the threshold\n if (slider.settings.mode === 'fade') {\n distance = Math.abs(slider.touch.start.x - slider.touch.end.x);\n if (distance >= slider.settings.swipeThreshold) {\n if (slider.touch.start.x > slider.touch.end.x) {\n el.goToNextSlide();\n } else {\n el.goToPrevSlide();\n }\n el.stopAuto();\n }\n // not fade mode\n } else {\n // calculate distance and el's animate property\n if (slider.settings.mode === 'horizontal') {\n distance = slider.touch.end.x - slider.touch.start.x;\n value = slider.touch.originalPos.left;\n } else {\n distance = slider.touch.end.y - slider.touch.start.y;\n value = slider.touch.originalPos.top;\n }\n // if not infinite loop and first / last slide, do not attempt a slide transition\n if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) {\n setPositionProperty(value, 'reset', 200);\n } else {\n // check if distance clears threshold\n if (Math.abs(distance) >= slider.settings.swipeThreshold) {\n if (distance < 0) {\n el.goToNextSlide();\n } else {\n el.goToPrevSlide();\n }\n el.stopAuto();\n } else {\n // el.animate(property, 200);\n setPositionProperty(value, 'reset', 200);\n }\n }\n }\n slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);\n if (slider.viewport.get(0).releasePointerCapture) {\n slider.viewport.get(0).releasePointerCapture(slider.pointerId);\n }\n };\n\n /**\n * Window resize event callback\n */\n var resizeWindow = function(e) {\n // don't do anything if slider isn't initialized.\n if (!slider.initialized) { return; }\n // Delay if slider working.\n if (slider.working) {\n window.setTimeout(resizeWindow, 10);\n } else {\n // get the new window dimens (again, thank you IE)\n var windowWidthNew = $(window).width(),\n windowHeightNew = $(window).height();\n // make sure that it is a true window resize\n // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements\n // are resized. Can you just die already?*\n if (windowWidth !== windowWidthNew || windowHeight !== windowHeightNew) {\n // set the new window dimens\n windowWidth = windowWidthNew;\n windowHeight = windowHeightNew;\n // update all dynamic elements\n el.redrawSlider();\n // Call user resize handler\n slider.settings.onSliderResize.call(el, slider.active.index);\n }\n }\n };\n\n /**\n * Adds an aria-hidden=true attribute to each element\n *\n * @param startVisibleIndex (int)\n * - the first visible element's index\n */\n var applyAriaHiddenAttributes = function(startVisibleIndex) {\n var numberOfSlidesShowing = getNumberSlidesShowing();\n // only apply attributes if the setting is enabled and not in ticker mode\n if (slider.settings.ariaHidden && !slider.settings.ticker) {\n // add aria-hidden=true to all elements\n slider.children.attr('aria-hidden', 'true');\n // get the visible elements and change to aria-hidden=false\n slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false');\n }\n };\n\n /**\n * Returns index according to present page range\n *\n * @param slideOndex (int)\n * - the desired slide index\n */\n var setSlideIndex = function(slideIndex) {\n if (slideIndex < 0) {\n if (slider.settings.infiniteLoop) {\n return getPagerQty() - 1;\n }else {\n //we don't go to undefined slides\n return slider.active.index;\n }\n // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)\n } else if (slideIndex >= getPagerQty()) {\n if (slider.settings.infiniteLoop) {\n return 0;\n } else {\n //we don't move to undefined pages\n return slider.active.index;\n }\n // set active index to requested slide\n } else {\n return slideIndex;\n }\n };\n\n /**\n * ===================================================================================\n * = PUBLIC FUNCTIONS\n * ===================================================================================\n */\n\n /**\n * Performs slide transition to the specified slide\n *\n * @param slideIndex (int)\n * - the destination slide's index (zero-based)\n *\n * @param direction (string)\n * - INTERNAL USE ONLY - the direction of travel (\"prev\" / \"next\")\n */\n el.goToSlide = function(slideIndex, direction) {\n // onSlideBefore, onSlideNext, onSlidePrev callbacks\n // Allow transition canceling based on returned value\n var performTransition = true,\n moveBy = 0,\n position = {left: 0, top: 0},\n lastChild = null,\n lastShowingIndex, eq, value, requestEl;\n // store the old index\n slider.oldIndex = slider.active.index;\n //set new index\n slider.active.index = setSlideIndex(slideIndex);\n\n // if plugin is currently in motion, ignore request\n if (slider.working || slider.active.index === slider.oldIndex) { return; }\n // declare that plugin is in motion\n slider.working = true;\n\n performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);\n\n // If transitions canceled, reset and return\n if (typeof (performTransition) !== 'undefined' && !performTransition) {\n slider.active.index = slider.oldIndex; // restore old index\n slider.working = false; // is not in motion\n return;\n }\n\n if (direction === 'next') {\n // Prevent canceling in future functions or lack there-of from negating previous commands to cancel\n if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {\n performTransition = false;\n }\n } else if (direction === 'prev') {\n // Prevent canceling in future functions or lack there-of from negating previous commands to cancel\n if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {\n performTransition = false;\n }\n }\n\n // check if last slide\n slider.active.last = slider.active.index >= getPagerQty() - 1;\n // update the pager with active class\n if (slider.settings.pager || slider.settings.pagerCustom) { updatePagerActive(slider.active.index); }\n // // check for direction control update\n if (slider.settings.controls) { updateDirectionControls(); }\n // if slider is set to mode: \"fade\"\n if (slider.settings.mode === 'fade') {\n // if adaptiveHeight is true and next height is different from current height, animate to the new height\n if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {\n slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);\n }\n // fade out the visible child and reset its z-index value\n slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});\n // fade in the newly requested slide\n slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function() {\n $(this).css('zIndex', slider.settings.slideZIndex);\n updateAfterSlideTransition();\n });\n // slider mode is not \"fade\"\n } else {\n // if adaptiveHeight is true and next height is different from current height, animate to the new height\n if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {\n slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);\n }\n // if carousel and not infinite loop\n if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {\n if (slider.settings.mode === 'horizontal') {\n // get the last child position\n lastChild = slider.children.eq(slider.children.length - 1);\n position = lastChild.position();\n // calculate the position of the last slide\n moveBy = slider.viewport.width() - lastChild.outerWidth();\n } else {\n // get last showing index position\n lastShowingIndex = slider.children.length - slider.settings.minSlides;\n position = slider.children.eq(lastShowingIndex).position();\n }\n // horizontal carousel, going previous while on first slide (infiniteLoop mode)\n } else if (slider.carousel && slider.active.last && direction === 'prev') {\n // get the last child position\n eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);\n lastChild = el.children('.bx-clone').eq(eq);\n position = lastChild.position();\n // if infinite loop and \"Next\" is clicked on the last slide\n } else if (direction === 'next' && slider.active.index === 0) {\n // get the last clone position\n position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();\n slider.active.last = false;\n // normal non-zero requests\n } else if (slideIndex >= 0) {\n //parseInt is applied to allow floats for slides/page\n requestEl = slideIndex * parseInt(getMoveBy());\n position = slider.children.eq(requestEl).position();\n }\n\n /* If the position doesn't exist\n * (e.g. if you destroy the slider on a next click),\n * it doesn't throw an error.\n */\n if (typeof (position) !== 'undefined') {\n value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;\n // plugin values to be animated\n setPositionProperty(value, 'slide', slider.settings.speed);\n } else {\n slider.working = false;\n }\n }\n if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }\n };\n\n /**\n * Transitions to the next slide in the show\n */\n el.goToNextSlide = function() {\n // if infiniteLoop is false and last page is showing, disregard call\n if (!slider.settings.infiniteLoop && slider.active.last) { return; }\n var pagerIndex = parseInt(slider.active.index) + 1;\n el.goToSlide(pagerIndex, 'next');\n };\n\n /**\n * Transitions to the prev slide in the show\n */\n el.goToPrevSlide = function() {\n // if infiniteLoop is false and last page is showing, disregard call\n if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; }\n var pagerIndex = parseInt(slider.active.index) - 1;\n el.goToSlide(pagerIndex, 'prev');\n };\n\n /**\n * Starts the auto show\n *\n * @param preventControlUpdate (boolean)\n * - if true, auto controls state will not be updated\n */\n el.startAuto = function(preventControlUpdate) {\n // if an interval already exists, disregard call\n if (slider.interval) { return; }\n // create an interval\n slider.interval = setInterval(function() {\n if (slider.settings.autoDirection === 'next') {\n el.goToNextSlide();\n } else {\n el.goToPrevSlide();\n }\n }, slider.settings.pause);\n // if auto controls are displayed and preventControlUpdate is not true\n if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); }\n };\n\n /**\n * Stops the auto show\n *\n * @param preventControlUpdate (boolean)\n * - if true, auto controls state will not be updated\n */\n el.stopAuto = function(preventControlUpdate) {\n // if no interval exists, disregard call\n if (!slider.interval) { return; }\n // clear the interval\n clearInterval(slider.interval);\n slider.interval = null;\n // if auto controls are displayed and preventControlUpdate is not true\n if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); }\n };\n\n /**\n * Returns current slide index (zero-based)\n */\n el.getCurrentSlide = function() {\n return slider.active.index;\n };\n\n /**\n * Returns current slide element\n */\n el.getCurrentSlideElement = function() {\n return slider.children.eq(slider.active.index);\n };\n\n /**\n * Returns a slide element\n * @param index (int)\n * - The index (zero-based) of the element you want returned.\n */\n el.getSlideElement = function(index) {\n return slider.children.eq(index);\n };\n\n /**\n * Returns number of slides in show\n */\n el.getSlideCount = function() {\n return slider.children.length;\n };\n\n /**\n * Return slider.working variable\n */\n el.isWorking = function() {\n return slider.working;\n };\n\n /**\n * Update all dynamic slider elements\n */\n el.redrawSlider = function() {\n // resize all children in ratio to new screen size\n slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());\n // adjust the height\n slider.viewport.css('height', getViewportHeight());\n // update the slide position\n if (!slider.settings.ticker) { setSlidePosition(); }\n // if active.last was true before the screen resize, we want\n // to keep it last no matter what screen size we end on\n if (slider.active.last) { slider.active.index = getPagerQty() - 1; }\n // if the active index (page) no longer exists due to the resize, simply set the index as last\n if (slider.active.index >= getPagerQty()) { slider.active.last = true; }\n // if a pager is being displayed and a custom pager is not being used, update it\n if (slider.settings.pager && !slider.settings.pagerCustom) {\n populatePager();\n updatePagerActive(slider.active.index);\n }\n if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }\n };\n\n /**\n * Destroy the current instance of the slider (revert everything back to original state)\n */\n el.destroySlider = function() {\n // don't do anything if slider has already been destroyed\n if (!slider.initialized) { return; }\n slider.initialized = false;\n $('.bx-clone', this).remove();\n slider.children.each(function() {\n if ($(this).data('origStyle') !== undefined) {\n $(this).attr('style', $(this).data('origStyle'));\n } else {\n $(this).removeAttr('style');\n }\n });\n if ($(this).data('origStyle') !== undefined) {\n this.attr('style', $(this).data('origStyle'));\n } else {\n $(this).removeAttr('style');\n }\n $(this).unwrap().unwrap();\n if (slider.controls.el) { slider.controls.el.remove(); }\n if (slider.controls.next) { slider.controls.next.remove(); }\n if (slider.controls.prev) { slider.controls.prev.remove(); }\n if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); }\n $('.bx-caption', this).remove();\n if (slider.controls.autoEl) { slider.controls.autoEl.remove(); }\n clearInterval(slider.interval);\n if (slider.settings.responsive) { $(window).unbind('resize', resizeWindow); }\n if (slider.settings.keyboardEnabled) { $(document).unbind('keydown', keyPress); }\n //remove self reference in data\n $(this).removeData('bxSlider');\n };\n\n /**\n * Reload the slider (revert all DOM changes, and re-initialize)\n */\n el.reloadSlider = function(settings) {\n if (settings !== undefined) { options = settings; }\n el.destroySlider();\n init();\n //store reference to self in order to access public functions later\n $(el).data('bxSlider', this);\n };\n\n init();\n\n $(el).data('bxSlider', this);\n\n // returns the current jQuery object\n return this;\n };\n\n})(jQuery);\n\n/*!\n\tColorbox 1.6.4\n\tlicense: MIT\n\thttp://www.jacklmoore.com/colorbox\n*/\n(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr(\"data-cbox-\"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?(\"x\"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get(\"photo\")||t.get(\"photoRegex\").test(e)}function l(t,e){return t.get(\"retinaUrl\")&&i.devicePixelRatio>1?e.replace(t.get(\"photoRegex\"),t.get(\"retinaSuffix\")):e}function d(t){\"contains\"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&\"nofollow\"!==e?(W=t(\".\"+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get(\"rel\")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get(\"rel\")),!U){U=$=!0,c(_.get(\"className\")),x.css({visibility:\"hidden\",display:\"block\",opacity:\"\"}),I=n(se,\"LoadedContent\",\"width:0; height:0; overflow:hidden; visibility:hidden\"),b.css({width:\"\",height:\"\"}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get(\"initialWidth\"),\"x\"),s=a(_.get(\"initialHeight\"),\"y\"),l=_.get(\"maxWidth\"),f=_.get(\"maxHeight\");_.w=Math.max((l!==!1?Math.min(h,a(l,\"x\")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,\"y\")):s)-N-j,0),I.css({width:\"\",height:_.h}),J.position(),u(ee),_.get(\"onOpen\"),O.add(F).hide(),x.focus(),_.get(\"trapFocus\")&&e.addEventListener&&(e.addEventListener(\"focus\",d,!0),ae.one(re,function(){e.removeEventListener(\"focus\",d,!0)})),_.get(\"returnFocus\")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get(\"opacity\"));v.css({opacity:p===p?p:\"\",cursor:_.get(\"overlayClose\")?\"pointer\":\"\",visibility:\"visible\"}).show(),_.get(\"closeButton\")?B.html(_.get(\"close\")).appendTo(b):B.appendTo(\"
\"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,\"class\":t.support.opacity===!1?Z+\"IE\":\"\",role:\"dialog\",tabindex:\"-1\"}).hide(),v=n(se,\"Overlay\").hide(),L=t([n(se,\"LoadingOverlay\")[0],n(se,\"LoadingGraphic\")[0]]),y=n(se,\"Wrapper\"),b=n(se,\"Content\").append(F=n(se,\"Title\"),R=n(se,\"Current\"),P=t('')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(\".select2-selection__rendered\").attr(\"id\")+\"-choice-\",s=0;s×')).attr(\"title\",s()),e.attr(\"aria-label\",s()),e.attr(\"aria-describedby\",n),a.StoreData(e[0],\"data\",t),this.$selection.prepend(e),this.$selection[0].classList.add(\"select2-selection--clearable\"))},e}),u.define(\"select2/selection/search\",[\"jquery\",\"../utils\",\"../keys\"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get(\"translations\").get(\"search\"),n=s('');this.$searchContainer=n,this.$search=n.find(\"textarea\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\",r=t.id+\"-container\";e.call(this,t,n),s.$search.attr(\"aria-describedby\",r),t.on(\"open\",function(){s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\")}),t.on(\"close\",function(){s.$search.val(\"\"),s.resizeSearch(),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.trigger(\"focus\")}),t.on(\"enable\",function(){s.$search.prop(\"disabled\",!1),s._transferTabIndex()}),t.on(\"disable\",function(){s.$search.prop(\"disabled\",!0)}),t.on(\"focus\",function(e){s.$search.trigger(\"focus\")}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")}),this.$selection.on(\"focusin\",\".select2-search--inline\",function(e){s.trigger(\"focus\",e)}),this.$selection.on(\"focusout\",\".select2-search--inline\",function(e){s._handleBlur(e)}),this.$selection.on(\"keydown\",\".select2-search--inline\",function(e){var t;e.stopPropagation(),s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||\"\"!==s.$search.val()||0<(t=s.$selection.find(\".select2-selection__choice\").last()).length&&(t=a.GetData(t[0],\"data\"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on(\"click\",\".select2-search--inline\",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on(\"input.searchcheck\",\".select2-search--inline\",function(e){o?s.$selection.off(\"input.search input.searchcheck\"):s.$selection.off(\"keyup.search\")}),this.$selection.on(\"keyup.search input.search\",\".select2-search--inline\",function(e){var t;o&&\"input\"===e.type?s.$selection.off(\"input.search input.searchcheck\"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr(\"tabindex\",this.$selection.attr(\"tabindex\")),this.$selection.attr(\"tabindex\",\"-1\")},e.prototype.createPlaceholder=function(e,t){this.$search.attr(\"placeholder\",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr(\"placeholder\",\"\"),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger(\"focus\")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger(\"query\",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger(\"unselect\",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css(\"width\",\"25px\");var e=\"100%\";\"\"===this.$search.attr(\"placeholder\")&&(e=.75*(this.$search.val().length+1)+\"em\"),this.$search.css(\"width\",e)},e}),u.define(\"select2/selection/selectionCss\",[\"../utils\"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get(\"selectionCssClass\")||\"\";return-1!==e.indexOf(\":all:\")&&(e=e.replace(\":all:\",\"\"),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define(\"select2/selection/eventRelay\",[\"jquery\"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=[\"open\",\"opening\",\"close\",\"closing\",\"select\",\"selecting\",\"unselect\",\"unselecting\",\"clear\",\"clearing\"],r=[\"opening\",\"closing\",\"selecting\",\"unselecting\",\"clearing\"];e.call(this,t,n),t.on(\"*\",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event(\"select2:\"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define(\"select2/translation\",[\"jquery\",\"require\"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define(\"select2/diacritics\",[],function(){return{\"Ⓐ\":\"A\",\"A\":\"A\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ầ\":\"A\",\"Ấ\":\"A\",\"Ẫ\":\"A\",\"Ẩ\":\"A\",\"Ã\":\"A\",\"Ā\":\"A\",\"Ă\":\"A\",\"Ằ\":\"A\",\"Ắ\":\"A\",\"Ẵ\":\"A\",\"Ẳ\":\"A\",\"Ȧ\":\"A\",\"Ǡ\":\"A\",\"Ä\":\"A\",\"Ǟ\":\"A\",\"Ả\":\"A\",\"Å\":\"A\",\"Ǻ\":\"A\",\"Ǎ\":\"A\",\"Ȁ\":\"A\",\"Ȃ\":\"A\",\"Ạ\":\"A\",\"Ậ\":\"A\",\"Ặ\":\"A\",\"Ḁ\":\"A\",\"Ą\":\"A\",\"Ⱥ\":\"A\",\"Ɐ\":\"A\",\"Ꜳ\":\"AA\",\"Æ\":\"AE\",\"Ǽ\":\"AE\",\"Ǣ\":\"AE\",\"Ꜵ\":\"AO\",\"Ꜷ\":\"AU\",\"Ꜹ\":\"AV\",\"Ꜻ\":\"AV\",\"Ꜽ\":\"AY\",\"Ⓑ\":\"B\",\"B\":\"B\",\"Ḃ\":\"B\",\"Ḅ\":\"B\",\"Ḇ\":\"B\",\"Ƀ\":\"B\",\"Ƃ\":\"B\",\"Ɓ\":\"B\",\"Ⓒ\":\"C\",\"C\":\"C\",\"Ć\":\"C\",\"Ĉ\":\"C\",\"Ċ\":\"C\",\"Č\":\"C\",\"Ç\":\"C\",\"Ḉ\":\"C\",\"Ƈ\":\"C\",\"Ȼ\":\"C\",\"Ꜿ\":\"C\",\"Ⓓ\":\"D\",\"D\":\"D\",\"Ḋ\":\"D\",\"Ď\":\"D\",\"Ḍ\":\"D\",\"Ḑ\":\"D\",\"Ḓ\":\"D\",\"Ḏ\":\"D\",\"Đ\":\"D\",\"Ƌ\":\"D\",\"Ɗ\":\"D\",\"Ɖ\":\"D\",\"Ꝺ\":\"D\",\"DZ\":\"DZ\",\"DŽ\":\"DZ\",\"Dz\":\"Dz\",\"Dž\":\"Dz\",\"Ⓔ\":\"E\",\"E\":\"E\",\"È\":\"E\",\"É\":\"E\",\"Ê\":\"E\",\"Ề\":\"E\",\"Ế\":\"E\",\"Ễ\":\"E\",\"Ể\":\"E\",\"Ẽ\":\"E\",\"Ē\":\"E\",\"Ḕ\":\"E\",\"Ḗ\":\"E\",\"Ĕ\":\"E\",\"Ė\":\"E\",\"Ë\":\"E\",\"Ẻ\":\"E\",\"Ě\":\"E\",\"Ȅ\":\"E\",\"Ȇ\":\"E\",\"Ẹ\":\"E\",\"Ệ\":\"E\",\"Ȩ\":\"E\",\"Ḝ\":\"E\",\"Ę\":\"E\",\"Ḙ\":\"E\",\"Ḛ\":\"E\",\"Ɛ\":\"E\",\"Ǝ\":\"E\",\"Ⓕ\":\"F\",\"F\":\"F\",\"Ḟ\":\"F\",\"Ƒ\":\"F\",\"Ꝼ\":\"F\",\"Ⓖ\":\"G\",\"G\":\"G\",\"Ǵ\":\"G\",\"Ĝ\":\"G\",\"Ḡ\":\"G\",\"Ğ\":\"G\",\"Ġ\":\"G\",\"Ǧ\":\"G\",\"Ģ\":\"G\",\"Ǥ\":\"G\",\"Ɠ\":\"G\",\"Ꞡ\":\"G\",\"Ᵹ\":\"G\",\"Ꝿ\":\"G\",\"Ⓗ\":\"H\",\"H\":\"H\",\"Ĥ\":\"H\",\"Ḣ\":\"H\",\"Ḧ\":\"H\",\"Ȟ\":\"H\",\"Ḥ\":\"H\",\"Ḩ\":\"H\",\"Ḫ\":\"H\",\"Ħ\":\"H\",\"Ⱨ\":\"H\",\"Ⱶ\":\"H\",\"Ɥ\":\"H\",\"Ⓘ\":\"I\",\"I\":\"I\",\"Ì\":\"I\",\"Í\":\"I\",\"Î\":\"I\",\"Ĩ\":\"I\",\"Ī\":\"I\",\"Ĭ\":\"I\",\"İ\":\"I\",\"Ï\":\"I\",\"Ḯ\":\"I\",\"Ỉ\":\"I\",\"Ǐ\":\"I\",\"Ȉ\":\"I\",\"Ȋ\":\"I\",\"Ị\":\"I\",\"Į\":\"I\",\"Ḭ\":\"I\",\"Ɨ\":\"I\",\"Ⓙ\":\"J\",\"J\":\"J\",\"Ĵ\":\"J\",\"Ɉ\":\"J\",\"Ⓚ\":\"K\",\"K\":\"K\",\"Ḱ\":\"K\",\"Ǩ\":\"K\",\"Ḳ\":\"K\",\"Ķ\":\"K\",\"Ḵ\":\"K\",\"Ƙ\":\"K\",\"Ⱪ\":\"K\",\"Ꝁ\":\"K\",\"Ꝃ\":\"K\",\"Ꝅ\":\"K\",\"Ꞣ\":\"K\",\"Ⓛ\":\"L\",\"L\":\"L\",\"Ŀ\":\"L\",\"Ĺ\":\"L\",\"Ľ\":\"L\",\"Ḷ\":\"L\",\"Ḹ\":\"L\",\"Ļ\":\"L\",\"Ḽ\":\"L\",\"Ḻ\":\"L\",\"Ł\":\"L\",\"Ƚ\":\"L\",\"Ɫ\":\"L\",\"Ⱡ\":\"L\",\"Ꝉ\":\"L\",\"Ꝇ\":\"L\",\"Ꞁ\":\"L\",\"LJ\":\"LJ\",\"Lj\":\"Lj\",\"Ⓜ\":\"M\",\"M\":\"M\",\"Ḿ\":\"M\",\"Ṁ\":\"M\",\"Ṃ\":\"M\",\"Ɱ\":\"M\",\"Ɯ\":\"M\",\"Ⓝ\":\"N\",\"N\":\"N\",\"Ǹ\":\"N\",\"Ń\":\"N\",\"Ñ\":\"N\",\"Ṅ\":\"N\",\"Ň\":\"N\",\"Ṇ\":\"N\",\"Ņ\":\"N\",\"Ṋ\":\"N\",\"Ṉ\":\"N\",\"Ƞ\":\"N\",\"Ɲ\":\"N\",\"Ꞑ\":\"N\",\"Ꞥ\":\"N\",\"NJ\":\"NJ\",\"Nj\":\"Nj\",\"Ⓞ\":\"O\",\"O\":\"O\",\"Ò\":\"O\",\"Ó\":\"O\",\"Ô\":\"O\",\"Ồ\":\"O\",\"Ố\":\"O\",\"Ỗ\":\"O\",\"Ổ\":\"O\",\"Õ\":\"O\",\"Ṍ\":\"O\",\"Ȭ\":\"O\",\"Ṏ\":\"O\",\"Ō\":\"O\",\"Ṑ\":\"O\",\"Ṓ\":\"O\",\"Ŏ\":\"O\",\"Ȯ\":\"O\",\"Ȱ\":\"O\",\"Ö\":\"O\",\"Ȫ\":\"O\",\"Ỏ\":\"O\",\"Ő\":\"O\",\"Ǒ\":\"O\",\"Ȍ\":\"O\",\"Ȏ\":\"O\",\"Ơ\":\"O\",\"Ờ\":\"O\",\"Ớ\":\"O\",\"Ỡ\":\"O\",\"Ở\":\"O\",\"Ợ\":\"O\",\"Ọ\":\"O\",\"Ộ\":\"O\",\"Ǫ\":\"O\",\"Ǭ\":\"O\",\"Ø\":\"O\",\"Ǿ\":\"O\",\"Ɔ\":\"O\",\"Ɵ\":\"O\",\"Ꝋ\":\"O\",\"Ꝍ\":\"O\",\"Œ\":\"OE\",\"Ƣ\":\"OI\",\"Ꝏ\":\"OO\",\"Ȣ\":\"OU\",\"Ⓟ\":\"P\",\"P\":\"P\",\"Ṕ\":\"P\",\"Ṗ\":\"P\",\"Ƥ\":\"P\",\"Ᵽ\":\"P\",\"Ꝑ\":\"P\",\"Ꝓ\":\"P\",\"Ꝕ\":\"P\",\"Ⓠ\":\"Q\",\"Q\":\"Q\",\"Ꝗ\":\"Q\",\"Ꝙ\":\"Q\",\"Ɋ\":\"Q\",\"Ⓡ\":\"R\",\"R\":\"R\",\"Ŕ\":\"R\",\"Ṙ\":\"R\",\"Ř\":\"R\",\"Ȑ\":\"R\",\"Ȓ\":\"R\",\"Ṛ\":\"R\",\"Ṝ\":\"R\",\"Ŗ\":\"R\",\"Ṟ\":\"R\",\"Ɍ\":\"R\",\"Ɽ\":\"R\",\"Ꝛ\":\"R\",\"Ꞧ\":\"R\",\"Ꞃ\":\"R\",\"Ⓢ\":\"S\",\"S\":\"S\",\"ẞ\":\"S\",\"Ś\":\"S\",\"Ṥ\":\"S\",\"Ŝ\":\"S\",\"Ṡ\":\"S\",\"Š\":\"S\",\"Ṧ\":\"S\",\"Ṣ\":\"S\",\"Ṩ\":\"S\",\"Ș\":\"S\",\"Ş\":\"S\",\"Ȿ\":\"S\",\"Ꞩ\":\"S\",\"Ꞅ\":\"S\",\"Ⓣ\":\"T\",\"T\":\"T\",\"Ṫ\":\"T\",\"Ť\":\"T\",\"Ṭ\":\"T\",\"Ț\":\"T\",\"Ţ\":\"T\",\"Ṱ\":\"T\",\"Ṯ\":\"T\",\"Ŧ\":\"T\",\"Ƭ\":\"T\",\"Ʈ\":\"T\",\"Ⱦ\":\"T\",\"Ꞇ\":\"T\",\"Ꜩ\":\"TZ\",\"Ⓤ\":\"U\",\"U\":\"U\",\"Ù\":\"U\",\"Ú\":\"U\",\"Û\":\"U\",\"Ũ\":\"U\",\"Ṹ\":\"U\",\"Ū\":\"U\",\"Ṻ\":\"U\",\"Ŭ\":\"U\",\"Ü\":\"U\",\"Ǜ\":\"U\",\"Ǘ\":\"U\",\"Ǖ\":\"U\",\"Ǚ\":\"U\",\"Ủ\":\"U\",\"Ů\":\"U\",\"Ű\":\"U\",\"Ǔ\":\"U\",\"Ȕ\":\"U\",\"Ȗ\":\"U\",\"Ư\":\"U\",\"Ừ\":\"U\",\"Ứ\":\"U\",\"Ữ\":\"U\",\"Ử\":\"U\",\"Ự\":\"U\",\"Ụ\":\"U\",\"Ṳ\":\"U\",\"Ų\":\"U\",\"Ṷ\":\"U\",\"Ṵ\":\"U\",\"Ʉ\":\"U\",\"Ⓥ\":\"V\",\"V\":\"V\",\"Ṽ\":\"V\",\"Ṿ\":\"V\",\"Ʋ\":\"V\",\"Ꝟ\":\"V\",\"Ʌ\":\"V\",\"Ꝡ\":\"VY\",\"Ⓦ\":\"W\",\"W\":\"W\",\"Ẁ\":\"W\",\"Ẃ\":\"W\",\"Ŵ\":\"W\",\"Ẇ\":\"W\",\"Ẅ\":\"W\",\"Ẉ\":\"W\",\"Ⱳ\":\"W\",\"Ⓧ\":\"X\",\"X\":\"X\",\"Ẋ\":\"X\",\"Ẍ\":\"X\",\"Ⓨ\":\"Y\",\"Y\":\"Y\",\"Ỳ\":\"Y\",\"Ý\":\"Y\",\"Ŷ\":\"Y\",\"Ỹ\":\"Y\",\"Ȳ\":\"Y\",\"Ẏ\":\"Y\",\"Ÿ\":\"Y\",\"Ỷ\":\"Y\",\"Ỵ\":\"Y\",\"Ƴ\":\"Y\",\"Ɏ\":\"Y\",\"Ỿ\":\"Y\",\"Ⓩ\":\"Z\",\"Z\":\"Z\",\"Ź\":\"Z\",\"Ẑ\":\"Z\",\"Ż\":\"Z\",\"Ž\":\"Z\",\"Ẓ\":\"Z\",\"Ẕ\":\"Z\",\"Ƶ\":\"Z\",\"Ȥ\":\"Z\",\"Ɀ\":\"Z\",\"Ⱬ\":\"Z\",\"Ꝣ\":\"Z\",\"ⓐ\":\"a\",\"a\":\"a\",\"ẚ\":\"a\",\"à\":\"a\",\"á\":\"a\",\"â\":\"a\",\"ầ\":\"a\",\"ấ\":\"a\",\"ẫ\":\"a\",\"ẩ\":\"a\",\"ã\":\"a\",\"ā\":\"a\",\"ă\":\"a\",\"ằ\":\"a\",\"ắ\":\"a\",\"ẵ\":\"a\",\"ẳ\":\"a\",\"ȧ\":\"a\",\"ǡ\":\"a\",\"ä\":\"a\",\"ǟ\":\"a\",\"ả\":\"a\",\"å\":\"a\",\"ǻ\":\"a\",\"ǎ\":\"a\",\"ȁ\":\"a\",\"ȃ\":\"a\",\"ạ\":\"a\",\"ậ\":\"a\",\"ặ\":\"a\",\"ḁ\":\"a\",\"ą\":\"a\",\"ⱥ\":\"a\",\"ɐ\":\"a\",\"ꜳ\":\"aa\",\"æ\":\"ae\",\"ǽ\":\"ae\",\"ǣ\":\"ae\",\"ꜵ\":\"ao\",\"ꜷ\":\"au\",\"ꜹ\":\"av\",\"ꜻ\":\"av\",\"ꜽ\":\"ay\",\"ⓑ\":\"b\",\"b\":\"b\",\"ḃ\":\"b\",\"ḅ\":\"b\",\"ḇ\":\"b\",\"ƀ\":\"b\",\"ƃ\":\"b\",\"ɓ\":\"b\",\"ⓒ\":\"c\",\"c\":\"c\",\"ć\":\"c\",\"ĉ\":\"c\",\"ċ\":\"c\",\"č\":\"c\",\"ç\":\"c\",\"ḉ\":\"c\",\"ƈ\":\"c\",\"ȼ\":\"c\",\"ꜿ\":\"c\",\"ↄ\":\"c\",\"ⓓ\":\"d\",\"d\":\"d\",\"ḋ\":\"d\",\"ď\":\"d\",\"ḍ\":\"d\",\"ḑ\":\"d\",\"ḓ\":\"d\",\"ḏ\":\"d\",\"đ\":\"d\",\"ƌ\":\"d\",\"ɖ\":\"d\",\"ɗ\":\"d\",\"ꝺ\":\"d\",\"dz\":\"dz\",\"dž\":\"dz\",\"ⓔ\":\"e\",\"e\":\"e\",\"è\":\"e\",\"é\":\"e\",\"ê\":\"e\",\"ề\":\"e\",\"ế\":\"e\",\"ễ\":\"e\",\"ể\":\"e\",\"ẽ\":\"e\",\"ē\":\"e\",\"ḕ\":\"e\",\"ḗ\":\"e\",\"ĕ\":\"e\",\"ė\":\"e\",\"ë\":\"e\",\"ẻ\":\"e\",\"ě\":\"e\",\"ȅ\":\"e\",\"ȇ\":\"e\",\"ẹ\":\"e\",\"ệ\":\"e\",\"ȩ\":\"e\",\"ḝ\":\"e\",\"ę\":\"e\",\"ḙ\":\"e\",\"ḛ\":\"e\",\"ɇ\":\"e\",\"ɛ\":\"e\",\"ǝ\":\"e\",\"ⓕ\":\"f\",\"f\":\"f\",\"ḟ\":\"f\",\"ƒ\":\"f\",\"ꝼ\":\"f\",\"ⓖ\":\"g\",\"g\":\"g\",\"ǵ\":\"g\",\"ĝ\":\"g\",\"ḡ\":\"g\",\"ğ\":\"g\",\"ġ\":\"g\",\"ǧ\":\"g\",\"ģ\":\"g\",\"ǥ\":\"g\",\"ɠ\":\"g\",\"ꞡ\":\"g\",\"ᵹ\":\"g\",\"ꝿ\":\"g\",\"ⓗ\":\"h\",\"h\":\"h\",\"ĥ\":\"h\",\"ḣ\":\"h\",\"ḧ\":\"h\",\"ȟ\":\"h\",\"ḥ\":\"h\",\"ḩ\":\"h\",\"ḫ\":\"h\",\"ẖ\":\"h\",\"ħ\":\"h\",\"ⱨ\":\"h\",\"ⱶ\":\"h\",\"ɥ\":\"h\",\"ƕ\":\"hv\",\"ⓘ\":\"i\",\"i\":\"i\",\"ì\":\"i\",\"í\":\"i\",\"î\":\"i\",\"ĩ\":\"i\",\"ī\":\"i\",\"ĭ\":\"i\",\"ï\":\"i\",\"ḯ\":\"i\",\"ỉ\":\"i\",\"ǐ\":\"i\",\"ȉ\":\"i\",\"ȋ\":\"i\",\"ị\":\"i\",\"į\":\"i\",\"ḭ\":\"i\",\"ɨ\":\"i\",\"ı\":\"i\",\"ⓙ\":\"j\",\"j\":\"j\",\"ĵ\":\"j\",\"ǰ\":\"j\",\"ɉ\":\"j\",\"ⓚ\":\"k\",\"k\":\"k\",\"ḱ\":\"k\",\"ǩ\":\"k\",\"ḳ\":\"k\",\"ķ\":\"k\",\"ḵ\":\"k\",\"ƙ\":\"k\",\"ⱪ\":\"k\",\"ꝁ\":\"k\",\"ꝃ\":\"k\",\"ꝅ\":\"k\",\"ꞣ\":\"k\",\"ⓛ\":\"l\",\"l\":\"l\",\"ŀ\":\"l\",\"ĺ\":\"l\",\"ľ\":\"l\",\"ḷ\":\"l\",\"ḹ\":\"l\",\"ļ\":\"l\",\"ḽ\":\"l\",\"ḻ\":\"l\",\"ſ\":\"l\",\"ł\":\"l\",\"ƚ\":\"l\",\"ɫ\":\"l\",\"ⱡ\":\"l\",\"ꝉ\":\"l\",\"ꞁ\":\"l\",\"ꝇ\":\"l\",\"lj\":\"lj\",\"ⓜ\":\"m\",\"m\":\"m\",\"ḿ\":\"m\",\"ṁ\":\"m\",\"ṃ\":\"m\",\"ɱ\":\"m\",\"ɯ\":\"m\",\"ⓝ\":\"n\",\"n\":\"n\",\"ǹ\":\"n\",\"ń\":\"n\",\"ñ\":\"n\",\"ṅ\":\"n\",\"ň\":\"n\",\"ṇ\":\"n\",\"ņ\":\"n\",\"ṋ\":\"n\",\"ṉ\":\"n\",\"ƞ\":\"n\",\"ɲ\":\"n\",\"ʼn\":\"n\",\"ꞑ\":\"n\",\"ꞥ\":\"n\",\"nj\":\"nj\",\"ⓞ\":\"o\",\"o\":\"o\",\"ò\":\"o\",\"ó\":\"o\",\"ô\":\"o\",\"ồ\":\"o\",\"ố\":\"o\",\"ỗ\":\"o\",\"ổ\":\"o\",\"õ\":\"o\",\"ṍ\":\"o\",\"ȭ\":\"o\",\"ṏ\":\"o\",\"ō\":\"o\",\"ṑ\":\"o\",\"ṓ\":\"o\",\"ŏ\":\"o\",\"ȯ\":\"o\",\"ȱ\":\"o\",\"ö\":\"o\",\"ȫ\":\"o\",\"ỏ\":\"o\",\"ő\":\"o\",\"ǒ\":\"o\",\"ȍ\":\"o\",\"ȏ\":\"o\",\"ơ\":\"o\",\"ờ\":\"o\",\"ớ\":\"o\",\"ỡ\":\"o\",\"ở\":\"o\",\"ợ\":\"o\",\"ọ\":\"o\",\"ộ\":\"o\",\"ǫ\":\"o\",\"ǭ\":\"o\",\"ø\":\"o\",\"ǿ\":\"o\",\"ɔ\":\"o\",\"ꝋ\":\"o\",\"ꝍ\":\"o\",\"ɵ\":\"o\",\"œ\":\"oe\",\"ƣ\":\"oi\",\"ȣ\":\"ou\",\"ꝏ\":\"oo\",\"ⓟ\":\"p\",\"p\":\"p\",\"ṕ\":\"p\",\"ṗ\":\"p\",\"ƥ\":\"p\",\"ᵽ\":\"p\",\"ꝑ\":\"p\",\"ꝓ\":\"p\",\"ꝕ\":\"p\",\"ⓠ\":\"q\",\"q\":\"q\",\"ɋ\":\"q\",\"ꝗ\":\"q\",\"ꝙ\":\"q\",\"ⓡ\":\"r\",\"r\":\"r\",\"ŕ\":\"r\",\"ṙ\":\"r\",\"ř\":\"r\",\"ȑ\":\"r\",\"ȓ\":\"r\",\"ṛ\":\"r\",\"ṝ\":\"r\",\"ŗ\":\"r\",\"ṟ\":\"r\",\"ɍ\":\"r\",\"ɽ\":\"r\",\"ꝛ\":\"r\",\"ꞧ\":\"r\",\"ꞃ\":\"r\",\"ⓢ\":\"s\",\"s\":\"s\",\"ß\":\"s\",\"ś\":\"s\",\"ṥ\":\"s\",\"ŝ\":\"s\",\"ṡ\":\"s\",\"š\":\"s\",\"ṧ\":\"s\",\"ṣ\":\"s\",\"ṩ\":\"s\",\"ș\":\"s\",\"ş\":\"s\",\"ȿ\":\"s\",\"ꞩ\":\"s\",\"ꞅ\":\"s\",\"ẛ\":\"s\",\"ⓣ\":\"t\",\"t\":\"t\",\"ṫ\":\"t\",\"ẗ\":\"t\",\"ť\":\"t\",\"ṭ\":\"t\",\"ț\":\"t\",\"ţ\":\"t\",\"ṱ\":\"t\",\"ṯ\":\"t\",\"ŧ\":\"t\",\"ƭ\":\"t\",\"ʈ\":\"t\",\"ⱦ\":\"t\",\"ꞇ\":\"t\",\"ꜩ\":\"tz\",\"ⓤ\":\"u\",\"u\":\"u\",\"ù\":\"u\",\"ú\":\"u\",\"û\":\"u\",\"ũ\":\"u\",\"ṹ\":\"u\",\"ū\":\"u\",\"ṻ\":\"u\",\"ŭ\":\"u\",\"ü\":\"u\",\"ǜ\":\"u\",\"ǘ\":\"u\",\"ǖ\":\"u\",\"ǚ\":\"u\",\"ủ\":\"u\",\"ů\":\"u\",\"ű\":\"u\",\"ǔ\":\"u\",\"ȕ\":\"u\",\"ȗ\":\"u\",\"ư\":\"u\",\"ừ\":\"u\",\"ứ\":\"u\",\"ữ\":\"u\",\"ử\":\"u\",\"ự\":\"u\",\"ụ\":\"u\",\"ṳ\":\"u\",\"ų\":\"u\",\"ṷ\":\"u\",\"ṵ\":\"u\",\"ʉ\":\"u\",\"ⓥ\":\"v\",\"v\":\"v\",\"ṽ\":\"v\",\"ṿ\":\"v\",\"ʋ\":\"v\",\"ꝟ\":\"v\",\"ʌ\":\"v\",\"ꝡ\":\"vy\",\"ⓦ\":\"w\",\"w\":\"w\",\"ẁ\":\"w\",\"ẃ\":\"w\",\"ŵ\":\"w\",\"ẇ\":\"w\",\"ẅ\":\"w\",\"ẘ\":\"w\",\"ẉ\":\"w\",\"ⱳ\":\"w\",\"ⓧ\":\"x\",\"x\":\"x\",\"ẋ\":\"x\",\"ẍ\":\"x\",\"ⓨ\":\"y\",\"y\":\"y\",\"ỳ\":\"y\",\"ý\":\"y\",\"ŷ\":\"y\",\"ỹ\":\"y\",\"ȳ\":\"y\",\"ẏ\":\"y\",\"ÿ\":\"y\",\"ỷ\":\"y\",\"ẙ\":\"y\",\"ỵ\":\"y\",\"ƴ\":\"y\",\"ɏ\":\"y\",\"ỿ\":\"y\",\"ⓩ\":\"z\",\"z\":\"z\",\"ź\":\"z\",\"ẑ\":\"z\",\"ż\":\"z\",\"ž\":\"z\",\"ẓ\":\"z\",\"ẕ\":\"z\",\"ƶ\":\"z\",\"ȥ\":\"z\",\"ɀ\":\"z\",\"ⱬ\":\"z\",\"ꝣ\":\"z\",\"Ά\":\"Α\",\"Έ\":\"Ε\",\"Ή\":\"Η\",\"Ί\":\"Ι\",\"Ϊ\":\"Ι\",\"Ό\":\"Ο\",\"Ύ\":\"Υ\",\"Ϋ\":\"Υ\",\"Ώ\":\"Ω\",\"ά\":\"α\",\"έ\":\"ε\",\"ή\":\"η\",\"ί\":\"ι\",\"ϊ\":\"ι\",\"ΐ\":\"ι\",\"ό\":\"ο\",\"ύ\":\"υ\",\"ϋ\":\"υ\",\"ΰ\":\"υ\",\"ώ\":\"ω\",\"ς\":\"σ\",\"’\":\"'\"}}),u.define(\"select2/data/base\",[\"../utils\"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error(\"The `current` method must be defined in child classes.\")},s.prototype.query=function(e,t){throw new Error(\"The `query` method must be defined in child classes.\")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+\"-result-\";return e+=n.generateChars(4),null!=t.id?e+=\"-\"+t.id.toString():e+=\"-\"+n.generateChars(4),e},s}),u.define(\"select2/data/select\",[\"./base\",\"../utils\",\"jquery\"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(\":checked\"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&\"option\"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger(\"input\").trigger(\"change\");this.$element.prop(\"multiple\")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;nthis.maximumInputLength?this.trigger(\"results:message\",{message:\"inputTooLong\",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define(\"select2/data/maximumSelectionLength\",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get(\"maximumSelectionLength\"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"select\",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0=n.maximumSelectionLength?n.trigger(\"results:message\",{message:\"maximumSelected\",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define(\"select2/dropdown\",[\"jquery\",\"./utils\"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr(\"dir\",this.options.get(\"dir\")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define(\"select2/dropdown/search\",[\"jquery\"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get(\"translations\").get(\"search\"),e=r('');return this.$searchContainer=e,this.$search=e.find(\"input\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\";e.call(this,t,n),this.$search.on(\"keydown\",function(e){s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on(\"input\",function(e){r(this).off(\"keyup\")}),this.$search.on(\"keyup input\",function(e){s.handleSearch(e)}),t.on(\"open\",function(){s.$search.attr(\"tabindex\",0),s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\"),window.setTimeout(function(){s.$search.trigger(\"focus\")},0)}),t.on(\"close\",function(){s.$search.attr(\"tabindex\",-1),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.val(\"\"),s.$search.trigger(\"blur\")}),t.on(\"focus\",function(){t.isOpen()||s.$search.trigger(\"focus\")}),t.on(\"results:all\",function(e){null!=e.query.term&&\"\"!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove(\"select2-search--hide\"):s.$searchContainer[0].classList.add(\"select2-search--hide\"))}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger(\"query\",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define(\"select2/dropdown/hidePlaceholder\",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get(\"placeholder\")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return\"string\"==typeof t&&(t={id:\"\",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define(\"select2/dropdown/infiniteScroll\",[\"jquery\"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"query\",function(e){s.lastParams=e,s.loading=!0}),t.on(\"query:append\",function(e){s.lastParams=e,s.loading=!0}),this.$results.on(\"scroll\",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger(\"query:append\",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
  • '),t=this.options.get(\"translations\").get(\"loadingMore\");return e.html(t(this.lastParams)),e},e}),u.define(\"select2/dropdown/attachBody\",[\"jquery\",\"../utils\"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get(\"dropdownParent\")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"open\",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on(\"close\",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on(\"mousedown\",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr(\"class\",n.attr(\"class\")),t[0].classList.remove(\"select2\"),t[0].classList.add(\"select2-container--open\"),t.css({position:\"absolute\",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u(\"\"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on(\"results:all\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:append\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:message\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"select\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"unselect\",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s=\"scroll.select2.\"+t.id,i=\"resize.select2.\"+t.id,r=\"orientationchange.select2.\"+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,\"select2-scroll-position\",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,\"select2-scroll-position\");u(this).scrollTop(t.y)}),u(window).on(s+\" \"+i+\" \"+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n=\"scroll.select2.\"+t.id,s=\"resize.select2.\"+t.id,t=\"orientationchange.select2.\"+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+\" \"+s+\" \"+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains(\"select2-dropdown--above\"),n=this.$dropdown[0].classList.contains(\"select2-dropdown--below\"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;\"static\"===l.css(\"position\")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s=\"below\"),e||!c||t?!c&&e&&t&&(s=\"below\"):s=\"above\",(\"above\"==s||t&&\"below\"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove(\"select2-dropdown--below\"),this.$dropdown[0].classList.remove(\"select2-dropdown--above\"),this.$dropdown[0].classList.add(\"select2-dropdown--\"+s),this.$container[0].classList.remove(\"select2-container--below\"),this.$container[0].classList.remove(\"select2-container--above\"),this.$container[0].classList.add(\"select2-container--\"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+\"px\"};this.options.get(\"dropdownAutoWidth\")&&(e.minWidth=e.width,e.position=\"relative\",e.width=\"auto\"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define(\"select2/dropdown/minimumResultsForSearch\",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get(\"minimumResultsForSearch\"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s');return e.attr(\"dir\",this.options.get(\"dir\")),this.$container=e,this.$container[0].classList.add(\"select2-container--\"+this.options.get(\"theme\")),r.StoreData(e[0],\"element\",this.$element),e},o}),u.define(\"jquery-mousewheel\",[\"jquery\"],function(e){return e}),u.define(\"jquery.select2\",[\"jquery\",\"jquery-mousewheel\",\"./select2/core\",\"./select2/defaults\",\"./select2/utils\"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=[\"open\",\"close\",\"destroy\"],i.fn.select2=function(t){if(\"object\"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if(\"string\"!=typeof t)throw new Error(\"Invalid arguments for Select2: \"+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,\"select2\");null==e&&window.console&&console.error&&console.error(\"The select2('\"+t+\"') method was called on an element that is not using Select2.\"),n=e[t].apply(e,s)}),-1 collection\r\n for (// get the cached index\r\n var index = 0; index < uses.length; ) {\r\n // get the current \r\n var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute(\"xlink:href\") || use.getAttribute(\"href\");\r\n if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), \r\n svg && src) {\r\n if (polyfill) {\r\n if (!opts.validate || opts.validate(src, svg, use)) {\r\n // remove the element\r\n parent.removeChild(use);\r\n // parse the src and get the url and id\r\n var srcSplit = src.split(\"#\"), url = srcSplit.shift(), id = srcSplit.join(\"#\");\r\n // if the link is external\r\n if (url.length) {\r\n // get the cached xhr request\r\n var xhr = requests[url];\r\n // ensure the xhr request exists\r\n xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open(\"GET\", url), xhr.send(), \r\n xhr._embeds = []), // add the svg and id as an item to the xhr embeds list\r\n xhr._embeds.push({\r\n parent: parent,\r\n svg: svg,\r\n id: id\r\n }), // prepare the xhr ready state change event\r\n loadreadystatechange(xhr);\r\n } else {\r\n // embed the local id into the svg\r\n embed(parent, svg, document.getElementById(id));\r\n }\r\n } else {\r\n // increase the index when the previous value was not \"valid\"\r\n ++index, ++numberOfSvgUseElementsToBypass;\r\n }\r\n }\r\n } else {\r\n // increase the index when the previous value was not \"valid\"\r\n ++index;\r\n }\r\n }\r\n // continue the interval\r\n (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);\r\n }\r\n var polyfill, opts = Object(rawopts), newerIEUA = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/, webkitUA = /\\bAppleWebKit\\/(\\d+)\\b/, olderEdgeUA = /\\bEdge\\/12\\.(\\d+)\\b/, edgeUA = /\\bEdge\\/.(\\d+)\\b/, inIframe = window.top !== window.self;\r\n polyfill = \"polyfill\" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;\r\n // create xhr requests object\r\n var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName(\"use\"), numberOfSvgUseElementsToBypass = 0;\r\n // conditionally start the interval if the polyfill is active\r\n polyfill && oninterval();\r\n }\r\n function getSVGAncestor(node) {\r\n for (var svg = node; \"svg\" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}\r\n return svg;\r\n }\r\n return svg4everybody;\r\n});\nsvg4everybody();\nvar $anchorlist = $('#anchor-list');\r\nvar $anchor_toggle_hide = $('#anchor-toggle-hide');\r\n\r\n$('#anchor-toggle-show').click(function(){\r\n\t$(this).fadeOut();\r\n\t$('#anchor-toggle-hide').fadeIn();\r\n\t$anchorlist.slideDown();\r\n});\r\n$('#anchor-toggle-hide').click(function(){\r\n\t$anchor_toggle_hide.fadeOut();\r\n\t$('#anchor-toggle-show').fadeIn();\r\n\t$anchorlist.slideUp();\r\n});\r\n\r\n//If the window gets resized down to mobile, we re-render the slider with different params\r\n$(window).on(\"debouncedresize\", function( event ) {\r\n\r\n\tif ($(window).width() > 1024) {\r\n\t\t$anchorlist.css('display', 'inline-block');\r\n\t}\r\n\t\r\n\t$('#anchor-list li a').click(function(){\r\n\t\tif ( $(window).width() < 1025 ) {\r\n\t\t\t$anchor_toggle_hide.fadeOut();\r\n\t\t\t$('#anchor-toggle-show').fadeIn();\r\n\t\t\t$anchorlist.slideUp();\r\n\t\t}\r\n\t});\r\n\r\n});\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n\t\t \n\tvar lazyBackgrounds = document.querySelectorAll(\".lazy-background\"); // 1\n\n if (\"IntersectionObserver\" in window) { // 2\n let lazyBackgroundObserver = new IntersectionObserver(function(entries, observer) {\n entries.forEach(function(entry) { // 3\n if (entry.isIntersecting) {\n entry.target.classList.add(\"visible\");\n lazyBackgroundObserver.unobserve(entry.target);\n }\n });\n });\n\n lazyBackgrounds.forEach(function(lazyBackground) { // 4\n lazyBackgroundObserver.observe(lazyBackground);\n });\n } \n else {\n entries.forEach(function(entry) { // 5\n entry.target.classList.add(\"visible\");\n });\n }\n});\n\n$(\".firstword_styled\").each(function() {\n // Some Vars\n var elText,\n openSpan = '',\n closeSpan = ' ';\n \n // Make the text into array\n elText = $(this).text().split(\" \");\n \n // Adding the open span to the beginning of the array\n elText.unshift(openSpan);\n \n // Adding span closing after the first word in each sentence\n elText.splice(2, 0, closeSpan);\n \n // Make the array into string \n elText = elText.join(\" \");\n \n // Change the html of each element to style it\n $(this).html(elText);\n});\n\n$(\".twowords_styled\").each(function() {\n // Some Vars\n var elText,\n openSpan = '',\n closeSpan = ' ';\n \n // Make the text into array\n elText = $(this).text().split(\" \");\n \n // Adding the open span to the beginning of the array\n elText.unshift(openSpan);\n \n // Adding span closing after the first word in each sentence\n elText.splice(3, 0, closeSpan);\n \n // Make the array into string \n elText = elText.join(\" \");\n \n // Change the html of each element to style it\n $(this).html(elText);\n});\n/**\r\n * Control header menu on-scroll\r\n */\r\nfunction header_scrolled() {\r\n\r\n\tvar top = $(this).scrollTop();\r\n\r\n if ( top > 80 ) {\r\n \t$('.header').addClass('scrolled');\r\n } else {\r\n \t$('.header').removeClass('scrolled');\r\n }\r\n}\r\n\r\nheader_scrolled();\r\n\r\n$(window).scroll( function() {\r\n\t\r\n\theader_scrolled();\r\n});\nvar image_slider;\nvar image_sliderActive = false;\nvar image_slider_params = {\n\tkeyboardEnabled: true,\n\tmaxSlides: 1,\n\tnextText: 'Next Slide',\n\tprevText: 'Previous Slide',\n\tpagerType: 'short',\n\ttouchEnabled: false,\n\tonSliderLoad: function(){\n\t\timage_sliderActive = true;\n\t}\n}\n\nfunction image_generate_slides() {\n\timage_slider = $('.slide_container.slideshow').bxSlider( image_slider_params );\n}\n\n//Initiate the slides on page-load\nimage_generate_slides();\n\n//If the window gets resized down to mobile, we re-render the slider with different params\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( image_sliderActive === true ) {\n\t\timage_slider.reloadSlider();\n\t}\n});\n\nif ($(window).width() < 767) { //Generate a slider for mobile\n\tmaxSlides = 1;\n\tcurrentSlideNumOffest = 1\n}else{\n\tmaxSlides = 3;\n\tcurrentSlideNumOffest = 4\n}\n\nvar latest_updates_slider;\nvar latest_updates_sliderActive = false;\nvar latest_updates_slider_params = {\n\t\n\tnextText: 'Next Slide',\n\tprevText: 'Previous Slide',\n\n\tpagerType: 'short',\n\tkeyboardEnabled: true,\n\tmaxSlides: maxSlides,\n\ttouchEnabled: false,\n\t/*\n\tTo add class on the first visible slide you have to call onSliderLoad. Then you continue adding and removing active-slide class with onSlideAfter call.\n\t*/\n\tonSlideAfter: function (currentSlideNumber, totalSlideQty, currentSlideHtmlObject) {\n\t\tconsole.log(currentSlideHtmlObject);\n\t\t$('.active-slide').removeClass('active-slide');\n\t\t$('.latest_updates__carousel .update').eq(currentSlideHtmlObject + currentSlideNumOffest).addClass('active-slide')\n\t},\n\tonSliderLoad: function () {\n\t\t$('.bxslider > li').eq(1).addClass('active-slide');\n\t\tlatest_updates_sliderActive = true;\n\t},\n}\n\n\n\n\n\nfunction generate_slides() {\n\tlatest_updates_slider = $('.latest_updates__carousel').bxSlider( latest_updates_slider_params );\n}\n\ngenerate_slides();\n\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( latest_updates_sliderActive === true ) {\n\t\tlatest_updates_slider.destroySlider();\n\t\tgenerate_slides();\n\t}\n});\nvar toggle = $('#menu-toggle');\nvar menu = $('#menu-main-navigation');\nvar modal = $('.modal_overlay');\nvar header = $('.header');\n\n//Hamburger menu toggle\ntoggle.on('click', function(){\n\tif (menu.hasClass('expanded')) {\n\t\t//$(this).attr('aria-expanded', 'false');\n\t\t$(this).removeClass('expanded');\n\t\tmenu.removeClass('expanded');\n\t\t$(this).attr('aria-expanded', 'false');\n\t} else {\n\t\tmenu.addClass('expanded'); \n\t\t$(this).addClass('expanded');\n\t\t$(this).attr('aria-expanded', 'true');\n\t}\n});\n\n\n//click to open a submenu\n$('#menu-main-navigation >.menu-item-has-children > button').on('click', function(){\n\t\n\tvar $window = $(window);\n\tvar windowsize = $window.width();\n\tif (windowsize > 1024)\n\t{\n\t\treturn;\t\t\n\t}\n\t\n\tvar submenu_parent = $(this).parent();\n\tvar submenu = submenu_parent.children('.sub-menu');\n\tvar submenu_button = $(this);\n\n\t$('#menu-main-navigation >.menu-item-has-children > button').attr('aria-expanded', 'false');//Set all buttons to exanded=false\n\n\t//HIDE MENU\n\tif ( submenu_parent.hasClass('expanded') ) {\n\n\t\tsubmenu_parent.removeClass('expanded');\n\t\tsubmenu_button.attr('aria-expanded', 'false');\n\t\theader.removeClass('temp_solid_bg');\n\t\t//modal.hide();\n\n\t\tsetTimeout(function () {\n\t\t\tsubmenu.addClass('hidden');\n\t\t}, 200);\n\n\t//SHOW MENU\n\t}else{\n\t\t\n\t\t// close other menu before\n\t\t$('#menu-main-navigation >.menu-item-has-children').removeClass('expanded');//Collapse any other open menus\n\t\t$('#menu-main-navigation >.menu-item-has-children .sub-menu').addClass('hidden');\n\t\tsubmenu.removeClass('hidden');\n\n\t\tsetTimeout(function () {\n\t\t\tsubmenu_parent.addClass('expanded');\n\t\t\tsubmenu_button.attr('aria-expanded', 'true');\n\t\t\theader.addClass('temp_solid_bg');\n\t\t\t//modal.show();\n\t\t}, 200);\n\t}\n\t\n\t\n});\n\n//Click to toggle sub-sub-menu\n//NOTE: need to DRY this and consolidate with above \n$('.second-tier >.menu-item-has-children > button').on('click', function(){\n\n\tvar submenu_parent = $(this).parent();\n\tvar submenu = submenu_parent.children('.sub-menu');\n\tvar submenu_button = $(this);\n\n\t$('.second-tier >.menu-item-has-children > button').attr('aria-expanded', 'false');//Set all buttons to exanded=false\n\n\tif ( submenu_parent.hasClass('expanded') ) {\n\t\tsubmenu_parent.removeClass('expanded');//toggles the menu shut\n\t\tsubmenu_button.attr('aria-expanded', 'false');\n\t\tsetTimeout(function () {\n\t\t\tsubmenu.addClass('hidden');\n\t\t}, 200);\n\t//SHOW MENU\n\t}else{\n\t\t$('.second-tier .menu-item-has-children').removeClass('expanded');//Collapse any other open menus\n\t\t$('.second-tier .menu-item-has-children .sub-menu').addClass('hidden');//Collapse any other open menus\n\t\tsubmenu.removeClass('hidden');\n\n\t\tsetTimeout(function () {\n\t\t\tsubmenu_parent.addClass('expanded');\n\t\t\tsubmenu_button.attr('aria-expanded', 'true');\n\t\t\theader.addClass('temp_solid_bg');\n\t\t\t//modal.show();\n\t\t}, 200);\n\t}\n});\n\n// Mobile: close sub-menu\n$('button.mobile_menu_subheading, .modal_overlay').on('click', function(){\n\t$(this).parent().parent().removeClass('expanded');\n\tmenu.attr('aria-expanded', 'false');\n\tmenu.find('li.expanded').removeClass('expanded');\n\t//modal.hide();\n});\n\n//Close menu with Escape key\n$(document).on('keyup', function(e) {\n\n\tif (e.key == \"Escape\") {\n\t\t//Hide 3rd-tier menu\n\t\tif( $('.second-tier >.menu-item-has-children').hasClass('expanded') ){\n\t\t\t$('.second-tier >.menu-item-has-children').removeClass('expanded');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('.second-tier >.menu-item-has-children .sub-menu').addClass('hidden');\n\t\t\t\t$('.second-tier >.menu-item-has-children>button').attr('aria-expanded', 'false');\n\t\t\t}, 200);\n\t\t}else{\n\t\t\t//Hide 3rd-tier menu\n\t\t\tif( $('#menu-main-navigation >.menu-item-has-children').hasClass('expanded') ){\n\t\t\t\t$('#menu-main-navigation >.menu-item-has-children').removeClass('expanded');\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t$('#menu-main-navigation >.menu-item-has-children .sub-menu').addClass('hidden');\n\t\t\t\t\t$('#menu-main-navigation >.menu-item-has-children>button').attr('aria-expanded', 'false');\n\t\t\t\t\tmodal.hide();\n\t\t\t\t}, 200);\n\t\t\t}\n\t\t}\n\t\t\n\t}\n});\n\n\n\n//hover\n$(function() {\n $('#menu-main-navigation >.menu-item-has-children').hover( function(){\n \n if ($( document ).width() > 1024)\n { \t \n\t $('#menu-main-navigation > li.expanded > ul').removeClass('hidden');\n\t $('#menu-main-navigation > li.expanded button').attr('aria-expanded','true');\n\t $('#menu-main-navigation > li.expanded').removeClass('.expanded');\n\t \n\t //modal.show();\n\t $(this).find('button').attr('aria-expanded','true');\n\t $(this).addClass('expanded');\n\t $(this).find('.sub-menu.megamenu.second-tier').removeClass('hidden');\n\n\t \n\t console.log('openned');\n }\n },\n function(){\n\t \n\t if ($( document ).width() > 1024)\n\t {\n\t\t console.log('unhover');\n\n\t\t $('#menu-main-navigation > li > button').attr('aria-expanded','false');\n\t $('#menu-main-navigation > li.expanded > ul').addClass('hidden');\n\t\t $('#menu-main-navigation > li.expanded').removeClass('expanded');\n\t \n\t //modal.hide();\n\t }\n\n });\n});\n\n\nvar testimonial_slider;\nvar testimonial_sliderActive = false;\nvar testimonial_slider_params = {\n\tadaptiveHeight: true,\n\tkeyboardEnabled: true,\n\tmaxSlides: 1,\n\tpagerType: 'short',\n\ttouchEnabled: false,\n\n\tnextText: 'Next Quote',\n\tprevText: 'Previous Quote',\n\t\n\tonSliderLoad: function(){\n\t\ttestimonial_sliderActive = true;\n\t}\n}\n\nfunction testimonial_generate_slides() {\n\ttestimonial_slider = $('.testimonial_carousel .testimonials').bxSlider( testimonial_slider_params );\n}\n\n//Initiate the slides on page-load\ntestimonial_generate_slides();\n\n//If the window gets resized down to mobile, we re-render the slider with different params\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( testimonial_sliderActive === true ) {\n\t\ttestimonial_slider.destroySlider();\n\t\ttestimonial_generate_slides();\n\t}\n});\n\nvar report_slider;\nvar report_sliderActive = false;\nvar report_slider_params = {\n\tkeyboardEnabled: true,\n\tmaxSlides: 1,\n\tpagerType: 'short',\n\ttouchEnabled: false,\n\tnextText: 'Next Report',\n\tprevText: 'Previous Report',\n\tonSliderLoad: function(){\n\t\treport_sliderActive = true;\n\t}\n}\n\nfunction report_generate_slides() {\n\treport_slider = $('.report_carousel').bxSlider( report_slider_params );\n}\n\n\nreport_generate_slides();\n\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( report_sliderActive === true ) {\n\t\treport_slider.destroySlider();\n\t\treport_generate_slides();\n\t}\n});\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '.showmoreless .showmore', function(e) { \n\t\t\n\t\t$(e.target).closest('div.text').find('.showmoreless .showmore').hide();\n\t\t$(e.target).closest('div.text').find('.showmoreless .showless').show();\n\t\t$(e.target).closest('div.text').find('.showmore-list-item').show();\n\t\t\n\t});\n\t\n\t$(document).on(\"click\", '.showmoreless .showless', function(e) { \n\t\t\n\t\t$(e.target).closest('div.text').find('.showmoreless .showmore').show();\n\t\t$(e.target).closest('div.text').find('.showmoreless .showless').hide();\n\t\t$(e.target).closest('div.text').find('.showmore-list-item').hide();\n\t\t\n\t});\n\t\n});\n\njQuery(document).ready(function(){\n\tvar $alert_banner_no = $('.alert_banner').data('alertno');\n if( $('.alert_banner').length ){\n $('.alert_banner__close').on(\"click\", function(){\n $(this).closest('.alert_banner').remove();\n $('body').removeClass('has_alert_banner');\n set_cookie('alert-banner', 'disable_'+$alert_banner_no);\n });\n if (get_cookie('alert-banner')=='disable_'+$alert_banner_no)\n {\n $('body').removeClass('has_alert_banner');\n }\n else\n {\n \t$('.alert_banner').show();\n }\n } \n});\n\nfunction set_cookie(name, value) {\n var date = new Date(),\n expires = 'expires=';\n date.setDate(date.getDate() + 1);\n expires += date.toGMTString();\n document.cookie = name + '=' + value + '; ' + expires + '; path=/';\n}\n\nfunction get_cookie(name) {\n\tvar value = \"; \" + document.cookie;\n\tvar parts = value.split(\"; \" + name + \"=\");\n\tif (parts.length == 2) return parts.pop().split(\";\").shift();\n}\n\nwindow.onbeforeprint = (event) => { \n jQuery(\"[data-aos]\").removeAttr('data-aos');\n};\n\n\nAOS.init({\n\t\n\tdisable: 'mobile', // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function\n\tduration: 1000,\n\tmirror: true,\n\t\n\t// Settings that can be overridden on per-element basis, by `data-aos-*` attributes:\n\tdelay: 500,\n\toffset: 60,\n\tonce: true,\n});\njQuery(document).ready(function(){\n\n\t\n\tif ($('#update-filter-reset').length)\n\t{\n\t\t\n\t\tif (window.location.search!='')\n\t\t{\n\t\t\t$('#update-filter-reset').attr('style','');\n\t\t}\n\t}\n\tif ($('#filter-reset').length)\n\t{\n\t\t\n\t\tif (window.location.search!='')\n\t\t{\n\t\t\t$('.desktop_only #filter-reset').attr('style','');\t\n\t\t\t$('.mobile_only #filter-reset').attr('style','');\t\n\t\t}\n\t}\n\t\n\n\t$(document).on(\"change\", '#filter-grant_amount, #filter-podcast_series, #filter-from_month, #filter-from_year, #filter-to_month, #filter-to_year, #filter-types ', function() { \n\t\t\n\t\t$('#archive-filter form').submit();\n \n\t});\n\t\n\t\n\t$(document).on(\"click\", '#filter-reset', function() { \n\t\t\n\t\tvar togo = $('#archive-base-url').val();\n window.location = $('#archive-base-url').val();\n \n\t});\n\t\n\t$(document).on(\"click\", '#archive-filter .arrow-icon', function() { \n\t\t\n\t\t$('#archive-filter form').submit();\n \n\t});\n\t\n\t$('#filter-keyword').keypress(function (e) {\n\t\t if (e.which == 13) {\n\t\t\t ///$('#archive-filter form').submit();\n\t\t\t $('#filter-submit').click();\n\t\t }\n\t});\n\t\n\n\t$('#show-filter').click(function(){\n\t\t$(this).css('display', 'none');\n\t\t$('#close-filter').css('display', 'block');\n\t\t$('.filter-hide').slideDown();\n\t});\n\n\t$('#close-filter').click(function(){\n\t\t$(this).css('display', 'none');\n\t\t$('#show-filter').css('display', 'block');\n\t\t$('.filter-hide').slideUp();\n\t});\n\t\n\t\n\n\t/* \n\t * ======================\n\t * \toverlay - close filter when click somewhere else\n\t * ======================\n\t */\n\t$('.modal_searchfilter_overlay').click(function(event){\t\n\t\thideAllFilterPopup();\t\t\n\t\t$('.modal_searchfilter_overlay').hide();\t\t\n\t});\n\n\t\n\t\n\t/* \n\t * ======================\n\t * \tCommitment Option - Start\n\t * ======================\n\t */\n\t// commitment selection\n\t$('.commiment_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\n\t\t\n\t\t$('#commitment-options').toggle();\n\n\t\t$('.filter__commitments').addClass('popupopen');\n\t\t$('.filter__commitments').addClass('already-clicked');\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\t\t\n\t\t\n\t});\n\t\n\t$('#commitment-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\t//$('#commitment-options').toggle();\t\n\t\t//hideAllFilterPopup();\n\t\t$('.initiative-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\n\t\t$( \"input.commitment-checkbox\" ).each(function() {\n\t \tif (this.checked)\n\t \t{\n\t \t\tvar commitment_id = $(this).val();\n\t \t\tvar id = $(this).attr('id');\n\t\t\t\t$('#'+id).prop(\"checked\",false);\n\t \t}\n\t\t});\t\t\n\t\t\n\t\tupdateCommitmentDropdownOld();\n\t});\n\t\n\t\n\t$('#old-commitment-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateCommitmentDropdownOld();\n\t\t\n\t\t//$('.filter__commitments #commitment-options').hide();\n\t\t\n\t\t\n\t\t$('#commitment-options').toggle();\t\t\n\t\t\n\t\t//$('#archive-filter form').submit();\n\t});\t\n\t\n\t$('.initiative-checkbox').change(function(event){\t\n\t\t\n\t\tupdateCommitmentDropdownOld();\n\t\t\n\t});\t\n\t\n\t//$('.commitment-checkbox, .initiative-checkbox').click(function(event){\t\n\t$('.commitment-checkbox').click(function(event){\t\n\t\t\t\n\t\t// recheck checkboxes \n\t\tupdateCheckboxAndRadio(this);\n\t\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateCommitmentDropdownOld();\n\t\t\n\t});\t\n\t\n\t$('.initiative-checkbox').click(function(event){\t\n\t\t\n\t\t// recheck checkboxes \n\t\tupdateParentCommitmentCheckbox($(this));\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateCommitmentDropdownOld();\n\t\t\n\t});\t\n\t\n\t\n\t// recheck commitment checkboxes \n\t//updateCheckboxAndRadio();\n\t\n\t// repopulate the text on the dropdown\n\tupdateCommitmentDropdownOld();\n\t\n\t// recheck the parent commitment checkbox\n\tupdateAllParentCommitmentCheckbox();\n\n\t/* ======================\n\t * \n\t * \tCommitment Option - End\n\t * \n\t * ======================\n\t */ \n\n\n\t\n\t/* \n\t * ======================\n\t * \tregion Option - Start\n\t * ======================\n\t */\n\n\t$('.region_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\n\t\t\n\t\t$('.filter__regions').addClass('popupopen');\n\t\t$('.filter__regions').addClass('already-clicked');\n\t\t\n\t\t$('#region-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#region-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\t$('.region-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\t\t\n\t\tupdateRegionDropdownOld();\n\t\t\n\t});\n\t\n\t$('.region-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateRegionDropdownOld();\n\t\t\n\t});\t\n\t\n\t$('#old-region-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateRegionDropdownOld()\n\t \n\t\t$('#region-options').toggle();\t\t\n\t\t\n\t\t//$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateRegionDropdownOld();\n\t\n\t/* \n\t * ======================\n\t * \tregion Option - End\n\t * ======================\n\t */\n\t\n\t\n\t/* \n\t * ======================\n\t * \tvideo Option - Start\n\t * ======================\n\t */\n\n\t$('.video_filter_selection').click(function(){\n\t\thideAllFilterPopup();\n\t\t$('.filter__video-series').addClass('popupopen');\n\t\t$('.filter__video-series').addClass('already-clicked');\n\t\t$('#video-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t\t\n\t});\n\t\n\t$('#video-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\t$('.video-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\t\t\n\t\tupdateVideoDropdown();\n\t\t\t\n\t});\n\t\n\t$('.video-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateVideoDropdown();\n\t\t\n\t});\t\n\t\n\t$('#video-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateVideoDropdown();\n\t \n\t\t$('#video-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateVideoDropdown();\n\t\n\t/* \n\t * ======================\n\t * \tvideo Option - End\n\t * ======================\n\t */\n\n\t\n\t/* \n\t * ======================\n\t * \tpodcast Option - Start\n\t * ======================\n\t */\n\n\t$('.podcast_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\n\t\t$('.filter__podcast-series').addClass('popupopen');\n\t\t$('.filter__podcast-series').addClass('already-clicked');\n\t\t$('#podcast-options').toggle();\n\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#podcast-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\n\t\t$('.podcast-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\t\t\n\t\tupdatePodcastDropdown();\n\t});\n\t\n\t$('.podcast-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdatePodcastDropdown();\n\t\t\n\t});\t\n\t\n\t$('#podcast-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdatePodcastDropdown();\n\t \n\t\t$('#podcast-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdatePodcastDropdown();\n\t\n\t/* \n\t * ======================\n\t * \tpodcast Option - End\n\t * ======================\n\t */\n\t\n\t\n\t/* \n\t * ======================\n\t * \ttype Option - Start\n\t * ======================\n\t */\n\n\t$('.type_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\t\n\t\t\n\t\t$('.filter__types').addClass('popupopen');\n\t\t$('.filter__types').addClass('already-clicked');\n\t\t\n\t\t$('#type-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#type-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\n\t\t$('.type-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\t\t\n\t\tupdateTypeDropdown();\n\t});\n\t\n\t$('.type-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateTypeDropdown();\n\t\t\n\t});\t\n\t\n\t$('#type-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateTypeDropdown();\n\t \n\t\t$('#type-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateTypeDropdown();\n\t\n\t/* \n\t * ======================\n\t * \ttype Option - End\n\t * ======================\n\t */\n\t\n\t\n\t/* \n\t * ======================\n\t * \tgrant Option - Start\n\t * ======================\n\t */\n\n\t$('.grant_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\n\t\t\n\t\t$('.filter__grant').addClass('popupopen');\n\t\t$('.filter__grant').addClass('already-clicked');\n\t\t\n\t\t$('#grant-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#grant-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\t$('.grant-checkbox').each(function() {\n\t\t\tvar id = $(this).attr('id');\n\t\t\t$('#'+id).prop(\"checked\",false);\n\t\t});\n\t\t\n\t\tupdateGrantDropdown()\n\t});\n\t\n\t$('.grant-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateGrantDropdown();\n\t\t\n\t});\t\n\t\n\t$('#grant-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateGrantDropdown()\n\t \n\t\t$('#grant-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateGrantDropdown();\n\t\n\t/* \n\t * ======================\n\t * \tgrant Option - End\n\t * ======================\n\t */\n\t\n\t\n\t\n\t/* \n\t * ======================\n\t * \t from month Option - Start\n\t * ======================\n\t */\n\n\t$('.from_month_filter_selection').click(function(){\n\t\t\n\t\t\n\t\thideAllFilterPopup();\n\t\t\n\t\t$('.filter__from-month').addClass('popupopen');\n\t\t$('.filter__from-month').addClass('already-clicked');\n\t\t\n\t\t\n\t\t$('#from_month-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#from_month-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\t$('#from_month-options').toggle();\t\n\t\thideAllFilterPopup();\n\t});\n\t\n\t$('.from_month-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateFromMonthField();\n\t\t\n\t});\t\n\t\n\t$('#from_month-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateFromMonthField()\n\t \n\t\t$('#from_month-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateFromMonthField();\n\t\n\t/* \n\t * ======================\n\t * \tfrom month Option - End\n\t * ======================\n\t */\n\t\n\t\n\t\n\t/* \n\t * ======================\n\t * \t to month Option - Start\n\t * ======================\n\t */\n\n\t$('.to_month_filter_selection').click(function(){\n\t\t\n\t\thideAllFilterPopup();\n\t\t\n\t\t$('.filter__to-month').addClass('popupopen');\n\t\t$('.filter__to-month').addClass('already-clicked');\n\t\t\n\t\t$('#to_month-options').toggle();\n\t\t\n\t\t// display_overlay\n\t\t$('.modal_searchfilter_overlay').show();\n\n\t});\n\t\n\t$('#to_month-option-cancel').click(function(){\t\t\t\n\t\tevent.preventDefault();\n\t\thideAllFilterPopup();\n\t\t$('#to_month-options').toggle();\t\n\t\t\n\t});\n\t\n\t$('.to_month-checkbox').click(function(event){\t\n\t\t\n\t\t// repopulate the text on the dropdown\n\t\tupdateToMonthField();\n\t\t\n\t});\t\n\t\n\t$('#to_month-option-done').click(function(event){\t\n\t\t\n\t\tevent.preventDefault();\n\t\t\n\t\tupdateToMonthField()\n\t \n\t\t$('#from_month-options').toggle();\t\t\n\t\t\n\t\t$('#archive-filter form').submit();\n\t});\t\n\t\n\tupdateToMonthField();\n\t\n\t/* \n\t * ======================\n\t * \tto month Option - End\n\t * ======================\n\t */\n\t\n\t\n\t\n\t\n\n\t\n});\n\nfunction updateCheckboxAndRadio(ele){\n\t\n\t// all initiative should be unselected\n\t// all child initiative should be selected\n\t//$('.initiative-checkbox').each(function() {\n\t\t//var id = $(this).attr('id');\n\t\t//$('#'+id).prop(\"checked\",false);\n\t//});\n\n\t$( \"input#\"+ele.id ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar commitment_id = $(this).val();\n \t\t\n \t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n \t\t\n \t\t$('.sub-category-commitment-'+commitment_id).each(function() {\n \t\t\tvar id = $(this).attr('id');\n \t\t\t$('#'+id).prop(\"checked\",true);\n \t\t});\n \t}\n \telse\n \t{\n \t\tvar commitment_id = $(this).val();\n \t\t\n \t\t//$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n \t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n \t\t\n \t\t$('.sub-category-commitment-'+commitment_id).each(function() {\n \t\t\tvar id = $(this).attr('id');\n \t\t\t$('#'+id).prop(\"checked\",false);\n \t\t});\n \t\t\n \t}\n \t\n \t\n\t});\n}\n\n\nfunction updateAllParentCommitmentCheckbox(){\n\t\n\t\n\t\n\t$('.initiative-checkbox').each(function() {\n\t\t\n\t\tif (this.checked)\n \t{\n\t\t\tupdateParentCommitmentCheckbox($('#'+this.id));\n \t}\n\t});\n\t\n}\n\n\n\nfunction updateParentCommitmentCheckbox(ele){\n\t\n\tconsole.log(ele.closest('ul').closest('li') );\n\tvar commitment_ele = ele.closest('ul').closest('li').find('> .commitment-checkbox');\n\tvar commitment_id = commitment_ele.val(); \t\n\t\n\tvar allcheckbox = 0;\n\tvar checked = 0;\n\tvar unchecked =0;\n\t$('.sub-category-commitment-'+commitment_id).each(function() {\n\t\tallcheckbox++;\n\t\tif (this.checked)\n\t\t{\n\t\t\tchecked++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunchecked++;\t\t\t\n\t\t}\n\t});\n\t\n\n\tif (allcheckbox==checked)\n\t{\n\t\tcommitment_ele.prop(\"checked\",true);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n\t}\n\t\n\tif (checked!=0 && unchecked!=0)\n\t{\n\t\tcommitment_ele.prop(\"checked\",true);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').addClass(\"somechecked\");\n\t}\n\t\n\tif (allcheckbox==unchecked)\n\t{\n\t\tcommitment_ele.prop(\"checked\",false);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n\t}\t\n\n}\n\n\n\n\nfunction hideAllFilterPopup()\n{\n\t$('fieldset').each(function() {\n\t\t$(this).hide();\n\t});\n\t$('.filter__root').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\n\t$('.filter__from-month').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\t\n\t$('.filter__to-month').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\t\t\n\t\n}\n\nfunction updateCommitmentDropdownOld()\n{\n\tvar isCommitmentNoInitiative = $('.page-template-template-updates_search').length;\n\tvar checkboxType = 'checkbox';\n\t//if (isCommitmentNoInitiative > 0)\n\t//\tcheckboxType = 'radio'\t\n if (isCommitmentNoInitiative==0)\n {\n \tisCommitmentNoInitiative = $('.post-type-archive-grant').length;\n }\n\n\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalCommitment = '';\n var firstCommitment = '';\n var countCommitment = 0;\n $( \"input.commitment-checkbox[type=\"+checkboxType+\"]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"commitment-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t \n \t\t // find all sub initiative\n \t\t $('.sub-category-commitment-'+cat_id+'[type=checkbox]').each(function() {\n \t\t\t number_sub_initiative++;\n \t\t });\n \t\t \n \t\t if (countCommitment==0) firstCommitment = label;\n \n \t\t countCommitment++;\n \t}\n \tfinalCommitment = trimChar(str,' ');\n \tfinalCommitment = trimChar(finalCommitment,',');\n\n \t\n });\n\n\tvar finalInitiative = \"\";\n var count = 0;\n var firstInitiative = \"\";\n $( \"input.initiative-checkbox[type=\"+checkboxType+\"]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tif (count==0)\n \t\t{\n \t\t\tvar inititative_id = $( this ).val();\n \t\t\tvar label = $('label[for=\"initiative-'+inititative_id+'\"]').html();\n \t\t\tfirstInitiative = label;\n \t\t} \t\t\n \t\tcount++; \t\t\n \t}\t \t\n });\n \n /*\n var inittext ='Initiative';\n if (count>1)\n \tinittext ='Initiatives'; \n finalInitiative = '('+count+' '+inittext+')';\n \n if (finalCommitment=='')\n {\n \tfinalCommitment = '';\n \tfinalInitiative = '';\n }\n else\n {\n \tfinalCommitment = finalCommitment+' '\n }\n \t\n\t$('a .current-commitment-selection').html(finalCommitment);\n\t$('a .current-initiative-selection').html(finalInitiative);\n\t*/\n \n if (isCommitmentNoInitiative > 0)\n\t{\n \tfinalInitiative = '';\n \tif (countCommitment>1)\n \t\tfinalCommitment = countCommitment+' Selected'\n \telse\n \t\tfinalCommitment = firstCommitment;\n\t}\n else\n {\n\t if (count==1)\n\t\t{\n\t \tfinalInitiative =firstInitiative; \n\t \tfinalCommitment = '';\n\t\t}\n\t else if (count==0)\n\t {\n\t \tfinalInitiative = '';\n\t \tfinalCommitment = '';\n\t }\n\t else\n\t {\n\t \tfinalCommitment = '';\n\t \tfinalInitiative = count+' Selected';\n\t }\n }\n\n\t$('a .current-commitment-selection').html(finalCommitment);\n\t$('a .current-initiative-selection').html(finalInitiative);\n\n}\n\nfunction updateRegionDropdownOld()\n{\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalRegion = '';\n var count = 0;\n var first = '';\n $( \"input.region-checkbox[type=radio]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"region-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalRegion = trimChar(str,' ');\n \tfinalRegion = trimChar(finalRegion,',');\n });\n\n \t\n if (count>1)\n {\n \t//var temp = count - 1;\n \tfinalRegion = count+' Selected';\n }\n else if (count==1)\n {\n \tfinalRegion = first;\n }\n\t$('a .current-region-selection').html(finalRegion);\n}\n\n\nfunction updateVideoDropdown()\n{\n\tvar str = \"\";\n \n var finalVideo = '';\n var count = 0;\n var first = '';\n $( \"input.video-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"video-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalVideo = trimChar(str,' ');\n \tfinalVideo = trimChar(finalVideo,',');\n });\n\n \n if (count>1)\n {\n \t//var temp = count - 1;\n \t//finalVideo = first+' (+'+temp+')';\n \tfinalVideo = count+' Selected';\n } \n else if (count==1)\n {\n \tfinalVideo = first;\n }\n\n\t$('a .current-video-selection').html(finalVideo);\n}\n\nfunction updatePodcastDropdown()\n{\n\tvar str = \"\";\n \n var finalPodcast = '';\n var count = 0;\n var first = '';\n $( \"input.podcast-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"podcast-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalPodcast = trimChar(str,' ');\n \tfinalPodcast = trimChar(finalPodcast,',');\n });\n\n if (finalPodcast=='')\n {\n \tfinalPodcast = '';\n } \n if (count>1)\n {\n \t//var temp = count - 1;\n \t///finalPodcast = first+' (+'+temp+')';\n \tfinalPodcast = count+' Selected';\n }\n else if (count==1)\n {\n \tfinalPodcast = first;\n }\n\t$('a .current-podcast-selection').html(finalPodcast);\n}\n\n\nfunction updateTypeDropdown()\n{\n\tvar str = \"\";\n \n var finalType = '';\n var count = 0;\n var first = '';\n $( \"input.type-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"type-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalType = trimChar(str,' ');\n \tfinalType = trimChar(finalType,',');\n });\n\t\n if (count>1)\n {\n \t//var temp = count - 1;\n \t//finalType = first+' (+'+temp+')';\n \tfinalType = count+' Selected';\n }\n else if (count==1)\n {\n \tfinalType = first;\n }\n\t$('a .current-type-selection').html(finalType);\n}\n\nfunction updateGrantDropdown()\n{\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalGrant = '';\n var count = 0;\n var first = '';\n $( \"input.grant-checkbox[type=radio]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"grant-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalGrant = trimChar(str,' ');\n \tfinalGrant = trimChar(finalGrant,',');\n });\n\n \t\n if (count>1)\n {\n \tfinalGrant = count+' Selected';\n }\n\t$('a .current-grant-selection').html(finalGrant);\n}\n\n\n\nfunction setFromMonthValue(monthNumber){\n\t\n\t$('#from_month').val(monthNumber);\n\t\n\tupdateFromMonthField();\n\t\n\t$('#archive-filter form').submit();\t\n}\n\nfunction updateFromMonthField()\n{\n\tvar monthNumber = $('#from_month').val();\n\t\n\tvar monthName = '';\n\tif (monthNumber=='1')\n\t\tmonthName = 'Jan';\n\tif (monthNumber=='2')\n\t\tmonthName = 'Feb';\n\tif (monthNumber=='3')\n\t\tmonthName = 'Mar';\n\tif (monthNumber=='4')\n\t\tmonthName = 'Apr';\n\tif (monthNumber=='5')\n\t\tmonthName = 'May';\n\tif (monthNumber=='6')\n\t\tmonthName = 'Jun';\n\tif (monthNumber=='7')\n\t\tmonthName = 'Jul';\n\tif (monthNumber=='8')\n\t\tmonthName = 'Aug';\n\tif (monthNumber=='9')\n\t\tmonthName = 'Sep';\n\tif (monthNumber=='10')\n\t\tmonthName = 'Oct';\t\t\n\tif (monthNumber=='11')\n\t\tmonthName = 'Nov';\n\tif (monthNumber=='12')\n\t\tmonthName = 'Dec';\t\n\n\tif (monthNumber=='')\n\t{\n\t\t$('.current-from_month-selection').html('Month');\t\n\t}\n\telse\n\t{\n\t\t$('a .current-from_month-selection').html(monthName);\n\t}\n\t\n}\n\n\n\n\nfunction setToMonthValue(monthNumber){\n\t\n\t$('#to_month').val(monthNumber);\n\t\n\tupdateToMonthField();\n\t\n\t$('#archive-filter form').submit();\t\n}\n\nfunction updateToMonthField()\n{\n\tvar monthNumber = $('#to_month').val();\n\t\n\tvar monthName = '';\n\tif (monthNumber=='1')\n\t\tmonthName = 'Jan';\n\tif (monthNumber=='2')\n\t\tmonthName = 'Feb';\n\tif (monthNumber=='3')\n\t\tmonthName = 'Mar';\n\tif (monthNumber=='4')\n\t\tmonthName = 'Apr';\n\tif (monthNumber=='5')\n\t\tmonthName = 'May';\n\tif (monthNumber=='6')\n\t\tmonthName = 'Jun';\n\tif (monthNumber=='7')\n\t\tmonthName = 'Jul';\n\tif (monthNumber=='8')\n\t\tmonthName = 'Aug';\n\tif (monthNumber=='9')\n\t\tmonthName = 'Sep';\n\tif (monthNumber=='10')\n\t\tmonthName = 'Oct';\t\t\n\tif (monthNumber=='11')\n\t\tmonthName = 'Nov';\n\tif (monthNumber=='12')\n\t\tmonthName = 'Dec';\t\n\n\tif (monthNumber=='')\n\t{\n\t\t$('.current-to_month-selection').html('Month');\t\n\t}\n\telse\n\t{\n\t\t$('a .current-to_month-selection').html(monthName);\n\t}\n\t\n}\n\n\n\nfunction trimChar(string, charToRemove) {\n while(string.charAt(0)==charToRemove) {\n string = string.substring(1);\n }\n\n while(string.charAt(string.length-1)==charToRemove) {\n string = string.substring(0,string.length-1);\n }\n\n return string;\n}\n\n\t\n\t\n\n// update the hidden field for the search bar\nfunction updateSubmenuSelection(field_id,field_value)\n{\n\t$('#'+field_id).val(field_value);\n\t\n\t// maybe need to ajax later\n\t//$('#archive-filter form').submit();\t\n\t\n\t$('#filter-submit').click();\n}\n\nfunction focusArchiveFilter(){\n\tvar url = window.location.search;\n\tif ( url.match(\"filter_news_types\") !== null) {\n\t\tif (url.match(\"filter_news_types\").length > 0) {\n\t\t\t$('#archive-submenu .item.active a').focus();\n\t\t}\n\t}\n}\nfocusArchiveFilter();\n\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '#archive-loadmore button', function() { \n\t\tvar nextPage = $('#archive-loadmore button').attr('href');\n \n // remove old next button\n $('#archive-loadmore').remove();\n //Show \"Loading\" GIF\n $('button.loading').show().focus();\n \n $.get( nextPage, function( data ) {\n \t\n \t// check number of result and update the result number for grant\n \tvar tofind = '
    '+data+'
    ';\n \tvar tofindEle = $('
    '+data+'
    ');\n \t\n \tvar numerOfResult = tofindEle.find('.number-of-results').val();\n \t$(\"#number-of-result\").html(numerOfResult);\n\n \tvar tobe_first_result_month_year_group = tofindEle.find('#first_result_month_year_group').val();\n \tvar tobe_last_result_month_year_group = tofindEle.find('#last_result_month_year_group').val();\n \tvar current_first_month_group = $('#first_result_month_year_group').val();\n \tvar current_last_month_group = $('#last_result_month_year_group').val();\n \t$('#last_result_month_year_group').val(tobe_last_result_month_year_group);\n\n \tif (current_last_month_group==tobe_first_result_month_year_group)\n \t{\n \t\ttofindEle.find('#'+tobe_first_result_month_year_group).remove();\n \t}\n \ttofindEle.find('#first_result_month_year_group').remove();\n \ttofindEle.find('#last_result_month_year_group').remove();\n \t\n \tvar newData = '
    '+tofindEle.html()+'
    ';\n \t$(\".wrapper .content-wrapper #placeholder-next-posts\").before( newData ); \t\n \t$(\".to-expand\").toggle('expand');\n\n // Set focus on first new link\n $(\".to-expand\").find('a').first().focus();\n\n }).done(function() {\n // hide loading button\n $('button.loading').hide();\n });\n \n $( \".to-expand\" ).each(function(index) {\n $(this).removeClass('to-expand'); \n });\n\t});\n\t\n});\n\njQuery(document).ready(function(){\n jQuery(function( $ ){\n border();\n });\n});\n\njQuery(document).on('DOMNodeInserted', '.postlist', function(e) {\n border();\n});\n\nvar border = function() {\n const months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n $('.tease').each(function(index, item) {\n if(($(item).prev(\".tease\").attr('class') !== undefined)){\n for ( var i = 0; i < months.length; i++ )\n {\n if ( $(item).hasClass( months[i] ))\n {\n $thismonth = months[i];\n if($(item).prev(\".tease\").hasClass($thismonth)){\n }else{\n $(item).addClass(\"top-border\");\n $(item).css(\"border-top\", \"5px solid yellow\");\n }\n break;\n }\n }\n }\n });\n}\n\nfunction onYouTubeIframeAPIReady() {\n\tif ($(window).width() > 767) {\n\t\tvar player;\n\t\tvar youtubeID = $('#YouTubeBackgroundVideoPlayer').data('youtubeid');\n\t\tplayer = new YT.Player('YouTubeBackgroundVideoPlayer', {\n\t\t\tvideoId: youtubeID, // YouTube Video ID\n\t\t\twidth: 1280, // Player width (in px)\n\t\t\theight: 720, // Player height (in px)\n\t\t\tplayerVars: {\n\t\t\t\tplaylist: youtubeID,\n\t\t\t\tautoplay: 1, // Auto-play the video on load\n\t\t\t\tautohide: 1,\n\t\t\t\tdisablekb: 1, \n\t\t\t\tcontrols: 0, // Hide pause/play buttons in player\n\t\t\t\tshowinfo: 0, // Hide the video title\n\t\t\t\tmodestbranding: 1, // Hide the Youtube Logo\n\t\t\t\tloop: 1, // Run the video in a loop\n\t\t\t\tfs: 0, // Hide the full screen button\n\t\t\t\tautohide: 0, // Hide video controls when playing\n\t\t\t\trel: 0,\n\t\t\t\tenablejsapi: 1,\n\t\t\t\tmute: true\n\t\t\t},\n\t\t\tevents: {\n\t\t\t\tonReady: function(e) {\n\t\t\t\t\te.target.mute();\n\t\t\t\t\te.target.setPlaybackQuality('hd1080');\n\n\t\t\t\t},\n\t\t\t\tonStateChange: function(e) {\n\t\t\t\t\tif(e && e.data === 1){\n\t\t\t\t\t\tvar videoHolder = $('.video_background');\n\t\t\t\t\t\tvideoHolder.addClass('video_ready');\n\t\t\t\t\t}else if(e && e.data === 0){\n\t\t\t\t\t\te.target.playVideo();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t \t});\n\t}\n}\n$( \".bigbet_download_section li .checkbox\" )\n .on( \"mouseup\", function() {\n\t setTimeout(function(){\n\t\t $( \".bigbet_download_section li .checkbox\" ).removeClass( \"pressed\" );\t \n\t\t}, 1000);\t \n\t $( this ).find('.checkmark').attr('style','scale: 1.0;');\n } )\n .on( \"mousedown\", function() {\n\t $( this ).addClass( \"pressed\" );\n\t $( this ).find('.checkmark').attr('style','scale: 0.85;');\n } );\n\n\n$('.bigbet_download_section .checkbox input').change(function() {\n var number_of_element = $(this).closest('.bigbet_download_section').find(':checked').length;\n if (number_of_element>0)\n \t$(this).closest('.bigbet_download_section').find('.cta').show(); \n else\n \t$(this).closest('.bigbet_download_section').find('.cta').attr('style','display:none'); \n \n});\n\n$(document).ready(function(){\n\t$( \".bigbet_download_section li .checkbox\" ).attr('checked','');\n\t$('.bigbet_download_section li :checkbox:checked').prop('checked',false);\n\t\n\tvar number_of_element = $('.bigbet_download_section :checked').length;\n if (number_of_element>0)\n \t$('.bigbet_download_section cta').show(); \n else\n \t$('.bigbet_download_section cta').attr('style','display:none'); \n \n $( \".bigbet_download_section li p\" ).click(function(event){\n \t$(event.target).closest('li').find('.checkbox').click();\n });\n \n});\n/* Initialize jQuery Colorbox*/\njQuery(document).ready(function(){\n\n if( $('.video-button').length ){\n $.getScript(\"https://www.youtube.com/player_api\", function(){});\n }\n\t\n\tjQuery(function( $ ){\n\n $( \".video-button\" ).each(function(index) {\n $(this).on(\"click\", function(){\n var video_id = $(this).closest('.video-embed-container').find('.video-id').html().trim();\n \n // add class video popup section\n $('#colorbox').addClass('video-popup');\n jQuery(this).colorbox({\n html : '
    ', \n opacity: 0.5, \n close:'
    X
    ', \n overlayClose: true,\n escKey:true,\n trapFocus:true,\n onComplete: function() {\n player = new YT.Player('ytplayer', {\n height: '390',\n width: '640',\n playerVars: {autoplay:1, enablejsapi:1},\n videoId: video_id,\n events: {\n 'onReady': function(event){\n },\n 'onStateChange': function(event){\n if(event.data == 0) {\n player.stopVideo();\n $(window).colorbox.close();\n }\n }\n }\n });\n $(\"#cboxWrapper\").on(\"click\", function(){\n player.stopVideo();\n $(window).colorbox.close();\n // remove class video popup section\n $('#colorbox').removeClass('video-popup');\n }).children().on(\"click\", function (e) {\n e.stopPropagation();\n });\n },\n onCleanup:function(){\n player.stopVideo();\n player.destroy();\n $(\"#cboxWrapper\").unbind();\n $('body').removeClass('open-popup');\n } \n });\n });\n });\n $('.file-gated-download').each(function(index) {\n $(this).on(\"click\", function(){\n \t\n var downloadUrl = $(this).closest('.gated-download-button-container').find('.download-url').val();\n \t$('#gated-download-form').find('form .gform_body .gfield .gform_hidden').val(downloadUrl);\n\n \t\n var fileDownloadUrl = $(this).closest('.gated-download-button-container').find('.file-download-url').val();\n \t$('#gated-download-form #file-download-url').val(fileDownloadUrl);\n $('#gated-download-form #input_28_15').val(fileDownloadUrl);\n $('#gated-download-form .btn_just_download').attr('href', fileDownloadUrl);\n $('#gated-download-form .gform_heading').append( '\"\"' );\n $('.gform_next_button').addClass(\"download\");\n\n //var fileDownloadReportTitle = $(this).closest('.gated-download-button-container').find('.download-report-name').val();\n //var form_title = $('#gated-download-form .gform_title').text();\n //form_title.text(form_title+'

    '+ fileDownloadReportTitle +'

    ');\n \n \n // add class in download button\n $('body').addClass('open-popup');\n $('#colorbox').addClass('pdf-download');\n\n jQuery(this).colorbox({\n html : '
    ',\n opacity: 0.5,\n close:'
    X
    ', \n overlayClose: true,\n scrolling: false,\n escKey:true,\n trapFocus:true,\n onComplete: function() {\n $( \".gfield_select\" ).each(function(index) {\n $(this).select2();\n });\n $('#gated-download-form').find('.html-embed-inner').appendTo(\".destination\"); \n $(\"#cboxWrapper, .btn_just_download\").on(\"click\", function(){\n $(window).colorbox.close();\n // remove class in download button\n $('body').removeClass('open-popup');\n $('#colorbox').removeClass('pdf-download');\n\n }).children().on(\"click\", function (e) {\n e.stopPropagation();\n });\n },\n onCleanup:function(){\n $('#colorbox .destination .html-embed-inner').appendTo($('#gated-download-form'));\n $(\"#cboxWrapper\").unbind();\n $('body').removeClass('open-popup');\n }\n }); \n });\n });\n $( '.newsletter-modal').each(function(index) {\n $(this).on(\"click\", function(){\n\t\n\t\t\tif ($('#override_newsletter_url').length)\n\t\t\t{\n\t\t\t\twindow.location.href = $('#override_newsletter_url').val();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n // add class in newsletter button\n $('body').addClass('open-popup');\n $('#colorbox').addClass('newsletter-signup');\n \tjQuery(this).colorbox({\n html : '
    ',\n opacity: 0.5,\n close:'
    X
    ', \n overlayClose: true,\n scrolling: false,\n escKey:true,\n trapFocus:true,\n onComplete: function() { \n \t$('.newsletter-html-embed-container').find('.html-embed-inner .gform_wrapper').attr('style','');\n $('.newsletter-html-embed-container').find('.html-embed-inner').appendTo(\".footer-destination\");\n $(\"#cboxWrapper\").on(\"click\", function(){\n $(window).colorbox.close();\n // remove class in newsletter button\n $('body').removeClass('open-popup');\n $('#colorbox').removeClass('newsletter-signup'); \n // hide the extra submit button\n $('.footer-destination .gform_footer input[type=submit]').hide();\n }).children().on(\"click\", function (e) {\n e.stopPropagation();\n });\n },\n onCleanup:function(){\n $('#colorbox .footer-destination .html-embed-inner').appendTo($('.newsletter-html-embed-container .html-embed'));\n $(\"#cboxWrapper\").unbind();\n $('body').removeClass('open-popup');\n },\n onClosed:function(){\n $('body').removeClass('open-popup');\n console.log('signup form closed');\n }\n }); \n });\n });\n\n $( \".cboxclose, #cboxOverlay\" ).each(function(index) {\n $(this).on(\"click\", function(){\n $(this).colorbox.close();\n $('body').removeClass('open-popup');\n });\n });\n $('#cboxClose').on('click', function(){\n $('body').removeClass('open-popup');\n console.log('signup form closed');\n });\n\n\t});\n \n});\nvar latest_content_slider;\nvar latest_content_sliderActive = false;\nvar latest_content_slider_params = {\n\tkeyboardEnabled: true,\n\tmaxSlides: 1,\n\tpagerType: 'short',\n\ttouchEnabled: false,\n\n\tnextText: 'Next Update',\n\tprevText: 'Previous Update',\n\n\tonSliderLoad: function(){\n\t\tlatest_content_sliderActive = true;\n\t}\n}\n\nfunction latest_content_generate_slides() {\n\tlatest_content_slider = $('.latest_content_carousel').bxSlider( report_slider_params );\n}\n\nlatest_content_generate_slides();\n\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( latest_content_sliderActive === true ) {\n\t\tlatest_content_slider.destroySlider();\n\t\tlatest_content_generate_slides();\n\t}\n});\njQuery(document).ready(function(){\n\t$('.gfield input').focus(function(){\n\t\t$(this).parent().parent().addClass('show-label');\n\t\t$('.gfield .ginput_complex input').parent().parent().parent().addClass('show-label');\n\t});\n\t$('.gfield select').change(function(){\n\t\t$(this).parent().parent().addClass('show-label');\n\t});\n});\n\n/* Initialize jQuery Colorbox*/\njQuery(function( $ ){\n $( \".content-block\" ).each(function(i) {\n var statsvertical = $('.col-lg-6:nth-child(2).bigstats');\n var chartfirst = $('.col-lg-6:nth-child(1).chart');\n var secondrow = $('.row2 .last-section-chart');\n if( statsvertical ){\n statsvertical.parent().addClass('has-statsvertical'); \n }\n if( chartfirst ){\n chartfirst.parent().parent().addClass('has-chartfirst'); \n }\n if( secondrow ){\n secondrow.parent().parent().addClass('chart-lastrow'); \n }\n });\n});\n\njQuery(document).ready(function(){\n if( $('#cookie_policy').length ){\n $('.cookie_policy__close').on(\"click\", function(){\n $('#cookie_policy').remove();\n set_cookie('cookie-banner', 'disable');\n }); \n if (get_cookie('cookie-banner')=='disable')\n {\n \t$('#cookie_policy').remove();\n }\n else\n {\n \t$('#cookie_policy').addClass('show');\n }\n }\n\n});\n\nfunction set_cookie(name, value) {\n var date = new Date(),\n expires = 'expires=';\n date.setDate(date.getDate() + 364);\n expires += date.toGMTString();\n document.cookie = name + '=' + value + '; ' + expires + '; path=/';\n}\n\nfunction get_cookie(name) {\n\tvar value = \"; \" + document.cookie;\n\tvar parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}\n(function($) {\n\tvar urlParams = new URLSearchParams(window.location.search);\n\tmyParam = urlParams.get(\"debug\");\n\n\tif (myParam == \"true\") {\n\t\tvar bs4Overlay = (function() {\n\t\t\t$(\"body #content\").append(\n\t\t\t\t'
    Toggle Grid(Hide)
    '\n\t\t\t);\n\n\t\t\tvar doc_height = $(document).height(),\n\t\t\t\tbs4_overlay = $(\"#bs4_overlay\"),\n\t\t\t\tbs4_toggle = $(\"#bs4_toggle\"),\n\t\t\t\tcol_count = 12,\n\t\t\t\tcol_html = \"\";\n\n\t\t\tfor (var i = col_count - 1; i >= 0; i--) {\n\t\t\t\tcol_html += '
    ';\n\t\t\t}\n\n\t\t\tbs4_overlay\n\t\t\t\t.height(doc_height)\n\t\t\t\t.append(\n\t\t\t\t\t'
    ' +\n\t\t\t\t\t\tcol_html +\n\t\t\t\t\t\t\"
    \"\n\t\t\t\t);\n\t\t\tbs4_overlay.find(\"i\").height(doc_height);\n\n\t\t\tbs4_toggle.on(\"click\", \".toggle\", function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbs4_overlay.toggleClass(\"active\");\n\t\t\t});\n\n\t\t\tbs4_toggle.on(\"click\", \".close\", function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbs4_toggle.addClass(\"hidden\");\n\t\t\t});\n\t\t})();\n\t}\n})(jQuery);\n\n/*\njQuery(document).ready(function(){\n\t$(document).ready(function(){\n\t\tvar featuredupdate_height = $('.featured-update .owl-item').height();\n\t\t$('.featured-update .owl-item .featured-update__content').css('height', featuredupdate_height);\n\t});\n});\n*/\n\n\nvar feature_update_slider;\nvar feature_update_sliderActive = false;\nvar feature_update_slider_params = {\n\t\n\tnextText: 'Next Slide',\n\tprevText: 'Previous Slide',\n\n\tkeyboardEnabled: true,\n\tmaxSlides: 1,\n\tpagerType: 'short',\n\ttouchEnabled: false,\n\tonSliderLoad: function(){\n\t\tfeature_update_sliderActive = true;\n\t}\n}\n\nfunction feature_update_generate_slides() {\n\tfeature_update_slider = $('.component.featured-update .feature-carousel').bxSlider( feature_update_slider_params );\n}\n\n//Initiate the slides on page-load\nfeature_update_generate_slides();\n\n//If the window gets resized down to mobile, we re-render the slider with different params\n$(window).on(\"debouncedresize\", function( event ) {\n\tif( feature_update_sliderActive === true ) {\n\t\tfeature_update_slider.reloadSlider();\n\t}\n});\n\n// Observer watches the feature carousel for style attr changes to fire function\n// When function fires, we loop through all slides and find the ones with aria-hidden: true\n// Then we apply the inert attribute to disabled tabbing for those slides to solve ADA issue\nconst callback = (mutationList, observer) => {\n\tfor (const mutation of mutationList) {\n\t\tif (mutation.type === 'attributes') {\n\t\t\tvar slides = $(\".update\");\n\t\t\tslides.each(function(idx, li) {\n\t\t\t\tvar slide = $(li);\n\t\t\t\tif (slide.attr('aria-hidden') == 'true') {\n\t\t\t\t\tslide.attr('inert', '');\n\t\t\t\t} else {\n\t\t\t\t\tslide.removeAttr('inert', '');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n};\n\nfunction featureCarouselObserver() {\n\tvar featureCarousel = document.getElementsByClassName('feature-carousel')[0];\n\tconst carouselObserver = new MutationObserver(callback);\n\tif (featureCarousel) {\n\t\tcarouselObserver.observe(featureCarousel, { attributes: true });\n\t} else {\n\t\treturn null;\n\t}\n}\n\nfeatureCarouselObserver();\n//Give each flourish iframe a unique title attribute for accessibility\n\nvar flourish_number = 0;\n\nsetTimeout(function() { \n\t$('.flourish-embed').each(function( index ) {\n\n\t\tvar this_embed = $(this);\n\t\t\n\t\tfl_title = $(this).attr('title');\n\t\tif (typeof fl_title == 'undefined') {\n\t\t\tfl_title = \"Interactive or visual content \"+flourish_number;\n\t\t}\n\t\tflourish_number++;\n\n//console.log( fl_title );\n\n\t\tthis_embed.find(\"iframe\").attr('title', fl_title);\n//console.log( this_embed.find(\"iframe\") );\t\n\t});\n}, 2000);\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '#global-loadmore button', function() { \n\n\t\tvar nextPage = $('#global-loadmore button').attr('href');\n\n // remove old next button\n $('#global-loadmore').remove();\n \n \n console.log(nextPage); \n $.get( nextPage, function( data ) {\n \t\n \t// check number of result and update the result number for grant\n \tvar tofind = '
    '+data+'
    ';\n \t//var numerOfResult = $(tofind).find('.number-of-results').val();\n \t//$(\"#number-of-result\").html(numerOfResult);\n \t\n \tconsole.log(data);\n \t\n \tvar content = $(tofind).find('.post-list');\n \tcontent.attr('style','display:none');\n \tcontent.addClass('to-expand');\n \t\n \tvar loadmore = $(tofind).find('#global-loadmore');\n \t$(\"#placeholder-next-posts\").before( content ); \n \t$(\"#placeholder-next-posts\").after( loadmore ); \n \t$(\".to-expand\").toggle('expand');\n \t$(\".to-expand\").removeClass('to-expand');\n \t\n });\n\n $( \".to-expand\" ).each(function(index) {\n $(this).removeClass('to-expand'); \n });\n\t});\n\t\n});\n\n$(document).ready(function(){\n\n\t$(document).on(\"click\", '#global-filter-clear', function(event) {\n\t\tevent.preventDefault();\n\t\t$('#filter-keyword').val('');\n\t});\n\t\n\t$(document).on(\"click\", '#global-filter-search', function() { \n\t\t$('#global-filter form').submit();\n\t});\n\t\n\t$('#filter-keyword').keypress(function (e) {\n\t\t if (e.which == 13) {\n\t\t \t $('#global-filter form').submit();\n\t\t }\n\t});\n\t\n\n\t$(document).on(\"click\", '.search-overlay', function(event) {\n\t\t$('#global-filter-clear').hide();\n\t\t$('.search-overlay').hide();\n\t\t$('#tooltipSearchSuggestions').hide();\t\t\n\t});\n\t\n\n\t/*\n\t\t\n\t\t\n\t$(document).ready(function() {\n\t\t\n\t\t$(\"#global-filter-clear\").click(function() {\n\t\t\t$(\"#filter-keyword\").val(\"\");\n\t\t\tupdateTooltipSearch();\n\t\t});\n\t\t\n\t\t$(\"#filter-keyword\").keyup(delay(function (e) {\n\t\t\tconsole.log('Time elapsed!', this.value);\n\t\t\tupdateTooltipSearch();\n\t\t}, 500));\n\t\t\n\t\t$(\"#filter-keyword\").change(function() {\n\t\t\tupdateTooltipSearch();\n\t\t});\n\t\t\n\t\t$( \"#filter-keyword\" ).focus(function() {\n\t\t\tupdateTooltipSearch();\n\t\t});\n\t\t\n\t\t\n\t});\n\t\n\t*/\n\t\t\n\t\n\tfunction delay(callback, ms) {\n\t var timer = 0;\n\t return function() {\n\t var context = this, args = arguments;\n\t clearTimeout(timer);\n\t timer = setTimeout(function () {\n\t callback.apply(context, args);\n\t }, ms || 0);\n\t };\n\t}\n\t\n\tfunction updateTooltipSearch() {\n\t\n\t\t$(\".tobeloaded\").addClass('loading');\n\t\t\n\t\tvar squery = $(\"#filter-keyword\").val().toLowerCase();\t\n\t\tvar tooltips = '';\n\t\tvar results = 0;\n\t\tif (squery.length > 1) {\n\t\t\t\n\t\t\ttooltips = \"\";\n\t\t\tbaseUrl = $('#global-base-url').val()+'&ajax=true';\n\t\t\t\t\t\t\n\t\t\t$.ajax({\n\t\t\t\t url: baseUrl,\n\t\t\t\t type: 'GET',\n\t\t\t\t dataType: \"json\",\n\t\t \n\t\t\t\t data: {\n\t\t\t\t action: 'globalsearch',\n\t\t\t\t keyword: squery,\n\t\t\t\t },\n\t\t\t\t success: function(msg){\n\t\t\t\t\n\t\t\t\t\t if (msg.length==0)\n\t\t\t\t\t {\n\t\t\t\t\t\t tooltips = \"
      No results found.
      Please try something else.
    \";\n\t\t\t\t\t\t $(\"#tooltipSearchSuggestions\").html(tooltips);\t\n\t\t\t\t\t\t $(\".tobeloaded\").removeClass('loading');\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t tooltips = \"
    \";\n\n\t\t\t\t\t\t $(\".tobeloaded\").removeClass('loading');\n\t\t\t\t\t\t \n\t\t\t\t\t\t $(\"#tooltipSearchSuggestions\").html(tooltips);\t\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t console.log(msg);\n\t\t\t\t },\n\t\t\t});\n\t\t\t\n\t\t\t$(\"#tooltipSearchSuggestions, #global-filter-clear\").fadeIn(222);\n\t\t\t$(\"#search-overlay-div\").show();\n\t\t\t\n\t\t} else {\t\t\t\n\t\t\tif (squery.length == 0) {\n\t\t\t\t$(\"#global-filter-clear\").fadeOut(222);\n\t\t\t\t$(\"#tooltipSearchSuggestions, #global-filter-clear\").fadeOut(222);\n\t\t\t\t$(\"#search-overlay-div\").hide();\t\t\t\t\n\t\t\t} else {\n\t\t\t\ttooltips = \"Enter at least 2 characters\";\n\t\t\t\t$(\"#tooltipSearchSuggestions, #global-filter-clear\").fadeIn(222);\n\t\t\t\t$(\".tobeloaded\").removeClass('loading');\n\t\t\t\t$(\"#search-overlay-div\").show();\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$(\"#tooltipSearchSuggestions\").html(tooltips);\n\t}\n\n});\n\n\n/* Initialize jQuery Colorbox*/\njQuery(document).ready(function(){\n\t\n\t$(\".download-grant button\").on(\"click\", function(event){ \n\t\n\t\tevent.preventDefault();\n\t\tvar form = $('#archive-filter form');\n\t\tvar downLoadOption = $('#download-grant-select').val();\n\t\tvar params = $( form ).serialize();\n\t\tvar path = '';\n\t\tif (window.location.pathname=='/')\n\t\t{\n\t\t\tpath = '';\n\t\t}\n\t\tvar hostUrl = window.location.protocol+ '//' +window.location.hostname + path;\n\t\tvar postUrl = hostUrl+'/?'+params+'&download='+downLoadOption;\n\t\twindow.location.href = postUrl;\n\t\t\n\t});\n \n});\n\n/* Initialize Download via form submission*/\n\njQuery(document).ready(function(){\n\t\n jQuery(document).on('gform_confirmation_loaded', function(){ \t\n \tvar url = $('#file-download-url').val();\n \t//alert(url);\n \t$('.download-gravity-form').remove();\n \t//$('#colorbox').remove();//Close the form modal\n $('button.subscribe').hide();\n $('button.no_thanks').hide();\n //window.open(url, '_blank');\n if( url ) {\n var filename = url.substring(url.lastIndexOf('/')+1);\n download_file(url, filename);\n location.reload();\n }\n });\n \n $('.download-gravity-form').on(\"click\", function(){ \n \t$(this).closest('.container').find('form').submit(); \n });\n $('.download-no-gravity-form').on(\"click\", function(){ \n $('#colorbox').remove();//Close the form modal\n });\n\n $('.subscribe').on(\"click\", function(){ \n \t$(this).closest('.container').find('form').submit(); \n });\n \n});\n\n\n\n/* Helper function */\nfunction download_file(fileURL, fileName) {\n // for non-IE\n if (!window.ActiveXObject) {\n var save = document.createElement('a');\n save.href = fileURL;\n save.target = '_blank';\n var filename = fileURL.substring(fileURL.lastIndexOf('/')+1);\n save.download = fileName || filename;\n\t if ( navigator.userAgent.toLowerCase().match(/(ipad|iphone|safari)/) && navigator.userAgent.search(\"Chrome\") < 0) {\n\t\t\t\tdocument.location = save.href;\n// window event not working here\n\t\t\t}else{\n\t\t var evt = new MouseEvent('click', {\n\t\t 'view': window,\n\t\t 'bubbles': true,\n\t\t 'cancelable': false\n\t\t });\n\t\t save.dispatchEvent(evt);\n\t\t (window.URL || window.webkitURL).revokeObjectURL(save.href);\n\t\t\t}\t\n }\n\n // for IE < 11\n else if ( !! window.ActiveXObject && document.execCommand) {\n var _window = window.open(fileURL, '_blank');\n _window.document.close();\n _window.document.execCommand('SaveAs', true, fileName || fileURL)\n _window.close();\n }\n}\n\n\nfunction selectSlider(theme, component_id){\n\t\n\t\n\tvar component_ele_id = '#'+component_id+'-desktop';\n\t\n\t// not active all menu item\n\t$(component_ele_id+' '+'.slide-menu-ul li.active').removeClass('active');\n\t$(component_ele_id+' '+'.slide-menu-ul li#menu-'+theme).addClass('active');\n\t\n\t// show hide slider\t\n\t$(component_ele_id+' '+'.'+theme);\n\t\n\treturn 0;\n}\n\n\n$('.slide-menu-ul li').click(function(event)\n{\t\t\n\tevent.stopPropagation();\n\t\n\tvar theme = event.target.rel;\n\tif (theme == undefined)\n\t{\n\t\ttheme = $(event.target).find('a').attr('rel');\n\t}\n\t\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slide-menu-ul li.active').removeClass('active');\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slide-menu-ul li#menu-'+theme).addClass('active');\n\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slider.active').removeClass('active').addClass('notactive');\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('#'+theme).removeClass('notactive').addClass('active');\n\t\n\n\treturn false;\n});\n\n\n$('.slide-menu-ul li').click(function(event)\n{\t\t\n\tevent.stopPropagation();\n\t\n\tvar theme = event.target.rel;\n\tif (theme == undefined)\n\t{\n\t\ttheme = $(event.target).find('a').attr('rel');\n\t}\n\t\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slide-menu-ul li.active').removeClass('active');\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slide-menu-ul li#menu-'+theme).addClass('active');\n\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('.slider.active').removeClass('active').addClass('notactive');\n\t$(event.target).closest('.slide-wrapper.desktop-only').find('#'+theme).removeClass('notactive').addClass('active');\n\t\n\n\treturn false;\n});\n\n\n\n\n$('.theme-menu-mobile > a').click(function(event)\n{\t\t\n\tevent.stopPropagation();\n\t\n\tvar theme = event.target.rel;\n\tif (theme == undefined)\n\t{\n\t\ttheme = $(event.target).find('a').attr('rel');\n\t}\n\n\t\n\tif ($(event.target).closest('li').hasClass('active'))\n\t{\n\t\t\n\t\t$(event.target).closest('li').removeClass('active')\n\t}\n\telse\n\t{\n\t\t$(event.target).closest('li').addClass('active')\n\t}\n\t\n\treturn false;\n});\n\n\njQuery(function($){\n\t// Smooth scrolling effect for anchor links\n\t// Select all links with hashes\n\t$('a[href*=\"#\"]')\n\t // Remove links that don't actually link to anything\n\t .not('[href=\"#\"]')\n\t .not('[href=\"#0\"]')\n\t .not('.no_smoothscroll')//Add this class to any anchor you don't want to smooth-scroll\n\t .click(function(event) {\n\t\t// On-page links\n\t\tif (\n\t\t location.pathname.replace(/^\\//, '') == this.pathname.replace(/^\\//, '') \n\t\t && \n\t\t location.hostname == this.hostname\n\t\t) {\n\t\t // Figure out element to scroll to\n\t\t var target = $(this.hash);\n\t\t target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');\n\t\t // Does a scroll target exist?\n\t\t if (target.length) {\n\t\t\t// Only prevent default if animation is actually gonna happen\n\t\t\tevent.preventDefault();\n\t\t\t// Scroll to 80px above anchor to allow room for sticky top-menu\n\t\t\tvar scrolloffset = 147;\n\t\t\t// Add data-scrolloffset\"50\" attribute to the tag to fine tune where the scrolling ends\n\t\t\tif( $(this).data(\"scrolloffset\") ) {\n\t\t\t\tscrolloffset = scrolloffset + $(this).data(\"scrolloffset\");\n\t\t\t}\n\t\t\t$('html, body').animate({\n\t\t\t scrollTop: target.offset().top-scrolloffset\n\t\t\t}, 1000, function() {\n\t\t\t // Callback after animation\n\t\t\t // Must change focus!\n\t\t\t var $target = $(target);\n\t\t\t //$target.focus();\n\t\t\t if ($target.is(\":focus\")) { // Checking if the target was focused\n\t\t\t\treturn false;\n\t\t\t } else {\n\t\t\t\t//$target.attr('tabindex','-1'); // Adding tabindex for elements not focusable\n\t\t\t\t//$target.focus(); // Set focus again\n\t\t\t };\n\t\t\t});\n\t\t }\n\t\t}\n\t});\n});\n/*\n Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net\n*/\n(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t=\"is_stuck\");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data(\"sticky_kit\")){a.data(\"sticky_kit\",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));\nif(!g.length)throw\"failed to find stick parent\";v=m=!1;(h=null!=p?p&&a.closest(p):b(\"
    \"))&&h.css(\"position\",a.css(\"position\"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css(\"border-top-width\"),10),f=parseInt(g.css(\"padding-top\"),10),d=parseInt(g.css(\"padding-bottom\"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:\"\",top:\"\",width:\"\",bottom:\"\"}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css(\"margin-top\"),10)||0)-q,\nu=a.outerHeight(!0),r=a.css(\"float\"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css(\"display\"),\"vertical-align\":a.css(\"vertical-align\"),\"float\":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:\"fixed\",bottom:\"\",top:c}).trigger(\"sticky_kit:unbottom\"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+\"px\"})))):e>F&&(m=!0,b={position:\"fixed\",top:c},b.width=\"border-box\"===a.css(\"box-sizing\")?a.outerWidth()+\"px\":a.width()+\"px\",a.css(b).addClass(t),null==p&&(a.after(h),\"left\"!==r&&\"right\"!==r||h.append(a)),a.trigger(\"sticky_kit:stick\")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,\"static\"===g.css(\"position\")&&g.css({position:\"relative\"}),\na.css({position:\"absolute\",bottom:d,top:\"auto\"}).trigger(\"sticky_kit:bottom\")},y=function(){x();return l()},H=function(){G=!0;f.off(\"touchmove\",l);f.off(\"scroll\",l);f.off(\"resize\",y);b(document.body).off(\"sticky_kit:recalc\",y);a.off(\"sticky_kit:detach\",H);a.removeData(\"sticky_kit\");a.css({position:\"\",bottom:\"\",top:\"\",width:\"\"});g.position(\"position\",\"\");if(m)return null==p&&(\"left\"!==r&&\"right\"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on(\"touchmove\",l),f.on(\"scroll\",l),f.on(\"resize\",\ny),b(document.body).on(\"sticky_kit:recalc\",y),a.on(\"sticky_kit:detach\",H),setTimeout(l,0)}};n=0;for(K=this.length;n .commitment-checkbox');\n\tvar commitment_id = commitment_ele.val(); \t\n\t\n\tvar allcheckbox = 0;\n\tvar checked = 0;\n\tvar unchecked =0;\n\t$('.sub-category-commitment-'+commitment_id).each(function() {\n\t\tallcheckbox++;\n\t\tif (this.checked)\n\t\t{\n\t\t\tchecked++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunchecked++;\t\t\t\n\t\t}\n\t});\n\t\n\n\tif (allcheckbox==checked)\n\t{\n\t\tcommitment_ele.prop(\"checked\",true);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n\t}\n\t\n\tif (checked!=0 && unchecked!=0)\n\t{\n\t\tcommitment_ele.prop(\"checked\",true);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').addClass(\"somechecked\");\n\t}\n\t\n\tif (allcheckbox==unchecked)\n\t{\n\t\tcommitment_ele.prop(\"checked\",false);\n\t\t$('label[for=\"commitment-'+commitment_id+'\"]').removeClass(\"somechecked\");\n\t}\t\n\n}\n\n\n\n\nfunction hideAllFilterPopup()\n{\n\t$('fieldset').each(function() {\n\t\tif ( $(this).attr('id') != 'status-options' )\n\t\t{\n\t\t\t$(this).hide();\n\t\t}\n\t});\n\t$('.filter__root').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\n\t$('.filter__from-month').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\t\n\t$('.filter__to-month').each(function() {\n\t\t$(this).removeClass('popupopen');\n\t});\t\t\n\t\n}\n\nfunction updateCommitmentDropdown()\n{\n\tvar isCommitmentNoInitiative = $('.page-template-template-updates_search').length;\n\tvar checkboxType = 'checkbox';\n\t//if (isCommitmentNoInitiative > 0)\n\t//\tcheckboxType = 'radio'\t\n if (isCommitmentNoInitiative==0)\n {\n \tisCommitmentNoInitiative = $('.post-type-archive-grant').length;\n }\n\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalCommitment = '';\n var firstCommitment = '';\n var countCommitment = 0;\n $( \"input.commitment-checkbox[type=\"+checkboxType+\"]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"commitment-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t \n \t\t // find all sub initiative\n \t\t $('.sub-category-commitment-'+cat_id+'[type=checkbox]').each(function() {\n \t\t\t number_sub_initiative++;\n \t\t });\n \t\t \n \t\t if (countCommitment==0) firstCommitment = label;\n \n \t\t countCommitment++;\n \t}\n \tfinalCommitment = trimChar(str,' ');\n \tfinalCommitment = trimChar(finalCommitment,',');\n\n \t\n \tconsole.log(finalCommitment);\n \t\n });\n\n\t\n \n \n\t if (countCommitment==1)\n\t\t{\n\t \tfinalCommitment = '1 Selected';\n\t\t}\n\t else if (countCommitment==0)\n\t {\n\t \tfinalCommitment = 'All Topics';\n\t }\n\t else\n\t {\n\t \tfinalCommitment = countCommitment+' Selected';\n\t }\n \n\n\t$('a .current-commitment-selection_new').html(finalCommitment);\n\n}\n\nfunction updateRegionDropdown()\n{\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalRegion = 'All Regions';\n var count = 0;\n var first = '';\n $( \"input.region-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"region-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalRegion = trimChar(str,' ');\n \tfinalRegion = trimChar(finalRegion,',');\n });\n\n \t\n console.log(count);\n \n if (count==0)\n {\n \t//var temp = count - 1;\n \tfinalRegion = 'All Regions';\n }\n else if (count>1)\n {\n \t//var temp = count - 1;\n \tfinalRegion = count+' Selected';\n }\n else if (count==1)\n {\n \t//finalRegion = first;\n \tfinalRegion = '1 Selected';\n }\n\t$('a .current-region-selection_new').html(finalRegion);\n}\n\n\nfunction updateCaseTypeDropdown()\n{\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalType = 'All Types';\n var count = 0;\n var first = '';\n $( \"input.case_study_category-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"case_study_category-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalType = trimChar(str,' ');\n \tfinalType = trimChar(finalType,',');\n });\n\n \t\n console.log(count);\n \n if (count==0)\n {\n \t//var temp = count - 1;\n \tfinalType = 'All Types';\n }\n else if (count>1)\n {\n \t//var temp = count - 1;\n \tfinalType = count+' Selected';\n }\n else if (count==1)\n {\n \t//finalRegion = first;\n \tfinalType = '1 Selected';\n }\n\t$('a .current-case_study_categories-selection').html(finalType);\n}\n\n\n\nfunction updateNewsTypesDropdown()\n{\n\tvar str = \"\";\n var number_sub_initiative = 0;\n var finalType = 'All Media Types';\n var count = 0;\n var first = '';\n $( \"input.news_types-checkbox[type=checkbox]\" ).each(function() {\n \tif (this.checked)\n \t{\n \t\tvar cat_id = $( this ).val();\n \t\tvar label = $('label[for=\"news_types-'+cat_id+'\"]').html();\n \t\t str += label + \", \";\t\n \t\t if (count==0)\n \t\t\t first = label;\n \t\t count++;\n \t}\n \tfinalType = trimChar(str,' ');\n \tfinalType = trimChar(finalType,',');\n });\n\n \t\n if (count==0)\n {\n \t//var temp = count - 1;\n \tfinalType = 'All Media Types';\n }\n else if (count>1)\n {\n \t//var temp = count - 1;\n \tfinalType = count+' Selected';\n }\n else if (count==1)\n {\n \t//finalRegion = first;\n \tfinalType = '1 Selected';\n }\n\t$('a .current-news_types-selection').html(finalType);\n}\n\n\nfunction trimChar(string, charToRemove) {\n while(string.charAt(0)==charToRemove) {\n string = string.substring(1);\n }\n\n while(string.charAt(string.length-1)==charToRemove) {\n string = string.substring(0,string.length-1);\n }\n\n return string;\n}\n\n\t\n\nvar maxWidth = '55%';\nif ($(window).width() < 767) {\n\tmaxWidth = '95%';\n}\n\n$.fn.extend({\n hasClasses: function (selectors) {\n var self = this;\n for (var i in selectors) {\n if ($(self).hasClass(selectors[i])) \n return true;\n }\n return false;\n }\n});\n\nfunction setCookie(cname, cvalue, exdays) {\n\tvar d = new Date();\n\td.setTime(d.getTime() + (exdays*24*60*60*1000));\n\tvar expires = \"expires=\"+ d.toUTCString();\n\tdocument.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n\tconsole.log('cookie expires: '+ expires);\n}\n\nfunction newsletter_popup_opened(){\n\tconsole.log('popup opened');\n\t$(\".gform_wrapper\").focus();\n\t$('body').addClass('open-popup');\n}\n\nfunction newsletter_popup_closed(){\n\t//setCookie('newsletter_popupShown', 'yes', 1);\n\tconsole.log('popup closed, 1-day cookie set');\n\t$('body').removeClass('open-popup');\n}\n\nfunction newsletter_popup_completed(){\n\t//setCookie('newsletter_popupShown', 'yes', 365);\n\tconsole.log('Newsletter completed, 1-year cookie set');\n}\n\nfunction trf_displayNewsletterPopup(){\n\t$.colorbox({\n\t\tclose:'
    X
    ', \n\t\tescKey:true,\n\t\theight: false,\n\t\thtml : '
    ', \n\t\tmaxWidth: maxWidth,\n\t\t//maxHeight:'95%',\n\t\tonComplete: newsletter_popup_opened,\n\t\tonClosed: newsletter_popup_closed,\n\t\topacity: 0.5,\n\t\toverlayClose: true,\n\t\ttrapFocus:true,\n\t\t\n\t\tonComplete: function() {\n\t\t\tconsole.log('onComplete?');\n\t\t\t$('body').addClass('open-popup');\n\t\t\t$('#colorbox').addClass('newsletter-signup');\n\t\t\t$('#colorbox').addClass('signup_popup');\n\t\t $('.newsletter-html-embed-container').find('.html-embed-inner .gform_wrapper').attr('style','');\n\t\t $('.newsletter-html-embed-container').find('.html-embed-inner').appendTo(\".footer-destination\");\n\t\t $(\"#cboxWrapper\").on(\"click\", function(){\n\t\t $(window).colorbox.close();\n\t\t // remove class in newsletter button\n\t\t $('body').removeClass('open-popup');\n\t\t $('#colorbox').removeClass('newsletter-signup'); \n\t\t $('#colorbox').removeClass('signup_popup'); \n\t\t // hide the extra submit button\n\t\t $('.footer-destination .gform_footer input[type=submit]').hide();\n\t\t newsletter_popup_closed();\n\t\t }).children().on(\"click\", function (e) {\n\t\t e.stopPropagation();\n\t\t });\n\t\t},\n\t\tonCleanup:function(){\n\t\t /*$('#colorbox .footer-destination .html-embed-inner').appendTo($('.newsletter-html-embed-container .html-embed'));\n\t\t $(\"#cboxWrapper\").unbind();\n\t\t $('body').removeClass('open-popup');\n\t\t $('#colorbox').removeClass('newsletter-signup');\n\t\t $('#colorbox').removeClass('signup_popup');\n\t\t newsletter_popup_closed();*/\n\t\t},\n\t\tonClosed:function(){\n\t\t $('body').removeClass('open-popup');\n\t\t $('#colorbox').removeClass('newsletter-signup');\n\t\t $('#colorbox').removeClass('signup_popup');\n\t\t newsletter_popup_closed();\n\t\t \n\t\t console.log('signup form closed');\n\t\t}\n\t});\n}\n// code to run upon successful form submission\n$(document).on(\"gform_confirmation_loaded\", function (e, form_id) {\n\tif(form_id == 9) {\n\t\tnewsletter_popup_completed();\n\t}\n});\n\n// Show popup if user scrolls down 25%\n$(window).scroll(function() {\n var height = $(window).scrollTop();\n\n if(height > $(document).height()*0.25) {\n\t\tvar popupShown = get_cookie('newsletter_popupShown');\n\t\tif( !popupShown ){\n\t\t\t//trf_displayNewsletterPopup();\n\t\t}\n }\n});\n// Show popup if mouse leaves the window\n$('body').mouseleave(function() {\n\tvar popupShown = get_cookie('newsletter_popupShown');\n\tif( !popupShown ){\n\t\t//trf_displayNewsletterPopup();\n\t}\n});\n\n// Show popup after X miliseconds\nsetTimeout(function(){\n\tvar popupShown = get_cookie('newsletter_popupShown');\n\tif( !popupShown ){\n\t\tif ($(\"body\").hasClass(\"home\")) {\n\t\t\t//trf_displayNewsletterPopup();\n\t\t}\n\t}\n}, 16000);\n$( \"ol\" ).each(function() {\n \tvar val=1;\n\tif ( $(this).attr(\"start\")){\n \t\tval = $(this).attr(\"start\");\n\t}\n \tval=val-1;\n\tval= 'li '+ val;\n\t$(this ).css('counter-increment',val );\n});\n$(document).ready(function(){\n\tvar owl = $(\".latest-content.owl-carousel\");\n\towl.owlCarousel({\n\t\t stagePadding: 50,\n\t\t loop:false,\n\t\t margin:0,\n\t\t nav:false,\t \n\t\t items:1\n\t});\n\towl.on('changed.owl.carousel', function(event) {\n\t\tvar items = event.item.count; // Number of items\n\t var item = event.item.index; \n\t item = item+1;\n\t $(this).closest('.container').find('.slider-page-numbers .current-page').html(item);\n\t})\n\t$(\".latest-content .owl-nav\").remove();\n});\n\n\njQuery(document).ready(function(){\n\n\t$(document).on(\"change\", '#filter-types', function() { \n\t\t\n\t\t$('#author-filter form').submit();\n \n\t});\n\t\n\tvar url = window.location.href;\n\tvar n = url.indexOf(\"filter_types\");\n\tif (n > 0)\n\t{\n\t\tvar position = $('.authored_content').position();\n\t\tvar headerHeight = $('header.header').height();\n\t\tvar scrollToTop = position.top-headerHeight-20;\t \t\n\t $(\"html, body\").animate({ scrollTop: scrollToTop }, 200, \"linear\");\n\t}\n\t\n});\n\njQuery(document).ready(function(){\n\n\t$(document).on(\"change\", '#profile-filter select', function() { \n\t\t\n\t\t$('#profile-filter').submit();\n \n\t});\n\t\n});\n\njQuery(document).ready(function(){\n\t\n\t\n\tfunction replaceQueryParam(param, newval, search) {\n\t var regex = new RegExp(\"([?;&])\" + param + \"[^&;]*[;&]?\");\n\t var query = search.replace(regex, \"$1\").replace(/&$/, '');\n\n\t return (query.length > 2 ? query + \"&\" : \"?\") + (newval ? param + \"=\" + newval : '');\n\t}\n\n\t$(document).on(\"click\", '.four-up-grid-annual_report #profile-loadmore button', function() { \n\n\t\tvar nextPage = $('.four-up-grid-annual_report #profile-loadmore button').attr('href');\n\n\t\t// remove old next button\n $('.four-up-grid-annual_report #profile-loadmore').remove();\n //Show \"Loading\" GIF\n $('button.loading').show().focus();\n \n $.get( nextPage, function( data ) {\n\n \t// check number of result and update the result number for grant\n \tvar tofind = '
    '+data+'
    ';\n \t//var numerOfResult = $(tofind).find('.number-of-results').val();\n \t//$(\"#number-of-result\").html(numerOfResult);\n\n \tvar content = $(tofind).find('.four-up-grid-annual_report .post-list');\n \tcontent.attr('style','display:none');\n \tcontent.addClass('to-expand');\n \t\n \t$(\".four-up-grid-annual_report #placeholder-next-posts\").before( content );\n \t\n \t$(\".to-expand\").toggle('expand');\n \t$(\".to-expand\").removeClass('to-expand'); \n\n \tcontent.find('li .headline a').first().focus();\n \t\n }).done(function() {\n\t\t\t// hide loading button\n \t$('button.loading').hide();\n\t\t});\n\n $( \".to-expand\" ).each(function(index) {\n $(this).removeClass('to-expand'); \n });\n\t});\n\t\n\t\n\t$(document).on(\"click\", '.four-up-grid-profile #profile-loadmore button', function() { \n\n\t\tvar nextPage = $('.four-up-grid-profile #profile-loadmore button').attr('href');\n\t\tnextPage = replaceQueryParam('pages', '', nextPage); \n\n\t\t// remove old next button\n\t\t$('.four-up-grid-profile #profile-loadmore').remove();\n //Show \"Loading\" GIF\n $('button.loading').show().focus();\n \n \n \n $.get( nextPage, function( data ) {\n \t\n \t// check number of result and update the result number for grant\n \tvar tofind = '
    '+data+'
    ';\n \t//var numerOfResult = $(tofind).find('.number-of-results').val();\n \t//$(\"#number-of-result\").html(numerOfResult);\n \t\n \tvar content = $(tofind).find('.four-up-grid-profile .post-list');\n \tcontent.attr('style','display:none');\n \tcontent.addClass('to-expand');\n \t\n \t$(\".four-up-grid-profile #placeholder-next-posts\").before( content );\n \t\n \t$(\".to-expand\").toggle('expand');\n \t$(\".to-expand\").removeClass('to-expand'); \n\n \tcontent.find('li .headline a').first().focus();\n \t\n }).done(function(){\n \t// hide loading button\n \t$('button.loading').hide();\n \t\n \tvar searchParams = new URLSearchParams(nextPage);\n \tvar paged_number = searchParams.get('paged_number');\n \tvar newParam = replaceQueryParam('pages', paged_number, window.location.search); \n \t\n \tvar path = window.location.pathname+newParam;\n \t//alert(path+newParam);\n \t//window.history.pushState(document.title, document.title , path);\n \tconst stateObj = { title: document.title};\n \twindow.history.replaceState(stateObj, document.title , path);\n \t\n });\n\n $( \".to-expand\" ).each(function(index) {\n $(this).removeClass('to-expand'); \n });\n\t});\n\t\n});\n\n/* Toggle 2nd Row of Updates */\njQuery(function( $ ){\n $( \".recent_content_row .viewmore button\" ).each(function(index) {\n $(this).on(\"click\", function(){\n $(this).parent().addClass('expanded');\n $(this).closest('.container').find('.item-init-hide').attr('tabindex', '-1');\n $(this).closest('.container').find('.item-init-hide').each(function(index) {\n \t$(this).toggle('expand');\n });\n //$(this).find('span').text($(this).find('span').text() == 'More' ? 'Fewer' : 'More');\n });\n });\n $( \".recent_content_row .viewless button\" ).each(function(index) {\n $(this).on(\"click\", function(){\n $(this).closest('.container').find('.expanded').removeClass('expanded');\n $(this).closest('.container').find('.item-init-hide').attr('tabindex', '');\n $(this).closest('.container').find('.item-init-hide').each(function(index) {\n $(this).toggle('expand');\n });\n });\n });\n});\n/* Show/Hide 2nd row of content */\njQuery(function( $ ){\n $( \".related-content-grid .seemore, .video_tiles .seemore\" ).each(function(index) {\n $(this).on(\"click\", function(){\n $(this).closest('.container').find('.seemore_item').each(function(index) {\n \t$(this).addClass('expand');\n });\n $(this).closest('.container').find('.seemore').each(function(index) {\n \t$(this).attr('style','display:none!important');\n }); \n $(this).closest('.container').find('.seeless').each(function(index) {\n \t$(this).attr('style','');\n }); \n });\n });\n \n \n $( \".related-content-grid .seeless, .video_tiles .seeless\" ).each(function(index) {\n $(this).on(\"click\", function(){ \n $(this).closest('.container').find('.seemore_item').each(function(index) {\n \t$(this).removeClass('expand');\n });\n $(this).closest('.container').find('.seemore').each(function(index) {\n \t$(this).attr('style','');\n }); \n $(this).closest('.container').find('.seeless').each(function(index) {\n \t$(this).attr('style','display:none!important');\n }); \n });\n });\n});\n\n\n// Get all the dropdown from document\ndocument.querySelectorAll('.dropdown-toggle').forEach(dropDownFunc);\n\n// Dropdown Open and Close function\nfunction dropDownFunc(dropDown) {\n console.log(dropDown.classList.contains('click-dropdown'));\n\n if(dropDown.classList.contains('click-dropdown') === true){\n dropDown.addEventListener('click', function (e) {\n e.preventDefault(); \n \n if (this.nextElementSibling.classList.contains('dropdown-active') === true) {\n // Close the clicked dropdown\n this.parentElement.classList.remove('dropdown-open');\n this.nextElementSibling.classList.remove('dropdown-active');\n \n } else {\n // Close the opend dropdown\n closeDropdown();\n \n // add the open and active class(Opening the DropDown)\n this.parentElement.classList.add('dropdown-open');\n this.nextElementSibling.classList.add('dropdown-active');\n }\n });\n }\n\n if(dropDown.classList.contains('hover-dropdown') === true){\n\n dropDown.onmouseover = dropDown.onmouseout = dropdownHover;\n\n function dropdownHover(e){\n if(e.type == 'mouseover'){\n // Close the opend dropdown\n closeDropdown();\n\n // add the open and active class(Opening the DropDown)\n this.parentElement.classList.add('dropdown-open');\n this.nextElementSibling.classList.add('dropdown-active');\n \n }\n\n // if(e.type == 'mouseout'){\n // // close the dropdown after user leave the list\n // e.target.nextElementSibling.onmouseleave = closeDropdown;\n // }\n }\n }\n\n};\n\n\n// Listen to the doc click\nwindow.addEventListener('click', function (e) {\n\n // Close the menu if click happen outside menu\n if (e.target.closest('.dropdown-container') === null) {\n // Close the opend dropdown\n closeDropdown();\n }\n\n});\n\n\n// Close the openend Dropdowns\nfunction closeDropdown() { \n console.log('run');\n \n // remove the open and active class from other opened Dropdown (Closing the opend DropDown)\n document.querySelectorAll('.dropdown-container').forEach(function (container) { \n container.classList.remove('dropdown-open')\n });\n\n document.querySelectorAll('.dropdown-menu').forEach(function (menu) { \n menu.classList.remove('dropdown-active');\n });\n}\n\n// close the dropdown on mouse out from the dropdown list\ndocument.querySelectorAll('.dropdown-menu').forEach(function (dropDownList) { \n // close the dropdown after user leave the list\n dropDownList.onmouseleave = closeDropdown;\n});\n\nwindow.onscroll = function() {myFunction()};\n\nfunction myFunction() {\n if( $('#myBar').length ) // use this if you are using id to check\n {\n var winScroll = $( window ).scrollTop() || document.documentElement.scrollTop;\n \n var height = $('body').height() - $( window ).height();\n var scrolled = Math.abs((winScroll / height)) * 100;\n $('#myBar').width(scrolled + '%');\n }\n}\n\n/*\r\n$(\"#anchor-list a\").click(function(event) {\r\n\tvar anchorID = $(this).attr('href');\r\n\tvar position = $(anchorID).position();\r\n\tvar headerHeight = $('header.header').height();\r\n\tvar scrollToTop = position.top-headerHeight-30;\t \t\r\n event.preventDefault();\r\n $(\"html, body\").animate({ scrollTop: scrollToTop }, 800, \"linear\");\r\n return false;\r\n});*/\r\n/*\r\nfunction scrollto(anchorID)\r\n{\r\n\tvar position = $(anchorID).position();\r\n\tvar headerHeight = $('header.header').height();\r\n\tvar scrollToTop = position.top-headerHeight-15;\t \t\r\n event.preventDefault();\r\n $(\"html, body\").animate({ scrollTop: scrollToTop }, 800, \"linear\");\r\n return false;\r\n}*/\njQuery(document).ready(function(){ \n $( \".select2\" ).each(function(index) {\n \t$(this).select2(); \n });\n\n $( \".select2-multiple\" ).each(function(index) {\n \t$(this).select2(); \n });\n\n $( \".gfield_select\" ).each(function(index) {\n \t$(this).select2(); \n });\n /*\n $(document).on('gform_page_loaded', function(event, form_id, current_page){\n $( \".gfield_select\" ).each(function(index) {\n $(this).select2(); \n });\n \n $( \".html-embed-inner .gfield.gform_validation_container.gfield_visibility_visible\" ).each(function(index) {\n \t$(this).addClass('show-label');\n });\n });\n */\n \n \n});\n\n/*\njQuery(document).ready(function(){\n if( $('article.post-type-profile').length == 0 && $('.has-sidebar').length ){\n $(window).scroll(function () {\n doscroll();\n });\n }\n \n});\n\n$(window).on(\"resize\", function( e ) {\n if( $('article.post-type-profile').length == 0 && $('.has-sidebar').length ){\n \n resetscroll();\n doscroll();\n }\n});\n\nvar resetscroll = function (){\n if( $('article.post-type-profile').length == 0 && $('.has-sidebar').length ){\n $('.has-sidebar .sidebar').attr('style','');\n $('#main-content').attr('style','');\n }\n};\n*/\nvar doscroll = function (){\n \n var scroll = $(this).scrollTop();\n var height = $('.has-sidebar .sidebar').height() + 'px';\n var length = $('#main-content').height() + $('#main-content').offset().top - $('.has-sidebar .sidebar').height();\n \n var heroHeight = $('#hero').outerHeight();\n\tvar headerHeight = $('header').outerHeight(); \n\tvar startToStickyAt = heroHeight+headerHeight;\n\t\t\n\tvar windowWidth = $( window ).width();\n\tvar wrapperWidth = $('.wrapper').outerWidth();\t\n var postionOfwrapper = $('.wrapper').position();\n var wrapperWidth = $('.wrapper').width();\n var mainContentWidth = $('#main-content').width();\n var sidebarWidth = $('.has-sidebar .sidebar').outerWidth();\n var windowWidth = $( window ).width();\n windowWidth = parseInt(windowWidth);\n wrapperWidth = parseInt(wrapperWidth);\n var spaceLeft = Math.round((windowWidth - wrapperWidth)/2); \n var original_position = $('#main-content.has-sidebar .sidebar').position();\t\n var mainContentLeftWidth = $('#main-content .container').outerWidth();\n var leftConteinerWidth = parseInt(mainContentLeftWidth);\n \n /*\n console.log('wrapperWidth');\n console.log(wrapperWidth);\n console.log('windowWidth');\n console.log(windowWidth);\n console.log('mainContentWidth');\n console.log(mainContentWidth);\n console.log('spaceLeft');\n console.log(spaceLeft); \n console.log('sidebarWidth');\n console.log(sidebarWidth); \n console.log('leftConteinerWidth');\n console.log(leftConteinerWidth); \n console.log('window.devicePixelRatio');\n console.log(window.devicePixelRatio);*/\n \n\t// for position fixed\n\tvar sidebarLeft = spaceLeft+mainContentWidth-sidebarWidth;\n\t// for position ansolute\n\tvar sidebarLeftAbs = mainContentWidth-sidebarWidth;\n\t\n\tif (wrapperWidth==windowWidth)\n\t{\n\t\tsidebarLeft = leftConteinerWidth;\n\t\tsidebarLeftAbs = leftConteinerWidth;\n\t}\n\n if (($(window).width() < 1007)){\n resetscroll();\n }else{\n \n if ( scroll > (length - headerHeight)) {\n $('.has-sidebar .sidebar').css({\n 'position': 'absolute',\n 'bottom': '0',\n 'top': 'auto',\n 'left' : sidebarLeftAbs+'px'\n });\n \n } else if ( scroll < $('.has-sidebar').offset().top + $('#hero').height()) {\n $('.has-sidebar .sidebar').css({\n 'position': 'absolute',\n 'top': '0',\n 'left' : sidebarLeftAbs+'px'\n });\n resetscroll();\n \n } else {\n\n \tif ( scroll > startToStickyAt) {\n \t\t\n \t\tresetscroll();\n \t\t\n \t\t$('.has-sidebar .sidebar').css({\n\t 'position': 'fixed',\n\t 'top': '60px',\n\t 'height': height,\n\t 'left': sidebarLeft+'px'\n\t });\n\t \n \t} \t\n }\n }\n \n}\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '.social_share_menu .facebook', function(e) { \n e.preventDefault();\n var url = window.location.href;\n url = encodeURI(url); \n shareOnFB(url)\n\t});\n\t\n\t$(document).on(\"click\", '.social_share_menu .linkedin', function(e) { \n e.preventDefault();\n var url = window.location.href;\n url = encodeURI(url);\n shareOnLinkedin(url);\n\t});\n\t\n\t\n\t$(document).on(\"click\", '.social_share_menu .twitter', function(e) { \n e.preventDefault();\n //var url = window.location.href;\n var url = window.location.host + window.location.pathname + window.location.search;\n if (window.location.pathname=='/')\n {\n \t url = window.location.host;\n }\n url = encodeURI(url);\n shareOntwitter(url);\n\t});\n\t\n\t\n\t$(document).on(\"click\", '.social_share_menu .copyurl', function(e) { \n e.preventDefault();\n var url = window.location.href;\n copyToClipboard(url); \t\n\t});\t\n\n\t\n\t\n});\n\n\nfunction popitup(url,windowName) {\n newwindow=window.open(url,windowName,'height=200,width=150');\n if (window.focus) {newwindow.focus()}\n return false;\n}\n\nfunction shareOnFB(shareUrl){\n //var url = \"https://www.facebook.com/sharer/sharer.php?u=\"+shareUrl+\"&t=your message\";\n\tvar url = \"https://www.facebook.com/sharer/sharer.php?u=\"+shareUrl;\n window.open(url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');\n return false;\n}\n\n\nfunction shareOntwitter(shareUrl){\n //var url = 'https://twitter.com/intent/tweet?url=URL_HERE&via=getboldify&text=yourtext';\n var url = 'https://twitter.com/intent/tweet?url='+shareUrl+'&via=rockefellerfdn';\n TwitterWindow = window.open(url, 'TwitterWindow',width=400,height=300);\n return false;\n}\n\nfunction shareOnGoogle(shareUrl){\n //var url = \"https://plus.google.com/share?url=https://yoururl.com\";\n var url = \"https://plus.google.com/share?url=\"+shareUrl;\t \n window.open(url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');\n return false;\n}\n\nfunction shareOnLinkedin(shareUrl){\n var url = \"https://www.linkedin.com/sharing/share-offsite/?url=\"+shareUrl;\t \n window.open(url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');\n return false;\n}\n\nfunction copyToClipboard(shareUrl) {\n\t var $temp = $(\"\");\n\t $(\"body\").append($temp);\n\t $temp.val(shareUrl).select();\n\t document.execCommand(\"copy\");\n\t $temp.remove();\n\t alert('Copied!');\n}\n\n\n$(window).scroll(function(){ // scroll event\t\n\tif ($('.stats-counter.notrun.one').length)\n\t{\n var windowTop = $(window).scrollTop(); // returns number\n playStatsAnimation(windowTop);\n\t}\n\tif ($('.stats-counter.notrun.two').length)\n\t{\n var windowTop = $(window).scrollTop(); // returns number\n playStatsAnimation2(windowTop);\n\t}\n\tif ($('.stats-counter.notrun.three').length)\n\t{\n var windowTop = $(window).scrollTop(); // returns number\n playStatsAnimation4(windowTop);\n\t}\n\t\n\tif ($('#hero.report_page').length)\n\t{\n\t\t\n\t\tif ($('.content.gated-download-button-container.notrun').length)\n\t\t{\n\t\t\tvar windowTop = $(window).scrollTop(); // returns number\n\t\t\tplayStatsAnimation3(windowTop);\n\t\t}\n\t}\n}); \n\nif ($('.stats-counter.notrun.one').length)\n{\n\t var windowTop = $(window).scrollTop(); // returns number\n\t playStatsAnimation(windowTop);\n\t//window.scrollTo(0, 0);\n}\n\nif ($('.stats-counter.notrun.two').length)\n{\n\t var windowTop = $(window).scrollTop(); // returns number\n\t playStatsAnimation2(windowTop);\n\t//window.scrollTo(0, 0);\n}\n\nif ($('.stats-counter.notrun.three').length)\n{\n\t var windowTop = $(window).scrollTop(); // returns number\n\t playStatsAnimation4(windowTop);\n\t//window.scrollTo(0, 0);\n}\n\nif ($('#hero.report_page').length)\n{\n\tif ($('.content.gated-download-button-container').length)\n\t{\n\t\t$('.content.gated-download-button-container').addClass('notrun');\n\t\t\n\t\t$('.content.gated-download-button-container .stats__header .number').each(function( index ) {\n\t\t\t \n\t\t\t var temp = $( this ).text();\n\t\t\t $(this).attr('data-count',temp);\n\t\t\t $(this).text('0');\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\tvar windowTop = $(window).scrollTop(); // returns number\n\t\tplayStatsAnimation3(windowTop);\n\t}\n}\n\nfunction playStatsAnimation(windowTop){\t\n\t\n\tif ($('.stats-counter.notrun.one').length)\n\t{\n\t\t\n\t\tvar element = $('.stats-counter.one');\n\t\tvar top = element.offset().top;\n\t\t\n\t\tvar viewportHeight = window.innerHeight;\n\t\tconsole.log('Viewport Height: '+viewportHeight);\n\t\t\n\t\tvar elementHeight = element.outerHeight();\n\t\tconsole.log('Element Height: '+elementHeight);\n\t\t\n\t\t\n\t\tvar shouldRunAt = ( top - (viewportHeight - elementHeight));\n\t\tconsole.log('Should run at: '+shouldRunAt);\n\t\t\n\t\t\n\t\tif ( shouldRunAt < windowTop )\n\t\t{\n\t\t\t$('.stats-counter.one .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t jQuery({ Counter: 0 }).animate({ Counter: countTo }, {\n\t\t \t duration: 1150,\n\t\t \t easing: 'swing',\n\t\t \t step: function () {\n\t\t \t $this.text(Math.ceil(this.Counter));\n\t\t \t }\n\t\t \t });\n\t\t \t });\n\t\t \t\n\n\t\t \tconst myTimeout = setTimeout(fixNumber, 1250);\n\t\t \t\n\t\t \tconst myTimeout2 = setTimeout(fixNumber, 1400);\n\t\n\t\t \tfunction fixNumber() {\n\t\t \t\t\n\t\t \t\t$('.stats-counter.one .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t $this.text(countTo);\n\t\t \t \n\t\t \t});\n\t\t \t \n\t\t \t}\n\t\t \t\n\t\t \t// run only once\n\t\t \t$('.stats-counter.notrun.one').removeClass('notrun');\n\t \t\n\t\t}\n\t\t\n\t}\t\n}\n\nfunction playStatsAnimation2(windowTop){\t\n\t\n\tif ($('.stats-counter.notrun.two').length)\n\t{\n\t\t\n\t\tvar element = $('.stats-counter.two');\n\t\tvar top = element.offset().top;\n\t\t\n\t\tvar viewportHeight = window.innerHeight;\n\t\tconsole.log('Viewport Height: '+viewportHeight);\n\t\t\n\t\tvar elementHeight = element.outerHeight();\n\t\tconsole.log('Element Height: '+elementHeight);\n\t\t\n\t\t\n\t\tvar shouldRunAt = ( top - (viewportHeight - elementHeight));\n\t\tconsole.log('Should run at: '+shouldRunAt);\n\t\t\n\t\t\n\t\tif ( shouldRunAt < windowTop )\n\t\t{\n\t\t\t$('.stats-counter.two .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t jQuery({ Counter: 0 }).animate({ Counter: countTo }, {\n\t\t \t duration: 1150,\n\t\t \t easing: 'swing',\n\t\t \t step: function () {\n\t\t \t $this.text(Math.ceil(this.Counter));\n\t\t \t }\n\t\t \t });\n\t\t \t });\n\t\t \t\n\n\t\t \tconst myTimeout = setTimeout(fixNumber, 1250);\n\t\t \t\n\t\t \tconst myTimeout2 = setTimeout(fixNumber, 1400);\n\t\n\t\t \tfunction fixNumber() {\n\t\t \t\t\n\t\t \t\t$('.stats-counter.two .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t $this.text(countTo);\n\t\t \t \n\t\t \t});\n\t\t \t \n\t\t \t}\n\t\t \t\n\t\t \t// run only once\n\t\t \t$('.stats-counter.notrun.two').removeClass('notrun');\n\t \t\n\t\t}\n\t\t\n\t}\t\n}\n\n\nfunction playStatsAnimation3(windowTop){\t\n\t\n\tif ($('#hero.report_page').length)\n\t{\n\t\t\n\t\tif ($('.content.gated-download-button-container').length)\n\t\t{\n\t\t\n\t\t\tvar element = $('.content.gated-download-button-container');\n\t\t\tvar top = element.offset().top;\n\t\t\t\n\t\t\tvar viewportHeight = window.innerHeight;\n\t\t\tconsole.log('Viewport Height: '+viewportHeight);\n\t\t\t\n\t\t\tvar elementHeight = element.outerHeight();\n\t\t\tconsole.log('Element Height: '+elementHeight);\n\t\t\t\n\t\t\t\n\t\t\tvar shouldRunAt = ( top - (viewportHeight - elementHeight));\n\t\t\tconsole.log('Should run at: '+shouldRunAt);\n\t\t\t\n\t\t\t\n\t\t\tif ( shouldRunAt < windowTop )\n\t\t\t{\n\t\t\t\t$('.content.gated-download-button-container .stats__header .number').each(function () {\n\t\t\t \t var $this = $(this);\n\t\t\t \t var countTo = $this.attr('data-count');\n\t\t\t \t jQuery({ Counter: 0 }).animate({ Counter: countTo }, {\n\t\t\t \t duration: 1150,\n\t\t\t \t easing: 'swing',\n\t\t\t \t step: function () {\n\t\t\t \t $this.text(Math.ceil(this.Counter));\n\t\t\t \t }\n\t\t\t \t });\n\t\t\t \t });\n\t\t\t \t\n\t\n\t\t\t \tconst myTimeout = setTimeout(fixNumber, 1250);\n\t\t\t \t\n\t\t\t \tconst myTimeout2 = setTimeout(fixNumber, 1400);\n\t\t\n\t\t\t \tfunction fixNumber() {\n\t\t\t \t\t\n\t\t\t \t\t$('.content.gated-download-button-container .stats__header .number').each(function () {\n\t\t\t \t var $this = $(this);\n\t\t\t \t var countTo = $this.attr('data-count');\n\t\t\t \t $this.text(countTo);\n\t\t\t \t \n\t\t\t \t});\n\t\t\t \t \n\t\t\t \t}\n\t\t\t \t\n\t\t\t \t// run only once\n\t\t\t \t$('.content.gated-download-button-container.notrun').removeClass('notrun');\n\t\t \t\n\t\t\t}\n\t\t\n\t\t}\t\n\t\t\n\t}\t\n\t\n\t\n\t\n}\n\n\nfunction playStatsAnimation4(windowTop){\t\n\t\n\tif ($('.stats-counter.notrun.three').length)\n\t{\n\t\t\n\t\tvar element = $('.stats-counter.three');\n\t\tvar top = element.offset().top;\n\t\t\n\t\tvar viewportHeight = window.innerHeight;\n\t\tconsole.log('Viewport Height: '+viewportHeight);\n\t\t\n\t\tvar elementHeight = element.outerHeight();\n\t\tconsole.log('Element Height: '+elementHeight);\n\t\t\n\t\t\n\t\tvar shouldRunAt = ( top - (viewportHeight - elementHeight));\n\t\tconsole.log('Should run at: '+shouldRunAt);\n\t\t\n\t\t\n\t\tif ( shouldRunAt < windowTop )\n\t\t{\n\t\t\t$('.stats-counter.three .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t jQuery({ Counter: 0 }).animate({ Counter: countTo }, {\n\t\t \t duration: 1150,\n\t\t \t easing: 'swing',\n\t\t \t step: function () {\n\t\t \t $this.text(Math.ceil(this.Counter));\n\t\t \t }\n\t\t \t });\n\t\t \t });\n\t\t \t\n\n\t\t \tconst myTimeout = setTimeout(fixNumber, 1250);\n\n\t\t \tconst myTimeout2 = setTimeout(fixNumber, 1400);\n\t\t\t\n\t\t \tfunction fixNumber() {\n\t\t \t\t\n\t\t \t\t$('.stats-counter.three .no').each(function () {\n\t\t \t var $this = $(this);\n\t\t \t var countTo = $this.attr('data-count');\n\t\t \t $this.text(countTo);\n\t\t \t \n\t\t \t \n\t\t \t});\n\t\t \t \n\t\t \t}\n\t\t \t\n\t\t \t// run only once\n\t\t \t$('.stats-counter.notrun.three').removeClass('notrun');\n\t \t\n\t\t}\n\t\t\n\t}\t\n}\n//$( \"#grant_topbar\" ).attr(\"tabindex\",-1).focus();\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '#update-filter-reset', function() { \n\t\t//var togo = $('#update-base-url').val();\n window.location = $('#update-base-url').val();\n\t});\n\t\n\t$(document).on(\"click\", '#update-filter .arrow-icon', function() { \n\t\t\n\t\t$('#update-filter form').submit();\n \n\t});\n\t\n\t$('#filter-keyword').keypress(function (e) {\n\t\t if (e.which == 13) {\n\t\t\t //$('#update-filter form').submit();\n\t\t\t $('#filter-submit').click();\n\t\t }\n\t});\n\t\n});\n\n// update the hidden field for the search bar\nfunction updateSubmenuSelection(field_id,field_value)\n{\n\t\n\t$('#'+field_id).val(field_value);\n\t\n\t// maybe need to ajax later\n\t//$('#archive-filter form').submit();\t\n\t\n\t$('#filter-submit').click();\n}\n\n\njQuery(document).ready(function(){\n\n\t$(document).on(\"click\", '#update-loadmore button', function() { \n\n\t\tvar nextPage = $('#update-loadmore button').attr('href');\n\n // remove old next button\n $('#update-loadmore').remove();\n //Show \"Loading\" GIF\n $('button.loading').show().focus();\n \n $.get( nextPage, function( data ) {\n \t\n \t// check number of result and update the result number for grant\n \tvar tofind = '
    '+data+'
    ';\n \t\n \tvar content = $(tofind).find('.post-list');\n \tcontent.attr('style','display:none');\n \tcontent.addClass('to-expand');\n \t\n\n \tvar tobe_first_result_month_year_group = content.find('#first_result_month_year_group').val();\n \tvar tobe_last_result_month_year_group = content.find('#last_result_month_year_group').val();\n \t\n \tvar current_first_month_group = $('#first_result_month_year_group').val();\n \tvar current_last_month_group = $('#last_result_month_year_group').val();\n \t\n \tif (current_last_month_group==tobe_first_result_month_year_group)\n \t{\n \t\tcontent.find('#'+tobe_first_result_month_year_group).remove();\n \t}\n \t$('#last_result_month_year_group').val(tobe_last_result_month_year_group)\n \tcontent.find('#first_result_month_year_group').remove();\n \tcontent.find('#last_result_month_year_group').remove();\n \t\n \tvar loadmore = $(tofind).find('#update-loadmore');\n \t$(\"#placeholder-next-posts\").before( content );\n \t$(\"#placeholder-next-posts\").after( loadmore ); \n \t$(\".to-expand\").toggle('expand');\n \t$(\".to-expand\").removeClass('to-expand');\n\n content.find('li .headline a').first().focus();\n \t\n }).done(function() {\n $('button.loading').hide();\n });\n\n $( \".to-expand\" ).each(function(index) {\n $(this).removeClass('to-expand'); \n });\n\t});\n\t\n});\n\n/* Initialize jQuery Colorbox*/\njQuery(function( $ ){\n $( \".video_tiles .seemorevideo\" ).each(function(index) {\n $(this).on(\"click\", function(){ \n $(this).closest('.container').find('.item-init-hide').each(function(index) {\n \t$(this).toggle('expand');\n });\n $(this).closest('.container').find('.seemorevideo').each(function(index) {\n \t$(this).attr('style','display:none!important');\n }); \n $(this).closest('.container').find('.seelessvideo').each(function(index) {\n \t$(this).attr('style','');\n }); \n });\n });\n \n \n $( \".video_tiles .seelessvideo\" ).each(function(index) {\n $(this).on(\"click\", function(){ \n $(this).closest('.container').find('.item-init-hide').each(function(index) {\n \t$(this).toggle('collapse');\n });\n $(this).closest('.container').find('.seemorevideo').each(function(index) {\n \t$(this).attr('style','');\n }); \n $(this).closest('.container').find('.seelessvideo').each(function(index) {\n \t$(this).attr('style','display:none!important');\n }); \n });\n });\n});\n\n// Super-Streamlined Dynamic Component Execution\r\nvar componentname,\r\n\tcomponent,\r\n\tHERO_calls = $(\"[data-component]\");\r\n\r\n// Loop over all [data-component]s on the page\r\nHERO_calls.each(function(i, item) {\r\n\tcomponentname = $(item).attr(\"data-component\");\r\n\tcomponent = window[\"HERO_\" + componentname];\r\n\r\n\t// Ensure the component exists\r\n\tif (typeof component == \"undefined\") {\r\n\t\tconsole.wrong(\r\n\t\t\t\"Call to undefined data-component `\" +\r\n\t\t\t\tcomponentname +\r\n\t\t\t\t\"`. Check to be sure it exists before calling with [data-component].\"\r\n\t\t);\r\n\r\n\t\treturn true;\r\n\t} else if (!component.config.init) {\r\n\t\tconsole.skltr(\"Initializing `\" + componentname + \"`...\");\r\n\r\n\t\t// Initialize the component, and set it's config.init to `true` to ensure initialization is a one-time only event.\r\n\t\tcomponent.init();\r\n\t\tcomponent.config.init = true;\r\n\t}\r\n});\r\n"],"file":"main.js"}