	// DS_XHR Parameters:
	//   URL to send data to
	//   Array containing record and field delimiter characters
	var objCitySource = new YAHOO.util.XHRDataSource("/GeoData/GetCityList.asp"); 
	objCitySource.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
	objCitySource.responseSchema = {
		recordDelim: "\n",
		fieldDelim: "\t"
	};
	
	// var objCitySource = new YAHOO.widget.DS_XHR("/GeoData/GetCityList.asp", ["\n", "\t"]); 
	// objCitySource.responseType = YAHOO.widget.DS_XHR.prototype.TYPE_FLAT; 
	objCitySource.maxCacheEntries = 0; 
	objCitySource.queryMatchSubset = false;
	objCitySource.scriptQueryAppend = ""; 
	
	var sCityDataSet = "";


	function initAutoObject(obj)
	{
		// Animation -- Optional
		// Container will expand and collapse vertically
		obj.animVert = true;

		// Container will expand and collapse horizontally
		obj.animHoriz = false;

		// Container animation will take 0.3 seconds to complete
		obj.animSpeed = 0.3;

		// Other
		obj.queryDelay = .1;
		obj.minQueryLength = 1;
		obj.useShadow = false;
		obj.typeAhead = false;
		obj.autoHighlight = false;
		obj.maxResultsDisplayed = 15;
		obj.useIFrame = true;
		
		// Format result (called for each received record, aResultItem is an array of fields received)
		obj.formatResult = function(aResultItem, sQuery) {
			var sResults = "";
			var nMax = aResultItem.length;
			var nIndex;

			return(aResultItem[0]);
		};
	}
	
// Setup object used for the default "to city" field (if it exists)	
	if (document.getElementById("AutoCityList"))
	{
		objAutoCity = new YAHOO.widget.AutoComplete("ToCityName", "AutoCityList", objCitySource);
		initAutoObject(objAutoCity);
	// Register callback function (called when an autofill option is selected
		objAutoCity.itemSelectEvent.subscribe(callBack);
	}

// Setup object used for the "from city" field (if it exists)
	if (document.getElementById("AutoFromCityList"))
	{
		objAutoFromCity = new YAHOO.widget.AutoComplete("FromCityName", "AutoFromCityList", objCitySource);
		initAutoObject(objAutoFromCity);
		// Register callback function (called when an autofill option is selected
		objAutoFromCity.itemSelectEvent.subscribe(callBack);
	}

	// On item select callback (b[2] = item selected)
	function callBack(a, b, c) {
		var query = String(b[2]);
		var queryArray = query.split(",");
		var stateName = queryArray[2];
		
		// alert('callback: a="' + a + '", b="' + b + '", c="' + c + '", query="' + b[2] + '"');
		
		// updateAjaxState();
	}
	


	function updateAjaxState(stateID) {
	
		if (stateID)
			objCitySource.scriptQueryAppend = 's=' + stateID + '&ds=' + sCityDataSet;
		else
			objCitySource.scriptQueryAppend = 's=0';
		
		objCitySource.flushCache();
	}
	
	function setCityDataSet(sDSName)
	{	sCityDataSet = sDSName;
	}
	
	//updateAjaxState(document.frmMoveQuotes.ToState.options[document.frmMoveQuotes.ToState.selectedIndex].value);

	
	function initStateLocal(formName, stateDropName, cityDropName, initialStateCode, initialCityId) 
	{ }
