var elearning_school_keyboard_navigation_loop = function (elem) {
  var elearning_school_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var elearning_school_firstTabbable = elearning_school_tabbable.first();
  var elearning_school_lastTabbable = elearning_school_tabbable.last();
  elearning_school_firstTabbable.focus();

  elearning_school_lastTabbable.on('keydown', function (e) {
    if ((e.which === 9 && !e.shiftKey)) {
      e.preventDefault();
      elearning_school_firstTabbable.focus();
    }
  });

  elearning_school_firstTabbable.on('keydown', function (e) {
    if ((e.which === 9 && e.shiftKey)) {
      e.preventDefault();
      elearning_school_lastTabbable.focus();
    }
  });

  elem.on('keyup', function (e) {
    if (e.keyCode === 27) {
      elem.hide();
    };
  });
};