function validateZIP(field) {

var valid = "0123456789-";
var hyphencount = 0;

zip1=document.catalog.zip.value;

if (zip1.length!=5 && zip1.length!=10) {
   zipm = zip1 + " is invalid. Please enter your 5 digit or 5+4 digit zip code.";
   alert(zipm);
   return false;
   }

for (var i=0; i < zip1.length; i++) {
      temp = "" + zip1.substring(i, i+1);
      if (temp == "-") hyphencount++;
      if (valid.indexOf(temp) == "-1") {
         zipm = zip1 + "\: This zip code value contains invalid characters.  Please try again.";
         alert(zipm);
         return false;
         }
      if ((hyphencount > 1) || ((zip1.length==10) && ""+zip1.charAt(5)!="-")) {
         zipm = zip1 + "\:  The hyphen character should be used with a properly formatted 5+4 digit zip code like \'12345-6789\'. Please try again.";
         alert(zipm);
         return false;
         }
      }

name=document.catalog.first.value;

if (name.length=="") {
   zipm = "First Name is Required. Please enter your First Name and re-submit.";
   alert(zipm);
   return false;
   }
 
name=document.catalog.last.value;

if (name.length=="") {
   zipm = "Last Name is Required. Please enter your Last Name and re-submit.";
   alert(zipm);
   return false;
   }

addr=document.catalog.adr1.value;

if (addr.length=="") {
   zipm = "Address Line 1 is Required. Please enter your Mailing Address and re-submit.";
   alert(zipm);
   return false;
   }

city=document.catalog.city.value;

if (city.length=="") {
   zipm = "City is Required. Please enter your City and re-submit.";
   alert(zipm);
   return false;
   }

zip5 = "";
state1 = document.catalog.state.value;

for (var i=0; i < 5; i++) {
   zip5 = zip5 + zip1.substring(i, i+1);
   }

if ((state1 == "AE") && ((zip5 < 00401) || (zip5 > 99950))) {
   zipm = zip1 + " is not a valid zip code for Military " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "AA") && ((zip5 < 00401) || (zip5 > 99950))) {
   zipm = zip1 + " is not a valid zip code for Military " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "AP") && ((zip5 < 00401) || (zip5 > 99950))) {
   zipm = zip1 + " is not a valid zip code for Military " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "AL") && ((zip5 < 35001) || (zip5 > 36926))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "AK") && ((zip5 < 99501) || (zip5 > 99950))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   } 

if ((state1 == "AZ") && ((zip5 < 85001) || (zip5 > 86556))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   } 

if ((state1 == "AR") && ((zip5 < 71601) || (zip5 > 72959))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "CA") && ((zip5 < 90001) || (zip5 > 96161))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "CO") && ((zip5 < 80001) || (zip5 > 81657))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "CT") && ((zip5 < 06001) || (zip5 > 06907))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "DE") && ((zip5 < 19701) || (zip5 > 19980))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "DC") && ((zip5 < 20001) || (zip5 > 20375))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "FL") && ((zip5 < 32001) || (zip5 > 34997))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "GA") && ((zip5 < 30001) || (zip5 > 31909))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "HI") && ((zip5 < 96701) || (zip5 > 96863))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "ID") && ((zip5 < 83201) || (zip5 > 83876))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "IL") && ((zip5 < 60001) || (zip5 > 62999))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "IN") && ((zip5 < 46001) || (zip5 > 47997))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "IA") && ((zip5 < 50001) || (zip5 > 52807))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "KS") && ((zip5 < 66001) || (zip5 > 67954))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "KY") && ((zip5 < 40001) || (zip5 > 42788))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "LA") && ((zip5 < 70001) || (zip5 > 71486))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "ME") && ((zip5 < 03901) || (zip5 > 04989))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MD") && ((zip5 < 20601) || (zip5 > 21930))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MA") && ((zip5 < 01001) || (zip5 > 02790))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MI") && ((zip5 < 48001) || (zip5 > 49971))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MN") && ((zip5 < 55001) || (zip5 > 56763))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MS") && ((zip5 < 38601) || (zip5 > 39776))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MO") && ((zip5 < 63001) || (zip5 > 65810))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "MT") && ((zip5 < 59001) || (zip5 > 59937))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NE") && ((zip5 < 68001) || (zip5 > 69367))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NV") && ((zip5 < 89001) || (zip5 > 89883))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NH") && ((zip5 < 03031) || (zip5 > 03897))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NJ") && ((zip5 < 07001) || (zip5 > 08904))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NM") && ((zip5 < 87001) || (zip5 > 88437))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NY") && ((zip5 < 10001) || (zip5 > 14905))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "NC") && ((zip5 < 27001) || (zip5 > 28909))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "ND") && ((zip5 < 58001) || (zip5 > 58856))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "OH") && ((zip5 < 43001) || (zip5 > 45899))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "OK") && ((zip5 < 73001) || (zip5 > 74966))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "OR") && ((zip5 < 97001) || (zip5 > 97920))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "PA") && ((zip5 < 15001) || (zip5 > 19611))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "RI") && ((zip5 < 02801) || (zip5 > 02921))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "SC") && ((zip5 < 29001) || (zip5 > 29945))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "SD") && ((zip5 < 57001) || (zip5 > 57799))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "TN") && ((zip5 < 37001) || (zip5 > 38589))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "TX") && ((zip5 < 75001) || (zip5 > 79938))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "UT") && ((zip5 < 84001) || (zip5 > 84790))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "VT") && ((zip5 < 05037) || (zip5 > 05907))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "VA") && ((zip5 < 20101) || (zip5 > 24657))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "WA") && ((zip5 < 98001) || (zip5 > 99403))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "WV") && ((zip5 < 24701) || (zip5 > 26886))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "WI") && ((zip5 < 53001) || (zip5 > 54986))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

if ((state1 == "WY") && ((zip5 < 82001) || (zip5 > 83128))) {
   zipm = zip1 + " is not a valid zip code for the state " + state1;
   alert(zipm);
   return false;
   }

return true;
}
