+
+function warrant_formtext_hilite()
+{
+ formtext_hilite($("nameid"));
+ formtext_hilite($("emailid"));
+ formsub_hilite($("subid"));
+ formsub_hilite($("cloid"));
+}
+
+
+function j_check_email(email)
+{
+ if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
+ return (true);
+ return (false);
+}
+
+function j_authbox(form)
+{
+ var no;
+
+ if (form.elements['realsub'].value == "chiudi") {
+ $('authbox').style.visibility = "hidden";
+ return (false);
+ }
+
+ if (form.elements['name'].value == '' || j_check_email(form.elements['email'].value) == false)
+ no = new notify(gst, "<br>I campi user e/o e-mail non sono validi;</br> correggeteli per favore.", 1, "chiudi", 280, 100);
+ else {
+ // submit the request
+ token = server_request('mesg', 'warranty',
+ 'cli_name', encodeURIComponent(form.elements['name'].value),
+ 'cli_email', encodeURIComponent(form.elements['email'].value) );
+ if (token == "1") {
+ $('authbox').style.visibility = "hidden";
+ form.elements['name'].value = "";
+ form.elements['email'].value = "";
+ return (false);
+ }
+ }
+
+ return (false);
+}
+
+function authbox(w, h)
+{
+ var box;
+
+ box = $('authbox');
+
+ box.style.zIndex = 200;
+ box.style.width = w+"px";
+ box.style.marginLeft = -parseInt(w/2)+"px";
+ box.style.height = h+"px";
+ box.style.top = parseInt((document.body.clientHeight - h) / 2) + document.body.scrollTop;
+
+ warrant_formtext_hilite();
+
+ box.style.visibility = "visible";
+ $("nameid").focus();
+}