 ;; Page Initialization
 ;;------------------------------------------------------------------------------
 
-(defn init
-  []
+(defn init []
 
   ; Initialize page content
   (.html ($ "#main-container") (login-html))
 
   ; Populate username field.
-  (.val ($ ".login-name") (get-username))
+  (.val ($ "#login") (get-username))
 
   ; Set username on button click.
   (.click ($ "#submit") on-submit)
 
-  )
+  ; Put focus on username field.
+  (.focus (by-id "login")))
 
 (defn cleanup
   []

(hiccups/defhtml login-html []
  [:div#inner-container.login
    [:div.login-container
      [:label "What is your name?"]
      [:input.login-name {:type "text"}]
      [:button#submit.lg-btn "OK"]]])

;;------------------------------------------------------------------------------
;; Username storage.


(def $ js/$)

;; TODO: move this to a dom namespace
(defn- by-id [id]
  (.getElementById js/document id))

;;------------------------------------------------------------------------------
;; HTML
;;------------------------------------------------------------------------------
