function CaricaPagina(pagina, id, msg) {
  var d = document;
  var url = ""; // = document.URL.substr(0, document.URL.lastIndexOf("/") + 1);

  if (typeof XMLHttpRequest != "undefined") {
    x = new XMLHttpRequest();
  } else {
    try { x = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch (e) {
      try { x = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch (e) { x = null; }
    }
  }

  if (x) {
    if (!msg) msg = "Loading...";
    d.getElementById(id).innerHTML = msg;
    x.onreadystatechange = function() { if (x.readyState == 4 && x.status == 200) { el = d.getElementById(id); el.innerHTML = x.responseText; } }
    x.open("GET", url + pagina, true);
    x.send(null);
  }
}
