function hover(item){
var codice=String(item);

if(codice==1){
  document.getElementById("home").style.background= '#B05A3A';
  document.getElementById("home").style.cursor= 'hand';}
if(codice==2)
  document.getElementById("chi").style.background= '#B05A3A';
if(codice==3)
  document.getElementById("dove").style.background= '#B05A3A';
if(codice==4)
  document.getElementById("serve").style.background= '#B05A3A';
if(codice==5)
  document.getElementById("galleria").style.background= '#B05A3A';
if(codice==6)
  document.getElementById("amici").style.background= '#B05A3A';
if(codice==7)
  document.getElementById("contatti").style.background= '#B05A3A';
if(codice==8)
  document.getElementById("tapp").style.background= '#B05A3A';
	
}
function no_hover(item){
var codice=String(item);

if(codice==1)
  document.getElementById("home").style.background= '#573328';
if(codice==2)
  document.getElementById("chi").style.background= '#573328';
if(codice==3)
  document.getElementById("dove").style.background= '#573328';
if(codice==4)
  document.getElementById("serve").style.background= '#573328';
if(codice==5)
  document.getElementById("galleria").style.background= '#573328';
if(codice==6)
  document.getElementById("amici").style.background= '#573328';
  if(codice==7)
  document.getElementById("contatti").style.background= '#573328';
	
}

function setIframe(mnu_sub, mnu){
document.getElementById("myIframe").src="innerFrame.asp?mnu_sub="+String(mnu_sub)+"&mnu="+String(mnu);
}


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

// 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");
 }

 return XHR;
}

function ajazzone(element_id){
	
	var ajax = assegnaXMLHttpRequest();

ajax.open("GET", "main.php?pg="+element_id, true);
ajax.send(null)

//la nostra solita funzione...
ajax.onreadystatechange = function () {
    if (ajax.readyState == 4) {
        if( ajax.status == 200 ){ // controllo che la richiesta sia avvenuta con successo
             var resp = ajax.responseText; //prende i dati
             var tipDiv = document.getElementById('main'); //ottiene il div
             tipDiv.innerHTML = resp; //imposta il contenuto
        } else {
             var tipDiv = document.getElementById('main'); //ottiene il div
             var error = 'Errore la richiesta ajax non è avvenuta con successo' ;
             tipDiv.innerHTML = error ; //imposta il contenuto di errore
        }
    }
}
 
}
 



