Eh...il problema però così è che getstructure() ad un certo punto richiama getState():

codice:
http.open('GET','get.php?id='+valore, true);
	http.onreadystatechange = function() { getState(uni,id); };
	http.send(null);
...e anche getState ha bisogno della variabile http.
Devo includere tutto in una macrofuzione?