// FUNZIONI PER IL CONTROLLO DEI FORM DI INVIO
function controllaForm(idForm) {
	var risposta = "";
	
	$("#"+idForm).find("input.required").each(function() {
		var input = $(this);
		if (input.attr("id").substr(0, 8) == "required")
			if ((input.attr("type") == "text" && input.val().length == 0) || (input.attr("type") == "checkbox" && !input.is(":checked")))
				risposta += "\n - Il campo '" + input.attr("id").replace(/_/g, " ") + "' non puo' essere vuoto";
	});

	$("#"+idForm).find("select.required").each(function() {
		var input = $(this);
		if (input.attr("id").substr(0, 8) == "required" && input.val().length == 0)
			risposta += "\n - Il campo '" + input.attr("id").replace(/_/g, " ") + "' non puo' essere vuoto";
	});

	if (risposta.length > 0) {
		alert("Si sono verificati i seguenti errori:" + risposta);
	} else
		$("#"+idForm).submit();
}

// FUNZIONE PER L'APERTURA DI UNA POPUP
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
