registrazione-account.jsp 33.7 KB
Newer Older
Admin CED's avatar
Admin CED committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951
<%/*
       * Created on 23/09/2014
       *
       * Copyright (c) EldaSoft S.p.A.
       * Tutti i diritti sono riservati.
       *
       * Questo codice sorgente e' materiale confidenziale di proprieta' di EldaSoft S.p.A.
       * In quanto tale non puo' essere distribuito liberamente ne' utilizzato a meno di 
       * aver prima formalizzato un accordo specifico con EldaSoft.
       */
%>

<%@ taglib uri="http://www.eldasoft.it/genetags" prefix="gene"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.eldasoft.it/tags" prefix="elda" %>

<c:set var="result" value="${gene:callFunction('it.eldasoft.gene.tags.functions.GetParametriRegistrazioneUtenteFunction',pageContext)}"/>

<gene:template file="scheda-nomenu-template.jsp">
	<gene:redefineInsert name="head">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.validate.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.realperson.min.js"></script>

		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/jquery/ui/std/jquery-ui.css" />
		
		<style type="text/css">
			label.error {
				float: none;
				color: white;
 				background-color: #E40000; 
				padding-left: 5px;
				padding-right: 5px;
				padding-top: 2px;
				padding-bottom: 2px;
				vertical-align: middle;
				margin-left: 5px;
 				border: 1px solid #BA0000; 
 				-moz-border-radius-topleft: 4px; 
 				-webkit-border-top-left-radius: 4px; 
 				-khtml-border-top-left-radius: 4px; 
 				border-top-left-radius: 4px; 
				-moz-border-radius-topright: 4px;
				-webkit-border-top-right-radius: 4px;
				-khtml-border-top-right-radius: 4px;
				border-top-right-radius: 4px;
 				-moz-border-radius-bottomleft: 4px; 
 				-webkit-border-bottom-left-radius: 4px; 
 				-khtml-border-bottom-left-radius: 4px; 
 				border-bottom-left-radius: 4px; 
				-moz-border-radius-bottomright: 4px;
				-webkit-border-bottom-right-radius: 4px;
				-khtml-border-bottom-right-radius: 4px;
				border-bottom-right-radius: 4px;
			}
		 
			.error {
				color:Red;
			}
			
			.realperson-challenge {
				display: inline-block;
				vertical-align: bottom;
				color: #000;
				padding-right: 5px;
			}
			.realperson-text {
				font-family: "Courier New",monospace;
				font-size: 5px;
				font-weight: bold;
				letter-spacing: -1px;
				line-height: 2px;
			}
			.realperson-regen {
				padding-top: 4px;
				font-size: 10px;
				text-align: left;
				padding-left: 10px;
				cursor: pointer;
				font-style: italic;
				color: #454545;
			}
			.realperson-disabled {
				opacity: 0.75;
				filter: Alpha(Opacity=75);
			}
			.realperson-disabled .realperson-regen {
				cursor: default;
			}
			
			.ui-autocomplete {
				max-height: 200px;
				overflow-y: auto;
				overflow-x: hidden;
				max-width: 700px;
			}
			
			.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 0px; -webkit-border-top-left-radius: 0px; -khtml-border-top-left-radius: 0px; border-top-left-radius: 0px; }
			.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 0px; -webkit-border-top-right-radius: 0px; -khtml-border-top-right-radius: 0px; border-top-right-radius: 0px; }
			.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; -khtml-border-bottom-left-radius: 0px; border-bottom-left-radius: 0px; }
			.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; -khtml-border-bottom-right-radius: 0px; border-bottom-right-radius: 0px; }
			.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce; font-weight: bold; color: #AD3600; }

		</style>
		
	</gene:redefineInsert>

	<gene:setString name="titoloMaschera" value='Registrazione utente'/>

	<gene:redefineInsert name="corpo">
	<c:choose>
	<c:when test='${requestScope.appBloccata eq "1"}'>
		<div class="errori-javascript-dettaglio">
			<ul>
			<html:messages id="error" message="true" property="error">
				<br>
				<li class="errori-javascript-err">ATTENZIONE:
				<small>Applicazione non ancora attivata</small></li>
				<br>
			</html:messages>
			</ul>
		</div>
	</c:when>
	<c:otherwise>
		<gene:formScheda entita="USRSYS" gestore="it.eldasoft.gene.tags.gestori.submit.GestoreFormRegistrazione" >
			<gene:campoScheda>
				<td colspan="2"><br><b>Dati anagrafici dell'utente</b></td>
			</gene:campoScheda>
			<gene:campoScheda title="Codice dell'anagrafico" campo="CODICE"  campoFittizio="true" definizione="T10;;;;" modificabile='${modoAperturaScheda eq "NUOVO"}' visibile="false" />
			<gene:campoScheda campo="NOME" campoFittizio="true" definizione="T80;;;;" title="Nome" obbligatorio="true" modificabile="${empty requestScope.nome || empty requestScope.cognome}" value="${requestScope.nome}"/>
			<gene:campoScheda campo="COGNOME" campoFittizio="true" definizione="T80;;;;" title="Cognome" obbligatorio="true" modificabile="${empty requestScope.nome || empty requestScope.cognome}" value="${requestScope.cognome}"/>
			<gene:campoScheda campo="TELEFONO" campoFittizio="true" definizione="T50;;;;" title="Telefono"/>
			<gene:campoScheda campo="EMAIL" campoFittizio="true" definizione="T100;;;;" title="E-mail" obbligatorio="true" value="${requestScope.email}"/>
			
			<gene:campoScheda>
				<td colspan="2"><br><b>Registrazione</b></td>
			</gene:campoScheda>
			<c:choose>
				<c:when test='${requestScope.isLoginCF eq "1"}'>
					<c:set var="titleCF" value="Codice Fiscale/Login"/>
					<c:set var="visLogin" value="false"/>
				</c:when>
				<c:otherwise>
					<c:set var="titleCF" value="Codice Fiscale"/>
					<c:set var="visLogin" value="true"/>
				</c:otherwise>
			</c:choose>
			<gene:campoScheda campo="LOGIN" campoFittizio="true" definizione="T16;;;;" title="Login" obbligatorio="true" visibile="${visLogin}" modificabile="${empty requestScope.login}" value="${requestScope.login}" />
			<gene:campoScheda campo="CODFISC" campoFittizio="true" definizione="T16;;;;" title="${titleCF}" obbligatorio="true" visibile='${requestScope.flagLdap ne "3" || !(requestScope.isLoginCF eq "1")}' modificabile="${empty requestScope.codfisc}" value="${requestScope.codfisc}"/>
			<gene:campoScheda campo="SYSCON" visibile="false"/>
			<gene:campoScheda campo="SYSUTE" visibile="false"/>
			<gene:campoScheda campo="SYSNOM" visibile="false" title="Login" entita="USRSYS" where="usrsys.syscon = utent.syscon"/>
			
			<c:choose>
				<c:when test='${requestScope.flagLdap ne "1" && requestScope.flagLdap ne "3"}'>
					<gene:campoScheda campo="SYSPWD" visibile="false" entita="USRSYS" where="usrsys.syscon = utent.syscon" />
					<gene:campoScheda>	
						<td class="etichetta-dato" >Password (*)</td>
						<td class="valore-dato">
							<input type="password" id="password" name="password" styleClass="testo" maxlength="30" size="20" />
							<span style="vertical-align: middle;"><i>&nbsp;(minino 8 caratteri, di cui 2 cifre)</i></span>
						</td>
					</gene:campoScheda>
					<gene:campoScheda>
						<td class="etichetta-dato" >Conferma password (*)</td>
						<td class="valore-dato"> 
							<input type="password" id="confPassword" name="confPassword" styleClass="testo" maxlength="30" size="20" />
						</td>
					</gene:campoScheda>
				</c:when>
				<c:otherwise>
					<gene:campoScheda campo="SYSPWD" visibile="false" entita="USRSYS" where="usrsys.syscon = utent.syscon" value=""/>
				</c:otherwise>
			</c:choose>
			
			<gene:campoScheda campo="FLAG_LDAP" value="${requestScope.flagLdap}" visibile="false"/>
			<gene:campoScheda campo="DN" campoFittizio="true" definizione="T250;;;;" title="DN" value="${requestScope.dn}" visibile="false"/>
			
			<c:choose>
				<c:when test='${requestScope.ruolo eq "0" }'>
				<gene:campoScheda campo="SYSAB3" title="Ruolo" obbligatorio="true" visibile="false" entita="USRSYS" where="usrsys.syscon = utent.syscon" value="U" />
				</c:when>
				<c:when test='${requestScope.ruolo eq "1" }'>
				<gene:campoScheda campo="SYSAB3" title="Ruolo" obbligatorio="true" entita="USRSYS" where="usrsys.syscon = utent.syscon">
					<gene:addValue value="" descr="" />
					<c:if test='${!empty listaValoriRuolo}'>
						<c:forEach items="${listaValoriRuolo}" var="valoriRuolo">
						<gene:addValue value="${valoriRuolo[0]}"
							descr="${valoriRuolo[1]}" />
						</c:forEach>
					</c:if>
				</gene:campoScheda>			
				</c:when>
				<c:when test='${requestScope.ruolo eq "2" }'>
				<gene:campoScheda campo="SYSABG" title="Ruolo" obbligatorio="true" entita="USRSYS" where="usrsys.syscon = utent.syscon">
					<gene:addValue value="" descr="" />
					<c:if test='${!empty listaValoriRuolo}'>
						<c:forEach items="${listaValoriRuolo}" var="valoriRuolo">
						<gene:addValue value="${valoriRuolo[0]}"
							descr="${valoriRuolo[1]}" />
						</c:forEach>
					</c:if>
				</gene:campoScheda>			
				</c:when>
				<c:when test='${requestScope.ruolo eq "3" }'>
				<gene:campoScheda campo="SYSABC" title="Ruolo" obbligatorio="true" entita="USRSYS" where="usrsys.syscon = utent.syscon">
					<gene:addValue value="" descr="" />
					<c:if test='${!empty listaValoriRuoloContratti}'>
						<c:forEach items="${listaValoriRuoloContratti}" var="valoriRuoloContratti">
						<gene:addValue value="${valoriRuoloContratti[0]}"
							descr="${valoriRuoloContratti[1]}" />
						</c:forEach>
					</c:if>
				</gene:campoScheda>			
				</c:when>
				<c:otherwise>
				</c:otherwise>
			</c:choose>
			
		
			
			<c:if test='${!empty listaProfiliDisponibili}'>
				<gene:campoScheda>
					<td colspan="2"><br><b>Applicativi disponibili</b></td>
				</gene:campoScheda>
				<gene:campoScheda>
					<td class="etichetta-dato">Applicativi (*)</td>
					<td class="valore-dato">
						<c:forEach items="${listaProfiliDisponibili}" step="1" var="valoriProfiliDisponibili" varStatus="ciclo" >
							<input style="vertical-align: middle;" type="checkbox" name="applicativi" value="${valoriProfiliDisponibili[0]}"/>
							<span style="vertical-align: middle;">${valoriProfiliDisponibili[1]}</span>
							<p style="margin-top:0px; padding-left: 24px;"><i>${valoriProfiliDisponibili[2]}</i></p>
						</c:forEach>
						<div style="margin-bottom: 5px;" id="messaggioApplicativi"></div>
					</td>
				</gene:campoScheda>
			</c:if>

			<gene:campoScheda>
				<td colspan="2"><br><b>Ulteriori indicazioni</b></td>
			</gene:campoScheda>
			<gene:campoScheda campo="MSGAMM" campoFittizio="true" definizione="T2000;0;;NOTE;" title="Messaggio per l'amministratore" />
			
			
			<c:if test='${requestScope.isUffintAbilitati eq "1" }'>
				<gene:campoScheda>
					<td colspan="2"><br><b>Ente</b></td>
				</gene:campoScheda>
				<gene:campoScheda entita="UFFINT" campo="CODEIN" /> 
				<gene:campoScheda title="Codice fiscale" entita="UFFINT" campo="CFEIN" obbligatorio="true"/>
				<gene:campoScheda addTr="false">
	
				<tr id="rowUFFINT_AVVISO">
					<td colspan="2">
						<br>
						<i>Non esiste alcun ente con il codice fiscale o la partita IVA indicate, valorizzare anche i campi seguenti</i>
						<br>
					</td>
				</tr>
				
				</gene:campoScheda>			
				<gene:campoScheda addTr="false">
					<tr id="rowVIS_UFFINT_NOMEIN">
						<td class="etichetta-dato">Denominazione</td>
						<td class="valore-dato"> 
							<div id="VIS_UFFINT_NOMEIN"></div>
						</td>
					</tr>
				</gene:campoScheda>
				<gene:campoScheda entita="UFFINT" campo="NOMEIN" obbligatorio="true" />
			</c:if>
			
			
			
			<c:if test='${!empty requestScope.isModelloFacSimile}' >
			<gene:campoScheda>
			<td colspan="2">
				<br>
				<b>Scarica il modello di abilitazione al servizio</b>
				<br>
				Per completare la registrazione &egrave; necessario scaricare il presente
				<c:if test='${!empty requestScope.isModelloFacSimile}' >
					<a class="link-229" href="javascript:apriModelloAbilitazioneServizio();" >
				</c:if>
				modello di abilitazione al servizio</a> , compilarlo, firmarlo digitalmente e <br>
				allegarlo alla presente scheda di registrazione (vedi "Allega documenti").
			</td>
			</gene:campoScheda> 
			<gene:campoScheda nome="ALLDOC">
				<td colspan="2">
				<br>
				<b>Allega documenti</b>
				<br>
				Nel caso in cui siano presenti pi&ugrave; documenti &egrave; necessario archiviarli in un unico file (.zip).
				<i><br>Utilizza il pulsante "Scegli file" per caricare i documenti</i>
				</td>
			</gene:campoScheda>
				<gene:campoScheda campo="NOMEDOC" campoFittizio="true" definizione="T50" title="Documento caricato" modificabile="true" visibile="false" />
				<gene:campoScheda title="Nome file" visibile="true">
					<input type="file" name="selezioneFile" id="selezioneFile" class="file" size="70" onkeydown="return bloccaCaratteriDaTastiera(event);" onchange='javascript:scegliFile();'/>
			</gene:campoScheda>
			</c:if>

			<gene:campoScheda> 
				<td colspan="2">
					<br>
					<b>Informativa trattamento dati personali ai sensi del D.Lgs. n. 196/2003</b>
					<br>
					Ai sensi dell'art. 13 del D. Lgs. n. 196/2003 (ex art. 10 della legge n. 675/96), si informa che i dati personali 
					forniti ed acquisiti contestualmente alla registrazione ai servizi scelti, nonche' i dati necessari 
					all'erogazione di tali servizi, saranno trattati, nel rispetto delle garanzie di riservatezza e delle misure di sicurezza 
			        previste dalla normativa vigente attraverso strumenti informatici, telematici e manuali, con logiche strettamente 
			        correlate alle finalita' del trattamento.
			       	<br>	
			       	<br>		       					
					<c:if test="${not empty moduloCondizioniDuso}">
						Dichiaro di aver preso visione e di accettare le condizioni d'uso del sito web. <br>
						(Cliccare <b><a href="${pageContext.request.contextPath}/${moduloCondizioniDuso}" class="link-generico" title="Condizioni d'uso" target="_blank">qui</a></b>
						per scaricare le condizioni d'uso)
						<br>
						<br>
					</c:if>	
					<span style="vertical-align: middle;">Accetto (*)&nbsp;</span><input style="vertical-align: middle;" type="checkbox" name="informativaPrivacy" id="informativaPrivacy" title="Accetto le condizioni d'uso"/>
			 	</td>				
			</gene:campoScheda>	
			
			<gene:campoScheda>
				<td colspan="2"><br><b>Dimostra di non essere un robot</b></td>
			</gene:campoScheda>
			<gene:campoScheda>
				<td class="etichetta-dato">Codice di controllo (*)</td>
				<td class="valore-dato">
					<input type="text" id="realperson" name="realperson" maxlength="15" size="15" />&nbsp;
				</td>
			</gene:campoScheda>
			
			
			<gene:campoScheda>	
				<td colSpan="2">
					<i><br>(*) Campi obbligatori</i>
				</td>
			</gene:campoScheda>
			<gene:campoScheda>	
				<td class="comandi-dettaglio" colSpan="2">
					<gene:insert name="pulsanteSalva">
						<INPUT type="button" class="bottone-azione" value="Registra" title="Registra" onclick="javascript:eseguiSubmit()">
					</gene:insert>
					<gene:insert name="pulsanteAnnulla">
						<INPUT type="button" class="bottone-azione" value="Annulla" title="Annulla registrazione" onclick="javascript:annullaScheda()">
					</gene:insert>
					&nbsp;
				</td>
			</gene:campoScheda>
			<gene:fnJavaScriptScheda funzione='upperCase("UFFINT_CFEIN", "#UFFINT_CFEIN#")' elencocampi='UFFINT_CFEIN' esegui="false" />
			<gene:fnJavaScriptScheda funzione='upperCase("CODFISC", "#CODFISC#")' elencocampi='CODFISC' esegui="false" />
		</gene:formScheda>
	</c:otherwise>
	</c:choose>
		

	</gene:redefineInsert>

	<gene:javaScript>
		
		
		
		document.forms[0].encoding="multipart/form-data";
		
			var changeUFFINT = false;	

			document.getElementById("NOME").size= 25;			
			document.getElementById("COGNOME").size= 25;
			document.getElementById("LOGIN").size= 20;
			document.getElementById("TELEFONO").size= 35;
			document.getElementById("EMAIL").size= 50;
			<c:if test='${requestScope.isUffintAbilitati eq "1" }'>
				document.getElementById("UFFINT_NOMEIN").cols= 55;
				document.getElementById("UFFINT_CFEIN").size= 20;
			</c:if>				
			
			
			function gestioneAction() {
				var nuovaAction = contextPath + "/SchedaNoSessione.do";
				document.forms[0].action = nuovaAction;
				nuovaAction = "commons/redirect.jsp";
				document.forms[0].jspPathTo.value = nuovaAction;
			}
			
			
			function gestioneSezioneUFFINT(visibile) {
				if (visibile == true) {
					$("#rowUFFINT_AVVISO").show();
					$("#rowUFFINT_NOMEIN").show();
				} else {
					$("#rowUFFINT_AVVISO").hide();
					$("#rowUFFINT_NOMEIN").hide();
					$("#UFFINT_NOMEIN").val("");
				}
			};
			
			
		
			$(document).ready(function()
			{
				$("#CODFISC").css("text-transform","uppercase");
				$("#UFFINT_CFEIN").css("text-transform","uppercase");
				$('#UFFINT_CFEIN').change(function() {
				  getDescrizioneEnte("");
				});
				$('#UFFINT_CFEIN').keyup(function() {
				  getDescrizioneEnte("");
				});
				
				$("#rowUFFINT_CODEIN").hide();							
			
				$("#realperson").css("text-transform","uppercase");
				$("#realperson").realperson({length: 6, regenerate: 'Rigenera codice'});

				jQuery.validator.addMethod("isSelectUffint",
					function(value, element) {return isSelectUffint(value);},
					"Selezionare un valore");

				jQuery.validator.addMethod("controlloCFPIVA",
				function(value, element) {
					return checkCodFis(value);
				},
				"Il valore specificato non  valido");
				
				jQuery.validator.addMethod("isLoginInesistente",
					function(value, element) {return !isLoginEsistente(value);},
					"Login esistente");
								
				jQuery.validator.addMethod("isPasswordCaratteriAmmessi",
					function(value, element) {return isPasswordCaratteriAmmessi(value);},
					"La password contiene caratteri non ammessi");	

				jQuery.validator.addMethod("isPasswordMinimo2Numerici",
					function(value, element) {return isPasswordMinimo2Numerici(value);},
					"La password deve contenere almeno 2 caratteri numerici");
			
				jQuery.validator.addMethod("passwordSimilarityNOME",
					function(value, element) {return !passwordSimilarity(value,$("#NOME").val());},
					"Password simile al nome dell'utente");

				jQuery.validator.addMethod("passwordSimilarityCOGNOME",
					function(value, element) {return !passwordSimilarity(value,$("#COGNOME").val());},
					"Password simile al cognome dell'utente");
					
				jQuery.validator.addMethod("passwordSimilarityCODFISC",
					function(value, element) {return !passwordSimilarity(value,$("#CODFISC").val());},
					"Password simile al codice fiscale / login di registrazione");
				
				
				jQuery.validator.addMethod("isCodiceControlloCorretto",
					function(value, element) {return isCodiceControlloCorretto();},
				"Il codice di controllo non e' corretto");
				
			    $("form[name^='formScheda']").validate(
			    {
			        rules:
			        {
			            NOME: "required",
			            COGNOME: "required",
			            LOGIN: 
		            	{
		            		required: true,
		            		isLoginInesistente: true
		            	},
			            CODFISC: 
		            	{
		            		required: true,
		            		minlength: 16,
		            		controlloCFPIVA: true,
		            		isLoginInesistente: true
		            	},
			            UFFINT_NOMEIN: "required",
			            UFFINT_CFEIN:
			            {
							required: true,
			            	controlloCFPIVA: true,
			            	isSelectUffint: true
			            },
			            password:
			            {
			            	required: true,
			            	isPasswordCaratteriAmmessi: true,
			            	minlength: 8,
			            	isPasswordMinimo2Numerici: true,
			            	passwordSimilarityNOME: true,
			            	passwordSimilarityCOGNOME: true,
			            	passwordSimilarityCODFISC: true
			            },
			            confPassword:
			            {
			            	required: true,
			            	equalTo: "#password"
			            },
			            EMAIL:
			            {
			                required: true,
			                email: true
			            },
			            USRSYS_SYSAB3:
			            {
			                required: true
			            },
			            USRSYS_SYSABG:
			            {
			                required: true
			            },
			            USRSYS_SYSABC:
			            {
			                required: true
			            },
			            applicativi:
			            {
			                required: true
			            },
			            
						selezioneFile:
			            {
			                required: true
			            },
			            informativaPrivacy:
			            {
			            	required: true
			            },
   			            realperson:
			            {
			            	required: true,
			            	minlength: 6,
			            	isCodiceControlloCorretto: true
			            }	            
			        },
			        messages:
			        {
			            NOME: "Inserire il nome",
			            COGNOME: "Inserire il cognome",
			            LOGIN:
			            {
			            	required: "Inserire la login",
			            	isLoginInesistente: "La login indicata e' gia' utilizzata"
			            },
			            CODFISC:
			            {
			            	required: "Inserire il codice fiscale",
			            	controlloCFPIVA: "Il valore specificato non rispetta il formato previsto",
			            	isLoginInesistente: "Il codice fiscale indicato e' gia' utilizzato"
			            },
			            UFFINT_NOMEIN: "Inserire la denominazione",
			            UFFINT_CFEIN:
			           	{
			            	required: "Inserire il codice fiscale o la partita IVA",
			            	controlloCFPIVA: "Il valore specificato non rispetta il formato previsto",
			            	isSelectUffint: "Selezionare un valore dalla lista"
							
			            },
			            password: 
			            {
			            	required: "Inserire la password",
			            	minlength: "La password deve essere lunga almeno 8 caratteri" 
			            },
			            confPassword: 
		            	{
		            	 	required: "Confermare la password",
		            		equalTo: "Le due password non coincidono" 	
		            	},
			            EMAIL:
			            {
			            	required: "Inserire l'indirizzo e-mail",
			            	email: "Inserire un indirizzo e-mail valido"
			            },
			            USRSYS_SYSAB3:
			            {
			            	required: "Inserire il ruolo"
			            },
			            USRSYS_SYSABG:
			            {
			            	required: "Inserire il ruolo"
			            },
			            USRSYS_SYSABC:
			            {
			            	required: "Inserire il ruolo"
			            },
			            applicativi:
			            {
			            	required: "Scegliere almeno un applicativo tra quelli proposti"
			            },
			            selezioneFile:
						{
			            	required: "Inserire i documenti richiesti"
			            },
			            informativaPrivacy:
			            {
			            	required: "Per procedere e' necessario accettare le condizioni"
			            },
			            realperson:
			            {
			            	required: "Digitare il codice di controllo",
			            	minlength: "Digitare tutti i 6 caratteri del codice di controllo"
			            }
			        },
			        errorPlacement: function(error, element) {
				    	if (element.attr("name") == "applicativi") {
				       		error.appendTo( $("#messaggioApplicativi") );
				       	} else {
				       		error.insertAfter(element);
				       	}
					}
				});
			});		
					
		
			function upperCase(campo, valore){
				document.getElementById(campo).value=valore.toUpperCase();
			}
						
			function annullaScheda(){
			
			<c:choose>
				<c:when test='${requestScope.flagLdap ne "3" }'>
					window.location.href="InitLogin.do";
				</c:when>
				<c:otherwise>
					document.location.href="SessionTimeOut.do";
				</c:otherwise>
			</c:choose>
				
			}

			function eseguiSubmit(){
				if ($("form[name^='formScheda']").validate().form()) {
					var eseguiSubmit = false;
					var isLoginCF = false;
					<c:if test='${requestScope.isLoginCF eq "1"}'>
			    		isLoginCF = true;
			    	</c:if>
					<c:choose>
						<c:when test='${requestScope.flagLdap ne "1" && requestScope.flagLdap ne "3"  }'>
							if (controllaCampoPassword(document.forms[0].password,8,true)) {
								document.forms[0].USRSYS_SYSPWD.value = document.forms[0].password.value;
								eseguiSubmit = true;
							}
						</c:when>
						<c:otherwise>
								eseguiSubmit = true;
						</c:otherwise>
					</c:choose>
					 if(eseguiSubmit==true){
					   	if(isLoginCF){
					 		document.forms[0].LOGIN.value = document.forms[0].CODFISC.value;
					 	}
						document.forms[0].USRSYS_SYSNOM.value = document.forms[0].LOGIN.value;
						document.forms[0].metodo.value="update";
						if(activeForm.onsubmit()){
							bloccaRichiesteServer();
							document.forms[0].submit();
						}
					 }
				}
			}
			
			function apriModelloAbilitazioneServizio(){
				var w = 700;
				var h = 500;
				var l = Math.floor((screen.width-w)/2);
				var t = Math.floor((screen.height-h)/2);
				document.location.href='ModelloRegistrazione.do?metodo=download';
			}
			
			
			function gestioneSezioneUFFINT(visibile) {
				if (visibile == false) {
					$("#rowUFFINT_AVVISO").hide();
					$("#rowUFFINT_NOMEIN").hide();
				}
			};

			
			function scegliFile() {
				var selezioneFile = document.getElementById("selezioneFile").value;
				var lunghezza_stringa=selezioneFile.length;
				var posizione_barra=selezioneFile.lastIndexOf("\\");
				var nome=selezioneFile.substring(posizione_barra+1,lunghezza_stringa).toUpperCase();
				setValue("NOMEDOC",nome);
			}
			
			function getDescrizioneEnte(valore) {
					var result = false;
	                var cfein = $("#UFFINT_CFEIN").val();
	                if (cfein != "" && checkCodFis(cfein)) {
						$.ajax({
							type: "GET",
							dataType: "json",
							/*async: false,*/
							beforeSend: function(x) {
							if(x && x.overrideMimeType) {
								x.overrideMimeType("application/json;charset=UTF-8");
							   }
							},
							url: "${pageContext.request.contextPath}/GetDescrizioneEnte.do",
							data: "cfein=" + cfein,
							success: function(data){
								if (data.enteEsistente == true) {
									$("#VIS_UFFINT_NOMEIN").html(data.NOMEIN.value);
									$("#rowVIS_UFFINT_NOMEIN").show();
									$("#UFFINT_CODEIN").val(data.CODEIN.value);
									gestioneSezioneUFFINT(false);
									result = true;
								} else {
									$("#VIS_UFFINT_NOMEIN").html("");
									$("#rowVIS_UFFINT_NOMEIN").hide();
									$("#UFFINT_CODEIN").val("");
									gestioneSezioneUFFINT(true);
								}
							},
							error: function(e){
								alert("Ente: errore durante la lettura delle informazioni");
							}
						});
					} else {
						$("#VIS_UFFINT_NOMEIN").html("");
						$("#rowVIS_UFFINT_NOMEIN").hide();
						$("#UFFINT_CODEIN").val("");
					}
					return result;
			}

				if ($("#UFFINT_CFEIN").val() != "") {
					getDescrizioneEnte("");
				} else {
					$("#rowVIS_UFFINT_NOMEIN").hide();
					gestioneSezioneUFFINT(false);
				}
				
				
			function isSelectUffint(cfein) {
					return changeUFFINT;
			}				
				
			function isLoginEsistente(login) {
					var isLoginEsistente = false;
	                $.ajax({
	                    type: "GET",
	                    dataType: "json",
	                    async: false,
	                    beforeSend: function(x) {
	        			if(x && x.overrideMimeType) {
	            			x.overrideMimeType("application/json;charset=UTF-8");
					       }
	    				},
	                    url: "${pageContext.request.contextPath}/IsLoginEsistente.do",
	                    data: "login=" + login,
	                    success: function(data){
	                    	if (data.loginEsistente == true) {
	                        	isLoginEsistente = true;
	                        } else {
	                        	isLoginEsistente = false;
	                        }
	                    },
	                    error: function(e){
	                        alert("Codice fiscale / login: errore durante il controllo di univocita'");
	                    }
	                });
	              return isLoginEsistente;
	        }

			
			
			function isPasswordCaratteriAmmessi(password){
					var caratteriAmmessi = " ~#\"$%&'()*+,-./0123456789:;<=>?!@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz";
					var result = true;
					var index = 0;
  					while(index < password.length & result){
	  					if(caratteriAmmessi.indexOf(password.charAt(index)) < 0){
		  					result = false;
	  					} else {
	  						index = index+1;
	  					}
	  				}
					return result;
			}
				
				
			function passwordSimilarity(password,similarityValue) {
					var result = false;
					if (similarityValue && password.toLowerCase().match(similarityValue.toLowerCase())) {
						result = true;
					} else {
						result = false;
					}
					return result;
			}
				
				
			function isPasswordMinimo2Numerici(password){
					var result = true;
				  	var index = 0;
				    var numInteri = 0;
				    var oggettoEspressioneRegolare = new RegExp("^[0-9]$");
					while(index < password.length){
						if (oggettoEspressioneRegolare.test(password.charAt(index))){
							numInteri = numInteri + 1
						}
						index = index + 1;
					}
					if(numInteri < 2) {
						result = false;
				  	}		
					return result;
			}
			
	        function isCodiceControlloCorretto() {
					var isCodiceControlloCorretto = false;
	                $.ajax({
	                    type: "GET",
	                    dataType: "json",
	                    async: false,
	                    beforeSend: function(x) {
	        			if(x && x.overrideMimeType) {
	            			x.overrideMimeType("application/json;charset=UTF-8");
					       }
	    				},
	                    url: "${pageContext.request.contextPath}/IsCodiceControlloCorretto.do",
	                    data: "realpersonHash=" + $("input[name=realpersonHash]").val() + "&realperson=" + $("#realperson").val(),
	                    success: function(data){
	                    	if (data.codiceControlloCorretto == true) {
	                        	isCodiceControlloCorretto = true;
	                        } else {
	                        	isCodiceControlloCorretto = false;
	                        }
	                    },
	                    error: function(e){
	                        isCodiceControlloCorretto = false;
	                    }
	                });
	                return isCodiceControlloCorretto;
	        }
	        
	        function SetApplicativiDisponibili(){
				var appdisp = '';
				var pv = ';';
				var isAppDisp = false;
					<c:forEach items="${listaProfiliDisponibili}" var="valoriProfiliDisponibili" varStatus="ciclo">
						if(document.getElementById("APPDISP_${ciclo.index}").checked){
							var app_i = document.getElementById("APPDISP_${ciclo.index}").value;
							var appdisp_i = "${valoriProfiliDisponibili[0]}";
							appdisp += appdisp_i;
							appdisp +=pv;
							isAppDisp = true;
						}
					</c:forEach>
					if(isAppDisp){
						setValue("APPDISP",appdisp);
					}else{
						alert("Segliere almeno uno fra gli applicativi disponibili");
					}
					
				
				return isAppDisp;
			}
			
        	$(function() {
				$("#UFFINT_CFEIN").autocomplete({
					delay: 0,
				    autoFocus: true,
				    position: { 
				    	my : "left top",
				    	at: "left bottom"
				    },
					source: function( request, response ) {
						changeUFFINT = false;
						var cfamm = $("#UFFINT_CFEIN").val();
						$.ajax({
							/*async: false,*/
						    type: "GET",
		                    dataType: "json",
		                    beforeSend: function(x) {
		        			if(x && x.overrideMimeType) {
		            			x.overrideMimeType("application/json;charset=UTF-8");
						       }
		    				},
		                    url: "${pageContext.request.contextPath}/GetListaEnti.do",
		                    data: "cfamm=" + cfamm,
							success: function( data ) {
								if (!data) {
									response([]);
								} else {
									response( $.map( data, function( item ) {
										return {
											label: (item[1].value == "")?item[0].value:item[0].value + " (C.F: " + item[1].value + ")",
											value: (item[1].value == "")?cfamm:item[1].value,
											valueNOMEIN: item[0].value,
											valueCODEIN: item[2].value
										}
									}));
								} 
							},
		                    error: function(e){
		                        alert("Errore durante la lettura della lista degli enti");
		                    }
						});
					},
					minLength: 1,
					select: function( event, ui ) {
						$("#VIS_UFFINT_NOMEIN").html(ui.item.valueNOMEIN);
						$("#rowVIS_UFFINT_NOMEIN").show();
						$("#UFFINT_CODEIN").val(ui.item.valueCODEIN);
						gestioneSezioneUFFINT(false);
						changeUFFINT = true;
					},
					open: function() {
						$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
					},
					close: function() {
						$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
					},
					change: function(event, ui) {
						var cfamm = $("#UFFINT_CFEIN").val();
						$.ajax({
							/*async: false,*/
						    type: "GET",
		                    dataType: "json",
		                    beforeSend: function(x) {
		        			if(x && x.overrideMimeType) {
		            			x.overrideMimeType("application/json;charset=UTF-8");
						       }
		    				},
		                    url: "${pageContext.request.contextPath}/GetListaEnti.do",
		                    data: "cfamm=" + cfamm,
							success: function( data ) {
								if (!data) {
									$("#VIS_UFFINT_NOMEIN").html("");
									$("#rowVIS_UFFINT_NOMEIN").hide();
									$("#UFFINT_CODEIN").val("");
									gestioneSezioneUFFINT(true);
								} 
							},
							error: function(e){
	                        		$("#VIS_UFFINT_NOMEIN").html("");
									$("#rowVIS_UFFINT_NOMEIN").hide();
									$("#UFFINT_CODEIN").val("");
									gestioneSezioneUFFINT(true);
		                    }
						});
					}
				});
			});
			
		</gene:javaScript>
		
</gene:template>