<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$( function( ) {
//   if (
//     (
//       (
//         window.location.href.indexOf("humber.ca/search") &gt; -1 ||
//         window.location.href.indexOf("/future-students") &gt; -1 ||
//         window.location.href.indexOf("https://sdev-www.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("https://humber.ca") &gt; -1 ||
//         window.location.href.indexOf("appliedtechnology.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("business.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("communityservices.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("healthsciences.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("liberalarts.humber.ca") &gt; -1 ||
//         window.location.href.indexOf("mediaarts.humber.ca") &gt; -1
//       ) &amp;&amp; (!localStorage.getItem('closeHighlightPopup'))
//     )
//   ) {
//
//     $( 'body' ).append( `
//      &lt;div class="bubbleTextGrp__wrapper global" style="left:unset;bottom: 120px;"&gt;
//        &lt;div class="bubble-image-bg-container-4"&gt;
//         &lt;div class="bubbleText__wrapper"&gt;
//           &lt;div style="width:100%;z-index: 2;"&gt;
//             &lt;p style="font-size:20px;color: #000;"&gt;&lt;strong&gt;THERE'S STILL TIME&lt;br/&gt;TO APPLY FOR MAY&lt;/strong&gt;&lt;/p&gt;
//             &lt;p&gt;&lt;a class="humber-track-link" href="https://humber.ca/search/full-time/may-start-date.html?program_type=all"&gt;Search May Programs &lt;em class="icon-chevron-right"&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
//           &lt;/div&gt;
//           &lt;span class="bubbleText__wrapper__closedBtn" style="z-index: 9;"&gt;Close X&lt;/span&gt;
//         &lt;/div&gt;
//         &lt;img src="https://humber.ca/assets/images/burst-transparent.png" style="margin-bottom: 0;top: 50%;left: 50%;width: 80%;right: unset;transform: translate(-50%, -50%);" alt="" /&gt;
//       &lt;/div&gt;
//       &lt;/div&gt;` );
//   }
//
//   if(
//     window.location.href.indexOf("/search/full-time/may-start-date.html") &gt; -1 ||
//     window.location.href.indexOf("humber.ca/admissions") &gt; -1 ||
//     window.location.href.indexOf("/future-students/win.html") &gt; -1 ||
//     window.location.href.indexOf("humber.ca/community/") &gt; -1 ||
//     window.location.href.indexOf("/humbercurrent/") &gt; -1 ||
//     window.location.href.indexOf("/current-students/resources/rebound.html") &gt; -1 ||
//     window.location.href.indexOf("/current-students/resources/apply-now.html") &gt; -1 ||
//     window.location.href.indexOf("/peoples-and-culture") &gt; -1
//   ) {
//     $('.bubbleTextGrp__wrapper.global').remove();
//   }



  // if (
  //     window.location.href.indexOf("/future-students") &gt; -1 ||
  //     window.location.href === "https://sdev-appliedtechnology.humber.ca/" ||
  //     window.location.href === "https://sdev-business.humber.ca/" ||
  //     window.location.href === "https://sdev-communityservices.humber.ca/" ||
  //     window.location.href === "https://sdev-healthsciences.humber.ca/" ||
  //     window.location.href === "https://sdev-liberalarts.humber.ca/" ||
  //     window.location.href === "https://sdev-mediaarts.humber.ca/"
  //   ) {
  //     $('body').append(`&lt;div class="bubbleTextGrp__wrapper bubbleTextGrp__wrapper--preventOverLap"&gt;
  //     &lt;div class="bubbleTextGrp__wrapper" style="left:unset; bottom:50px; right: 0;"&gt;
  //     &lt;div class="bubbleText__wrapper right" style="max-width: 250px;"&gt;
  //       &lt;div&gt;
  //       &lt;p&gt;&lt;strong&gt;There's still time to apply for Fall 2022.&lt;/strong&gt;&lt;/p&gt;
  //       &lt;p&gt;&lt;a onclick="ga(\'send\', \'event\', \'Button\', \'Click\', \'${document.title}\');" class="text-white" href="https://humber.ca/search/full-time/availability.html"&gt;Search by Program Availability &lt;em class="icon-chevron-right"&gt;&amp;nbsp;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
  //       &lt;/div&gt;
  //       &lt;span class="bubbleText__wrapper__closedBtn"&gt;Close X&lt;/span&gt;
  //     &lt;/div&gt;
  //     &lt;/div&gt;`);
  // }

  $('a, button').addClass('humber-track-link');

  $(document).on('click', '.view-faculty-profiles-btn', function(e) {
    $(this).toggleClass('clicked');
    $('.view-faculty-profiles-wrp').toggleClass('showing');
    if($(this).hasClass('clicked')) {
      $(this).find('span').removeClass('icon-chevron-down').addClass('icon-chevron-up');
    } else {
      $(this).find('span').removeClass('icon-chevron-up').addClass('icon-chevron-down');
    }
  });

  // if (window.location.href.indexOf("/continuous-professional-learning") &gt; -1) {
  //     $('body').append(`&lt;div class="bubbleTextGrp__wrapper bubbleTextGrp__wrapper--preventOverLap" style="top: 40%;"&gt;
  //         &lt;div class="bubbleTextGrp__wrapper" style="left:unset; bottom:0; left: 0;"&gt;
  //           &lt;div class="bubbleText__wrapper right" style="max-width: 250px;"&gt;
  //             CPL Course registration will not be available on Wednesday Nov 2 from 9:00pm to 12:00 am due to scheduled maintenance.
  //             &lt;span class="bubbleText__wrapper__closedBtn"&gt;Close X&lt;/span&gt;
  //           &lt;/div&gt;
  //         &lt;/div&gt;
  //       &lt;/div&gt;`);
  // }

  if ( $( '.bubbleText__wrapper' ).length ) {
    $( document ).on( 'click', '.bubbleText__wrapper__closedBtn', function( ) {
      $( this ).parent( '.bubbleText__wrapper' ).fadeOut( 500 );

      if (typeof localStorage !== 'undefined') {
          if (!localStorage.getItem('closeHighlightPopup')) {
              // If the variable doesn't exist, create it
              localStorage.setItem('closeHighlightPopup', true);
          }
      } else {
          console.error('localStorage is not supported in this browser.');
      }

    } );
  }

  if ( $( '.bubbleTextGrp__wrapper--preventOverLap' ).length ) {

    function preventBubbleOverlapFooter( ) {
      var currentWindowPos = $( window ).scrollTop( );
      var bubbleTextPos = $( '.bubbleTextGrp__wrapper--preventOverLap' ).offset( ).top;

      if ( currentWindowPos &gt;= 500 ) {
        $( '.bubbleTextGrp__wrapper--preventOverLap' ).css( {
          'top': '1%'
        } );
      } else {
        $( '.bubbleTextGrp__wrapper--preventOverLap' ).css( {
          'top': '40%'
        } );
      }
    }

    $( window ).scroll( function( e ) {
      preventBubbleOverlapFooter( );
    } );

  }


  function addSkipContentLink( ) {
    //remove the one on template
    if ( $( 'a[href$="#skiptocontent"]' ).length ) {
      $( 'a[href$="#skiptocontent"]' ).remove( );
      if ( $( '#humberGlobalNav' ).length ) {
        setTimeout( function( ) {
          var skipContentTag = document.createElement( 'a' );
          skipContentTag.appendChild( document.createTextNode( "Skip to Content" ) );
          skipContentTag.href = window.location.href + "#skiptocontent";
          skipContentTag.classList.add( 'skipContentLink' );
          skipContentTag.classList.add( 'hideFromScreen' );
          document.body.insertBefore( skipContentTag, document.querySelector( '#humberGlobalNav' ) );
        }, 100 );

        $( window ).keyup( function( e ) {
          var code = ( e.keyCode ? e.keyCode : e.which );
          if ( code == 9 &amp;&amp; $( '.skipContentLink:focus' ).length ) {
            $( '.skipContentLink' ).removeClass( 'hideFromScreen' );
          }
        } );
        $( document ).on( 'click', '.skipContentLink', function( e ) {
          $( '.skipContentLink' ).remove( );
        } );
      }
    }
  }
  addSkipContentLink( );
} );

function checkOverflow( el ) {
  var curOverflow = el.style.overflow;

  if ( !curOverflow || curOverflow === "visible" )
    el.style.overflow = "hidden";

  var isOverflowing = el.clientWidth &lt; el.scrollWidth ||
    el.clientHeight &lt; el.scrollHeight;

  el.style.overflow = curOverflow;

  return isOverflowing;
}

function scrollForMoreText( ) {
  if ( $( '.programtab-details-lg .program-page-tab-links' ).length ) {

    document.querySelectorAll( '.programtab-details-lg .program-page-tab-links' ).forEach( function( node ) {
      var isProgramTabOverflow = checkOverflow( node );

      if ( isProgramTabOverflow ) {
        $( node ).parents( '.programtab-details-lg' ).find( '.program-tab-helptext' ).show( );
      } else {
        $( node ).parents( '.programtab-details-lg' ).find( '.program-tab-helptext' ).hide( );
      }
    } );

    $( document ).on( 'click', '.program-page-tab-links .nav-item', function( e ) {
      if ( $( '.videoFeed' ).length ) {
        $( '.videoFeed' ).slick( 'refresh' );
      }
      if ( $( '.brand-flexslider .flexslider' ).length ) {
        $( '.brand-flexslider .flexslider' ).trigger( 'resize' );
      }
      if ( $( '.equal-divs' ).length ) {
        setTimeout( function( ) {
          equalDivs( ".equal-divs .card" );
          equalDivs( ".equal-divs .eq-gitem" );
        }, 1 );
      }
      if ( $( '.equal-wells' ).length ) {
        setTimeout( function( ) {
          equalDivs( ".equal-wells .card" );
        }, 1 );
      }
      if ( $( '.equal-wells-all-screen' ).length ) {
        setTimeout( function( ) {
          equalDivsAllScreen( ".equal-wells-all-screen .card" );
        }, 1 );
      }
      if ( $( '.faculty-readmore' ).length ) {
        setTimeout( function( ) {
          $( '.faculty-readmore' ).readmore( {
            speed: 75,
            moreLink: '&lt;a href="#"&gt;Read more &lt;em class="icon-chevron-down"&gt;&amp;nbsp;&lt;/em&gt;&lt;/a&gt;',
            lessLink: '&lt;a href="#"&gt;Read less &lt;em class="icon-chevron-up"&gt;&amp;nbsp;&lt;/em&gt;&lt;/a&gt;'
          } );
        }, 500 );
      }

    } );
  }
}

if ( $( '.programtab-details-lg .program-page-tab-links' ).length ) {
  $( '.program-page-tab-links .nav-item:first-child a' ).tab( 'show' );
}

$( window ).on( 'resize', function( e ) {

  scrollForMoreText( );
} );

scrollForMoreText( );


/* NEW PROGRAM PAGE TAB STYLE */
$.fn.shorten = function( settings ) {

  var config = {
    showChars: 100,
    ellipsesText: "...",
    moreText: "Read More &lt;em class='icon-chevron-down'&gt;&amp;nbsp;&lt;/em&gt;",
    lessText: "Read less &lt;em class='icon-chevron-up'&gt;&amp;nbsp;&lt;/em&gt;"
  };

  if ( settings ) {
    $.extend( config, settings );
  }

  $( document ).off( "click", '.morelink' );

  $( document ).on( {
    click: function( ) {

      var $this = $( this );
      if ( $this.hasClass( 'less' ) ) {
        $this.removeClass( 'less' );
        $this.html( config.moreText );
      } else {
        $this.addClass( 'less' );
        $this.html( config.lessText );
      }
      $this.parent( ).prev( ).toggle( );
      $this.prev( ).toggle( );
      return false;
    }
  }, '.morelink' );

  return this.each( function( ) {
    var $this = $( this );
    if ( $this.hasClass( "shortened" ) ) return;

    $this.addClass( "shortened" );
    var content = $this.html( );
    if ( content.length &gt; config.showChars ) {
      var c = content.substr( 0, config.showChars );
      var h = content.substr( config.showChars, content.length - config.showChars );
      var html = c + '&lt;span class="moreellipses"&gt;' + config.ellipsesText + ' &lt;/span&gt;&lt;span class="morecontent"&gt;&lt;span&gt;' + h + '&lt;/span&gt; &lt;a href="#" class="morelink"&gt;' + config.moreText + '&lt;/a&gt;&lt;/span&gt;';
      $this.html( html );
      $( ".morecontent span" ).hide( );
    }
  } );

};

$( ".bio-short" ).shorten( {
  "showChars": 200
} );
/* END OF NEW PROGRAM PAGE TAB STYLE */


$( document ).on( 'click', '.pd-accordion .card button', function( ) {

  $( '.pd-accordion .card button' ).find( 'em' ).removeClass( 'icon-chevron-up' ).addClass( 'icon-chevron-down' );

  if ( $( this ).hasClass( 'collapsed' ) ) {
    $( this ).find( 'em' ).removeClass( 'icon-chevron-up' ).addClass( 'icon-chevron-down' );
  } else {
    $( this ).find( 'em' ).removeClass( 'icon-chevron-down' ).addClass( 'icon-chevron-up' );
  }
} );

$( document ).on( 'click', '.see-course-btn', function( e ) {
  e.stopPropagation( );
  e.preventDefault( );
  $( 'html,body' ).animate( { scrollTop: parseInt( $( ".curriculum-course-btn" ).offset( ).top - 125 ) } );
  if ( !$( ".popout-exclusive-btn[data-content='curriculum-content']" ).hasClass( 'clicked' ) ) {
    setTimeout( function( ) {
      $( ".popout-exclusive-btn[data-content='curriculum-content']" ).trigger( 'click' );
    }, 500 );
  }
} );

if ( $( '[data-toggle="tooltip"]' ).length ) {
  $( '[data-toggle="tooltip"]' ).tooltip( );
}

/************************ Vertical Tabs Starts ************************/
/* LAST UPDATE: March 11, 2020
   REASON: PROGRAM WIDGET - Cope with the new program template design
*/
/************************ CONFIGURATION PLACES IN HERE ************************/
var mobileSize = 1400; //means 1415 in css
var lastWidgetPos = 0;
var minScreenHeight = 965; //* in order to work on abs and fix pos 965
/************************ END OF CONFIGURATION ************************/


/************************************************************************
	THESE ARE PATCH UPDATE TO THE WIDGET INC BUG FIXES.
	ALL PATCHES SHOULD BE PUTTING INSIDE HERE.
*************************************************************************/
function showProgramAvailabilityOnSm( ) {
  if ( $( '#program-availability-lg-tbl' ).length ) {

    var cloneAvailabilityTbl = $( '#program-availability-lg-tbl' ).children( ).clone( true );
    if ( $( window ).width( ) &lt;= mobileSize ) { //* 1280 in css
      $( '#program-availability-sm-tbl' ).html( cloneAvailabilityTbl );
    } else {
      $( '#program-availability-sm-tbl' ).html( '' );
    }
  } else {
    $( '#program-availability-sm-tbl' ).remove( );
  }

  if ( $( '.program-video' ).length ) {

    var cloneProgramVideo = $( '.program-video' ).children( ).clone( true );
    if ( window.matchMedia( "(max-width: 1199px)" ).matches ) {
      $( '.program-video-sm-block' ).html( cloneProgramVideo );
    } else {
      $( '.program-video-sm-block' ).html( '' );
    }
  }

}

function fixWidgetOnSmallHeightScreen( ) { //* Solution to make the widget works on screen height below 765px
  if ( $( window ).height( ) &lt;= minScreenHeight ) {
    if ( $( '.vertical-tab' ).hasClass( 'desktop-widget' ) ) { //* check if widget is on desktop platform
      if ( $( '.vertical-tab' ).css( 'position' ) == 'fixed' ) {
        $( '.vertical-tab' ).css( 'position', 'absolute' );
      }
      $( '.vertical-tab-overlay' ).addClass( 'fixed' ).css( { 'overflow': 'auto' } );
    }
  }
}

function fixScrollOnAbsolutePos( ) { //* Fix the bugs when widget is on absolute pos

  if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) ) { //* On Mobile
    if ( $( '#anchor-mobile' ).length ) {
      var anchor_mobile = $( '#anchor-mobile' ).offset( ).top + 10;
      if ( $( window ).scrollTop( ) &lt;= anchor_mobile ) {
        if ( $( '.vertical-tab' ).css( 'position' ) == 'absolute' ) {
          $( '.vertical-tab' ).css( { 'position': 'fixed' } );
        }
      }
    }
  } else { //* On large screen
    if ( $( ".scroller-anchor" ).length ) {
      var scroller_anchor = $( ".scroller-anchor" ).offset( ).top;
      if ( $( window ).scrollTop( ) &gt;= scroller_anchor ) {
        $( '.vertical-tab' ).css( { 'position': 'fixed' } );
      }
    }
  }
}

function preventWidgetOverlapFooter( ) { //* This function will prevent widget overlap the footer only on mobile
  if ( $( '.vertical-tab' ).length ) {
    if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) &amp;&amp; !$( '.vertical-tab' ).hasClass( 'horizontal-tab' ) ) {
      var footerPosition = $( '#humberGlobalFooter' ).offset( ).top;
      var widgetHeight = $( '.vertical-tab' ).outerHeight( true );
      var widgetPosition = $( '.vertical-tab' ).offset( ).top + widgetHeight;

      var shiftWidgetUp = footerPosition - widgetPosition;

      if ( widgetPosition &gt;= footerPosition ) { //* if widget overlaps footer then put widget on the top

        $( '.vertical-tablinks' ).css( {
          'position': 'relative',
          'top': shiftWidgetUp + 'px'
        } );

      } else {

        $( '.vertical-tablinks' ).css( {
          'position': 'relative',
          'top': 'unset',
          'top': 'auto'
        } );
      }
    }
  }
}

function fixAlignWidgetIcon( ) {
  if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) &amp;&amp; $( '.vertical-tab' ).hasClass( 'horizontal-tab' ) ) {
    $( '.vertical-tablinks .tablinks span' ).css( 'display', 'none !important' );
  }
}

function reduceTopWidgetSpacingOnAbs( canDo ) { //* This will reduce 1/2 space above widget on absolute pos

  if ( $( '.vertical-tab' ).hasClass( 'desktop-widget' ) &amp;&amp; !$( '.vertical-tab' ).hasClass( 'small-screen-mode' ) ) { //* Only check for desktop platform

    if ( $( '.vertical-tab' ).css( 'position' ) == 'absolute' ) {
      if ( canDo == true ) { //* trigger when open the tab
        $( '.vertical-tab' ).css( { 'padding-top': '20px' } );
      } else { //* trigger when close the tab
        $( '.vertical-tab' ).css( { 'padding-top': '40px' } );
      }
    }
  }
}

function equalDivs( container ) {
  var currentTallest = 0,
    currentRowStart = 0,
    rowDivs = new Array( ),
    $el,
    topPosition = 0;
  $( container ).each( function( ) {

    $el = $( this );
    $( $el ).height( 'auto' );

    if ( window.matchMedia( "(min-width: 576px)" ).matches ) {
      topPostion = $el.position( ).top;

      if ( currentRowStart != topPostion ) {
        for ( currentDiv = 0; currentDiv &lt; rowDivs.length; currentDiv++ ) {
          rowDivs[ currentDiv ].height( currentTallest );
        }
        rowDivs.length = 0; // empty the array
        currentRowStart = topPostion;
        currentTallest = $el.height( );
        rowDivs.push( $el );
      } else {
        rowDivs.push( $el );
        currentTallest = ( currentTallest &lt; $el.height( ) ) ? ( $el.height( ) ) : ( currentTallest );
      }
      for ( currentDiv = 0; currentDiv &lt; rowDivs.length; currentDiv++ ) {
        rowDivs[ currentDiv ].height( currentTallest );
      }
    }

  } );
}

/************************ END OF PATCHING ************************/

/* Slide In/Out Menu Feature. Go live after approved */
$( document ).on( 'click', '#arrow-tab', function( e ) {
  e.preventDefault( );
  if ( $( '.vertical-tab' ).hasClass( 'desktop-widget' ) ) {
    if ( $( this ).hasClass( 'show' ) ) {

      $( '.f-load' ).hide( function( ) {
        $( '.arrow' ).css( 'transform', 'rotate(130deg)' );
        $( '#arrow-tab' ).removeClass( 'show' );
      } );
    } else {
      $( '.f-load' ).show( function( ) {
        $( '.arrow' ).css( 'transform', 'rotate(-45deg)' );
        $( '#arrow-tab' ).addClass( 'show' );

      } );
    }
  }
} );

function hideWidgetText( mobileSize ) { //* Hide widget text on screen less than mobileSize
  if ( $( window ).width( ) &lt;= mobileSize ) {
    $( 'a.tablinks' ).find( 'span' ).css( 'display', 'none' );
    $( '#arrow-tab' ).removeClass( 'show' );
    $( '#arrow-helptext-sm' ).hide( );
  } else {
    //$('a.tablinks').find('span').css('display','inline-block');
  }
}

/* End Of Slide In/Out */

function pathWayTabArrow( ) { //* Toggle up and down arrow icon in pathway tab
  var tabCount = 0;
  $( 'body' ).on( 'click', '.pathway-tab-trans', function( e ) {
    //$('.pathway-tab-trans').on('click', function(e) {
    //e.preventDefault();
    var arrow = $( this ).find( '.btn-pathway' ).find( '.widget-arr &gt; em' );
    var scrollTo = $( this ).position( ).top;

    if ( $( this ).find( '.btn-pathway' ).hasClass( 'collapsed' ) ) {
      arrow.removeClass( 'icon-chevron-down' ).addClass( 'icon-chevron-up' );

      setTimeout( function( ) {
        $( '#pathways.vertical-tabcontent' ).animate( {
          scrollTop: scrollTo
        }, 800 );
      }, 100 );

    } else {
      arrow.removeClass( 'icon-chevron-up' ).addClass( 'icon-chevron-down' );
    }
  } );
}

function WidgetOnScreenState( ) {
  if ( $( window ).width( ) &lt;= mobileSize ) {
    $( '.vertical-tab' ).addClass( 'mobile-widget' ).removeClass( 'desktop-widget' );
  } else {
    $( '.vertical-tab' ).addClass( 'desktop-widget' ).removeClass( 'mobile-widget' );
  }
}

function stopBodyScrollingOnMobile( bool ) { //* stop body scroll on mobile
  if ( bool === true ) {
    if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) ) {
      $( 'body, html' ).addClass( 'no-scroll-on-mobile' );
      $( '.vertical-tab-overlay' ).css( {
        '-webkit-overflow-scrolling': 'touch',
      } );
    } else {
      $( 'body, html' ).addClass( 'no-scroll-on-desktop' );
    }
  } else {
    if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) ) {
      $( '.vertical-tab' ).css( { 'height': 'auto' } );
    }
    $( 'body, html' ).removeClass( 'no-scroll-on-mobile' ).removeClass( 'no-scroll-on-desktop' );
  }
}

function restoreWidgetPos( ) {
  if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) ) {
    $( 'html,body' ).animate( { scrollTop: lastWidgetPos } );
  }
}


function repositionWidgetOnMobile( ) {
  if ( !$( '.vertical-tab-overlay' ).hasClass( 'active' ) ) {
    if ( $( '#anchor-mobile' ).length ) {
      var anchor_mobile = $( '#anchor-mobile' ).offset( ).top + 10;
      if ( $( window ).scrollTop( ) &gt;= anchor_mobile ) {
        $( '.vertical-tab' ).css( {
          'position': 'fixed',
          'top': '0px',
          'padding-top': '0',
        } );
      } else {
        $( '.vertical-tab' ).css( {
          'position': 'absolute',
          'top': anchor_mobile + 'px',
          'padding-top': '0',
        } );
      }
    }
  }
}


function showWidgetArrow( obj ) { //* show arrow if content is scrollable
  var innerHeight = $( obj ).innerHeight( );
  var scrollHeight = $( obj ).prop( 'scrollHeight' );
  if ( innerHeight &lt; scrollHeight ) {
    $( obj ).find( '.widget-arrow' ).fadeIn( 500 );
  }
}

function showToolTip( ) {
  //* simple powerful tooltip
  $( '.info-btn' ).each( function( ) { //* Tool tip function uses in Contact us Tab
    var count_info_click = 0;
    $( this ).on( 'click', function( e ) {
      e.preventDefault( );

      var tooltipText = $( this ).find( '.tooltip-info' ).text( $( this ).attr( 'data-content' ) );
      if ( count_info_click % 2 === 0 ) {
        $( this ).find( '.tooltip-info' ).fadeIn( 500 );
      } else {
        $( this ).find( '.tooltip-info' ).fadeOut( 500 );
      }
      count_info_click = count_info_click + 1;
    } );
  } );
}

function showTab( targetedTab ) {
  //repositionWidgetOnMobile();
  if ( $( '.vertical-tab' ).hasClass( 'desktop-widget' ) ) { //* not trigger on mobile size
    if ( $( window ).scrollTop( ) &lt;= $( ".scroller-anchor" ).offset( ).top ) {
      $( 'html,body' ).animate( { scrollTop: parseInt( $( ".scroller-anchor" ).offset( ).top - 125 ) } );
      $( '.vertical-tab' ).css( {
        'position': 'fixed',
        'top': '11%',
        'padding-top': '0',
      } );
    }
  }

  if ( !targetedTab.hasClass( "active" ) ) { //Open Tab
    $( '.vertical-tabcontent' ).hide( );
    $( '.vertical-tab-overlay' ).addClass( "active" );
    $( '.vertical-tab-overlay' ).addClass( "fixed" );
    $( '.vertical-tabcontent-holder' ).show( );
    $( '.vertical-tab a' ).removeClass( "active" );
    stopBodyScrollingOnMobile( true ); //lock the Body

    $( '.vertical-tab' ).css( 'width', '100%' );
    targetedTab.addClass( "active" );
    $displayDiv = $( targetedTab.attr( 'href' ) );
    $( $displayDiv ).find( 'a[data-toggle="collapse"]' ).removeClass( 'active' );
    $( $displayDiv ).find( '.collapse' ).removeClass( 'in' ).height( 0 );

    if ( $( window ).width( ) &lt;= mobileSize ) { //* small screen like iphone plus
      $displayDiv.css( {
        'height': 'calc(100vh - 28vh)',
        'overflow': 'auto',
        'display': 'block',
        'max-height': 'unset'
      } );
    } else { //* larger screen size
      var wheight = 0;
      if ( $( '.vertical-tab' ).css( 'position' ) == 'absolute' &amp;&amp; $( '.vertical-tab' ).hasClass( 'small-screen-mode' ) ) {
        wheight = 200;
      } else {
        wheight = 250;
      }
      $displayDiv.css( {
        'max-height': $( window ).height( ) - wheight + 'px',
        'min-height': '500px'
      } );
    }

    $displayDiv.show( );

  }
}


//* Start Window event
$( window ).on( 'mousewheel DOMMouseScroll', function( event ) { //* This to ensure func works on all browsers
  if ( event.originalEvent.detail &gt; 0 || event.originalEvent.wheelDelta &lt; 0 ) {
    hideWidgetText( mobileSize );
  } else {
    hideWidgetText( mobileSize );
  }
} );

document.onkeydown = function( ) {
  switch ( event.keyCode ) {
    case 38:
      hideWidgetText( mobileSize );
      console.log( "Up key is pressed" );
      break;
    case 40:
      hideWidgetText( mobileSize );
      console.log( "Down key is pressed" );
      break;
  }
};

$( window ).on( 'touchmove', function( ) { //* event trigger only on mobile
  hideWidgetText( mobileSize );
} );


$( window ).on( 'resize', function( ) {
  setTimeout( WidgetOnScreenState( ), 500 );
  setTimeout( repositionWidgetOnMobile( ), 1000 );
  showProgramAvailabilityOnSm( );
  equalDivs( ".semester-pair .semester-group" );
} );

$( window ).on( "debouncedresize", function( event ) {
  if ( $( '.vertical-tab' ).hasClass( 'desktop-widget' ) ) {
    var wheight = 0;
    if ( $( '.vertical-tab' ).css( 'position' ) == 'absolute' &amp;&amp; $( '.vertical-tab' ).hasClass( 'small-screen-mode' ) ) {
      wheight = 200;
    } else {
      wheight = 250;
    }
    $( '.vertical-tabcontent' ).css( 'max-height', $( window ).height( ) - wheight + 'px' );

    //add checking if screen height is less than minScreenHeight
    if ( $( window ).height( ) &lt;= minScreenHeight ) {
      $( '.vertical-tab' ).addClass( 'small-screen-mode' );
    } else {
      $( '.vertical-tab' ).removeClass( 'small-screen-mode' );
    }

  }
} );

$( window ).on( 'load', function( ) {
  if ( typeof disable_intl !== 'undefined' ) {
    if ( disable_intl == 1 ) {
      $( '.international-fee' ).remove( );
    }
  }
  if ( $( "#user_location" ).length ) {
    //Auto complete for input field
    var available_countries = [ ];
    var api_countries = 'https://humber.ca/hq/api/Academic_equivalency/country_lists';
    $.ajax( {
      method: "GET",
      url: api_countries,
    } ).done( function( data ) {
      for ( var i = 0; i &lt; data.length; i++ ) {
        available_countries.push( data[ i ].name );
      }
      //* Load resource to input fields

      $( "#user_location" ).autocomplete( {
        source: available_countries
      } );
    } );
  }

} )

$( window ).scroll( function( e ) {
  if ( $( ".scroller-anchor" ).length ) {
    var scroller_anchor = $( ".scroller-anchor" ).offset( ).top;
  }
  preventWidgetOverlapFooter( );
  repositionWidgetOnMobile( );

} );

$( document ).on( 'click', function( e ) { //* close tab whenever user click outside of tab area
  if ( $( '.vertical-tabcontent-holder' ).css( 'display' ) == 'block' ) {
    var widgetContent = $( '.vertical-tablinks, a.tablinks,  .vertical-tabcontent-holder, .ui-autocomplete' );

    if ( $( window ).width( ) &gt; mobileSize ) { //* apply to larger screen
      if ( !widgetContent.is( e.target ) &amp;&amp; ( widgetContent.has( e.target ).length === 0 ) ) {
        $( '.vertical-tab' ).find( '.close-vertical-tabcontent' ).trigger( 'click' );
      }
    }
  }

} );

//* End Window event

$( function( ) {
  // if ( typeof( unavailableProgramMessage ) !== 'undefined' ) {
  //   $( '.unavailable-program-message' ).html( "&lt;div class='alert alert-dismissible mb-0 fade show' role='alert' style='background-color:#e26f81;'&gt;" + unavailableProgramMessage + "&lt;button type='button' class='close' data-dismiss='alert' aria-label='Close'&gt;&lt;span aria-hidden='true'&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;" );
  // }
  lastWidgetPos = 0;
  pathWayTabArrow( );
  showProgramAvailabilityOnSm( );
  setTimeout( WidgetOnScreenState( ), 500 );
  repositionWidgetOnMobile( );
  if ( $( '.vertical-tab' ).length ) {
    showToolTip( );
    //* Show tab content when url including #
    var hashIt = new HashStack( 2, false );
    var currentHash = hashIt.get( );
    if ( currentHash ) {
      var targetedTab = $( '.vertical-tab .vertical-tablinks a[href="#' + currentHash + '"]' );
      setTimeout( showTab( targetedTab ), 300 );
    }

    $( '.vertical-tab .vertical-tablinks' ).on( 'click', 'a', function( e ) {
      if ( !$( this ).hasClass( 'disabled-tabs' ) ) {
        ga( 'send', 'event', 'Button', 'Click', $( this ).attr( 'href' ) + ' widget tab - ' + program_name );
        if ( $( this ).attr( 'href' ) == '#go-to-apprentice-link' ) {
          $( '.vertical-tab-overlay, .vertical-tabcontent-holder, .vertical-tabcontent' ).css( 'display', 'none' );
          e.preventDefault( );
          window.location.href = 'https://humber.ca/admissions/apply/apprenticeships.html';
        } else {
          e.preventDefault( );
        }

        if ( $( '.vertical-tab' ).hasClass( 'mobile-widget' ) ) {
          $( '#arrow-helptext-sm' ).hide( );
          if ( !$( '.vertical-tab' ).hasClass( 'horizontal-tab' ) ) {
            lastWidgetPos = $( window ).scrollTop( );
            $( '.vertical-tab' ).addClass( 'horizontal-tab' ).css( {
              'height': '100%'
            } );
            fixScrollOnAbsolutePos( );
          }
          $( '.vertical-tabcontent-holder' ).css( {
            'display': 'block',
            'float': 'right',
            'height': 'calc(100vh - 50px)',
            'padding': '25px'
          } );
        } else {
          $( '.vertical-tabcontent-holder' ).css( {
            'height': 'auto',
            'padding-bottom': '25px',
            'float': 'left'
          } );
          $( '.vertical-tab' ).removeClass( 'horizontal-tab' );
        }
        showTab( $( this ) );
        fixWidgetOnSmallHeightScreen( );
      }
    } );

    $( '.vertical-tab' ).on( 'click', '.close-vertical-tabcontent', function( e ) {
      e.preventDefault( );
      $( '.vertical-tab a' ).removeClass( "active" );
      $( '.vertical-tab' ).removeClass( 'horizontal-tab' );
      restoreWidgetPos( );
      $( '.vertical-tabcontent-holder' ).hide( );
      $( '.vertical-tabcontent' ).hide( );
      $( '.vertical-tab-overlay' ).removeClass( "active" );
      $( '.vertical-tab-overlay' ).removeClass( "fixed" );
      stopBodyScrollingOnMobile( false );
      $( '.vertical-tab' ).css( 'width', 'auto' );
      repositionWidgetOnMobile( );
    } );

    //detect location
    $( '.vertical-tabcontent-holder' ).on( 'click', '#findLocation', function( ) {
      $( '.countryAddmissionReq' ).html( '' );
      $.ajax( {
        method: "GET",
        url: 'https://humber.ca/site-config/get-location.html',
      } ).done( function( data ) {
        var country = $( data ).text( );
        $( "input[name='user_location']" ).val( country );
        $( '.vertical-tabcontent-holder' ).find( '#showCountryAddmissionReq' ).trigger( 'click' );
      } )
    } );

    $( '.vertical-tabcontent-holder' ).on( 'click', '#showCountryAddmissionReq', function( ) {
      $( '.countryAddmissionReq' ).html( '' );
      var degree_requirement_title = '&lt;p&gt;&lt;strong&gt;Admission to a Bachelorâ€™s Degree program&lt;/strong&gt;&lt;/p&gt;';
      var diploma_requirement_title = '&lt;p&gt;&lt;strong&gt;Admission to a Diploma program&lt;/strong&gt;&lt;/p&gt;';
      var graduate_requirement_title = '&lt;p&gt;&lt;strong&gt;&lt;span xss="removed"&gt;Admission to a Graduate Certificate program&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;';
      var college_certificate_title = '&lt;p&gt;&lt;strong&gt;&lt;span xss="removed"&gt;Admission to a Ontario College Certificate program&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;';
      var academic_equivalencies_requirements = '';
      //*default text
      var academic_degree_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible you must possess the equivalent of an Ontario Secondary School Diploma (OSSD) and required courses as noted in the course list.&lt;/em&gt;&lt;/p&gt;';
      var academic_diploma_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible you must possess the equivalent of an Ontario Secondary School Diploma (OSSD) and required courses as noted in the course list.&lt;/em&gt;&lt;/p&gt;';
      var academic_graduate_default_txt = '&lt;p&gt;&lt;em&gt;To be eligible for admission you must possess a bachelorâ€™s degree or advanced diploma.&lt;/em&gt;&lt;/p&gt;';

      var userCountry = $.trim( $( "input[name='user_location']" ).val( ).toLowerCase( ) );
      if ( userCountry ) {
        $.ajax( {
          method: "GET",
          url: 'https://humber.ca/hq/api/Academic_equivalency/country/' + userCountry,
          success: function( data ) {
            var academic_equivalencies_requirements = '';

            if ( data.length &gt; 0 || data !== "" ) {

              if ( data.requirements_diploma === null &amp;&amp; data.requirements_degree === "" ) {
                academic_equivalencies_requirements = '&lt;p&gt;Detection is showing that you are in Canada and will not work. Please type in your country of origin. If Canadian, use the Academic Requirements on the left.';
              } else {
                if ( program_type.search( 'Diploma' ) &gt; -1 ) {
                  academic_equivalencies_requirements = ( data.requirements_diploma === null || data.requirements_diploma === '' ) ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : diploma_requirement_title + data.requirements_diploma + academic_diploma_default_txt;
                } else if ( program_type.search( 'Ontario Graduate Certificate' ) &gt; -1 || program_type.search( 'Preparatory Semester' ) &gt; -1 ) {
                  academic_equivalencies_requirements = ( data.requirements_graduate === null || data.requirements_graduate === '' ) ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : graduate_requirement_title + data.requirements_graduate + academic_graduate_default_txt;
                } else if ( program_type.search( 'Ontario College Certificate' ) &gt; -1 ) {
                  academic_equivalencies_requirements = ( data.requirements_diploma === null || data.requirements_diploma === '' ) ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : college_certificate_title + data.requirements_diploma + academic_diploma_default_txt;
                } else if ( program_type.search( 'Degree' ) &gt; -1 ) {
                  academic_equivalencies_requirements = ( data.requirements_degree === null || data.requirements_degree === '' ) ? '&lt;p&gt;No requirements found for this country&lt;/p&gt;' : degree_requirement_title + data.requirements_degree + academic_degree_default_txt;
                } else {
                  academic_equivalencies_requirements = '';
                }
              }
              academic_equivalencies_requirements += '&lt;p&gt;&lt;strong&gt;International applicants may be asked to submit an ICAS or WES evaluation.&lt;/strong&gt;&lt;/p&gt;';

            } else {

              academic_equivalencies_requirements = '&lt;p&gt;No requirements found for this country.&lt;/p&gt;';

            }


            $( '.countryAddmissionReq' ).html( academic_equivalencies_requirements );
          },
          error: function( e ) {
            if ( e.status === 400 ) {
              $( '.countryAddmissionReq' ).html( '&lt;p&gt;Requirements are not available for this country.&lt;/p&gt;' );
            }
          }
        } );
      } else {
        $( '.vertical-tabcontent-holder' ).find( '#findLocation' ).trigger( 'click' );
      }
    } );
  }
  if ( $( '.page-loader-icon' ).length ) {
    setTimeout( function( ) { $( '.page-loader-icon' ).hide( ); }, 500 );
  }

} );
/****** Vertical Tabs Ends ********/




/****** Imported from humber-corporate-menu.js ***/

$( document ).ready( function( ) {
  $( document ).on( 'click', '.refundLink', function( e ) {
    e.preventDefault( );
    var content = $( this ).attr( 'data-content' );
    $.fancybox( {
      'content': content,
      'maxWidth': 1170,
      'height': 'auto',
      'autoSize': false
    } );
  } );

  $( 'body' ).on( 'click', '.program-date-select', function( ) {
    if ( $( this ).val( ).length &gt; 0 ) {
      window.location = window.location.pathname + '?year=' + $( this ).val( );
    } else {
      window.location = window.location.pathname;
    }
  } );


  //local storage solution to close the humber corporate alert
  //if a change in the alert is detected php will insert some js to clear the flag
  //var object = {value: 0, expires: 0}//clear local storage - for testing
  //localStorage.setItem('humberCorporateAlertClosed', JSON.stringify(object));//clear local storage - for testing
  var humberCorporateAlertClosed = JSON.parse( localStorage.getItem( 'humberCorporateAlertClosed' ) );

  if ( humberCorporateAlertClosed ) {
    var humberCorporateAlertClosedExpires = humberCorporateAlertClosed.expires;
    var now = new Date( ).getTime( ).toString( );

    //check and clear expires if needed
    if ( humberCorporateAlertClosedExpires &lt; now ) {
      var object = { value: 0, expires: 0 }
      localStorage.setItem( 'humberCorporateAlertClosed', JSON.stringify( object ) );
      $( '.humber-corporate-alert' ).show( );
    } else {
      //ntd - alert is hidden from css
    }

    //reload var
    humberCorporateAlertClosed = JSON.parse( localStorage.getItem( 'humberCorporateAlertClosed' ) );

    if ( humberCorporateAlertClosed.value == 1 ) {
      //ntd - alert should be hidden from css
    } else {
      $( '.humber-corporate-alert' ).show( );
    }

  } else {
    //alert should show by default if local storage empty
    $( '.humber-corporate-alert' ).show( );
  }
  $( '.humber-corporate-alert-close-btn' ).click( function( e ) {
    e.preventDefault( );
    $( '.humber-corporate-alert' ).hide( );
    var object = { value: 1, expires: new Date( ).getTime( ) + 24 * 3600000 }
    //var object = {value: 1, expires: new Date().getTime()}
    localStorage.setItem( 'humberCorporateAlertClosed', JSON.stringify( object ) );
  } );

  $( 'body' ).click( function( ) {
    if ( $( 'form input[type="search"]' ).width( ) &gt; 0 ) {
      if ( !$( 'form input[type="search"]' ).is( ':focus' ) ) {
        $( 'form#search-form input[type="search"]' ).css( {
          'width': '0',
          'padding': '0',
          'margin': '0',
          'border': 'none'
        } );
      }
    }
  } );

  $( 'body' ).on( 'click', '.id-modal', function( e ) {
    e.preventDefault( );
    var content = $( $( this ).attr( 'href' ) ).html( );
    $.fancybox( {
      'content': content,
      'autoSize': false,
      'height': 'auto',
      beforeLoad: function( ) {
        if ( $( window ).width( ) &gt; 979 ) {
          this.width = '50%';
        }
      }
    } );
  } );

  $( "#inputCanadianCitizen" ).on( 'change', function( ) {
    var val = this.value;
    if ( val === "No" ) {
      $( ".contact-destination" ).hide( );
    } else {
      $( ".contact-destination" ).show( );
    }
  } );

  $( '.collapsed-program-data' ).remove( );
  $( window ).resize( function( ) {
    if ( $( window ).width( ) &lt;= 970 ) {
      $( '.program-details-data-wrp .program-details-data' ).hide( );
    } else {
      $( '.collapsed-program-data' ).remove( );
    }
  } );

  /**************** program details functionality (Remove it after bringing over vertical tabs widget) ********/
  if ( $( '.SectionGenericBlockItem-SchoolProgramDetails' ).length ) {
    $( '.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li a' ).on( 'click', function( e ) {
      var $target = $( $( this ).attr( 'href' ) );
      if ( $( window ).width( ) &lt;= 970 ) {
        if ( $( this ).parent( ).hasClass( 'active' ) ) {
          $( this ).parent( ).next( ).slideUp( );
          $( this ).parent( ).removeClass( 'active' );
        } else {
          $( '.program-details-data' ).slideUp( );
          $( this ).parent( ).after( $( $target ).clone( ).addClass( 'collapsed-program-data' ) );
          $( this ).parent( ).next( ).slideDown( );
          $( '.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li a' ).parent( ).removeClass( 'active' );
          $( this ).parent( ).addClass( 'active' );
        }
      } else {
        if ( $( this ).parent( ).hasClass( 'active' ) ) {
          $( $( this ).attr( "href" ) ).toggleClass( 'active' );
          $( '.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li' ).removeClass( 'active' );
          $( '.tab-pane' ).slideUp( 'fast' );
          e.preventDefault( );
          e.stopPropagation( );
        } else {
          //open
          $( '.SectionGenericBlockItem-SchoolProgramDetails .nav-tabs li' ).removeClass( 'active' );
          $( this ).parent( ).addClass( 'active' );
          $( '.tab-pane' ).slideUp( 'fast' );
          setTimeout( function( ) { $target.slideDown( 'fast' ); }, 200 );
        }
      }
    } );
  }
  /************************************************************************************************************/

  $( ".popout-btn" ).click( function( ) {
    var thisbtn = $( this );
    var content = $( this ).data( "content" );

    if ( !$( "." + content ).hasClass( "showing" ) ) {
      $( "." + content ).addClass( "showing" ).slideDown( "fast" );
      arrowUp( thisbtn );
      $( 'html,body' ).animate( {
        scrollTop: $( "." + content ).offset( ).top - 100
      }, 1000 );
      equalDivs( ".equal-divs .card" );
      equalDivs( ".equal-wells .card" );
    } else {
      $( "." + content ).removeClass( "showing" ).slideUp( "fast" );
      arrowDown( thisbtn );
    }
  } );
  $( document ).on( 'click', '.popout-exclusive-btn', function( e ) {
    e.preventDefault();
    e.stopPropagation( );
    console.log('faculty script');
    var thisbtn = $( this );
    var content = $( this ).attr( "data-content" );

    if ( !$( "." + content ).hasClass( "showing" ) ) {
      $( ".popout-content" ).removeClass( "showing" ).slideUp( "fast" );
      $( "." + content ).addClass( "showing" ).slideDown( "fast" );
      if ( $( ".clicked" ).length ) {
        arrowDown( $( '.clicked' ) );
        arrowUp( thisbtn );
      } else {
        arrowUp( thisbtn );
        if ( $( "." + content ).offset( ).top ) {
          $( 'html,body' ).animate( {
            scrollTop: $( "." + content ).offset( ).top - 100
          }, 500 );
        }
      }
      equalDivs( ".equal-divs .card" );
      equalDivs( ".equal-wells .card" );
    } else {
      $( ".popout-content" ).removeClass( "showing" ).slideUp( "fast" );
      arrowDown( thisbtn );
    }
  } );

  $( ".collapse-btn" ).on( 'click', function( e ) {
    var prevSection = $( this ).parent( ).closest( "section" ).prev( ).offset( ).top;
    $( this ).parent( ).closest( "section" ).slideUp( ).removeClass( "showing" );
    $( 'html,body' ).animate( {
      scrollTop: prevSection - 100
    }, 1000 );
    //arrowDown( $( '.clicked' ) );

    let relativeBtn = $(`a[data-content="${$( this ).parent( ).closest( "section" ).attr('id')}"]`);
    arrowDown( relativeBtn );
  } );

  $( 'body' ).on( 'click', '.open-secondary', function( e ) {
    e.preventDefault( );
    var href = $( this ).attr( 'href' );
    var offset = $( '.SectionGenericBlockItem-SchoolProgramDetails' ).offset( ).top + $( '.SectionGenericBlockItem-SchoolProgramDetails' ).height( );
    if ( $( this ).hasClass( "clicked" ) ) {
      $( '.close-secondary' ).parents( 'section' ).hide( );
      $( this ).removeClass( "clicked" );
    } else {
      $( href ).show( );
      $( 'html,body' ).animate( {
        scrollTop: offset
      }, 500 );
      $( this ).addClass( "clicked" );
    }
  } );

  $( '.close-secondary' ).click( function( e ) {
    e.preventDefault( );
    $( this ).parents( 'section' ).hide( );
    $( '.open-secondary' ).removeClass( "clicked" );
  } )

  function arrowUp( button ) {
    button.find('em').removeClass('icon-chevron-down').addClass(' icon-chevron-up clicked');
  }

  function arrowDown( button ) {
    button.find('em').removeClass('icon-chevron-up clicked').addClass(' icon-chevron-down');
  }

//   var notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/custom_groups/1_3';
//   if ( window.location.href.indexOf( "humber.ca/realestate" ) &gt; -1 ) {
//     notifications_url = window.location.protocol + '//humber.ca/hq/api/notifications/index/group/2';
//   }
//
//   $.ajax( {
//     method: "GET",
//     url: notifications_url,
//   } ).done( function( notifications ) {
//     var $latestNotification;
//     var totalNumberOfNotifications = notifications.length;
//     var numberOfUnseenNotifications;
//     if ( typeof( $.cookie( 'last_viewed_notification' ) ) !== 'undefined' ) {
//       $.each( notifications, function( key, notification ) {
//         if ( notification.id == $.cookie( 'last_viewed_notification' ) ) {
//           var isSlider = ( notifications[ key + 1 ] ?
//             ( notifications[ key + 1 ].notification_location != "2" ? 1 : 0 ) :
//             0 )
//           $latestNotification = isSlider ? notifications[ key + 1 ] : undefined;
//           numberOfUnseenNotifications = totalNumberOfNotifications - ( key + 1 );
//           return false;
//         } else {
//           if ( $latestNotification == undefined ) {
//             $latestNotification = ( notifications[ key ] ?
//               ( notifications[ key ].notification_location != "2" ? notifications[ key ] : undefined ) :
//               undefined );
//             numberOfUnseenNotifications = totalNumberOfNotifications;
//           }
//         }
//       } );
//     } else {
//
//       $.each( notifications, function( key, notification ) {
//         if ( $latestNotification == undefined ) {
//
//           $latestNotification = ( notifications[ key ] ?
//             ( notifications[ key ].notification_location != "2" ? notifications[ key ] : undefined ) :
//             undefined );
//           numberOfUnseenNotifications = totalNumberOfNotifications;
//         }
//       } );
//
//     }
//
//     if ( $latestNotification !== undefined ) {
//       $( 'body' ).append( '&lt;div class="notification-popup"&gt;&lt;div class="notification-image"&gt;&lt;img alt="notification icon" src="//humber.ca/assets/images/notifications/' + $latestNotification.icon + '"&gt;&lt;/div&gt;&lt;div class="notification-details"&gt;&lt;div class="close-notification"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="30" height="30" viewBox="0 0 252 252" style=";fill:#000000;" class="icon icons8-cancel"&gt;&lt;g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"&gt;&lt;path d="M0,252v-252h252v252z" fill="none"&gt;&lt;/path&gt;&lt;g id="Layer_1"&gt;&lt;path d="M236.25,126c0,60.88425 -49.36575,110.25 -110.25,110.25c-60.88425,0 -110.25,-49.36575 -110.25,-110.25c0,-60.88425 49.36575,-110.25 110.25,-110.25c60.88425,0 110.25,49.36575 110.25,110.25z" fill="#000000"&gt;&lt;/path&gt;&lt;path d="M155.694,81.459l14.847,14.847l-74.235,74.235l-14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;path d="M170.541,155.694l-14.847,14.847l-74.235,-74.235l14.847,-14.847z" fill="#ffffff"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;' + $latestNotification.description + '&lt;a class="read-all-alerts-btn" href="https://humber.ca/alerts.html" title="Alerts and Notifications"&gt;Read all alerts &lt;em style="font-size:12px;" class="icon-chevron-right"&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;' );
//
//       $( '.alerts-icon' ).attr( 'id', 'alert-icon' );
//       $( '.alerts-icon' ).data( 'alert_number', numberOfUnseenNotifications );
//       $( '.alerts-icon' ).html( '&lt;div class="alert-number"&gt;' + numberOfUnseenNotifications + '&lt;/div&gt;&lt;span&gt;Alerts&lt;/span&gt;' );
//
//       setTimeout( function( ) { $( '.notification-popup' ).css( 'right', '0px' ); }, 50 );
//
//       $( '.close-notification' ).on( 'click', function( ) {
//         $( '.notification-popup' ).css( 'right', '-1000%' );
//         $.cookie( 'last_viewed_notification', $latestNotification.id, { expires: 30, path: '/' } );
//         var numberOfUnseenNotificationsLeft = $( '.humber-corporate-menu-side-items-list' ).find( '#alert-icon' ).data( 'alert_number' ) - 1;
//         if ( numberOfUnseenNotificationsLeft ) {
//           $( '.humber-corporate-menu-side-items-list' ).find( '#alert-icon div.alert-number' ).html( numberOfUnseenNotificationsLeft );
//         } else {
//           $( '.humber-corporate-menu-side-items-list' ).find( '#alert-icon' ).html( '&lt;img src="https://humber.ca/assets/images/notification_alerts.png" alt="Alerts and Notifications icon" width="35"&gt;&lt;span&gt;Alerts&lt;/span&gt;' );
//         }
//
//       } );
//     } else {
//       if ( numberOfUnseenNotifications ) {
//         $( '.alerts-icon' ).attr( 'id', 'alert-icon' );
//         $( '.alerts-icon' ).data( 'alert_number', numberOfUnseenNotifications );
//         $( '.alerts-icon' ).html( '&lt;div class="alert-number"&gt;' + numberOfUnseenNotifications + '&lt;/div&gt;&lt;span&gt;Alerts&lt;/span&gt;' );
//       } else {
//         $( '.alerts-icon' ).html( '&lt;img src="https://humber.ca/assets/images/notification_alerts.png" alt="Alerts and Notifications icon" width="35"&gt;&lt;span&gt;Alerts&lt;/span&gt;' );
//       }
//     }
//   } );

  /******************* Curricullum program btns ******************/
  $( document ).on( 'click', '.program-btns', function( e ) {
    setTimeout( function( ) { equalDivs( ".semester-pair .semester-group" ); }, 100 );
  } );


  /* AJAX CURRICULUM IN PROGRAM PAGE */
  $( document ).on( 'click', '.get-curr-info-btn', function( e ) {
    e.preventDefault( );
    $.ajax( {
      method: 'GET',
      url: $( this ).attr( 'href' ),
      error: function( xhr, error, thrown ) {
        $.fancybox( {
          'content': "&lt;p&gt;The requested content cannot be loaded. Please try again later.&lt;/p&gt;",
          'maxWidth': 1170,
          'height': 'auto',
          'autoSize': true
        } );
      },
      success: function( data ) {
        $.fancybox( {
          'content': data,
          'maxWidth': 1170,
          'height': 'auto',
          'autoSize': true
        } );
      }
    } );
  } );
  /* END OF AJAX CURRICULUM IN PROGRAM PAGE */

} );

$( document ).on( 'click', '.notification-block .read-more-link[href=\"#\"]', function( e ) {
  e.preventDefault( );
  console.log( 'click' );
  var parentDesc = $( this ).parents( '.notification-block-details' );
  if ( parentDesc.hasClass( 'active' ) ) {
    parentDesc.removeClass( 'active' );
    $( this ).html( 'Read More &lt;em class=\"icon-chevron-down\"&gt;&lt;/em&gt;' );
  } else {
    parentDesc.addClass( 'active' );
    $( this ).html( 'Read Less &lt;em class=\"icon-chevron-up\"&gt;&lt;/em&gt;' );
  }
} );

/* used for program avaialabilty **/
$( document ).ready( function( ) {

  $( document ).on( 'click', '.class_tab__links',  function( ) {
    var parentTab = $( this ).closest( '.class_tab' );
    var contentToShow = $( this ).data( 'content' );
    parentTab.find( '.class_tab__links, .class_tab__content' ).removeClass( 'active' );
    $( this ).addClass( 'active' );
    parentTab.find( '.class_tab__content.tabcontent--' + contentToShow ).addClass( 'active' );
    console.log('click');
  } );

  /***** .side-img-text-widget ******/
  var sideWidgetOpenStageAddAt = 700;
  var lastScrollTop = 0;

  if ( $( ".scroller-anchor" ).length ) {
    sideWidgetOpenStageAddAt = $( ".scroller-anchor" ).offset( ).top;
  }
  sideWidgetOpenStageAddAt = $( document ).scrollTop( ) &gt; sideWidgetOpenStageAddAt ? $( document ).scrollTop( ) : sideWidgetOpenStageAddAt;

  $( document ).scroll( function( ) {
    var documentTop = $( document ).scrollTop( );
    // console.log(documentTop + '  -- ' + sideWidgetOpenStageAddAt);
    // console.log((documentTop - sideWidgetOpenStageAddAt) &gt; 100);

    if ( documentTop &gt; lastScrollTop ) {
      if ( ( documentTop - sideWidgetOpenStageAddAt ) &gt; 100 ) {
        $( ".side-img-text-widget" ).removeClass( 'open-stage' );
      }
    } else {
      if ( ( sideWidgetOpenStageAddAt - documentTop ) &gt; 100 ) {
        $( ".side-img-text-widget" ).removeClass( 'open-stage' );
      }
    }
    lastScrollTop = documentTop &lt;= 0 ? 0 : documentTop;

  } );
  $( ".side-img-text-widget" ).on( 'hover', function( ) {
    $( ".side-img-text-widget" ).addClass( 'open-stage' );
    sideWidgetOpenStageAddAt = $( document ).scrollTop( );
  } );
  /***** .side-img-text-widget ******/
} );</pre></body></html>