// JavaScript Document
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

// <<<<<<<<<<<<<<< changePhoto <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

function loadPhoto(id)
{
	
		xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
		  alert ("Your browser does not support AJAX!");
		  return;
	  } 
var url="js_change.php?id="+id;
url=url+"&kaes="+Math.random();
xmlHttp.onreadystatechange=cambioStato;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
updateChart(id,prog,price,filename,sconto)
}

function cambioStato() 
{
	
	if (xmlHttp.readyState==4)
		{ 
			//document.getElementById("statotext").appendChild="Stato aggiornato";
			//alert("Stato cambiato !");
			var t = xmlHttp.responseText;
			document.getElementById("viewPhoto").innerHTML = t;
		}
	if (xmlHttp.readyState==3)
		{ 
			var t ="Operazione in corso....";
			document.getElementById("viewPhoto").innerHTML = t;
			//alert("per la via");
		}
	if (xmlHttp.readyState==2)
		{ 
			var t ="Operazione in corso....";
			document.getElementById("viewPhoto").innerHTML = t;
			//alert("per la via");
		}
	if (xmlHttp.readyState==1)
		{ 
			var t ="Invio....";
			document.getElementById("viewPhoto").innerHTML = t;

		}
	if (xmlHttp.readyState==0)
		{ 
			alert("richiesta non inviata");
		}
		
}
