// check multi checkboxes based on the name passed in.
function CheckMultiple(name) 
{
	theFrm = document.frmSS;
	for (var i=0; i < theFrm.length; i++) 
	{
		fldObj = theFrm.elements[i];
		var fieldnamecheck=fldObj.name.indexOf(name);
		if (fieldnamecheck != -1) {
			if (fldObj.checked) {
				return true;
			}
		}
	}
	return false;
}
function CheckSS()
{
	theMsg = '';
	error = false;
	
	theFrm = document.frmSS;

	valcheck = document.getElementById("Fields[277]");
	if (valcheck.value == "") {
		theMsg += "Inserisci il nome.\n";
		error = true;
	} else {
		var minsize_277 = 0;
		var maxsize_277 = 100;
		var fieldlength = 0;
		fieldlength = valcheck.value.length;
		if (fieldlength < minsize_277) {
			theMsg += "Inserisci un valore valido per 'Nome e Cognome' lungo almeno " + minsize_277 + " caratteri\n";
			error = true;
		}
		if (fieldlength > maxsize_277) {
			theMsg += "Inserisci un valore valido per 'Nome e Cognome' non pił lungo di " + maxsize_277 + " caratteri\n";
			error = true;
		}
	}
	
	hasDot = theFrm.Email.value.indexOf(".");
	hasAt = theFrm.Email.value.indexOf("@");
	if (hasDot == -1 || hasAt == -1)
	{
		theMsg += "Inserisci un indirizzo e-mail valido.\n";
		error = true;
	}
	
	if(!theFrm.tratt_dati.checked) {
		theMsg += "E' necessario acconsentire al trattamento dei dati personali.\n";
		error = true;
	}
	
	if(error) {
		alert(theMsg);
		return false;
	}
}

function Checkform()
{
	theMsg = '';
	error = false;
	
	theFrm = document.frmSS;

	valcheck = document.getElementById("Fields[277]");
	if (valcheck.value == "" || valcheck.value == "nome") {
		theMsg += "Inserisci il nome.\n";
		error = true;
	} else {
		var minsize_277 = 0;
		var maxsize_277 = 100;
		var fieldlength = 0;
		fieldlength = valcheck.value.length;
		if (fieldlength < minsize_277) {
			theMsg += "Inserisci un valore valido per 'Nome' lungo almeno " + minsize_277 + " caratteri\n";
			error = true;
		}
		if (fieldlength > maxsize_277) {
			theMsg += "Inserisci un valore valido per 'Nome e Cognome' non pił lungo di " + maxsize_277 + " caratteri\n";
			error = true;
		}
	}
	
	hasDot = theFrm.Email.value.indexOf(".");
	hasAt = theFrm.Email.value.indexOf("@");
	if (hasDot == -1 || hasAt == -1)
	{
		theMsg += "Inserisci un indirizzo e-mail valido.\n";
		error = true;
	}
	
	if(error) {
		alert(theMsg);
		return false;
	}
}


