function checkCheckBox(){
if (document.f1.agree.checked == false )
{
alert('You must agree with the terms and conditions to continue.');
return false;
}
else

     var theCount = 0;
     var theString = document.f1.phone.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone.value = newPhone;
     }
		 else {
			alert('Please enter your phone number in the following format, including area code: 555-555-5555');
			return false;
		 }
     var theCount = 0;
     var theString = document.f1.phone2.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone2.value = newPhone;
     }
}

function checkPhone(){
     var theCount = 0;
     var theString = document.f1.phone.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone.value = newPhone;
     }
		 else {
			alert('Please enter your phone number in the following format, including area code: 555-555-5555');
			return false;
		 }
     var theCount = 0;
     var theString = document.f1.phone2.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone2.value = newPhone;
     }
}

function checkCheckBoxChange(){
if (document.f1.agree.checked == false )
{
alert('You must agree with the terms and conditions to continue.');
return false;
}
else
     var theCount = 0;
     var theString = document.f1.phone_old.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone_old.value = newPhone;
     }
		 else {
			alert('Please enter your phone number in the following format, including area code: 555-555-5555');
			return false;
		 }

     var theCount = 0;
     var theString = document.f1.phone.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone.value = newPhone;
     }
		 else {
			alert('Please enter your phone number in the following format, including area code: 555-555-5555');
			return false;
		 }
     var theCount = 0;
     var theString = document.f1.phone2.value;
     var newString = "";
     var myString = theString;
     var theLen = myString.length;
     for ( var i = 0 ; i < theLen ; i++ )
     {
     // Character codes for ints 1 - 9 are 48 - 57
          if ( (myString.charCodeAt(i) >= 48 ) && (myString.charCodeAt(i) <= 57) )
          newString = newString + myString.charAt(i);   
     }
// Now the validation to determine that the remaining string is 9 characters.
     if (newString.length == 10 )
     {
// Now the string has been stripped of other chars it can be reformatted to ###-##-#### 
          var newLen = newString.length;
          var newPhone = "";
          for ( var i = 0 ; i < newLen ; i++ )
          {
               if ( ( i == 2 ) || ( i == 5 ) )
               {
                    newPhone = newPhone + newString.charAt(i) + "-";
               }else{
                    newPhone = newPhone + newString.charAt(i);
               }
          }
          document.f1.phone2.value = newPhone;
     }
}

