function setCustomStateValue(fld) {alert(fld);
	var action = document.getElementById('field_dropdown_state_custom_'+fld).value;
	document.getElementById(fld).value = action;alert(action);
}

function chooseCustomStateValue(fld) {
	var action = selectbox_value('field_dropdown_state_select_'+fld);
	if (action == 'CUSTOM' || action == 'Enter State/Province') {
		document.getElementById('field_dropdown_state_custom_'+fld).style.display = 'inline';
		document.getElementById(fld).value = '';
	} else {
		document.getElementById('field_dropdown_state_custom_'+fld).style.display = 'none';
		document.getElementById(fld).value = action;
	}
}

function selectbox_value(id) {
	// a quick and easy way of getting the actual value of a select element
  var el = document.getElementById(id);
	if (!el) {
		alert("tried to get value of a select box '" + id + "' that doesn't exist");
		return '';
	}
  return el[el.selectedIndex].value;
}

