var electrician_services_Keyboard_loop = function (elem) {
  var electrician_services_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var electrician_services_firstTabbable = electrician_services_tabbable.first();
  var electrician_services_lastTabbable = electrician_services_tabbable.last();
  electrician_services_firstTabbable.focus();

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

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

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