function datiForm(){
	var controllo = false;
	var bottone = document.form.ssn;
	for(var i=0; i<bottone.length; i++) {
		if(bottone[i].checked) {
			controllo = true;
			break;
		}
	}
	if(!controllo) {
		alert("Selezionare se la prenotazione è in convenzione con l'SSN");
		return false;
	}
	//return true;
	
	if(document.form.nome.value == ""){
		document.form.nome.focus();
		alert("Il campo nome è obbligatorio");
		return false;
	}
	
	if(document.form.cognome.value == ""){
		document.form.cognome.focus();
		alert("Il campo cognome è obbligatorio");
		return false;
	}
	
	/*
	if(document.form.ssn[0].checked == true){
		if(document.form.data_nascita.value == ""){
			document.form.data_nascita.focus();
			alert("Il campo data di nascita è obbligatorio");
		return false;
		}
	
		if(document.form.indirizzo.value == ""){
			document.form.indirizzo.focus();
			alert("Il campo indirizzo è obbligatorio");
		return false;
		}
	}
	*/
	
	if(document.form.citta.value == ""){
		document.form.citta.focus();
		alert("Il campo città è obbligatorio");
		return false;
	}
	
	/*if (isNaN(document.form.telefono.value) || (document.form.telefono.value == "") || (document.form.telefono.value == "undefined")){
		document.form.telefono.focus();
		alert("Il campo TELEFONO FISSO è obbligatorio");
		return false;
	}*/
	
	if (isNaN(document.form.telefono.value) || (document.form.telefono.value == "") || (document.form.telefono.value == "undefined")){
		document.form.telefono.focus();
		alert("Il campo TELEFONO FISSO è obbligatorio");
		document.form.telefono.value = "";
		document.form.telefono.focus();
		return false;
	} else {
		var numCell = ["330", "331", "333", "334", "335", "336", "337", "338", "339", "360", "363", "366", "368", "340", "342", "345", "346", "347", "348", "349", "320", "323", "327", "328", "329", "380", "383", "388", "389", "390", "391", "392", "393", "313", "389", "377", "331", "373", "366", "331", "370"];
		
		var telefono = document.form.telefono.value;
		var prefisso = telefono.substr(0,3);
		
		var i=0;
		while(i<numCell.length) {
			if (numCell[i] == prefisso){
				alert("Indicare un numero di TELEFONO FISSO");
				document.form.telefono.value = "";
				document.form.telefono.focus();
				return false;
			}
			i++;
		} 
	}

	
	if(document.form.contatto_dalle.value == "ore"){
		document.form.contatto_dalle.focus();
		alert("Indicare una fascia oraria nella quale contattarla");
		return false;
	}
	
	if(document.form.contatto_alle.value == "ore"){
		document.form.contatto_alle.focus();
		alert("Indicare una fascia oraria nella quale contattarla");
		return false;
	}
	
	/*
	if(document.form.from.value == ""){
		document.form.from.focus();
		alert("Il campo e-mail è obbligatorio");
		return false;
		}
	*/
	
	if(document.form.body.value == ""){
		alert("Il campo esami è obbligatorio");
		return false;
	}
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function setOra() {
}

function copiaEmail() {
	var email = document.form.email_cliente.value.length;
	if(document.form.email_cliente.value != ""){
		var filter =/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		var mail = document.form.email_cliente;
		if(!filter.test(mail.value)){
			alert("E' necessario inserire un indirizzo email valido");
			document.form.email_cliente.value();
			return false;
		} else {
			document.form.from.value = document.form.email_cliente.value;
		}
	}
}
