jQuery.validator.addMethod("telefono", function(phone_number, element) {
	phone_number = phone_number.replace(/\s+/g, ""); 
	return this.optional(element) || phone_number.length == 9 && phone_number.match(/(^[69][0-9]{8,8})$/);
}, "Incorrecto");

jQuery.validator.addMethod("edad", function(age, element) {
	age = age.replace(/\s+/g, ""); 
	return this.optional(element) || age.length == 2;
}, "Incorrecto");

jQuery.validator.addMethod("cp", function(cp, element) {
	cp = cp.replace(/\s+/g, ""); 
	return this.optional(element) || cp.length == 5 && cp.match(/^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/);
}, "Incorrecto");

jQuery.validator.addMethod("entidad", function(entidad, element) {
	entidad = entidad.replace(/\s+/g, ""); 
	return this.optional(element) || entidad.length == 4;
}, "Incorrecto");

jQuery.validator.addMethod("sucursal", function(sucursal, element) {
	sucursal = sucursal.replace(/\s+/g, ""); 
	return this.optional(element) || sucursal.length == 4;
}, "Incorrecto");

jQuery.validator.addMethod("dc", function(dc, element) {
	dc = dc.replace(/\s+/g, ""); 
	return this.optional(element) || dc.length == 2;
}, "Incorrecto");

jQuery.validator.addMethod("cuenta", function(cuenta, element) {
	cuenta = cuenta.replace(/\s+/g, ""); 
	return this.optional(element) || cuenta.length == 10;
}, "Incorrecto");
