function initialize_search_bar()
{
	YAHOO.example.BasicRemote = function() {
		// Use an XHRDataSource
		var oDS = new YAHOO.util.XHRDataSource("simple_search.php");
		// Set the responseType
		oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
		// Define the schema of the delimited results
		oDS.responseSchema = {
			recordDelim: "\n",
			fieldDelim: "\t",
			fields: ["id", "type", "name"]
		};
		// Enable caching
		oDS.maxCacheEntries = 5;

		// Instantiate the AutoComplete
		var oAC = new YAHOO.widget.AutoComplete("search_input", "search_container", oDS);
		
		//define your itemSelect handler function:
		var itemSelectHandler = function(sType, aArgs) {
			//YAHOO.log(sType); // this is a string representing the event;
							  // e.g., "itemSelectEvent"
			var oMyAcInstance = aArgs[0]; // your AutoComplete instance
			var elListItem = aArgs[1]; // the <li> element selected in the suggestion
									   // container
			var oData = aArgs[2]; // object literal of data for the result

			//objectInspect(oData);
			document.getElementById("search_form").submit();
//			alert(oData[0]);
		};
		 
		//subscribe your handler to the event, assuming
		//you have an AutoComplete instance myAC:
		oAC.itemSelectEvent.subscribe(itemSelectHandler);
						
		return {
			oDS: oDS,
			oAC: oAC
		};
	}();
}

function search_bar_focus()
{
	if (document.getElementById("search_input").value == "Start your search here...")
		document.getElementById("search_input").value = "";
}

function search_bar_blur()
{
	if (document.getElementById("search_input").value == "")
		document.getElementById("search_input").value = "Start your search here...";
}

YAHOO.util.Event.addListener(window, "load", initialize_search_bar);