function check_data(list) {
var msg
	msg = "";

	if (list.nome.value.length == 0)
	{
		list.nome.focus();
		msg += "Il NOME è obbligatorio.\n";
	}

	if (list.cognome.value.length == 0)
	{
		list.cognome.focus();
		msg += "Il COGNOME è obbligatorio.\n";
	}

	if (list.email.value.length == 0)
	{
		list.email.focus();
		msg += "L' indirizzo EMAIL è obbligatorio.\n";
	}

	if (list.telefono.value.length == 0)
	{
		list.telefono.focus();
		msg += "Il TELEFONO è obbligatorio.\n";
	}

	if (msg.length == 0){
	 list.submit();	

	}	
	else
		{
			alert(msg);
		}
}

function check_search(list) {
var msg
	msg = "";

	if (list.src.value.length == 0)
	{
		list.src.focus();
		msg += "Campo ricerca vuoto.\n";
	}

	if (msg.length == 0){
	 list.submit();	

	}	
	else
		{
			alert(msg);
		}
}

function Add_car(list)
	{
		if ( (parseInt(list.qta.value) >= 1) )
		{		
				list.submit();
		}
			else
		{
			alert("Attenzione, per prenotare inserire un quantitativo maggiore di 1.\n");
		}
	}

	
function controlla_contatti(list)
{

	var esatto
	var msg
	msg = "";
	var email2 = /\w+@\w+.+\w{2,4}$/;
	if (list.email.value.length == 0)
	{
		list.email.focus();
		msg += "La EMAIL e' obbligatoria.\n";
	}
	if (list.messaggio.value.length == 0)
	{
		list.messaggio.focus();
		msg += "Il campo MESSAGGIO e' obbligatorio.\n";
	}
	if (msg.length == 0)
		{
			esatto = true;
			if (!list.email.value.match(email2))
			{
				list.email.select();
				alert("L' EMAIL non  corretta")
				esatto=false;
			}
				
				
			if (esatto)	list.submit();	
		}
		else
		{
			msg = "Attenzione. La segnalazione non puo' essere inviata:\n\n" + msg;
			alert (msg);			
		}
}
function PopUpMenu(pagina,nomePopUp,dimensioni) 
	{   
     open(pagina, nomePopUp, dimensioni);
	}
