

function load_struct(id)
{
	
	xmlHttp.open('POST', 'loadstruct_ajax.php?id='+id, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp.onreadystatechange = stateChangedsc2; 
														
		xmlHttp.send(null);
}



function stateChangedsc2() {



	if(xmlHttp.readyState == 4) 
	{
	
		//Stato OK
		if (xmlHttp.status == 200) 
		{
			
			var risp = xmlHttp.responseText;
			
			if(risp!="")
			{
				risp=risp.replace(/^\s*/gi,"");
				
				document.getElementById('lista_struttura').style.display='block';
				document.getElementById('lista_struttura').innerHTML=risp;
				
			}
			
		} 
		else 
		{
			alert(xmlHttp);
		}
	}
}


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;
}

