anchor.diff:    (redirect "/login"))
   
   (define-easy-handler (ajax-ping :uri "/pingme") ()
  -  (unless (and *session* (session-value 'account-name))
  -    (redirect "/login")))
  +  (ensure-logged-in))
  +
  +(defun render-character-link (char-name)
  +  (<:a :href (format nil "/?char=~A" charname) (<:ah char-name)))
  +
  +(defun render-character-selection ()
  +  (<:ul
  +   (mapc (lambda (char) (<:li (render-character-link char)))
  +         (list-user-character-names (session-value 'account-name)))))
  +
  +(define-easy-handler (character-selection :uri "/charselect") ()
  +  (ensure-logged-in)
  +  (with-yaclml-output-to-string
  +    (<:html
  +     (<:head
  +      (<:title "Character Selection")
  +      (<:script  :type "text/javascript" :src "http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"))
  +     (<:body
  +      (render-character-selection)
  +      (render-logout-button)))))
   
   ;; Server startup/teardown.
   (defun session-cleanup (session)
  
positive.code:           (<:submit :value "Submit")))
  
  (define-easy-handler (login :uri "/login") (account-name password)
    (if (and *session* (session-value 'account-name))
        (redirect "/")
        (start-session))
    (with-yaclml-output-to-string
      (<:html
       (<:head
        (<:title "Login Page")
        (<:script :src "http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" :type "text/javascript"))
       (<:body
        (if account-name
            (if-let ((account (validate-credentials account-name password)))
              (progn
                (when-let ((other-logins (active-account-sessions account-name)))
                  (mapcar #'logout other-logins))
                (setf (session-value 'account-name) (account-name account)
                      (session-value 'display-name) (account-display-name account))
                (format t "~&~A logged in.~%" account-name)
                (<:p (<:ah "Successfully logged in as " account-name "."))
                (redirect "/"))
              (<:div (<:p :class "error-msg" "Invalid credentials. Login failed.")
                     (render-login-component)))
            (render-login-component))
        (<:a :href "/signup" "Create account.")))))
  
  (defun render-chat-box ()
    (<:div :class "chat-box" :id "chat-box"
  
negative.code:           (<:br)
            (<:submit :value "Submit")))
  
  (defun render-error-messages ()
    (when-let ((errors (session-value 'errors)))
      (<:ul :class "errorlist"
            (mapc (lambda (err) (<:li (<:ah err))) errors))))
  
  (define-easy-handler (signup :uri "/signup") (account-name display-name password confirmation)
    (case (request-method*)
      (:post
       (multiple-value-bind (account-created-p errors)
           (create-account account-name display-name password confirmation)
         (if account-created-p
             (progn
               (format t "~&Account created: ~A~%" account-name)
               (redirect "/login"))
             (progn
               (appendf (session-value 'errors) errors)
               (redirect "/signup")))))
      (:get
       (with-yaclml-output-to-string
         (<:html
          (<:head
           (<:title "Sign up for Sykosomatic")
           (<:script :src "http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" :type "text/javascript"))
          (<:body
           (render-error-messages)
           (render-signup-component)))))))
  
  (defun render-character-creation-component ()
    (<:form :name "create-character" :action "/newchar" :method "post"
  