// JavaScript Document

//Google map----------------------------------------------------------
    
	http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=Albergo+grigna&sll=45.939691,9.319839&sspn=0.218697,0.462799&ie=UTF8&ll=45.967379,9.319839&spn=0.218587,0.462799&z=11&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(45.967379,9.319839), 11);
		
		
        // 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(45.967379,9.319839);		
		
		function createMarker_1(point) {
		var marker = new GMarker(point, icon);
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml("<h3>Albergo Ristorante Grigna</h3><p>23826 Mandello del Lario (LC) <br>Via Statale, 29 <br>Tel 0341.731105 / 0341.702329 <br>Fax. 0341.702748 <br>Roberto 335.6346090 Elena 335.5299132 <br> e-mail <a href='mailto:h.grigna@albergogrigna.it'>h.grigna@albergogrigna.it</a></p>");
		});
		return marker;
		}
		
        map.addOverlay(createMarker_1(point));
		
		
		
      }
    }

//-------------------FINR GOOGLE MAP----------------------------------------------------------------------------------------------------------------
function inviaFormPrenotazioniHotel_Step1() {
	
	var str = document.idForm.notti.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Notti. Inserire un valore numerico.");
		return;}
	
	var str = document.idForm.adulti.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Adulti. Inserire un valore numerico.");
		return;}
		
	var str = document.idForm.bambini.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Bambini. Inserire un valore numerico.");
		return;}

	var str = document.idForm.stanze.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail. Inserire un valore numerico.");
		return;}
		
		

document.idForm.submit();
	}


function inviaFormPrenotazioniRisto_Step1() {
	
	var str = document.ristorante.persone.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Persone.");
		return;}
	
	var str = document.ristorante.ora_arrivo.value;
	var re = /^[a-zA-Z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Ora arrivo. ");
		return;}
		
		
		

document.ristorante.submit();
	}


function inviaFormPrenotazioni() {
	
	var str = document.FormPrenotazioni.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormPrenotazioni.cognome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormPrenotazioni.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormPrenotazioni.mail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
	var str = document.FormPrenotazioni.mess.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Messaggio");
		return;}
		

document.FormPrenotazioni.submit();
	}

function popUp(url,name,features){
html = '<HTML>\n<HEAD>\n<TITLE> GALLERIA </TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=20>\n<CENTER><IMG SRC="'+url+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width,document.imageTest.height + 100)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,statusbar=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}


