<!--

// Modulo society
function validaSoc() {
  if ( document.getElementById('nome1').value.length == 0 ) {
		alert("The NAME field is obligatory");
		document.getElementById('nome1').focus();
		return false;
	}
	/*
	if ( document.getElementById('ilpaese').value.length == 0 ) {
		alert("The COUNTRY field is obligatory");
		document.getElementById('ilpaese').focus();
		return false;
	}
	*/
	if ( document.getElementById('username').value.length == 0 ) {
		alert("The USERNAME field is obligatory");
		document.getElementById('username').focus();
		return false;
	}
	if ( document.getElementById('password1').value != document.getElementById('password2').value ) {
		alert("The PASSWORD field and the REPEAT PASSWORD field are different");
		document.getElementById('password2').focus();
		return false;
	}
}

// Modulo events
function validaEvento() {
  if ( document.getElementById('societa').options[document.getElementById('societa').selectedIndex].value == "" ) {
		alert("The SOCIETY field is obligatory");
		document.getElementById('societa').focus();
		return false;
	}
  if ( document.getElementById('data_inizio').value.length == 0 ) {
		alert("The START DATE field is obligatory");
		document.getElementById('data_fine').focus();
		return false;
	}
	if ( document.getElementById('data_fine').value.length == 0 ) {
		alert("The END DATE field is obligatory");
		document.getElementById('data_fine').focus();
		return false;
	}
	if ( document.getElementById('oggetto').value.length == 0 ) {
		alert("The TITLE field is obligatory");
		document.getElementById('oggetto').focus();
		return false;
	}
}

// Modulo members
function validaAna() {
  if ( document.getElementById('societa').options[document.getElementById('societa').selectedIndex].value == "" ) {
		alert("The SOCIETY field is obligatory");
		document.getElementById('societa').focus();
		return false;
	}
  if ( document.getElementById('nome').value.length == 0 ) {
		alert("The NAME field is obligatory");
		document.getElementById('nome').focus();
		return false;
	}
	if ( document.getElementById('cognome').value.length == 0 ) {
		alert("The SURNAME field is obligatory");
		document.getElementById('cognome').focus();
		return false;
	}
}

// Modulo fee
function validaQuota() {
  if ( document.getElementById('societa').options[document.getElementById('societa').selectedIndex].value == "" ) {
		alert("The SOCIETY field is obligatory");
		document.getElementById('societa').focus();
		return false;
	}
	if ( document.getElementById('anno').options[document.getElementById('anno').selectedIndex].value == "" ) {
		alert("The YEAR field is obligatory");
		document.getElementById('anno').focus();
		return false;
	}
  if ( document.getElementById('quota').value.length == 0 ) {
		alert("The FEE field is obligatory");
		document.getElementById('quota').focus();
		return false;
	}
	if ( isNaN(document.getElementById('quota').value) ) {
		alert("The FEE is not a number");
		document.getElementById('quota').focus();
		return false;
	}
	// Cerco la virgola nel campo della quota (non e' consentita)
	for(i=0; i<document.getElementById('quota').value.length; i++) {
    if(document.getElementById('quota').value.charCodeAt(i)==44) {
      alert("You can't use comma [,] in the FEE field, use dot [.] for decimal separation");
      document.getElementById('quota').focus();
      return false;
	  }
  }
}

//-->
