(function ($) { $.extend({ metadata: { defaults: { type: "class", name: "metadata", cre: /({.*})/, single: "metadata" }, setType: function (a, b) { this.defaults.type = a, this.defaults.name = b }, get: function (elem, opts) { var settings = $.extend({}, this.defaults, opts); settings.single.length || (settings.single = "metadata"); var data = $.data(elem, settings.single); if (data) return data; if (data = "{}", "class" == settings.type) { var m = settings.cre.exec(elem.className); m && (data = m[1]) } else if ("elem" == settings.type) { if (!elem.getElementsByTagName) return void 0; var e = elem.getElementsByTagName(settings.name); e.length && (data = $.trim(e[0].innerHTML)) } else if (void 0 != elem.getAttribute) { var attr = elem.getAttribute(settings.name); attr && (data = attr) } return 0 > data.indexOf("{") && (data = "{" + data + "}"), data = eval("(" + data + ")"), $.data(elem, settings.single, data), data } } }), $.fn.metadata = function (a) { return $.metadata.get(this[0], a) } })(jQuery); (function (e) { var a = [], d = /^url\(["']?([^"'\)]*)["']?\);?$/i, c = /\.png$/i, b = e.browser.msie && e.browser.version == 6; function f() { e.each(a, function () { this.refresh(true) }) } e(window).resize(f); e.Poshytip = function (h, g) { this.$elm = e(h); this.opts = e.extend({}, e.fn.poshytip.defaults, g); this.$tip = e(['
', '
', '
', "
"].join("")).appendTo(document.body); this.$arrow = this.$tip.find("div.tip-arrow"); this.$inner = this.$tip.find("div.tip-inner"); this.disabled = false; this.content = null; this.init() }; e.Poshytip.prototype = { init: function () { a.push(this); var g = this.$elm.attr("title"); this.$elm.data("title.poshytip", g !== undefined ? g : null).data("poshytip", this); if (this.opts.showOn != "none") { this.$elm.bind({ "mouseenter.poshytip": e.proxy(this.mouseenter, this), "mouseleave.poshytip": e.proxy(this.mouseleave, this) }); switch (this.opts.showOn) { case "hover": if (this.opts.alignTo == "cursor") { this.$elm.bind("mousemove.poshytip", e.proxy(this.mousemove, this)) } if (this.opts.allowTipHover) { this.$tip.hover(e.proxy(this.clearTimeouts, this), e.proxy(this.mouseleave, this)) } break; case "focus": this.$elm.bind({ "focus.poshytip": e.proxy(this.show, this), "blur.poshytip": e.proxy(this.hide, this) }); break } } }, mouseenter: function (g) { if (this.disabled) { return true } this.$elm.attr("title", ""); if (this.opts.showOn == "focus") { return true } this.clearTimeouts(); this.showTimeout = setTimeout(e.proxy(this.show, this), this.opts.showTimeout) }, mouseleave: function (g) { if (this.disabled || this.asyncAnimating && (this.$tip[0] === g.relatedTarget || jQuery.contains(this.$tip[0], g.relatedTarget))) { return true } var h = this.$elm.data("title.poshytip"); if (h !== null) { this.$elm.attr("title", h) } if (this.opts.showOn == "focus") { return true } this.clearTimeouts(); this.hideTimeout = setTimeout(e.proxy(this.hide, this), this.opts.hideTimeout) }, mousemove: function (g) { if (this.disabled) { return true } this.eventX = g.pageX; this.eventY = g.pageY; if (this.opts.followCursor && this.$tip.data("active")) { this.calcPos(); this.$tip.css({ left: this.pos.l, top: this.pos.t }); if (this.pos.arrow) { this.$arrow[0].className = "tip-arrow tip-arrow-" + this.pos.arrow } } }, show: function () { if (this.disabled || this.$tip.data("active")) { return } this.reset(); this.update(); this.display(); if (this.opts.timeOnScreen) { setTimeout(e.proxy(this.hide, this), this.opts.timeOnScreen) } }, hide: function () { if (this.disabled || !this.$tip.data("active")) { return } this.display(true) }, reset: function () { this.$tip.queue([]).detach().css("visibility", "hidden").data("active", false); this.$inner.find("*").poshytip("hide"); if (this.opts.fade) { this.$tip.css("opacity", this.opacity) } this.$arrow[0].className = "tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"; this.asyncAnimating = false }, update: function (j, k) { if (this.disabled) { return } var i = j !== undefined; if (i) { if (!k) { this.opts.content = j } if (!this.$tip.data("active")) { return } } else { j = this.opts.content } var h = this, g = typeof j == "function" ? j.call(this.$elm[0], function (l) { h.update(l) }) : j == "[title]" ? this.$elm.data("title.poshytip") : j; if (this.content !== g) { this.$inner.empty().append(g); this.content = g } this.refresh(i) }, refresh: function (h) { if (this.disabled) { return } if (h) { if (!this.$tip.data("active")) { return } var k = { left: this.$tip.css("left"), top: this.$tip.css("top") } } this.$tip.css({ left: 0, top: 0 }).appendTo(document.body); if (this.opacity === undefined) { this.opacity = this.$tip.css("opacity") } var l = this.$tip.css("background-image").match(d), m = this.$arrow.css("background-image").match(d); if (l) { var i = c.test(l[1]); if (b && i) { this.$tip.css("background-image", "none"); this.$inner.css({ margin: 0, border: 0, padding: 0 }); l = i = false } else { this.$tip.prepend('
').css({ border: 0, padding: 0, "background-image": "none", "background-color": "transparent" }).find(".tip-bg-image").css("background-image", 'url("' + l[1] + '")').end().find("td").eq(3).append(this.$inner) } if (i && !e.support.opacity) { this.opts.fade = false } } if (m && !e.support.opacity) { if (b && c.test(m[1])) { m = false; this.$arrow.css("background-image", "none") } this.opts.fade = false } var o = this.$tip.find("table"); if (b) { this.$tip[0].style.width = ""; o.width("auto").find("td").eq(3).width("auto"); var n = this.$tip.width(), j = parseInt(this.$tip.css("min-width")), g = parseInt(this.$tip.css("max-width")); if (!isNaN(j) && n < j) { n = j } else { if (!isNaN(g) && n > g) { n = g } } this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%") } else { if (o[0]) { o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find("td").eq(3).width("100%") } } this.tipOuterW = this.$tip.outerWidth(); this.tipOuterH = this.$tip.outerHeight(); this.calcPos(); if (m && this.pos.arrow) { this.$arrow[0].className = "tip-arrow tip-arrow-" + this.pos.arrow; this.$arrow.css("visibility", "inherit") } if (h) { this.asyncAnimating = true; var p = this; this.$tip.css(k).animate({ left: this.pos.l, top: this.pos.t }, 200, function () { p.asyncAnimating = false }) } else { this.$tip.css({ left: this.pos.l, top: this.pos.t }) } }, display: function (h) { var i = this.$tip.data("active"); if (i && !h || !i && h) { return } this.$tip.stop(); if ((this.opts.slide && this.pos.arrow || this.opts.fade) && (h && this.opts.hideAniDuration || !h && this.opts.showAniDuration)) { var m = {}, l = {}; if (this.opts.slide && this.pos.arrow) { var k, g; if (this.pos.arrow == "bottom" || this.pos.arrow == "top") { k = "top"; g = "bottom" } else { k = "left"; g = "right" } var j = parseInt(this.$tip.css(k)); m[k] = j + (h ? 0 : (this.pos.arrow == g ? -this.opts.slideOffset : this.opts.slideOffset)); l[k] = j + (h ? (this.pos.arrow == g ? this.opts.slideOffset : -this.opts.slideOffset) : 0) + "px" } if (this.opts.fade) { m.opacity = h ? this.$tip.css("opacity") : 0; l.opacity = h ? 0 : this.opacity } this.$tip.css(m).animate(l, this.opts[h ? "hideAniDuration" : "showAniDuration"]) } h ? this.$tip.queue(e.proxy(this.reset, this)) : this.$tip.css("visibility", "inherit"); this.$tip.data("active", !i) }, disable: function () { this.reset(); this.disabled = true }, enable: function () { this.disabled = false }, destroy: function () { this.reset(); this.$tip.remove(); delete this.$tip; this.content = null; this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip"); a.splice(e.inArray(this, a), 1) }, clearTimeouts: function () { if (this.showTimeout) { clearTimeout(this.showTimeout); this.showTimeout = 0 } if (this.hideTimeout) { clearTimeout(this.hideTimeout); this.hideTimeout = 0 } }, calcPos: function () { var n = { l: 0, t: 0, arrow: "" }, h = e(window), k = { l: h.scrollLeft(), t: h.scrollTop(), w: h.width(), h: h.height() }, p, j, m, i, q, g; if (this.opts.alignTo == "cursor") { p = j = m = this.eventX; i = q = g = this.eventY } else { var o = this.$elm.offset(), l = { l: o.left, t: o.top, w: this.$elm.outerWidth(), h: this.$elm.outerHeight() }; p = l.l + (this.opts.alignX != "inner-right" ? 0 : l.w); j = p + Math.floor(l.w / 2); m = p + (this.opts.alignX != "inner-left" ? l.w : 0); i = l.t + (this.opts.alignY != "inner-bottom" ? 0 : l.h); q = i + Math.floor(l.h / 2); g = i + (this.opts.alignY != "inner-top" ? l.h : 0) } switch (this.opts.alignX) { case "right": case "inner-left": n.l = m + this.opts.offsetX; if (n.l + this.tipOuterW > k.l + k.w) { n.l = k.l + k.w - this.tipOuterW } if (this.opts.alignX == "right" || this.opts.alignY == "center") { n.arrow = "left" } break; case "center": n.l = j - Math.floor(this.tipOuterW / 2); if (n.l + this.tipOuterW > k.l + k.w) { n.l = k.l + k.w - this.tipOuterW } else { if (n.l < k.l) { n.l = k.l } } break; default: n.l = p - this.tipOuterW - this.opts.offsetX; if (n.l < k.l) { n.l = k.l } if (this.opts.alignX == "left" || this.opts.alignY == "center") { n.arrow = "right" } } switch (this.opts.alignY) { case "bottom": case "inner-top": n.t = g + this.opts.offsetY; if (!n.arrow || this.opts.alignTo == "cursor") { n.arrow = "top" } if (n.t + this.tipOuterH > k.t + k.h) { n.t = i - this.tipOuterH - this.opts.offsetY; if (n.arrow == "top") { n.arrow = "bottom" } } break; case "center": n.t = q - Math.floor(this.tipOuterH / 2); if (n.t + this.tipOuterH > k.t + k.h) { n.t = k.t + k.h - this.tipOuterH } else { if (n.t < k.t) { n.t = k.t } } break; default: n.t = i - this.tipOuterH - this.opts.offsetY; if (!n.arrow || this.opts.alignTo == "cursor") { n.arrow = "bottom" } if (n.t < k.t) { n.t = g + this.opts.offsetY; if (n.arrow == "bottom") { n.arrow = "top" } } } this.pos = n } }; e.fn.poshytip = function (h) { if (typeof h == "string") { var g = arguments, k = h; Array.prototype.shift.call(g); if (k == "destroy") { this.die("mouseenter.poshytip").die("focus.poshytip") } return this.each(function () { var l = e(this).data("poshytip"); if (l && l[k]) { l[k].apply(l, g) } }) } var i = e.extend({}, e.fn.poshytip.defaults, h); if (!e("#poshytip-css-" + i.className)[0]) { e(['"].join("")).appendTo("head") } if (i.liveEvents && i.showOn != "none") { var j = e.extend({}, i, { liveEvents: false }); switch (i.showOn) { case "hover": this.live("mouseenter.poshytip", function () { var l = e(this); if (!l.data("poshytip")) { l.poshytip(j).poshytip("mouseenter") } }); break; case "focus": this.live("focus.poshytip", function () { var l = e(this); if (!l.data("poshytip")) { l.poshytip(j).poshytip("show") } }); break } return this } return this.each(function () { new e.Poshytip(this, i) }) }; e.fn.poshytip.defaults = { content: "[title]", className: "tip-yellow", bgImageFrameSize: 10, showTimeout: 500, hideTimeout: 100, timeOnScreen: 0, showOn: "hover", liveEvents: false, alignTo: "cursor", alignX: "right", alignY: "top", offsetX: -22, offsetY: 18, allowTipHover: true, followCursor: false, fade: true, slide: true, slideOffset: 8, showAniDuration: 300, hideAniDuration: 300 } })(jQuery); (function (a) { a.extend(a.fn, { validate: function (b) { if (!this.length) return b && b.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"), void 0; 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 1 === arguments.length ? 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(RegExp("\\{" + a + "\\}", "g"), c) }), b) }, a.extend(a.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorTip: !0, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: !0, errorContainer: a([]), errorLabelContainer: a([]), onsubmit: !0, ignore: ":hidden", ignoreTitle: !1, onfocusin: function (a) { 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) { this.checkable(a) || !(a.name in this.submitted) && this.optional(a) || this.element(a) }, onkeyup: function (a, b) { (9 !== b.which || "" !== this.elementValue(a)) && (a.name in this.submitted || a === this.lastActive) && this.element(a) }, onclick: function (a) { a.name in this.submitted ? this.element(a) : a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (b, c, d) { "radio" === b.type ? this.findByName(b.name).addClass(c).removeClass(d) : a(b).addClass(c).removeClass(d) }, unhighlight: function (b, c, d) { "radio" === b.type ? 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: "\u4e0d\u80fd\u4e3a\u7a7a.", remote: "\u8bf7\u4fee\u6539\u8be5\u503c.", email: "\u8bf7\u8f93\u5165\u6b63\u786e\u683c\u5f0f\u7684\u7535\u5b50\u90ae\u4ef6.", url: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u7f51\u5740.", date: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u65e5\u671f.", dateISO: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u65e5\u671f(\u5e74-\u6708-\u65e5).", number: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u6570\u5b57.", digits: "\u53ea\u80fd\u8f93\u5165\u6574\u6570.", creditcard: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u4fe1\u7528\u5361\u53f7.", equalTo: "\u8bf7\u518d\u6b21\u8f93\u5165\u76f8\u540c\u7684\u503c.", maxlength: a.validator.format("\u8bf7\u8f93\u5165\u6700\u591a {0} \u4e2a\u5b57\u7b26."), minlength: a.validator.format("\u8bf7\u8f93\u5165\u6700\u5c11 {0} \u4e2a\u5b57\u7b26."), rangelength: a.validator.format("\u8bf7\u8f93\u5165\u4ecb\u4e8e {0} \u548c {1} \u4e4b\u95f4\u4e2a\u5b57\u7b26."), range: a.validator.format("\u8bf7\u8f93\u5165\u4ecb\u4e8e {0} \u548c {1} \u4e4b\u95f4\u7684\u503c."), max: a.validator.format("\u8bf7\u8f93\u5165\u6700\u5927\u4e3a {0} \u7684\u503c."), min: a.validator.format("\u8bf7\u8f93\u5165\u6700\u5c0f\u4e3a {0} \u7684\u503c."), selectreq: "\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u9879.", radioreq: "\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u9879.", phone: "\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u7535\u8bdd\u53f7\u7801 (\u56fd\u5bb6\u4ee3\u7801)\u533a\u53f7-\u53f7\u7801*\u5206\u673a.", mobile: "\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\u7801.", decimals: "\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5c0f\u6570.", zipcode: "\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u90ae\u7f16.", datetime: "\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u65e5\u671f\u65f6\u95f4(\u5e74-\u6708-\u65e5 \u65f6:\u5206)." }, 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"), this.settings.errorTip && this.elements().poshytip("disable") }, 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 0 === this.size() }, 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 && 1 === a.grep(this.errorList, function (a) { return a.element.name === b.name }).length && 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 "radio" === c || "checkbox" === c ? a('input[name="' + a(b).attr("name") + '"]:checked').val() : "string" == typeof d ? d.replace(/\r/g, "") : d }, check: function (b) { b = this.validationTargetFor(this.clean(b)); var f, c = a(b).rules(), d = !1, e = this.elementValue(b); for (var g in c) { var h = { method: g, parameters: c[g] }; try { if (f = a.validator.methods[g].call(this, e, b, h.parameters), "dependency-mismatch" === f) { d = !0; continue } if (d = !1, "pending" === f) return this.toHide = this.toHide.not(this.errorsFor(b)), void 0; 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 } } return d ? void 0 : (this.objectLength(c) && this.successList.push(b), !0) }, customMetaMessage: function (b, c) { if (a.metadata) { 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; arguments.length > a; a++) if (void 0 !== arguments[a]) return arguments[a]; return void 0 }, 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 || void 0, 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; "function" == typeof d ? 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 b, c; for (b = 0; this.errorList[b]; b++) { var d = this.errorList[b]; this.settings.highlight && this.settings.highlight.call(this, d.element, this.settings.errorClass, this.settings.validClass), this.showLabel(d.element, d.message) } if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success) for (b = 0; this.successList[b]; b++) this.showLabel(this.successList[b]); if (this.settings.unhighlight) for (b = 0, c = this.validElements() ; c[b]; b++) this.settings.unhighlight.call(this, c[b], this.settings.errorClass, this.settings.validClass), this.settings.errorTip && a(c[b]).poshytip("disable"); 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") && (this.settings.errorTip ? (d.html(" "), a(b).poshytip("update", c).poshytip("enable")) : d.html(c))) : (d = a("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(b), generated: !0 }).addClass(this.settings.errorClass), this.settings.errorTip ? (d.html(" "), a(b).poshytip({ content: c, showOn: "focus", alignTo: "target", alignY: "center", offsetX: 5 })) : d.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(""), "string" == typeof this.settings.success ? 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 }, getCnLength: function (a) { for (var c = a.length, d = 0; a.length > d; d++) a.charCodeAt(d) > 255 && c++; return c }, depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : !0 }, dependTypes: { "boolean": function (a) { 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--, 0 > this.pendingRequest && (this.pendingRequest = 0), delete this.pending[b.name], c && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (a(this.currentForm).submit(), this.formSubmitted = !1) : !c && 0 === this.pendingRequest && 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 }, selectreq: { selectreq: !0 }, radioreq: { radioreq: !0 }, phone: { phone: !0 }, mobile: { mobile: !0 }, decimals: { decimals: !0 }, zipcode: { zipcode: !0 }, datetime: { datetime: !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; "required" === e ? (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) return delete b[d], void 0; 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] = void 0 !== e.param ? 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 ("string" == typeof b) { 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] = void 0 !== d ? d : a.validator.messages[b], 3 > c.length && a.validator.addClassRules(b, a.validator.normalizeRule(b)) }, methods: { required: function (b, c, d) { if (!this.depend(d, c)) return "dependency-mismatch"; if ("select" === c.nodeName.toLowerCase()) { 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); if (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 = "string" == typeof d && { url: d } || d, 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 || "true" === d; 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.getCnLength(a.trim(b), c); return this.optional(c) || e >= d }, maxlength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getCnLength(a.trim(b), c); return this.optional(c) || d >= e }, rangelength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getCnLength(a.trim(b), c); return this.optional(c) || e >= d[0] && d[1] >= e }, min: function (a, b, c) { return this.optional(b) || a >= c }, max: function (a, b, c) { return this.optional(b) || c >= a }, range: function (a, b, c) { return this.optional(b) || a >= c[0] && c[1] >= a }, 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 0 === c % 10 }, 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() }, selectreq: function (b, c) { if ("select" === c.nodeName.toLowerCase()) { var e = a(c).val(); return e && e.length > 0 } return a.trim(b).length > 0 }, radioreq: function (b, c) { return this.checkable(c) ? this.getLength(b, c) > 0 : a.trim(b).length > 0 }, phone: function (a, b) { return this.optional(b) || /(^\(\d{1,4}\)\d+-\d+(\*\d+)?$)|((^0\d{2,3}|^8\d{2})-\d{7,8}(\*[0-9]+)?$)/.test(a) }, mobile: function (a, b) { return this.optional(b) || /^[0|1]{1,2}[3|4|5|8]\d{9}$/.test(a) }, decimals: function (a, b) { return this.optional(b) || /^(\-?)(\d+)(.{1})(\d+)$/.test(a) }, zipcode: function (a, b) { return this.optional(b) || /^[0-9]{6}$/.test(a) }, datetime: function (a, b) { return this.optional(b) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}[\ ]([0-1]\d|2[0-3]):([0-5]\d)$/.test(a) } } }), a.format = a.validator.format })(jQuery), function (a) { var b = {}; if (a.ajaxPrefilter) a.ajaxPrefilter(function (a, c, d) { var e = a.port; "abort" === a.mode && (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 "abort" === e ? (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); return e.is(b) ? d.apply(e, arguments) : void 0 }) } }) }(jQuery);