function ControllaMail(MailToCheck) {
   	Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   	return Filtro.test(MailToCheck)
}
	
function ControllaForm(Modulo,messaggio) {
	IdModulo = document.getElementById(Modulo);
	var ritorno = false;
		ritorno = ControllaMail(IdModulo.Email.value);
		if (IdModulo.Richiedente.value!="" && IdModulo.Richieste.value!="" && IdModulo.Email.value!="") {
			ritorno = true 
		}
		if (ritorno == false) {
		alert (messaggio);
		return false
	} else {
		return true
	}	
}

function form(locazione) {
newwindow = window.open (locazione, "New", "toolbar=no, scrollbars=yes, location=no, width="+360+", height="+420+", left=100, top=100")
newwindow.creator=self
newwindow.focus(); 
}

	function ControllaFormBooking(Modulo,messaggio) {
		var ritorno = false;
			ritorno = ControllaMail(Modulo.email.value);
			if ((Modulo.richiedente.value!="") && (Modulo.email.value!="") && (Modulo.richiesta.value.length>1)) {
				ritorno = true
			}
			else 
			{
			ritorno = false
			}
			if (ritorno == false) {
				alert (messaggio);
				return false
		} else {
			return true
		}	
	}





function googlemap(locazione) {
//Da implementare chiusura della finestra sorgente
LarghezzaFinestra=330
AltezzaFinestra=330
newwindow = window.open (locazione, "New", "toolbar=no, resize=yes, resizable=yes, scrollbars=no, location=no, width="+LarghezzaFinestra+", height="+540+", left="+ (screen.width-LarghezzaFinestra)/2 +", top="+(screen.height-540)/2 +" " )
newwindow.creator=self
newwindow.focus(); 

}


function imgGallery(id,img) {
 id = document.getElementById(id);
	id.src=img;
 }