function validate_required(field,alerttxt)
{
	with (field)
	{
		if (value==null||value==""||value.length <= 2) {
			alert(alerttxt);
			return false;
		}
		return true;
	}
}

function validate_state(s, c)
{
	if (c[c.selectedIndex].value == 'United States' && s[s.selectedIndex].value == '') {
		alert('Please select a state');
		return false;
	}
	return true;
}
	
function validate_form(thisform)
{
	with (thisform)
	{
		if (!validate_required(city,"Please enter a city (or a 3-letter airport code)"))
			{
			city.focus();
			return false;
		}
		if (city.value.length == 3)
			return true;
		if (!validate_state(state, country))
			{
			state.focus();
			return false;
		}
		return true;
	}
}

