// note that in the html the name of the field to be checked must
// be modified in 2 places in the form action ;
// and at the field itself.  Ex:  input type="text" name="deadlink"
// Also, add the name as a required field

function validateZIP(field) {
var valid = "4";
var hyphencount = 0;

if (field.length!=1 && field.length!=10) {
alert("Please enter the correct 2+2 answer.");
return false;
}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Incorrect - please enter your 2+2 answer again.");
return false;
}
if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(1)!="-")) {
alert("Incorrect - please enter your 2+2 answer again.");
return false;
   }
}
return true;
}
