var Blog_Tag = { options: null, form: null, init: function (options) { var form = $('form#' + options.formId); if ($(form).size() == 1) { Blog_Tag.form = form; } else { alert('Form "' + options.formId + '" is undefined'); return false; } Blog_Tag.options = options; Blog_Tag.initValue(); }, initValue: function () { $('input#value', Blog_Tag.form).autocomplete({ source: Blog_Tag.options.sourceUrl, autoFocus: true, minLength: 3 }); } }