function allDigits(str){
	return inValidCharSet(str,"0123456789");
}

function inValidCharSet(str,charset){
	var result = true;

	// Note: doesn't use regular expressions to avoid early Mac browser bugs	
	for (var i=0;i < str.length;i++)
		if (charset.indexOf(str.substr(i,1))<0){
			result = false;
			break;
		}
	return result;
}

<!-- verify form -->
function checkzip() {
	if (allDigits(document.locator.zip.value) && document.locator.zip.value.length == 5){
		return true;
	}
	else {
		alert('Please enter a 5 digit number for ZIP code');
		document.locator.zip.focus();
		return false;
	}
}