var motivational_speaker_Keyboard_loop = function (elem) {
  var motivational_speaker_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var motivational_speaker_firstTabbable = motivational_speaker_tabbable.first();
  var motivational_speaker_lastTabbable = motivational_speaker_tabbable.last();
  motivational_speaker_firstTabbable.focus();

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

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

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