var residenza = "I"; var tipoClientidb = new Object() tipoClientidb["impresa"] = [ {value:"Servizi alle imprese", text:"Servizi alle imprese"}, {value:"Informatica", text:"Informatica"}, {value:"Commercio", text:"Commercio"}, {value:"Telecomunicazioni", text:"Telecomunicazioni"}, {value:"Editoria/Stampa", text:"Editoria/Stampa"}, {value:"Meccanica/Elettrica", text:"Meccanica/Elettrica"}, {value:"Alimentare", text:"Alimentare"}, {value:"Chimica/Farmaceutica", text:"Chimica/Farmaceutica"}, {value:"Edilizia" , text:"Edilizia"}, {value:"Tessile/Moda" , text:"Tessile/Moda"}, {value:"Mobili/Arredamento", text:"Mobili/Arredamento"}, {value:"Alberghi/Ristoranti", text:"Alberghi/Ristoranti"}, {value:"Trasporti/Logistica", text:"Trasporti/Logistica"}, {value:"Finanza", text:"Finanza"}, {value:"Altro", text:"Altro"}]; tipoClientidb["professionista"] = [ {value:"Commercialista", text:"Commercialista"}, {value:"Ragioniere", text:"Ragioniere"}, {value:"Notaio", text:"Notaio"}, {value:"Tributarista", text:"Tributarista"}, {value:"Avvocato", text:"Avvocato"}, {value:"Consulente del lavoro", text:"Consulente del lavoro"}, {value:"Altro", text:"Altro"}]; tipoClientidb["pubblicaAmmiLoc"] = [ {value:"Regione", text:"Regione"}, {value:"Provincia", text:"Provincia"}, {value:"Comune", text:"Comune"}, {value:"Comunità montana", text:"Comunità montana"}, {value:"ASL", text:"ASL"}, {value:"CCIAA", text:"CCIAA"}, {value:"Altro", text:"Altro"}]; tipoClientidb["pubblicaAmmiCentrale"] = []; tipoClientidb["associazioniDiCategoria"] = []; tipoClientidb["privato"] = []; tipoClientidb["altro"] = []; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var controlServizi=false; //se si aggiunge un nuovo cantiere aggiungere un elemento che identifica il cantiere (sempre di 3 caratteri) nell'arrey elencoServizi var elencoServizi = new Array("CRM","BCK","VCI","FAX","SIT"); //nell'oggetto servizio seguente, aggiungere i paramentri caratteristici del nuovo cantiere var servizio=new Object() servizio["CRM"] =[ {value:"registra_campi_servizio", text:"registra_campi_servizio_crm"}, {value:"cb", text:"cbCRM"}, {value:"servizio", text:"servizioCRM"}, {value:"Software per la gestione dei clienti", text:"Software per la gestione dei clienti"}, {value:"checkServizio", text:"checkServizioCRM"}, {value:"checkContratto",text:"accettoContrattoCRM"}]; servizio["BCK"] =[ {value:"registra_campi_servizio", text:"registra_campi_servizio_backup"}, {value:"cb", text:"cbBackup"}, {value:"servizio", text:"servizioBackup"}, {value:"Backup", text:"Backup"}, {value:"checkServizio", text:"checkServizioBackup"}, {value:"checkContratto",text:"accettoContrattoBackup"}]; servizio["VCI"] =[ {value:"registra_campi_servizio", text:"registra_campi_servizio_voci"}, {value:"cb", text:"cbVoci"}, {value:"servizio", text:"servizioVoci"}, {value:"Voci", text:"Voci"}, {value:"checkServizio", text:"checkServizioVoci"}, {value:"checkContratto",text:"accettoContrattoVoci"}]; servizio["FAX"] =[ {value:"registra_campi_servizio", text:"registra_campi_servizio_fax"}, {value:"cb", text:"cbFax"}, {value:"servizio", text:"servizioFax"}, {value:"Fax", text:"Fax"}, {value:"checkServizio", text:"checkServizioFax"}, {value:"checkContratto",text:"accettoContrattoFax"}]; servizio["SIT"] =[ {value:"registra_campi_servizio", text:"registra_campi_servizio_sito"}, {value:"cb", text:"cbSito"}, {value:"servizio", text:"servizioSito"}, {value:"Sito", text:"Sito"}, {value:"checkServizio", text:"checkServizioSito"}, {value:"checkContratto",text:"accettoContrattoSito"}]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function gestisciDivServizioVoci(){ if(document.getElementById("servizioVoci").checked == false) nascondiDIV('alertServizioVoci'); else mostraDIV('alertServizioVoci'); } function settaAccettoContrattoVisure(val){ document.getElementById("accettoContrattoVisure").value=val; } function settaAccettoContrattoVisure2(val){ document.getElementById("accettoContrattoVisure2").value=val; } function settaAccettoContrattoCRM(val){ document.getElementById("accettoContrattoCRM").value=val; } function settaAccettoContrattoBackup(val){ document.getElementById("accettoContrattoBackup").value=val; } function settaAccettoContrattoServizio(val,nomeServizio){ document.getElementById(nomeServizio).value=val; } function caricaDatiFromPortale(tipoCli,seltipo,resUte,nazioneNascita,dir,indiceProvNas,indiceProvRes,indiceProvSpe,indiceComNas,indiceComRes,indiceComSpe,promo,indietro){ var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var choice = tipoCli; var choiceSel2 = seltipo; if(choice == 'impresa'||choice == 'professionista'||choice == 'pubblicaAmmiLoc'||choice == 'pubblicaAmmiCentrale'||choice == 'associazioniDiCategoria'||choice == 'privato'){ var db = tipoClientidb[choice];} else{var db='';} var cliChooser =document.getElementById("seltipo2"); if (choice != "") { if(db.length == 0){ nascondi('seltipo2'); } else{ mostra('seltipo2'); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cliChooser.add(newElem, where); if(db[i].value == seltipo) { cliChooser.selectedIndex=i+1; } } } }else{ nascondi('seltipo2'); } if(resUte == 'E'){ visualizzaEstero(); if("PROPRIO" == dir){ document.form1.dirI[0].checked = true; document.form1.dirI[1].checked = false; }else{ document.form1.dirI[0].checked = false; document.form1.dirI[1].checked = true; } }else{ visualizzaItaliano(); if("PROPRIO" == dir){ document.form1.dirI[0].checked = true; document.form1.dirI[1].checked = false; }else{ document.form1.dirI[0].checked = false; document.form1.dirI[1].checked = true; } } visualizzaDatiPerNazione(nazioneNascita); visualizzaInputPromo(); RicreaComuni('comnasUte' ,indiceProvNas,indiceComNas); RicreaComuni('comuneCliI',indiceProvRes,indiceComRes); RicreaComuni('comuneKitI',indiceProvSpe,indiceComSpe); if("SI" == indietro){ if(tipoCli == 'impresa'){ document.getElementById("campo_registra_leg_rappr").style.display="none"; document.getElementById("registra_campi_leg_rappr").style.display="none"; document.form1.dirI[1].checked = true; document.getElementById("denom_cli").value="-"; cambiaLabel('LEGALE'); }else{ document.getElementById("campo_registra_leg_rappr").style.display="block"; document.getElementById("registra_campi_leg_rappr").style.display="block"; if(document.getElementById("denom_cli").value =="") { document.form1.dirI[0].checked = true; cambiaLabel('PROPRIO'); } else { document.form1.dirI[1].checked = true; cambiaLabel('LEGALE'); } } var tipoDoc=document.getElementById("tipoDocumentoUtente").value; if (tipoDoc != "CF"){ mostraDIV('registra_campi_numSerie_nascita'); nascondiDIV('registra_campi_codfis_nascita'); } else { nascondiDIV('registra_campi_numSerie_nascita'); mostraDIV('registra_campi_codfis_nascita'); } } } function caricaDati(tipoCli,seltipo,resUte,nazioneNascita,dir,indiceProvNas,indiceProvRes,indiceProvSpe,indiceComNas,indiceComRes,indiceComSpe,indietro,checkServizioCRM,checkServizioBackup,checkServizioVoci,cciaa){ var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var choice = tipoCli; var choiceSel2 = seltipo; var db = tipoClientidb[choice]; var cliChooser =document.getElementById("seltipo2"); if (choice != "") { if(db.length == 0){ nascondi('seltipo2'); } else{ mostra('seltipo2'); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cliChooser.add(newElem, where); if(db[i].value == seltipo) { cliChooser.selectedIndex=i+1; } } } }else{ nascondi('seltipo2'); } if("SI" == indietro){ //alert(cciaa); document.getElementById('cciaaReg').value=cciaa; listaServizi(''); //document.getElementById("denom_cli").value=denom_cli; var serviziChecked=new Array(checkServizioCRM,checkServizioBackup,checkServizioVoci); for (i=0; i< elencoServizi.length; i++){ var servizioTemp = elencoServizi[i]; var choice = elencoServizi[i]; var sv = servizio[choice]; var registra_campi_servizio=sv[0].text; if("checked" == serviziChecked[i]){ document.getElementById(registra_campi_servizio).checked=true; } } controllaServizi(); controllaPromo("indietro"); var tipoDoc=document.getElementById("tipoDocumentoUtente").value; if (tipoDoc != "CF"){ mostraDIV('registra_campi_numSerie_nascita'); nascondiDIV('registra_campi_codfis_nascita'); } else { nascondiDIV('registra_campi_numSerie_nascita'); mostraDIV('registra_campi_codfis_nascita'); } } if(resUte == 'E'){ visualizzaEstero(); if("PROPRIO" == dir){ document.form1.dirE[0].checked = true; document.form1.dirE[1].checked = false; document.form1.dirE[2].checked = false; }else if("PASSIVO" == dir){ document.form1.dirE[0].checked = false; document.form1.dirE[1].checked = true; document.form1.dirE[2].checked = false; }else{ document.form1.dirE[0].checked = false; document.form1.dirE[1].checked = false; document.form1.dirE[2].checked = true; } }else{ visualizzaItaliano(); if("PROPRIO" == dir){ document.form1.dirI[0].checked = true; document.form1.dirI[1].checked = false; }else{ document.form1.dirI[0].checked = false; document.form1.dirI[1].checked = true; } } visualizzaDatiPerNazione(nazioneNascita); visualizzaInputPromo(); RicreaComuni('comnasUte' ,indiceProvNas,indiceComNas); RicreaComuni('comuneCliI',indiceProvRes,indiceComRes); RicreaComuni('comuneKitI',indiceProvSpe,indiceComSpe); } function visualizzaInputPromo(){ if(document.form1.promo[0].checked){ document.getElementById("codicePromo").style.display = 'none'; document.getElementById("noCodicePromo").style.display = 'block'; }else{ document.getElementById("codicePromo").style.display = 'block'; document.getElementById("noCodicePromo").style.display = 'none'; } } function caricaDatiCCIAA(tipoCli,seltipo,resUte,nazioneNascita,dir,indiceProvNas,indiceProvRes,indiceProvSpe,indiceComNas,indiceComRes,indiceComSpe){ var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var choice = tipoCli; var choiceSel2 = seltipo; var db = tipoClientidb[choice]; var cliChooser =document.getElementById("seltipo2"); if (choice != "") { if(db.length == 0){ nascondi('seltipo2'); } else{ mostra('seltipo2'); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cliChooser.add(newElem, where); if(db[i].value == seltipo) { cliChooser.selectedIndex=i+1; } } } }else{ nascondi('seltipo2'); } if(resUte == 'E'){ visualizzaEsteroCCIAA(); if("PROPRIO" == dir){ document.form1.dirE[0].checked = true; document.form1.dirE[1].checked = false; document.form1.dirE[2].checked = false; }else if("PASSIVO" == dir){ document.form1.dirE[0].checked = false; document.form1.dirE[1].checked = true; document.form1.dirE[2].checked = false; }else{ document.form1.dirE[0].checked = false; document.form1.dirE[1].checked = false; document.form1.dirE[2].checked = true; } }else{ visualizzaItalianoCCIAA(); if("PROPRIO" == dir){ document.form1.dirI[0].checked = true; document.form1.dirI[1].checked = false; }else{ document.form1.dirI[0].checked = false; document.form1.dirI[1].checked = true; } } visualizzaDatiPerNazione(nazioneNascita); RicreaComuni('comnasUte' ,indiceProvNas,indiceComNas); RicreaComuni('comuneCliI',indiceProvRes,indiceComRes); RicreaComuni('comuneKitI',indiceProvSpe,indiceComSpe); } function setTipoClienteNoServizi(chooser) { var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var cliChooser = chooser.form.elements["seltipo2"]; while (cliChooser.options.length) { cliChooser.remove(0); } var choice = chooser.options[chooser.selectedIndex].value; if(choice == "altro"){ newTipoCliente = prompt ("Inserisci un nuovo valore per l'attività:", ""); if (newTipoCliente != null) { document.form1.tipoCli.options[(document.form1.tipoCli.options.length)]=new Option(newTipoCliente,newTipoCliente,true,true); } document.getElementById("seltipo2").value=""; nascondi('seltipo2'); }else if(choice == "pubblicaAmmiCentrale" || choice == "associazioniDiCategoria" || choice == "privato" ) { document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } else{ var db = tipoClientidb[choice]; newElem = document.createElement("option"); newElem.text = "Scegli area"; newElem.value = ""; cliChooser.add(newElem, where); if (choice != "") { if(db.length == 0){ document.getElementById("descSeltipo2").value=""; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } else{ mostra('seltipo2'); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cliChooser.add(newElem, where); } } }else{ document.getElementById("descSeltipo2").value=""; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } } if(choice == "impresa"){ if(document.getElementById("resUte").value=='I'){ nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); }else{ mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); } document.getElementById("campo_registra_leg_rappr").style.display="none"; document.getElementById("registra_campi_leg_rappr").style.display="none"; document.form1.dirI[1].checked = true; document.getElementById("denom_cli").value="-"; document.getElementById('labelImpresa').style.display='block'; document.getElementById('labelProprio').style.display='none'; document.getElementById('recapiti_cliente').innerHTML="Dati Impresa"; document.getElementById('labelText16').innerHTML="Indirizzo Sede"; cambiaLabel('LEGALE'); } else { nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); document.getElementById("campo_registra_leg_rappr").style.display="block"; document.getElementById("registra_campi_leg_rappr").style.display="block"; document.form1.dirI[0].checked = true; document.getElementById("denom_cli").value=""; document.getElementById('labelImpresa').style.display='none'; document.getElementById('labelProprio').style.display='block'; document.getElementById('labelText16').innerHTML="Indirizzo Residenza/Domicilio"; document.getElementById('recapiti_cliente').innerHTML="Dati Residenza/Domicilio"; cambiaLabel('PROPRIO'); } option_text("tipoCli","descTipoCli"); //listaServizi(''); } function setTipoCliente(chooser) { var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var cliChooser = chooser.form.elements["seltipo2"]; while (cliChooser.options.length) { cliChooser.remove(0); } var choice = chooser.options[chooser.selectedIndex].value; if(choice == ""){ document.getElementById("descSeltipo2").value=""; document.getElementById("seltipo2bis").value=""; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); }else if(choice == "altro"){ newTipoCliente = prompt ("Inserisci un nuovo valore per l'attività:", ""); if (newTipoCliente != null) { document.form1.tipoCli.options[(document.form1.tipoCli.options.length)]=new Option(newTipoCliente,newTipoCliente,true,true); } document.getElementById("seltipo2bis").value="xxx"; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); }else if(choice == "pubblicaAmmiCentrale" || choice == "associazioniDiCategoria" || choice == "privato" ) { document.getElementById("seltipo2bis").value="xxx"; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } else{ var db = tipoClientidb[choice]; newElem = document.createElement("option"); newElem.text = "Scegli area"; newElem.value = ""; cliChooser.add(newElem, where); if (choice != "") { if(db.length == 0){ document.getElementById("descSeltipo2").value=""; document.getElementById("seltipo2bis").value=""; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } else{ mostra('seltipo2'); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cliChooser.add(newElem, where); } } }else{ document.getElementById("descSeltipo2").value=""; document.getElementById("seltipo2bis").value=""; document.getElementById("seltipo2").value=""; nascondi('seltipo2'); } } option_text("tipoCli","descTipoCli"); listaServizi(''); if(choice != "impresa") { nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); document.getElementById('labelText16').innerHTML="Indirizzo Residenza/Domicilio"; document.getElementById('recapiti_cliente').innerHTML="Dati Residenza/Domicilio"; document.form1.dirI[0].checked = true; document.getElementById("denom_cli").value=""; cambiaLabel('PROPRIO'); }else{ if(document.getElementById("resUte").value=='I'){ nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); }else{ mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); } document.getElementById('recapiti_cliente').innerHTML="Dati Impresa"; document.getElementById('labelText16').innerHTML="Indirizzo Sede"; cambiaLabel('LEGALE'); } } function datiImpresa(tipoCli){ if(tipoCli != "impresa") { nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); document.getElementById('labelText16').innerHTML="Indirizzo Residenza/Domicilio"; document.getElementById('recapiti_cliente').innerHTML="Dati Residenza/Domicilio"; document.form1.dirI[0].checked = true; document.getElementById("denom_cli").value=""; cambiaLabel('PROPRIO'); }else{ if(document.getElementById("resUte").value=='I'){ nascondiDIV('tipoDocImpresaEstera'); mostraDIV('tipoDoc'); mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); }else{ mostraDIV('tipoDocImpresaEstera'); nascondiDIV('tipoDoc'); } document.getElementById('recapiti_cliente').innerHTML="Dati Impresa"; document.getElementById('labelText16').innerHTML="Indirizzo Sede"; cambiaLabel('LEGALE'); } } function setDescSeltipo2(chooser) { var seltipo2Chooser = chooser.form.elements["seltipo2"]; var choice = chooser.options[chooser.selectedIndex].value; document.getElementById("seltipo2bis").value=choice; if(choice == "Altro"){ newTipoCliente = prompt ("Inserisci un nuovo valore per l'attività:", ""); if (newTipoCliente != null) { document.form1.seltipo2.options[(document.form1.seltipo2.options.length-1)]=new Option(newTipoCliente,newTipoCliente,true,true); } } //settaSeltipo2('seltipo2',chooser.options.selectedIndex); option_text("seltipo2","descSeltipo2"); listaServizi(''); } function setDescSeltipo2NoServizi(chooser) { var seltipo2Chooser = chooser.form.elements["seltipo2"]; var choice = chooser.options[chooser.selectedIndex].value; if(choice == "Altro"){ newTipoCliente = prompt ("Inserisci un nuovo valore per l'attività:", ""); if (newTipoCliente != null) { document.form1.seltipo2.options[(document.form1.seltipo2.options.length-1)]=new Option(newTipoCliente,newTipoCliente,true,true); } } //settaSeltipo2('seltipo2',chooser.options.selectedIndex); option_text("seltipo2","descSeltipo2"); } function listaServizi(click){ if(document.getElementById("seltipo2bis").value != "" && document.getElementById("tipoCli").value !="" && document.getElementById("cciaaReg").value!="") { document.getElementById("divServiziOnlineDisponibili").style.display="block"; prov = document.getElementById("cciaaReg").value; tipo = document.getElementById("tipoCli").value; cciaaReg = document.getElementById("cciaaReg").value; serviziVisibili=0; for (i=0; i< elencoServizi.length; i++){ var servizioTemp = elencoServizi[i]; var choice = elencoServizi[i]; var sv = servizio[choice]; var registra_campi_servizio=sv[0].text; var tipo_servizio=sv[2].text; if(tipo == 'impresa' && eval("document.getElementById('"+prov+servizioTemp+"')")){ document.getElementById(registra_campi_servizio).style.display="block"; serviziVisibili +=1; }else{ //condizione particolare: il servizio VCI deve essere visualizzato per tutti gli utenti if(servizioTemp == 'VCI' && eval("document.getElementById('"+prov+servizioTemp+"')")){ document.getElementById(registra_campi_servizio).style.display="block"; document.getElementById('apDiv7').style.display="block"; serviziVisibili +=1; } else{ document.getElementById(registra_campi_servizio).style.display="none"; document.getElementById(tipo_servizio).checked= false; } } } if(tipo == 'impresa'){ document.getElementById("campo_registra_leg_rappr").style.display="none"; document.getElementById("registra_campi_leg_rappr").style.display="none"; document.form1.dirI[1].checked = true; document.getElementById("denom_cli").value="-"; }else{ document.getElementById("campo_registra_leg_rappr").style.display="block"; document.getElementById("registra_campi_leg_rappr").style.display="block"; if(document.getElementById("denom_cli").value =="") document.form1.dirI[0].checked = true; else document.form1.dirI[1].checked = true; //document.getElementById("denom_cli").value=""; } if( click =='cciaa' || document.getElementById("PROV_RES_PV_I").value == '' || document.getElementById("comuneCliI").value == ''){ mappaCciaaRegIntiCciaResidenza(cciaaReg); } if(serviziVisibili ==0) { document.getElementById("no_servizi").style.display="block"; document.getElementById("bottoneControllo").style.display="none"; }else{ document.getElementById("no_servizi").style.display="none"; document.getElementById("bottoneControllo").style.display="block"; } // ross //document.getElementById("bottoneControllo").style.display="block"; }else{ document.getElementById("bottoneContinua").value="servizi"; for (i=0; i< elencoServizi.length; i++){ var servizioTemp = elencoServizi[i]; var choice = elencoServizi[i]; var sv = servizio[choice]; var registra_campi_servizio=sv[0].text; document.getElementById(registra_campi_servizio).style.display="none"; } document.getElementById("divServiziOnlineDisponibili").style.display="none"; document.getElementById("dati").style.display="none"; document.getElementById("bottoneControllo").style.display="none"; } } function mappaCciaaRegIntiCciaResidenza(cciaareg){ num_option=document.getElementById('PROV_RES_PV_I').options.length; for (i=0; i< num_option; i++){ cciaaRes = document.getElementById('PROV_RES_PV_I').options[i].value; if(cciaareg == cciaaRes){ document.getElementById('PROV_RES_PV_I').options[i].selected = true; RiempiComuni('comuneCliI',i,'proRes'); document.getElementById('PROV_RES_PV_I').disabled = true; break; } } } function controlla(){ if(document.getElementById("bottoneContinua").value == "servizi") controllaServizi(); else preCheckMail(document.getElementById("emailUte").value); } function controllaServizi(){ var controlCheck=false; for (i=0; i< elencoServizi.length; i++){ var choice = elencoServizi[i]; var sv = servizio[choice]; var camp_servizio=sv[2].text; if(document.getElementById(camp_servizio).checked == true){ controlCheck=true; break; } } if(document.getElementById("servizioVisure").checked == true || controlCheck==true ){ document.getElementById("dati").style.display="block"; document.getElementById("bottoneContinua").value="tutto"; controlServizi=true; }else{ document.getElementById("bottoneContinua").value="servizi"; document.getElementById("dati").style.display="none"; alert("seleziona almeno un servizio online tra quelli disponibili"); } } function setInfoTpay(chooser) { var infoTpayChooser = chooser.form.elements["infoTpay"]; var choice = chooser.options[chooser.selectedIndex].value; if(choice == "AL"){ newInfoTpay = prompt ("Inserisci chi ti ha parlato di noi:", ""); if (newInfoTpay != null) { document.form1.infoTpay.options[(document.form1.infoTpay.options.length-1)]=new Option(newInfoTpay,"AL",true,true); } } option_text("infoTpay","descInfoTpay"); } function setTipoContatto(){ option_text("tipoContatto","descTipoContatto"); } function inizializza(){ if (document.all) { // creo le variabili per la sintassi di IE documento="document.all"; /* notare le virgolette precedute dall'escape ("), * che si sono rese necessarie, per mantenere inalterata * la sinassi e per non incorrere in errori */ parA="['"; parB="']"; visibilita=".style.visibility"; posizione=".style.position"; display=".style.display"; nascosto="'hidden'"; visibile="'visible'"; } else if (document.layers){ //NN4 documento="document.layers"; parA="['"; parB="']"; visibilita=".visibility"; disply=".display"; posizione=".position"; nascosto="'hide'"; visibile="'show'"; } else if (document.getElementById) { // Opera e NN6 documento="document.getElementById"; parA="('"; parB="')"; visibilita=".style.visibility"; posizione=".style.position"; display=".style.display"; nascosto="'hidden'"; visibile="'visible'"; } } function nascondi(elemento) { /* eseguo l'istruzione tramite eval, come somma di variabili */ inizializza(); eval(documento+parA+elemento+parB+visibilita+"="+nascosto+";"); } function mostra(elemento) { /* istruzione identica alla precedente, soltando che rende visbile */ inizializza(); eval(documento+parA+elemento+parB+visibilita+"="+visibile+";"); } function controllaRadio(){ if (!document.getElementById('radio1').checked) { alert("Per poter effettuare la registrazione bisogna prestare il proprio consenso!"); return false; } spostacheck(this.form,true); } /* controlla se il valore passato è un numero */ function isDigit(value) { return /^\d+$/.test(value); } /* toglie gli spazi all'inizio e alla fine di una stringa */ function trim(value) { return value.replace(/^\s+/,"").replace(/\s+$/,""); } function riempi(theform){ if(residenza == 'I'){ RicreaComuni('comuneKitI',theform.proRes.value,theform.comuneCliI.options.selectedIndex); theform.proSpe.value = theform.proRes.value; theform.comSpe.value = theform.comuneCliI.options.selectedIndex; theform.indKitI.value = theform.indCliI.value; theform.capKitI.value = theform.capCliI.value; theform.provKitI.value = theform.PROV_RES_PV_I.value; }else{ theform.comuneKitE.value = theform.comuneCliE.value; theform.indKitE.value = theform.indCliE.value; theform.capKitE.value = theform.capCliE.value; theform.provKitE.value = theform.PROV_RES_PV_E.value; theform.nazKitE.value = theform.nazCliE.value; } return false; } function copiaMail(theform){ theform.emailCli.value = theform.emailUte.value; return false; } function copiaCodFis(theform){ theform.cfImpCliI.value = theform.pivaCliI.value; return false; } function copiaCodFisUtente(theform){ var tipoUtente = theform.descTipoCli.value; if(tipoUtente != "Impresa") theform.cfImpCliI.value = theform.cfCli.value; else theform.cfImpCliI.value=''; } function spostacheck(theform,al){ if(residenza == "I"){ if (theform.denom_cli.value != "" && (theform.dirI[1].checked == false)) { theform.dirI[0].checked = false; theform.dirI[1].checked = true; if (al) return false; else return true; } if (theform.denom_cli.value == "" && (theform.dirI[1].checked == true)){ theform.dirI[0].checked = true; theform.dirI[1].checked = false; if (al) return false; else return true; } }else{ if (theform.denom_cli.value != "" && (theform.dirE[2].checked == false)) { theform.dirE[0].checked = false; theform.dirE[1].checked = false; theform.dirE[2].checked = true; if (al) return false; else return true; } } } function apriGuida() { window.open("/paga/html/home/help_registra.htm", "guida", "toolbar=no,resizable=yes,menubar=no,scrollbars=yes,width=800,height=500"); } function cambia(n) { var nn = n.toUpperCase(); document.form1.siglaProvincia.value =nn; b=document.form1.provnasUte.options.length; trovato=false; for(i=0; i "9"))) return false; } // Tutti i caratteri sono numeri return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // Febraio a 28 giorni in ogni anno divisibile per 4 // eccetto per gli anni centenari divisibili per 400 return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var re5digit=new RegExp(/^\d{8}$/) //La data deve avere almeno 8 cifre if (!dtStr.match(re5digit)){ return "Per favore inserisci una data valida" } var strMonth=dtStr.substring(2,4) var strDay=dtStr.substring(0,2) var strYear=dtStr.substring(4,8) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ return "Inserisci un giorno valido" } if (strMonth.length<1 || month<1 || month>12){ return "Per favore inserisci un mese valido" } if (strYear.length != 4 || year==0 || yearmaxYear){ return "Per favore inserisci un anno valido tra "+minYear+" e "+maxYear } if ( isInteger(stripCharsInBag(dtStr, dtCh))==false){ return "Per favore inserisci una data valida" } return "true" } function ValidaData(stringa){ var dt=stringa if (isDate(dt.value)!="true"){ alert(isDate(dt.value)) dt.focus() return false } return true } function ValidaCaptcha(stringa, baseurl){ if(!verificaAccept()) return false; var str=trim2(stringa) var url=baseurl if ( ((str=='')) || ((str ==' '))){ alert('Si prega di ricopiare il Codice di Sicurezza per poter proseguire con la registrazione!') }else { impostaProviciaEsteraBlank(); controlloCaratteriAmmessi(); document.getElementById('form1').submit(); } } /* * Fine check data */ /** Check EMAIL */ function checkMail(x) { if (checkMail2(x)!="true"){ alert(checkMail2(x))} } function preCheckMail(email){ email=trim2(email); email = email.toUpperCase(); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (filter.test(email)){ ControllaDominioEmail.controllaDominio(email,controllaTutto); }else{ controllaTutto("\t- Inserire una e-mail valida\n"); } } /* Ecco il Check Finale (devo "ri-checkare" tutto ) */ function cambiaColoreInput(colore){ document.getElementById('denom_cli').style.backgroundColor=colore; document.getElementById('tipoCli').style.backgroundColor=colore; document.getElementById('seltipo2').style.backgroundColor=colore; document.getElementById('dtnasUte_gg').style.backgroundColor=colore; document.getElementById('dtnasUte_mm').style.backgroundColor=colore; document.getElementById('dtnasUte_yy').style.backgroundColor=colore; document.getElementById('cognCli').style.backgroundColor=colore; document.getElementById('nomeCli').style.backgroundColor=colore; document.getElementById('comnasUte').style.backgroundColor=colore; document.getElementById('indCliI').style.backgroundColor=colore; document.getElementById('indCliE').style.backgroundColor=colore; document.getElementById('cfCli').style.backgroundColor=colore; document.getElementById('comuneCliI').style.backgroundColor=colore; document.getElementById('comuneCliE').style.backgroundColor=colore; document.getElementById('telCli2').style.backgroundColor=colore; document.getElementById('faxCli2').style.backgroundColor=colore; document.getElementById('capCliI').style.backgroundColor=colore; document.getElementById('capCliE').style.backgroundColor=colore; document.getElementById('emailUte').style.backgroundColor=colore; document.getElementById('pivaCli').style.backgroundColor=colore; document.getElementById('cfImpCliI').style.backgroundColor=colore; //document.getElementById('cciaa').style.backgroundColor=colore; document.getElementById('provnasUte').style.backgroundColor=colore; document.getElementById('naznasUte').style.backgroundColor=colore; document.getElementById('locnasUte').style.backgroundColor=colore; document.getElementById('ncf').style.backgroundColor=colore; document.getElementById('icf').style.backgroundColor=colore; document.getElementById('desc_icf').style.backgroundColor=colore; document.getElementById('ncf_nascita').style.backgroundColor=colore; document.getElementById('icf_nascita').style.backgroundColor=colore; document.getElementById('desc_icf_nascita').style.backgroundColor=colore; document.getElementById('nazCliE').style.backgroundColor=colore; document.getElementById('PROV_RES_PV_I').style.backgroundColor=colore; document.getElementById('indKitE').style.backgroundColor=colore; document.getElementById('indKitI').style.backgroundColor=colore; document.getElementById('comuneKitI').style.backgroundColor=colore; document.getElementById('comuneKitE').style.backgroundColor=colore; document.getElementById('capKitI').style.backgroundColor=colore; document.getElementById('provKitI').style.backgroundColor=colore; document.getElementById('nazKitE').style.backgroundColor=colore; document.getElementById('TICKET').style.backgroundColor=colore; document.getElementById('cellulare').style.backgroundColor=colore; document.getElementById('cbVisure').style.backgroundColor=colore; document.getElementById('tipoDocumentoUtente').style.backgroundColor=colore; document.getElementById('nazioneDocumentoUtente').style.backgroundColor=colore; document.getElementById('tipoDocumentoCliente').style.backgroundColor=colore; document.getElementById('nazioneDocumentoCliente').style.backgroundColor=colore; for (i=0; i< elencoServizi.length; i++){ var choice = elencoServizi[i]; var sv = servizio[choice]; var cb_servizio=sv[1].text; document.getElementById(cb_servizio).style.backgroundColor=colore; } //document.getElementById('cbCRM').style.backgroundColor=colore; //document.getElementById('cbBackup').style.backgroundColor=colore; } function controllaTutto(dominioMailIndesiderato){ cambiaColoreInput("#FFFFFF"); var errori=""; var error_bool=false; var bottoneContinua=document.getElementById("bottoneContinua").value; if(controlServizi == true){ var controlCheck=false; for (i=0; i< elencoServizi.length; i++){ var choice = elencoServizi[i]; var sv = servizio[choice]; var camp_servizio=sv[2].text; if(document.getElementById(camp_servizio).checked == true){ controlCheck=true; break; } } if(document.getElementById("servizioVisure").checked == false && controlCheck == false){ errori +="\t- Seleziona almeno un servizio online tra quelli disponibili\n"; if(document.getElementById("servizioVisure").checked == false){ document.getElementById("cbVisure").style.backgroundColor="#FFFFCC"; } for (i=0; i< elencoServizi.length; i++){ var choice = elencoServizi[i]; var sv = servizio[choice]; var camp_servizio=sv[2].text; var cb_servizio=sv[1].text; if(document.getElementById(camp_servizio).checked == false){ document.getElementById(cb_servizio).style.backgroundColor="#FFFFCC"; } } /*if(document.getElementById("servizioCRM").checked == false){ document.getElementById("cbCRM").style.backgroundColor="#FFFFCC"; } if(document.getElementById("servizioBackup").checked == false){ document.getElementById("cbBackup").style.backgroundColor="#FFFFCC"; }*/ error_bool=true; } /*if(document.getElementById("servizioVisure").checked == false && document.getElementById("servizioCRM").checked == false && document.getElementById("servizioBackup").checked == false){ errori +="\t- Seleziona almeno un servizio online tra quelli disponibili\n"; if(document.getElementById("servizioVisure").checked == false){ document.getElementById("cbVisure").style.backgroundColor="#FFFFCC"; } if(document.getElementById("servizioCRM").checked == false){ document.getElementById("cbCRM").style.backgroundColor="#FFFFCC"; } if(document.getElementById("servizioBackup").checked == false){ document.getElementById("cbBackup").style.backgroundColor="#FFFFCC"; } error_bool=true; }*/ } if (document.getElementById('tipoCli').value == ''){ errori +="\t- Selezionare una Tipologia di Cliente valida.\n" errori +="\t- Selezionare un'area per il Tipo Cliente.\n" document.getElementById('tipoCli').style.backgroundColor="#FFFFCC"; document.getElementById('seltipo2').style.backgroundColor="#FFFFCC"; error_bool=true } if(document.getElementById('tipoCli').value == 'impresa' || document.getElementById('tipoCli').value == 'professionista' || document.getElementById('tipoCli').value == 'pubblicaAmmiLoc'){ var cliChooser = document.getElementById('seltipo2'); var numOpt =cliChooser.options.length; if (numOpt != 1 && document.getElementById('seltipo2').value==''){ errori +="\t- Selezionare un'area per il Tipo Cliente.\n" document.getElementById('seltipo2').style.backgroundColor="#FFFFCC"; error_bool=true }} if (document.form1.promo[1].checked == true && ControlloNonVuoto2(document.getElementById('TICKET').value)!="true" ) { errori +="\t- Inserire codice promozione\n" document.getElementById('TICKET').style.backgroundColor="#FFFFCC"; error_bool=true } if (ControlloNonVuoto2(document.getElementById('cognCli').value)!="true" ) { errori +="\t- Inserire il Cognome\n" document.getElementById('cognCli').style.backgroundColor="#FFFFCC"; error_bool=true } if (ControlloNonVuoto2(document.getElementById('cognCli').value)!="false" && !controllaCampiCaratteriStrani(document.getElementById('cognCli').value)) { errori +="\t- Inserire un Cognome valido\n" document.getElementById('cognCli').style.backgroundColor="#FFFFCC"; error_bool=true } if (ControlloNonVuoto2(document.getElementById('nomeCli').value)!="true" ) { errori +="\t- Inserire il Nome\n" document.getElementById('nomeCli').style.backgroundColor="#FFFFCC"; error_bool=true } if (ControlloNonVuoto2(document.getElementById('nomeCli').value)!="false" && !controllaCampiCaratteriStrani(document.getElementById('nomeCli').value)) { errori +="\t- Inserire un Nome valido\n" document.getElementById('nomeCli').style.backgroundColor="#FFFFCC"; error_bool=true } var data = document.getElementById('dtnasUte_gg').value + document.getElementById('dtnasUte_mm').value +document.getElementById('dtnasUte_yy').value if (isDate(data)!="true"){ errori +="\t- Inserire una Data di Nascita valida\n" document.getElementById('dtnasUte_gg').style.backgroundColor="#FFFFCC"; document.getElementById('dtnasUte_mm').style.backgroundColor="#FFFFCC"; document.getElementById('dtnasUte_yy').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('naznasUte').value == "") { errori +="\t- Selezionare la nazione di nascita\n" document.getElementById('naznasUte').style.backgroundColor="#FFFFCC"; error_bool=true }else if (document.getElementById('naznasUte').value == "IT"){ if (document.getElementById('provnasUte').value == "") { errori +="\t- Selezionare la provincia di nascita\n" document.getElementById('provnasUte').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('comnasUte').value =='' ) { errori +="\t- Inserire il Comune di nascita\n" document.getElementById('comnasUte').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('tipoDocumentoUtente').value=='CF' && controllaCodiceFiscale('cfCli')!= "true") { errori +="\t- Inserire il Codice Fiscale corretto\n" document.getElementById('cfCli').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('tipoDocumentoUtente').value == "") { errori +="\t- Selezionare il tipo di documento\n" document.getElementById('tipoDocumentoUtente').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('nazioneDocumentoUtente').value == "") { errori +="\t- Selezionare la nazione di rilascio del documento\n" document.getElementById('nazioneDocumentoUtente').style.backgroundColor="#FFFFCC"; error_bool=true } if ( document.getElementById('tipoDocumentoUtente').value!='CF' && (ControlloNonVuoto2(document.getElementById('ncf_nascita').value)!="true")) { errori +="\t- Inserire il numero documento\n" document.getElementById('ncf_nascita').style.backgroundColor="#FFFFCC"; error_bool=true } if ( document.getElementById('tipoDocumentoUtente').value!='CF' && (ControlloNonVuoto2(document.getElementById('ncf_nascita').value)!="false")&& !isAlfanumerico(document.getElementById('ncf_nascita').value)) { errori +="\t- Inserire un numero valido documento\n" document.getElementById('ncf_nascita').style.backgroundColor="#FFFFCC"; error_bool=true } //document.getElementById('tipoDocumentoUtente').value = 'CF'; //document.getElementById('nazioneDocumentoUtente').value = 'IT'; }else{ if (ControlloNonVuoto2(document.getElementById('locnasUte').value)!="true" ) { errori +="\t- Inserire la località di nascita\n" document.getElementById('locnasUte').style.backgroundColor="#FFFFCC"; error_bool=true } /*if (ControlloNonVuoto2(document.getElementById('locnasUte').value)!="false" && !controllaCampiCaratteriStrani(document.getElementById('locnasUte').value) ) { errori +="\t- Inserire una località di nascita valida\n" document.getElementById('comnasUte').style.backgroundColor="#FFFFCC"; error_bool=true }*/ /*if (ControlloNonVuoto2(document.getElementById('icf_nascita').value)!="true" ) { errori +="\t- Inserire il codice stato di nascita\n" document.getElementById('icf_nascita').style.backgroundColor="#FFFFCC"; document.getElementById('desc_icf_nascita').style.backgroundColor="#FFFFCC"; error_bool=true }*/ if (document.getElementById('tipoDocumentoUtente').value == "") { errori +="\t- Selezionare il tipo di documento\n" document.getElementById('tipoDocumentoUtente').style.backgroundColor="#FFFFCC"; error_bool=true } if (document.getElementById('nazioneDocumentoUtente').value == "") { errori +="\t- Selezionare la nazione di rilascio del documento\n" document.getElementById('nazioneDocumentoUtente').style.backgroundColor="#FFFFCC"; error_bool=true } if ( (ControlloNonVuoto2(document.getElementById('ncf_nascita').value)!="true")) { errori +="\t- Inserire il numero documento\n" document.getElementById('ncf_nascita').style.backgroundColor="#FFFFCC"; error_bool=true } if ( (ControlloNonVuoto2(document.getElementById('ncf_nascita').value)!="false")&& !isAlfanumerico(document.getElementById('ncf_nascita').value)) { errori +="\t- Inserire un numero valido documento\n" document.getElementById('ncf_nascita').style.backgroundColor="#FFFFCC"; error_bool=true } } if (document.form1.dirI[1].checked == true && ControlloNonVuoto2(document.getElementById('denom_cli').value)!="true" ) { errori +="\t- Inserire Impresa/Società\n" document.getElementById('denom_cli').style.backgroundColor="#FFFFCC"; error_bool=true } /*if ((residenza == "E") && document.form1.dirE[2].checked == true && ControlloNonVuoto2(document.getElementById('denom_cli').value)!="true" ) { errori +="\t- Inserire Impresa/Società\n" document.getElementById('denom_cli').style.backgroundColor="#FFFFCC"; error_bool=true }*/ if ((residenza == "I") && ControlloNonVuoto2(document.getElementById('indCliI').value)!="true" ) { errori +="\t- Inserire l'indirizzo di residenza\n" document.getElementById('indCliI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "I") && (ControlloNonVuoto2(document.getElementById('indCliI').value)!="false") && !controllaCampiCaratteriStraniIndirizzo(document.getElementById('indCliI').value )) { errori +="\t- Inserire un indirizzo di residenza valido\n" document.getElementById('indCliI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && ControlloNonVuoto2(document.getElementById('indCliE').value)!="true" ) { errori +="\t- Inserire l'indirizzo di residenza\n" document.getElementById('indCliE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && (ControlloNonVuoto2(document.getElementById('indCliE').value)!="false") && !controllaCampiCaratteriStraniIndirizzo(document.getElementById('indCliE').value )) { errori +="\t- Inserire un indirizzo di residenza valido\n" document.getElementById('indCliE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "I") && ControllaCAP2(document.getElementById('capCliI').value)!="true"){ errori +="\t- Inserire un C.A.P. valido\n" document.getElementById('capCliI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && ControlloNonVuoto2(document.getElementById('capCliE').value)!="true" ) { errori +="\t- Inserire il C.A.P.\n" document.getElementById('capCliE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && isNaN(document.getElementById('capCliE').value)) { errori +="\t- Inserire un C.A.P. valido\n" document.getElementById('capCliE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "I") && document.getElementById('comuneCliI').value =="" ) { errori +="\t- Inserire il comune di residenza\n" document.getElementById('comuneCliI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && ControlloNonVuoto2(document.getElementById('comuneCliE').value)!="true" ) { errori +="\t- Inserire la località di residenza\n" document.getElementById('comuneCliE').style.backgroundColor="#FFFFCC"; error_bool=true } /*if ((residenza == "E") && (ControlloNonVuoto2(document.getElementById('comuneCliE').value)!="false") && !controllaCampiCaratteriStrani(document.getElementById('comuneCliE').value )) { errori +="\t- Inserire una località di residenza valida\n" document.getElementById('comuneCliE').style.backgroundColor="#FFFFCC"; error_bool=true }*/ if ((residenza == "I") && document.getElementById('PROV_RES_PV_I').value == "" ) { errori +="\t- Selezionare la provincia di residenza\n" document.getElementById('PROV_RES_PV_I').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && document.getElementById('nazCliE').value == "" ) { errori +="\t- Selezionare la nazione di residenza\n" document.getElementById('nazCliE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "I") && ControlloNonVuoto2(document.getElementById('pivaCliI').value)=="true" && ControllaPIVA2(document.getElementById('pivaCliI').value) !="true") { errori +="\t- Inserire il numero di partita iva corretto\n" document.getElementById('pivaCliI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && document.getElementById('tipoDocumentoCliente').value == "" ) { errori +="\t- Selezionare il tipo documento di residenza\n" document.getElementById('tipoDocumentoCliente').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && document.getElementById('nazioneDocumentoCliente').value == "" ) { errori +="\t- Selezionare la nazione di rilascio del documento di residenza\n" document.getElementById('nazioneDocumentoCliente').style.backgroundColor="#FFFFCC"; error_bool=true } /*if ((residenza == "E") && ControlloNonVuoto2(document.getElementById('pivaCliE').value)=="true" && isNaN(document.getElementById('pivaCliE').value)) { errori +="\t- Inserire il VAT number corretto\n" document.getElementById('pivaCliE').style.backgroundColor="#FFFFCC"; error_bool=true }*/ if(residenza == 'I'){ var cod = trim(document.getElementById('cfImpCliI').value); if (cod.length == 16){ if (controllaCodiceFiscale('cfImpCliI')!="true") { errori +="\t- Inserire il Codice Fiscale corretto (residenza cliente)\n" document.getElementById('cfImpCliI').style.backgroundColor="#FFFFCC"; error_bool=true } } else if(cod.length == 11) { if (ControllaPIVA2(cod)!="true") { errori +="\t- Inserire il Codice Fiscale corretto (residenza cliente)\n" document.getElementById('cfImpCliI').style.backgroundColor="#FFFFCC"; error_bool=true } } else{ errori +="\t- Inserire il Codice Fiscale corretto (residenza cliente)\n" document.getElementById('cfImpCliI').style.backgroundColor="#FFFFCC"; error_bool=true } }else{ /*if (ControlloNonVuoto2(document.getElementById('icf').value)!="true" ) { errori +="\t- Inserire il codice stato\n"; document.getElementById('icf').style.backgroundColor="#FFFFCC"; document.getElementById('desc_icf').style.backgroundColor="#FFFFCC"; error_bool=true }*/ if ((ControlloNonVuoto2(document.getElementById('ncf').value)!="true")) { errori +="\t- Inserire il numero del documento di residenza\n"; document.getElementById('ncf').style.backgroundColor="#FFFFCC"; error_bool=true } if ( (ControlloNonVuoto2(document.getElementById('ncf').value)!="false")&& !isAlfanumerico(document.getElementById('ncf').value)) { errori +="\t- Inserire un numero valido del documento di residenza\n" document.getElementById('ncf').style.backgroundColor="#FFFFCC"; error_bool=true } } if (ControlloNonVuoto2(document.getElementById('telCli2').value)!="true" ) { errori +="\t- Inserire il numero di telefono\n" document.getElementById('telCli2').style.backgroundColor="#FFFFCC"; error_bool=true } if (isNaN(document.getElementById('telCli2').value)) { errori +="\t- Inserire un numero di telefono valido\n" document.getElementById('telCli2').style.backgroundColor="#FFFFCC"; error_bool=true } if (isNaN(document.getElementById('faxCli2').value)) { errori +="\t- Inserire un numero di fax valido\n" document.getElementById('faxCli2').style.backgroundColor="#FFFFCC"; error_bool=true } if (isNaN(document.getElementById('cellulare').value)) { errori +="\t- Inserire un numero di cellulare valido\n" document.getElementById('cellulare').style.backgroundColor="#FFFFCC"; error_bool=true } ritornoMail = dominioMailIndesiderato; if ( ritornoMail !="true"){ errori +=ritornoMail; document.getElementById('emailUte').style.backgroundColor="#FFFFCC"; error_bool=true } /* if ((residenza == "I") && (ControlloNonVuoto2(document.getElementById('indKitI').value)!="false") && !controllaCampiCaratteriStraniIndirizzo(document.getElementById('indKitI').value )) { errori +="\t- Inserire un indirizzo di spedizione valido\n" document.getElementById('indKitI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && (ControlloNonVuoto2(document.getElementById('indKitE').value)!="false") && !controllaCampiCaratteriStraniIndirizzo(document.getElementById('indKitE').value )) { errori +="\t- Inserire un indirizzo di spedizione valido\n" document.getElementById('indKitE').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "I") && (document.getElementById('capKitI').value.length >0) && ControllaCAP2(document.getElementById('capKitI').value)!="true"){ errori +="\t- Inserire un C.A.P. di spedizione valido\n" document.getElementById('capKitI').style.backgroundColor="#FFFFCC"; error_bool=true } if ((residenza == "E") && (ControlloNonVuoto2(document.getElementById('comuneKitE').value)!="false") && !controllaCampiCaratteriStrani(document.getElementById('comuneKitE').value )) { errori +="\t- Inserire un località di spedizione valido\n" document.getElementById('comuneKitE').style.backgroundColor="#FFFFCC"; error_bool=true } if(residenza == "I"){ if (document.getElementById('indKitI').value =='' && document.getElementById('capKitI').value =='' && document.getElementById('comuneKitI').value =='' && document.getElementById('provKitI').value ==''){ // ok }else if(document.getElementById('indKitI').value !='' && document.getElementById('capKitI').value !='' && document.getElementById('comuneKitI').value !=''&& document.getElementById('provKitI').value !=''){ // ok }else{ errori +="\t- Inserire o cancellare tutti i dati per l'indirizzo di spedizione italia \n" error_bool=true if(document.getElementById('indKitI').value =='') document.getElementById('indKitI').style.backgroundColor="#FFFFCC"; if(document.getElementById('capKitI').value =='') document.getElementById('capKitI').style.backgroundColor="#FFFFCC"; if(document.getElementById('comuneKitI').value =='') document.getElementById('comuneKitI').style.backgroundColor="#FFFFCC"; if(document.getElementById('provKitI').value =='') document.getElementById('provKitI').style.backgroundColor="#FFFFCC"; } } if(residenza == "E"){ if(document.getElementById('indKitE').value =='' && document.getElementById('comuneKitE').value =='' && document.getElementById('nazKitE').value =='' && document.getElementById('capKitE').value ==''){ // ok }else if(document.getElementById('indKitE').value !='' && document.getElementById('comuneKitE').value !=''&& document.getElementById('nazKitE').value !='' && document.getElementById('capKitE').value !=''){ // ok }else{ errori +="\t- Inserire o cancellare tutti i dati per l'indirizzo di spedizione estero \n" error_bool=true if(document.getElementById('indKitE').value =='') document.getElementById('indKitE').style.backgroundColor="#FFFFCC"; if(document.getElementById('comuneKitE').value =='') document.getElementById('comuneKitE').style.backgroundColor="#FFFFCC"; if(document.getElementById('nazKitE').value =='') document.getElementById('nazKitE').style.backgroundColor="#FFFFCC"; if(document.getElementById('capKitE').value =='') document.getElementById('capKitE').style.backgroundColor="#FFFFCC"; } } */ if (error_bool){ alert ("Siamo spiacenti, ma per proseguire con la registrazione è necessario:\n"+errori) } else{ //if(cciaa == '') riempi(document.form1); if( residenza == 'I'){ radI = document.form1.dirI; val_radI = ""; for(i=0; i < radI.length; i++) { if(radI[i].checked) { val_radI = radI[i].value; break; } } document.getElementById('dir').value = val_radI; document.getElementById('indCli').value = document.getElementById('indCliI').value document.getElementById('capCli').value = document.getElementById('capCliI').value document.getElementById('comuneCli').value = document.getElementById('comuneCliI').value document.getElementById('nazCli').value = document.getElementById('nazCliI').value document.getElementById('descNazCli').value = 'ITALIA'; document.getElementById('siglaProvinciaRes').value = document.getElementById('PROV_RES_PV_I').value document.getElementById('PROV_RES_PV').value = document.getElementById('PROV_RES_PV_I').value document.getElementById('pivaCli').value = document.getElementById('pivaCliI').value document.getElementById('cfImpCli').value = document.getElementById('cfImpCliI').value document.getElementById('indKit').value = document.getElementById('indKitI').value document.getElementById('capKit').value = document.getElementById('capKitI').value document.getElementById('comuneKit').value = document.getElementById('comuneKitI').value document.getElementById('nazKit').value = document.getElementById('nazKitI').value document.getElementById('siglaProvinciaKit').value = document.getElementById('provKitI').value document.getElementById('provKit').value = document.getElementById('provKitI').value document.getElementById('tipoDocumentoCliente').value = 'CF'; document.getElementById('nazioneDocumentoCliente').value = 'IT'; }else{ radE = document.form1.dirE; val_radE = ""; for(i=0; i < radE.length; i++) { if(radE[i].checked) { val_radE = radE[i].value; break; } } document.getElementById('dir').value = val_radE; document.getElementById('indCli').value = document.getElementById('indCliE').value document.getElementById('capCli').value = document.getElementById('capCliE').value document.getElementById('comuneCli').value = document.getElementById('comuneCliE').value document.getElementById('nazCli').value = document.getElementById('nazCliE').value option_text('nazCliE','descNazCli'); document.getElementById('siglaProvinciaRes').value = document.getElementById('siglaProvinciaResE').value document.getElementById('PROV_RES_PV').value = document.getElementById('PROV_RES_PV_E').value document.getElementById('cfImpCli').value = document.getElementById('ncf').value document.getElementById('indKit').value = document.getElementById('indKitE').value document.getElementById('capKit').value = document.getElementById('capKitE').value document.getElementById('comuneKit').value = document.getElementById('comuneKitE').value document.getElementById('nazKit').value = document.getElementById('nazKitE').value document.getElementById('siglaProvinciaKit').value = document.getElementById('siglaProvinciaKitE').value document.getElementById('provKit').value = document.getElementById('provKitE').value document.getElementById('tipoDocumentoUtente').value = document.getElementById('tipoDocumentoUtente').value; document.getElementById('nazioneDocumentoUtente').value = document.getElementById('nazioneDocumentoUtente').value; } option_text('tipoCli','descTipoCli'); var tipoCliTmp=document.getElementById('tipoCli').value; if(tipoCliTmp=='impresa' || tipoCliTmp=='professionista'|| tipoCliTmp=='pubblicaAmmiLoc'){ document.getElementById('seltipo2').value=document.getElementById('seltipo2').value; option_text('seltipo2','descSeltipo2'); } option_text('naznasUte','descNaznasUte'); option_text('tipoDocumentoUtente','descTipoDocumentoUtente'); option_text('nazioneDocumentoUtente','descNazioneDocumentoUtente'); if(residenza == "E"){ if(document.getElementById('tipoCli').value == 'impresa'){ select = document.getElementById('tipoDocumentoCliente'); for (var i = 0; i < select.options.length; i++) { if (select.options[i].text == 'Serial Number') { select.options[i].selected=true; break; } } document.getElementById('descTipoDocumentoCliente').value ='Serial Number'; }else { option_text('tipoDocumentoCliente','descTipoDocumentoCliente'); } option_text('nazioneDocumentoCliente','descNazioneDocumentoCliente'); } document.getElementById('dtnasUte').value = document.getElementById('dtnasUte_gg').value + document.getElementById('dtnasUte_mm').value +document.getElementById('dtnasUte_yy').value; document.getElementById('siglaProvincia').value = document.getElementById('provnasUte').value if( document.getElementById('portale').value == 'no' && document.form1.modReg[0].checked){ option_text('cod_agente','descCodAgente'); } document.getElementById('form1').submit(); } } function option_text(elemento,descElemento) { var w = document.getElementById(elemento).selectedIndex; var selected_text = document.getElementById(elemento).options[w].text; document.getElementById(descElemento).value = selected_text; } function verificaAccept(){ var controlCheck=false; for (i=0; i< elencoServizi.length; i++){ var choice = elencoServizi[i]; var sv = servizio[choice]; var camp_servizio=sv[5].text; if(document.getElementById(camp_servizio).value == 'no'){ controlCheck=true; break; } } if (document.getElementById('accettoContrattoVisure').value == 'no' || document.getElementById('accettoContrattoVisure2').value == 'no' || controlCheck == true){ alert("Per proseguire è necessario accettare le condizioni contrattuali"); return false; } else{ if(document.getElementById('TICKET').value != '' && document.getElementById('isTicketValidate').value != 'valido'){ if (confirm("Il codice promozione indicato non è valido. Per usufruire della promozione clicca su 'Annulla' e torna alla pagina precedente per correggere il codice, in caso contrario per continuare la registrazione clicca su 'OK'")) { return true; }else{ return false; } }else{ return true; } } /* if (document.getElementById('accettoContrattoVisure').value == 'no' || document.getElementById('accettoContrattoVisure2').value == 'no' || document.getElementById('accettoContrattoCRM').value == 'no' || document.getElementById('accettoContrattoBackup').value == 'no' || document.getElementById('accettoContrattoVoci').value == 'no'){ alert("Per proseguire è necessario accettare le condizioni contrattuali"); return false; } else{ if(document.getElementById('TICKET').value != '' && document.getElementById('isTicketValidate').value != 'valido'){ if (confirm("Il codice promozione indicato non è valido. Per usufruire della promozione clicca su 'Annulla' e torna alla pagina precedente per correggere il codice, in caso contrario per continuare la registrazione clicca su 'OK'")) { return true; }else{ return false; } }else{ return true; } }*/ } function carica_desc_icf_nascita(id_desc){ id_desc = id_desc.toUpperCase(); document.getElementById('icf_nascita').value = id_desc; num_option = document.getElementById('desc_icf_nascita').options.length; esiste = "no"; for(a=0;a=0 || stringa.indexOf('!') >=0 || stringa.indexOf('\\') >=0 || stringa.indexOf('"') >=0 || stringa.indexOf('£') >=0 || stringa.indexOf('%') >=0 || stringa.indexOf('/') >=0 || stringa.indexOf('(') >=0 || stringa.indexOf(')') >=0 || stringa.indexOf('=') >=0 || stringa.indexOf('?') >=0 || stringa.indexOf('^') >=0 || stringa.indexOf('*') >=0 || stringa.indexOf('[') >=0 || stringa.indexOf(']') >=0 || stringa.indexOf('#') >=0 || stringa.indexOf('§') >=0 || stringa.indexOf(';') >=0 || stringa.indexOf(',') >=0 || stringa.indexOf(':') >=0 || stringa.indexOf('.') >=0 || stringa.indexOf('-') >=0 || stringa.indexOf('_') >=0 || stringa.indexOf('<') >=0 || stringa.indexOf('>') >=0 || stringa.indexOf('°') >=0 || stringa.indexOf('+') >=0) return false; else return true; } function RiempiComuni(select,indice,campo) { com = eval('com'+indice); eval("document.getElementById('"+campo+"').value='"+indice+"'"); var arrayComuni = com.split("+"); with (eval("document.form1."+select)) { while (options.length > 0) options[0]=null; options[0]=new Option(arrayComuni[0],'') for (i=1;i< arrayComuni.length;i++){ options[i]=new Option(arrayComuni[i],arrayComuni[i]) } options.selectedIndex=0; } } function settaComune(select,valore){ eval("document.getElementById('"+select+"').value='"+valore+"'"); } function settaSeltipo2(select,valore){ eval("document.getElementById('"+select+"').value='"+valore+"'"); } function settaComuneCap(select,valore,provincia,comune){ eval("document.getElementById('"+select+"').value='"+valore+"'"); indice = eval("document.getElementById('"+provincia+"').value"); caps = eval("cap"+indice); capResult = caps.split("+"); eval("document.getElementById('"+comune+"').value=capResult["+valore+"]"); } function RicreaComuni(select,indiceProv,indiceComune) { com = eval('com'+indiceProv); var arrayComuni = com.split("+"); with (eval("document.form1."+select)) { while (options.length > 0) options[0]=null; options[0]=new Option(arrayComuni[0],'') for (i=1;i< arrayComuni.length;i++){ options[i]=new Option(arrayComuni[i],arrayComuni[i]) } options.selectedIndex=indiceComune; } } function visualizzaReg(){ document.getElementById('registra_associazione').style.display='block'; document.getElementById('box_altre_info').style.display='block'; document.getElementById('box_ricerca_03sped').style.display='block'; document.getElementById('registra_campi_copia_dati').style.display='block'; } function visualizzaRegLight(){ document.getElementById('registra_associazione').style.display='none'; document.getElementById('box_altre_info').style.display='none'; document.getElementById('box_ricerca_03sped').style.display='none'; document.getElementById('registra_campi_copia_dati').style.display='none'; } function apriHelp(page){ window.open(page,'Help','width=600,height=300,scrollbars=yes,toolbar=no,resizable=no,menubar=no'); } function cambiaLabel(tipo){ if(tipo =="PROPRIO"){ document.getElementById('labelImpresa').style.display='none'; document.getElementById('labelProprio').style.display='block'; } else { document.getElementById('labelImpresa').style.display='block'; document.getElementById('labelProprio').style.display='none'; } } /** //function isAlfaNumericoSpecialChar // //@ description Restituisce una stringa che contiene solo i caratteri // _@.,&/()-+'!0123456789ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz, // con i caratteri è,é,ç,ò,ì,à,ù, sostituiti da e,e,c,o,i,a,u // //@ param inputValue è il valore del campo da sottoporre al controllo // **/ function isAlfaNumericoSpecialChar(inputValue) { var str=inputValue; var resultTmp = str.replace(/è/gi, "e"); resultTmp = resultTmp.replace(/[é\ê\ë\É\Ê\Ë\È]/gi, "e"); resultTmp = resultTmp.replace(/[ì\ï\î\í\Í\Î\Ï\Ì]/gi, "i"); resultTmp = resultTmp.replace(/[ç\Ç]/gi, "c"); resultTmp = resultTmp.replace(/[ò\ô\ö\Ö\ó\Ó\Ô\Ò\õ\Õ]/gi, "o"); resultTmp = resultTmp.replace(/à/gi, "a"); resultTmp = resultTmp.replace(/[ù\ü\û\Ü\ú\Ú\Û\Ù]/gi, "u"); resultTmp = resultTmp.replace(/[â\ä\à\å\Ä\Å\á\Á\Â\À]/gi, "a"); resultTmp = resultTmp.replace(/[\æ\Æ]/gi, "ae"); resultTmp = resultTmp.replace(/[\ÿ\ý\Ý]/gi, "y"); resultTmp = resultTmp.replace(/[\ñ\Ñ]/gi, "n"); var result = resultTmp.replace(/[^a-zA-Z0-9\&'()\@\+\-\,\_\.\!\/]/gi," "); return result; } function controlloCaratteriAmmessi(){ var elemento; if(document.getElementById('resUte').value=='E'){ elemento=new Array("cognCli","nomeCli","denom_cli","indCli","indKit","comnasUte","comuneCli","comuneKit"); } else{ elemento=new Array("cognCli","nomeCli","denom_cli","indCli","resUte","indKit","comnasUte"); } for (var i = 0; i < elemento.length; i++) { var inputValue=document.getElementById(elemento[i]).value; //alert(inputValue); var newStr=isAlfaNumericoSpecialChar(inputValue); document.getElementById(elemento[i]).value=newStr; } } // Se si disattiva il servizio visure il campo "Inserisci codice promozionale" viene disattivato function controllaPromo(provenienza){ if(document.getElementById("servizioVisure").checked == false) { document.getElementById("registra_campi_promozione").style.display="none"; document.getElementById("no_registra_campi_promozione").style.display="block"; if(provenienza!="indietro") document.form1.promo[0].click(); } else{ document.getElementById("registra_campi_promozione").style.display="block"; document.getElementById("no_registra_campi_promozione").style.display="none"; if(provenienza!="indietro") document.form1.promo[0].click(); } } function controllaCampiCaratteriStraniIndirizzo(stringa){ var str=stringa; var str2=str.replace(/[ \t\n\r\f\v]/gi,""); var patt=new RegExp("[^a-zA-Z0-9./+,()-]","gi"); if(patt.test(str2)) return false; else return true; } function isAlfanumerico(stringa){ var str=stringa; var patt=new RegExp("[^a-zA-Z0-9]","gi"); if(patt.test(str)) return false; else return true; } function copiaEstremiDocStraniero(theForm,stato){ if(residenza == "E"){ if(tipoUtente != "Impresa" && stato==true){ var tipoUtente = theForm.descTipoCli.value; if(theForm.naznasUte.value != "IT") theForm.nazCliE.value = theForm.naznasUte.value; if(theForm.tipoDocumentoUtente.value != 'CF'){ theForm.tipoDocumentoCliente.value=theForm.tipoDocumentoUtente.value; theForm.nazioneDocumentoCliente.value=theForm.nazioneDocumentoUtente.value; theForm.ncf.value=theForm.ncf_nascita.value; } } else{ theForm.nazCliE.value = ''; theForm.tipoDocumentoCliente.value=''; theForm.nazioneDocumentoCliente.value=''; theForm.ncf.value=''; } } } function azzeraCampiSpedizione(){ if(residenza == "I"){ document.getElementById('indKitI').value=''; document.getElementById('comuneKitI').value=''; document.getElementById('provKitI').value=''; document.getElementById('capKitI').value=''; } else{ document.getElementById('indKitE').value=''; document.getElementById('comuneKitE').value=''; document.getElementById('provKitE').value=''; document.getElementById('capKitE').value=''; } } function cambiaCCIAAEstero(residenza){ if(residenza=='E'){ document.getElementById('cciaaReg').value='RM'; document.getElementById('cciaaReg').disabled=true; listaServizi(document.getElementById('cciaaReg').value); } else { document.getElementById('cciaaReg').value=document.getElementById('PROV_RES_PV_I').value; document.getElementById('cciaaReg').disabled=false; listaServizi(document.getElementById('PROV_RES_PV_I').value); } } function impostaProviciaEsteraBlank(){ //se il cliente è residente all'estero le province di residenza vengono impostate a blank if(document.getElementById('resUte').value=='E'){ //alert(document.getElementById('resUte').value); document.getElementById('provKit').value=''; document.getElementById('siglaProvinciaRes').value=''; document.getElementById('PROV_RES_PV').value=''; } }