function mostra(id)
{
  if (id == 'gran')
  {
    document.getElementById('gran').className = 'subMenu-on';
    document.getElementById('reg').className = 'subMenu-off';
  } else {
    document.getElementById('reg').className = 'subMenu-on';
    document.getElementById('gran').className = 'subMenu-off';
  }
}

function resolution()
{
	var res = screen.availWidth;

	if (res == "800")
	{
			document.getElementById('intestazione').className = "intestazione-1024";
			document.getElementById('corpo').className = "corpo-1024";
			document.getElementById('footer').className = "footer-1024";
	}
}

function controlla_form()
{
	var msg = "";
	var errore = false;
	
	if (document.preventivo.Nome.value == '')
		msg += "il campo \"Nome e Cognome\" è vuoto ...\n";
	if (document.preventivo.Email.value == "")
		msg += "il campo \"E-Mail\" è vuoto ...\n";
	if (document.preventivo.Email.value !== '')
	{
		var email = document.preventivo.Email.value;
		if (email.search(/\w[^@]{1,}\w[@]{1}\w[^@]{1,}\w[.]{1}\w[^@]{1,}/) == -1)
		{
			msg +="Il campo E-Mail non è un indirizzo valido...\n";
		}
	} 
	if (document.preventivo.Partenza.value == "")
		msg += "il campo \"Luogo di Partenza\" è vuoto ...\n";
	if (document.preventivo.Arrivo.value == "")
		msg += "il campo \"Luogo d'Arrivo\" è vuoto ...\n";
	if (document.preventivo.DataP.value == "")
		msg += "il campo \"Data Partenza\" è vuoto ...\n";
	if (document.preventivo.DataA.value == "")
		msg += "il campo \"Data Arrivo\" è vuoto ...\n";
	if (document.preventivo.OraP.value == "")
		msg += "il campo \"Ora Partenza\" è vuoto ...\n";
	if (document.preventivo.NumP.value == "")
		msg += "il campo \"Numero Persone\" è vuoto ...\n";
		
	if (msg != "")
	{
		errore = true;
		var msg_completo = 'La E-mail non può essere spedita a causa dei seguenti errori:\n\n'+msg+'\nSi prega di correggerli e di riprovare ...';
		alert(msg_completo);
	}
	
	if (!errore)
		document.preventivo.submit();
}

function sblocca()
{
	
	if (document.getElementById) {  
		document.getElementById('precarica').style.visibility = 'hidden';
	}
	else {
		if (document.layers) { 
			document.hidepage.visibility = 'hidden';
		} else { 
			document.all.hidepage.style.visibility = 'hidden';
   	 	}
   	}
   	
}

