// JavaScript Document
function isValidUSZip(z)
{
	var c = 0;
	var valid = "0123456789-";
	
	if (!(z.length == 5 || z.length == 9 || z.length == 10)) 
	{
		c +=1;
	}
	
	for (var i=0; i < z.length; i++)
	{
		temp = "" + z.substring(i, i+1);
		if (valid.indexOf(temp) == "-1")
		{
			c +=1;
		}
	}

	if (c == 0)
	{
		return true;
	}
	else 
	{
		return false;
	}
}
function isValidCAZip(z)
{
	 var reg1 = /([A-Za-z]\d[A-Za-z]\s\d[A-Za-z]\d)/;
	 var result = z.match(reg1);

	 if (result != null)
	 {
		return true;
	 }
	 else
	 {
		return false;
	 }		
 }
 