
var xmlHttp = false;
try
{
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  xmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
  try
  {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
  }catch(e){
    xmlHttp = false;
  }
}
//browser diversi da Internet Explorer
if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
{
  xmlHttp = new XMLHttpRequest();
  xmlHttp2 = new XMLHttpRequest();
}


function aggiorna2(rettangolo, dimensione_pagina)
{

  if (xmlHttp)
  {
    xmlHttp.open('GET', './funzioni/rombo.php'); 
    xmlHttp.onreadystatechange = function (){

      if (xmlHttp.readyState == 4)
      {
       document.getElementById("head-1").innerHTML = xmlHttp.responseText;
      }
    };
    xmlHttp.send(null);
 }

  if ((xmlHttp2) && (rettangolo!=2) && (dimensione_pagina==0))
  {
    xmlHttp2.open('GET', './funzioni/rettangolo.php?dimensione=' + rettangolo); 
    xmlHttp2.onreadystatechange = function (){

      if (xmlHttp2.readyState == 4)
      {
        document.getElementById("imagine").innerHTML = xmlHttp2.responseText;
      }
    };
    xmlHttp2.send(null);
 }
  setTimeout('aggiorna2( ' + rettangolo + ', ' + dimensione_pagina + ')',5000);
}

function aggiorna(rettangolo, dimensione_pagina)
{
	setTimeout('aggiorna2( ' + rettangolo + ', ' + dimensione_pagina + ')',5000);
}

