function ViewSomma(){
	var cosa=document.dona.somma.options[document.dona.somma.selectedIndex].value;
	if(cosa=="altro"){
		document.getElementById('importoDIV').style.display="block";
	} else {
		document.getElementById('importoDIV').style.display="none";
	}

}
function ViewCat(){
	var cosa=document.dona.cat.options[document.dona.cat.selectedIndex].value;
	if(cosa=="altro"){
		document.getElementById('altroDIV').style.display="block";
	} else {
		document.getElementById('altroDIV').style.display="none";
	}

}
function ViewContact(){
	var cosa=document.contact.feed.options[document.contact.feed.selectedIndex].value;
	if(cosa=="InfoAltro"){
		document.getElementById('altroche').style.display="block";
	} else {
		document.getElementById('altroche').style.display="none";
	}
}

function validaDono(nomeform){
	var rit=true;
	var ritRB = "";
	rit=Stringa(rit,true,nomeform.nome,'Name',null,null,true); 
	rit=Stringa(rit,true,nomeform.cognome,'Surname',null,null,true); 
	rit=SelectCheck(rit,true,nomeform.nazione,'Nation',null,true);
	rit=Stringa(rit,true,nomeform.citta,'City',null,null,true); 
	if(nomeform.nazione.options[nomeform.nazione.selectedIndex].value == "IT") {
		rit=SelectCheck(rit,true,nomeform.prS,'Country',null,true); 
	} else {
		rit=Caratteri(rit,false,nomeform.pr,'Country',2,30,true); 
	}
	rit=Stringa(rit,true,nomeform.indirizzo,'Address',null,null,true); 
	rit=Stringa(rit,false,nomeform.civico,'Home number',null,null,false); 
	if(nomeform.nazione.options[nomeform.nazione.selectedIndex].value == "IT") {
		rit=Numero(rit,true,nomeform.capIT,'ZIP Code',5,5,true);
	} else {
		rit=Numero(rit,true,nomeform.cap,'ZIP Code',4,15,true);
	}
	rit=Numero(rit,false,nomeform.tel,'Telephone',9,17,true);
	rit=Numero(rit,false,nomeform.fax,'Fax',9,17,true);
	rit=CheckEmail(rit,true,nomeform.email,'Email',true);
	rit=CheckEmail(rit,true,nomeform.cnf_email,'Confirm Email',true);
	if((rit)&&(nomeform.email.value!=nomeform.cnf_email.value)) {
		rit=false;
		alert("The email field and the field confirmation email are not equal.");
		ColorValidate(false,nomeform.email,true)
		ColorValidate(false,nomeform.cnf_email,true)
	}	
	rit=Importo(rit,true,nomeform.importo,'Amount',true);
	rit=SelectCheck(rit, true,nomeform.cat,'Designation', null, true);
	if (nomeform.cat[nomeform.cat.selectedIndex].value == 'other'){
		rit=Stringa(rit,true,nomeform.altroTXT,'Designation',null,null,true); 
	}
	/*ritRB=RBCheck(nomeform.informazioni);
	if(ritRB == "") {
		if(rit) alert("Indicate whether you wish to receive information on future initiatives of the Vatican Library");	
		rit=false;
	}*/
	if (rit) nomeform.submit();
}
function validaPartecipo(nomeform){
	var rit=true;
	rit=Stringa(rit,true,nomeform.nome,'Name',null,null,true); 
	rit=Stringa(rit,true,nomeform.cognome,'Surname',null,null,true); 
	rit=CheckEmail(rit,true,nomeform.email,'Email',true);
	rit=Stringa(rit,true,nomeform.indirizzo,'Address',null,null,true); 
	rit=Stringa(rit,false,nomeform.istituzione,'Istitution',null,null,false); 
	if (rit) nomeform.submit();
}

function validaPer(nomeform){
	var rit=true;
	if(nomeform.emailcnt.type != "hidden") {
		if(nomeform.feed.type != "hidden") {
			var cosa=nomeform.feed.options[nomeform.feed.selectedIndex].value;
			if(cosa=="InfoAltro"){
				rit=Stringa(rit,true,nomeform.argomento,'Object',null,100,true); 
			}
		}
		rit=CheckEmail(rit,true,nomeform.emailcnt,'Email sender',true); 
		rit=CheckEmail(rit,true,nomeform.cemailcnt,'Confirm email sender',true); 
		if((rit)&&(nomeform.emailcnt.value!=nomeform.cemailcnt.value)) {
			rit=false;
			alert("The email field and the field confirmation email are not equal.");
		}
	}
	rit=Stringa(rit,true,nomeform.testo,'Text of Messagge',null,null,true); 
	if (rit) nomeform.submit();
}
function validaERR(nomeform){
	var rit=true;
	if(nomeform.emailcntERR.type != "hidden") {
		rit=CheckEmail(rit,true,nomeform.emailcntERR,'Email sender',true); 
		rit=CheckEmail(rit,true,nomeform.cemailcntERR,'Confirm Email sender',true); 
		if((rit)&&(nomeform.emailcntERR.value!=nomeform.cemailcntERR.value)) {
			rit=false;
			alert("The email field and the field confirmation email are not equal.");
		}
	}
	rit=Stringa(rit,true,nomeform.testoERR,'Text of Messagge',null,null,true); 
	if (rit) nomeform.submit();
}

function validaDip(nomeform){
	var rit=true;
	rit=Stringa(rit,true,nomeform.argomentoDip,'Object',null,100,true); 
	rit=Stringa(rit,true,nomeform.testoDip,'Text of Messagge',null,null,true); 
	if (rit) nomeform.submit();
}

function validaUff(nomeform){
	var rit=true;
	rit=Stringa(rit,true,nomeform.argomentoUff,'Object',null,100,true); 
	rit=Stringa(rit,true,nomeform.testoUff,'Text of Messagge',null,null,true); 
	if (rit) nomeform.submit();
}
function validaSugg(nomeform) {
	var rit=true;
	rit=Stringa(rit,true,nomeform.titolo,'Title',2,null,true); 
	rit=Stringa(rit,true,nomeform.autore,'Author or Authors',2,null,true); 
	rit=Stringa(rit,false,nomeform.collana,'Collaction',2,null,true); 
	rit=Stringa(rit,false,nomeform.casaedit,'Publishing House',2,null,true);
	rit=Numero(rit,false,nomeform.anno,'Year of publication',4,4,true);
	rit=Stringa(rit,true,nomeform.note,'Notes',2,200,true); 
	if (rit) nomeform.submit();
}

function validaDelNewsletter(nomeform) {
	var ret=true;
	ret=CheckEmail(ret,true,nomeform.utente, 'Email',true);
	if (ret) nomeform.submit();
}

function validaDonazione(nomeform) {
	var ret=false;
	ret=RBCheck(nomeform.cat);
	if(ret == false) {
		alert("Select an option, please.");
	}
	if (ret) nomeform.submit();

}
