/* * jquery.validity v1.3.1 * http://validity.thatscaptaintoyou.com/ * https://github.com/whatgoodisaroad/validity * * dual licensed under mit and gpl * * date: 2013-01-28 (monday, 28 january 2013) */ (function(a,e){function d(b,c,h){var d=[];(b.reduction||b).filter(a.validity.settings.elementsupport).each(function(){c(this)?d.push(this):j(this,f(h,{field:q(this)}))});b.reduction=a(d);return b}function g(){if(a.validity.isvalidating())a.validity.report.errors++,a.validity.report.valid=!1}function j(b,c){g();a.validity.out.raise(a(b),c)}function i(b,c){g();a.validity.out.raiseaggregate(b,c)}function o(b){var a=0;b.each(function(){var b=parsefloat(this.value);a+=isnan(b)?0:b});return a}function f(b, a){for(var h in a)a.hasownproperty(h)&&(b=b.replace(regexp("#\\{"+h+"\\}","g"),a[h]));return p(b)}function q(b){var b=a(b),c=b.prop("id"),h=a.validity.settings.defaultfieldname;if(b.prop("title").length)h=b.prop("title");else if(/^([a-z0-9][a-z]*)+$/.test(c))h=c.replace(/([a-z0-9])[a-z]*/g," $&");else if(/^[a-z0-9]+(_[a-z0-9]+)*$/.test(c)){b=c.split("_");for(c=0;c]*$/},messages:{require:"#{field} is required.",match:"#{field} is in an invalid format.",integer:"#{field} must be a positive, whole number.",date:"#{field} must be formatted as a date. (mm/dd/yyyy)", email:"#{field} must be formatted as an email.",usd:"#{field} must be formatted as a us dollar amount.",url:"#{field} must be formatted as a url.",number:"#{field} must be formatted as a number.",zip:"#{field} must be formatted as a zipcode ##### or #####-####.",phone:"#{field} must be formatted as a phone number ###-###-####.",guid:"#{field} must be formatted as a guid like {3f2504e0-4f89-11d3-9a0c-0305e82c3301}.",time24:"#{field} must be formatted as a 24 hour time: 23:00.",time12:"#{field} must be formatted as a 12 hour time: 12:00 am/pm", lessthan:"#{field} must be less than #{max}.",lessthanorequalto:"#{field} must be less than or equal to #{max}.",greaterthan:"#{field} must be greater than #{min}.",greaterthanorequalto:"#{field} must be greater than or equal to #{min}.",range:"#{field} must be between #{min} and #{max}.",toolong:"#{field} cannot be longer than #{max} characters.",tooshort:"#{field} cannot be shorter than #{min} characters.",nonhtml:"#{field} cannot contain html characters.",alphabet:"#{field} contains disallowed characters.", mincharclass:"#{field} cannot have more than #{min} #{charclass} characters.",maxcharclass:"#{field} cannot have less than #{min} #{charclass} characters.",equal:"values don't match.",distinct:"a value was repeated.",sum:"values don't add to #{sum}.",summax:"the sum of the values must be less than #{max}.",summin:"the sum of the values must be greater than #{min}.",radiochecked:"the selected value is not valid.",generic:"invalid."},out:{start:function(){this.defer("start")},end:function(b){this.defer("end", b)},raise:function(b,a){this.defer("raise",b,a)},raiseaggregate:function(b,a){this.defer("raiseaggregate",b,a)},defer:function(b){var c=a.validity,c=c.outputs[c.settings.outputmode];c[b].apply(c,array.prototype.slice.call(arguments,1))}},charclasses:{alphabetical:/\w/g,numeric:/\d/g,alphanumeric:/[a-za-z0-9]/g,symbol:/[^a-za-z0-9]/g},outputs:{},__private:e,setup:function(b){this.settings=a.extend(this.settings,b);this.__private=this.settings.debugprivates?r:e},report:null,isvalidating:function(){return!!this.report}, start:function(){this.out.start();this.report={errors:0,valid:!0}},end:function(){var b=this.report||{errors:0,valid:!0};this.report=null;this.out.end(b);return b},clear:function(){this.start();this.end()}};a.fn.extend({validity:function(b){return this.each(function(){if(this.tagname.tolowercase()=="form"){var c=null;typeof b=="string"?c=function(){a(b).require()}:a.isfunction(b)&&(c=b);b&&a(this).bind("submit",function(){a.validity.start();c();return a.validity.end().valid})}})},require:function(b){return d(this, function(b){return!!a(b).val().length},b||a.validity.messages.require)},match:function(b,c){if(!c)c=a.validity.messages.match,typeof b==="string"&&a.validity.messages[b]&&(c=a.validity.messages[b]);typeof b=="string"&&(b=a.validity.patterns[b]);return d(this,a.isfunction(b)?function(a){return!a.value.length||b(a.value)}:function(a){if(b.global)b.lastindex=0;return!a.value.length||b.test(a.value)},c)},range:function(b,c,h){return d(this,b.gettime&&c.gettime?function(a){a=new date(a.value);return a>= new date(b)&&a<=new date(c)}:b.substring&&c.substring&&big?function(a){a=new big(a.value);return a.greaterthanorequalto(new big(b))&&a.lessthanorequalto(new big(c))}:function(a){a=parsefloat(a.value);return a>=b&&a<=c},h||f(a.validity.messages.range,{min:a.validity.settings.argtostring(b),max:a.validity.settings.argtostring(c)}))},greaterthan:function(b,c){return d(this,b.gettime?function(a){return new date(a.value)>b}:b.substring&&big?function(a){return(new big(a.value)).greaterthan(new big(b))}: function(a){return parsefloat(a.value)>b},c||f(a.validity.messages.greaterthan,{min:a.validity.settings.argtostring(b)}))},greaterthanorequalto:function(b,c){return d(this,b.gettime?function(a){return new date(a.value)>=b}:b.substring&&big?function(a){return(new big(a.value)).greaterthanorequalto(new big(b))}:function(a){return parsefloat(a.value)>=b},c||f(a.validity.messages.greaterthanorequalto,{min:a.validity.settings.argtostring(b)}))},lessthan:function(b,c){return d(this,b.gettime?function(a){return new date(a.value)< b}:b.substring&&big?function(a){return(new big(a.value)).lessthan(new big(b))}:function(a){return parsefloat(a.value)=b},c||f(a.validity.messages.tooshort,{min:b}))},alphabet:function(b,c){var h=[];return d(this,function(a){for(var c=0;c=c},h||f(a.validity.messages.mincharclass,{min:c,charclass:b}))},maxcharclass:function(b,c,h){typeof b=="string"&&(b=b.tolowercase(),a.validity.charclasses[b]&&(b=a.validity.charclasses[b]));return d(this,function(a){return(a.value.match(b)||[]).length<=c},h||f(a.validity.messages.maxcharclass,{max:c,charclass:b}))},nonhtml:function(b){return d(this, function(b){return a.validity.patterns.nonhtml.test(b.value)},b||a.validity.messages.nonhtml)},equal:function(b,c){var d=(this.reduction||this).filter(a.validity.settings.elementsupport),e=function(a){return a},g=a.validity.messages.equal;if(d.length){a.isfunction(b)?(e=b,typeof c=="string"&&(g=c)):typeof b=="string"&&(g=b);var f=a.map(d,function(a){return e(a.value)}),l=f[0],m=!0,k;for(k in f)f[k]!=l&&(m=!1);if(!m)i(d,g),this.reduction=a([])}return this},distinct:function(b,c){var d=(this.reduction|| this).filter(a.validity.settings.elementsupport),e=function(a){return a},g=a.validity.messages.distinct,f=[],l=[],m=!0;if(d.length){a.isfunction(b)?(e=b,typeof c=="string"&&(g=c)):typeof b=="string"&&(g=b);for(var k=a.map(d,function(a){return e(a.value)}),n=0;no(d))i(d,c||f(a.validity.messages.summin, {min:b})),this.reduction=a([]);return this},radiochecked:function(b,c){var d=(this.reduction||this).filter(a.validity.settings.elementsupport);d.is(":radio")&&d.find(":checked").val()!=b&&i(d,c||a.validity.messages.radiochecked)},radionotchecked:function(b,c){var d=(this.reduction||this).filter(a.validity.settings.elementsupport);d.is(":radio")&&d.filter(":checked").val()==b&&i(d,c||a.validity.messages.radiochecked)},checkboxchecked:function(b){var c=(this.reduction||this).filter(a.validity.settings.elementsupport); c.is(":checkbox")&&!c.is(":checked")&&i(c,b||a.validity.messages.radiochecked)},assert:function(b,c){var e=this.reduction||this;if(e.length)if(a.isfunction(b))return d(this,b,c||a.validity.messages.generic);else if(!b)i(e,c||a.validity.messages.generic),this.reduction=a([]);return this},fail:function(a){return this.assert(!1,a)}});r={validate:d,addtoreport:g,raiseerror:j,raiseaggregateerror:i,numericsum:o,format:f,infer:q,capitalize:p}})(jquery);(function(a){a.validity.outputs.tooltip={tooltipclass:"validity-tooltip",start:function(){a("."+a.validity.outputs.tooltip.tooltipclass).remove()},end:function(e){!e.valid&&a.validity.settings.scrollto&&a("body").scrolltop(a("."+a.validity.outputs.tooltip.tooltipclass).offset().top)},raise:function(e,d){var g=e.offset();g.left+=e.width()+18;g.top+=8;a('
'+d+'
').click(function(){e.focus(); a(this).fadeout()}).css(g).hide().appendto("body").fadein()},raiseaggregate:function(a,d){a.length&&this.raise(a.filter(":last"),d)}}})(jquery); (function(a){function e(a){return a.attr("id").length?a.attr("id"):a.attr("name")}a.validity.outputs.label={cssclass:"error",start:function(){a("."+a.validity.outputs.label.cssclass).remove()},end:function(d){if(!d.valid&&a.validity.settings.scrollto)location.hash=a("."+a.validity.outputs.label.cssclass+":eq(0)").attr("for")},raise:function(d,g){var j="."+a.validity.outputs.label.cssclass+"[for='"+e(d)+"']";a(j).length?a(j).text(g):a("