function Concatinate(Value1, Value2)
{

var StatusSelIndex2;
var StatusSelVal2;

StatusSelIndex2 = document.frmzip.elements[Value2].selectedIndex;
StatusSelVal2 = document.frmzip.elements[Value2].options[StatusSelIndex2].value;

var StatusSelIndex3;
var StatusSelVal3;

StatusSelIndex3 = document.frmzip.elements[Value1];
StatusSelVal3 = document.frmzip.elements[Value1].value; 


zip_city = StatusSelVal3;
city = 'zip_city=' + zip_city + '&';

zip_state = StatusSelVal2;
state = 'state=' + zip_state;

document.frmzip.citystate.value = StatusSelVal3 + " " + StatusSelVal2
                
}

function validate(field) { 
  var url = "";
  var formerror = false;
  action = checkFields(field);
  if (action != "") formerror = true;
  if (formerror){
    top.location.replace(action);
    return false;
  }else{
    return true;
    }
}

function checkFields (field){
action2 = Concatinate('city','state');

zip_city = field.city.value;
city = 'zip_city=' + zip_city + '&';

zip_state = field.state.value;
state = 'state=' + zip_state;

  var ok = true;        
        if ((field.city.value == "") && (field.state.value == "")){
            url = 'http://zip4.usps.com/zip4/citytown_cserror.htm?' + city + state;
            ok=false;
        }
        else if (field.city.value.length < 1){
            url = 'http://zip4.usps.com/zip4/citytown_cityerror.htm?' + city + state;
            ok=false;
        }
        else if (field.state.value == ""){
            url = 'http://zip4.usps.com/zip4/citytown_stateerror.htm?' + city + state;
            ok=false;
        }
    
        if (ok == false) return url;
        else return "";
}