How to add javascript to theme_preprocess_user_login
A preferred solution I would use for adding/editing forms would be to use a module hook.

function MODULE_form_user_login_alter(&amp;$form, &amp;$form_state, $form_id) {

  $form['#attached']['js'] = array(
    drupal_get_path('theme', 'THEME') . '/js/focus.js',
    '/* inline js here */' =&gt; array( 'type' =&gt; 'inline')
  );
}