function ParsePhoneNumber( PhoneField )
{
   var PhoneNumberInitialString = PhoneField.value;
   var FmtStr="";
   var index = 0;
   var LimitCheck;

   LimitCheck = PhoneNumberInitialString.length;
   if( LimitCheck < 1 ) return true;

   while (index != LimitCheck) {
      if (isNaN(parseInt(PhoneNumberInitialString.charAt(index)))) {
      } else {
         FmtStr = FmtStr + PhoneNumberInitialString.charAt(index);
      }
      index = index + 1;
   }
   if (FmtStr.length == 10) {
      FmtStr = FmtStr.substring(0,3) + "/" + FmtStr.substring(3,6) + "-" + FmtStr.substring(6,10);
      PhoneField.value = FmtStr;
      return true;
   } else {
      FmtStr=PhoneNumberInitialString;
      alert("Phone/Fax numbers must have exactly ten digits, and be formatted at ###/###-####.  Please update your number.");
      //PhoneField.value = FmtStr;
      PhoneField.focus();
      return false;
   }
}

function ValidatePhones(phone_corp, phone_tollfree, fax)
{
  if( ParsePhoneNumber(phone_corp) ) {
     if( ParsePhoneNumber(phone_tollfree) ) {
        if( ParsePhoneNumber(fax) ) {
           return true;
        }
     }
  }
  return false;
}


