[AutoComplete] setting dynamically 'minChars' option

[AutoComplete] setting dynamically 'minChars' option

[AutoComplete plugin]
 
Hi all,
 
I would like to be able to set the 'minChars' option with a variable, whenever my page is refreshed
 
So far, neither of these solutions work:
 
1.  $("#q").autocomplete([url], {
  minChars: function() {return aNumber;}, //instead of "minChars: aNumber"
..}
does'nt work because minChars seems not accepting functions


 
2. <body onLoad="$('#q').setOptions({minChars: aNumber});">
does'nt work because onLoad seems to be executed before the autocomplete function (that overrides it)

Possible solutions could be:
1. move to JQuery UI, where a built-in "disable" function exists
 
Do you see anything else ?
Thanks for your help
Didier