+ // Constructs the URL for a client which connects to the connection
+ // with the given id.
+ function getClientURL(id) {
+
+ // Get parameters from query string
+ var parameters = window.location.search.substring(1);
+
+ // Construct URL for client, including any additional
+ // parameters from the query string
+ var client_url = "client.xhtml?id=" + encodeURIComponent(id);
+ if (parameters) client_url += "&" + parameters;
+
+ return client_url;
+
+ }
+
+ // Resets the interface such that the login UI is displayed if
+ // the user is not authenticated (or authentication fails) and
+ // the connection list UI (or the client for the only available
+ // connection, if there is only one) is displayed if the user is
+ // authenticated.