function checkZip(zipIn) {

	// requires FormCheck.js also be included in page that includes this for isblank and isEmpty functions

	var errorMsg;
	
	if( isBlank( zipIn ) || isEmpty( zipIn ) )
	{
		errorMsg =  "Please enter a Zip Code" ;
		return errorMsg;				
	}
	
	var zipCode = stripCharsInBag( zipIn, ' -' );

	if( !isZIPCode( zipCode ) || !isInteger( zipCode ) )
	{
		errorMsg = "Please enter a valid Zip Code";
		return errorMsg;
	}
	
	return "";

}

function reformatZip(zipIn){

	if( zipIn.length == 9 )	// Reformat if 9 digit
	{
		return zipCode.substring( 0, 5 ) + '-' + zipCode.substring( 5, 9 );
	}
	else {
		return zipIn;
	}
	
}

