function formatta_77(stringa){
	var temp = new String(stringa);
	temp = temp.split('_');
	temp = temp.join(' ');
	return temp.substr(0,(temp.length-1));
}

function controllo_77(nomeform){
	var msg_errore = '';
	var ultimo = '';
	var nomecampo = '';
	var formdin = eval('document.'+nomeform+'\;');
	for(i=0;i<formdin.elements.length;i++){
		if(formdin.elements[i].type=="text"){
			//controllo il nome
			nomecampo = formdin.elements[i].name;
			ultimo = nomecampo.charAt(nomecampo.length-1)
			if(ultimo == '#'){
				//controllo che il campo sia pieno
				if(formdin.elements[i].value==""){
					msg_errore = msg_errore + 'Il campo "' + formatta_77(nomecampo) + "\" è obbligatorio.\n";
				}
			}
			else if(ultimo == '@'){
				//controllo che il campo sia una mail valida
				if(formdin.elements[i].value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
					msg_errore = msg_errore + 'Il campo "' + formatta_77(nomecampo) + "\" deve essere una mail valida.\n";
				}
			}
		}
	}
	//controllo i dati e mando la risposta
	if(msg_errore == ''){
		return true;
	}else{
		alert(msg_errore);
		return false;
	}
}