// JavaScript Document


function checknumber(object_value)
{
	if (object_value.length == 0)
		return true;

	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

	check_char = start_format.indexOf(object_value.charAt(0));

	if (check_char == 1)
		decimal = true;
	else if (check_char < 1)
		return false;

	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i));
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
		}
		else if (trailing_blank)
			return false;
		else
			digits = true;
	}	

	return true
}

function submitZipForm()
{
	if(document.zipcodeform.localzip.value == ""||document.zipcodeform.localzip.value.length < 5||isNaN(document.zipcodeform.localzip.value))
	{
		alert("Please enter a valid zip code");
		return false;
	}
	else
	{
		document.zipcodeform.submit()
	}
}
function submitZipForm_a()
{
	if(document.zipcodeform_a.localzip.value == "")
	{
		alert("Please enter a valid zip code");
		return false;
	}
	if(document.zipcodeform_a.localzip.value.length < 5)
	{
		alert("Please enter a valid 5 digit zip code!")
		return false
	}
	if(isNaN(document.zipcodeform_a.localzip.value))
	{
		alert("Zip codes must contain numbers only!")
		return false
	}
	return true
}




	function validateForm()
	{
		var zipTest = '/^[a-zA-Z]+$/'
		formObj = document.getElementById("zipForm")
		if(formObj.localzip.value == '')
		{
			alert("Please enter your zip code!")
			return false
		}
		if(formObj.localzip.value.length < 5)
		{
			alert("Please enter a valid zip code!")
			return false
		}
		if(isNaN(formObj.localzip.value))
		{
			alert("Please enter a valid zip code!")
			return false
		}
	}
