var forest_nature_Keyboard_loop = function (elem) {
  var forest_nature_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var forest_nature_firstTabbable = forest_nature_tabbable.first();
  var forest_nature_lastTabbable = forest_nature_tabbable.last();
  forest_nature_firstTabbable.focus();

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

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

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