<!--
<!--
	// Googlemaps
	//<![CDATA[
	var WINDOW_HTML = '<font style="font-family: Verdana; font-size: 10px;"><font style="font-weight: bold; color: #00A200;">Hotel Bellevue</font><br /><br />Via Statale, 33<br />23013 Cosio Valtellino (Sondrio) - Italia</font>';
	
	function initialize(){
		if(GBrowserIsCompatible()){
			var map = new GMap2(document.getElementById("mappa"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(46.133828, 9.561174), 13);
			var marker = new GMarker(new GLatLng(46.133828, 9.561174));
      map.addOverlay(marker);
      GEvent.addListener(marker, "click", function(){
        marker.openInfoWindowHtml(WINDOW_HTML);
      });
      marker.openInfoWindowHtml(WINDOW_HTML);
			var ovcontrol = new GOverviewMapControl(new GSize(180,180)); 
      map.addControl(ovcontrol);
		}
	}
	//]]>
	
	// Apre una pop-up centrata
	function centerPopup(typePage, number){
		if(typePage == 'h'){
			w = 500;
			h = 332;
		}
		else if(typePage == 'v'){
			w = 249;
			h = 332;
		}
			
		var l = Math.floor((screen.width-w)/2);
		var t = Math.floor((screen.height-h)/2);
		var site = window.open("pages/gallery.php?num=" + number + "", "popup", "toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, width=" + w + ", height=" + h + ", top=" + t + ", left=" + l);
		site.focus();
	}
	
	// Controlla l'invio della form "contatti"
	function checkContatti(){
		var item = document.contatti;
		var goodEmail = item.mail.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		
		if(item.name.value == ''){
			alert("Attenzione!\nIl campo NOME non è stato compilato correttamente...");
			item.name.focus();
		}
		else if(item.surname.value == ''){
			alert("Attenzione!\nIl campo COGNOME non è stato compilato correttamente...");
			item.surname.focus();
		}
		else if(!goodEmail){
			alert("Attenzione!\nIl campo E-MAIL non è stato compilato correttamente...");
			item.mail.focus();
		}
		else if(item.phone.value != '' && isNaN(item.phone.value)){
			alert("Attenzione!\nIl campo TELEFONO/CELLULARE non è numerico...");
			item.phone.focus();
		}
		else if(item.what.value == ''){
			alert("Attenzione!\nIl campo RICHIESTA non è stato compilato correttamente...");
			item.what.focus();
		}
		else if(item.privacy.checked == false)
			alert("Attenzione!\nE' necessario confermare la lettura dell'informativa sulla PRIVACY...");
		else{
			item.go.value = 'Y';
			item.submit();
		}
	}
	
	// Mostra/nasconde la visibility del div "id"
	function showHideDiv(id){
		if(id == 'lombardia'){
			document.getElementById('lombardia').style.display = "block";
			document.getElementById('valtellina').style.display = "none";
			document.getElementById('cosio_valtellino').style.display = "none";			
		}
		else if(id == 'valtellina'){
			document.getElementById('lombardia').style.display = "none";
			document.getElementById('valtellina').style.display = "block";
			document.getElementById('cosio_valtellino').style.display = "none";			
		}
		else if(id == 'cosio_valtellino'){
			document.getElementById('lombardia').style.display = "none";
			document.getElementById('valtellina').style.display = "none";
			document.getElementById('cosio_valtellino').style.display = "block";			
		}
	}
	
	// Mostra/nasconde la visibility del div "visite"
	function showHideVisit(){
		if(document.getElementById('visite').style.display == "none")
			document.getElementById('visite').style.display = "block";
		else
			document.getElementById('visite').style.display = "none";
	}
	
	// Passa l'id della news per gli input di modifica
	function passForSubId(idValue){
		document.form_news.id_main.value = idValue;
		document.form_news.cmd.value = 'news';
		
		document.form_news.submit();
	}
	
	// Controlla la form d'inserimento delle news
	function insNews(idValue){
		if(document.form_news.titolo.value == ''){
			alert("Attenzione!\nIl campo TITOLO non è stato compilato...");
			document.form_news.titolo.focus();
		}
		else if(document.form_news.descrizione.value == ''){
			alert("Attenzione!\nIl campo DESCRIZIONE non è stato compilato...");
			document.form_news.descrizione.focus();
		}
		else{
			document.form_news.id_main.value = idValue;
			document.form_news.cmd.value = 'do_modnews';
			document.form_news.submit();
		}
	}
	
	// Elimina la news
	function delNews(idValue){
		if(confirm("Sei sicuro di voler eliminare questa news?")){
			document.form_news.id_main.value = idValue;
			document.form_news.cmd.value = 'do_delnews';
			document.form_news.submit();
		}
	}
	
	// Controlla la form d'inserimento del menù
	function insMenu(){
		if(document.form_menu.primo.value != '' || document.form_menu.secondo.value != '' || document.form_menu.dolce.value != ''){
			document.form_menu.sel_primo.value = '';
			document.form_menu.sel_secondo.value = '';
			document.form_menu.sel_dolce.value = '';
			
			document.form_menu.cmd.value = 'do_modmenu';
			document.form_menu.submit();
		}
		else{
			if(document.form_menu.sel_primo.value == '')
				alert("Attenzione!\nIl campo PRIMO PIATTO non è stato selezionato...");
			else if(document.form_menu.sel_secondo.value == '')
				alert("Attenzione!\nIl campo SECONDO PIATTO non è stato selezionato...");
			else if(document.form_menu.sel_dolce.value == '')
				alert("Attenzione!\nIl campo DOLCE non è stato selezionato...");
			else{
				document.form_menu.cmd.value = 'do_modmenu';
				document.form_menu.submit();
			}
		}
	}
	
	// Elimina la news
	function delMenu(idValue, type){
		if(idValue == '')
			alert("Attenzione!\nIl piatto da eliminare non è stato selezionato...");
		else{
			if(confirm("Sei sicuro di voler eliminare questo piatto?")){
				document.form_menu.id_main.value = idValue + "||" + type;
				document.form_menu.cmd.value = 'do_delmenu';
				document.form_menu.submit();
			}
		}
	}
//-->