         window.location.hash = @startPage
 
     @session.connect $('#jid').val(), $('#password').val(), callback
+    false
 
   draw: ->
     @session.disconnect()

        <fieldset id="login-form-controls">
          <input id="jid" name="jid" type="email" maxlength="1024" value="#{jid}" placeholder="Your user name"/>
          <input id="password" name="password" type="password" maxlength="1024" placeholder="Your password"/>
          <input id="start" type="button" value="Start Chat"/>
        </fieldset>
        <p id="error" style="display:none;">User name and password not found.</p>
      </form>
    """).appendTo '#container'
    $('#start').click => this.start()
    $('#container').fadeIn 1000
    this.resize()

  resize: ->

  start: ->
    $('#error').hide()
    callback = (success) =>
      unless success
        @session.disconnect()
        $('#error').show()
        $('#password').val('').focus()
        return

      localStorage['jid'] = $('#jid').val()
      $('#current-user-name').text @session.bareJid()
      $('#current-user-avatar').attr 'src', @session.avatar(@session.jid())
