function campiContatti(theForm){
if (theForm.f_name.value =="")
                {
                alert("Inserire il nome")
                theForm.f_name.focus();
                return (false);
                }
if (theForm.f_cognome.value =="")
                {
                alert("Inserire il cognome")
                theForm.f_cognome.focus();
                return (false);
                }

if (theForm.f_mail.value =="")
                {
                alert("Inserire l'email")
                theForm.f_mail.focus();
                return (false);
                }
if (!check_email(theForm.f_mail.value))
                {
                validity = false;
                alert("Email non valida");
                theForm.f_mail.focus();
                return (false);
                }

if (theForm.f_oggetto.value =="")
                {
                alert("Inserire l'oggetto")
                theForm.f_oggetto.focus();
                return (false);
                }
if (theForm.f_message.value =="")
                {
                alert("Inserire la descrizione")
                theForm.f_message.focus();
                return (false);
                }
}	




function campiPrenota(theForm){
if (theForm.f_name.value =="")
                {
                alert("Inserire il nome")
                theForm.f_name.focus();
                return (false);
                }
if (theForm.f_cognome.value =="")
                {
                alert("Inserire il cognome")
                theForm.f_cognome.focus();
                return (false);
                }

if (theForm.f_mail.value =="")
                {
                alert("Inserire l'email")
                theForm.f_mail.focus();
                return (false);
                }


if (theForm.f_arrivo.value =="")
                {
                alert("Inserire la data di arrivo")
                theForm.f_arrivo.focus();
                return (false);
                }
if (theForm.f_partenza.value =="")
                {
                alert("Inserire la data di partenza")
                theForm.f_message.focus();
                return (false);
                }

if (theForm.numPax.value =="")
                {
                alert("Inserire il numero di ospiti")
                theForm.numPax.focus();
                return (false);
                }
if (theForm.prefInternazionale.value =="")
                {
                alert("Inserire il prefisso internazionale")
                theForm.prefInternazionale.focus();
                return (false);
                }

if (theForm.prefLocale.value =="")
                {
                alert("Inserire il prefisso")
                theForm.prefLocale.focus();
                return (false);
                }
if (theForm.f_telefono.value =="")
                {
                alert("Inserire il numero di telefono")
                theForm.f_telefono.focus();
                return (false);
                }

if (theForm.f_indirizzo.value =="")
                {
                alert("Inserire l'indirizzo")
                theForm.f_indirizzo.focus();
                return (false);
                }
if (theForm.f_citta.value =="")
                {
                alert("Inserire la cittā")
                theForm.f_citta.focus();
                return (false);
                }
if (!check_email(theForm.f_mail.value))
                {
                validity = false;
                alert("Email non valida");
                theForm.f_mail.focus();
                return (false);
                }
}








function check_email(address) {
                  if ((address == "")
                       || (address.indexOf ("@") == -1)
                       || (address.indexOf (".") == -1))
                   return false;
                   return true;
                  }		
				  
function LunghezzaMax(campo)
{
	if (campo.value.length>100000)
	{
	alert("Hai raggiunto il limite massimo di caratteri consentiti per la descrizione");
	campo.value=campo.value.substring(0, 100000);
	campo.focus();
	}
}

function isnum(obj) 
{
	if (isNaN(obj.value))
	{
	alert('Nel campo č possibile immettere solo numeri!');
	obj.value="";
	obj.focus();
	}
}

function listaNazioni(){
	document.getElementsByName("prefInternazionale")[0].innerHTML='<option></option><option>AL +355</option><option>AR +54</option><option>AT +43</option><option>AU +61</option><option>BE +32</option><option>BG +359</option><option>BR +55</option><option>CA +1</option><option>CH +41</option><option>CL +56</option><option>CN +86</option><option>CY +357</option><option>DE +49</option><option>DK +45</option><option>EG +20</option><option>ES +34</option><option>FR +33</option><option>GE +995</option><option>HR +385</option><option>JP +81</option><option>GB +44</option><option>GR +30</option><option>IE +353</option><option>IL +972</option><option>IN +91</option><option>IS +354</option><option>IT +39</option><option>KE +254</option><option>LI +423</option><option>LT +370</option><option>LU +352</option><option>MA +212</option><option>MC +377</option><option>MK +389</option><option>MT +356</option><option>MX +52</option><option>NL +31</option><option>NZ +44</option><option>PL +48</option><option>PT +351</option><option>RO +40</option><option>RU +7</option><option>SE +46</option><option>SI +386</option><option>SK +421</option><option>TN +216</option><option>TR +90</option><option>UA +380</option><option>US+1</option><option>UY +36</option>';	
}

function selezione(oggetto){
	//oggetto.className='activelink';
	var x=document.getElementsByName("alink");
	var i=0;
	//alert(x.length)
	for(i=0;i<x.length;i++){
		document.getElementsByName("alink")[i].className='menu';	
	}
	oggetto.className='activelink';
}

function copyDate() {
  var cpyrt = document.getElementById("copyright")
  if (cpyrt) {
     cpyrt.firstChild.nodeValue = (new Date()).getFullYear();
  }
}