function findValue(li) {
	if( li == null ) return alert("No match!");

	// if coming from an AJAX call, let's use the CityId as the value
	if( !!li.extra ) var sValue = li.extra[0];

	// otherwise, let's just display the value in the text box
	else var sValue = li.selectValue;
	
	//document.forms[0].depLoc.value = sValue;
	
	
	//document.forms[0].source.value = li.innerHTML;
	document.forms[0].CityAjax.focus();
	
	//alert("The value you selected was: " + document.forms[0].depLoc.value);
	
	//alert(li.innerHTML)
}
function TofindValue(li) {
	if( li == null ) return alert("No match!");

	// if coming from an AJAX call, let's use the CityId as the value
	if( !!li.extra ) var sValue = li.extra[0];

	// otherwise, let's just display the value in the text box
	else var sValue = li.selectValue;
	
	//document.forms[0].arrLoc.value = sValue;
	//document.forms[0].destination.value = li.innerHTML;
	document.forms[0].ToCityAjax.focus();
	
	//alert("The value you selected was TOOOOOOOOOO: " + document.forms[0].arrLoc.value);
	
}
function selectItem(li) {
	findValue(li);
}
function ToselectItem(li) {
	TofindValue(li);
}

function formatItem(row) {
	//return row[0] + " (" + row[1] + ")";
	return row[0] ;
}
function ToformatItem(row) {
	//return row[0] + " (" + row[1] + ")";
	return row[0];
}
function lookupAjax(){
	var oSuggest = $("#CityAjax")[0].autocompleter;

	oSuggest.findValue();

	return false;
}

function lookupLocal(){
	var oSuggest = $("#CityLocal")[0].autocompleter;

	oSuggest.findValue();

	return false;
}

function doFocus(obj,def_val)
{
	if(obj.value==	def_val)
	{
		obj.value = "";
		obj.select();
	
		
	}
}
function doLost(obj,def_val)
{
	if(obj.value==	"")
	{
		obj.value = def_val;
	}
}

