function execJS(t)
{
    var p1 = 0, p2 = 0, p3 = 0, p4 = 0;
    p1 = t.indexOf("<" + "script", 0);
    if(p1 == -1) return t;
    
    p2 = t.indexOf(">", p1 + 7) + 1;
    p3 = t.indexOf("<" + "/script>", p2);
    p4 = p3 + 9;
    
    var c = t.substring(p2, p3);
    var s = document.createElement("script");
    s.type = "text/javascript";
    s.text = c;
    document.getElementsByTagName("head")[0].appendChild(s);
    
    t = t.substring(0, p1) + t.substr(p4);
    return execJS(t);

}
    function makeRequest(id_div_output,notify_waiting,url) {

		//alert(url);
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

		if(notify_waiting){
			document.getElementById(id_div_output).innerHTML='<img src=\"http://'+document.location.hostname+'/_img/progressbar.gif\" />';
		}
		//alert(url);
        http_request.onreadystatechange = function() { alertContents(http_request,id_div_output); };
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents(http_request,output) {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
			risposta=http_request.responseText;
			//alert(output);
			document.getElementById(output).innerHTML=risposta;
			execJS(risposta);
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
 

    function makeRequest_doafter(id_div_output,notify_waiting,url,funzione) {


        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

		if(notify_waiting){
			document.getElementById(id_div_output).innerHTML='<img src=\"http://'+document.location.hostname+'/files/getbyname/progressbar.gif\" />';
		}
		//alert(url);
        http_request.onreadystatechange = function() { alertContents_doafter(http_request,id_div_output,funzione); };
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents_doafter(http_request,output,funzione) {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
			risposta=http_request.responseText;
			//alert(output);
			document.getElementById(output).innerHTML=risposta;
			funzione();
            } else {
                alert('There was a problem with the request.');
            }
        }

    }

       