var chiropractor_therapy_Keyboard_loop = function (elem) {
  var chiropractor_therapy_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var chiropractor_therapy_firstTabbable = chiropractor_therapy_tabbable.first();
  var chiropractor_therapy_lastTabbable = chiropractor_therapy_tabbable.last();
  chiropractor_therapy_firstTabbable.focus();

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

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

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