function createRequestObject()
{
    var ro;
    ro = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
    return ro;
}



var http = createRequestObject();




function GetIdCountry()
{
    var ID_Country = document.getElementById('countryList').options[document.getElementById('countryList').selectedIndex].value;
    return ID_Country;
}




function GetIdState()
{
    var ID_State = document.getElementById('stateList').options[document.getElementById('stateList').selectedIndex].value;
    return ID_State;
}




/*function sndReq(param,arg1,arg2)
{
    IDState = GetIdState();
    http.open('get', 'ajax.php?param='+param+'&IDState='+IDState+'&arg1='+arg1+'&arg2='+arg2);
    http.onreadystatechange = handleResponse;
    http.send(null);
}*/




function sndReq(param)
{
    var IdCountry = GetIdCountry();
    http.open('get', './ajax.php?param='+param+'&IdCountry='+IdCountry);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function sndReq2(param)
{
    var IdState = GetIdState();
    http.open('get', './ajax.php?param='+param+'&IdState='+IdState);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function listCountry(param)
{
    http.open('get', './ajax.php?param='+param);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function handleResponse()
{
    if(http.readyState == 4) {
        var response = http.responseText;
        var update = new Array();

        if(response.indexOf('|') != -1) {
            update = response.split('|');
            document.getElementById(update[0]).innerHTML = update[1];
        }
    }
}




function modifStatusPays(arg1,arg2)
{
    http.open('get', 'ajax.php?param=ModifStatusPays_'+arg1+'&ID_Country='+arg1+'&Status='+arg2);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function help(arg)
{
    http.open('get', './ajax.php?param=HelpMe&arg='+arg);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function ViewOrder(arg)
{
    http.open('get', './ajax.php?param=ViewOrder&arg='+arg);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function execAction(arg1, arg2)
{
    http.open('get', './ajax.php?param='+arg1+'&arg2='+arg2);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function addData(param)
{
    http.open('get', './ajax.php?param='+param);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function saveData()
{
    var data = document.addProduct.ID_Cat.value;
    http.open('get', './ajax.php?param=saveData&data='+data);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function saveDataSubCat()
{
    var data = document.addProduct.ID_SCat.value;
    http.open('get', './ajax.php?param=saveDataSubCat&data='+data);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function geoData(param1, param2)
{
    var id = document.getElementById(param2).options[document.getElementById(param2).selectedIndex].value;
    http.open('get', './ajax.php?id='+id+'&param='+param1);
    http.onreadystatechange = handleResponse;
    http.send(null);
}




function action(p1, p2, p3)
{
    http.open('get', './ajax.php?param='+p1+'&param2='+p2+'&param3='+p3);
    http.onreadystatechange = handleResponse;
    http.send(null);
}





