function formatPhone(field)
{
	var myChar = "";
	var newField = "";
	var phone = "";

	//Make the value numeric ONLY
	for(var i = 0; i < field.value.length; ++i)
	{
		myChar = field.value.substring(i, i+1);
		if(myChar == "0" || myChar == "1" || myChar == "2" || myChar == "3" || myChar == "4" || myChar == "5" || myChar == "6" || myChar == "7" || myChar == "8" || myChar == "9")
		{
			newField = ""+newField+myChar;
		}
	}

	//Set the field value to this new value
	field.value = ""+newField;

	//Check the length
	if(field.value.length == 10)	//Home number (xxx) xxx-xxxx
	{
		phone = "(" + newField.substring(0, 3) + ") " + newField.substring(3, 6) + "-" + newField.substring(6, 10);
	}
	if(field.value.length == 11)	//1-800 number x-xxx-xxx-xxxx
	{
		phone = "" + newField.substring(0, 1) + "-" + newField.substring(1, 4) + "-" + newField.substring(4, 7)+ "-" + newField.substring(7, 11);
	}

	//Return the value of phone (Blank if it isn't a valid number)
	return(phone);	
}