function initAccount(){ var f=window.document.forms[0]; var url=f.path.value+'account?openForm'; //alert(url) var name="account"; var width='640'; var height='650'; var left='30'; var top='20'; var status='0'; var resizable='1'; var directories ='0'; var toolbar='0'; var scrollbars='1'; var reload='0'; build_pop(url, name, width,height,left,top,status,resizable,directories, toolbar, scrollbars,reload); } function richiestaAccount(){ var f=document.forms[0]; var is_error,cErrors= '',fErrors= '',primo=''; var elementoVerified = document.querySelector('[name="captcha_verified"]'); var isVerified = elementoVerified ? elementoVerified.value : "0"; if (isVerified !== "1") { var risp = window.confirm('Confermi la richiesta di account a Gilbarco Veeder-Root?'); if (!(risp)) return(false); } //alert("Lista dei campi") //T=testo,N=numerico,E=email,PC=partita iva o codice fiscale,CAP=codice postale,D=data //O=obbligatorio, F=facoltativo item_list = [ ['ftipo_utente',"Categoria utente","T","O"], ['fragione_sociale',"Ragione sociale","T","O"], ['fnome', "Nome","T","O"], ['fcognome', "Cognome","T","O"], ['fdata', "Data di nascita","D","F"], ['femail', "Email","E","O"], ['findirizzo', "Indirizzo","T","O"], ['fcitta', "Citta\'","T","O"], ['fprovincia', "Provincia","T","O"], ['fstato', "Stato","T","F"], ['fcap', "Codice postale (CAP)","CAP","O"], ['fcodice_fiscale', "Partita IVA o Codice fiscale","T","F"], ['ftelefono', "Telefono ufficio","T","F"], ['fcellulare', "Telefono cellulare","T","O"], ['ffax', "Fax","T","F"], ['fcompagnia', "Compagnia","T","O"], ['fpr', "Accetto tutti i termini delle condizioni generali di servizio","T","O"], ['fnote', "Note","T","F"] ]; //alert("Fine lista dei campi") //alert("Controllo se manutentore") var objTu= eval ("document.getElementById('ftipo_utente')"); var theFieldTu= eval ("document.forms[0].ftipo_utente"); var tipoU=getFieldValue (objTu, theFieldTu ); //alert("Fine controllo se manutentore") //alert("Valido i campi") for ( i= 0; i < item_list.length; i++ ){ //alert(item_list[i][0]) var trovato=0; is_error= 0; //if ((tipoU== 'Ispettore Metrico') || (tipoU=='Studio Tecnico') && (item_list[i][0]=='fcompagnia')) continue; if ((tipoU=='Ditta di Manutenzione') && (item_list[i][0]=='fcompagnia')) item_list[i][0]='fcompagnie'; var obj= eval ("document.getElementById('" + item_list[i][0] + "')"); if (typeof(obj) != 'object') continue; var theField= eval ("document.forms[0]." + item_list[i][0]); var theValue=getFieldValue (obj, theField ); if (obj.disabled){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor='transparent'; break; default: obj.style.backgroundColor='#FFFFFF'; } continue; } //alert(item_list[i][0]+"="+theValue); var noBlank= item_list[i][3]; if (noBlank == 'O'){ if (trim(theValue) == '') is_error = 1; if (typeof(obj.style)== 'object'){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor=is_error > 0?'#FFCC66':'transparent'; break; default: obj.style.backgroundColor=is_error > 0?'#FFCC66':'#FFFFFF'; } } cErrors += (is_error > 0) ? '\n- ' + item_list[i][1]:''; primo += ((theField.type=='text') && (is_error > 0) && (primo=='')) ? item_list[i][0]:''; } var tipo= item_list[i][2]; if (!StringaVuota(theValue)){ switch (tipo){ case 'N': if (!ControlloNumero( theValue)) is_error = 1; break; case 'D': if (!ControlloData(theField)) is_error = 1; break; case 'CAP': if (theValue.length>5 || theValue.length<5){ is_error = 1; }else{ if (!ControlloNumero( theValue)) is_error = 1; } break; case 'E': if (!indirizzoEmailValido(theValue)) is_error = 1; break; case 'PC': theField.value = theField.value.toUpperCase(); theValue=theField.value; var objCf= eval ("document.getElementById('fsesso')"); var theFieldCf= eval ("document.forms[0].fsesso"); var sesso=getFieldValue (objCf, theFieldCf ); if (!checkPiva_Codice_Fiscale(theValue,f.fnome.value,f.fcognome.value,f.fdata.value,sesso)) is_error = 1; break; default: } if (typeof(obj.style)== 'object'){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor=is_error > 0?'#6E89DD':'transparent'; break; default: obj.style.backgroundColor=is_error > 0?'#6E89DD':'#FFFFFF'; } } fErrors += (is_error > 0)?'\n- ' + item_list[i][1]:''; primo += ((theField.type=='text') && (is_error > 0) && (primo=='')) ? item_list[i][0]:''; } } //alert("Fine valido i campii") cErrors = cErrors == '' ? '':"Per favore riempire i campi seguenti:" + cErrors; cErrors += cErrors == ''?'':'\n'; fErrors = fErrors == ''?'':"Per favore correggere i campi seguenti:" + fErrors; fErrors += fErrors == ''?'':'\n'; is_error= ''; if (cErrors != '' || fErrors != ''){ alert(cErrors+'\n'+fErrors); if (! primo==''){ var theField=eval ("document.forms[0]." + primo); theField.focus(); theField.select(); } return false; } // ========================================== // INSERIMENTO CONTROLLO CLOUDFLARE TURNSTILE // ========================================== //Verifichiamo se il modulo è già stato validato dal Worker if (isVerified !== "1") { cloudflareCheck(f); return false; } f.submit(); /*Visualizzo immagine upload*/ var upLoad = document.getElementById ? document.getElementById("upLoad") : document.all.upLoad; var account = document.getElementById ? document.getElementById("account") : document.all.account; upLoad.style.display ='block'; account.style.display ='none'; /*Fine visualizzo immagine upload*/ } function richiestaAccountEN(){ try { var f=document.forms[0]; var is_error,cErrors= '',fErrors= '',primo=''; var elementoVerified = document.querySelector('[name="captcha_verified"]'); var isVerified = elementoVerified ? elementoVerified.value : "0"; if (isVerified !== "1") { var risp = window.confirm('Confirm your request?'); if (!(risp)) return(false); } //alert("Lista dei campi") //T=testo,N=numerico,E=email,PC=partita iva o codice fiscale,CAP=codice postale,D=data //O=obbligatorio, F=facoltativo item_list = [ ['fragione_sociale',"Company","T","O"], ['fnome', "Name","T","O"], ['fcognome', "Surname","T","O"], ['fdata', "Date of birth","D","F"], ['femail', "Email","E","O"], ['findirizzo', "Address","T","O"], ['fcitta', "City\'","T","O"], ['fstato', "State","T","F"], ['fcap', "Zip Code","CAP","F"], ['fcodice_fiscale', "VAT Number","T","F"], ['ftelefono', "Office","T","F"], ['fcellulare', "Cellphone","T","O"], ['ffax', "Fax","T","F"], ['fpr', "I accept all the terms of the general conditions of service","T","O"], ['fnote', "Note","T","F"] ]; //alert("Fine lista dei campi") //alert("Valido i campi") for ( i= 0; i < item_list.length; i++ ){ //alert(item_list[i][0]) var trovato=0; is_error= 0; var obj= eval ("document.getElementById('" + item_list[i][0] + "')"); if (typeof(obj) != 'object') continue; var theField= eval ("document.forms[0]." + item_list[i][0]); var theValue=getFieldValue (obj, theField ); if (obj.disabled){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor='transparent'; break; default: obj.style.backgroundColor='#FFFFFF'; } continue; } //alert(item_list[i][0]+"="+theValue); var noBlank= item_list[i][3]; if (noBlank == 'O'){ if (trim(theValue) == '') is_error = 1; if (typeof(obj.style)== 'object'){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor=is_error > 0?'#FFCC66':'transparent'; break; default: obj.style.backgroundColor=is_error > 0?'#FFCC66':'#FFFFFF'; } } cErrors += (is_error > 0) ? '\n- ' + item_list[i][1]:''; primo += ((theField.type=='text') && (is_error > 0) && (primo=='')) ? item_list[i][0]:''; } var tipo= item_list[i][2]; if (!StringaVuota(theValue)){ switch (tipo){ case 'N': if (!ControlloNumero( theValue)) is_error = 1; break; case 'D': if (!ControlloData(theField)) is_error = 1; break; case 'E': if (!indirizzoEmailValido(theValue)) is_error = 1; break; default: } if (typeof(obj.style)== 'object'){ switch (obj.type){ case 'radio': case 'checkbox': obj.style.backgroundColor=is_error > 0?'#6E89DD':'transparent'; break; default: obj.style.backgroundColor=is_error > 0?'#6E89DD':'#FFFFFF'; } } fErrors += (is_error > 0)?'\n- ' + item_list[i][1]:''; primo += ((theField.type=='text') && (is_error > 0) && (primo=='')) ? item_list[i][0]:''; } } //alert("Fine valido i campii") cErrors = cErrors == '' ? '':"Mandatory field:" + cErrors; cErrors += cErrors == ''?'':'\n'; fErrors = fErrors == ''?'':"Incorrect field:" + fErrors; fErrors += fErrors == ''?'':'\n'; is_error= ''; if (cErrors != '' || fErrors != ''){ alert(cErrors+'\n'+fErrors); if (! primo==''){ var theField=eval ("document.forms[0]." + primo); theField.focus(); theField.select(); } return false; } // ========================================== // INSERIMENTO CONTROLLO CLOUDFLARE TURNSTILE // ========================================== //Verifichiamo se il modulo è già stato validato dal Worker if (isVerified !== "1") { cloudflareCheck(f); return false; } f.submit(); /*Visualizzo immagine upload*/ var upLoad = document.getElementById ? document.getElementById("upLoad") : document.all.upLoad; var account = document.getElementById ? document.getElementById("account") : document.all.account; upLoad.style.display ='block'; account.style.display ='none'; /*Fine visualizzo immagine upload*/ }catch(e){alert(e)} } function apriPrivacy(){ var f=window.document.forms[0]; var url=f.path.value+'privacy?openForm'; var name="privacy"; var width='900'; var height='600'; var left='80'; var top='60'; var status='0'; var resizable='1'; var directories ='0'; var toolbar='0'; var scrollbars='1'; var reload='0'; build_pop(url, name, width,height,left,top,status,resizable,directories, toolbar, scrollbars,reload); //window.document.location=url; } function richiestaPassword(){ var f=window.document.forms[0]; var url=f.path.value+'requestPwd?openForm&gilbid='+f.gilbid.value+'&langid='+f.langid.value; window.document.location=url; } function modificaProfilo(){ var f=window.document.forms[0]; var url=f.pathStorico.value+'(hideUserNameProfilo)/$First?editDocument&gilbid='+f.gilbid.value+'&langid='+f.langid.value; window.document.location=url; } function selezionaCompagnia(){ try { var unaCompagnia = document.getElementById ? document.getElementById("unaCompagnia") : document.all.unaCompagnia; var piuCompagnie = document.getElementById ? document.getElementById("piuCompagnie") : document.all.piuCompagnie; var astRs = document.getElementById ? document.getElementById("astRs") : document.all.astRs; var astCo = document.getElementById ? document.getElementById("astCo") : document.all.astCo; var obj= eval ("document.getElementById('ftipo_utente')"); var theField= eval ("document.forms[0].ftipo_utente"); if (obj != null) { var tipo=getFieldValue (obj, theField ); switch (tipo){ case 'Ditta di Manutenzione': piuCompagnie.style.display = 'block'; unaCompagnia.style.display = 'none'; astRs.style.display = 'block'; astCo.style.display = 'block'; var theFieldRS=eval ("document.forms[0].fragione_sociale"); disable_field(theFieldRS,false); break; case 'Ispettore Metrico': unaCompagnia.style.display = 'block'; piuCompagnie.style.display = 'none'; astRs.style.display = 'none'; astCo.style.display = 'none'; var theFieldRS=eval ("document.forms[0].fragione_sociale"); theFieldRS.value='' disable_field(theFieldRS,true); var theFieldD=eval ("document.forms[0].fcompagnia"); for ( i= 0; i < theFieldD.length; i++ ){ disable_field(theFieldD[i],true); } break; case 'Studio Tecnico': unaCompagnia.style.display = 'block'; piuCompagnie.style.display = 'none'; astRs.style.display = 'block'; astCo.style.display = 'none'; var theFieldRS=eval ("document.forms[0].fragione_sociale"); disable_field(theFieldRS,false); var theFieldD=eval ("document.forms[0].fcompagnia"); for ( i= 0; i < theFieldD.length; i++ ){ disable_field(theFieldD[i],true); } break; case 'Tecnico di Compagnia': unaCompagnia.style.display = 'block'; piuCompagnie.style.display = 'none'; astRs.style.display = 'none'; astCo.style.display = 'block'; var theFieldRS=eval ("document.forms[0].fragione_sociale"); theFieldRS.value='' disable_field(theFieldRS,true); var theFieldE=eval ("document.forms[0].fcompagnia"); for ( i= 0; i < theFieldE.length; i++ ){ disable_field(theFieldE[i],false); } break; case '': unaCompagnia.style.display = 'block'; piuCompagnie.style.display = 'none'; astRs.style.display = 'none'; astCo.style.display = 'none'; var theFieldRS=eval ("document.forms[0].fragione_sociale"); disable_field(theFieldRS,true); var theFieldD=eval ("document.forms[0].fcompagnia"); for ( i= 0; i < theFieldD.length; i++ ){ disable_field(theFieldD[i],true); } break; default: } } var lingua = ''; var theFieldLNG=eval ("document.forms[0].lingua"); if(theFieldLNG != undefined) { lingua =theFieldLNG.value; } if (lingua == 'English') { var theFieldRS=eval ("document.forms[0].fragione_sociale"); disable_field(theFieldRS,false); astRs.style.display = 'block'; } }catch(e){alert(e)} } function selezionalingua() { } //Gestisce il click sul tasto ENTER per tutte le viste function keyDown(e) { var strin=""; //alert("keyDown") if (abilitato==3) { //var ns4=1; var nKey=e.which; var ieKey=0; var realkey = String.fromCharCode(e.which); strin=nKey } if (abilitato==4) { //var ns4=0; var ieKey=event.keyCode; var nKey=0; var realkey = String.fromCharCode(event.keyCode); strin=ieKey } if (strin=="13"){ richiestaAccount(); }else{ return true; } } //Fine gestisce il click sul tasto ENTER per tutte le viste