function funct_vis_() {
	prendiElementoDaId('evento_big').style.display='none';
	prendiElementoDaId('hide_all').style.visibility='hidden';	
}

function prendiElementoDaId(idElement) {
	var elemento;
	if (document.getElementById)
		elemento = document.getElementById(idElement);
	else elemento = document.all[idElement];
	return elemento;
}

/**Funzioni per programmazione funzionale*/
function reduce(a,f) {
    if (a.length == 0) {
        throw emptyArrayError;
    }
    var res = a[0];
    for (var j = 1; j < a.length; j++) {
        res = f(res,a[j]);
    }
    return res;
}
function map(a,f) {
    var res = Array();
    for (var j = 0; j < a.length; j++) {
        res[j] = f(a[j]);
    }
    return res;
}
function filter(a,f) {
    var res = Array();
    for (var j = 0; j < a.length; j++) {
		var retu=f(a[j]);
        (retu==true) ? res[j] = a[j] : true;
    }
    return res;
}

/**Fine funzioni per programmazione funzionale*/

// funzione per assegnare l'oggetto XMLHttpRequest
// compatibile con i browsers più recenti e diffusi
function assegnaXMLHttpRequest(handler) {

// lista delle variabili locali
var
 // variabile di ritorno, nulla di default
 XHR = null,
 
 // informazioni sul nome del browser
 browserUtente = navigator.userAgent.toUpperCase();


 // browser standard con supporto nativo
 // non importa il tipo di browser
 if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
  XHR = new XMLHttpRequest();

 // browser Internet Explorer
 // è necessario filtrare la versione 4
 else if(
  window.ActiveXObject &&
  browserUtente.indexOf("MSIE 4") < 0
 ) {
 
  // la versione 6 di IE ha un nome differente
  // per il tipo di oggetto ActiveX
  if(browserUtente.indexOf("MSIE 5") < 0)
   XHR = new ActiveXObject("Msxml2.XMLHTTP");

  // le versioni 5 e 5.5 invece sfruttano lo stesso nome
  else
   XHR = new ActiveXObject("Microsoft.XMLHTTP");
 }
 XHR.onreadystatechange = handler;
 return XHR;
}

/**Link esterni, apre una nuova pagina*/
function NewPage() {
if(!document.getElementsByTagName ) { return; }
var anchors = document.getElementsByTagName( "a" );
for( var loop = 0; loop < anchors.length; loop++ ) {
var anchor = anchors[ loop ];
if( anchor.getAttribute( "href" ) && anchor.getAttribute( "rel" ) == "external" ) {
anchor.target = "_blank";
}
}
} 
/**Controllo del form contatti*/
function controllaFormContatti(){
	if (prendiElementoDaId('richiesta').nome.value == "") {
		alert("Attenzione! Non è stato inserito il nome.");
		return false;
	}
	if (prendiElementoDaId('richiesta').cognome.value == "") {
		alert("Attenzione! Non è stato inserito il cognome.");
		return false;
	}
	if (prendiElementoDaId('richiesta').mail.value == "") {
		alert("Attenzione! Non è stato inserito l'indirizzo E-mail.");
		return false;
	}
	if (prendiElementoDaId('richiesta').telefono.value == "") {
		alert("Attenzione! Non è stato inserito il numero di telefono.");
		return false;
	}
	if (prendiElementoDaId('richiesta').descrizione.value == "") {
		alert("Attenzione! Non è stato inserito il corpo della richiesta di informazioni.");
		return false;
	}
	if ((prendiElementoDaId('richiesta').privacy).checked == false) {
		alert("Attenzione! Non è stato autorizzato il trattamento dei dati personali.");
		return false;
	}
	
}
/**Controllo del form richiedi info da promozione*/
function controllaFormPromozione(){
	if (prendiElementoDaId('richiesta').nome.value == "") {
		alert("Attenzione! Non è stato inserito il nome.");
		return false;
	}
	if (prendiElementoDaId('richiesta').cognome.value == "") {
		alert("Attenzione! Non è stato inserito il cognome.");
		return false;
	}
	if (prendiElementoDaId('richiesta').telefono.value == "") {
		alert("Attenzione! Non è stato inserito il numero di telefono.");
		return false;
	}	
	if (prendiElementoDaId('richiesta').email.value == "") {
		alert("Attenzione! Non è stato inserito l'indirizzo E-mail.");
		return false;
	}	
	if (prendiElementoDaId('richiesta').privacy.checked == false) {
		alert("Attenzione! Non è stato autorizzato il trattamento dei dati personali.");
		return false;
	}	
	
	
}
var map = null;
var geocoder = null;
function load() {  
if (GBrowserIsCompatible()) {
			function createMarker(point, description) {
				  var marker = new GMarker(point);
				  GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml(description);
				  });
				  return marker;
			}
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(45.7709, 9.0107), 16);
		var point = new GLatLng(45.7709, 9.0107);
		var marker = new GMarker(point);
		map.addOverlay(
			createMarker(new GLatLng(45.7709, 9.0107), "<b>20HOURS</b><br /><br />Via Monte Rosa - Villa Guardia (CO)")
		);
	}
}
window.onload = function() {
	NewPage();
}
