/*! jquery validation plugin - v1.10.0 - 9/7/2012 * https://github.com/jzaefferer/jquery-validation * copyright (c) 2012 jörn zaefferer; licensed mit, gpl */ (function (a) { a.extend(a.fn, { validate: function (b) { if (!this.length) { b && b.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"); return } var c = a.data(this[0], "validator"); return c ? c : (this.attr("novalidate", "novalidate"), c = new a.validator(b, this[0]), a.data(this[0], "validator", c), c.settings.onsubmit && (this.validatedelegate(":submit", "click", function (b) { c.settings.submithandler && (c.submitbutton = b.target), a(b.target).hasclass("cancel") && (c.cancelsubmit = !0) }), this.submit(function (b) { function d() { var d; return c.settings.submithandler ? (c.submitbutton && (d = a("").attr("name", c.submitbutton.name).val(c.submitbutton.value).appendto(c.currentform)), c.settings.submithandler.call(c, c.currentform, b), c.submitbutton && d.remove(), !1) : !0 } return c.settings.debug && b.preventdefault(), c.cancelsubmit ? (c.cancelsubmit = !1, d()) : c.form() ? c.pendingrequest ? (c.formsubmitted = !0, !1) : d() : (c.focusinvalid(), !1) })), c) }, valid: function () { if (a(this[0]).is("form")) return this.validate().form(); var b = !0, c = a(this[0].form).validate(); return this.each(function () { b &= c.element(this) }), b }, removeattrs: function (b) { var c = {}, d = this; return a.each(b.split(/\s/), function (a, b) { c[b] = d.attr(b), d.removeattr(b) }), c }, rules: function (b, c) { var d = this[0]; if (b) { var e = a.data(d.form, "validator").settings, f = e.rules, g = a.validator.staticrules(d); switch (b) { case "add": a.extend(g, a.validator.normalizerule(c)), f[d.name] = g, c.messages && (e.messages[d.name] = a.extend(e.messages[d.name], c.messages)); break; case "remove": if (!c) return delete f[d.name], g; var h = {}; return a.each(c.split(/\s/), function (a, b) { h[b] = g[b], delete g[b] }), h } } var i = a.validator.normalizerules(a.extend({}, a.validator.metadatarules(d), a.validator.classrules(d), a.validator.attributerules(d), a.validator.staticrules(d)), d); if (i.required) { var j = i.required; delete i.required, i = a.extend({ required: j }, i) } return i } }), a.extend(a.expr[":"], { blank: function (b) { return !a.trim("" + b.value) }, filled: function (b) { return !!a.trim("" + b.value) }, unchecked: function (a) { return !a.checked } }), a.validator = function (b, c) { this.settings = a.extend(!0, {}, a.validator.defaults, b), this.currentform = c, this.init() }, a.validator.format = function (b, c) { return arguments.length === 1 ? function () { var c = a.makearray(arguments); return c.unshift(b), a.validator.format.apply(this, c) } : (arguments.length > 2 && c.constructor !== array && (c = a.makearray(arguments).slice(1)), c.constructor !== array && (c = [c]), a.each(c, function (a, c) { b = b.replace(new regexp("\\{" + a + "\\}", "g"), c) }), b) }, a.extend(a.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorclass: "error", validclass: "valid", errorelement: "label", focusinvalid: !0, errorcontainer: a([]), errorlabelcontainer: a([]), onsubmit: !0, ignore: ":hidden", ignoretitle: !1, onfocusin: function (a, b) { this.lastactive = a, this.settings.focuscleanup && !this.blockfocuscleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorclass, this.settings.validclass), this.addwrapper(this.errorsfor(a)).hide()) }, onfocusout: function (a, b) { !this.checkable(a) && (a.name in this.submitted || !this.optional(a)) && this.element(a) }, onkeyup: function (a, b) { if (b.which === 9 && this.elementvalue(a) === "") return; (a.name in this.submitted || a === this.lastactive) && this.element(a) }, onclick: function (a, b) { a.name in this.submitted ? this.element(a) : a.parentnode.name in this.submitted && this.element(a.parentnode) }, highlight: function (b, c, d) { b.type === "radio" ? this.findbyname(b.name).addclass(c).removeclass(d) : a(b).addclass(c).removeclass(d) }, unhighlight: function (b, c, d) { b.type === "radio" ? this.findbyname(b.name).removeclass(c).addclass(d) : a(b).removeclass(c).addclass(d) } }, setdefaults: function (b) { a.extend(a.validator.defaults, b) }, messages: { required: "this field is required.", remote: "please fix this field.", email: "please enter a valid email address.", url: "please enter a valid url.", date: "please enter a valid date.", dateiso: "please enter a valid date (iso).", number: "please enter a valid number.", digits: "please enter only digits.", creditcard: "please enter a valid credit card number.", equalto: "please enter the same value again.", maxlength: a.validator.format("please enter no more than {0} characters."), minlength: a.validator.format("please enter at least {0} characters."), rangelength: a.validator.format("please enter a value between {0} and {1} characters long."), range: a.validator.format("please enter a value between {0} and {1}."), max: a.validator.format("please enter a value less than or equal to {0}."), min: a.validator.format("please enter a value greater than or equal to {0}.") }, autocreateranges: !1, prototype: { init: function () { function d(b) { var c = a.data(this[0].form, "validator"), d = "on" + b.type.replace(/^validate/, ""); c.settings[d] && c.settings[d].call(c, this[0], b) } this.labelcontainer = a(this.settings.errorlabelcontainer), this.errorcontext = this.labelcontainer.length && this.labelcontainer || a(this.currentform), this.containers = a(this.settings.errorcontainer).add(this.settings.errorlabelcontainer), this.submitted = {}, this.valuecache = {}, this.pendingrequest = 0, this.pending = {}, this.invalid = {}, this.reset(); var b = this.groups = {}; a.each(this.settings.groups, function (c, d) { a.each(d.split(/\s/), function (a, d) { b[d] = c }) }); var c = this.settings.rules; a.each(c, function (b, d) { c[b] = a.validator.normalizerule(d) }), a(this.currentform).validatedelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", d).validatedelegate("[type='radio'], [type='checkbox'], select, option", "click", d), this.settings.invalidhandler && a(this.currentform).bind("invalid-form.validate", this.settings.invalidhandler) }, form: function () { return this.checkform(), a.extend(this.submitted, this.errormap), this.invalid = a.extend({}, this.errormap), this.valid() || a(this.currentform).triggerhandler("invalid-form", [this]), this.showerrors(), this.valid() }, checkform: function () { this.prepareform(); for (var a = 0, b = this.currentelements = this.elements(); b[a]; a++) this.check(b[a]); return this.valid() }, element: function (b) { b = this.validationtargetfor(this.clean(b)), this.lastelement = b, this.prepareelement(b), this.currentelements = a(b); var c = this.check(b) !== !1; return c ? delete this.invalid[b.name] : this.invalid[b.name] = !0, this.numberofinvalids() || (this.tohide = this.tohide.add(this.containers)), this.showerrors(), c }, showerrors: function (b) { if (b) { a.extend(this.errormap, b), this.errorlist = []; for (var c in b) this.errorlist.push({ message: b[c], element: this.findbyname(c)[0] }); this.successlist = a.grep(this.successlist, function (a) { return !(a.name in b) }) } this.settings.showerrors ? this.settings.showerrors.call(this, this.errormap, this.errorlist) : this.defaultshowerrors() }, resetform: function () { a.fn.resetform && a(this.currentform).resetform(), this.submitted = {}, this.lastelement = null, this.prepareform(), this.hideerrors(), this.elements().removeclass(this.settings.errorclass).removedata("previousvalue") }, numberofinvalids: function () { return this.objectlength(this.invalid) }, objectlength: function (a) { var b = 0; for (var c in a) b++; return b }, hideerrors: function () { this.addwrapper(this.tohide).hide() }, valid: function () { return this.size() === 0 }, size: function () { return this.errorlist.length }, focusinvalid: function () { if (this.settings.focusinvalid) try { a(this.findlastactive() || this.errorlist.length && this.errorlist[0].element || []).filter(":visible").focus().trigger("focusin") } catch (b) { } }, findlastactive: function () { var b = this.lastactive; return b && a.grep(this.errorlist, function (a) { return a.element.name === b.name }).length === 1 && b }, elements: function () { var b = this, c = {}; return a(this.currentform).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () { return !this.name && b.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in c || !b.objectlength(a(this).rules()) ? !1 : (c[this.name] = !0, !0) }) }, clean: function (b) { return a(b)[0] }, errors: function () { var b = this.settings.errorclass.replace(" ", "."); return a(this.settings.errorelement + "." + b, this.errorcontext) }, reset: function () { this.successlist = [], this.errorlist = [], this.errormap = {}, this.toshow = a([]), this.tohide = a([]), this.currentelements = a([]) }, prepareform: function () { this.reset(), this.tohide = this.errors().add(this.containers) }, prepareelement: function (a) { this.reset(), this.tohide = this.errorsfor(a) }, elementvalue: function (b) { var c = a(b).attr("type"), d = a(b).val(); return c === "radio" || c === "checkbox" ? a('input[name="' + a(b).attr("name") + '"]:checked').val() : typeof d == "string" ? d.replace(/\r/g, "") : d }, check: function (b) { b = this.validationtargetfor(this.clean(b)); var c = a(b).rules(), d = !1, e = this.elementvalue(b), f; for (var g in c) { var h = { method: g, parameters: c[g] }; try { f = a.validator.methods[g].call(this, e, b, h.parameters); if (f === "dependency-mismatch") { d = !0; continue } d = !1; if (f === "pending") { this.tohide = this.tohide.not(this.errorsfor(b)); return } if (!f) return this.formatandadd(b, h), !1 } catch (i) { throw this.settings.debug && window.console && console.log("exception occured when checking element " + b.id + ", check the '" + h.method + "' method", i), i } } if (d) return; return this.objectlength(c) && this.successlist.push(b), !0 }, custommetamessage: function (b, c) { if (!a.metadata) return; var d = this.settings.meta ? a(b).metadata()[this.settings.meta] : a(b).metadata(); return d && d.messages && d.messages[c] }, customdatamessage: function (b, c) { return a(b).data("msg-" + c.tolowercase()) || b.attributes && a(b).attr("data-msg-" + c.tolowercase()) }, custommessage: function (a, b) { var c = this.settings.messages[a]; return c && (c.constructor === string ? c : c[b]) }, finddefined: function () { for (var a = 0; a < arguments.length; a++) if (arguments[a] !== undefined) return arguments[a]; return undefined }, defaultmessage: function (b, c) { return this.finddefined(this.custommessage(b.name, c), this.customdatamessage(b, c), this.custommetamessage(b, c), !this.settings.ignoretitle && b.title || undefined, a.validator.messages[c], "warning: no message defined for " + b.name + "") }, formatandadd: function (b, c) { var d = this.defaultmessage(b, c.method), e = /\$?\{(\d+)\}/g; typeof d == "function" ? d = d.call(this, c.parameters, b) : e.test(d) && (d = a.validator.format(d.replace(e, "{$1}"), c.parameters)), this.errorlist.push({ message: d, element: b }), this.errormap[b.name] = d, this.submitted[b.name] = d }, addwrapper: function (a) { return this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper))), a }, defaultshowerrors: function () { var a, b; for (a = 0; this.errorlist[a]; a++) { var c = this.errorlist[a]; this.settings.highlight && this.settings.highlight.call(this, c.element, this.settings.errorclass, this.settings.validclass), this.showlabel(c.element, c.message) } this.errorlist.length && (this.toshow = this.toshow.add(this.containers)); if (this.settings.success) for (a = 0; this.successlist[a]; a++) this.showlabel(this.successlist[a]); if (this.settings.unhighlight) for (a = 0, b = this.validelements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorclass, this.settings.validclass); this.tohide = this.tohide.not(this.toshow), this.hideerrors(), this.addwrapper(this.toshow).show() }, validelements: function () { return this.currentelements.not(this.invalidelements()) }, invalidelements: function () { return a(this.errorlist).map(function () { return this.element }) }, showlabel: function (b, c) { var d = this.errorsfor(b); d.length ? (d.removeclass(this.settings.validclass).addclass(this.settings.errorclass), d.attr("generated") && d.html(c)) : (d = a("<" + this.settings.errorelement + "/>").attr({ "for": this.idorname(b), generated: !0 }).addclass(this.settings.errorclass).html(c || ""), this.settings.wrapper && (d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelcontainer.append(d).length || (this.settings.errorplacement ? this.settings.errorplacement(d, a(b)) : d.insertafter(b))), !c && this.settings.success && (d.text(""), typeof this.settings.success == "string" ? d.addclass(this.settings.success) : this.settings.success(d, b)), this.toshow = this.toshow.add(d) }, errorsfor: function (b) { var c = this.idorname(b); return this.errors().filter(function () { return a(this).attr("for") === c }) }, idorname: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, validationtargetfor: function (a) { return this.checkable(a) && (a = this.findbyname(a.name).not(this.settings.ignore)[0]), a }, checkable: function (a) { return /radio|checkbox/i.test(a.type) }, findbyname: function (b) { return a(this.currentform).find('[name="' + b + '"]') }, getlength: function (b, c) { switch (c.nodename.tolowercase()) { case "select": return a("option:selected", c).length; case "input": if (this.checkable(c)) return this.findbyname(c.name).filter(":checked").length } return b.length }, depend: function (a, b) { return this.dependtypes[typeof a] ? this.dependtypes[typeof a](a, b) : !0 }, dependtypes: { "boolean": function (a, b) { return a }, string: function (b, c) { return !!a(b, c.form).length }, "function": function (a, b) { return a(b) } }, optional: function (b) { var c = this.elementvalue(b); return !a.validator.methods.required.call(this, c, b) && "dependency-mismatch" }, startrequest: function (a) { this.pending[a.name] || (this.pendingrequest++, this.pending[a.name] = !0) }, stoprequest: function (b, c) { this.pendingrequest--, this.pendingrequest < 0 && (this.pendingrequest = 0), delete this.pending[b.name], c && this.pendingrequest === 0 && this.formsubmitted && this.form() ? (a(this.currentform).submit(), this.formsubmitted = !1) : !c && this.pendingrequest === 0 && this.formsubmitted && (a(this.currentform).triggerhandler("invalid-form", [this]), this.formsubmitted = !1) }, previousvalue: function (b) { return a.data(b, "previousvalue") || a.data(b, "previousvalue", { old: null, valid: !0, message: this.defaultmessage(b, "remote") }) } }, classrulesettings: { required: { required: !0 }, email: { email: !0 }, url: { url: !0 }, date: { date: !0 }, dateiso: { dateiso: !0 }, number: { number: !0 }, digits: { digits: !0 }, creditcard: { creditcard: !0} }, addclassrules: function (b, c) { b.constructor === string ? this.classrulesettings[b] = c : a.extend(this.classrulesettings, b) }, classrules: function (b) { var c = {}, d = a(b).attr("class"); return d && a.each(d.split(" "), function () { this in a.validator.classrulesettings && a.extend(c, a.validator.classrulesettings[this]) }), c }, attributerules: function (b) { var c = {}, d = a(b); for (var e in a.validator.methods) { var f; e === "required" ? (f = d.get(0).getattribute(e), f === "" && (f = !0), f = !!f) : f = d.attr(e), f ? c[e] = f : d[0].getattribute("type") === e && (c[e] = !0) } return c.maxlength && /-1|2147483647|524288/.test(c.maxlength) && delete c.maxlength, c }, metadatarules: function (b) { if (!a.metadata) return {}; var c = a.data(b.form, "validator").settings.meta; return c ? a(b).metadata()[c] : a(b).metadata() }, staticrules: function (b) { var c = {}, d = a.data(b.form, "validator"); return d.settings.rules && (c = a.validator.normalizerule(d.settings.rules[b.name]) || {}), c }, normalizerules: function (b, c) { return a.each(b, function (d, e) { if (e === !1) { delete b[d]; return } if (e.param || e.depends) { var f = !0; switch (typeof e.depends) { case "string": f = !!a(e.depends, c.form).length; break; case "function": f = e.depends.call(c, c) } f ? b[d] = e.param !== undefined ? e.param : !0 : delete b[d] } }), a.each(b, function (d, e) { b[d] = a.isfunction(e) ? e(c) : e }), a.each(["minlength", "maxlength", "min", "max"], function () { b[this] && (b[this] = number(b[this])) }), a.each(["rangelength", "range"], function () { b[this] && (b[this] = [number(b[this][0]), number(b[this][1])]) }), a.validator.autocreateranges && (b.min && b.max && (b.range = [b.min, b.max], delete b.min, delete b.max), b.minlength && b.maxlength && (b.rangelength = [b.minlength, b.maxlength], delete b.minlength, delete b.maxlength)), b.messages && delete b.messages, b }, normalizerule: function (b) { if (typeof b == "string") { var c = {}; a.each(b.split(/\s/), function () { c[this] = !0 }), b = c } return b }, addmethod: function (b, c, d) { a.validator.methods[b] = c, a.validator.messages[b] = d !== undefined ? d : a.validator.messages[b], c.length < 3 && a.validator.addclassrules(b, a.validator.normalizerule(b)) }, methods: { required: function (b, c, d) { if (!this.depend(d, c)) return "dependency-mismatch"; if (c.nodename.tolowercase() === "select") { var e = a(c).val(); return e && e.length > 0 } return this.checkable(c) ? this.getlength(b, c) > 0 : a.trim(b).length > 0 }, remote: function (b, c, d) { if (this.optional(c)) return "dependency-mismatch"; var e = this.previousvalue(c); this.settings.messages[c.name] || (this.settings.messages[c.name] = {}), e.originalmessage = this.settings.messages[c.name].remote, this.settings.messages[c.name].remote = e.message, d = typeof d == "string" && { url: d} || d; if (this.pending[c.name]) return "pending"; if (e.old === b) return e.valid; e.old = b; var f = this; this.startrequest(c); var g = {}; return g[c.name] = b, a.ajax(a.extend(!0, { url: d, mode: "abort", port: "validate" + c.name, datatype: "json", data: g, success: function (d) { f.settings.messages[c.name].remote = e.originalmessage; var g = d === !0 || d === "true"; if (g) { var h = f.formsubmitted; f.prepareelement(c), f.formsubmitted = h, f.successlist.push(c), delete f.invalid[c.name], f.showerrors() } else { var i = {}, j = d || f.defaultmessage(c, "remote"); i[c.name] = e.message = a.isfunction(j) ? j(b) : j, f.invalid[c.name] = !0, f.showerrors(i) } e.valid = g, f.stoprequest(c, g) } }, d)), "pending" }, minlength: function (b, c, d) { var e = a.isarray(b) ? b.length : this.getlength(a.trim(b), c); return this.optional(c) || e >= d }, maxlength: function (b, c, d) { var e = a.isarray(b) ? b.length : this.getlength(a.trim(b), c); return this.optional(c) || e <= d }, rangelength: function (b, c, d) { var e = a.isarray(b) ? b.length : this.getlength(a.trim(b), c); return this.optional(c) || e >= d[0] && e <= d[1] }, min: function (a, b, c) { return this.optional(b) || a >= c }, max: function (a, b, c) { return this.optional(b) || a <= c }, range: function (a, b, c) { return this.optional(b) || a >= c[0] && a <= c[1] }, email: function (a, b) { return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.)+(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))$/i.test(a) }, url: function (a, b) { return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.)+(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\ue000-\uf8ff]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) }, date: function (a, b) { return this.optional(b) || !/invalid|nan/.test(new date(a)) }, dateiso: function (a, b) { return this.optional(b) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a) }, number: function (a, b) { return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a) }, digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) }, creditcard: function (a, b) { if (this.optional(b)) return "dependency-mismatch"; if (/[^0-9 \-]+/.test(a)) return !1; var c = 0, d = 0, e = !1; a = a.replace(/\d/g, ""); for (var f = a.length - 1; f >= 0; f--) { var g = a.charat(f); d = parseint(g, 10), e && (d *= 2) > 9 && (d -= 9), c += d, e = !e } return c % 10 === 0 }, equalto: function (b, c, d) { var e = a(d); return this.settings.onfocusout && e.unbind(".validate-equalto").bind("blur.validate-equalto", function () { a(c).valid() }), b === e.val() } } }), a.format = a.validator.format })(jquery), function (a) { var b = {}; if (a.ajaxprefilter) a.ajaxprefilter(function (a, c, d) { var e = a.port; a.mode === "abort" && (b[e] && b[e].abort(), b[e] = d) }); else { var c = a.ajax; a.ajax = function (d) { var e = ("mode" in d ? d : a.ajaxsettings).mode, f = ("port" in d ? d : a.ajaxsettings).port; return e === "abort" ? (b[f] && b[f].abort(), b[f] = c.apply(this, arguments)) : c.apply(this, arguments) } } } (jquery), function (a) { !jquery.event.special.focusin && !jquery.event.special.focusout && document.addeventlistener && a.each({ focus: "focusin", blur: "focusout" }, function (b, c) { function d(b) { return b = a.event.fix(b), b.type = c, a.event.handle.call(this, b) } a.event.special[c] = { setup: function () { this.addeventlistener(b, d, !0) }, teardown: function () { this.removeeventlistener(b, d, !0) }, handler: function (b) { var d = arguments; return d[0] = a.event.fix(b), d[0].type = c, a.event.handle.apply(this, d) } } }), a.extend(a.fn, { validatedelegate: function (b, c, d) { return this.bind(c, function (c) { var e = a(c.target); if (e.is(b)) return d.apply(e, arguments) }) } }) } (jquery); jquery.validator.addmethod("cellphone", function (value, element, params) { var reg = /^[1][358]\d{9}$/; return this.optional(element) || reg.test(value.replace(/\s/ig,"")); }, "例13800138000"); jquery.validator.addmethod("istel", function (value) { var tel = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/; return value ? tel.test(value) : true; }, "例0757-82345678"); jquery.validator.addmethod("ckdn", function (value) { var reg = /^([a-za-z0-9\u4e00-\u9fa5][-a-za-z0-9\u4e00-\u9fa5]{0,62}(\.[a-za-z0-9\u4e00-\u9fa5][-a-za-z0-9\u4e00-\u9fa5]{0,62})+\.?)/; return value ? reg.test(value) : true; }, "输入域名的域名不正确!");