function body_onload()
{	
	//caricaContenuto("home.html");
	//avviaBlinkBacheca();
}

function caricaContenuto(file) {
	clientSideInclude('contenuto', file);
}

// Sezione PattinanTO
function caricaPattinanto_ChiSiamo() { caricaContenuto('pattinanto_chisiamo.html'); }
function caricaPattinanto_ChiSiamo_Storia() { caricaContenuto('pattinanto_chisiamo_storia.html'); }
function caricaPattinanto_Obiettivi() { caricaContenuto('pattinanto_obiettivi.html'); }
function caricaPattinanto_Documenti() { caricaContenuto('documenti_pattinanto.html'); }

// Sezione Allenamenti
function caricaAllenamenti_Partecipare() { avvisoInCostruzione(); }
function caricaAllenamenti_Programma() { avvisoInCostruzione(); }
function caricaAllenamenti_Luoghi() { avvisoInCostruzione(); }

// Sezione Foto
function caricaFoto_TorrePelliceAprile2008() { caricaContenuto('foto_torrepellice.html'); }

// Contatti
function caricaContatti() { avvisoInCostruzione(); }

function avvisoInCostruzione()
{
	alert('Pagina in costruzione. Ci scusiamo per il disagio...');
}

function avviaBlinkBacheca()
{
	document.getElementById("bacheca").style.backgroundColor="rgb(215,198,179)";
	document.getElementById("bacheca").style.color="rgb(0,0,0)";
	setTimeout("blinkBacheca()",2000);
}

function blinkBacheca()
{
	//document.getElementById("bacheca").style.backgroundColor="#ff0000";
	document.getElementById("bacheca").style.color="#ff0000";
	setTimeout("avviaBlinkBacheca()",150);
}

function getXhttp() {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
  return req;
}

function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('POST', url, false);
    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    req.send('lingua=ciao');
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
  return req;
}

/* INIZIO: FUNZIONE --BOOKMARK-- */
function bookmarksite(title, url){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar);
		window.sidebar.addPanel(title, url, "");
}
/* FINE: FUNZIONE --BOOKMARK-- */
