var axmlHttp;
 

// Create the XML HTTP request object. We try to be
// more cross-browser as possible.
function CreateXmlHttpReq() 
{
    var xmlhttp = null;
    try 
    {
        xmlhttp = new XMLHttpRequest();
    } 
    catch(e) 
    {
        try 
        {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch(e) 
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
  
    return xmlhttp;
}

function getDataAjax(pagina,nomeDiv)
{
//alert(pagina+' - '+nomeDiv);
   if (is_array(axmlHttp))
        indice = axmlHttp.length;
    else
    {
        axmlHttp = new Array();
        indice = 0;
    
    }
    axmlHttp[indice]=CreateXmlHttpReq();
    axmlHttp[indice].onreadystatechange= getDataAjax2;
    axmlHttp[indice].open('GET',pagina,true);
    axmlHttp[indice].send(null); 
}

function getDataAjax2()
{

    if(this.readyState == 4)
    {
        if(this.status==200)
        {
           
            testo = this.responseText.split(';;;');
            var nomeDiv = testo[0];
           
            var valore = testo[1];
     //alert(valore);
            document.getElementById(nomeDiv).innerHTML=valore;
            
        }
    }
}

function is_array(input)
{
    return typeof(input)=='object'&&(input instanceof Array);
}
