function is_numeric(strString)
{
	//  check for valid numeric strings	
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

	if (strString.length == 0) return false;

	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
		{
			blnResult = false;
		}
	}
   return blnResult;
}

function validateForm(f) 
{
	if ((f.country.value != "US") && (f.country.value != "Canada")) 
	{
		// no zip required, therefore no validation required
		return true;
	}

	if ((f.country.value == "US") && (!is_numeric(f.zip.value)) && (f.zip.value.length != 5))
	{
		window.alert("Please enter a 5 digit zip code for the United States.");
		return false;						
	}
	
	if ((f.country.value == "Canada") && (f.zip.value.length != 6))
	{
		window.alert("Please enter your 6 character zip code for Canada.");
		return false;						
	}
}