
function validazione(){ 
	

	//if(document.getElementById("persona").value=="seleziona") {
	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("name").value==""){
			alert("Inserire nominativo del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("name1").value==""){
			alert("Inserire nominativo del mittente");
			return false;
		}
	
	}
	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("ragione").value==""){
			alert("Inserire ragione sociale");
			return false;
		}
	}
	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("codice").value==""){
			alert("Inserire  C.F. o P.I. del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("codice1").value==""){
			alert("Inserire  C.F. o P.I. del mittente");
			return false;
		}
	
	}
if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("mail").value==""){
			alert("Inserire  mail del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("mail1").value==""){
			alert("Inserire  mail del mittente");
			return false;
		}
	
	}
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="rimborso_spese")	{
		if(document.getElementById("luogo").value==""){
			alert("Inserire luogo");
			return false;
		}
	}
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="pagamento_notula_fattura")	{
		if(document.getElementById("incarico").value==""){
			alert("Inserire protocollo incarico");
			return false;
		}
	}

	
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="rimborso_spese")	{
		if(document.getElementById("data").value==""){
			alert("Inserire data");
			return false;
		}
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="pagamento_notula_fattura")	{
		if(document.getElementById("data1").value==""){
			alert("Inserire data");
			return false;
		}
	
	}
	
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="rimborso_spese")	{
		if(document.getElementById("progetto").value==""){
			alert("Inserire progetto di riferimento");
			return false;
		}
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="pagamento_notula_fattura")	{
		if(document.getElementById("progetto1").value==""){
			alert("Inserire progetto di riferimento");
			return false;
		}
	
	}
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="pagamento_notula_fattura")	{
		if(document.getElementById("dati").value==""){
			alert("Inserire dati identificativi");
			return false;
		}
	}

	
if(document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="seleziona1") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="rimborso_spese")	{
		if(document.getElementById("note").value==""){
			alert("Inserire note");
			return false;
		}
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="pagamento_notula_fattura")	{
		if(document.getElementById("note1").value==""){
			alert("Inserire note");
			return false;
		}
	
	}
	if (document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value=="richiesta_generica")	{
		if(document.getElementById("note2").value==""){
			alert("Inserire note");
			return false;
		}
	
	}

if(document.getElementById("privacy1").checked==false) {
	alert("Per inviare la richiesta informazioni devi acconsentire al trattamento dei tuoi dati");
	return false;
	}

return true;
}

function validazione1(){  
	

	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("name").value==""){
			alert("Inserire nominativo del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("name1").value==""){
			alert("Inserire nominativo del mittente");
			return false;
		}
	
	}
	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("ragione").value==""){
			alert("Inserire ragione sociale");
			return false;
		}
	}
	if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("codice").value==""){
			alert("Inserire  C.F. o P.I. del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("codice1").value==""){
			alert("Inserire  C.F. o P.I. del mittente");
			return false;
		}
	
	}
if(document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="seleziona") {
	alert("Inserire persona fisica o giuridica");
	return false;
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_fisica")	{
		if(document.getElementById("mail").value==""){
			alert("Inserire  mail del mittente");
			return false;
		}
	}
	if (document.modulo.persona.options[document.modulo.persona.selectedIndex].value=="persona_giuridica")	{
		if(document.getElementById("mail1").value==""){
			alert("Inserire  mail del mittente");
			return false;
		}
	
	}





if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="rimborso_spese1")	{
		if(document.getElementById("luogo_1").value==""){
			alert("Inserire luogo");
			return false;
		}
	}
if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="pagamento_notula_fattura1")	{
		if(document.getElementById("incarico_1").value==""){
			alert("Inserire protocollo incarico");
			return false;
		}
	}

	
if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="rimborso_spese1")	{
		if(document.getElementById("data_1").value==""){
			alert("Inserire data");
			return false;
		}
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="pagamento_notula_fattura1")	{
		if(document.getElementById("data1_1").value==""){
			alert("Inserire data");
			return false;
		}
	
	}
	
if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="rimborso_spese1")	{
		if(document.getElementById("progetto_1").value==""){
			alert("Inserire progetto di riferimento");
			return false;
		}
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="pagamento_notula_fattura1")	{
		if(document.getElementById("progetto1_1").value==""){
			alert("Inserire progetto di riferimento");
			return false;
		}
	
	}
if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="pagamento_notula_fattura1")	{
		if(document.getElementById("dati_1").value==""){
			alert("Inserire dati identificativi");
			return false;
		}
	}

	
if(document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="seleziona2") {
	alert("Inserire causale");
	return false;
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="rimborso_spese1")	{
		if(document.getElementById("note_1").value==""){
			alert("Inserire note");
			return false;
		}
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="pagamento_notula_fattura1")	{
		if(document.getElementById("note1_1").value==""){
			alert("Inserire note");
			return false;
		}
	
	}
	if (document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value=="richiesta_generica1")	{
		if(document.getElementById("note2_1").value==""){
			alert("Inserire note");
			return false;
		}
	
	}
	if(document.getElementById("privacy2").checked==false) {
	alert("Per inviare la richiesta informazioni devi acconsentire al trattamento dei tuoi dati");
	return false;
	}
	
return true;
}




function show(whichLayer){
	if (document.getElementById){
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "block";
	}
	else if (document.all)
	{
		var style2 = document.all[whichLayer].style;
		style2.display =  "block";
	}
	else if (document.layers)
	{
		var style2 = document.layers[whichLayer].style;
		style2.display =  "block";
	}
}
function hide(whichLayer){
	if (document.getElementById){
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "none";
	}
	else if (document.all)
	{
		var style2 = document.all[whichLayer].style;
		style2.display =  "none";
	}
	else if (document.layers)
	{
		var style2 = document.layers[whichLayer].style;
		style2.display =  "none";
	}
}
function cambia_div(whichLayer){
	var scelta = document.modulo.persona.options[document.modulo.persona.selectedIndex].value;
	if (scelta == 'persona_fisica')	{
		show('rs');
		hide('rs1');
	}
	else if (scelta == 'persona_giuridica')	{
		show('rs1');
		hide('rs');
	}
}
function causale_div(whichLayer){
	var scelta1 = document.modulo1.causale.options[document.modulo1.causale.selectedIndex].value;
	if (scelta1 == 'rimborso_spese')	{
		show('rc');
		hide('rc1');
		hide('rc2');
	}
	else if (scelta1 == 'pagamento_notula_fattura')	{
		show('rc1');
		hide('rc');
		hide('rc2');
	}
	else if (scelta1 == 'richiesta_generica')	{
		show('rc2');
		hide('rc');
		hide('rc1');
	}
}
function causale2_div(whichLayer){
	var scelta1 = document.modulo2.causale2.options[document.modulo2.causale2.selectedIndex].value;
	if (scelta1 == 'rimborso_spese1')	{
		show('rc_1');
		hide('rc1_1');
		hide('rc2_1');
	}
	else if (scelta1 == 'pagamento_notula_fattura1')	{
		show('rc1_1');
		hide('rc_1');
		hide('rc2_1');
	}
	else if (scelta1 == 'richiesta_generica1')	{
		show('rc2_1');
		hide('rc_1');
		hide('rc1_1');
	}
}




