 # BrowserID javascript functions
 
 @browserid = browserid =
+
+  ### PROPERTIES ###
+
   # Public: Path used to verify browserID authentication assertions. Assertions
   # are POSTed to this path.
   loginPath: '/login'

  # Public: This method is called when a user clears their authentication. By
  # default, it reloads the current page.
  onLogout: (data, status, xhr) ->
    alert("Logout result: #{status} #{data}")
    #window.location.reload()

  # Public: This method is called when a user fails to clear their
  # authentication.
  onLogoutError: (xhr, status, err) ->
    alert("Logout #{err} - #{xhr.responseText}")

  # Public: Watches the authentication state and takes action when the user
  # logs in or logs out. This method MUST be called on every page of the

          type: 'POST'
          url: @loginPath
          data: { assertion: assertion }
          success: (data, status, xhr) => @onLogin(data, status, xhr)
          error: (xhr, status, err) => @onLoginError(xhr, status, err)
      onlogout: =>
        $.ajax
          type: 'POST'
          url: @logoutPath
          success: (data, status, xhr) => @onLogout(data, status, xhr)
          error: (xhr, status, err) => @onLogoutError(xhr, status, err)



