    function showStopplaces(nameFrom, stopplace) {

        var cont = document.getElementById('stopplacescombo');
        //var loading = document.getElementById('loading');
        var ans="";
        var opt="";
        var i=0;
        var o=0;
        var selectedIndex=0;

        //cont.innerHTML = loading.innerHTML;
        var http = createRequestObject();
        if( http )
        {
            http.open('get', "./getstopplaces.php?namefrom="+nameFrom);
            http.onreadystatechange = function ()
            {
                if(http.readyState == 4)
                {
                    ans=http.responseText;
                    ans=ans.toString();
                    cont.length=0;
                    while (i<ans.length){
                        if (ans.substr(i, 1)=="~"){
                            cont[o] = new Option(opt.substr(0,23) , opt);
                            if (opt==stopplace){
                                selectedIndex=o;
                            }
                            o++;
                            i++;
                            opt="";
                        } else {
                            opt=opt+ans.substr(i, 1);
                            i++;
                        }
                    }
                    cont.selectedIndex=selectedIndex;
                }
            }
            http.send(null);
        }
        else
        {
            document.location = link;
        }
    }

    // создание ajax объекта
    function createRequestObject()
    {
        try { return new XMLHttpRequest() }
        catch(e)
        {
            try { return new ActiveXObject('Msxml2.XMLHTTP') }
            catch(e)
            {
                try { return new ActiveXObject('Microsoft.XMLHTTP') }
                catch(e) { return null; }
            }
        }
    }


