// JavaScript Document

//Google map------http://maps.google.it/maps?f=q&hl=it&geocode=&time=&date=&ttype=&q=hotel+traiano+roma&ie=UTF8&ll=41.898188,12.497635&spn=0.112951,0.2314&z=12&iwloc=B&om=1
	
	
	function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
      //  map.addControl(new GSmallMapControl());
		map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
       // map.addControl(new ContourIntervalControl());
        map.addControl(new GScaleControl());
        map.addControl(new GOverviewMapControl(new GSize(110, 110)));
        map.enableDoubleClickZoom();
        map.enableContinuousZoom();
        map.setCenter(new GLatLng(41.897422,12.483859), 12);
		
		
        // Create our "tiny" marker icon
        var icon = new GIcon();
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.iconSize = new GSize(12, 20);
        icon.iconAnchor = new GPoint(5, 1);
        icon.infoWindowAnchor = new GPoint(5, 1);
		
		

        // Add 10 markers to the map at random locations
		var point = new GLatLng(41.897054,12.483859);		
		
		function createMarker_1(point) {
		var marker = new GMarker(point, icon);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml("<h3>Hotel Traiano</h3>HOTEL 4 STELLE ROMA CENTRO<p>Via 4 Novembre, 154 00187 Rome (Lazio) - Tel:06 6783862 <br> </p>");
		});
		return marker;
		}
		
        map.addOverlay(createMarker_1(point));
		
		
		
      }
    }

//-------------------FINR GOOGLE MAP----------------------------------------------------------------------------------------------------------------


//Contatti
function inviaFormContatti() {
	
	var str = document.FormContatti.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormContatti.cognome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormContatti.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormContatti.mail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
	var str = document.FormContatti.mess.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Messaggio");
		return;}
		
	if(document.FormContatti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}

document.FormContatti.submit();
	}
	




function inviaFormInterventi() {
	
	var str = document.FormContatti.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormContatti.cognome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormContatti.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormContatti.mail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
	var str = document.FormContatti.codice_fiscale_piva.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare il campo Codice fiscale/P.iva");
		return;}		
		
	var str = document.FormContatti.impianto.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare il campo Tipologia di impianto");
		return;}		
		
	var str = document.FormContatti.guasto.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Guasto segnalato");
		return;}
		
	if(document.FormContatti.RadioGroup1[1].checked){
	alert("Per inviare la richiesta di intervento tecnico accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}

document.FormContatti.submit();
	}


