The Prototype's $() function is a handy shorthand for window.document.getElementById():
function clearCityAndStateFields() { $("form:city").value = ""; $("form:state").value = ""; }
function setCityAndStateFields(city, state) { $("form:city").value = city; $("form:state").value = state; }