/************* PAGINA links *************/

/*
 * Get the content of a page
 * 
 */
function getContent(method, page, args, func) {

  // Obtain an XMLHttpRequest instance
  var req = newXMLHttpRequest();

  // Set the handler function to receive callback notifications
  // from the request object
  var handlerFunction = getReadyStateHandler(req, func);
  req.onreadystatechange = handlerFunction;

  // Open an HTTP GET connection to the shopping cart servlet.
  // Third parameter specifies request is asynchronous.
  req.open(method, page, true);

  req.send(args);
}

function getNotizie()
{
  getContent("GET", "notizie.html", "", setNotizie);
}

function setNotizie(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getAlloggi()
{
  getContent("GET", "alloggi.html", "", setAlloggi);
}

function setAlloggi(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getVoli()
{
  getContent("GET", "voli.html", "", setVoli);
}

function setVoli(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getUtility()
{
  getContent("GET", "utility.html", "", setUtility);
}

function setUtility(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getPacchetti()
{
  getContent("GET", "pacchetti.html", "", setPacchetti);
}

function setPacchetti(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

