/*! Cedarville University Javascript - v1.0 - 2024-06-04 */
function getUrlParameter(results){results=results.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");results=new RegExp("[\\?&]"+results+"=([^&#]*)").exec(location.search);return null===results?"":decodeURIComponent(results[1].replace(/\+/g," "))}!function(){const lazyBackgrounds=document.querySelectorAll("[animate-element], .animate-element, .animate-element-fade, .animate-element-slide, .gallery-container");const lazyBackgroundObserver=new IntersectionObserver(function(entries,observer){entries.forEach(function(entry){if(entry.isIntersecting){const element=entry.target;element.classList.add("in-viewport"),lazyBackgroundObserver.unobserve(element)}})},{threshold:.15});document.addEventListener("DOMContentLoaded",function(){lazyBackgrounds.forEach(function(lazyBackground){lazyBackgroundObserver.observe(lazyBackground)})})}(),function(factory){var registeredInModuleLoader,OldCookies,api;"function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),registeredInModuleLoader||(OldCookies=window.Cookies,(api=window.Cookies=factory()).noConflict=function(){return window.Cookies=OldCookies,api})}(function(){function extend(){for(var i=0,result={};i<arguments.length;i++){var key,attributes=arguments[i];for(key in attributes)result[key]=attributes[key]}return result}function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function init(converter){function api(){}function set(key,value,attributes){if("undefined"!=typeof document){"number"==typeof(attributes=extend({path:"/"},api.defaults,attributes)).expires&&(attributes.expires=new Date(+new Date+864e5*attributes.expires)),attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{var result=JSON.stringify(value);/^[\{\[]/.test(result)&&(value=result)}catch(e){}value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var attributeName,stringifiedAttributes="";for(attributeName in attributes)attributes[attributeName]&&(stringifiedAttributes+="; "+attributeName,!0!==attributes[attributeName]&&(stringifiedAttributes+="="+attributes[attributeName].split(";")[0]));return document.cookie=key+"="+value+stringifiedAttributes}}function get(key,json){if("undefined"!=typeof document){for(var jar={},cookies=document.cookie?document.cookie.split("; "):[],i=0;i<cookies.length;i++){var parts=cookies[i].split("="),cookie=parts.slice(1).join("=");json||'"'!==cookie.charAt(0)||(cookie=cookie.slice(1,-1));try{var name=decode(parts[0]),cookie=(converter.read||converter)(cookie,name)||decode(cookie);if(json)try{cookie=JSON.parse(cookie)}catch(e){}if(jar[name]=cookie,key===name)break}catch(e){}}return key?jar[key]:jar}}return api.set=set,api.get=function(key){return get(key,!1)},api.getJSON=function(key){return get(key,!0)},api.remove=function(key,attributes){set(key,"",extend(attributes,{expires:-1}))},api.defaults={},api.withConverter=init,api}(function(){})}),function(window){"use strict";var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var key,source=arguments[i];for(key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var CACHE,DATA_HASH_ID="data-hashaccordion-id",pluginConfig=(CACHE={},{set:function(id,config){CACHE[id]=config},get:function(id){return CACHE[id]},remove:function(id){return CACHE[id]}}),findById=function(id,hash){return document.querySelector("#"+id+"["+DATA_HASH_ID+'="'+hash+'"]')},addClass=function(el,className){el.classList?el.classList.add(className):el.className+=" "+className},hasClass=function(el,className){return el.classList?el.classList.contains(className):new RegExp("(^| )"+className+"( |$)","gi").test(el.className)},setAttributes=function(node,attrs){Object.keys(attrs).forEach(function(attribute){node.setAttribute(attribute,attrs[attribute])})},searchParent=function(el,parentClass,hashId){for(var found=!1,parentElement=el;parentElement&&!1===found;)!0===hasClass(parentElement,parentClass)&&parentElement.getAttribute(DATA_HASH_ID)===hashId?found=!0:parentElement=parentElement.parentNode;return!0===found?parentElement.getAttribute("id"):""},unSelectHeaders=function(elts,attrSelected){elts.forEach(function(header_node){setAttributes(header_node,_defineProperty({},attrSelected,"false"))})},selectHeader=function(el,attrSelected){el.setAttribute(attrSelected,!0)},selectHeaderInList=function(elts,param,attrSelected){var indice_trouve=void 0;elts.forEach(function(header_node,index){"true"===header_node.getAttribute(attrSelected)&&(indice_trouve=index)}),"next"===param&&(selectHeader(elts[indice_trouve+1]),setTimeout(function(){elts[indice_trouve+1].focus()},0)),"prev"===param&&(selectHeader(elts[indice_trouve-1]),setTimeout(function(){elts[indice_trouve-1].focus()},0))},plugin=function(){var CONFIG=_extends({ACCORDION_JS:"js-accordion",ACCORDION_JS_HEADER:"js-accordion__header",ACCORDION_JS_PANEL:"js-accordion__panel",ACCORDION_DATA_PREFIX_CLASS:"data-accordion-prefix-classes",ACCORDION_DATA_OPENED:"data-accordion-opened",ACCORDION_DATA_MULTISELECTABLE:"data-accordion-multiselectable",ACCORDION_DATA_COOL_SELECTORS:"data-accordion-cool-selectors",ACCORDION_PREFIX_IDS:"accordion",ACCORDION_BUTTON_ID:"_tab",ACCORDION_PANEL_ID:"_panel",ACCORDION_STYLE:"accordion",ACCORDION_TITLE_STYLE:"accordion__title",ACCORDION_HEADER_STYLE:"accordion__header",ACCORDION_PANEL_STYLE:"accordion__panel",ACCORDION_ROLE_TABLIST:"tablist",ACCORDION_ROLE_TAB:"tab",ACCORDION_ROLE_TABPANEL:"tabpanel",ATTR_ROLE:"role",ATTR_MULTISELECTABLE:"aria-multiselectable",ATTR_EXPANDED:"aria-expanded",ATTR_LABELLEDBY:"aria-labelledby",ATTR_HIDDEN:"aria-hidden",ATTR_CONTROLS:"aria-controls",ATTR_SELECTED:"aria-selected"},arguments.length<=0||void 0===arguments[0]?{}:arguments[0]),HASH_ID=Math.random().toString(32).slice(2,12);pluginConfig.set(HASH_ID,CONFIG);return{attach:function(node){!function(){var node=arguments.length<=0||void 0===arguments[0]?document:arguments[0];return[].slice.call(node.querySelectorAll("."+CONFIG.ACCORDION_JS))}(node).forEach(function(accordion_node){var iLisible="z"+Math.random().toString(32).slice(2,12),prefixClassName=!0===accordion_node.hasAttribute(CONFIG.ACCORDION_DATA_PREFIX_CLASS)?accordion_node.getAttribute(CONFIG.ACCORDION_DATA_PREFIX_CLASS)+"-":"",coolSelectors=!0===accordion_node.hasAttribute(CONFIG.ACCORDION_DATA_COOL_SELECTORS);"none"===accordion_node.getAttribute(CONFIG.ACCORDION_DATA_MULTISELECTABLE)?accordion_node.setAttribute(CONFIG.ATTR_MULTISELECTABLE,"false"):accordion_node.setAttribute(CONFIG.ATTR_MULTISELECTABLE,"true"),accordion_node.setAttribute(CONFIG.ATTR_ROLE,CONFIG.ACCORDION_ROLE_TABLIST),accordion_node.setAttribute("id",iLisible),accordion_node.setAttribute(DATA_HASH_ID,HASH_ID),addClass(accordion_node,prefixClassName+CONFIG.ACCORDION_STYLE),[].slice.call(accordion_node.querySelectorAll("."+CONFIG.ACCORDION_JS_HEADER)).forEach(function(header_node,_setAttributes3){var indexHeaderLisible,accordionPanel,accordionButton,accordionOpenedAttribute,el;header_node.parentNode!==accordion_node&&!1==coolSelectors||(indexHeaderLisible=_setAttributes3+1,accordionPanel=header_node.nextElementSibling,el=header_node.innerHTML,accordionButton=document.createElement("BUTTON"),accordionOpenedAttribute=!0===header_node.hasAttribute(CONFIG.ACCORDION_DATA_OPENED)?header_node.getAttribute(CONFIG.ACCORDION_DATA_OPENED):"",accordionButton.innerHTML=el,addClass(accordionButton,CONFIG.ACCORDION_JS_HEADER),addClass(accordionButton,prefixClassName+CONFIG.ACCORDION_HEADER_STYLE),setAttributes(accordionButton,(_defineProperty(_setAttributes3={},CONFIG.ATTR_ROLE,CONFIG.ACCORDION_ROLE_TAB),_defineProperty(_setAttributes3,"id",CONFIG.ACCORDION_PREFIX_IDS+iLisible+CONFIG.ACCORDION_BUTTON_ID+indexHeaderLisible),_defineProperty(_setAttributes3,CONFIG.ATTR_CONTROLS,CONFIG.ACCORDION_PREFIX_IDS+iLisible+CONFIG.ACCORDION_PANEL_ID+indexHeaderLisible),_defineProperty(_setAttributes3,CONFIG.ATTR_SELECTED,"false"),_defineProperty(_setAttributes3,"type","button"),_defineProperty(_setAttributes3,DATA_HASH_ID,HASH_ID),_setAttributes3)),header_node.innerHTML="",header_node.appendChild(accordionButton),addClass(header_node,prefixClassName+CONFIG.ACCORDION_TITLE_STYLE),el=header_node,_setAttributes3=CONFIG.ACCORDION_JS_HEADER,el.classList?el.classList.remove(_setAttributes3):el.className=el.className.replace(new RegExp("(^|\\b)"+_setAttributes3.split(" ").join("|")+"(\\b|$)","gi")," "),addClass(accordionPanel,prefixClassName+CONFIG.ACCORDION_PANEL_STYLE),setAttributes(accordionPanel,(_defineProperty(_setAttributes3={},CONFIG.ATTR_ROLE,CONFIG.ACCORDION_ROLE_TABPANEL),_defineProperty(_setAttributes3,CONFIG.ATTR_LABELLEDBY,CONFIG.ACCORDION_PREFIX_IDS+iLisible+CONFIG.ACCORDION_BUTTON_ID+indexHeaderLisible),_defineProperty(_setAttributes3,"id",CONFIG.ACCORDION_PREFIX_IDS+iLisible+CONFIG.ACCORDION_PANEL_ID+indexHeaderLisible),_defineProperty(_setAttributes3,DATA_HASH_ID,HASH_ID),_setAttributes3)),"true"===accordionOpenedAttribute?(accordionButton.setAttribute(CONFIG.ATTR_EXPANDED,"true"),header_node.removeAttribute(CONFIG.ACCORDION_DATA_OPENED),accordionPanel.setAttribute(CONFIG.ATTR_HIDDEN,"false")):(accordionButton.setAttribute(CONFIG.ATTR_EXPANDED,"false"),accordionPanel.setAttribute(CONFIG.ATTR_HIDDEN,"true"),accordionPanel.style.display="none"))})})},gotoAccordion:function(url){let desiredAcc=null,hrefItems=url.split("#");if(2==hrefItems.length&&(desiredAcc=hrefItems[1].toLowerCase().replaceAll(/[^a-z0-9-]/g,"")),desiredAcc)for(const elem of document.querySelectorAll(`.${CONFIG.ACCORDION_JS} .accordion-item-${CONFIG.ACCORDION_HEADER_STYLE}`))if(elem.textContent&&elem.textContent.trim().toLowerCase().replaceAll(" ","-").replaceAll(/[^a-z0-9-]/g,"")==desiredAcc){"false"==elem.ariaExpanded&&elem.click();var scrollPos=document.getElementsByTagName("header")[0].offsetHeight,scrollPos=elem.getBoundingClientRect().top+window.scrollY-scrollPos;"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.scrollTo({top:scrollPos,behavior:"instant"});break}}}};function slideUp(el,duration){el.style.transitionProperty="height, margin, padding",el.style.transitionDuration=duration+"ms",el.style.boxSizing="border-box",el.style.height=el.offsetHeight+"px",el.offsetHeight,el.style.overflow="hidden",el.style.height=0,el.style.paddingTop=0,el.style.paddingBottom=0,el.style.marginTop=0,el.style.marginBottom=0,window.setTimeout(function(){el.style.display="none",el.style.removeProperty("height"),el.style.removeProperty("padding-top"),el.style.removeProperty("padding-bottom"),el.style.removeProperty("margin-top"),el.style.removeProperty("margin-bottom"),el.style.removeProperty("overflow"),el.style.removeProperty("transition-duration"),el.style.removeProperty("transition-property")},duration)}window.van11yAccordion=(["click","keydown","focus"].forEach(function(eventName){document.body.addEventListener(eventName,function(e){var buttonTag,accordionContainer,coolSelectors,$accordionAllHeaders,CONFIG,hashId=function(el,hashId){for(var found=!1,parentElement=el;1===parentElement.nodeType&&parentElement&&!1===found;)!0===parentElement.hasAttribute(hashId)?found=!0:parentElement=parentElement.parentNode;return!0===found?parentElement.getAttribute(hashId):""}(e.target,DATA_HASH_ID);""!==hashId&&(CONFIG=pluginConfig.get(hashId),!0===hasClass(e.target,CONFIG.ACCORDION_JS_HEADER)&&"focus"===eventName&&(buttonTag=e.target,accordionContainer=findById(searchParent(buttonTag,CONFIG.ACCORDION_JS,hashId),hashId),coolSelectors=!0===accordionContainer.hasAttribute(CONFIG.ACCORDION_DATA_COOL_SELECTORS),$accordionAllHeaders=[].slice.call(accordionContainer.querySelectorAll("."+CONFIG.ACCORDION_JS_HEADER)),!1==coolSelectors&&($accordionAllHeaders=$accordionAllHeaders.filter(function(element){return element.parentNode.parentNode===accordionContainer})),unSelectHeaders($accordionAllHeaders,CONFIG.ATTR_SELECTED),selectHeader(buttonTag,CONFIG.ATTR_SELECTED)),!0===hasClass(e.target,CONFIG.ACCORDION_JS_HEADER)&&"click"===eventName&&function(){var buttonTag=e.target,accordionContainer=findById(searchParent(buttonTag,CONFIG.ACCORDION_JS,hashId),hashId),coolSelectors=!0===accordionContainer.hasAttribute(CONFIG.ACCORDION_DATA_COOL_SELECTORS),$accordionAllHeaders=[].slice.call(accordionContainer.querySelectorAll("."+CONFIG.ACCORDION_JS_HEADER)),accordionMultiSelectable=accordionContainer.getAttribute(CONFIG.ATTR_MULTISELECTABLE),destination=findById(buttonTag.getAttribute(CONFIG.ATTR_CONTROLS),hashId),stateButton=buttonTag.getAttribute(CONFIG.ATTR_EXPANDED);!1==coolSelectors&&($accordionAllHeaders=$accordionAllHeaders.filter(function(element){return element.parentNode.parentNode===accordionContainer})),"false"===stateButton?(buttonTag.setAttribute(CONFIG.ATTR_EXPANDED,!0),destination.removeAttribute(CONFIG.ATTR_HIDDEN),function(el,duration){el.style.removeProperty("display");let display=window.getComputedStyle(el).display;"none"===display&&(display="block"),el.style.display=display;var height=el.offsetHeight;el.style.overflow="hidden",el.style.height=0,el.style.paddingTop=0,el.style.paddingBottom=0,el.style.marginTop=0,el.style.marginBottom=0,el.offsetHeight,el.style.boxSizing="border-box",el.style.transitionProperty="height, margin, padding",el.style.transitionDuration=duration+"ms",el.style.height=height+"px",el.style.removeProperty("padding-top"),el.style.removeProperty("padding-bottom"),el.style.removeProperty("margin-top"),el.style.removeProperty("margin-bottom"),window.setTimeout(function(){el.style.removeProperty("height"),el.style.removeProperty("overflow"),el.style.removeProperty("transition-duration"),el.style.removeProperty("transition-property")},duration)}(destination,300)):(buttonTag.setAttribute(CONFIG.ATTR_EXPANDED,!1),destination.setAttribute(CONFIG.ATTR_HIDDEN,!0),slideUp(destination,300)),"false"===accordionMultiSelectable&&$accordionAllHeaders.forEach(function(header_node){var destinationPanel=findById(header_node.getAttribute(CONFIG.ATTR_CONTROLS),hashId);header_node!==buttonTag?(header_node.setAttribute(CONFIG.ATTR_SELECTED,!1),header_node.setAttribute(CONFIG.ATTR_EXPANDED,!1),destinationPanel.setAttribute(CONFIG.ATTR_HIDDEN,!0),slideUp(destinationPanel,300)):header_node.setAttribute(CONFIG.ATTR_SELECTED,!0)}),setTimeout(function(){buttonTag.focus()},0),e.preventDefault()}(),!0===hasClass(e.target,CONFIG.ACCORDION_JS_HEADER)&&"keydown"===eventName&&function(){var coolSelectors=e.target,coolSelectors=searchParent(coolSelectors,CONFIG.ACCORDION_JS,hashId),accordionContainer=findById(coolSelectors,hashId),coolSelectors=!0===accordionContainer.hasAttribute(CONFIG.ACCORDION_DATA_COOL_SELECTORS),$accordionAllHeaders=[].slice.call(accordionContainer.querySelectorAll("."+CONFIG.ACCORDION_JS_HEADER));!1==coolSelectors&&($accordionAllHeaders=$accordionAllHeaders.filter(function(element){return element.parentNode.parentNode===accordionContainer})),36===e.keyCode?(unSelectHeaders($accordionAllHeaders,CONFIG.ATTR_SELECTED),selectHeader($accordionAllHeaders[0],CONFIG.ATTR_SELECTED),setTimeout(function(){$accordionAllHeaders[0].focus()},0),e.preventDefault()):35===e.keyCode?(unSelectHeaders($accordionAllHeaders,CONFIG.ATTR_SELECTED),selectHeader($accordionAllHeaders[$accordionAllHeaders.length-1],CONFIG.ATTR_SELECTED),setTimeout(function(){$accordionAllHeaders[$accordionAllHeaders.length-1].focus()},0),e.preventDefault()):37!==e.keyCode&&38!==e.keyCode||e.ctrlKey?40!==e.keyCode&&39!==e.keyCode||e.ctrlKey||("true"===$accordionAllHeaders[$accordionAllHeaders.length-1].getAttribute(CONFIG.ATTR_SELECTED)?(unSelectHeaders($accordionAllHeaders,CONFIG.ATTR_SELECTED),selectHeader($accordionAllHeaders[0],CONFIG.ATTR_SELECTED),setTimeout(function(){$accordionAllHeaders[0].focus()},0)):selectHeaderInList($accordionAllHeaders,"next",CONFIG.ATTR_SELECTED),e.preventDefault()):("true"===$accordionAllHeaders[0].getAttribute(CONFIG.ATTR_SELECTED)?(unSelectHeaders($accordionAllHeaders,CONFIG.ATTR_SELECTED),selectHeader($accordionAllHeaders[$accordionAllHeaders.length-1],CONFIG.ATTR_SELECTED),setTimeout(function(){$accordionAllHeaders[$accordionAllHeaders.length-1].focus()},0)):selectHeaderInList($accordionAllHeaders,"prev",CONFIG.ATTR_SELECTED),e.preventDefault())}())},!0)}),plugin)}(window);var accordionOnLoad=function accordionOnLoad(){var accordions=window.van11yAccordion();accordions.attach(),accordions.gotoAccordion(window.location.href);const buttons=document.getElementsByClassName("goto-accordion");for(let i=0;i<buttons.length;i++)buttons[i].addEventListener("click",function(ev){gotoAccordion(this.href)});document.removeEventListener("DOMContentLoaded",accordionOnLoad)};document.addEventListener("DOMContentLoaded",accordionOnLoad),function(){const galleryContainer=document.querySelector(".gallery-container");if(galleryContainer){const cardsWithContent=galleryContainer.querySelectorAll(".gallery-card--active");!function(){let activeIndex=0;setInterval(function(){cardsWithContent.forEach((card,index)=>{index===activeIndex?card.classList.add("rotated"):card.classList.remove("rotated")}),activeIndex===cardsWithContent.length-1?activeIndex=0:activeIndex++},5e3)}()}}(),function(window){"use strict";function CardFilterList(filters,parentId){var self=this;self.filters=filters;for(var i=0;i<filters.length;i++)self.filters[i]._input=document.getElementById(filters[i].input),self.filters[i]._attribute="data-"+filters[i].attribute,self.filters[i]._input.addEventListener("input",function(){self.executeFilter()});this.container=document.querySelector("#"+parentId),this.dataItems=this.container.querySelectorAll("div.card--frameless")}CardFilterList.prototype.executeFilter=function(){for(var i=0;i<this.dataItems.length;i++){for(var hasMatch=!1,anyFilterSet=!1,x=0;x<this.filters.length;x++){var filter=this.filters[x]._input.value.toUpperCase();if(0!=filter.length){var anyFilterSet=!0,data=this.dataItems[i].getAttribute(this.filters[x]._attribute),cardText=this.dataItems[i].querySelector(".card__text").textContent;if(-1<data.toUpperCase().indexOf(filter)||-1<cardText.toUpperCase().indexOf(filter)){hasMatch=!0;break}}}this.dataItems[i].parentElement.style.display=hasMatch||!anyFilterSet?"":"none"}},window.CardFilterList=CardFilterList}(window),function(){const cards=document.querySelectorAll(".flip-card");let activeCard=null;cards.forEach(card=>{const toggle=card.querySelector(".flip-card__toggle");toggle.addEventListener("click",function(target){target.preventDefault();target=target.currentTarget;const parentCard=target.parentElement,backPanel=target.nextElementSibling;activeCard&&activeCard.classList.remove("active"),parentCard.classList.toggle("active"),parentCard.classList.contains("active")?(activeCard=parentCard,backPanel.focus()):activeCard=null})}),document.addEventListener("click",function(target){target=target.target;activeCard&&!activeCard.contains(target)&&(activeCard.classList.remove("active"),activeCard=null)})}(),function(window){"use strict";window.CollapseElements=function(els){if(els&&0!=els.length)for(var i=0;i<els.length;i++)els[i].addEventListener("click",function(e){this.setAttribute("aria-pressed","false"==this.getAttribute("aria-pressed")?"true":"false");var targetEl=document.getElementById(this.hash.replace("#",""));targetEl?(targetEl.classList.contains("show")?targetEl.classList.remove("show"):targetEl.classList.add("show"),e.preventDefault()):console.log("Could not find "+this.hash)})}}(window);var collapseElements=document.querySelectorAll('a[data-cu-toggle="collapse"]');new CollapseElements(collapseElements),function(window){"use strict";window.ExpandableLists=function(lists){for(var i=0;i<lists.length;i++){var element=lists[i].getElementsByClassName("expandable-list__title")[0];null!=element&&element.addEventListener("click",function(){this.setAttribute("aria-pressed","false"==this.getAttribute("aria-pressed")?"true":"false")})}}}(window);var expandableLists=document.getElementsByClassName("expandable-list");new ExpandableLists(expandableLists);var modal=function(){};!function(){const railNavToggle=document.getElementById("rail-nav-toggle"),railNavMenu=document.getElementById("rail-nav-menu"),railSubToggles=document.querySelectorAll(".rail-nav__expander-toggle");railNavMenu&&railNavToggle&&railNavToggle.addEventListener("click",function(e){const target=e.target;target.classList.toggle("active"),railNavMenu.classList.toggle("active"),target.classList.contains("active")?target.setAttribute("aria-expanded",!0):target.setAttribute("aria-expanded",!1)}),railSubToggles.forEach(toggle=>{const railSubNav=toggle.closest(".rail-nav__expander").nextElementSibling;toggle.addEventListener("click",function(e){const target=e.target;target.classList.toggle("active"),railSubNav.classList.toggle("active"),target.classList.contains("active")?target.setAttribute("aria-expanded",!0):target.setAttribute("aria-expanded",!1)})})}(),function(window){"use strict";function TabsControl(tabs){var self=this,tabToOpen=-1;self.tabs=tabs,self.targets=[];for(var i=0;i<tabs.length;i++){var target=document.getElementById(self.tabs[i].getAttribute("href").substring(1));null!=target&&(self.targets.push(target),self.tabs[i].hash==window.location.hash&&(tabToOpen=i),self.tabs[i].addEventListener("click",function(e){return self.openTab(this),e.preventDefault(),!1}))}-1<tabToOpen&&self.openTab(self.tabs[tabToOpen])}TabsControl.prototype.openTab=function(tabElement){for(var targetEl,i=0;i<this.tabs.length;i++)this.tabs[i].parentElement.classList.remove("active"),this.targets[i].classList.remove("active"),tabElement==this.tabs[i]&&(targetEl=this.targets[i]);targetEl.classList.add("active"),tabElement.parentElement.classList.add("active")},window.Tabs=TabsControl}(window);var tabs=document.querySelectorAll('a[data-toggle="tab"]');new Tabs(tabs),window.addEventListener("load",function(){var topEl,fn,delay,last,timer,fa=document.getElementById("footer-actions");function onScroll(){window.pageYOffset+window.innerHeight+fa.offsetHeight<topEl-50?fa.classList.add("footer--stuck"):fa.classList.remove("footer--stuck")}fa&&(topEl=fa.offsetTop+fa.offsetHeight,window.addEventListener("scroll",(fn=onScroll,delay=25,timer=last=void 0,function(){var now=+new Date;last&&now<last+delay?(clearTimeout(timer),timer=setTimeout(function(){last=now,fn()},delay)):(last=now,fn())})),onScroll())});const getFooterToggles=document.querySelectorAll(".footer__top-toggle");getFooterToggles.forEach(toggle=>{const footerPanel=document.getElementById(toggle.getAttribute("data-target"));toggle.addEventListener("click",function(){toggle.classList.contains("active")?(toggle.classList.remove("active"),toggle.setAttribute("aria-expanded",!1),footerPanel.classList.remove("show")):(toggle.classList.add("active"),toggle.setAttribute("aria-expanded",!0),footerPanel.classList.add("show"))})});const modalTriggers=document.querySelectorAll(".trigger-modal"),modalContainer=document.querySelector(".modal-container");if(modalTriggers&&modalContainer){const setModalEvents=function(){var focusableContent='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';const firstFocusableElement=modalContainer.querySelectorAll(focusableContent)[0];focusableContent=modalContainer.querySelectorAll(focusableContent);const lastFocusableElement=focusableContent[focusableContent.length-1];modalContainer.addEventListener("keydown",function(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===firstFocusableElement&&(lastFocusableElement.focus(),e.preventDefault()):document.activeElement===lastFocusableElement&&(firstFocusableElement.focus(),e.preventDefault()))}),modalContainer.addEventListener("keyup",function(e){"Esc"!==e.key&&"Escape"!==e.key||closeModal()}),firstFocusableElement.focus()},showModalOnClick=function(e){e.preventDefault(),showModal()},showModal=function(){setModalEvents(),document.body.classList.add("modal-active"),modalContainer.classList.add("active"),modalContainer.focus()},closeModal=function(){modalContainer.classList.remove("active"),document.body.classList.remove("modal-active")},addCloseButton=function(){modalContainer.insertAdjacentHTML("afterbegin",`<button type="button" id="modal-container-close" class="modal-container__close">
      X
      <span class="visually-hidden">Close modal window</span>
    </button>`);const closeButton=document.getElementById("modal-container-close");closeButton.addEventListener("click",closeModal)};modalContainer.setAttribute("tabindex","-1"),modalContainer.setAttribute("role","dialog"),modalTriggers.forEach(trigger=>{trigger.setAttribute("role","button"),trigger.addEventListener("click",showModalOnClick)}),addCloseButton(),window.showModalOnClick=showModalOnClick,window.showModal=showModal}var megamenu=function(){Array.prototype.contains=function(needle){for(i in this)try{if("contains"!==i&&this[i].contains(needle))return!0}catch(exception){console.log(this[i])}return!1};const menuButton=document.getElementById("menuOpen"),menuButtonClose=document.getElementById("menuClose"),getPanel=document.getElementById("menuPanel"),bodyContainer=document.body,getNavToggles=document.querySelectorAll(".header__nav-expand"),getPanelToggles=document.querySelectorAll(".header__panel-btn"),headerSearchButton=document.getElementById("headerSearchBtn"),globalSearchInput=document.getElementById("global-search");headerSearchButton&&menuButton&&headerSearchButton.addEventListener("click",function(){menuButton.click(),document.getElementById("panelToggle01").click(),globalSearchInput.focus()}),menuButton&&menuButton.addEventListener("click",function(){bodyContainer.classList.add("nav-active"),getPanel.classList.add("show")}),menuButton&&menuButtonClose.addEventListener("click",function(){bodyContainer.classList.remove("nav-active"),getPanel.classList.remove("show")});function toggleNavItem(e){var target=e.currentTarget;getNavToggles.forEach(item=>{var targetId=item.getAttribute("data-target");const toggleMenu=document.getElementById(targetId);item===target?(item.classList.toggle("active"),toggleMenu.classList.toggle("show")):(item.classList.remove("active"),toggleMenu.classList.remove("show"))})}return getNavToggles.forEach(toggle=>{toggle.addEventListener("click",toggleNavItem)}),getPanelToggles.forEach(toggle=>{const getToggleMenu=toggle,getTogglePanel=document.getElementById(getToggleMenu.getAttribute("data-target"));getTogglePanel.setAttribute("aria-labelledby",toggle.getAttribute("id"));getToggleMenu.addEventListener("click",function(e){e.preventDefault,(()=>{if(getToggleMenu.classList.contains("active"))getToggleMenu.classList.remove("active"),getToggleMenu.setAttribute("aria-expanded",!1),getTogglePanel.classList.remove("show"),getTogglePanel.setAttribute("aria-hidden",!0);else{const siblingTabs=document.querySelectorAll(".header__panel-btn.active");siblingTabs.forEach(activeToggle=>{const siblingTabPanel=document.getElementById(activeToggle.getAttribute("data-target"));activeToggle.classList.remove("active"),activeToggle.setAttribute("aria-expanded",!1),siblingTabPanel.classList.remove("show"),siblingTabPanel.setAttribute("aria-hidden",!0)}),getToggleMenu.classList.add("active"),getToggleMenu.setAttribute("aria-expanded",!0),getTogglePanel.classList.add("show"),getTogglePanel.setAttribute("aria-hidden",!1)}})()})}),function(options){var menuExpandButton,menu,utilityMenu,infoNavButton,searchMenuButton,globalSearchDropdown,globalSearchInput,linkGroupClassName="primary-nav__link-group",utilityMenuClass="utility-nav",Keyboard={DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACE:32,UP:38};function handleMenuCloseEvent(isNotMenuButton){const mainMenu=document.getElementById("menuPanel"),mainMenuButton=document.getElementById("menuOpen"),headerSearchButton=document.getElementById("headerSearchBtn");var isClickOutside=isNotMenuButton.key,isNotSearchbutton=isNotMenuButton.target,isMenuOpen=document.body.classList.contains("nav-active"),isEscapeKey="Esc"===isClickOutside||"Escape"===isClickOutside,isNotMenuButton=!(mainMenuButton&&mainMenuButton.contains(isNotSearchbutton)),isClickOutside=!(mainMenu&&mainMenu.contains(isNotSearchbutton)),isNotSearchbutton=!(headerSearchButton&&headerSearchButton.contains(isNotSearchbutton));isMenuOpen&&(isEscapeKey&&closeMainMenu(),isClickOutside&&isNotMenuButton&&isNotSearchbutton&&closeMainMenu())}function closeMainMenu(){const mainMenuButton=document.getElementById("menuOpen"),mainMenu=document.getElementById("menuPanel");mainMenu&&mainMenu.classList.remove("show"),document.body.classList.remove("nav-active"),mainMenuButton&&mainMenuButton.focus()}function toggleClass(el,className){el.classList.contains(className)?el.classList.remove(className):el.classList.add(className)}function getControls(elId){if(!elId)return null;elId=elId.getAttribute("aria-controls");return document.getElementById(elId)}function expandInfoNav(){var infoMenu=getControls(infoNavButton);closeOtherMenus(infoMenu),"false"===infoMenu.getAttribute("aria-expanded")?(infoMenu.setAttribute("aria-expanded","true"),infoMenu.setAttribute("aria-hidden","false")):(infoMenu.setAttribute("aria-expanded","false"),infoMenu.setAttribute("aria-hidden","true"))}function expandMainMenu(){toggleClass(menu,"primary-nav--collapsed"),toggleClass(utilityMenu,utilityMenuClass+"--collapsed")}function expandSearchMenu(el){toggleClass(searchMenuButton,"btn--close"),"false"===searchMenuButton.getAttribute("aria-expanded")?(searchMenuButton.setAttribute("aria-expanded","true"),globalSearchDropdown.setAttribute("aria-hidden","false"),globalSearchInput.focus()):(searchMenuButton.setAttribute("aria-expanded","false"),globalSearchDropdown.setAttribute("aria-hidden","true"),searchMenuButton.focus(),globalSearchInput.value="")}function tapMenu(mouseEvent){var ariaExpanded=mouseEvent.target.getAttribute("aria-controls"),linkGroup=document.getElementById(ariaExpanded),ariaExpanded=mouseEvent.target.getAttribute("aria-expanded");"true"===ariaExpanded?collapseMenu(mouseEvent.target,linkGroup):"false"===ariaExpanded&&expandMenu(mouseEvent.target,linkGroup)}function expandMenu(menuItem,linkGroup){closeOtherMenus(menuItem),menuItem.setAttribute("aria-expanded","true"),linkGroup.setAttribute("aria-expanded","true"),linkGroup.setAttribute("aria-hidden","false")}function collapseMenu(menuItem,linkGroup){menuItem.setAttribute("aria-expanded","false"),linkGroup.setAttribute("aria-expanded","false"),linkGroup.setAttribute("aria-hidden","true")}function keyDownHandler(event){var index,list,linkGroupId=event.target.getAttribute("aria-controls"),linkGroup=document.getElementById(linkGroupId);switch(event.keyCode){case Keyboard.ENTER:if("false"!==event.target.getAttribute("aria-expanded"))return;expandMenu(event.target,linkGroup);break;case Keyboard.SPACE:if("true"===event.target.getAttribute("aria-expanded"))collapseMenu(event.target,linkGroup);else{if("false"!==event.target.getAttribute("aria-expanded"))return;expandMenu(event.target,linkGroup)}break;case Keyboard.DOWN:"false"===event.target.getAttribute("aria-expanded")?expandMenu(event.target,linkGroup):(index=event.target,list=document.querySelectorAll("input, button, select, textarea, a[href]"),list=Array.prototype.filter.call(list,function(item){return"0"<=item.tabIndex}),index=list.indexOf(index),(list[index+1]||list[0]).focus());break;case Keyboard.UP:"true"===event.target.getAttribute("aria-expanded")?collapseMenu(event.target,linkGroup):function(index){var list=document.querySelectorAll("input, button, select, textarea, a[href]"),list=Array.prototype.filter.call(list,function(item){return"0"<=item.tabIndex}),index=list.indexOf(index);return list[index-1]||list[0]}(event.target).focus();break;case Keyboard.LEFT:!function(index){var list=document.getElementsByClassName("primary-nav__link"),list=Array.prototype.slice.call(list),index=list.indexOf(index);return list[index-1]||list[0]}(event.target).focus();break;case Keyboard.RIGHT:!function(index){var list=document.getElementsByClassName("primary-nav__link"),list=Array.prototype.slice.call(list),index=list.indexOf(index);return list[index+1]||list[0]}(event.target).focus();break;default:return}event.preventDefault()}function closeOtherMenus(el){for(var menuItems=document.getElementsByClassName(linkGroupClassName),i=0;i<menuItems.length;i++){var link=menuItems[i].getAttribute("aria-labelledby"),link=document.getElementById(link);link!=el&&collapseMenu(link,menuItems[i])}var infoMenu=getControls(infoNavButton);infoMenu&&el!=infoMenu&&(infoMenu.setAttribute("aria-expanded","false"),infoMenu.setAttribute("aria-hidden","true"))}!function(){menu=document.getElementById("primary-nav"),elements=document.getElementsByClassName("primary-nav__item"),menuExpandButton=document.getElementsByClassName("header__menu-button")[0],utilityMenu=document.getElementsByClassName(utilityMenuClass)[0],infoNavButton=document.getElementsByClassName("info-nav__button")[0],searchMenuButton=document.getElementById("global-search__button"),globalSearchDropdown=document.getElementById("global-search__dropdown"),globalSearchInput=document.getElementById("global-search"),Array.prototype.slice.call(elements),getControls(infoNavButton),document.addEventListener("click",handleMenuCloseEvent),document.addEventListener("keyup",handleMenuCloseEvent);try{menu.addEventListener("keydown",keyDownHandler),menuExpandButton.addEventListener("click",expandMainMenu),infoNavButton.addEventListener("click",expandInfoNav),searchMenuButton.addEventListener("click",expandSearchMenu)}catch(err){}for(var i=0;i<elements.length;i++)elements[i].addEventListener("click",tapMenu)}()}}();!function(window){"use strict";function extend(a,b){for(var key in b)b.hasOwnProperty(key)&&(a[key]=b[key]);return a}function GridFx(el,options){this.gridEl=el,this.options=extend({},this.options),extend(this.options,options),this.items=[].slice.call(this.gridEl.querySelectorAll(".image-gallery__item")),this.previewEl=document.getElementById("image-gallery__preview"),this.isExpanded=!1,this.closeCtrl=this.previewEl.querySelector("button.btn--close"),this.previewDescriptionEl=this.previewEl.querySelector(".description--preview"),this._init()}GridFx.prototype.options={pagemargin:0,onInit:function(instance){return!1},onOpenItem:function(instance,item){return!1},onCloseItem:function(instance,item){return!1},onExpand:function(){return!1}},GridFx.prototype._init=function(){this.options.onInit(this);new Masonry(this.gridEl,{itemSelector:".image-gallery__item",isFitWidth:!0}),this._initEvents(),this._setOriginal()},GridFx.prototype._initEvents=function(){var self=this,clickEvent=null!==document.ontouchstart?"click":"touchstart";this.items.forEach(function(item){function touchmove(ev){item.removeEventListener("touchend",touchend)}var touchend=function(ev){ev.preventDefault(),self._openItem(ev,item),item.removeEventListener("touchend",touchend)};item.addEventListener(clickEvent,function(ev){"click"==clickEvent?(ev.preventDefault(),self._openItem(ev,item)):(item.addEventListener("touchend",touchend),item.addEventListener("touchmove",touchmove))})}),this.closeCtrl.addEventListener("click",function(){self._closeItem()})},GridFx.prototype._openItem=function(ev,descriptionEl){descriptionEl.querySelector("img").getBoundingClientRect();this.current=this.items.indexOf(descriptionEl),this._setOriginal(descriptionEl.querySelector("a").getAttribute("href")),descriptionEl.classList.add("image-gallery__item--current");descriptionEl=descriptionEl.querySelector(".image-gallery__description");descriptionEl&&0<descriptionEl.innerHTML.trim().length?(this.previewEl.classList.remove("image-gallery__preview--notext"),this.previewDescriptionEl.innerHTML=descriptionEl.innerHTML):this.previewEl.classList.add("image-gallery__preview--notext");var self=this;setTimeout(function(){self.previewEl.classList.add("image-gallery__preview--open"),self.options.onExpand()},0),self.originalImg.style.opacity=1},GridFx.prototype._setOriginal=function(src){src||(this.originalImg=document.createElement("img"),this.originalImg.className="original",this.originalImg.style.opacity=0,src="",this.previewEl.appendChild(this.originalImg)),this.originalImg.setAttribute("src",src)},GridFx.prototype._closeItem=function(){var gridItem=this.items[this.current],self=(gridItem.querySelector("img").getBoundingClientRect(),this);this.previewEl.classList.remove("image-gallery__preview--open"),this.previewEl.classList.remove("preview--image-loaded"),self.previewDescriptionEl.innerHTML="",gridItem.classList.remove("image-gallery__item--current"),setTimeout(function(){self.originalImg.style.opacity=0},60)},GridFx.prototype._nextItem=function(){var gridItem=this.items[this.current],descriptionEl=function(el){for(var nextSibling=el.nextSibling;nextSibling&&1!=nextSibling.nodeType;)nextSibling=nextSibling.nextSibling;return nextSibling}(gridItem);this.current=descriptionEl,this._setOriginal(descriptionEl.querySelector("a").getAttribute("href")),descriptionEl.classList.add("image-gallery__item--current"),gridItem.classList.remove("image-gallery__item--current");descriptionEl=descriptionEl.querySelector(".image-gallery__description");descriptionEl&&(this.previewDescriptionEl.innerHTML=descriptionEl.innerHTML)},GridFx.prototype._prevItem=function(){var gridItem=this.items[this.current];(function(el){for(var prevSibling=el.previousSibling;prevSibling&&1!=prevSibling.nodeType;)prevSibling=prevSibling.previousSibling})(gridItem),gridItem.querySelector("img"),(void 0).querySelector("img")},GridFx.prototype._getWinSize=function(){return{width:document.documentElement.clientWidth,height:window.innerHeight}},window.GridFx=GridFx}(window),function(window){function MegaSearch(megaSearchId,url){var self;this.primaryEl=document.getElementById(megaSearchId),this.primaryEl&&(this.inputEl=this.primaryEl.getElementsByClassName("search-field__input")[0],this.suggestionEl=this.primaryEl.getElementsByClassName("search-suggestions")[0],this.closeButtonEl=this.primaryEl.getElementsByClassName("mega-search__clear")[0],-1==(this.serviceUrl=url).indexOf("{0}")&&(this.serviceUrl=url.concat("?SearchTerm={0}")),this.minChars=3,this.fullscreenClass="mega-search--fullscreen",this.xhr=new XMLHttpRequest,this.timeout,(self=this).inputEl.addEventListener("input",function(ev){clearTimeout(self.timeout),self.timeout=setTimeout(function(){self.inputChanged()},200)}),this.inputEl.addEventListener("focus",function(ev){self.inputChanged()}),this.closeButtonEl.addEventListener("click",function(ev){self.closeSearch()}))}String.format||(String.format=function(format){var args=Array.prototype.slice.call(arguments,1);return format.replace(/{(\d+)}/g,function(match,number){return void 0!==args[number]?args[number]:match})}),MegaSearch.prototype.inputChanged=function(){var self=this,inputVal=self.inputEl.value;inputVal.length>=self.minChars?self.getData(inputVal,function(result){self.renderData(result)}):(self.suggestionEl.innerHTML="",self.moveToOriginal())},MegaSearch.prototype.closeSearch=function(e){return this.moveToOriginal(),this.inputEl.value="",this.suggestionEl.innerHTML="",e.preventDefault(),!1},MegaSearch.prototype.getData=function(url,callback){var self=this,url=String.format(this.serviceUrl,url);this.xhr.abort(),this.xhr.open("GET",url),this.xhr.send(null),this.xhr.onreadystatechange=function(){4===self.xhr.readyState&&200===self.xhr.status?callback(self.xhr.responseText):200!==self.xhr.status&&console.log("Error: "+self.xhr.status)}},MegaSearch.prototype.renderData=function(strData){0<strData.length&&this.moveToTop();var result=strData;try{var jsonData=JSON.parse(strData);null!=jsonData&&(null!=jsonData["@odata.context"]?jsonData["@odata.context"].includes("academicprograms")?(result='<ol class="search-suggestions__list">',jsonData.value.forEach(function(program){result+=String.format('<li><a href="/academic-programs/{0}" class="search-suggestions__link">{1}</a></li>',program.UrlName,program.ProgramName)}),result+="</ol>"):result="UNKNOWN ODATA TYPE":result=null!=jsonData.Result?jsonData.Result:"UNKNOWN DATA TYPE")}catch(err){}this.suggestionEl.innerHTML=result},MegaSearch.prototype.moveToTop=function(){},MegaSearch.prototype.moveToOriginal=function(){},window.MegaSearch=MegaSearch}(window);var streamingFlag=function(){var eventId,flag,flagHtml,currCheckNum=0;return flagDisplayed=!1,hideIfNotExist=!1,function(){!function getIsStreaming(){var url,xhr;["beta.cedarville.edu","www.cedarville.edu","devfinity.cedarville.edu","www.cedarville-local.com"].includes(window.location.hostname)&&null!=document.getElementById("streaming-flag-container")&&(url="/restapi/StreamingFlag/IsStreaming?format=json",0<getUrlParameter("test").length&&(url=url.concat("&UseTestData=true")),(xhr=new XMLHttpRequest).open("GET",url),xhr.onreadystatechange=function(x){this.readyState===XMLHttpRequest.DONE&&200===this.status&&(JSON.parse(xhr.responseText).Result?flagDisplayed||function(){var testMode=0<getUrlParameter("test").length,url="/restapi/StreamingFlag/GetStreamingFlag?format=json";testMode&&(url=url.concat("&UseTestData=true"));var xhr=new XMLHttpRequest;xhr.open("GET",url),xhr.onreadystatechange=function(){var jsonResponse;this.readyState===XMLHttpRequest.DONE&&200===this.status&&(jsonResponse=JSON.parse(xhr.responseText),(flagHtml=jsonResponse.Result)&&function(){if(!flagDisplayed){const flagContainer=document.getElementById("streaming-flag-container");flagContainer&&(flagContainer.innerHTML=flagHtml,flagContainer.classList.add("active")),void 0!==(flag=document.getElementById("streaming-flag"))&&(flagDisplayed=!0,type=flag.getAttribute("data-type"),eventId=flag.getAttribute("data-event-id"),Cookies.get("streaming-flag-"+type)===eventId&&(flag.style.display="none"))}}())},xhr.send()}():hideIfNotExist&&void 0!==(flag=document.getElementsByClassName("streaming-flag")[0])&&(flag.style.visibility="hidden",flagDisplayed=!1),hideIfNotExist=!0)},xhr.send(),++currCheckNum<10&&setTimeout(function(){getIsStreaming()},6e4))}()}}();function startup(){megamenu(),new MegaSearch("primary-search","/restapi/Search/GlobalSearchSuggestion/{0}?format=json"),streamingFlag()}!function(window){"use strict";function FilterList(filters,listId){var self=this;self.filters=filters;for(var i=0;i<filters.length;i++)self.filters[i]._input=document.getElementById(filters[i].input),self.filters[i]._attribute="data-"+filters[i].attribute,self.filters[i]._input.addEventListener("input",function(){self.executeFilter()});this.ul=document.getElementById(listId),this.dataItems=this.ul.getElementsByTagName("li")}FilterList.prototype.executeFilter=function(){for(var i=0;i<this.dataItems.length;i++){for(var result=!0,x=0;x<this.filters.length;x++){var data=this.dataItems[i].getAttribute(this.filters[x]._attribute),filter=this.filters[x]._input.value.toUpperCase();-1==data.toUpperCase().indexOf(filter)&&(result=!1)}this.dataItems[i].style.display=result?"":"none"}},window.FilterList=FilterList}(window),window.addEventListener("load",startup,!1);