// 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()
{
	theFrm = document.frmSS;

	hasDot = theFrm.Email.value.indexOf(".");
	hasAt = theFrm.Email.value.indexOf("@");
	
	if (hasDot == -1 || hasAt == -1)
	{
		alert("Indirizzo email non valido.");
		theFrm.Email.focus();
		theFrm.Email.select();
		return false;
	}

	
	return true;
}


function Validator(theForm)
{
	if (theForm.Email.value == "") {
		alert("Attenzione, immettere un indirizzo e-mail");
		theForm.Email.focus();
		return false;
  }
  if (theForm.Email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
		alert("Attenzione, immettere un indirizzo e-mail corretto!");
		theForm.Email.focus();
		return false;
  }
  if (theForm.name == "frmSS1") {
	  if (theForm.privacy.checked == false) {
			alert("Attenzione, accettare le condizioni della privacy");
			theForm.privacy.focus();
			return false;
	  }
	}

  return true;
}