//GLOBAL VARS
var separatore = ",";
//LOAD DA MENU
function loadPage(toPage){
	//TESTARE SE I CAMPI LOGIN SONO O NO PIENI
	document.forms[0].acct_name.value="";
	document.forms[0].acct_pass.value="";
	if((document.forms[0].datainizio!=null && document.forms[0].comboArea!=null) && !(document.forms[0].comboArea.value==document.forms[0].comboAreaBackup.value && document.forms[0].datainizio.value==document.forms[0].datainizioBackup.value && document.forms[0].datafine.value==document.forms[0].datafineBackup.value)){
		document.forms[0].pag.value="0";
	}
	if(document.forms[0].toCharge.value!=toPage && (document.forms[0].pag!=null)){
		document.forms[0].pag.value="0";
		document.forms[0].datainizio.value="";
		document.forms[0].datafine.value="";
		document.forms[0].datainizioBackup.value="";
		document.forms[0].datafineBackup.value="";
		document.forms[0].comboArea.value="-1";
		document.forms[0].comboAreaBackup.value="-1";
	}

	if(document.forms[0].comboArea!="undefined" && document.forms[0].comboArea!=null){
		document.forms[0].filter.value=document.forms[0].comboArea.value+":"+document.forms[0].pag.value;
	}
	if(document.forms[0].datainizio!="undefined" && document.forms[0].datainizio!=null){
		document.forms[0].data.value=document.forms[0].datainizio.value+":"+document.forms[0].datafine.value;
	}
//	document.forms[0].toCharge.value=toPage;
	document.login.toCharge.value=toPage;
	//CARICO I SELEZIONATI
	document.forms[0].submit();
}
//LOAD DA CATALOGO
function loadCorso(corso) {
	//TESTARE SE I CAMPI LOGIN SONO O NO PIENI
	document.forms[0].acct_name.value="";
	document.forms[0].acct_pass.value="";
	var pCor = document.forms[0].toCharge.value;
	document.forms[0].toCharge.value=pCor+":"+corso;
	//CARICO I SELEZIONATI
	document.forms[0].submit();
}
//Submit via return key
function preLogin(evnt) {
	//SE INVIO FACCIO IL SUBMIT
	if(evnt!=null && evnt!="undefined" && evnt.keyCode!=null && evnt.keyCode==13){
		document.forms[0].submit();
	}
}
//Submit
function login() {
	document.forms[0].submit();
}
//Submit iscrizioni
function goIscrizione(obj,value) {
	if(obj=="next" && document.forms[1].provaprivacy!="undefined" && document.forms[1].provaprivacy!=null && document.forms[1].provaprivacy.value!="1" ){
		//alert ("valore di vorname " + document.forms[1].vorname.value);
		//document.forms[1].vorname1.value=document.forms[1].vorname.value;
//		alert("Attenzione bisogna accettare almeno il primo punto delle norme sulla privacy per poter proseguire.");
		alert("Attenzione è necessario accettare le condizioni d'utilizzo del serivizio.");
		//document.forms[1].submit();
	}else{
	
		document.forms[1].privacy_1.value=1;
		//COMMENTATO PERCHE' SELEZIONE PORTATA INTERNAMENTE
	//	if(document.forms[1].subiscrizione.value==1){
	//		document.forms[1].corsisel.value = document.forms[0].selezionati.value;
	//	}
	//	if(document.forms[1].corsisel.value==""){
	//		alert("Non ci sono corsi selezionati non è possibile proseguire.");
	//	}else{
			document.forms[1].subiscrizione.value=value;
			document.forms[1].submit();
	//	}
	
	}
}
//Submit iscrizioni
function goIscrizioneAzienda(obj,value) {
	if(obj=="next" && document.forms[1].provaprivacy!="undefined" && document.forms[1].provaprivacy!=null && document.forms[1].provaprivacy.value!="1" ){
		//alert ("valore di vorname " + document.forms[1].vorname.value);
		//document.forms[1].vorname1.value=document.forms[1].vorname.value;
//		alert("Attenzione bisogna accettare almeno il primo punto delle norme sulla privacy per poter proseguire.");
		alert("Attenzione è necessario accettare almeno il primo punto sulla privacy.");
		//document.forms[1].submit();
	}else{
		if (document.forms[1].ragionesociale.value=="" || document.forms[1].ragionesociale.value=="undefined") {
			alert("Inserire la ragione sociale dell'azienda.");
		} else 	if (document.forms[1].referente.value=="" || document.forms[1].referente.value=="undefined") {
			alert("Inserire il nominativo del referente dell'azienda.");
		}else if (document.forms[1].email.value=="" || document.forms[1].email.value=="undefined") {
			alert("Inserire l'email aziendale.");
		}else if (document.forms[1].telefono.value=="" || document.forms[1].telefono.value=="undefined") {
			alert("Inserire il numero di telefono aziendale.");
		}
		else {	document.forms[1].privacy_1.value=1;
		//COMMENTATO PERCHE' SELEZIONE PORTATA INTERNAMENTE
	//	if(document.forms[1].subiscrizione.value==1){
	//		document.forms[1].corsisel.value = document.forms[0].selezionati.value;
	//	}
	//	if(document.forms[1].corsisel.value==""){
	//		alert("Non ci sono corsi selezionati non è possibile proseguire.");
	//	}else{
			document.forms[1].subiscrizione.value=value;
			document.forms[1].submit();
	//	}
		}
	
	}
}

//procedura che verifica la validità dei giorni e dei mesi 
function GiorniMese(giorni, mese) {
	//alert("valore del mese" + mese + "valore del giorno" + giorni);
	switch(mese) {
		case "01": {
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di gennaio non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "02": {
			if (giorni<01 || giorni>29) {
				alert("giorno del mese di febbraio non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "03": {
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di marzo non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "04": {
			if (giorni<01 || giorni>30) {
				alert("giorno del mese di aprile non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "05": {
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di maggio non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "06": {
			if (giorni<01 || giorni>30) {
				alert("giorno del mese di giugno non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "07":{
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di luglio non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "08":{
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di agosto non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "09": {
			if (giorni<01 || giorni>30) {
				alert("giorno del mese di settembre non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "10": {
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di ottobre non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "11": {
			if (giorni<01 || giorni>30) {
				alert("giorno del mese di novembre non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		case "12": {
			if (giorni<01 || giorni>31) {
				alert("giorno del mese di dicembre non valido!");
				return false;
			}
			else {
				return true;
			}
		}break;
		default: {
			alert("la data inserita non è valida!" );
			return false;
		}break;
	}
}
//CONTROLLA LA VALIDITA'DI UNA DATA
function validaData(obj) {
	var oggi=new Date();
	var maggiore=true;
	var toFind="/";
	var toFind2="00"
	var vDate = obj.value;
	var bool = false;
	k=0;
	if((vDate!="" && vDate.substring(6,8)=="19") ||(vDate!="" && vDate.substring(6,8)=="20")){
		if(vDate.indexOf(toFind)==-1){
			toFind="-";
		}
		if (vDate.substring(2,3) != toFind ||
		vDate.substring(5,6) != toFind ||
		isNaN(vDate.substring(0,2)) ||
		isNaN(vDate.substring(3,5)) ||
		isNaN(vDate.substring(6,10))) {
				alert("Inserire la data in formato gg/mm/aaaa o gg-mm-aaaaa");
				obj.value = "";
				obj.focus();
				obj.select();
				return false;
			}
		
			
	/*else if (vDate.substring(0,2) > 31) {
		obj.value = "";
		obj.focus();
		alert("Impossibile utilizzare un valore superiore a 31 per i giorni");
		return false;
		}

		else if (vDate.substring(3,5) > 12) {
		obj.value = "";
		obj.focus();
		alert("Impossibile utilizzare un valore superiore a 12 per i mesi");
		return false;
		}

		else if (vDate.substring(6,10) < 1900) {
		obj.value = "";
		obj.focus();
		alert("Impossibile utilizzare un valore inferiore a 1900 per l'anno");
		return false;
		}*/
		else {
			if(vDate.indexOf(toFind2)!=-1){
				alert("Data non valida! ");
				obj.value = "";
				obj.focus();
				obj.select();
			}	
			else {
				bool=GiorniMese(vDate.substring(0,2), vDate.substring(3,5));
			}
			/*if(bool==false) {
				alert("la data non è valida");
				return false;
			}*/
		}
		anno=oggi.getYear();
		if(anno<2000){
			anno=anno+1900;
		}
		//MAGGIORE ETA'
		 if( vDate.substring(6,10) >=(anno-18)){
		 	maggiore=false;
			if (vDate.substring(6,10) ==(anno-18)){
				maggiore=true;
				if (vDate.substring(3,5) >= (oggi.getMonth()+1)){
					maggiore=false;
					if (vDate.substring(3,5) == (oggi.getMonth()+1) ){
						maggiore=true;
						if (vDate.substring(0,2) >= oggi.getDate()){
							maggiore=false;
							if (vDate.substring(0,2) == oggi.getDate()){
								maggiore=true;
							}
						}
					}
				}
			}
		}

		if(maggiore==true && vDate.indexOf(toFind2)==-1){
			obj.value = vDate.substring(0,2)+"-"+vDate.substring(3,5)+"-"+vDate.substring(6,10);
		}else{
			alert("L'iscrizione non è permessa ai MINORI");
			obj.value = "";
			obj.focus();
			obj.select();
			return false;
		}
	}
	else{
		alert("Inserire la data in formato gg/mm/aaaa o gg-mm-aaaaa");
		obj.value = "";
		obj.focus();
		obj.select();
		return false;
	}
	if (bool==false) {
		obj.value = "";
		obj.focus();
		obj.select();
	}
}


//checkMaggiorenne
function isMaggiorenne() {
 	if(document.forms[1].cmagg.checked=="false"){
		document.forms[1].maggiorenne.value="";
	}else{
		if(validaData(document.forms[1].datanascita)!="false"){
			document.forms[1].maggiorenne.value="checked";
		}else{
			document.forms[1].maggiorenne.value="";
			document.forms[1].cmagg.checked="false";
		}
	}
}


//GESTIONE SELEZIONE-DESELEZIONE CORSI
function selectCorso(obj){
	var sel = document.forms[0].selezionati.value;
	var valore = obj.name;
	if(obj.checked){
		if(sel.length>0){
			sel=sel+separatore+valore;
		}else{
			sel=sel+valore;
		}
	}else{
		var temp = separatore+sel+separatore;
		var tofind=separatore+valore+separatore;
		var da = temp.indexOf(tofind);
		temp = temp.substring(0,da)+separatore+temp.substring((da+tofind.length),temp.length);
		sel = temp.substring(1,temp.length-1);
		if(sel==separatore){
			sel="";
		}
	}
	document.forms[0].selezionati.value=sel;
}

//CARICA FROM COMBO
function loadComboPage(toPage,obj){
	document.forms[0].pag.value=obj.value;
	loadPage(toPage);
}

//GESTISCE COMBO NAZIONE
function comboCountry(){
	var numRow = document.forms[1].nazione.value-69;
	var descnazione = "";
	//alert(document.forms[1].land.disabled);
	document.forms[1].land.readOnly=true;
	if(document.forms[1].nazione.value==309){
		document.forms[1].land.readOnly=false;
	}else{
		descnazione = document.forms[1].nazione.options[numRow].text
	}
	document.forms[1].land.value=descnazione;
}

function changeStatus(obj){

}

//procedura che controlla il codice fiscale e la lunghezza della partita iva
function checkCFPI(cfins)
   {
	var k=0;
	var sText = document.forms[1].cfpi.value;
	var k = document.forms[1].cfpi.value.length;
	/*var temp = cfins.value;
	alert("document.forms[1].cfpi.value = " +document.forms[1].cfpi.value+ "lunghezza = " +document.forms[1].cfpi.value.length );
	alert("p = " +p+ "lunghezza = " +p.lenght );
	alert("temp = " +temp+ "lunghezza = " +p.lenght );
	for (i=0; i<16; i++) {
		alert("temp[i] = " + temp[i]);
		if (temp[i]!=undefined || temp[i]!="undefined" || temp[i]!=" " ) {
			k++;
		}
	}*/
	switch (k) {
		case 16: {
			var cf=cfins.value.toUpperCase();
			var cfReg = /^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/;
		   if (!cfReg.test(cf)) {
      			alert("Codice Fiscale errato");
				document.forms[1].cfpi.focus();
				document.forms[1].cfpi.value="";
	  			return false;
		   }
   			var set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var set2 = "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var setpari = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var setdisp = "BAKPLCQDREVOSFTGUHMINJWZYX";
   			var s = 0;
   			for( i = 1; i <= 13; i += 2 )
      			s += setpari.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
		   for( i = 0; i <= 14; i += 2 )
      			s += setdisp.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
		   if ( s%26 != cf.charCodeAt(15)-'A'.charCodeAt(0) ){
      			alert("Codice Fiscale errato");
				document.forms[1].cfpi.focus();
				document.forms[1].cfpi.value="";
	  			return false;
		   }
		}break;
		case 11: {
			  var ValidChars = "0123456789.";
			  var IsNumber=true;
			  var Char;
			
			   for (i = 0; i < sText.length && IsNumber == true; i++) 	  { 
				  Char = sText.charAt(i); 
				  if (ValidChars.indexOf(Char) == -1)  			 {
						alert("la P.Iva inserita non è numerico! " );
						document.forms[1].cfpi.focus();
						document.forms[1].cfpi.value="";
						IsNumber = false;
				 }
		  	  }
			return IsNumeric;
		} break;
		case 0: {
			return true;
		} break;
		
		default: {
			alert("Lunghezza del codice fisascle a P. Iva non valida" );
			document.forms[1].cfpi.focus();
			document.forms[1].cfpi.value="";
			return false;
		} break;
	}

   return true;
   }
   
//procedura che controlla la mail inserita
function checkEmailAddress(field) {
// Note: The next expression must be all on one line...
//       allow no spaces, linefeeds, or carriage returns!
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (goodEmail){
   		good = true
	} else {
   		alert('Inserire un indirizzo email valido!')
   		field.focus()
   		field.select()
   		good = false
   }
   return good;
}
/*Procedura che controlla se la stringa è un numero*/
function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 	if (sText.length!=5)  {
		alert("il cap inserito non è di 5 caratteri! " );
		document.forms[1].plz.focus();
		document.forms[1].plz.value="";
		IsNumber = false;
	
	}
	else {
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
				alert("il cap inserito non è numerico! " );
				document.forms[1].plz.focus();
				document.forms[1].plz.value="";
				IsNumber = false;
			 }
		  }

		}
   return IsNumber;
   
   }
    
   //CONTROLLA LA VALIDITA'DI UNA DATA
function Data(obj) {
	var oggi=new Date();
	var maggiore=true;
	var toFind="/";
	var vDate = obj.value;
	if (vDate.indexOf(toFind)!=-1) {
		alert("specificare la data nel formato gg-mm-aaaa");
		return false;
	}
	else {
			bool=GiorniMese(vDate.substring(0,2), vDate.substring(3,5));
	}		
}

function MakeLink()   {
	//varibili per la costruzione del link
	var vorname=document.forms[1].vorname.value;
	var nachname=document.forms[1].nachname.value;
	var benutzername=document.forms[1].benutzername.value;
	var plz=document.forms[1].plz.value;
	if (document.forms[1].anrede[0].value!='undefined') { 
		var anrede=document.forms[1].anrede[0].value;
	}
	else if (document.forms[1].anrede[1].value!="undefined") {
		var anrede=document.forms[1].anrede[1].value;
	}
	var status=document.forms[1].status.value;
	//var atitel=document.forms[1].atitel.value;
	var strasse=document.forms[1].strasse.value;
	var institution=document.forms[1].institution.value;
	var ort=document.forms[1].ort.value;
	var land=document.forms[1].land.value;
	var telefon=document.forms[1].telefon.value;
	var email=document.forms[1].email.value;
	var lang=document.forms[1].lang.value;
	var cfpi=document.forms[1].cfpi.value;
	var provincia=document.forms[1].provincia.value;
	var luogonascita=document.forms[1].luogonascita.value;
	var datanascita=document.forms[1].datanascita.value;
	var maggiorenne=document.forms[1].maggiorenne.value;
	var p1=document.forms[1].privacy_1.value;		
	var p2=document.forms[1].privacy_2.value;
	var p3=document.forms[1].privacy_3.value;
		
//	link='login.php?req_uri=%2Filias%2F&set_lang=&toCharge=mod-privacy&vorname='+vorname+'&nachname='+nachname+'&benutzername='+benutzername+'&anrede='+anrede+'&strasse='+strasse+'&telefon='+telefon+'&cfpi='+cfpi+'&provincia='+provincia+'&luogonascita='+luogonascita+'&datanascita='+datanascita+'&email='+email+'&institution='+institution+'&email='+email+'&maggiorenne=' + maggiorenne + "&privacy_1="+p1+"&privacy_2="+p2+"&privacy_3="+p3;	
	link='login.php?req_uri=%2Filias%2F&set_lang=&toCharge=mod-privacy&vorname='+vorname+'&nachname='+nachname+'&benutzername='+benutzername+'&anrede='+anrede+'&strasse='+strasse+'&telefon='+telefon+'&cfpi='+cfpi+'&provincia='+provincia+'&luogonascita='+luogonascita+'&datanascita='+datanascita+'&email='+email+'&institution='+institution+'&email='+email+'&maggiorenne=' + maggiorenne ;	
	location.href=link;
	//location.href=target;
}


// Verifica Partita Iva
/*function checkPIVA(pi)  {
	if( pi == '' ) return false;
	if( pi.length != 11 )   {
		alert( "La lunghezza della partita IVA non è\n" +
		"corretta: la partita IVA dovrebbe essere lunga\n" +
		"esattamente 11 caratteri.\n");
		return false;
	}
	validi = "0123456789";
	for( i = 0; i < 11; i++ ){
		if( validi.indexOf( pi.charAt(i) ) == -1 ) 
			alert( "La partita IVA contiene un carattere non valido `" + pi.charAt(i) + "'.\nI caratteri validi sono le cifre.\n");
			return false;
		}
	}
	s = 0;
	for( i = 0; i <= 9; i += 2 )
		s += pi.charCodeAt(i) - '0'.charCodeAt(0);
	for( i = 1; i <= 9; i += 2 ){
		c = 2*( pi.charCodeAt(i) - '0'.charCodeAt(0) );
			if( c > 9 ) c = c - 9;
				s += c;
	}
	if( ( 10 - s%10 )%10 != pi.charCodeAt(10) - '0'.charCodeAt(0) ) {
		alert( "La partita IVA non è valida:\n" + "il codice di controllo non corrisponde.\n");
		return false;
	}
	return true;

}*/

//procedura che controlla il codice fiscale e la lunghezza della partita iva
function checkCFPIReg(cfins)
   {
	var k=0;
	var sText = document.forms[0].cfpi.value;
	var k = document.forms[0].cfpi.value.length;
	/*var temp = cfins.value;
	alert("document.forms[1].cfpi.value = " +document.forms[1].cfpi.value+ "lunghezza = " +document.forms[1].cfpi.value.length );
	alert("p = " +p+ "lunghezza = " +p.lenght );
	alert("temp = " +temp+ "lunghezza = " +p.lenght );
	for (i=0; i<16; i++) {
		alert("temp[i] = " + temp[i]);
		if (temp[i]!=undefined || temp[i]!="undefined" || temp[i]!=" " ) {
			k++;
		}
	}*/
	switch (k) {
		case 16: {
			var cf=cfins.value.toUpperCase();
			var cfReg = /^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/;
		   if (!cfReg.test(cf)) {
      			alert("Codice Fiscale errato");
				document.forms[0].cfpi.focus();
				document.forms[0].cfpi.value="";
	  			return false;
		   }
   			var set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var set2 = "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var setpari = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   			var setdisp = "BAKPLCQDREVOSFTGUHMINJWZYX";
   			var s = 0;
   			for( i = 1; i <= 13; i += 2 )
      			s += setpari.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
		   for( i = 0; i <= 14; i += 2 )
      			s += setdisp.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
		   if ( s%26 != cf.charCodeAt(15)-'A'.charCodeAt(0) ){
      			alert("Codice Fiscale errato");
				document.forms[0].cfpi.focus();
				document.forms[0].cfpi.value="";
	  			return false;
		   }
		}break;
		case 11: {
			  var ValidChars = "0123456789.";
			  var IsNumber=true;
			  var Char;
			
			   for (i = 0; i < sText.length && IsNumber == true; i++) 	  { 
				  Char = sText.charAt(i); 
				  if (ValidChars.indexOf(Char) == -1)  			 {
						alert("la P.Iva inserita non è numerico! " );
						document.forms[0].cfpi.focus();
						document.forms[0].cfpi.value="";
						IsNumber = false;
				 }
		  	  }
			return IsNumeric;
		} break;
		case 0: {
			return true;
		} break;
		
		default: {
			alert("Lunghezza del codice fisascle a P. Iva non valida" );
			document.forms[0].cfpi.focus();
			document.forms[0].cfpi.value="";
			return false;
		} break;
	}

   return true;
   }
   
   /*Procedura che controlla se la stringa è un numero*/
function IsNumericReg(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 	if (sText.length!=5)  {
		alert("il cap inserito non è di 5 caratteri! " );
		document.forms[0].plz.focus();
		document.forms[0].plz.value="";
		IsNumber = false;
	
	}
	else {
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
				alert("il cap inserito non è numerico! " );
				document.forms[0].plz.focus();
				document.forms[0].plz.value="";
				IsNumber = false;
			 }
		  }

		}
   return IsNumber;
   
   }
   
function MakeLinkAzienda()   {
	//varibili per la costruzione del link
	var rg=document.forms[1].ragionesociale.value;
	var referente=document.forms[1].referente.value;
	var email=document.forms[1].email.value;
	var telefono=document.forms[1].telefono.value;
	var fax=document.forms[1].fax.value;
	var p1=document.forms[1].privacy_1.value;		
	var p2=document.forms[1].privacy_2.value;
	
		
//	link='login.php?req_uri=%2Filias%2F&set_lang=&toCharge=mod-privacy&vorname='+vorname+'&nachname='+nachname+'&benutzername='+benutzername+'&anrede='+anrede+'&strasse='+strasse+'&telefon='+telefon+'&cfpi='+cfpi+'&provincia='+provincia+'&luogonascita='+luogonascita+'&datanascita='+datanascita+'&email='+email+'&institution='+institution+'&email='+email+'&maggiorenne=' + maggiorenne + "&privacy_1="+p1+"&privacy_2="+p2+"&privacy_3="+p3;	
	link='login.php?req_uri=%2Filias%2F&set_lang=&toCharge=privacy-azienda&ragionesociale='+rg+'&referente='+referente+'&email='+email+'&telefono='+telefono+'&fax='+fax ;	
	location.href=link;
	//location.href=target;
}
   
   
   
