function SuggestionProvider(){
	this.http = zXmlHttp.createRequest();	
}

SuggestionProvider.prototype.requestSuggestions = function(oAutoSuggestControl,bTypeAhead){
	var oHttp = this.http;

	//cancel any active requests
	if(oHttp.readyState != 0){
		oHttp.abort();
	}
	//define the data
	var oData = {
		requesting: "SearchTerms",
		text: oAutoSuggestControl.userText,
		limit: 5
	};

	//open the connection to the server
	oHttp.open("post","ajax/suggestions.php",true);
	oHttp.onreadystatechange = function(){
		if(oHttp.readyState == 4){
			//evaluate the returned text Javascript (an Array)
			var aSuggestions = JSON.parse(oHttp.responseText);

			//provide suggestions to the control
			oAutoSuggestControl.autosuggest(aSuggestions,bTypeAhead);
		}
	};

	//send the request
	oHttp.send(JSON.stringify(oData));
};

SuggestionProvider.prototype.submitSearch = function(oAutoSuggestControl){
	//submits the search term to the page to be added to the database

        var oHttp = this.http;

	//cancel any active requests
	if(oHttp.readyState != 0){
		oHttp.abort();
	}
	//define the data
	var oData = {
		requesting: "SearchAddition",
		text: oAutoSuggestControl.userText
	};

	//open the connection to the server
	oHttp.open("post","ajax/suggestions.php",true);

	//send the request
	oHttp.send(JSON.stringify(oData));
};