/*
 * obsolete functions
 * 
function clearLabel(field){
	if(field.value == "Address (Optional)" || field.value == "City (Optional)"){
		field.value = "";
	}
}

function createLabel(field){
	
}
 */

/**
 * 
 * function showAddressSuggestions
 * @param searchTypeKey   	-- 
 * @param ambiguousLocation	--
 * This function is called from search-main.xhtml
 * 
 */
function showAddressSuggestions(searchTypeKey, ambiguousLocation) {
	//alert('search-main showMapAddressSuggestions');
	if (searchTypeKey == 0) {
		//alert('ZERO');  //searchTypeKey is invalid
	} else {
		if (searchTypeKey == 3) {
			if (ambiguousLocation=='true') {
				// alert("True");
				document.getElementById('distanceForm:mp').component.show()
			} else {
				// alert("false");
				document.getElementById('distanceForm:mp').component.hide()
			}
		}
	}
}
/**
 * 
 * function setFieldFocus
 * Sets focus to the suggestion input field (name) 
 * for name-search.xhtml 
 */
function setFieldFocus() {
	if (document.getElementById("pnsForm:name")) {
		document.getElementById("pnsForm:name").focus();
	}
}
/**
 * 
 * function showMapAddressSuggestions
 * @param ambiguousLocation
 * @return

 * Checks whether there are address suggestion to display
 * based on an ambiguous address/location entered by the user
 * There will be a list of suggestions if mapquest returns 
 * a list after attempting to geocode a location
 * This function is called from map-main.xhtml
 * 
 */
function showMapAddressSuggestions(ambiguousLocation)
{
	//alert('map-main showMapAddressSuggestions');
	if(ambiguousLocation==0) {
		//alert('ZERO');
	} else {
		//alert('*** ambiguousLocation='+ambiguousLocation);
		if(ambiguousLocation=='true'){
			//alert('*** ready to show modalPanel -- ambiguousLocation='+ambiguousLocation);
			document.getElementById('sourceAddressForm:mp').component.show();
		}
		else{
			document.getElementById('sourceAddressForm:mp').component.hide();		
		}
	}


}






