$(document).ready(setup);
var choice;								// deve essere globale!

function setup(){
	choice = $('#formmail').html();
	$('#formmail').load('formread.asp?form=' + choice, null, attachCheckEvent);
}

function attachCheckEvent(){
	$('#' + choice).bind('submit', null, formCheck);		// aggancio evento di check del form
};

function formCheck(){
	var returnFlag = true;
	$('input.required').each(function (){if (this.value.match(/^\s*$/)) {returnFlag = false;}});
	if (!returnFlag) {alert("Per favore, compilate tutti i campi richiesti\n")};
	return returnFlag;
};
