			function FormatPhone(thisControl)
			{
			  var strInitial = thisControl.value
			  var strFinal = new String()
			  var j = 0
			  var rePhone = new RegExp("[(]\\d\\d\\d[)][ ]\\d\\d\\d[-]\\d{4}$");
			
			  if (strInitial.length > 2)
			    strFinal = "(";
			  // here we check for the already formatted phone number and exit if true
			  if ((rePhone.test(strInitial) == true))
			  {
			    return true;
			  }
			  
			  if ( (strInitial.length > 1) && (strInitial.charAt(0) == '1'))
			  {
			     strInitial = strInitial.substring(1,strInitial.length);
			  }
			  
			  // here we begin processing the field, placing the numbers into a new phone number string
			  for (var i = 0; i < strInitial.length; ++i)
			  {
			    if ((strInitial.charAt(i) == '0') || (strInitial.charAt(i) == '1') ||
			        (strInitial.charAt(i) == '2') || (strInitial.charAt(i) == '3') ||
			        (strInitial.charAt(i) == '4') || (strInitial.charAt(i) == '5') ||
			        (strInitial.charAt(i) == '6') || (strInitial.charAt(i) == '7') ||
			        (strInitial.charAt(i) == '8') || (strInitial.charAt(i) == '9'))
			    {
			      j = j + 1
			      if (j == 4)
			      {
			        strFinal = strFinal + ") ";
			      }
			      if (j == 7)
			      {
			        strFinal = strFinal + "-";
			      }
			      if (j < 11)
			      {
			        strFinal = strFinal + strInitial.charAt(i);
			      }
			    }
			  }
			  thisControl.value = strFinal;
			  if (strFinal.length == 1)
				 thisControl.value = "";
				
			  // here we check for an entry clearly too long or too short and flag it
			  if ((strFinal.length != 14))
			  {
			    return false;
			  }
			  else
			  {
			    return true;
			  }
			}
