var AjaxCaching = false;

function display(content, storage)
{
    storage.innerHTML = content;
}

function retrieve(url)
{
	var storage = document.getElementById("storage");
	var xhr = createXHR();
	xhr.onreadystatechange=function()
	{ 
		if(xhr.readyState == 4)
		{
			if(xhr.status == 200)
			{
				var 	content = xhr.responseText;
				display(content, storage);
				document.getElementById("messaggio_attesa").innerHTML="<p><b><font size=\"4\" color=\"black\">...download terminato...ora analizzo i dati  </font></b>"
				analizza(storage);
			}
		} 
	}; 

	if(AjaxCaching == false)
		url = url + "?nocache=" + Math.random();
	xhr.open("GET", url , true);
	xhr.send('');  
}


function submitForm(url,url1)
{ 
  
	var xhr = createXHR();
	var filename = "ajaxmc_spaghi"+Math.floor(Math.random()*1000)+".html";	
    var script = "./ajax-spaghetti-pall/ajaxmc_spaghi-cross-get.php?"+url+"%"+url1+"%%"+filename;
//	var filename = "ajaxmc_spaghi"+210+".html";	
//     var script = "a=1";
  	
	xhr.onreadystatechange=function()
	{ 
		if(xhr.readyState == 4)
		{
			 retrieve('./ajax-spaghetti-pall/'+filename);
		}
	}; 
 	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");


	xhr.send(''); 
} 

