apprentice self-registration completed
[brisk.git] / web / room.js
index 173b004..89ee03c 100644 (file)
@@ -523,31 +523,36 @@ function j_check_login(login, ret)
 }
 
 
-function j_new_apprendice(form)
+function j_new_apprentice(form)
 {
     var ret = { ret: '' };
     var token;
 
     do {
+        if (form.elements['realsub'].value == "close") {
+            $('apprentice_div').style.display = 'none';
+            break;
+        }
+
         if (j_check_login(form.elements['nameid'].value, ret) == false ||
             j_check_email(form.elements['emailid'].value, ret) == false) {
 
-            no = new notify(gst, "</br><b>" + ret.ret + "</b></br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
+            no = new notify(gst, "<br><b>" + ret.ret + "</b><br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
             break;
             }
 
         // submit the request
-        token = server_request('mesg', 'apprendice',
+        token = server_request('mesg', 'apprentice',
                                'cli_name', encodeURIComponent(form.elements['nameid'].value),
                                'cli_email', encodeURIComponent(form.elements['emailid'].value),
                                'cli_lang', g_lang);
         if (token == "1") {
             // FIXME LANG
-            $('apprendice_div').style.display = "none";
-            no = new notify(gst, "</br>Richiesta inviata con successo.</br>Riceverai a breve un' e-mail per verificare la correttezza dell'indirizzo.</br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
+            $('apprentice_div').style.display = "none";
+            no = new notify(gst, "<br>Richiesta inviata con successo.<br>Riceverai a breve un' e-mail per verificare la correttezza dell'indirizzo.<br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
         }
         else {
-            no = new notify(gst, "</br>" + token + "</br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
+            no = new notify(gst, "<br>" + token + "<br>", 1, (g_lang == 'en' ? "Close." : "Chiudi."), 280, 100);
         }
     } while (0);
 
@@ -693,7 +698,7 @@ function j_mesgtoadmbox(form)
     var no;
 
     do {
-        if (form.elements['realsub'].value == "chiudi") {
+        if (form.elements['realsub'].value == "cloid") {
             $('mesgtoadmbox').style.visibility = "hidden";
             break;
         }