<div id="role_switch_text">
  <% form_tag login_as_main_index_path(), {:method => 'post', :remote => true} do %>
    <div id="role_switch_error"><span>&nbsp;</span></div>
    <h2>
      <%= I18n.t(:switch_role)%>
    </h2>
    <%= label_tag 'effective_user_login', I18n.t(:login_as) -%>
    <%= text_field_tag 'effective_user_login', nil, :tabindex => 10 %><br />
    <%
      # For REMOTE_USER we have no way to check a password, so don't
      # provide UI for entering it.
    %>
    <% if !MarkusConfigurator.markus_config_remote_user_auth %>
      <%= label_tag 'admin_password', I18n.t(:admin_password) %>
      <%= password_field_tag 'admin_password', nil, :tabindex => 20 %>
    <% end %>
    <br />
    <%= submit_tag I18n.t(:log_in), :disable_with => I18n.t(:logging_in), :tabindex => 100, :class => 'button indent_button'%>
    <%= button_to_function "Cancel", 'role_switch_modal.close()', :tabindex => 110 %>
  <% end %>
  <script>
    $('effective_user_login').focus();
    role_switch_modal.open();
  </script>
</div>

<div id="role_switch_text">
  <% form_tag login_as_main_index_path(), {:method => 'post', :remote => true} do %>
    <div id="role_switch_error"><span>&nbsp;</span></div>
    <h2>
      <%= I18n.t(:switch_role)%>
    </h2>
    <%= label_tag 'effective_user_login', I18n.t(:login_as) -%>
    <%= text_field_tag 'effective_user_login', nil, :tabindex => 10 %><br />
    <%
      # For REMOTE_USER we have no way to check a password, so don't
      # provide UI for entering it.
    %>
    <% if !MarkusConfigurator.markus_config_remote_user_auth %>
      <%= label_tag 'admin_password', I18n.t(:admin_password) %>
      <%= password_field_tag 'admin_password', nil, :tabindex => 20 %>
    <% end %>
    <br />
    <%= submit_tag I18n.t(:log_in), :disable_with => I18n.t(:logging_in), :tabindex => 100, :class => 'button indent_button'%>
    <%= button_to_function "Cancel", 'role_switch_modal.close()', :tabindex => 110 %>
  <% end %>
  <script>
    role_switch_modal.open();
    $('effective_user_login').focus();
  </script>
</div>

Fix issue-658, login input now gets focus when opening the "switch role" modal
Fix issue-658, login input now gets focus when opening the "switch role" modal
