$(document).ready(function(){
    jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
    phone_number = phone_number.replace(/\s+/g, ""); 
	return this.optional(element) || phone_number.length > 9 &&
		phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Must be a valid number");

$("form").validate({
  rules: {
    field: {
      required: true,
      phoneUS: true
    }
  }
});
if(window.location.href.indexOf('?success') > 0) {
	alert('Thank you for contacting us.');
}
  });

