').addClass(settings.timer_progress_class));\n timer_container.addClass(settings.timer_paused_class);\n container.append(timer_container);\n }\n\n if (settings.slide_number) {\n number_container = $('
').addClass(settings.slide_number_class);\n number_container.append('
' + settings.slide_number_text + '
');\n container.append(number_container);\n }\n\n if (settings.bullets) {\n bullets_container = $('
').addClass(settings.bullets_container_class);\n container.append(bullets_container);\n bullets_container.wrap('');\n self.slides().each(function (idx, el) {\n var bullet = $('- ').attr('data-orbit-slide', idx).on('click', self.link_bullet);;\n bullets_container.append(bullet);\n });\n }\n\n };\n\n self._goto = function (next_idx, start_timer) {\n // if (locked) {return false;}\n if (next_idx === idx) {return false;}\n if (typeof timer === 'object') {timer.restart();}\n var slides = self.slides();\n\n var dir = 'next';\n locked = true;\n if (next_idx < idx) {dir = 'prev';}\n if (next_idx >= slides.length) {\n if (!settings.circular) {\n return false;\n }\n next_idx = 0;\n } else if (next_idx < 0) {\n if (!settings.circular) {\n return false;\n }\n next_idx = slides.length - 1;\n }\n\n var current = $(slides.get(idx));\n var next = $(slides.get(next_idx));\n\n current.css('zIndex', 2);\n current.removeClass(settings.active_slide_class);\n next.css('zIndex', 4).addClass(settings.active_slide_class);\n\n slides_container.trigger('before-slide-change.fndtn.orbit');\n settings.before_slide_change();\n self.update_active_link(next_idx);\n\n var callback = function () {\n var unlock = function () {\n idx = next_idx;\n locked = false;\n if (start_timer === true) {timer = self.create_timer(); timer.start();}\n self.update_slide_number(idx);\n slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);\n settings.after_slide_change(idx, slides.length);\n };\n if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {\n slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);\n } else {\n unlock();\n }\n };\n\n if (slides.length === 1) {callback(); return false;}\n\n var start_animation = function () {\n if (dir === 'next') {animate.next(current, next, callback);}\n if (dir === 'prev') {animate.prev(current, next, callback);}\n };\n\n if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {\n slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);\n } else {\n start_animation();\n }\n };\n\n self.next = function (e) {\n e.stopImmediatePropagation();\n e.preventDefault();\n self._goto(idx + 1);\n };\n\n self.prev = function (e) {\n e.stopImmediatePropagation();\n e.preventDefault();\n self._goto(idx - 1);\n };\n\n self.link_custom = function (e) {\n e.preventDefault();\n var link = $(this).attr('data-orbit-link');\n if ((typeof link === 'string') && (link = $.trim(link)) != '') {\n var slide = container.find('[data-orbit-slide=' + link + ']');\n if (slide.index() != -1) {self._goto(slide.index());}\n }\n };\n\n self.link_bullet = function (e) {\n var index = $(this).attr('data-orbit-slide');\n if ((typeof index === 'string') && (index = $.trim(index)) != '') {\n if (isNaN(parseInt(index))) {\n var slide = container.find('[data-orbit-slide=' + index + ']');\n if (slide.index() != -1) {self._goto(slide.index() + 1);}\n } else {\n self._goto(parseInt(index));\n }\n }\n\n }\n\n self.timer_callback = function () {\n self._goto(idx + 1, true);\n }\n\n self.compute_dimensions = function () {\n var current = $(self.slides().get(idx));\n var h = current.outerHeight();\n if (!settings.variable_height) {\n self.slides().each(function(){\n if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }\n });\n }\n slides_container.height(h);\n };\n\n self.create_timer = function () {\n var t = new Timer(\n container.find('.' + settings.timer_container_class),\n settings,\n self.timer_callback\n );\n return t;\n };\n\n self.stop_timer = function () {\n if (typeof timer === 'object') {\n timer.stop();\n }\n };\n\n self.toggle_timer = function () {\n var t = container.find('.' + settings.timer_container_class);\n if (t.hasClass(settings.timer_paused_class)) {\n if (typeof timer === 'undefined') {timer = self.create_timer();}\n timer.start();\n } else {\n if (typeof timer === 'object') {timer.stop();}\n }\n };\n\n self.init = function () {\n self.build_markup();\n if (settings.timer) {\n timer = self.create_timer();\n Foundation.utils.image_loaded(this.slides().children('img'), timer.start);\n }\n animate = new FadeAnimation(settings, slides_container);\n if (settings.animation === 'slide') {\n animate = new SlideAnimation(settings, slides_container);\n }\n\n container.on('click', '.' + settings.next_class, self.next);\n container.on('click', '.' + settings.prev_class, self.prev);\n\n if (settings.next_on_click) {\n container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);\n }\n\n container.on('click', self.toggle_timer);\n if (settings.swipe) {\n container.on('touchstart.fndtn.orbit', function (e) {\n if (!e.touches) {e = e.originalEvent;}\n var data = {\n start_page_x : e.touches[0].pageX,\n start_page_y : e.touches[0].pageY,\n start_time : (new Date()).getTime(),\n delta_x : 0,\n is_scrolling : undefined\n };\n container.data('swipe-transition', data);\n e.stopPropagation();\n })\n .on('touchmove.fndtn.orbit', function (e) {\n if (!e.touches) {\n e = e.originalEvent;\n }\n // Ignore pinch/zoom events\n if (e.touches.length > 1 || e.scale && e.scale !== 1) {\n return;\n }\n\n var data = container.data('swipe-transition');\n if (typeof data === 'undefined') {data = {};}\n\n data.delta_x = e.touches[0].pageX - data.start_page_x;\n\n if ( typeof data.is_scrolling === 'undefined') {\n data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );\n }\n\n if (!data.is_scrolling && !data.active) {\n e.preventDefault();\n var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);\n data.active = true;\n self._goto(direction);\n }\n })\n .on('touchend.fndtn.orbit', function (e) {\n container.data('swipe-transition', {});\n e.stopPropagation();\n })\n }\n container.on('mouseenter.fndtn.orbit', function (e) {\n if (settings.timer && settings.pause_on_hover) {\n self.stop_timer();\n }\n })\n .on('mouseleave.fndtn.orbit', function (e) {\n if (settings.timer && settings.resume_on_mouseout) {\n timer.start();\n }\n });\n\n $(document).on('click', '[data-orbit-link]', self.link_custom);\n $(window).on('load resize', self.compute_dimensions);\n Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);\n Foundation.utils.image_loaded(this.slides().children('img'), function () {\n container.prev('.' + settings.preloader_class).css('display', 'none');\n self.update_slide_number(0);\n self.update_active_link(0);\n slides_container.trigger('ready.fndtn.orbit');\n });\n };\n\n self.init();\n };\n\n var Timer = function (el, settings, callback) {\n var self = this,\n duration = settings.timer_speed,\n progress = el.find('.' + settings.timer_progress_class),\n start,\n timeout,\n left = -1;\n\n this.update_progress = function (w) {\n var new_progress = progress.clone();\n new_progress.attr('style', '');\n new_progress.css('width', w + '%');\n progress.replaceWith(new_progress);\n progress = new_progress;\n };\n\n this.restart = function () {\n clearTimeout(timeout);\n el.addClass(settings.timer_paused_class);\n left = -1;\n self.update_progress(0);\n };\n\n this.start = function () {\n if (!el.hasClass(settings.timer_paused_class)) {return true;}\n left = (left === -1) ? duration : left;\n el.removeClass(settings.timer_paused_class);\n start = new Date().getTime();\n progress.animate({'width' : '100%'}, left, 'linear');\n timeout = setTimeout(function () {\n self.restart();\n callback();\n }, left);\n el.trigger('timer-started.fndtn.orbit')\n };\n\n this.stop = function () {\n if (el.hasClass(settings.timer_paused_class)) {return true;}\n clearTimeout(timeout);\n el.addClass(settings.timer_paused_class);\n var end = new Date().getTime();\n left = left - (end - start);\n var w = 100 - ((left / duration) * 100);\n self.update_progress(w);\n el.trigger('timer-stopped.fndtn.orbit');\n };\n };\n\n var SlideAnimation = function (settings, container) {\n var duration = settings.animation_speed;\n var is_rtl = ($('html[dir=rtl]').length === 1);\n var margin = is_rtl ? 'marginRight' : 'marginLeft';\n var animMargin = {};\n animMargin[margin] = '0%';\n\n this.next = function (current, next, callback) {\n current.animate({marginLeft : '-100%'}, duration);\n next.animate(animMargin, duration, function () {\n current.css(margin, '100%');\n callback();\n });\n };\n\n this.prev = function (current, prev, callback) {\n current.animate({marginLeft : '100%'}, duration);\n prev.css(margin, '-100%');\n prev.animate(animMargin, duration, function () {\n current.css(margin, '100%');\n callback();\n });\n };\n };\n\n var FadeAnimation = function (settings, container) {\n var duration = settings.animation_speed;\n var is_rtl = ($('html[dir=rtl]').length === 1);\n var margin = is_rtl ? 'marginRight' : 'marginLeft';\n\n this.next = function (current, next, callback) {\n next.css({'margin' : '0%', 'opacity' : '0.01'});\n next.animate({'opacity' :'1'}, duration, 'linear', function () {\n current.css('margin', '100%');\n callback();\n });\n };\n\n this.prev = function (current, prev, callback) {\n prev.css({'margin' : '0%', 'opacity' : '0.01'});\n prev.animate({'opacity' : '1'}, duration, 'linear', function () {\n current.css('margin', '100%');\n callback();\n });\n };\n };\n\n Foundation.libs = Foundation.libs || {};\n\n Foundation.libs.orbit = {\n name : 'orbit',\n\n version : '5.5.3',\n\n settings : {\n animation : 'slide',\n timer_speed : 10000,\n pause_on_hover : true,\n resume_on_mouseout : false,\n next_on_click : true,\n animation_speed : 500,\n stack_on_small : false,\n navigation_arrows : true,\n slide_number : true,\n slide_number_text : 'of',\n container_class : 'orbit-container',\n stack_on_small_class : 'orbit-stack-on-small',\n next_class : 'orbit-next',\n prev_class : 'orbit-prev',\n timer_container_class : 'orbit-timer',\n timer_paused_class : 'paused',\n timer_progress_class : 'orbit-progress',\n slides_container_class : 'orbit-slides-container',\n preloader_class : 'preloader',\n slide_selector : '*',\n bullets_container_class : 'orbit-bullets',\n bullets_active_class : 'active',\n slide_number_class : 'orbit-slide-number',\n caption_class : 'orbit-caption',\n active_slide_class : 'active',\n orbit_transition_class : 'orbit-transitioning',\n bullets : true,\n circular : true,\n timer : true,\n variable_height : false,\n swipe : true,\n before_slide_change : noop,\n after_slide_change : noop\n },\n\n init : function (scope, method, options) {\n var self = this;\n this.bindings(method, options);\n },\n\n events : function (instance) {\n var orbit_instance = new Orbit(this.S(instance), this.S(instance).data('orbit-init'));\n this.S(instance).data(this.name + '-instance', orbit_instance);\n },\n\n reflow : function () {\n var self = this;\n\n if (self.S(self.scope).is('[data-orbit]')) {\n var $el = self.S(self.scope);\n var instance = $el.data(self.name + '-instance');\n instance.compute_dimensions();\n } else {\n self.S('[data-orbit]', self.scope).each(function (idx, el) {\n var $el = self.S(el);\n var opts = self.data_options($el);\n var instance = $el.data(self.name + '-instance');\n instance.compute_dimensions();\n });\n }\n }\n };\n\n}(jQuery, window, window.document));\n\n;(function ($, window, document, undefined) {\n 'use strict';\n\n var openModals = [];\n\n Foundation.libs.reveal = {\n name : 'reveal',\n\n version : '5.5.3',\n\n locked : false,\n\n settings : {\n animation : 'fadeAndPop',\n animation_speed : 250,\n close_on_background_click : true,\n close_on_esc : true,\n dismiss_modal_class : 'close-reveal-modal',\n multiple_opened : false,\n bg_class : 'reveal-modal-bg',\n root_element : 'body',\n open : function(){},\n opened : function(){},\n close : function(){},\n closed : function(){},\n on_ajax_error: $.noop,\n bg : $('.reveal-modal-bg'),\n css : {\n open : {\n 'opacity' : 0,\n 'visibility' : 'visible',\n 'display' : 'block'\n },\n close : {\n 'opacity' : 1,\n 'visibility' : 'hidden',\n 'display' : 'none'\n }\n }\n },\n\n init : function (scope, method, options) {\n $.extend(true, this.settings, method, options);\n this.bindings(method, options);\n },\n\n events : function (scope) {\n var self = this,\n S = self.S;\n\n S(this.scope)\n .off('.reveal')\n .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {\n e.preventDefault();\n\n if (!self.locked) {\n var element = S(this),\n ajax = element.data(self.data_attr('reveal-ajax')),\n replaceContentSel = element.data(self.data_attr('reveal-replace-content'));\n\n self.locked = true;\n\n if (typeof ajax === 'undefined') {\n self.open.call(self, element);\n } else {\n var url = ajax === true ? element.attr('href') : ajax;\n self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel });\n }\n }\n });\n\n S(document)\n .on('click.fndtn.reveal', this.close_targets(), function (e) {\n e.preventDefault();\n if (!self.locked) {\n var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,\n bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];\n\n if (bg_clicked) {\n if (settings.close_on_background_click) {\n e.stopPropagation();\n } else {\n return;\n }\n }\n\n self.locked = true;\n self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));\n }\n });\n\n if (S('[' + self.attr_name() + ']', this.scope).length > 0) {\n S(this.scope)\n // .off('.reveal')\n .on('open.fndtn.reveal', this.settings.open)\n .on('opened.fndtn.reveal', this.settings.opened)\n .on('opened.fndtn.reveal', this.open_video)\n .on('close.fndtn.reveal', this.settings.close)\n .on('closed.fndtn.reveal', this.settings.closed)\n .on('closed.fndtn.reveal', this.close_video);\n } else {\n S(this.scope)\n // .off('.reveal')\n .on('open.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.open)\n .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.opened)\n .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.open_video)\n .on('close.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.close)\n .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.closed)\n .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.close_video);\n }\n\n return true;\n },\n\n // PATCH #3: turning on key up capture only when a reveal window is open\n key_up_on : function (scope) {\n var self = this;\n\n // PATCH #1: fixing multiple keyup event trigger from single key press\n self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {\n var open_modal = self.S('[' + self.attr_name() + '].open'),\n settings = open_modal.data(self.attr_name(true) + '-init') || self.settings ;\n // PATCH #2: making sure that the close event can be called only while unlocked,\n // so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window.\n if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key\n self.close.call(self, open_modal);\n }\n });\n\n return true;\n },\n\n // PATCH #3: turning on key up capture only when a reveal window is open\n key_up_off : function (scope) {\n this.S('body').off('keyup.fndtn.reveal');\n return true;\n },\n\n open : function (target, ajax_settings) {\n var self = this,\n modal;\n\n if (target) {\n if (typeof target.selector !== 'undefined') {\n // Find the named node; only use the first one found, since the rest of the code assumes there's only one node\n modal = self.S('#' + target.data(self.data_attr('reveal-id'))).first();\n } else {\n modal = self.S(this.scope);\n\n ajax_settings = target;\n }\n } else {\n modal = self.S(this.scope);\n }\n\n var settings = modal.data(self.attr_name(true) + '-init');\n settings = settings || this.settings;\n\n\n if (modal.hasClass('open') && target !== undefined && target.attr('data-reveal-id') == modal.attr('id')) {\n return self.close(modal);\n }\n\n if (!modal.hasClass('open')) {\n var open_modal = self.S('[' + self.attr_name() + '].open');\n\n if (typeof modal.data('css-top') === 'undefined') {\n modal.data('css-top', parseInt(modal.css('top'), 10))\n .data('offset', this.cache_offset(modal));\n }\n\n modal.attr('tabindex','0').attr('aria-hidden','false');\n\n this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open\n\n // Prevent namespace event from triggering twice\n modal.on('open.fndtn.reveal', function(e) {\n if (e.namespace !== 'fndtn.reveal') return;\n });\n\n modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');\n\n if (open_modal.length < 1) {\n this.toggle_bg(modal, true);\n }\n\n if (typeof ajax_settings === 'string') {\n ajax_settings = {\n url : ajax_settings\n };\n }\n\n var openModal = function() {\n if(open_modal.length > 0) {\n if(settings.multiple_opened) {\n self.to_back(open_modal);\n } else {\n self.hide(open_modal, settings.css.close);\n }\n }\n\n // bl: add the open_modal that isn't already in the background to the openModals array\n if(settings.multiple_opened) {\n openModals.push(modal);\n }\n\n self.show(modal, settings.css.open);\n };\n\n if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {\n openModal();\n } else {\n var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;\n $.extend(ajax_settings, {\n success : function (data, textStatus, jqXHR) {\n if ( $.isFunction(old_success) ) {\n var result = old_success(data, textStatus, jqXHR);\n if (typeof result == 'string') {\n data = result;\n }\n }\n\n if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') {\n modal.find(options.replaceContentSel).html(data);\n } else {\n modal.html(data);\n }\n\n self.S(modal).foundation('section', 'reflow');\n self.S(modal).children().foundation();\n\n openModal();\n }\n });\n\n // check for if user initalized with error callback\n if (settings.on_ajax_error !== $.noop) {\n $.extend(ajax_settings, {\n error : settings.on_ajax_error\n });\n }\n\n $.ajax(ajax_settings);\n }\n }\n self.S(window).trigger('resize');\n },\n\n close : function (modal) {\n var modal = modal && modal.length ? modal : this.S(this.scope),\n open_modals = this.S('[' + this.attr_name() + '].open'),\n settings = modal.data(this.attr_name(true) + '-init') || this.settings,\n self = this;\n\n if (open_modals.length > 0) {\n\n modal.removeAttr('tabindex','0').attr('aria-hidden','true');\n\n this.locked = true;\n this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open\n\n modal.trigger('close.fndtn.reveal');\n\n if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) {\n self.toggle_bg(modal, false);\n self.to_front(modal);\n }\n\n if (settings.multiple_opened) {\n var isCurrent = modal.is(':not(.toback)');\n self.hide(modal, settings.css.close, settings);\n if(isCurrent) {\n // remove the last modal since it is now closed\n openModals.pop();\n } else {\n // if this isn't the current modal, then find it in the array and remove it\n openModals = $.grep(openModals, function(elt) {\n var isThis = elt[0]===modal[0];\n if(isThis) {\n // since it's not currently in the front, put it in the front now that it is hidden\n // so that if it's re-opened, it won't be .toback\n self.to_front(modal);\n }\n return !isThis;\n });\n }\n // finally, show the next modal in the stack, if there is one\n if(openModals.length>0) {\n self.to_front(openModals[openModals.length - 1]);\n }\n } else {\n self.hide(open_modals, settings.css.close, settings);\n }\n }\n },\n\n close_targets : function () {\n var base = '.' + this.settings.dismiss_modal_class;\n\n if (this.settings.close_on_background_click) {\n return base + ', .' + this.settings.bg_class;\n }\n\n return base;\n },\n\n toggle_bg : function (modal, state) {\n if (this.S('.' + this.settings.bg_class).length === 0) {\n this.settings.bg = $('', {'class': this.settings.bg_class})\n .appendTo('body').hide();\n }\n\n var visible = this.settings.bg.filter(':visible').length > 0;\n if ( state != visible ) {\n if ( state == undefined ? visible : !state ) {\n this.hide(this.settings.bg);\n } else {\n this.show(this.settings.bg);\n }\n }\n },\n\n show : function (el, css) {\n // is modal\n if (css) {\n var settings = el.data(this.attr_name(true) + '-init') || this.settings,\n root_element = settings.root_element,\n context = this;\n\n if (el.parent(root_element).length === 0) {\n var placeholder = el.wrap('').parent();\n\n el.on('closed.fndtn.reveal.wrapped', function () {\n el.detach().appendTo(placeholder);\n el.unwrap().unbind('closed.fndtn.reveal.wrapped');\n });\n\n el.detach().appendTo(root_element);\n }\n\n var animData = getAnimationData(settings.animation);\n if (!animData.animate) {\n this.locked = false;\n }\n if (animData.pop) {\n css.top = $(window).scrollTop() - el.data('offset') + 'px';\n var end_css = {\n top: $(window).scrollTop() + el.data('css-top') + 'px',\n opacity: 1\n };\n\n return setTimeout(function () {\n return el\n .css(css)\n .animate(end_css, settings.animation_speed, 'linear', function () {\n context.locked = false;\n el.trigger('opened.fndtn.reveal');\n })\n .addClass('open');\n }, settings.animation_speed / 2);\n }\n\n css.top = $(window).scrollTop() + el.data('css-top') + 'px';\n\n if (animData.fade) {\n var end_css = {opacity: 1};\n\n return setTimeout(function () {\n return el\n .css(css)\n .animate(end_css, settings.animation_speed, 'linear', function () {\n context.locked = false;\n el.trigger('opened.fndtn.reveal');\n })\n .addClass('open');\n }, settings.animation_speed / 2);\n }\n\n return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal');\n }\n\n var settings = this.settings;\n\n // should we animate the background?\n if (getAnimationData(settings.animation).fade) {\n return el.fadeIn(settings.animation_speed / 2);\n }\n\n this.locked = false;\n\n return el.show();\n },\n\n to_back : function(el) {\n el.addClass('toback');\n },\n\n to_front : function(el) {\n el.removeClass('toback');\n },\n\n hide : function (el, css) {\n // is modal\n if (css) {\n var settings = el.data(this.attr_name(true) + '-init'),\n context = this;\n settings = settings || this.settings;\n\n var animData = getAnimationData(settings.animation);\n if (!animData.animate) {\n this.locked = false;\n }\n if (animData.pop) {\n var end_css = {\n top: - $(window).scrollTop() - el.data('offset') + 'px',\n opacity: 0\n };\n\n return setTimeout(function () {\n return el\n .animate(end_css, settings.animation_speed, 'linear', function () {\n context.locked = false;\n el.css(css).trigger('closed.fndtn.reveal');\n })\n .removeClass('open');\n }, settings.animation_speed / 2);\n }\n\n if (animData.fade) {\n var end_css = {opacity : 0};\n\n return setTimeout(function () {\n return el\n .animate(end_css, settings.animation_speed, 'linear', function () {\n context.locked = false;\n el.css(css).trigger('closed.fndtn.reveal');\n })\n .removeClass('open');\n }, settings.animation_speed / 2);\n }\n\n return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');\n }\n\n var settings = this.settings;\n\n // should we animate the background?\n if (getAnimationData(settings.animation).fade) {\n return el.fadeOut(settings.animation_speed / 2);\n }\n\n return el.hide();\n },\n\n close_video : function (e) {\n var video = $('.flex-video', e.target),\n iframe = $('iframe', video);\n\n if (iframe.length > 0) {\n iframe.attr('data-src', iframe[0].src);\n iframe.attr('src', iframe.attr('src'));\n video.hide();\n }\n },\n\n open_video : function (e) {\n var video = $('.flex-video', e.target),\n iframe = video.find('iframe');\n\n if (iframe.length > 0) {\n var data_src = iframe.attr('data-src');\n if (typeof data_src === 'string') {\n iframe[0].src = iframe.attr('data-src');\n } else {\n var src = iframe[0].src;\n iframe[0].src = undefined;\n iframe[0].src = src;\n }\n video.show();\n }\n },\n\n data_attr : function (str) {\n if (this.namespace.length > 0) {\n return this.namespace + '-' + str;\n }\n\n return str;\n },\n\n cache_offset : function (modal) {\n var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY;\n\n modal.hide();\n\n return offset;\n },\n\n off : function () {\n $(this.scope).off('.fndtn.reveal');\n },\n\n reflow : function () {}\n };\n\n /*\n * getAnimationData('popAndFade') // {animate: true, pop: true, fade: true}\n * getAnimationData('fade') // {animate: true, pop: false, fade: true}\n * getAnimationData('pop') // {animate: true, pop: true, fade: false}\n * getAnimationData('foo') // {animate: false, pop: false, fade: false}\n * getAnimationData(null) // {animate: false, pop: false, fade: false}\n */\n function getAnimationData(str) {\n var fade = /fade/i.test(str);\n var pop = /pop/i.test(str);\n return {\n animate : fade || pop,\n pop : pop,\n fade : fade\n };\n }\n}(jQuery, window, window.document));\n\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.slider = {\n name : 'slider',\n\n version : '5.5.3',\n\n settings : {\n start : 0,\n end : 100,\n step : 1,\n precision : 2,\n initial : null,\n display_selector : '',\n vertical : false,\n trigger_input_change : false,\n on_change : function () {}\n },\n\n cache : {},\n\n init : function (scope, method, options) {\n Foundation.inherit(this, 'throttle');\n this.bindings(method, options);\n this.reflow();\n },\n\n events : function () {\n var self = this;\n $(this.scope)\n .off('.slider')\n .on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',\n '[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function (e) {\n if (!self.cache.active) {\n e.preventDefault();\n self.set_active_slider($(e.target));\n }\n })\n .on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function (e) {\n if (!!self.cache.active) {\n e.preventDefault();\n if ($.data(self.cache.active[0], 'settings').vertical) {\n var scroll_offset = 0;\n if (!e.pageY) {\n scroll_offset = window.scrollY;\n }\n self.calculate_position(self.cache.active, self.get_cursor_position(e, 'y') + scroll_offset);\n } else {\n self.calculate_position(self.cache.active, self.get_cursor_position(e, 'x'));\n }\n }\n })\n .on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function (e) {\n if(!self.cache.active) {\n // if the user has just clicked into the slider without starting to drag the handle\n var slider = $(e.target).attr('role') === 'slider' ? $(e.target) : $(e.target).closest('.range-slider').find(\"[role='slider']\");\n\n if (slider.length && (!slider.parent().hasClass('disabled') && !slider.parent().attr('disabled'))) {\n self.set_active_slider(slider);\n if ($.data(self.cache.active[0], 'settings').vertical) {\n var scroll_offset = 0;\n if (!e.pageY) {\n scroll_offset = window.scrollY;\n }\n self.calculate_position(self.cache.active, self.get_cursor_position(e, 'y') + scroll_offset);\n } else {\n self.calculate_position(self.cache.active, self.get_cursor_position(e, 'x'));\n }\n }\n }\n self.remove_active_slider();\n })\n .on('change.fndtn.slider', function (e) {\n self.settings.on_change();\n });\n\n self.S(window)\n .on('resize.fndtn.slider', self.throttle(function (e) {\n self.reflow();\n }, 300));\n\n // update slider value as users change input value\n this.S('[' + this.attr_name() + ']').each(function () {\n var slider = $(this),\n handle = slider.children('.range-slider-handle')[0],\n settings = self.initialize_settings(handle);\n\n if (settings.display_selector != '') {\n $(settings.display_selector).each(function(){\n if ($(this).attr('value')) {\n $(this).off('change').on('change', function () {\n slider.foundation(\"slider\", \"set_value\", $(this).val());\n });\n }\n });\n }\n });\n },\n\n get_cursor_position : function (e, xy) {\n var pageXY = 'page' + xy.toUpperCase(),\n clientXY = 'client' + xy.toUpperCase(),\n position;\n\n if (typeof e[pageXY] !== 'undefined') {\n position = e[pageXY];\n } else if (typeof e.originalEvent[clientXY] !== 'undefined') {\n position = e.originalEvent[clientXY];\n } else if (e.originalEvent.touches && e.originalEvent.touches[0] && typeof e.originalEvent.touches[0][clientXY] !== 'undefined') {\n position = e.originalEvent.touches[0][clientXY];\n } else if (e.currentPoint && typeof e.currentPoint[xy] !== 'undefined') {\n position = e.currentPoint[xy];\n }\n\n return position;\n },\n\n set_active_slider : function ($handle) {\n this.cache.active = $handle;\n },\n\n remove_active_slider : function () {\n this.cache.active = null;\n },\n\n calculate_position : function ($handle, cursor_x) {\n var self = this,\n settings = $.data($handle[0], 'settings'),\n handle_l = $.data($handle[0], 'handle_l'),\n handle_o = $.data($handle[0], 'handle_o'),\n bar_l = $.data($handle[0], 'bar_l'),\n bar_o = $.data($handle[0], 'bar_o');\n\n requestAnimationFrame(function () {\n var pct;\n\n if (Foundation.rtl && !settings.vertical) {\n pct = self.limit_to(((bar_o + bar_l - cursor_x) / bar_l), 0, 1);\n } else {\n pct = self.limit_to(((cursor_x - bar_o) / bar_l), 0, 1);\n }\n\n pct = settings.vertical ? 1 - pct : pct;\n\n var norm = self.normalized_value(pct, settings.start, settings.end, settings.step, settings.precision);\n\n self.set_ui($handle, norm);\n });\n },\n\n set_ui : function ($handle, value) {\n var settings = $.data($handle[0], 'settings'),\n handle_l = $.data($handle[0], 'handle_l'),\n bar_l = $.data($handle[0], 'bar_l'),\n norm_pct = this.normalized_percentage(value, settings.start, settings.end),\n handle_offset = norm_pct * (bar_l - handle_l) - 1,\n progress_bar_length = norm_pct * 100,\n $handle_parent = $handle.parent(),\n $hidden_inputs = $handle.parent().children('input[type=hidden]');\n\n if (Foundation.rtl && !settings.vertical) {\n handle_offset = -handle_offset;\n }\n\n handle_offset = settings.vertical ? -handle_offset + bar_l - handle_l + 1 : handle_offset;\n this.set_translate($handle, handle_offset, settings.vertical);\n\n if (settings.vertical) {\n $handle.siblings('.range-slider-active-segment').css('height', progress_bar_length + '%');\n } else {\n $handle.siblings('.range-slider-active-segment').css('width', progress_bar_length + '%');\n }\n\n $handle_parent.attr(this.attr_name(), value).trigger('change.fndtn.slider');\n\n $hidden_inputs.val(value);\n if (settings.trigger_input_change) {\n $hidden_inputs.trigger('change.fndtn.slider');\n }\n\n if (!$handle[0].hasAttribute('aria-valuemin')) {\n $handle.attr({\n 'aria-valuemin' : settings.start,\n 'aria-valuemax' : settings.end\n });\n }\n $handle.attr('aria-valuenow', value);\n\n if (settings.display_selector != '') {\n $(settings.display_selector).each(function () {\n if (this.hasAttribute('value')) {\n $(this).val(value);\n } else {\n $(this).text(value);\n }\n });\n }\n\n },\n\n normalized_percentage : function (val, start, end) {\n return Math.min(1, (val - start) / (end - start));\n },\n\n normalized_value : function (val, start, end, step, precision) {\n var range = end - start,\n point = val * range,\n mod = (point - (point % step)) / step,\n rem = point % step,\n round = ( rem >= step * 0.5 ? step : 0);\n return ((mod * step + round) + start).toFixed(precision);\n },\n\n set_translate : function (ele, offset, vertical) {\n if (vertical) {\n $(ele)\n .css('-webkit-transform', 'translateY(' + offset + 'px)')\n .css('-moz-transform', 'translateY(' + offset + 'px)')\n .css('-ms-transform', 'translateY(' + offset + 'px)')\n .css('-o-transform', 'translateY(' + offset + 'px)')\n .css('transform', 'translateY(' + offset + 'px)');\n } else {\n $(ele)\n .css('-webkit-transform', 'translateX(' + offset + 'px)')\n .css('-moz-transform', 'translateX(' + offset + 'px)')\n .css('-ms-transform', 'translateX(' + offset + 'px)')\n .css('-o-transform', 'translateX(' + offset + 'px)')\n .css('transform', 'translateX(' + offset + 'px)');\n }\n },\n\n limit_to : function (val, min, max) {\n return Math.min(Math.max(val, min), max);\n },\n\n initialize_settings : function (handle) {\n var settings = $.extend({}, this.settings, this.data_options($(handle).parent())),\n decimal_places_match_result;\n\n if (settings.precision === null) {\n decimal_places_match_result = ('' + settings.step).match(/\\.([\\d]*)/);\n settings.precision = decimal_places_match_result && decimal_places_match_result[1] ? decimal_places_match_result[1].length : 0;\n }\n\n if (settings.vertical) {\n $.data(handle, 'bar_o', $(handle).parent().offset().top);\n $.data(handle, 'bar_l', $(handle).parent().outerHeight());\n $.data(handle, 'handle_o', $(handle).offset().top);\n $.data(handle, 'handle_l', $(handle).outerHeight());\n } else {\n $.data(handle, 'bar_o', $(handle).parent().offset().left);\n $.data(handle, 'bar_l', $(handle).parent().outerWidth());\n $.data(handle, 'handle_o', $(handle).offset().left);\n $.data(handle, 'handle_l', $(handle).outerWidth());\n }\n\n $.data(handle, 'bar', $(handle).parent());\n return $.data(handle, 'settings', settings);\n },\n\n set_initial_position : function ($ele) {\n var settings = $.data($ele.children('.range-slider-handle')[0], 'settings'),\n initial = ((typeof settings.initial == 'number' && !isNaN(settings.initial)) ? settings.initial : Math.floor((settings.end - settings.start) * 0.5 / settings.step) * settings.step + settings.start),\n $handle = $ele.children('.range-slider-handle');\n this.set_ui($handle, initial);\n },\n\n set_value : function (value) {\n var self = this;\n $('[' + self.attr_name() + ']', this.scope).each(function () {\n $(this).attr(self.attr_name(), value);\n });\n if (!!$(this.scope).attr(self.attr_name())) {\n $(this.scope).attr(self.attr_name(), value);\n }\n self.reflow();\n },\n\n reflow : function () {\n var self = this;\n self.S('[' + this.attr_name() + ']').each(function () {\n var handle = $(this).children('.range-slider-handle')[0],\n val = $(this).attr(self.attr_name());\n self.initialize_settings(handle);\n\n if (val) {\n self.set_ui($(handle), parseFloat(val));\n } else {\n self.set_initial_position($(this));\n }\n });\n }\n };\n\n}(jQuery, window, window.document));\n\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.tab = {\n name : 'tab',\n\n version : '5.5.3',\n\n settings : {\n active_class : 'active',\n callback : function () {},\n deep_linking : false,\n scroll_to_content : true,\n is_hover : false\n },\n\n default_tab_hashes : [],\n\n init : function (scope, method, options) {\n var self = this,\n S = this.S;\n\n \t // Store the default active tabs which will be referenced when the\n \t // location hash is absent, as in the case of navigating the tabs and\n \t // returning to the first viewing via the browser Back button.\n \t S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {\n \t self.default_tab_hashes.push(this.hash);\n \t });\n\n this.bindings(method, options);\n this.handle_location_hash_change();\n },\n\n events : function () {\n var self = this,\n S = this.S;\n\n var usual_tab_behavior = function (e, target) {\n var settings = S(target).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');\n if (!settings.is_hover || Modernizr.touch) {\n // if user did not pressed tab key, prevent default action\n var keyCode = e.keyCode || e.which;\n if (keyCode !== 9) { \n e.preventDefault();\n e.stopPropagation();\n }\n self.toggle_active_tab(S(target).parent());\n \n }\n };\n\n S(this.scope)\n .off('.tab')\n // Key event: focus/tab key\n .on('keydown.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {\n var keyCode = e.keyCode || e.which;\n // if user pressed tab key\n if (keyCode === 13 || keyCode === 32) { // enter or space\n var el = this;\n usual_tab_behavior(e, el);\n } \n })\n // Click event: tab title\n .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {\n var el = this;\n usual_tab_behavior(e, el);\n })\n // Hover event: tab title\n .on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {\n var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');\n if (settings.is_hover) {\n self.toggle_active_tab(S(this).parent());\n }\n });\n\n // Location hash change event\n S(window).on('hashchange.fndtn.tab', function (e) {\n e.preventDefault();\n self.handle_location_hash_change();\n });\n },\n\n handle_location_hash_change : function () {\n\n var self = this,\n S = this.S;\n\n S('[' + this.attr_name() + ']', this.scope).each(function () {\n var settings = S(this).data(self.attr_name(true) + '-init');\n if (settings.deep_linking) {\n // Match the location hash to a label\n var hash;\n if (settings.scroll_to_content) {\n hash = self.scope.location.hash;\n } else {\n // prefix the hash to prevent anchor scrolling\n hash = self.scope.location.hash.replace('fndtn-', '');\n }\n if (hash != '') {\n // Check whether the location hash references a tab content div or\n // another element on the page (inside or outside the tab content div)\n var hash_element = S(hash);\n if (hash_element.hasClass('content') && hash_element.parent().hasClass('tabs-content')) {\n // Tab content div\n self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent());\n } else {\n // Not the tab content div. If inside the tab content, find the\n // containing tab and toggle it as active.\n var hash_tab_container_id = hash_element.closest('.content').attr('id');\n if (hash_tab_container_id != undefined) {\n self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash);\n }\n }\n } else {\n // Reference the default tab hashes which were initialized in the init function\n for (var ind = 0; ind < self.default_tab_hashes.length; ind++) {\n self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent());\n }\n }\n }\n });\n },\n\n toggle_active_tab : function (tab, location_hash) {\n var self = this,\n S = self.S,\n tabs = tab.closest('[' + this.attr_name() + ']'),\n tab_link = tab.find('a'),\n anchor = tab.children('a').first(),\n target_hash = '#' + anchor.attr('href').split('#')[1],\n target = S(target_hash),\n siblings = tab.siblings(),\n settings = tabs.data(this.attr_name(true) + '-init'),\n interpret_keyup_action = function (e) {\n // Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js\n\n // define current, previous and next (possible) tabs\n\n var $original = $(this);\n var $prev = $(this).parents('li').prev().children('[role=\"tab\"]');\n var $next = $(this).parents('li').next().children('[role=\"tab\"]');\n var $target;\n\n // find the direction (prev or next)\n\n switch (e.keyCode) {\n case 37:\n $target = $prev;\n break;\n case 39:\n $target = $next;\n break;\n default:\n $target = false\n break;\n }\n\n if ($target.length) {\n $original.attr({\n 'tabindex' : '-1',\n 'aria-selected' : null\n });\n $target.attr({\n 'tabindex' : '0',\n 'aria-selected' : true\n }).focus();\n }\n\n // Hide panels\n\n $('[role=\"tabpanel\"]')\n .attr('aria-hidden', 'true');\n\n // Show panel which corresponds to target\n\n $('#' + $(document.activeElement).attr('href').substring(1))\n .attr('aria-hidden', null);\n\n },\n go_to_hash = function(hash) {\n // This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it\n // the user would get continually redirected to the default hash.\n var default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : 'fndtn-' + self.default_tab_hashes[0].replace('#', '');\n\n if (hash !== default_hash || window.location.hash) {\n window.location.hash = hash;\n }\n };\n\n // allow usage of data-tab-content attribute instead of href\n if (anchor.data('tab-content')) {\n target_hash = '#' + anchor.data('tab-content').split('#')[1];\n target = S(target_hash);\n }\n\n if (settings.deep_linking) {\n\n if (settings.scroll_to_content) {\n\n // retain current hash to scroll to content\n go_to_hash(location_hash || target_hash);\n\n if (location_hash == undefined || location_hash == target_hash) {\n tab.parent()[0].scrollIntoView();\n } else {\n S(target_hash)[0].scrollIntoView();\n }\n } else {\n // prefix the hashes so that the browser doesn't scroll down\n if (location_hash != undefined) {\n go_to_hash('fndtn-' + location_hash.replace('#', ''));\n } else {\n go_to_hash('fndtn-' + target_hash.replace('#', ''));\n }\n }\n }\n\n // WARNING: The activation and deactivation of the tab content must\n // occur after the deep linking in order to properly refresh the browser\n // window (notably in Chrome).\n // Clean up multiple attr instances to done once\n tab.addClass(settings.active_class).triggerHandler('opened');\n tab_link.attr({'aria-selected' : 'true', tabindex : 0});\n siblings.removeClass(settings.active_class)\n siblings.find('a').attr({'aria-selected' : 'false'/*, tabindex : -1*/});\n target.siblings().removeClass(settings.active_class).attr({'aria-hidden' : 'true'/*, tabindex : -1*/});\n target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex');\n settings.callback(tab);\n target.triggerHandler('toggled', [target]);\n tabs.triggerHandler('toggled', [tab]);\n\n tab_link.off('keydown').on('keydown', interpret_keyup_action );\n },\n\n data_attr : function (str) {\n if (this.namespace.length > 0) {\n return this.namespace + '-' + str;\n }\n\n return str;\n },\n\n off : function () {},\n\n reflow : function () {}\n };\n}(jQuery, window, window.document));\n\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.tooltip = {\n name : 'tooltip',\n\n version : '5.5.3',\n\n settings : {\n additional_inheritable_classes : [],\n tooltip_class : '.tooltip',\n append_to : 'body',\n touch_close_text : 'Tap To Close',\n disable_for_touch : false,\n hover_delay : 200,\n fade_in_duration : 150,\n fade_out_duration : 150,\n show_on : 'all',\n tip_template : function (selector, content) {\n return '' + content + '';\n }\n },\n\n cache : {},\n\n init : function (scope, method, options) {\n Foundation.inherit(this, 'random_str');\n this.bindings(method, options);\n },\n\n should_show : function (target, tip) {\n var settings = $.extend({}, this.settings, this.data_options(target));\n\n if (settings.show_on === 'all') {\n return true;\n } else if (this.small() && settings.show_on === 'small') {\n return true;\n } else if (this.medium() && settings.show_on === 'medium') {\n return true;\n } else if (this.large() && settings.show_on === 'large') {\n return true;\n }\n return false;\n },\n\n medium : function () {\n return matchMedia(Foundation.media_queries['medium']).matches;\n },\n\n large : function () {\n return matchMedia(Foundation.media_queries['large']).matches;\n },\n\n events : function (instance) {\n var self = this,\n S = self.S;\n\n self.create(this.S(instance));\n\n function _startShow(elt, $this, immediate) {\n if (elt.timer) {\n return;\n }\n\n if (immediate) {\n elt.timer = null;\n self.showTip($this);\n } else {\n elt.timer = setTimeout(function () {\n elt.timer = null;\n self.showTip($this);\n }.bind(elt), self.settings.hover_delay);\n }\n }\n\n function _startHide(elt, $this) {\n if (elt.timer) {\n clearTimeout(elt.timer);\n elt.timer = null;\n }\n\n self.hide($this);\n }\n\n $(this.scope)\n .off('.tooltip')\n .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',\n '[' + this.attr_name() + ']', function (e) {\n var $this = S(this),\n settings = $.extend({}, self.settings, self.data_options($this)),\n is_touch = false;\n\n if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type) && S(e.target).is('a')) {\n return false;\n }\n\n if (/mouse/i.test(e.type) && self.ie_touch(e)) {\n return false;\n }\n \n if ($this.hasClass('open')) {\n if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {\n e.preventDefault();\n }\n self.hide($this);\n } else {\n if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {\n return;\n } else if (!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {\n e.preventDefault();\n S(settings.tooltip_class + '.open').hide();\n is_touch = true;\n // close other open tooltips on touch\n if ($('.open[' + self.attr_name() + ']').length > 0) {\n var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);\n self.hide(prevOpen);\n }\n }\n\n if (/enter|over/i.test(e.type)) {\n _startShow(this, $this);\n\n } else if (e.type === 'mouseout' || e.type === 'mouseleave') {\n _startHide(this, $this);\n } else {\n _startShow(this, $this, true);\n }\n }\n })\n .on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) {\n if (/mouse/i.test(e.type) && self.ie_touch(e)) {\n return false;\n }\n\n if ($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {\n return;\n } else if ($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {\n self.convert_to_touch($(this));\n } else {\n _startHide(this, $(this));\n }\n })\n .on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {\n _startHide(this, S(this));\n });\n },\n\n ie_touch : function (e) {\n // How do I distinguish between IE11 and Windows Phone 8?????\n return false;\n },\n\n showTip : function ($target) {\n var $tip = this.getTip($target);\n if (this.should_show($target, $tip)) {\n return this.show($target);\n }\n return;\n },\n\n getTip : function ($target) {\n var selector = this.selector($target),\n settings = $.extend({}, this.settings, this.data_options($target)),\n tip = null;\n\n if (selector) {\n tip = this.S('span[data-selector=\"' + selector + '\"]' + settings.tooltip_class);\n }\n\n return (typeof tip === 'object') ? tip : false;\n },\n\n selector : function ($target) {\n var dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');\n\n if (typeof dataSelector != 'string') {\n dataSelector = this.random_str(6);\n $target\n .attr('data-selector', dataSelector)\n .attr('aria-describedby', dataSelector);\n }\n\n return dataSelector;\n },\n\n create : function ($target) {\n var self = this,\n settings = $.extend({}, this.settings, this.data_options($target)),\n tip_template = this.settings.tip_template;\n\n if (typeof settings.tip_template === 'string' && window.hasOwnProperty(settings.tip_template)) {\n tip_template = window[settings.tip_template];\n }\n\n var $tip = $(tip_template(this.selector($target), $('').html($target.attr('title')).html())),\n classes = this.inheritable_classes($target);\n\n $tip.addClass(classes).appendTo(settings.append_to);\n\n if (Modernizr.touch) {\n $tip.append('' + settings.touch_close_text + '');\n $tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function (e) {\n self.hide($target);\n });\n }\n\n $target.removeAttr('title').attr('title', '');\n },\n\n reposition : function (target, tip, classes) {\n var width, nub, nubHeight, nubWidth, objPos;\n\n tip.css('visibility', 'hidden').show();\n\n width = target.data('width');\n nub = tip.children('.nub');\n nubHeight = nub.outerHeight();\n nubWidth = nub.outerWidth();\n\n if (this.small()) {\n tip.css({'width' : '100%'});\n } else {\n tip.css({'width' : (width) ? width : 'auto'});\n }\n\n objPos = function (obj, top, right, bottom, left, width) {\n return obj.css({\n 'top' : (top) ? top : 'auto',\n 'bottom' : (bottom) ? bottom : 'auto',\n 'left' : (left) ? left : 'auto',\n 'right' : (right) ? right : 'auto'\n }).end();\n };\n \n var o_top = target.offset().top;\n var o_left = target.offset().left;\n var outerHeight = target.outerHeight();\n\n objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', o_left);\n\n if (this.small()) {\n objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', 12.5, $(this.scope).width());\n tip.addClass('tip-override');\n objPos(nub, -nubHeight, 'auto', 'auto', o_left);\n } else {\n \n if (Foundation.rtl) {\n nub.addClass('rtl');\n o_left = o_left + target.outerWidth() - tip.outerWidth();\n }\n\n objPos(tip, (o_top + outerHeight + 10), 'auto', 'auto', o_left);\n // reset nub from small styles, if they've been applied\n if (nub.attr('style')) {\n nub.removeAttr('style');\n }\n \n tip.removeClass('tip-override');\n \n var tip_outerHeight = tip.outerHeight();\n \n if (classes && classes.indexOf('tip-top') > -1) {\n if (Foundation.rtl) {\n nub.addClass('rtl');\n }\n objPos(tip, (o_top - tip_outerHeight), 'auto', 'auto', o_left)\n .removeClass('tip-override');\n } else if (classes && classes.indexOf('tip-left') > -1) {\n objPos(tip, (o_top + (outerHeight / 2) - (tip_outerHeight / 2)), 'auto', 'auto', (o_left - tip.outerWidth() - nubHeight))\n .removeClass('tip-override');\n nub.removeClass('rtl');\n } else if (classes && classes.indexOf('tip-right') > -1) {\n objPos(tip, (o_top + (outerHeight / 2) - (tip_outerHeight / 2)), 'auto', 'auto', (o_left + target.outerWidth() + nubHeight))\n .removeClass('tip-override');\n nub.removeClass('rtl');\n }\n }\n\n tip.css('visibility', 'visible').hide();\n },\n\n small : function () {\n return matchMedia(Foundation.media_queries.small).matches &&\n !matchMedia(Foundation.media_queries.medium).matches;\n },\n\n inheritable_classes : function ($target) {\n var settings = $.extend({}, this.settings, this.data_options($target)),\n inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'radius', 'round'].concat(settings.additional_inheritable_classes),\n classes = $target.attr('class'),\n filtered = classes ? $.map(classes.split(' '), function (el, i) {\n if ($.inArray(el, inheritables) !== -1) {\n return el;\n }\n }).join(' ') : '';\n\n return $.trim(filtered);\n },\n\n convert_to_touch : function ($target) {\n var self = this,\n $tip = self.getTip($target),\n settings = $.extend({}, self.settings, self.data_options($target));\n\n if ($tip.find('.tap-to-close').length === 0) {\n $tip.append('' + settings.touch_close_text + '');\n $tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function (e) {\n self.hide($target);\n });\n }\n\n $target.data('tooltip-open-event-type', 'touch');\n },\n\n show : function ($target) {\n var $tip = this.getTip($target);\n if ($target.data('tooltip-open-event-type') == 'touch') {\n this.convert_to_touch($target);\n }\n\n this.reposition($target, $tip, $target.attr('class'));\n $target.addClass('open');\n $tip.fadeIn(this.settings.fade_in_duration);\n },\n\n hide : function ($target) {\n var $tip = this.getTip($target);\n\n $tip.fadeOut(this.settings.fade_out_duration, function () {\n $tip.find('.tap-to-close').remove();\n $tip.off('click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');\n $target.removeClass('open');\n });\n },\n\n off : function () {\n var self = this;\n this.S(this.scope).off('.fndtn.tooltip');\n this.S(this.settings.tooltip_class).each(function (i) {\n $('[' + self.attr_name() + ']').eq(i).attr('title', $(this).text());\n }).remove();\n },\n\n reflow : function () {}\n };\n}(jQuery, window, window.document));\n\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.topbar = {\n name : 'topbar',\n\n version : '5.5.3',\n\n settings : {\n index : 0,\n start_offset : 0,\n sticky_class : 'sticky',\n custom_back_text : true,\n back_text : 'Back',\n mobile_show_parent_link : true,\n is_hover : true,\n scrolltop : true, // jump to top when sticky nav menu toggle is clicked\n sticky_on : 'all',\n dropdown_autoclose: true\n },\n\n init : function (section, method, options) {\n Foundation.inherit(this, 'add_custom_rule register_media throttle');\n var self = this;\n\n self.register_media('topbar', 'foundation-mq-topbar');\n\n this.bindings(method, options);\n\n self.S('[' + this.attr_name() + ']', this.scope).each(function () {\n var topbar = $(this),\n settings = topbar.data(self.attr_name(true) + '-init'),\n section = self.S('section, .top-bar-section', this);\n topbar.data('index', 0);\n var topbarContainer = topbar.parent();\n if (topbarContainer.hasClass('fixed') || self.is_sticky(topbar, topbarContainer, settings) ) {\n self.settings.sticky_class = settings.sticky_class;\n self.settings.sticky_topbar = topbar;\n topbar.data('height', topbarContainer.outerHeight());\n topbar.data('stickyoffset', topbarContainer.offset().top);\n } else {\n topbar.data('height', topbar.outerHeight());\n }\n\n if (!settings.assembled) {\n self.assemble(topbar);\n }\n\n if (settings.is_hover) {\n self.S('.has-dropdown', topbar).addClass('not-click');\n } else {\n self.S('.has-dropdown', topbar).removeClass('not-click');\n }\n\n // Pad body when sticky (scrolled) or fixed.\n self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');\n\n if (topbarContainer.hasClass('fixed')) {\n self.S('body').addClass('f-topbar-fixed');\n }\n });\n\n },\n\n is_sticky : function (topbar, topbarContainer, settings) {\n var sticky = topbarContainer.hasClass(settings.sticky_class);\n var smallMatch = matchMedia(Foundation.media_queries.small).matches;\n var medMatch = matchMedia(Foundation.media_queries.medium).matches;\n var lrgMatch = matchMedia(Foundation.media_queries.large).matches;\n\n if (sticky && settings.sticky_on === 'all') {\n return true;\n }\n if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {\n if (smallMatch && !medMatch && !lrgMatch) { return true; }\n }\n if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {\n if (smallMatch && medMatch && !lrgMatch) { return true; }\n }\n if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {\n if (smallMatch && medMatch && lrgMatch) { return true; }\n }\n\n return false;\n },\n\n toggle : function (toggleEl) {\n var self = this,\n topbar;\n\n if (toggleEl) {\n topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');\n } else {\n topbar = self.S('[' + this.attr_name() + ']');\n }\n\n var settings = topbar.data(this.attr_name(true) + '-init');\n\n var section = self.S('section, .top-bar-section', topbar);\n\n if (self.breakpoint()) {\n if (!self.rtl) {\n section.css({left : '0%'});\n $('>.name', section).css({left : '100%'});\n } else {\n section.css({right : '0%'});\n $('>.name', section).css({right : '100%'});\n }\n\n self.S('li.moved', section).removeClass('moved');\n topbar.data('index', 0);\n\n topbar\n .toggleClass('expanded')\n .css('height', '');\n }\n\n if (settings.scrolltop) {\n if (!topbar.hasClass('expanded')) {\n if (topbar.hasClass('fixed')) {\n topbar.parent().addClass('fixed');\n topbar.removeClass('fixed');\n self.S('body').addClass('f-topbar-fixed');\n }\n } else if (topbar.parent().hasClass('fixed')) {\n if (settings.scrolltop) {\n topbar.parent().removeClass('fixed');\n topbar.addClass('fixed');\n self.S('body').removeClass('f-topbar-fixed');\n\n window.scrollTo(0, 0);\n } else {\n topbar.parent().removeClass('expanded');\n }\n }\n } else {\n if (self.is_sticky(topbar, topbar.parent(), settings)) {\n topbar.parent().addClass('fixed');\n }\n\n if (topbar.parent().hasClass('fixed')) {\n if (!topbar.hasClass('expanded')) {\n topbar.removeClass('fixed');\n topbar.parent().removeClass('expanded');\n self.update_sticky_positioning();\n } else {\n topbar.addClass('fixed');\n topbar.parent().addClass('expanded');\n self.S('body').addClass('f-topbar-fixed');\n }\n }\n }\n },\n\n timer : null,\n\n events : function (bar) {\n var self = this,\n S = this.S;\n\n S(this.scope)\n .off('.topbar')\n .on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) {\n e.preventDefault();\n self.toggle(this);\n })\n .on('click.fndtn.topbar contextmenu.fndtn.topbar', '.top-bar .top-bar-section li a[href^=\"#\"],[' + this.attr_name() + '] .top-bar-section li a[href^=\"#\"]', function (e) {\n var li = $(this).closest('li'),\n topbar = li.closest('[' + self.attr_name() + ']'),\n settings = topbar.data(self.attr_name(true) + '-init');\n\n if (settings.dropdown_autoclose && settings.is_hover) {\n var hoverLi = $(this).closest('.hover');\n hoverLi.removeClass('hover');\n }\n if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {\n self.toggle();\n }\n\n })\n .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {\n var li = S(this),\n target = S(e.target),\n topbar = li.closest('[' + self.attr_name() + ']'),\n settings = topbar.data(self.attr_name(true) + '-init');\n\n if (target.data('revealId')) {\n self.toggle();\n return;\n }\n\n if (self.breakpoint()) {\n return;\n }\n\n if (settings.is_hover && !Modernizr.touch) {\n return;\n }\n\n e.stopImmediatePropagation();\n\n if (li.hasClass('hover')) {\n li\n .removeClass('hover')\n .find('li')\n .removeClass('hover');\n\n li.parents('li.hover')\n .removeClass('hover');\n } else {\n li.addClass('hover');\n\n $(li).siblings().removeClass('hover');\n\n if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {\n e.preventDefault();\n }\n }\n })\n .on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) {\n if (self.breakpoint()) {\n\n e.preventDefault();\n\n var $this = S(this),\n topbar = $this.closest('[' + self.attr_name() + ']'),\n section = topbar.find('section, .top-bar-section'),\n dropdownHeight = $this.next('.dropdown').outerHeight(),\n $selectedLi = $this.closest('li');\n\n topbar.data('index', topbar.data('index') + 1);\n $selectedLi.addClass('moved');\n\n if (!self.rtl) {\n section.css({left : -(100 * topbar.data('index')) + '%'});\n section.find('>.name').css({left : 100 * topbar.data('index') + '%'});\n } else {\n section.css({right : -(100 * topbar.data('index')) + '%'});\n section.find('>.name').css({right : 100 * topbar.data('index') + '%'});\n }\n\n topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));\n }\n });\n\n S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {\n self.resize.call(self);\n }, 50)).trigger('resize.fndtn.topbar').load(function () {\n // Ensure that the offset is calculated after all of the pages resources have loaded\n S(this).trigger('resize.fndtn.topbar');\n });\n\n S('body').off('.topbar').on('click.fndtn.topbar', function (e) {\n var parent = S(e.target).closest('li').closest('li.hover');\n\n if (parent.length > 0) {\n return;\n }\n\n S('[' + self.attr_name() + '] li.hover').removeClass('hover');\n });\n\n // Go up a level on Click\n S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) {\n e.preventDefault();\n\n var $this = S(this),\n topbar = $this.closest('[' + self.attr_name() + ']'),\n section = topbar.find('section, .top-bar-section'),\n settings = topbar.data(self.attr_name(true) + '-init'),\n $movedLi = $this.closest('li.moved'),\n $previousLevelUl = $movedLi.parent();\n\n topbar.data('index', topbar.data('index') - 1);\n\n if (!self.rtl) {\n section.css({left : -(100 * topbar.data('index')) + '%'});\n section.find('>.name').css({left : 100 * topbar.data('index') + '%'});\n } else {\n section.css({right : -(100 * topbar.data('index')) + '%'});\n section.find('>.name').css({right : 100 * topbar.data('index') + '%'});\n }\n\n if (topbar.data('index') === 0) {\n topbar.css('height', '');\n } else {\n topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height'));\n }\n\n setTimeout(function () {\n $movedLi.removeClass('moved');\n }, 300);\n });\n\n // Show dropdown menus when their items are focused\n S(this.scope).find('.dropdown a')\n .focus(function () {\n $(this).parents('.has-dropdown').addClass('hover');\n })\n .blur(function () {\n $(this).parents('.has-dropdown').removeClass('hover');\n });\n },\n\n resize : function () {\n var self = this;\n self.S('[' + this.attr_name() + ']').each(function () {\n var topbar = self.S(this),\n settings = topbar.data(self.attr_name(true) + '-init');\n\n var stickyContainer = topbar.parent('.' + self.settings.sticky_class);\n var stickyOffset;\n\n if (!self.breakpoint()) {\n var doToggle = topbar.hasClass('expanded');\n topbar\n .css('height', '')\n .removeClass('expanded')\n .find('li')\n .removeClass('hover');\n\n if (doToggle) {\n self.toggle(topbar);\n }\n }\n\n if (self.is_sticky(topbar, stickyContainer, settings)) {\n if (stickyContainer.hasClass('fixed')) {\n // Remove the fixed to allow for correct calculation of the offset.\n stickyContainer.removeClass('fixed');\n\n stickyOffset = stickyContainer.offset().top;\n if (self.S(document.body).hasClass('f-topbar-fixed')) {\n stickyOffset -= topbar.data('height');\n }\n\n topbar.data('stickyoffset', stickyOffset);\n stickyContainer.addClass('fixed');\n } else {\n stickyOffset = stickyContainer.offset().top;\n topbar.data('stickyoffset', stickyOffset);\n }\n }\n\n });\n },\n\n breakpoint : function () {\n return !matchMedia(Foundation.media_queries['topbar']).matches;\n },\n\n small : function () {\n return matchMedia(Foundation.media_queries['small']).matches;\n },\n\n medium : function () {\n return matchMedia(Foundation.media_queries['medium']).matches;\n },\n\n large : function () {\n return matchMedia(Foundation.media_queries['large']).matches;\n },\n\n assemble : function (topbar) {\n var self = this,\n settings = topbar.data(this.attr_name(true) + '-init'),\n section = self.S('section, .top-bar-section', topbar);\n\n // Pull element out of the DOM for manipulation\n section.detach();\n\n self.S('.has-dropdown>a', section).each(function () {\n var $link = self.S(this),\n $dropdown = $link.siblings('.dropdown'),\n url = $link.attr('href'),\n $titleLi;\n\n if (!$dropdown.find('.title.back').length) {\n\n if (settings.mobile_show_parent_link == true && url) {\n $titleLi = $('
- ' + $link.html() +'
');\n } else {\n $titleLi = $('
');\n }\n\n // Copy link to subnav\n if (settings.custom_back_text == true) {\n $('h5>a', $titleLi).html(settings.back_text);\n } else {\n $('h5>a', $titleLi).html('« ' + $link.html());\n }\n $dropdown.prepend($titleLi);\n }\n });\n\n // Put element back in the DOM\n section.appendTo(topbar);\n\n // check for sticky\n this.sticky();\n\n this.assembled(topbar);\n },\n\n assembled : function (topbar) {\n topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled : true}));\n },\n\n height : function (ul) {\n var total = 0,\n self = this;\n\n $('> li', ul).each(function () {\n total += self.S(this).outerHeight(true);\n });\n\n return total;\n },\n\n sticky : function () {\n var self = this;\n\n this.S(window).on('scroll', function () {\n self.update_sticky_positioning();\n });\n },\n\n update_sticky_positioning : function () {\n var klass = '.' + this.settings.sticky_class,\n $window = this.S(window),\n self = this;\n\n if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {\n var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;\n if (!self.S(klass).hasClass('expanded')) {\n if ($window.scrollTop() > (distance)) {\n if (!self.S(klass).hasClass('fixed')) {\n self.S(klass).addClass('fixed');\n self.S('body').addClass('f-topbar-fixed');\n }\n } else if ($window.scrollTop() <= distance) {\n if (self.S(klass).hasClass('fixed')) {\n self.S(klass).removeClass('fixed');\n self.S('body').removeClass('f-topbar-fixed');\n }\n }\n }\n }\n },\n\n off : function () {\n this.S(this.scope).off('.fndtn.topbar');\n this.S(window).off('.fndtn.topbar');\n },\n\n reflow : function () {}\n };\n}(jQuery, window, window.document));\n","/**\n * webfonts.js\n *\n * Load Webfonts to use on the site. Uses the Web Font Loader asynchronously.\n *\n * You can set your default Font Stack in scss/_settings.scss.\n * Documentation: https://github.com/typekit/webfontloader and https://developers.google.com/speed/libraries/devguide#webfont\n */\n\nWebFontConfig = {\n\ttypekit: { id: 'zws8lrx' }\n};\n\n(function() {\n\tvar wf = document.createElement('script');\n\twf.src = ('https:' === document.location.protocol ? 'https' : 'http') +\n\t\t\t'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';\n\twf.type = 'text/javascript';\n\twf.async = 'true';\n\tvar s = document.getElementsByTagName('script')[0];\n\ts.parentNode.insertBefore(wf, s);\n})();\n","/**\n * skip-link-focus-fix.js\n *\n * Skip Link Focus Fix\n * This fixes the focus problem in Opera and Webkit browsers when using skiplinks.\n */\n\n( function() {\n\tvar is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,\n\t\tis_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,\n\t\tis_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;\n\n\tif ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {\n\t\twindow.addEventListener( 'hashchange', function() {\n\t\t\tvar element = document.getElementById( location.hash.substring( 1 ) );\n\n\t\t\tif ( element ) {\n\t\t\t\tif ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )\n\t\t\t\t\telement.tabIndex = -1;\n\n\t\t\t\telement.focus();\n\t\t\t}\n\t\t}, false );\n\t}\n})();\n","/**\n * custom.js\n *\n * Custom JavaScript (jQuery) code for the Application.\n */\n\n/**\n * Executes the JavaScript code when the DOM is ready to be used.\n * By passing the $ you can code using the $ alias for jQuery.\n * Inside of this function, $() will work as an alias for jQuery()\n * and other libraries also using $ will not be accessible under this shortcut\n */\n( function($) {\n\n\t// Initialize the Foundation JavaScript\n\t// Documentation can be found at: http://foundation.zurb.com/docs\n\t$(document).foundation();\n\t\t $(window).on( 'load resize', function() {\n\t\t\tvar height = $(window).height();\n\t\t\t$('.fp-image').css({\n\t\t\t\t'height' : height\n\t\t});\n } );\n\t $('.archive-year span').click(function(event){\n\t \t$(this).parent().toggleClass('triggered');\n\t\t event.preventDefault();\n\t\t \n\t\t $(this).parent().find('.archive-month').slideToggle('400', function(){\n\t\t\t}); \n\t }); \n\t\t \n\n\t (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1374312066168538\";\n fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));\n\n\t (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1374312066168538\";\n fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));\n\n\t\n $(function() {\n var isIPad = (navigator.userAgent.match(/iPad/i) != null) ? true : false;\n if (isIPad) {\n $('body').on('click.fndtn.dropdown, touchstart.fndtn.dropdown', '.dropdown a', function (e) {\n e.stopPropagation();\n e.preventDefault();\n window.location.href = this;\n return false;\n });\n }\n });\n \n} )(jQuery);\n \n\n\n"]}