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);
				Istruzioni_Finali();
			}
		} 
	}; 

	if(AjaxCaching == false)
		url = url + "?nocache=" + Math.random();
	xhr.open("GET", url , true);
	xhr.send('');  
}


function submitForm(url,url1)
{ 
  
	var xhr = createXHR();
  
//	var script = "ajax-cross-get.php?"+url;
//	var script = "./ajax/ajax-cross-get.php?"+url+"%"+url1;
//	var filename = "./ajax/dati.html";	

	var filename = "ajaxmg"+Math.floor(Math.random()*1000)+".html";	
    var script = "./ajax/ajax-cross-get.php?"+url+"%"+url1+"%%"+filename;
  	
	xhr.onreadystatechange=function()
	{ 
		if(xhr.readyState == 4)
		{
			 retrieve('./ajax/'+filename);
		}
	}; 
	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");


	xhr.send(''); 
} 

