PageSourceSearch

https://www.towson.edu/_resources/js/scripts.js?date=031121

js towson.edu collected 2026-10-01 09:01:34 UTC 53,115 bytes, 1,197 lines download raw bytes

1$(document).ready(function() {
2
3    //////////////////////////////////////////////////////////////////////
4    // reveal content
5    //////////////////////////////////////////////////////////////////////
6    window.sr = ScrollReveal();
7    var reveal = {
8        delay    : 100,
9        duration : 800,
10        distance : '150px',
11        easing   : 'ease-in-out',
12        scale    : 1
13    };
14    sr.reveal('.home .split-callout .col img', reveal);
15    sr.reveal('.home  .full-width-callout .wrapper', reveal);
16    sr.reveal('.home .homepage-intro-callout .col', { duration: 800 }, 100);
17    sr.reveal('.home .news.complex .columns .col', { duration: 800 }, 100);
18
19    //////////////////////////////////////////////////////////////////////
20    // ADA related scripts for menus and program filters
21    //////////////////////////////////////////////////////////////////////
22
23    $('.navigation .main .dropdown .drop ul li a').attr('aria-hidden', 'true');
24    // $('span.span-style').attr('role', 'text');
25
26    //activate nested utility nav
27    $(".navigation .utility li a.top").on("click keypress",function(){
28        if($(this).hasClass('active')) {
29            $(this).removeClass("active");
30            $(".navigation .utility ul li ul.active").removeClass("active");
31            $(this).attr('aria-expanded', 'false');
32        }
33        else{
34            $(".navigation .utility li a.top.active").removeClass("active");
35            $(".navigation .utility ul li ul.active").removeClass("active");
36            $(this).addClass("active");
37            $(this).siblings().addClass("active");
38            $(".navigation .utility li a").attr('aria-expanded', 'false');
39            $(this).attr('aria-expanded', 'true');
40        }
41    });
42    $("#content").on("click keypress",function(){
43        $(".navigation .utility li a.top.active").removeClass("active");
44        $(".navigation .utility ul li ul.active").removeClass("active");
45    });
46    $(".navigation .utility ul.right").on("click keypress",function(){
47        $(".navigation .utility li a.top.active").removeClass("active");
48        $(".navigation .utility ul li ul.active").removeClass("active");
49    });
50    $(".navigation .main").on("click keypress",function(){
51        $(".navigation .utility li a.top.active").removeClass("active");
52        $(".navigation .utility ul li ul.active").removeClass("active");
53    });
54
55    //activate nested main nav
56    $('body').keyup(function(e) {
57        var code = e.keyCode || e.which;
58        if (code == '9') {
59            if($('.navigation .main ul li i.visible').length == 0) {
60                $('.navigation .main ul li i').addClass("visible");
61            }
62        }
63    });
64    var currentLink;
65    $(".navigation .main nav ul li i").on("click keypress",function(){
66        $('.navigation .main .dropdown .drop').removeClass("active");
67        currentLink = $(this).attr('data-attr');
68        $(this).attr('aria-expanded', 'true');
69        if($('.navigation .main .dropdown .drop.active').length == 0) {
70            $('.navigation .main .dropdown .drop.' + currentLink).addClass("active");
71            $('.navigation .main .dropdown .drop.' + currentLink + ' ul:first-of-type li:first-of-type a').focus();
72            $('.navigation .main .dropdown .drop ul li a').attr('tabindex', '0');
73            $('.navigation .main .dropdown .drop ul li a').attr('aria-hidden', 'false');
74        }
75    });
76    // on key down of last ul li <a> focus to the sibling of the currentLink var
77    $(".navigation .main .dropdown .drop:not(:last-child) ul:last-of-type li:last-of-type a").keydown(function(){
78        $('.navigation .main .dropdown .drop').removeClass("active");
79        $('.navigation .main .dropdown .drop ul li a').attr('tabindex', '-1');
80        $('.navigation .main .dropdown .drop ul li a').attr('aria-hidden', 'true');
81        $('#' + currentLink).focus();
82        $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
83        //console.log(currentLink);
84    });
85    //ensures nested main nav is closed when exiting final dropdown
86    $(".navigation .main .dropdown .drop ul:last-of-type li:last-of-type a").keydown(function(){
87        $('.navigation .main .dropdown .drop').removeClass("active");
88        $('.navigation .main .dropdown .drop ul li a').attr('tabindex', '-1');
89        $('.navigation .main .dropdown .drop ul li a').attr('aria-hidden', 'true');
90        $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
91    });
92
93    // fix the shift tab leaving the menu and back to current item
94
95    $(".drop.one .left li:first-of-type a:first-of-type").on("keydown", function (e) {
96
97        if (e.shiftKey && e.keyCode === 9) {
98            e.preventDefault();
99            $("#one + .ri-arrow-down-s-line.visible").focus();
100            $('.navigation .main .dropdown .drop').removeClass("active");
101            $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
102
103        }
104    });
105    $(".drop.two .left li:first-of-type a:first-of-type").on("keydown", function (e) {
106
107        if (e.shiftKey && e.keyCode === 9) {
108            e.preventDefault();
109            $("#two + .ri-arrow-down-s-line.visible").focus();
110            $('.navigation .main .dropdown .drop').removeClass("active");
111            $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
112
113        }
114    });
115    $(".drop.three .left li:first-of-type a:first-of-type").on("keydown", function (e) {
116
117        if (e.shiftKey && e.keyCode === 9) {
118            e.preventDefault();
119            $("#three + .ri-arrow-down-s-line.visible").focus();
120            $('.navigation .main .dropdown .drop').removeClass("active");
121            $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
122
123        }
124    });
125    $(".drop.four .left li:first-of-type a:first-of-type").on("keydown", function (e) {
126
127        if (e.shiftKey && e.keyCode === 9) {
128            e.preventDefault();
129            $("#four + .ri-arrow-down-s-line.visible").focus();
130            $('.navigation .main .dropdown .drop').removeClass("active");
131            $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
132
133        }
134    });
135    $(".drop.five .left li:first-of-type a:first-of-type").on("keydown", function (e) {
136
137        if (e.shiftKey && e.keyCode === 9) {
138            e.preventDefault();
139            $("#five + .ri-arrow-down-s-line.visible").focus();
140            $('.navigation .main .dropdown .drop').removeClass("active");
141            $(".navigation .main nav ul li i").attr('aria-expanded', 'false');
142
143        }
144    });
145
146
147    //allow interaction with program listing filter
148    $('.program-listing .filters label').keypress(function(){
149        $(this).click();
150    });
151
152    //mobile navigation
153    $('.mobile-nav').on("click touch keypress", function () {
154        $(".mobile-nav .hamburger").toggleClass('active');
155        $(".mobile-links").toggleClass('active');
156        $('.mobile-links ul.util li.top').attr('tabindex', '0');
157        $('.mobile-links ul.util li.top a').attr('tabindex', '0');
158        if($('.mobile-links.active').length > 0) {
159            $('.mobile-links a').attr('tabindex', '0');
160            $('.mobile-links ul.util li ul li a').attr('tabindex', '-1');
161            // $('.mobile-links').attr('aria-hidden', 'false');
162            // $('#content').css('display','none');
163            $('.footer').css('display','none');
164            $('.footer-callout').css('display','none');
165            $('.mobile-nav').attr('aria-label', 'Mobile navigation close');
166        }
167        else{
168            $('.mobile-links a').attr('tabindex', '-1');
169            // $('.mobile-links').attr('aria-hidden', 'true');
170            $('#content').css('display','block');
171            $('.footer').css('display','block');
172            $('.footer-callout').css('display','block');
173            $('.mobile-nav').attr('aria-label', 'Mobile navigation button');
174        }
175    });
176    //mobile navigation nested ul
177    $('.mobile-links ul.util li').on("click touch keypress", function () {
178        $(this).children('ul').addClass('active');
179
180        $(".mobile-links ul li a").attr('tabindex', '-1');
181        $(".mobile-links ul.util li").attr('tabindex', '-1');
182
183        $(this).find("ul li a").attr('tabindex', '0');
184        $('.mobile-links .back').addClass('active').attr('tabindex', '0');
185
186        $('.mobile-links ul.util li ul.active li:first-of-type').focus();
187
188        $('.mobile-links ul li').css('display','none');
189        $('.mobile-links .btn').css('display','none');
190        $('.mobile-links p').css('display','none');
191        $(this).css('display','block').css("visibility","hidden");
192        $('.mobile-links ul.util li ul.active li').css('display','block').css("visibility","visible");
193
194        // Added February 2021
195        $('.mobile-links > .container').css('padding-bottom','950px').css('margin-top','-70px');
196
197        if($(this).hasClass('students')) {
198            $('.mobile-links > .container').css('padding-bottom','850px').css('margin-top','-70px');
199        }
200
201        if($(this).hasClass('parents')) {
202            $('.mobile-links > .container').css('padding-bottom','450px').css('margin-top','-70px');
203        }
204
205        if($(this).hasClass('alumni')) {
206            $('.mobile-links > .container').css('padding-bottom','450px').css('margin-top','-70px');
207        }
208
209        if($(this).hasClass('facultystaff')) {
210            $('.mobile-links > .container').css('padding-bottom','450px').css('margin-top','-70px');
211        }
212
213        if($(this).hasClass('business')) {
214            $('.mobile-links > .container').css('padding-bottom','450px').css('margin-top','-70px');
215        }
216
217        $('.mobile-links .back p').css('display','block');
218
219    });
220    $('.mobile-links .back').on("click touch keypress", function () {
221        $('.mobile-links ul.util li ul').removeClass('active');
222
223        $(".mobile-links ul li a").attr('tabindex', '0');
224        $(".mobile-links ul.util li").attr('tabindex', '0');
225        $(".mobile-links ul.util li ul li").attr('tabindex', '-1');
226
227        $(".mobile-links ul.util li ul li a").attr('tabindex', '-1');
228        $(this).removeClass('active').attr('tabindex', '-1');
229
230        $('.mobile-links .btn').css('display','block');
231        $('.mobile-links ul li').css('display','block').css("visibility","visible");;
232        $('.mobile-links p').css('display','block');
233
234        // Added February 2021
235        $('.mobile-links > .container').css('padding-bottom','0').css('margin-top','0');
236
237        $('.mobile-links ul:first-of-type li:first-of-type a').focus();
238    });
239
240    /*
241    $(".hide-focus").focus(function() {
242      alert( "Handler for .focus() called." );
243    });
244    */
245
246    $(window).keydown(function (e) {
247        var code = (e.keyCode ? e.keyCode : e.which);
248
249        //reset focus to top when reaching bottom of mobile navigation
250        /* if (code == 9 && $('.mobile-links ul.util li ul.active li:last-of-type a:focus').length) {
251            $('.mobile-links .back').focus();
252        }
253        if (code == 9 && $('.mobile-links ul:last-of-type li:last-of-type a:focus').length) {
254            $('.mobile-nav').focus();
255        } */
256
257        //left and right arrow controls - number statistics
258        if (code == 39 && $('.numbers.statistics ul li:focus').length) {
259            $('.numbers.statistics ul li:focus').next().focus();
260        }
261        if (code == 37 && $('.numbers.statistics ul li:focus').length) {
262            $('.numbers.statistics ul li:focus').prev().focus();
263        }
264
265        //up and down arrow controls - number statistics
266        if (code == 38 && $('.numbers.statistics ul li:focus').length) {
267            e.preventDefault();
268            $(this).parent().parent().prevAll('p').focus();
269            //console.log("previous number statistics");
270        }
271        if (code == 40 && $('.numbers.statistics ul li:focus').length) {
272            e.preventDefault();
273            $(this).parent().parent().nextAll('p').focus();
274            //console.log("next number statistics");
275        }
276
277        //left and right arrow controls - number statistics-small
278        if (code == 39 && $('.numbers.statistics-small ul li:focus').length) {
279            $('.numbers.statistics-small ul li:focus').next().focus();
280        }
281        if (code == 37 && $('.numbers.statistics-small ul li:focus').length) {
282            $('.numbers.statistics-small ul li:focus').prev().focus();
283        }
284
285        //up and down arrow controls - number statistics-small
286        if (code == 38 && $('.numbers.statistics-small ul li:focus').length) {
287            $(this).prev('p').focus();
288            e.preventDefault();
289            //console.log("previous number statistics small");
290        }
291        if (code == 40 && $('.numbers.statistics-small ul li:focus').length) {
292            $(this).next('p').focus();
293            e.preventDefault();
294            //console.log("next number statistics small");
295        }
296
297        //left and right arrow controls - tabbed
298        if (code == 39 && $('.tabbed .top .left li:focus').length) {
299            $('.tabbed .top .left li:focus').next().focus();
300        }
301        if (code == 37 && $('.tabbed .top .left li:focus').length) {
302            $('.tabbed .top .left li:focus').prev().focus();
303        }
304
305        //up and down arrow controls - tabbed
306        if (code == 38 && $('.tabbed .top .left li:focus').length) {
307            $(this).prev('p').focus();
308            e.preventDefault();
309            //console.log("previous tabbed");
310        }
311        if (code == 40 && $('.tabbed .top .left li:focus').length) {
312            $(this).next('p').focus();
313            e.preventDefault();
314            //console.log("next tabbed");
315        }
316
317
318        //left and right arrow controls - areas of study
319        if (code == 39 && $('.tabber .tabber-handle:focus').length) {
320            $('.tabber .tabber-handle:focus').next().focus();
321        }
322        if (code == 37 && $('.tabber .tabber-handle:focus').length) {
323            $('.tabber .tabber-handle:focus').prev().focus();
324        }
325
326    });
327
328    //////////////////////////////////////////////////////////////////////
329    // Search bar detect .navigation .search-section
330    //////////////////////////////////////////////////////////////////////
331
332    //detect focus of program listing search bar
333    $('.program-listing .filters .search input[type="search"]').focus( function() {
334        $('.program-listing .filters .search').addClass('active');
335    });
336    /* $('.program-listing .filters .search input[type="search"]').blur( function() {
337        $('.program-listing .filters .search').removeClass('active');
338    }); */
339
340    //detect focus of navigation search bar
341    $('.navigation .search-section input.search_input').focus( function() {
342        $('.navigation .search-section').addClass('active');
343    });
344    $('.navigation .search-section input.search_input').blur( function() {
345        $('.navigation .search-section').removeClass('active');
346    });
347    $('.navigation .search-section button.search_submit_word').focus( function() {
348        $('.navigation .search-section').addClass('active');
349    });
350    $('.navigation .search-section button.search_submit_word').blur( function() {
351        $('.navigation .search-section').removeClass('active');
352    });
353    $('.navigation .mobile .search-section input.search_input').focus( function() {
354        $('.navigation .mobile .search-section').addClass('active');
355    });
356    $('.navigation .mobile .search-section input.search_input').blur( function() {
357        $('.navigation .search-section').addClass('active');
358    });
359
360    //////////////////////////////////////////////////////////////////////
361    // Border hover states
362    //////////////////////////////////////////////////////////////////////
363
364    //hover state on news image block
365    $('.news .col a.btn').hover(function(){
366        $(this).parent('div').toggleClass('active');
367    });
368
369    //hover state on news complex image block
370    $('.news.complex .columns .col a.inline').hover(function(){
371        $(this).parent('div').toggleClass('active');
372    });
373
374    //hover state on colleges image block
375    $('.colleges .col .copy a').hover(function(){
376        $(this).parent('div').parent('div').toggleClass('active');
377    });
378
379    //hover state on tile image block
380    $('.tiles .col a').hover(function(){
381        $(this).parent('div').toggleClass('active');
382    });
383
384    //hover state on prgram image block
385    $('.program-listing .programs .title a').hover(function(){
386        $(this).parent('div').parent('div').toggleClass('border-display');
387    });
388
389    //////////////////////////////////////////////////////////////////////
390    // Tab content controls
391    //////////////////////////////////////////////////////////////////////
392
393    //get dynamic width and center UL statistic snippet
394    if($('.numbers.statistics').length > 0) {
395        $(window).on("resize load", function(event){
396            var statListWidth = $(".numbers.statistics ul").innerWidth();
397            var statListPadding = 1; //solves chrome bug not measuring fractional innerWidth
398            var statListWidthUpdated = statListWidth + statListPadding;
399            $(".numbers.statistics ul").width(statListWidthUpdated).css("display","block").css("opacity","1");
400        });
401    }
402
403    //get dynamic width and center UL statistic-small snippet
404    if($('.numbers.statistics-small').length > 0) {
405        $(window).on("resize load", function(event){
406            var statListWidth = $(".numbers.statistics-small ul").innerWidth();
407            var statListPadding = 1; //solves chrome bug not measuring fractional innerWidth
408            var statListWidthUpdated = statListWidth + statListPadding;
409            $(".numbers.statistics-small ul").width(statListWidthUpdated).css("display","block").css("opacity","1");
410        });
411    }
412
413    //areas of study tab controls - desktop
414    $('.study.filter li:not(:first)').addClass('inactive');
415    $('.study.filter .columns').hide();
416    $('.study.filter .columns:first').show();
417    $('.study.filter #tabs li').on("click touch keypress", function () {
418        var title = $(this).attr('id');
419        if($(this).hasClass('inactive')){
420            $('.study.filter #tabs li').addClass('inactive');
421            $(this).removeClass('inactive');
422            $('.study.filter .columns').hide();
423            $('.study.filter #'+ title + 'Container').fadeIn('slow');
424            //aria selected
425            $('.study.filter #tabs li').attr('aria-selected', 'false');
426            $(this).attr('aria-selected', 'true');
427        }
428    });
429    //areas of study tab controls - mobile
430    $('.study.filter .mobile-select select').change(function() {
431        var value = $(this).val();
432        $('.study.filter .columns').hide();
433        $('.study.filter #'+ value + 'Container').fadeIn('slow');
434    });
435
436    //statistics tab controls
437    $('.numbers.statistics .stats ul li:not(:first)').addClass('inactive');
438    $('.numbers.statistics .columns').hide();
439    $('.numbers.statistics .columns:first').show();
440    $('.numbers.statistics ul#tabs li').on("click touch keypress", function () {
441        var tab = $(this).attr('id');
442        if($(this).hasClass('inactive')){
443            $('.numbers.statistics #tabs li').addClass('inactive');
444            $(this).removeClass('inactive');
445            $('.numbers.statistics .columns').hide();
446            $('.numbers.statistics #'+ tab + 'Container').fadeIn('slow');
447            //aria selected
448            $('.numbers.statistics #tabs li').attr('aria-selected', 'false');
449            $(this).attr('aria-selected', 'true');
450        }
451    });
452    //statistics tab controls - mobile
453    $('.numbers.statistics .mobile-select select').change(function() {
454        var value = $(this).val();
455        $('.numbers.statistics .columns').hide();
456        $('.numbers.statistics #'+ value + 'Container').fadeIn('slow');
457    });
458
459    //statistics-small tab controls
460    $('.numbers.statistics-small ul li:not(:first)').addClass('inactive');
461    $('.numbers.statistics-small .columns').hide();
462    $('.numbers.statistics-small .columns:first').show();
463    $('.numbers.statistics-small ul#tabs li').on("click touch keypress", function () {
464        var tab = $(this).attr('id');
465        if($(this).hasClass('inactive')){
466            $('.numbers.statistics-small #tabs li').addClass('inactive');
467            $(this).removeClass('inactive');
468            $('.numbers.statistics-small .columns').hide();
469            $('.numbers.statistics-small #'+ tab + 'Container').fadeIn('slow');
470            //aria selected
471            $('.numbers.statistics-small #tabs li').attr('aria-selected', 'false');
472            $(this).attr('aria-selected', 'true');
473        }
474    });
475    //statistics-small tab controls - mobile
476    $('.numbers.statistics-small .mobile-select select').change(function() {
477        var value = $(this).val();
478        $('.numbers.statistics-small .columns').hide();
479        $('.numbers.statistics-small #'+ value + 'Container').fadeIn('slow');
480    });
481
482    //tabbed tab controls
483    $('.tabbed ul li:not(:first)').addClass('inactive');
484    $('.tabbed .content').hide();
485    $('.tabbed .content:first').show();
486    $('.tabbed ul#tabs li').on("click touch keypress", function () {
487        var tab = $(this).attr('id');
488        if($(this).hasClass('inactive')){
489            $('.tabbed #tabs li').addClass('inactive');
490            $(this).removeClass('inactive');
491            $('.tabbed .content').hide();
492            $('.tabbed #'+ tab + 'Container').fadeIn('slow');
493            //aria selected
494            $('.tabbed #tabs li').attr('aria-selected', 'false');
495            $(this).attr('aria-selected', 'true');
496        }
497    });
498    //tabbed tab controls - mobile
499    $('.tabbed .mobile-select select').change(function() {
500        var value = $(this).val();
501        $('.tabbed .content').hide();
502        $('.tabbed #'+ value + 'Container').fadeIn('slow');
503    });
504
505    //////////////////////////////////////////////////////////////////////
506    // Program search information
507    //////////////////////////////////////////////////////////////////////
508
509    //program additional information
510    $('.program-listing .programs .tile .expand').on("click touch keypress", function () {
511        const closestTile = $(this).closest('.tile');
512        var closestTileIsActive = closestTile.hasClass("active");
513        var activeTileExists = $('.program-listing .programs .tile.active').length > 0;
514
515        $(".tile").removeClass('active');
516        if(activeTileExists) {
517            $(".program-listing .programs .title .expand.ri-close-line").removeClass('ri-close-line').addClass("ri-information-line");
518            $('.info a').attr('tabindex', '-1');
519        }
520        if(!closestTileIsActive){
521            //style changes
522            $(this).closest('.tile').toggleClass('active');
523            $(this).toggleClass('ri-close-line');
524            $(this).toggleClass('ri-information-line');
525            //display hidden information
526            $('.program-listing .programs .tile .info').css('top','0');
527            var infoHeight = $('.program-listing .programs .tile.active').height();
528            $('.program-listing .programs .tile.active .info').css('top',infoHeight + 5);
529            $('.tile.active .info a').attr('tabindex', '0');
530        }
531    });
532
533    //////////////////////////////////////////////////////////////////////
534    // Accordions
535    //////////////////////////////////////////////////////////////////////
536
537    //accordion controls
538    $('.accordion-group').find('.accordion-toggle').click(function(){
539        if($(this).hasClass('active')){
540            $(this).removeClass("active");
541            $(this).next().slideToggle('fast');
542            $(this).next().attr( 'tabindex', '-1');			
543            $(this).attr('aria-expanded', 'false');
544            //$(this) .attr( 'aria-label', 'Accordion closed.');
545            //$(this) .attr( 'aria-describedby', 'Accordion closed.');
546        }
547        else{
548            $(this).addClass("active");
549            $(this).next().slideToggle('fast');
550            $(this).next().attr( 'tabindex', '0');	
551            $(this).attr('aria-expanded', 'true');
552            //$(this) .attr( 'aria-label', 'Accordion open.');
553            //$(this) .attr( 'aria-describedby', 'Accordion open.');
554        }
555    });
556    $('.accordion-group').find('.accordion-toggle').keypress(function(){
557        if($(this).hasClass('active')){
558            $(this).removeClass("active");
559            $(this).next().slideToggle('fast');
560            $(this).next().attr( 'tabindex', '-1');				
561            $(this).attr('aria-expanded', 'false');
562            //$(this) .attr( 'aria-label', 'Accordion closed.');
563            //$(this) .attr( 'aria-describedby', 'Accordion closed.');
564        }
565        else{
566            $(this).addClass("active");
567            $(this).next().slideToggle('fast');
568            $(this).next().attr( 'tabindex', '0');				
569            $(this).attr('aria-expanded', 'true');
570            //$(this) .attr( 'aria-label', 'Accordion open.');
571            //$(this) .attr( 'aria-describedby', 'Accordion open.');
572        }
573    });
574
575    //accordion controls - programs filter
576    $('#accordion-programs').find('.accordion-toggle').click(function(){
577        if($(this).hasClass('active')){
578            $(this).removeClass("active");
579            $(this).nextAll( ".accordion-content" ).first().slideToggle('fast');
580            $(this).attr('aria-expanded', 'false');
581            //$(this) .attr( 'aria-label', 'Accordion closed.');
582            //$(this) .attr( 'aria-describedby', 'Accordion closed.');
583        }
584        else{
585            $(this).addClass("active");
586            $(this).nextAll( ".accordion-content" ).first().slideToggle('fast');
587            $(this).attr('aria-expanded', 'true');
588            //$(this) .attr( 'aria-label', 'Accordion open.');
589            //$(this) .attr( 'aria-describedby', 'Accordion open.');
590        }
591    });
592    $('#accordion-programs').find('.accordion-toggle').keypress(function(){
593        if($(this).hasClass('active')){
594            $(this).removeClass("active");
595            $(this).nextAll( ".accordion-content" ).first().slideToggle('fast');
596            $(this).attr('aria-expanded', 'false');
597            //$(this) .attr( 'aria-label', 'Accordion closed.');
598            //$(this) .attr( 'aria-describedby', 'Accordion closed.');
599        }
600        else{
601            $(this).addClass("active");
602            $(this).nextAll( ".accordion-content" ).first().slideToggle('fast');
603            $(this).attr('aria-expanded', 'true');
604            //$(this) .attr( 'aria-label', 'Accordion open.');
605            //$(this) .attr( 'aria-describedby', 'Accordion open.');
606        }
607    });
608
609
610    //tooltip controls - programs filter
611    $('#accordion-programs').find('.ri-question-line').click(function(){
612        if($(this).nextAll( ".program-list-category-tooltip" ).first().hasClass('active')){
613            $(this).nextAll( ".program-list-category-tooltip" ).first().removeClass("active");
614        }
615        else{
616            $(this).nextAll( ".program-list-category-tooltip" ).first().addClass("active");
617        }
618    });
619    $('#accordion-programs').find('.ri-question-line').keypress(function(){
620        if($(this).nextAll( ".program-list-category-tooltip" ).first().hasClass('active')){
621            $(this).nextAll( ".program-list-category-tooltip" ).first().removeClass("active");
622        }
623        else{
624            $(this).nextAll( ".program-list-category-tooltip" ).first().addClass("active");
625        }
626    });
627
628    //////////////////////////////////////////////////////////////////////
629    // Navigation / Menu controls
630    //////////////////////////////////////////////////////////////////////
631
632    //display main navigation dropdown
633    $('.navigation .main nav ul li a').hoverIntent(function(){
634        var navNumber = $(this).attr('id');
635        $('.navigation .main .dropdown .drop').delay( 800 ).removeClass('active');
636        $('.navigation .main .dropdown .' + navNumber).delay( 800 ).addClass('active');
637        //hide util nav if open
638        $(".navigation .utility ul li a").removeClass("active");
639        $(".navigation .utility ul li ul").removeClass("active");
640    });
641    //hide main navigation dropdown
642    $(document).mousemove(function(){
643        if($('.navigation .main .dropdown .active').length > 0) {
644            if($(".navigation .main:hover").length != 0){
645                //do nothing
646            }
647            else{
648                $('.navigation .main .dropdown .drop').removeClass('active');
649            }
650        }
651    });
652
653    //toggle sidebar mobile menu and hamburger icon
654    if($('.mobile-sidebar-nav').length > 0) {
655        $('.mobile-sidebar-nav .hamburger').on("click touch keypress", function() {
656            $(this).toggleClass('active');
657            $(".mobile-sidebar-nav nav").toggleClass('active');
658            if($('.mobile-sidebar-nav nav.active').length > 0) {
659                $('.mobile-sidebar-nav nav a').attr('tabindex', '0');
660                $('.mobile-sidebar-nav .hamburger').attr('aria-label', 'Sub Menu Opened');
661                $('.mobile-sidebar-nav .hamburger').attr('aria-describedby', 'Sub Menu Opened');
662            }
663            else{
664                $('.mobile-sidebar-nav nav a').attr('tabindex', '-1');
665                $('.mobile-sidebar-nav .hamburger').attr('aria-label', 'Sub Menu Closed');
666                $('.mobile-sidebar-nav .hamburger').attr('aria-describedby', 'Sub Menu Closed');
667            }
668        });
669    }
670
671    /* if($('.mobile_subnav_container').length > 0) {
672        $('.mobile_subnav_container nav.subnavigation .naver-handle').attr('tabindex', '0');
673    } */
674
675    //append icons to sidebar navigations
676    if($('#subnavigation').length > 0){
677        $("<i class='ri-arrow-right-s-line' aria-label='Arrow icon' tabindex='-1' aria-hidden='true'></i>").prependTo("#subnavigation ul li a");
678        $("<i class='ri-arrow-right-fill' aria-label='Arrow fill icon' tabindex='-1' aria-hidden='true'></i>").prependTo("#subnavigation ul li a");
679        $("<i class='ri-arrow-right-s-line' aria-label='Arrow icon' tabindex='-1' aria-hidden='true'></i>").prependTo(".naver-container ul li a");
680    }
681    if($('#subnavigation-mobile').length > 0){
682        $("<i class='ri-arrow-right-s-line' aria-label='Arrow icon' tabindex='-1' aria-hidden='true'></i>").prependTo("#subnavigation-mobile ul li a");
683        $("<i class='ri-arrow-right-fill' aria-label='Arrow fill icon' tabindex='-1' aria-hidden='true'></i>").prependTo("#subnavigation-mobile ul li a");
684    }
685
686    //append icon to mobile breadcrumb
687    if($('.breadcrumb_items').length > 0){
688        $("<i class='ri-arrow-left-line' aria-label='Previous page' tabindex='-1' aria-hidden='true'></i>").prependTo(".breadcrumb_items");
689    }
690
691    if($('.split-callout .email-link').length > 0){
692        $("<i class='ri-arrow-right-line' aria-label='right arrow' aria-hidden='true' />").appendTo(".split-callout .email-link");
693    }
694
695    //////////////////////////////////////////////////////////////////////
696    // News complex snippet content filter
697    //////////////////////////////////////////////////////////////////////
698
699    //toggle news content
700    $('.news .controls input:radio[name="controls"]').change(function(){
701        if (this.checked && this.value == 'news') {
702            $(".news.complex .columns").removeClass('active')
703            $(".news.complex .columns.news").addClass('active');
704        }
705        if (this.checked && this.value == 'instagram') {
706            $(".news.complex .columns").removeClass('active')
707            $(".news.complex .columns.insta").addClass('active');
708        }
709        if (this.checked && this.value == 'all') {
710            $(".news.complex .columns").removeClass('active')
711            $(".news.complex .columns.mix").addClass('active');
712        }
713    });
714
715    //////////////////////////////////////////////////////////////////////
716    // Resizing columns to match max height content
717    //////////////////////////////////////////////////////////////////////
718
719    function resize(){
720
721        //set col to be same height
722        if($('.colleges .match .col').length > 0) {
723            var maxHeightCollege = 0;
724            $(".colleges .match .col").each(function() {
725                $(".colleges .match .col").css('height','auto');
726                if ($(this).outerHeight() > maxHeightCollege) {
727                    maxHeightCollege = $(this).outerHeight();
728                }
729            }).height(maxHeightCollege);
730        }
731        //set col to be same height
732        if($('.tiles .match .col').length > 0) {
733            var maxHeightTile = 0;
734            $(".tiles .match .col").each(function() {
735                $(".tiles .match .col").css('height','auto');
736                if ($(this).outerHeight() > maxHeightTile) {
737                    maxHeightTile = $(this).outerHeight();
738                }
739            }).height(maxHeightTile);
740        }
741
742    }
743    $(window).on("resize", resize);
744    $(window).on("orientationchange", function(){ setTimeout(resize, 150);});
745    resize();
746
747    //////////////////////////////////////////////////////////////////////
748    // Slider init and scripts
749    //////////////////////////////////////////////////////////////////////
750
751    //complex news slider
752    $('.news.complex .mobile .slide-wrap').slick({
753        centerMode: true,
754        centerPadding: '0px',
755        slidesToShow: 1,
756        autoplay: false,
757        autoplaySpeed: 3000,
758        speed: 200,
759        prevArrow: $('.news.complex .mobile .prev'),
760        nextArrow: $('.news.complex .mobile .next')
761    });
762    $('.news.complex .mobile .prev').attr('tabindex', '0');
763    $('.news.complex .mobile .next').attr('tabindex', '0');
764    $('.news.complex .mobile .slick-arrow').keypress(function(){
765        $(this).click();
766    });
767
768    //video carousel slider controls
769    var videoURL = $('.image.active').attr('data-video');
770    $('.video-blocks .controls .video-url').attr('href', videoURL);
771    $('.video-blocks .prev').on("click touch keypress", function () {
772
773        if($('.video-blocks .carousel .image').length == 3) {
774
775            if($('.image.active').is('[data-attr="1"]')){
776                $('.image').removeClass('active');
777                $('.image').removeClass('prev-slide');
778                $('.image').removeClass('next-slide');
779                $('.image[data-attr="1"]').addClass("next-slide");
780                $('.image[data-attr="2"]').addClass("prev-slide");
781                $('.image[data-attr="3"]').addClass("active");
782                var videoURL = $('.image.active').attr('data-video');
783                $('.video-blocks .controls .video-url').attr('href', videoURL);
784            }
785            else if($('.image.active').is('[data-attr="2"]')){
786                $('.image').removeClass('active');
787                $('.image').removeClass('prev-slide');
788                $('.image').removeClass('next-slide');
789                $('.image[data-attr="1"]').addClass("active");
790                $('.image[data-attr="2"]').addClass("next-slide");
791                $('.image[data-attr="3"]').addClass("prev-slide");
792                var videoURL = $('.image.active').attr('data-video');
793                $('.video-blocks .controls .video-url').attr('href', videoURL);
794            }
795            else if($('.image.active').is('[data-attr="3"]')){
796                $('.image').removeClass('active');
797                $('.image').removeClass('prev-slide');
798                $('.image').removeClass('next-slide');
799                $('.image[data-attr="1"]').addClass("prev-slide");
800                $('.image[data-attr="2"]').addClass("active");
801                $('.image[data-attr="3"]').addClass("next-slide");
802                var videoURL = $('.image.active').attr('data-video');
803                $('.video-blocks .controls .video-url').attr('href', videoURL);
804            }
805
806        }
807        if($('.video-blocks .carousel .image').length == 2) {
808
809            if($('.image.active').is('[data-attr="1"]')){
810                $('.image').removeClass('active');
811                $('.image').removeClass('prev-slide');
812                $('.image[data-attr="1"]').addClass("prev-slide");
813                $('.image[data-attr="2"]').addClass("active");
814                var videoURL = $('.image.active').attr('data-video');
815                $('.video-blocks .controls .video-url').attr('href', videoURL);
816            }
817            else if($('.image.active').is('[data-attr="2"]')){
818                $('.image').removeClass('active');
819                $('.image').removeClass('prev-slide');
820                $('.image[data-attr="1"]').addClass("active");
821                $('.image[data-attr="2"]').addClass("prev-slide");
822                var videoURL = $('.image.active').attr('data-video');
823                $('.video-blocks .controls .video-url').attr('href', videoURL);
824            }
825
826        }
827
828    });
829
830    $('.video-blocks .next').on("click touch keypress", function () {
831
832        if($('.video-blocks .carousel .image').length == 3) {
833
834            if($('.image.active').is('[data-attr="1"]')){
835                $('.image').removeClass('active');
836                $('.image').removeClass('prev-slide');
837                $('.image').removeClass('next-slide');
838                $('.image[data-attr="1"]').addClass("prev-slide");
839                $('.image[data-attr="2"]').addClass("active");
840                $('.image[data-attr="3"]').addClass("next-slide");
841                var videoURL = $('.image.active').attr('data-video');
842                $('.video-blocks .controls .video-url').attr('href', videoURL);
843            }
844            else if($('.image.active').is('[data-attr="2"]')){
845                $('.image').removeClass('active');
846                $('.image').removeClass('prev-slide');
847                $('.image').removeClass('next-slide');
848                $('.image[data-attr="1"]').addClass("next-slide");
849                $('.image[data-attr="2"]').addClass("prev-slide");
850                $('.image[data-attr="3"]').addClass("active");
851                var videoURL = $('.image.active').attr('data-video');
852                $('.video-blocks .controls .video-url').attr('href', videoURL);
853            }
854            else if($('.image.active').is('[data-attr="3"]')){
855                $('.image').removeClass('active');
856                $('.image').removeClass('prev-slide');
857                $('.image').removeClass('next-slide');
858                $('.image[data-attr="1"]').addClass("active");
859                $('.image[data-attr="2"]').addClass("next-slide");
860                $('.image[data-attr="3"]').addClass("prev-slide");
861                var videoURL = $('.image.active').attr('data-video');
862                $('.video-blocks .controls .video-url').attr('href', videoURL);
863            }
864
865        }
866        if($('.video-blocks .carousel .image').length == 2) {
867
868            if($('.image.active').is('[data-attr="1"]')){
869                $('.image').removeClass('active');
870                $('.image').removeClass('prev-slide');
871                $('.image[data-attr="1"]').addClass("prev-slide");
872                $('.image[data-attr="2"]').addClass("active");
873                var videoURL = $('.image.active').attr('data-video');
874                $('.video-blocks .controls .video-url').attr('href', videoURL);
875            }
876            else if($('.image.active').is('[data-attr="2"]')){
877                $('.image').removeClass('active');
878                $('.image').removeClass('prev-slide');
879                $('.image[data-attr="1"]').addClass("active");
880                $('.image[data-attr="2"]').addClass("prev-slide");
881                var videoURL = $('.image.active').attr('data-video');
882                $('.video-blocks .controls .video-url').attr('href', videoURL);
883            }
884
885        }
886
887    });
888
889
890    $('.image[data-attr="1"]').on("focus", function(){
891        $('.image').removeClass('active');
892        $('.image').removeClass('prev-slide');
893        $('.image').removeClass('next-slide');
894        $('.image[data-attr="1"]').addClass("active");
895        $('.image[data-attr="2"]').addClass("next-slide");
896        $('.image[data-attr="3"]').addClass("prev-slide");
897        var videoURL = $('.image.active').attr('data-video');
898        $('.video-blocks .controls .video-url').attr('href', videoURL);
899    });
900    $('.image[data-attr="2"]').on("focus", function(){
901        $('.image').removeClass('active');
902        $('.image').removeClass('prev-slide');
903        $('.image').removeClass('next-slide');
904        $('.image[data-attr="1"]').addClass("prev-slide");
905        $('.image[data-attr="2"]').addClass("active");
906        $('.image[data-attr="3"]').addClass("next-slide");
907        var videoURL = $('.image.active').attr('data-video');
908        $('.video-blocks .controls .video-url').attr('href', videoURL);
909    });
910    $('.image[data-attr="3"]').on("focus", function(){
911        $('.image').removeClass('active');
912        $('.image').removeClass('prev-slide');
913        $('.image').removeClass('next-slide');
914        $('.image[data-attr="1"]').addClass("next-slide");
915        $('.image[data-attr="2"]').addClass("prev-slide");
916        $('.image[data-attr="3"]').addClass("active");
917        var videoURL = $('.image.active').attr('data-video');
918        $('.video-blocks .controls .video-url').attr('href', videoURL);
919    });
920
921
922    //video carousel swipe controls for mobile
923    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
924        $(".video-blocks .carousel").swipeDetector().on("swipeLeft.sd swipeRight.sd", function(event) {
925            if (event.type === "swipeLeft") {
926                $(".video-blocks .controls img.next").trigger("click");
927            } else if (event.type === "swipeRight") {
928                $(".video-blocks .controls img.prev").trigger("click");
929            }
930        });
931    }
932
933    //////////////////////////////////////////////////////////////////////
934    // Miscellaneous
935    //////////////////////////////////////////////////////////////////////
936
937    //randomize intro accent image
938    var accent = $('.page-intro .accent');
939    var random = Math.floor(Math.random() * accent.length);
940    accent.eq(random).addClass('active');
941
942    //our people style adjustment if less than three
943    if ($(".people .columns .col").length < 3){
944        $(".people").addClass('adjust');
945    }
946    if ($(".people .columns .col").length > 3){
947        $(".people").addClass('shrink');
948    }
949
950    //footer callout style adjustment if more than 1
951    if($('.footer-callout a').length > 1) {
952        $(".footer-callout").addClass('split');
953    }
954
955    //page intro accent reposition if no <p>
956    if($('.page-intro .copy p').length == 0) {
957        $(".page-intro .copy h1").addClass('adjust');
958        $(".page-intro .accent.active").addClass('adjust');
959    }
960
961    //append icon to colleges
962    if($('.colleges .full_width_list_block .link_button').length > 0){
963        $("<i class='ri-arrow-right-line' aria-label='Arrow icon' tabindex='-1' aria-hidden='true'></i></i>").appendTo(".colleges .full_width_list_block .link_button");
964    }
965
966    //append icon to areas of study
967    if($('.areas_of_study .item_link .inner').length > 0){
968        $("<i class='ri-arrow-right-line' aria-label='Arrow icon' tabindex='-1' aria-hidden='true'></i></i>").appendTo(".areas_of_study .item_link .inner");
969    }
970
971    //add aria label to close buttons
972    $('.html5lightbox').on("click touch keypress", function () {
973        $('#html5-close').attr('aria-label', 'Close');
974    });
975
976    //hide background videos on mobile
977    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
978        if($('.video-background').length > 0){
979            $(".video-background").remove();
980            $(".video-controls").remove();
981        }
982    }
983
984    //hide background videos on mobile
985    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
986        if($('.video-background.youtube').length > 0){
987            $(".video-background.youtube").remove();
988            $(".video-controls").remove();
989        }
990    }
991
992    /* $(".mobile-links .container .top-nav-bottom .last-link .last-mobile-nav-link ").on("keydown", function (e) {
993                if (e.keyCode === 9 || e.keyCode === 40) {
994                    e.preventDefault();
995                    $(".mobile .container .mobile-nav").focus();
996                    console.log("from last link to menu");
997                }
998            }); */
999
1000    $(".mobile-links .container .top-nav-bottom #skip-to-main .back-to-top ").on("click", function() {
1001        $(".mobile .container .mobile-nav").focus();
1002        console.log("from last link to menu");
1003
1004    });
1005
1006    $('.l1-landing .row:has(section.news)').addClass('news_row');
1007
1008    $('.l1-landing .row:has(section.events)').addClass('events_row');
1009
1010    // The function actually applying the offset
1011    function offsetAnchor() {
1012        if(location.hash.length !== 0) {
1013            window.scrollTo(window.scrollX, window.scrollY - 170);
1014        }
1015    }
1016
1017    // This will capture hash changes while on the page
1018    window.addEventListener("hashchange", offsetAnchor);
1019
1020    // This is here so that when you enter the page with a hash,
1021    // it can provide the offset in that case too. Having a timeout
1022    // seems necessary to allow the browser to jump to the anchor first.
1023    window.setTimeout(offsetAnchor, 1); // The delay of 1 is arbitrary and may not always work right (although it did in my testing).
1024
1025    /* ==========================================
1026    Red Scare Box Accessibility
1027   ========================================== */
1028
1029    /*
1030        var monthNames = ["Jan", "Feb", "Mar", "Apr", "May",
1031     "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
1032     ]; // Define month names array
1033
1034     $(".sc-smartboard-datetime").replaceWith(function(){
1035         var postDate = $(this).html();
1036         var parts = postDate.split('/');
1037
1038         var d = new Date(parts[2], parts[1] - 1, parts[0]);
1039
1040         return '<div id="alertDate">' + d.getDate() + '</div><div id="alertMonth">' + monthNames[d.getMonth()] + '</div>';
1041     });
1042     */
1043
1044
1045    /* ==========================================
1046    College Areas of Study ACCESSIBILITY
1047   ========================================== */
1048
1049    jQuery(function ($) {
1050
1051        var i = 0
1052        if ($("section.areas_of_study.tabber").length > i) {
1053
1054            function JS_wait_AOStudy() {
1055                if ($("a.tabber-handle.undergrad.button").length == i) {
1056                    window.setTimeout(JS_wait_AOStudy, 300);
1057                } else {
1058                    JS_ready_AOStudy();
1059                }
1060            }
1061
1062
1063            function JS_ready_AOStudy() {
1064
1065
1066
1067                $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").on("keydown", function (e) {
1068
1069                    if (e.shiftKey && e.keyCode === 9 || e.keyCode === 38) {
1070                        console.log("from undergrad to out");
1071
1072                    } else if (e.keyCode === 9 || e.keyCode === 40) {
1073                        e.preventDefault();
1074                        if ($(this).hasClass('active')) {
1075                            e.preventDefault();
1076                            $("section.areas_of_study .row .tabs #section_1 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").focus();
1077                            console.log("from undergrad to grad first");
1078                        } else {
1079                            e.preventDefault();
1080                            $("section.areas_of_study .row .tabs #section_2 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").focus();
1081                            console.log("from undergrad to first");
1082                        }
1083                    }
1084
1085
1086                });
1087
1088                $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").on("keydown", function (e) {
1089
1090                    if (e.shiftKey && e.keyCode === 9 || e.keyCode === 38) {
1091                        console.log("from grad to out");
1092
1093                    } else if (e.keyCode === 9) {
1094                        e.preventDefault();
1095                        if ($(this).hasClass('active')) {
1096                            e.preventDefault();
1097                            $("section.areas_of_study .row .tabs #section_2 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").focus();
1098                            console.log("from grad to ugrad first");
1099                        } else {
1100                            e.preventDefault();
1101                            $("section.people .container .columns .col:first-of-type a").focus();
1102                            console.log("from grad to out");
1103                        }
1104                    } else if (e.keyCode === 40) {
1105                        e.preventDefault();
1106                        if ($(this).hasClass('active')) {
1107                            e.preventDefault();
1108                            $("section.areas_of_study .row .tabs #section_2 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").focus();
1109                            console.log("from grad to ugrad first");
1110                        } else {
1111                            e.preventDefault();
1112                            $("section.people h4:first-of-type").focus();
1113                            console.log("from grad to out");
1114                        }
1115                    }
1116
1117
1118                });
1119
1120                //video carousel swipe controls for mobile -- DOES NOT APPEAR TO WORK FOR ACCESSIBILITY
1121                /* if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
1122                    $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").swipeDetector().on("swipeLeft.sd swipeRight.sd", function(event) {
1123                        if (event.type === "swipeLeft") {
1124                            $("section.people h4:first-of-type").focus();
1125                        } else if (event.type === "swipeRight") {
1126                            $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").focus();
1127                        }
1128                    });
1129                } */
1130
1131
1132
1133                $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").on("keydown", function (e) {
1134                    if (e.keyCode === 37) {
1135                        e.preventDefault();
1136                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").focus();
1137                        console.log("from grad to undergrad");
1138                    }
1139                });
1140                $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").on("keydown", function (e) {
1141                    if (e.keyCode === 39) {
1142                        e.preventDefault();
1143                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").focus();
1144                        console.log("from undergrad to grad");
1145                    }
1146                });
1147
1148
1149
1150
1151
1152                $("section.areas_of_study .row .tabs #section_2 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").on("keydown", function (e) {
1153                    if (e.shiftKey && e.keyCode === 9 || e.keyCode === 38) {
1154                        e.preventDefault();
1155                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").focus();
1156                        console.log("from first to grad");
1157                    }
1158                });
1159
1160
1161
1162
1163                $("section.areas_of_study .row .tabs #section_1 .mobile-full.tablet-full.desktop-4:first .item:first .item_link").on("keydown", function (e) {
1164                    if (e.shiftKey && e.keyCode === 9 || e.keyCode === 38) {
1165                        e.preventDefault();
1166                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.undergrad.button").focus();
1167                        console.log("from first to undergrad");
1168                    }
1169                });
1170
1171
1172
1173
1174                $("section.areas_of_study .row .tabs #section_1 .mobile-full.tablet-full.desktop-4:last .item:last .item_link").on("keydown", function (e) {
1175                    if (e.shiftKey && e.keyCode === 9) {
1176                        console.log("from last ugrad to second last ugrad");
1177                    } else if (e.keyCode === 9) {
1178                        e.preventDefault();
1179                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").focus();
1180                        console.log("tab from last ugrad to grad tab");
1181                    } else if (e.keyCode === 40) {
1182                        $("section.areas_of_study .row .all-full .tabber-handles .tabber-handle.grad.button").focus();
1183                        console.log("arrow from last ugrad to grad tab");
1184                    }
1185                });
1186
1187            }
1188
1189            $(document).ready(JS_wait_AOStudy);
1190        }
1191
1192
1193    });
1194
1195
1196
1197});//(document).ready

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.