
function validateForm(f) {
  var e1, e2;
  if( !LastButtonClicked) return true;

  if( LastButtonClicked.id == 'btn_submit') {

    if( !(e2 = document.getElementById('city'))) return false;
    if( !(e1 = document.getElementById('zip'))) return false;
    e1.value = trim(e1.value,'');
    if( e1.value == '' && e2.value == '') {
      alert('No Zip Code or City was provided.');
      LastButtonClicked.style.visibility = "visible";
      return false;
    }
    if( e1.value != '' ) {
      if( !validateUSZip(e1.value)) {
        alert('Invalid zip code!');
        LastButtonClicked.style.visibility = "visible";
        return false;
      }
    }

  } // End of 'btn_submit'
  return true;
}

function chkOther(e) {
  var e1;
  if( e.id == 'zip') {
    if( (e1 = document.getElementById('city'))) e1.value = '';
  } else if( e.id == 'city') {
    if( (e1 = document.getElementById('zip'))) e1.value = '';
  }
}

