// suggestion provider for the suggest control
function ax_suggestions() {
    this.oControl = null;
    this.bAhead = false;
}

ax_suggestions.prototype.requestSuggestions = function (oAutoSuggestControl, bTypeAhead) {
	this.oControl = oAutoSuggestControl;
	this.bAhead = bTypeAhead;
	var sTextboxValue = this.oControl.textbox.value;

	if (sTextboxValue.length > 1) {
		ax_makeRequest_object("ax_suggest.asp?t=" + sTextboxValue.replace(/ /g, "%20"), this, this.callBack);
	}
	else {
		this.oControl.autosuggest(new Array(), this.bAhead);
	}
};

ax_suggestions.prototype.callBack = function() {
    if (http_request.readyState == 4 && http_request.status == 200) {
		var xmldoc = http_request.responseText;
		
		try 
			{
			eval ('var aSuggestions = ' + xmldoc);
			this.oControl.autosuggest(aSuggestions, this.bAhead);
			}
		catch(er) {}
    }
}
