$(document).ready(function(){

    $('#modelContainer').show();

    // Definicja list
    var _models = $('#model').dataSelect('/dictionary/lists/models?context=json');
    var _makesObj = $('#make');
    var _makes = _makesObj.dataSelect('/dictionary/lists/makes?context=json').setDependent(_models);

    // Obsługa zmiany pól
    var _types = $('.typeSelect .inputRadio').change(function(){
        _models.setSource({profile:this, make:_makesObj});
        _makes.setSource({profile:this}).refresh();
    });

    $('#priceMin').dependentSelect($('#priceMax'));
    $('#yearMin').dependentSelect($('#yearMax'));

    // BugFix inputReplace
    $(_types[0]).click().change();
});