// Base Yahoo AutoComplete class.
// Will take care of calling the remoteURL and show the list of options for 
// text data delimited by \t and \n.


function YAC1 (remoteURL, acId, acCntrId, acListId) {
	// Define the Data source...
	// alert("Building YAC for " + remoteURL);
	this.oDS = new YAHOO.util.XHRDataSource(remoteURL);
	// this.oDS.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
	this.oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
	this.oDS.maxCacheEntries = 100;
	this.oDS.responseSchema = { 
	        recordDelim: "\n", 
	        fieldDelim: "\t" 
   	}; 

	// Define the autoComplete and connect it up to the Data source
   	this.oAC = new YAHOO.widget.AutoComplete(acId, acCntrId, this.oDS);
   	this.oAC.maxResultsDisplayed = 100;
   	this.oAC.minQueryLength = 3;
	/* this.oAC.queryDelay = 2;
	this.oAC.typeAhead = true;
	*/
}		

function YAC(remoteURL, acId, acCntrId) {
	alert("Setting up autocomplete for " + acId);
	var options = { serviceUrl: remoteURL, minChars: 2, maxHeight: 300 }
	var ac = $(acId).autocomplete(options);
}

