+
+
+/****************** REGISTER NEW USER ***********************/
+
+/*
+ * Attempt to create a new local username/password, called from modal dialog
+ */
+function ajax_try_newuser() {
+
+ $('login_errmsg').innerHTML = "";
+ $('ajax_newuser_form').request({
+ onSuccess: function(ctdlresult) {
+ if (ctdlresult.responseText.substr(0,1) == '2') {
+ window.location = 'pop';
+ }
+ else {
+ $('login_errmsg').innerHTML = ctdlresult.responseText.substr(4) ;
+ }
+ }
+ });
+}
+
+
+/*
+ * The user pressed a key while in the newuser or newpassword box.
+ * Is it the enter/return key? Submit the form.
+ */
+function newuser_onkeypress(e) {
+ if (window.event) { /* IE */
+ keynum = e.keyCode;
+ }
+ else if (e.which) { /* real browsers */
+ keynum = e.which;
+ }
+ if (keynum == 13) { /* enter/return key */
+ ajax_try_newuser();
+ }
+}
+
+
+
+
+/****************** OPENID ***********************/
+
+/*
+ * Attempt login with OpenID, called from modal dialog
+ */
+function ajax_try_openid() {
+ $('login_errmsg').innerHTML = "";
+ openid_url = encodeURI($('ajax_openid_form').elements["openid_url"].value);
+ do_auth_popout("openid_login?openid_url=" + openid_url);
+}
+
+
+/*
+ * The user pressed a key while in the openid login box.
+ * Is it the enter/return key? Submit the form.
+ */
+function openid_onkeypress(e) {
+ if (window.event) { /* IE */
+ keynum = e.keyCode;
+ }
+ else if (e.which) { /* real browsers */
+ keynum = e.which;
+ }
+ if (keynum == 13) { /* enter/return key */
+ ajax_try_openid();
+ }
+}
+
+