// This is a port of ajaxsuggestion.js to use the jQuery framework instead of the Prototype framework.
var AjaxSuggestion = function(properties) {
	this.options = Object.extend({
		timeoutInterval: 1000,
		callback: Prototype.emptyFunction
	}, properties || {});
	return this;
}
AjaxSuggestion.prototype = {
	onSuggest: function(text) {
		this.text = text;
		var _this = this;
		setTimeout(function() { _this._getSuggestions(text); }, this.options.timeoutInterval);
	},
	
	_getSuggestions: function(text) {
		if (this.text == text) {
			this.options.callback(text);
		}
	}
};