//Updates the car model list when a car maker is provided
function update_car_model(el) {
    var pre = '';
    if (/\/car\//.test(window.location))
        pre = '../';
    var id = el.value;
    $.ajax({
        url:pre+'javascript/xhr.php?task=car_model_list&id='+id,
        cache : true,
        beforeSend : function(loading) {
            $('#car_model').attr('disabled','disabled');
            $('#search').attr('disabled','disabled');
        },
        complete: function(data) {
            $('#car_model').html(data.responseText);
            $('#car_model').removeAttr('disabled');
            $('#search').removeAttr('disabled');
        }
    });
}

