var req;
	function loadXMLDoc(url) {
    	req = false;
    	// branch for native XMLHttpRequest object
    	if(window.XMLHttpRequest) {
    		try {
				req = new XMLHttpRequest();
        	} catch(e) {
				req = false;
        	}
    	// branch for IE/Windows ActiveX version
    	} else if(window.ActiveXObject) {
       		try {
        		req = new ActiveXObject("Msxml2.XMLHTTP");
      		} catch(e) {
        		try {
        	  		req = new ActiveXObject("Microsoft.XMLHTTP");
        		} catch(e) {
        	  		req = false;
        		}
			}
    	}
		if(req) {
			req.onreadystatechange = processReqChange;
			req.open("GET", url, true);
			req.send("");
		}
	}
	
	function processReqChange() {
    	if (req.readyState == 1) {
        	imageimg = document.getElementById("div_image");
			imageimg.style.display = 'block';
			//preloadimg = new Image ();
			//preloadimg.onload = displayimg;
			//preloadimg.src = '/img/loading.gif';
			//document.getElementById('div_livelli').src=preloadimg.src
		}
		if (req.readyState == 4) {
        	// only if "OK"
        	if (req.status == 200) {
          //  	alert("got 4 and 200");
				// ...processing statements go here...
      			imageimg = document.getElementById("div_image");
				imageimg.style.display = 'none';
				document.getElementById('div_livelli').innerHTML=req.responseText
			} else {
            	alert("There was a problem retrieving the XHTML data:\n" + req.statusText);
        	}
    	}
	}
	
	

 