var req = mint.Request();
names = new Array();
values = new Array();
function getSubjects()
{
v = document.getElementById('cities').value; 

    document.getElementById("subjects").disabled = false;
    document.getElementById("searchb").disabled = false;    
    req.getJSON = true;
    req.AddParam("curvalue", v);
    req.Send("/ajax/subjects.php");
    req.OnSuccess = function() 
    {
        for(var i = 0; i < this.responseJSON.length; ++i) 
        {
            names[i] = this.responseJSON[i].name; 
            values[i] = this.responseJSON[i].value;
            select = document.getElementById('subjects');
            select.options[i]=new Option(names[i],values[i],'false','false' );
        }
    }
}

function getSubjectsFill(par)
{
     

    document.getElementById("subjects").disabled = false;
    document.getElementById("searchb").disabled = false;    
    req.getJSON = true;
    req.AddParam("curvalue", par);
    req.Send("/ajax/subjects.php");
    req.OnSuccess = function() 
    {
        for(var i = 0; i < this.responseJSON.length; ++i) 
        {
            names[i] = this.responseJSON[i].name; 
            values[i] = this.responseJSON[i].value;
            select = document.getElementById('subjects');
            select.options[i]=new Option(names[i],values[i],'false','false' );
        }
    }
}