function formPrenotazione() {

	oCognome=document.getElementById('last_name');
	oNome=document.getElementById('first_name');
	oEmail=document.getElementById('email');
	oPhone=document.getElementById('phone');
	oCheckIn=document.getElementById('checkIn');
	oCheckOut=document.getElementById('checkOut');
	oNights=document.getElementById('nights');
	oRooms=document.getElementById('rooms');
	oAdults=document.getElementById('adults');
	oChildren=document.getElementById('children');

	if (oCognome.value=='') {
		alert ("Inserisci il cognome - Last name - Nachname");
		oCognome.focus();
		return false;
	}

	if (oNome.value=='') {
		alert ("Inserisci il nome - First name - Vorname");
		oNome.focus();
		return false;
	}

	if ((oEmail.value.length<5) || (oEmail.value.indexOf("@")==-1)) {
		alert ("Formato email non valido - Email");
		oEmail.focus();
		return false;
	}

	if (oPhone.value=='') {
		alert ("Inserisci il telefono - Phone - Telefon");
		oPhone.focus();
		return false;
	}

	if ((oCheckIn.value=='') || (oCheckIn.value=='dd-mm-yyyy') || (oCheckIn.value=='gg-mm-aaaa') || (oCheckIn.value=='tt-mm-jjjj') || (oCheckIn.value.indexOf("-")==-1)) {
		alert ("Inserisci la data d'arrivo - Day of arrival - Anreisetag");
		oCheckIn.focus();
		return false;
	}

	if ((oCheckOut.value=='') || (oCheckOut.value=='dd-mm-yyyy') || (oCheckOut.value=='gg-mm-aaaa') || (oCheckIn.value=='tt-mm-jjjj') || (oCheckOut.value.indexOf("-")==-1)) {
		alert ("Inserisci la data di partenza - Day of departure - Abreisetag");
		oCheckOut.focus();
		return false;
	}

	return true;

}

function formContatti() {

	oNome=document.getElementById('nome');
	oCognome=document.getElementById('cognome');
	oIndirizzo=document.getElementById('indirizzo');
	oCitta=document.getElementById('citta');
	oTel=document.getElementById('tel');
	oEmail=document.getElementById('email');
	oPrivacy=document.getElementById('privacy');
	oTesto=document.getElementById('testo');

	if (oNome.value=='') {
		alert ("Inserisci il nome");
		oNome.focus();
		return false;
	}

	if (oCognome.value=='') {
		alert ("Inserisci il cognome");
		oCognome.focus();
		return false;
	}

	if (oIndirizzo.value=='') {
		alert ("Inserisci l'indirizzo");
		oIndirizzo.focus();
		return false;
	}

	if (oCitta.value=='') {
		alert ("Inserisci la citta'");
		oCitta.focus();
		return false;
	}

	if (oTel.value=='') {
		alert ("Inserisci il numero di telefono");
		oTel.focus();
		return false;
	}

	if ((oEmail.value.length<5) || (oEmail.value.indexOf("@")==-1)) {
		alert ("Formato email non valido");
		oEmail.focus();
		return false;
	}

	if (oPrivacy.checked!=true) {
		alert ("Per procedere con l'iscrizione e' necessario l'autorizzazione al trattamento dei dati");
		return false;
	}

	if (oTesto.value.length<10) {
		alert ("Inserisci il testo del messaggio");
		oTesto.focus();
		return false;
	}

	return true;
}

function aprifinestra(URL, nome, opzioni) {

	var indiceFinestra=window.open(URL, nome, opzioni);
	indiceFinestra.focus();

}
