﻿(function (e) { e.tools = e.tools || {}; e.tools.expose = { version: "1.0.5", conf: { maskId: null, loadSpeed: "slow", closeSpeed: "fast", closeOnClick: true, closeOnEsc: true, zIndex: 9998, opacity: 0.8, color: "#456", api: false} }; function d() { if (e.browser.msie) { var b = e(document).height(), a = e(window).height(); return [window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, b - a < 20 ? a : b] } return [e(window).width(), e(document).height()] } function f(c, n) { var l = this, b = e(this), k = null, m = false, a = 0; e.each(n, function (g, h) { if (e.isFunction(h)) { b.bind(g, h) } }); e(window).resize(function () { l.fit() }); e.extend(this, { getMask: function () { return k }, getExposed: function () { return c }, getConf: function () { return n }, isLoaded: function () { return m }, load: function (h) { if (m) { return l } a = c.eq(0).css("zIndex"); if (n.maskId) { k = e("#" + n.maskId) } if (!k || !k.length) { var j = d(); k = e("<div/>").css({ position: "absolute", top: 0, left: 0, width: j[0], height: j[1], display: "none", opacity: 0, zIndex: n.zIndex }); if (n.maskId) { k.attr("id", n.maskId) } e("body").append(k); var i = k.css("backgroundColor"); if (!i || i == "transparent" || i == "rgba(0, 0, 0, 0)") { k.css("backgroundColor", n.color) } if (n.closeOnEsc) { e(document).bind("keydown.unexpose", function (p) { if (p.keyCode == 27) { l.close() } }) } if (n.closeOnClick) { k.bind("click.unexpose", function (p) { l.close(p) }) } } h = h || e.Event(); h.type = "onBeforeLoad"; b.trigger(h); if (h.isDefaultPrevented()) { return l } e.each(c, function () { var p = e(this); if (!/relative|absolute|fixed/i.test(p.css("position"))) { p.css("position", "relative") } }); c.css({ zIndex: Math.max(n.zIndex + 1, a == "auto" ? 0 : a) }); var g = k.height(); if (!this.isLoaded()) { k.css({ opacity: 0, display: "block" }).fadeTo(n.loadSpeed, n.opacity, function () { if (k.height() != g) { k.css("height", g) } h.type = "onLoad"; b.trigger(h) }) } m = true; return l }, close: function (g) { if (!m) { return l } g = g || e.Event(); g.type = "onBeforeClose"; b.trigger(g); if (g.isDefaultPrevented()) { return l } k.fadeOut(n.closeSpeed, function () { g.type = "onClose"; b.trigger(g); c.css({ zIndex: e.browser.msie ? a : null }) }); m = false; return l }, fit: function () { if (k) { var g = d(); k.css({ width: g[0], height: g[1] }) } }, bind: function (g, h) { b.bind(g, h); return l }, unbind: function (g) { b.unbind(g); return l } }); e.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","), function (g, h) { l[h] = function (i) { return l.bind(h, i) } }) } e.fn.expose = function (a) { var b = this.eq(typeof a == "number" ? a : 0).data("expose"); if (b) { return b } if (typeof a == "string") { a = { color: a} } var c = e.extend({}, e.tools.expose.conf); a = e.extend(c, a); this.each(function () { b = new f(e(this), a); e(this).data("expose", b) }); return a.api ? b : this } })(jQuery); (function (a) { a.extend(a.fn, { validate: function (c) { if (!this.length) { c && c.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"); return } var b = a.data(this[0], "validator"); if (b) { return b } b = new a.validator(c, this[0]); a.data(this[0], "validator", b); if (b.settings.onsubmit) { this.find("input, button").filter(".cancel").click(function () { b.cancelSubmit = true }); if (b.settings.submitHandler) { this.find("input, button").filter(":submit").click(function () { b.submitButton = this }) } this.submit(function (d) { if (b.settings.debug) { d.preventDefault() } function e() { if (b.settings.submitHandler) { if (b.submitButton) { var f = a("<input type='hidden'/>").attr("name", b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm) } b.settings.submitHandler.call(b, b.currentForm); if (b.submitButton) { f.remove() } return false } return true } if (b.cancelSubmit) { b.cancelSubmit = false; return e() } if (b.form()) { if (b.pendingRequest) { b.formSubmitted = true; return false } return e() } else { b.focusInvalid(); return false } }) } return b }, valid: function () { if (a(this[0]).is("form")) { return this.validate().form() } else { var b = true; var c = a(this[0].form).validate(); this.each(function () { b &= c.element(this) }); return b } }, removeAttrs: function (d) { var c = {}, b = this; a.each(d.split(/\s/), function (f, e) { c[e] = b.attr(e); b.removeAttr(e) }); return c }, rules: function (e, g) { var c = this[0]; if (e) { var j = a.data(c.form, "validator").settings; var h = j.rules; var f = a.validator.staticRules(c); switch (e) { case "add": a.extend(f, a.validator.normalizeRule(g)); h[c.name] = f; if (g.messages) { j.messages[c.name] = a.extend(j.messages[c.name], g.messages) } break; case "remove": if (!g) { delete h[c.name]; return f } var b = {}; a.each(g.split(/\s/), function (l, k) { b[k] = f[k]; delete f[k] }); return b } } var d = a.validator.normalizeRules(a.extend({}, a.validator.metadataRules(c), a.validator.classRules(c), a.validator.attributeRules(c), a.validator.staticRules(c)), c); if (d.required) { var i = d.required; delete d.required; d = a.extend({ required: i }, d) } return d } }); a.extend(a.expr[":"], { blank: function (b) { return !a.trim(b.value) }, filled: function (b) { return !!a.trim(b.value) }, unchecked: function (b) { return !b.checked } }); a.validator = function (c, b) { this.settings = a.extend({}, a.validator.defaults, c); this.currentForm = b; this.init() }; a.validator.format = function (c, b) { if (arguments.length == 1) { return function () { var d = a.makeArray(arguments); d.unshift(c); return a.validator.format.apply(this, d) } } if (arguments.length > 2 && b.constructor != Array) { b = a.makeArray(arguments).slice(1) } if (b.constructor != Array) { b = [b] } a.each(b, function (e, d) { c = c.replace(new RegExp("\\{" + e + "\\}", "g"), d) }); return c }; a.extend(a.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: a([]), errorLabelContainer: a([]), onsubmit: true, ignore: [], ignoreTitle: false, onfocusin: function (b) { this.lastActive = b; if (this.settings.focusCleanup && !this.blockFocusCleanup) { this.settings.unhighlight && this.settings.unhighlight.call(this, b, this.settings.errorClass, this.settings.validClass); this.errorsFor(b).hide() } }, onfocusout: function (b) { if (!this.checkable(b) && (b.name in this.submitted || !this.optional(b))) { this.element(b) } }, onkeyup: function (b) { if (b.name in this.submitted || b == this.lastElement) { this.element(b) } }, onclick: function (b) { if (b.name in this.submitted) { this.element(b) } }, highlight: function (c, d, b) { a(c).addClass(d).removeClass(b) }, unhighlight: function (c, d, b) { a(c).removeClass(d).addClass(b) } }, 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).", dateDE: "Bitte geben Sie ein gï¿½ltiges Datum ein.", number: "Please enter a valid number.", numberDE: "Bitte geben Sie eine Nummer ein.", digits: "Please enter only digits", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", 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: false, prototype: { init: function () { 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 (f, e) { a.each(e.split(/\s/), function (h, g) { b[g] = f }) }); var d = this.settings.rules; a.each(d, function (f, e) { d[f] = a.validator.normalizeRule(e) }); function c(e) { var f = a.data(this[0].form, "validator"); f.settings["on" + e.type] && f.settings["on" + e.type].call(f, this[0]) } a(this.currentForm).delegate("focusin focusout keyup", ":text, :password, :file, select, textarea", c).delegate("click", ":radio, :checkbox", c); if (this.settings.invalidHandler) { a(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler) } }, form: function () { this.checkForm(); a.extend(this.submitted, this.errorMap); this.invalid = a.extend({}, this.errorMap); if (!this.valid()) { a(this.currentForm).triggerHandler("invalid-form", [this]) } this.showErrors(); return this.valid() }, checkForm: function () { this.prepareForm(); for (var c = 0, b = (this.currentElements = this.elements()); b[c]; c++) { this.check(b[c]) } return this.valid() }, element: function (c) { c = this.clean(c); this.lastElement = c; this.prepareElement(c); this.currentElements = a(c); var b = this.check(c); if (b) { delete this.invalid[c.name] } else { this.invalid[c.name] = true } if (!this.numberOfInvalids()) { this.toHide = this.toHide.add(this.containers) } this.showErrors(); return b }, showErrors: function (c) { if (c) { a.extend(this.errorMap, c); this.errorList = []; for (var b in c) { this.errorList.push({ message: c[b], element: this.findByName(b)[0] }) } this.successList = a.grep(this.successList, function (d) { return !(d.name in c) }) } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors() }, resetForm: function () { if (a.fn.resetForm) { a(this.currentForm).resetForm() } this.submitted = {}; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (d) { var b = 0; for (var c in d) { 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() } catch (b) { } } }, findLastActive: function () { var b = this.lastActive; return b && a.grep(this.errorList, function (c) { return c.element.name == b.name }).length == 1 && b }, elements: function () { var c = this, b = {}; return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () { !this.name && c.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in b || !c.objectLength(a(this).rules())) { return false } b[this.name] = true; return true }) }, clean: function (b) { return a(b)[0] }, errors: function () { return a(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext) }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = a([]); this.toHide = a([]); this.formSubmitted = false; this.currentElements = a([]) }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers) }, prepareElement: function (b) { this.reset(); this.toHide = this.errorsFor(b) }, check: function (f) { f = this.clean(f); if (this.checkable(f)) { f = this.findByName(f.name)[0] } var d = a(f).rules(); var b = false; for (method in d) { var h = { method: method, parameters: d[method] }; try { var c = a.validator.methods[method].call(this, f.value.replace(/\r/g, ""), f, h.parameters); if (c == "dependency-mismatch") { b = true; continue } b = false; if (c == "pending") { this.toHide = this.toHide.not(this.errorsFor(f)); return } if (!c) { this.formatAndAdd(f, h); return false } } catch (g) { this.settings.debug && window.console && console.log("exception occured when checking element " + f.id + ", check the '" + h.method + "' method"); throw g } } if (b) { return } if (this.objectLength(d)) { this.successList.push(f) } return true }, customMetaMessage: function (d, b) { if (!a.metadata) { return } var c = this.settings.meta ? a(d).metadata()[this.settings.meta] : a(d).metadata(); return c && c.messages && c.messages[b] }, customMessage: function (c, d) { var b = this.settings.messages[c]; return b && (b.constructor == String ? b : b[d]) }, findDefined: function () { for (var b = 0; b < arguments.length; b++) { if (arguments[b] !== undefined) { return arguments[b] } } return undefined }, defaultMessage: function (c, b) { return this.findDefined(this.customMessage(c.name, b), this.customMetaMessage(c, b), !this.settings.ignoreTitle && c.title || undefined, a.validator.messages[b], "<strong>Warning: No message defined for " + c.name + "</strong>") }, formatAndAdd: function (c, d) { var b = this.defaultMessage(c, d.method); if (typeof b == "function") { b = b.call(this, d.parameters, c) } this.errorList.push({ message: b, element: c }); this.errorMap[c.name] = b; this.submitted[c.name] = b }, addWrapper: function (b) { if (this.settings.wrapper) { b = b.add(b.parent(this.settings.wrapper)) } return b }, defaultShowErrors: function () { for (var c = 0; this.errorList[c]; c++) { var d = this.errorList[c]; 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) } if (this.settings.success) { for (var c = 0; this.successList[c]; c++) { this.showLabel(this.successList[c]) } } if (this.settings.unhighlight) { for (var c = 0, b = this.validElements(); b[c]; c++) { this.settings.unhighlight.call(this, b[c], 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 (d, c) { var b = this.errorsFor(d); if (b.length) { b.removeClass().addClass(this.settings.errorClass); b.attr("generated") && b.html(c) } else { b = a("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(d), generated: true }).addClass(this.settings.errorClass).html(c || ""); if (this.settings.wrapper) { b = b.hide().show().wrap("<" + this.settings.wrapper + "/>").parent() } if (!this.labelContainer.append(b).length) { this.settings.errorPlacement ? this.settings.errorPlacement(b, a(d)) : b.insertAfter(d) } } if (!c && this.settings.success) { b.text(""); typeof this.settings.success == "string" ? b.addClass(this.settings.success) : this.settings.success(b) } this.toShow = this.toShow.add(b) }, errorsFor: function (b) { return this.errors().filter("[for='" + this.idOrName(b) + "']") }, idOrName: function (b) { return this.groups[b.name] || (this.checkable(b) ? b.name : b.id || b.name) }, checkable: function (b) { return /radio|checkbox/i.test(b.type) }, findByName: function (b) { var c = this.currentForm; return a(document.getElementsByName(b)).map(function (e, d) { return d.form == c && d.name == b && d || null }) }, 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 (b, c) { return this.dependTypes[typeof b] ? this.dependTypes[typeof b](b, c) : true }, dependTypes: { "boolean": function (b, c) { return b }, string: function (b, c) { return !!a(b, c.form).length }, "function": function (b, c) { return b(c) } }, optional: function (b) { return !a.validator.methods.required.call(this, a.trim(b.value), b) && "dependency-mismatch" }, startRequest: function (b) { if (!this.pending[b.name]) { this.pendingRequest++; this.pending[b.name] = true } }, stopRequest: function (c, b) { this.pendingRequest--; if (this.pendingRequest < 0) { this.pendingRequest = 0 } delete this.pending[c.name]; if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) { a(this.currentForm).submit() } else { if (!b && this.pendingRequest == 0 && this.formSubmitted) { a(this.currentForm).triggerHandler("invalid-form", [this]) } } }, previousValue: function (b) { return a.data(b, "previousValue") || a.data(b, "previousValue", previous = { old: null, valid: true, message: this.defaultMessage(b, "remote") }) } }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, dateDE: { dateDE: true }, number: { number: true }, numberDE: { numberDE: true }, digits: { digits: true }, creditcard: { creditcard: true} }, addClassRules: function (c, b) { c.constructor == String ? this.classRuleSettings[c] = b : a.extend(this.classRuleSettings, c) }, classRules: function (d) { var c = {}; var b = a(d).attr("class"); b && a.each(b.split(" "), function () { if (this in a.validator.classRuleSettings) { a.extend(c, a.validator.classRuleSettings[this]) } }); return c }, attributeRules: function (e) { var d = {}; var c = a(e); for (method in a.validator.methods) { var b = c.attr(method); if (b) { d[method] = b } } if (d.maxlength && /-1|2147483647|524288/.test(d.maxlength)) { delete d.maxlength } return d }, metadataRules: function (c) { if (!a.metadata) { return {} } var b = a.data(c.form, "validator").settings.meta; return b ? a(c).metadata()[b] : a(c).metadata() }, staticRules: function (d) { var b = {}; var c = a.data(d.form, "validator"); if (c.settings.rules) { b = a.validator.normalizeRule(c.settings.rules[d.name]) || {} } return b }, normalizeRules: function (b, c) { a.each(b, function (f, e) { if (e === false) { delete b[f]; return } if (e.param || e.depends) { var d = true; switch (typeof e.depends) { case "string": d = !!a(e.depends, c.form).length; break; case "function": d = e.depends.call(c, c); break } if (d) { b[f] = e.param !== undefined ? e.param : true } else { delete b[f] } } }); a.each(b, function (e, d) { b[e] = a.isFunction(d) ? d(c) : d }); a.each(["minlength", "maxlength", "min", "max"], function () { if (b[this]) { b[this] = Number(b[this]) } }); a.each(["rangelength", "range"], function () { if (b[this]) { b[this] = [Number(b[this][0]), Number(b[this][1])] } }); if (a.validator.autoCreateRanges) { if (b.min && b.max) { b.range = [b.min, b.max]; delete b.min; delete b.max } if (b.minlength && b.maxlength) { b.rangelength = [b.minlength, b.maxlength]; delete b.minlength; delete b.maxlength } } if (b.messages) { delete b.messages } return b }, normalizeRule: function (c) { if (typeof c == "string") { var b = {}; a.each(c.split(/\s/), function () { b[this] = true }); c = b } return c }, addMethod: function (b, c, d) { a.validator.methods[b] = c; a.validator.messages[b] = d || a.validator.messages[b]; if (c.length < 3) { a.validator.addClassRules(b, a.validator.normalizeRule(b)) } }, methods: { required: function (b, d, c) { if (!this.depend(c, d)) { return "dependency-mismatch" } switch (d.nodeName.toLowerCase()) { case "select": var e = a("option:selected", d); return e.length > 0 && (d.type == "select-multiple" || (a.browser.msie && !(e[0].attributes.value.specified) ? e[0].text : e[0].value).length > 0); case "input": if (this.checkable(d)) { return this.getLength(b, d) > 0 } default: return a.trim(b).length > 0 } }, remote: function (b, f, c) { if (this.optional(f)) { return "dependency-mismatch" } var d = this.previousValue(f); if (!this.settings.messages[f.name]) { this.settings.messages[f.name] = {} } this.settings.messages[f.name].remote = typeof d.message == "function" ? d.message(b) : d.message; c = typeof c == "string" && { url: c} || c; if (d.old !== b) { d.old = b; var e = this; this.startRequest(f); var g = {}; g[f.name] = b; a.ajax(a.extend(true, { url: c, mode: "abort", port: "validate" + f.name, dataType: "json", data: g, success: function (h) { var j = h === true; if (j) { var i = e.formSubmitted; e.prepareElement(f); e.formSubmitted = i; e.successList.push(f); e.showErrors() } else { var k = {}; k[f.name] = d.message = h || e.defaultMessage(f, "remote"); e.showErrors(k) } d.valid = j; e.stopRequest(f, j) } }, c)); return "pending" } else { if (this.pending[f.name]) { return "pending" } } return d.valid }, minlength: function (b, d, c) { return this.optional(d) || this.getLength(a.trim(b), d) >= c }, maxlength: function (b, d, c) { return this.optional(d) || this.getLength(a.trim(b), d) <= c }, rangelength: function (b, d, c) { var e = this.getLength(a.trim(b), d); return this.optional(d) || (e >= c[0] && e <= c[1]) }, min: function (b, d, c) { return this.optional(d) || b >= c }, max: function (b, d, c) { return this.optional(d) || b <= c }, range: function (b, d, c) { return this.optional(d) || (b >= c[0] && b <= c[1]) }, email: function (b, c) { return this.optional(c) || /^((([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(b) }, url: function (b, c) { return this.optional(c) || /^(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(b) }, date: function (b, c) { return this.optional(c) || !/Invalid|NaN/.test(new Date(b)) }, dateISO: function (b, c) { return this.optional(c) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(b) }, dateDE: function (b, c) { return this.optional(c) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(b) }, number: function (b, c) { return this.optional(c) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(b) }, numberDE: function (b, c) { return this.optional(c) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(b) }, digits: function (b, c) { return this.optional(c) || /^\d+$/.test(b) }, creditcard: function (b, d) { if (this.optional(d)) { return "dependency-mismatch" } if (/[^0-9-]+/.test(b)) { return false } var e = 0, c = 0, g = false; b = b.replace(/\D/g, ""); for (n = b.length - 1; n >= 0; n--) { var f = b.charAt(n); var c = parseInt(f, 10); if (g) { if ((c *= 2) > 9) { c -= 9 } } e += c; g = !g } return (e % 10) == 0 }, accept: function (b, d, c) { c = typeof c == "string" ? c.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(d) || b.match(new RegExp(".(" + c + ")$", "i")) }, equalTo: function (b, d, c) { return b == a(c).val() } } }); a.format = a.validator.format })(jQuery); (function (b) { var c = b.ajax; var a = {}; b.ajax = function (e) { e = b.extend(e, b.extend({}, b.ajaxSettings, e)); var d = e.port; if (e.mode == "abort") { if (a[d]) { a[d].abort() } return (a[d] = c.apply(this, arguments)) } return c.apply(this, arguments) } })(jQuery); (function (a) { a.each({ focus: "focusin", blur: "focusout" }, function (b, c) { a.event.special[c] = { setup: function () { if (a.browser.msie) { return false } this.addEventListener(b, a.event.special[c].handler, true) }, teardown: function () { if (a.browser.msie) { return false } this.removeEventListener(b, a.event.special[c].handler, true) }, handler: function (d) { arguments[0] = a.event.fix(d); arguments[0].type = c; return a.event.handle.apply(this, arguments) } } }); a.extend(a.fn, { delegate: function (c, b, d) { return this.bind(c, function (e) { var f = a(e.target); if (f.is(b)) { return d.apply(f, arguments) } }) }, triggerEvent: function (b, c) { return this.triggerHandler(b, [a.event.fix({ type: b, target: c })]) } }) })(jQuery); var xVal = xVal || {}; xVal.Plugins = xVal.Plugins || {}; xVal.Messages = xVal.Messages || {}; xVal.AttachValidator = function (a, c, e, d) { if (d != null) { this.Plugins[d].AttachValidator(a, c, e) } else { for (var b in this.Plugins) { this.Plugins[b].AttachValidator(a, c, e); return } } }; (function ($) { xVal.Plugins["jquery.validate"] = { AttachValidator: function (elementPrefix, rulesConfig, options) { var self = this; self._ensureCustomFunctionsRegistered(); $(function () { self._ensureValidationSummaryContainerExistsIfRequired(options); for (var i = 0; i < rulesConfig.Fields.length; i++) { var fieldName = rulesConfig.Fields[i].FieldName; var fieldRules = rulesConfig.Fields[i].FieldRules; var elemId = self._makeAspNetMvcHtmlHelperID((elementPrefix ? elementPrefix + "." : "") + fieldName); var elem = document.getElementById(elemId); if (elem) { for (var j = 0; j < fieldRules.length; j++) { var rule = fieldRules[j]; if (rule != null) { var ruleName = rule.RuleName; var ruleParams = rule.RuleParameters; var errorText = (typeof (rule.Message) == "undefined" ? null : rule.Message); self._attachRuleToDOMElement(ruleName, ruleParams, errorText, $(elem), elementPrefix, options) } } } } }) }, _makeAspNetMvcHtmlHelperID: function (fullyQualifiedModelName) { return fullyQualifiedModelName.replace(/\./g, "_") }, _attachRuleToDOMElement: function (ruleName, ruleParams, errorText, element, elementPrefix, options) { var parentForm = element.parents("form"); if (parentForm.length != 1) { alert("Error: Element " + element.attr("id") + " is not in a form") } this._ensureFormIsMarkedForValidation($(parentForm[0]), options); this._associateNearbyValidationMessageSpanWithElement(element); var options = {}; switch (ruleName) { case "Required": options.required = true; options.messages = { required: errorText || xVal.Messages.Required }; break; case "Range": if (ruleParams.Type == "string") { options.xVal_stringRange = [ruleParams.Min, ruleParams.Max]; if (errorText != null) { options.messages = { xVal_stringRange: $.format(errorText)} } } else { if (ruleParams.Type == "datetime") { var minDate, maxDate; if (typeof (ruleParams.MinYear) != "undefined") { minDate = new Date(ruleParams.MinYear, ruleParams.MinMonth - 1, ruleParams.MinDay, ruleParams.MinHour, ruleParams.MinMinute, ruleParams.MinSecond) } if (typeof (ruleParams.MaxYear) != "undefined") { maxDate = new Date(ruleParams.MaxYear, ruleParams.MaxMonth - 1, ruleParams.MaxDay, ruleParams.MaxHour, ruleParams.MaxMinute, ruleParams.MaxSecond) } options.xVal_dateRange = [minDate, maxDate]; if (errorText != null) { options.messages = { xVal_dateRange: $.format(errorText)} } } else { if (typeof (ruleParams.Min) == "undefined") { options.max = ruleParams.Max; errorText = errorText || xVal.Messages.Range_Numeric_Max; if (errorText != null) { options.messages = { max: $.format(errorText)} } } else { if (typeof (ruleParams.Max) == "undefined") { options.min = ruleParams.Min; errorText = errorText || xVal.Messages.Range_Numeric_Min; if (errorText != null) { options.messages = { min: $.format(errorText)} } } else { options.range = [ruleParams.Min, ruleParams.Max]; errorText = errorText || xVal.Messages.Range_Numeric_MinMax; if (errorText != null) { options.messages = { range: $.format(errorText)} } } } } } break; case "StringLength": if (typeof (ruleParams.MinLength) == "undefined") { options.maxlength = ruleParams.MaxLength; errorText = errorText || xVal.Messages.StringLength_Max; if (errorText != null) { options.messages = { maxlength: $.format(errorText)} } } else { if (typeof (ruleParams.MaxLength) == "undefined") { options.minlength = ruleParams.MinLength; errorText = errorText || xVal.Messages.StringLength_Min; if (errorText != null) { options.messages = { minlength: $.format(errorText)} } } else { options.rangelength = [ruleParams.MinLength, ruleParams.MaxLength]; errorText = errorText || xVal.Messages.StringLength_MinMax; if (errorText != null) { options.messages = { rangelength: $.format(errorText)} } } } break; case "DataType": switch (ruleParams.Type) { case "EmailAddress": options.email = true; options.messages = { email: errorText || xVal.Messages.DataType_EmailAddress }; break; case "Integer": options.xVal_regex = ["^\\-?\\d+$", ""]; options.messages = { xVal_regex: errorText || xVal.Messages.DataType_Integer || "Please enter a whole number." }; break; case "Decimal": options.number = true; options.messages = { number: errorText || xVal.Messages.DataType_Decimal }; break; case "Date": options.date = true; options.messages = { date: errorText || xVal.Messages.DataType_Date }; break; case "DateTime": options.xVal_regex = ["^\\d{1,2}/\\d{1,2}/(\\d{2}|\\d{4})\\s+\\d{1,2}\\:\\d{2}(\\:\\d{2})?$", ""]; options.messages = { xVal_regex: errorText || xVal.Messages.DataType_DateTime || "Please enter a valid date and time." }; break; case "Currency": options.xVal_regex = ["^\\D?\\s?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$", ""]; options.messages = { xVal_regex: errorText || xVal.Messages.DataType_Currency || "Please enter a currency value." }; break; case "CreditCardLuhn": options.xVal_creditCardLuhn = true; if (errorText != null) { options.messages = { xVal_creditCardLuhn: errorText} } break } break; case "RegEx": options.xVal_regex = [ruleParams.Pattern, ruleParams.Options]; if (errorText != null) { options.messages = { xVal_regex: errorText} } break; case "Comparison": var elemToCompareId = this._makeAspNetMvcHtmlHelperID((elementPrefix ? elementPrefix + "." : "") + ruleParams.PropertyToCompare); var elemToCompare = document.getElementById(elemToCompareId); if (elemToCompare != null) { options.xVal_comparison = [ruleParams.PropertyToCompare, elemToCompare, ruleParams.ComparisonOperator]; if (errorText != null) { options.messages = { xVal_comparison: errorText} } } break; case "Remote": var dataAccessor = {}; parentForm.find("input[name], textarea[name], select[name]").each(function () { var input = this; dataAccessor[input.name] = function () { return $(input).val() } }); options.remote = { url: ruleParams.url, data: dataAccessor, type: "post" }; break; case "Custom": var ruleFunction = this._parseAsFunctionWithWarnings(ruleParams.Function); if (ruleFunction != null) { var customFunctionName = this._registerCustomValidationFunction(ruleFunction); var evaluatedParams = ruleParams.Parameters == "null" ? null : eval("(" + ruleParams.Parameters + ")"); options[customFunctionName] = evaluatedParams || true; options.messages = []; options.messages[customFunctionName] = errorText } break } element.rules("add", options) }, _parseAsFunctionWithWarnings: function (functionString) { var result; try { result = eval("(" + functionString + ")") } catch (ex) { alert("Custom rule error: Could not find or could not parse the function '" + functionString + "'"); return null } if (typeof (result) != "function") { alert("Custom rule error: The JavaScript object '" + functionString + "' is not a function."); return null } return result }, _associateNearbyValidationMessageSpanWithElement: function (element) { var nearbyMessages = element.nextAll("span.field-validation-error"); if (nearbyMessages.length > 0) { $(nearbyMessages[0]).attr("generated", "true").attr("htmlfor", element.attr("id")) } }, _ensureFormIsMarkedForValidation: function (formElement, options) { if (!formElement.data("isMarkedForValidation")) { formElement.data("isMarkedForValidation", true); var validationOptions = { errorClass: "field-validation-error", errorElement: "span", highlight: function (element) { $(element).addClass("input-validation-error") }, unhighlight: function (element) { $(element).removeClass("input-validation-error") } }; if (options.ValidationSummary) { validationOptions.wrapper = "li"; validationOptions.errorLabelContainer = "#" + options.ValidationSummary.ElementID + " ul:first" } var validator = formElement.validate(validationOptions); if (options.ValidationSummary) { this._modifyJQueryValidationElementHidingBehaviourToSupportValidationSummary(validator, options) } } }, _registerCustomValidationFunction: function (evalFn) { jQuery.validator.xValCustomFunctionCount = (jQuery.validator.xValCustomFunctionCount || 0) + 1; var functionName = "xVal_customFunction_" + jQuery.validator.xValCustomFunctionCount; jQuery.validator.addMethod(functionName, function (value, element, params) { if (this.optional(element)) { return true } return evalFn(value, element, params) }); return functionName }, _ensureCustomFunctionsRegistered: function () { if (!jQuery.validator.xValFunctionsRegistered) { jQuery.validator.xValFunctionsRegistered = true; jQuery.validator.addMethod("xVal_stringRange", function (value, element, params) { if (this.optional(element)) { return true } if (params[0] != null) { if (value < params[0]) { return false } } if (params[1] != null) { if (value > params[1]) { return false } } return true }, function (params) { if ((params[0] != null) && (params[1] != null)) { return $.format(xVal.Messages.Range_String_MinMax || "Please enter a value alphabetically between '{0}' and '{1}'.", params[0], params[1]) } else { if (params[0] != null) { return $.format(xVal.Messages.Range_String_Min || "Please enter a value not alphabetically before '{0}'.", params[0]) } else { return $.format(xVal.Messages.Range_String_Max || "Please enter a value not alphabetically after '{0}'.", params[1]) } } }); jQuery.validator.addMethod("xVal_dateRange", function (value, element, params) { if (this.optional(element)) { return true } var parsedValue = Date.parse(value); if (isNaN(parsedValue)) { return false } else { parsedValue = new Date(parsedValue) } if (params[0] != null) { if (parsedValue < params[0]) { return false } } if (params[1] != null) { if (parsedValue > params[1]) { return false } } return true }, function (params, elem) { if (isNaN(Date.parse(elem.value))) { return xVal.Messages.DataType_Date || "Please enter a valid date in yyyy/mm/dd format." } var formatDate = function (date) { var result = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(); if (date.getHours() + date.getMinutes() + date.getSeconds() != 0) { result += " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() } return result.replace(/\b(\d)\b/g, "0$1") }; if ((params[0] != null) && (params[1] != null)) { return $.format(xVal.Messages.Range_DateTime_MinMax || "Please enter a date between {0} and {1}.", formatDate(params[0]), formatDate(params[1])) } else { if (params[0] != null) { return $.format(xVal.Messages.Range_DateTime_Min || "Please enter a date no earlier than {0}.", formatDate(params[0])) } else { return $.format(xVal.Messages.Range_DateTime_Max || "Please enter a date no later than {0}.", formatDate(params[1])) } } }); jQuery.validator.addMethod("xVal_regex", function (value, element, params) { if (this.optional(element)) { return true } var pattern = params[0]; var options = params[1]; var regex = new RegExp(pattern, options); return regex.test(value) }, function (params) { return xVal.Messages.Regex || "This value is invalid." }); jQuery.validator.addMethod("xVal_creditCardLuhn", function (value, element, params) { if (this.optional(element)) { return true } value = value.replace(/\D/g, ""); if (value == "") { return false } var sum = 0; for (var i = value.length - 2; i >= 0; i -= 2) { sum += Array(0, 2, 4, 6, 8, 1, 3, 5, 7, 9)[parseInt(value.charAt(i), 10)] } for (var i = value.length - 1; i >= 0; i -= 2) { sum += parseInt(value.charAt(i), 10) } return (sum % 10) == 0 }, function (params) { return xVal.Messages.DataType_CreditCardLuhn || "Please enter a valid credit card number." }); jQuery.validator.addMethod("xVal_comparison", function (value, element, params) { if (this.optional(element)) { return true } var elemToCompare = params[1]; var comparisonOperator = params[2]; switch (comparisonOperator) { case "Equals": return value == elemToCompare.value; case "DoesNotEqual": return value != elemToCompare.value } return true }, function (params) { var propertyToCompareName = params[0]; var comparisonOperator = params[2]; switch (comparisonOperator) { case "Equals": return $.format(xVal.Messages.Comparison_Equals || "This value must be the same as {0}.", propertyToCompareName); case "DoesNotEqual": return $.format(xVal.Messages.Comparison_DoesNotEqual || "This value must be different from {0}.", propertyToCompareName) } }); $.expr[":"].displayableValidationSummaryMessage = function (object) { var span = $(object).find("span:first"); if (span.length == 0) { return true } return !(span.css("display") === "none") && !span.is(":empty") } } }, _ensureValidationSummaryContainerExistsIfRequired: function (options) { if (options.ValidationSummary) { var validationSummaryContainer = $("#" + options.ValidationSummary.ElementID); if (validationSummaryContainer.length == 0) { alert('Cannot find validation summary element "' + options.ValidationSummary.ElementID + "\". Make sure you've put an element with this ID into your HTML document.") } if (!validationSummaryContainer.is(":has(ul)")) { validationSummaryContainer.append($("<span class='validation-summary-errors' />").text(options.ValidationSummary.HeaderMessage)).append($("<ul />")).hide() } } }, _modifyJQueryValidationElementHidingBehaviourToSupportValidationSummary: function (validator, options) { var originalHideErrorsMethod = validator.hideErrors; var originalShowErrorsMethod = validator.showErrors; validator.hideErrors = function () { this.toHide = this.toHide.not("ul"); originalHideErrorsMethod.apply(this, arguments); $("#" + options.ValidationSummary.ElementID + ":not(:has(li:displayableValidationSummaryMessage))").hide() }; validator.showErrors = function () { originalShowErrorsMethod.apply(this, arguments); $("#" + options.ValidationSummary.ElementID + ":has(li:displayableValidationSummaryMessage)").show() } } } })(jQuery); var jaaulde = window.jaaulde || {}; jaaulde.utils = jaaulde.utils || {}; jaaulde.utils.cookies = (function () { var d, a, c, b, e = { expiresAt: null, path: "/", domain: null, secure: false }; d = function (h) { var f, g; if (typeof h !== "object" || h === null) { f = e } else { f = { expiresAt: e.expiresAt, path: e.path, domain: e.domain, secure: e.secure }; if (typeof h.expiresAt === "object" && h.expiresAt instanceof Date) { f.expiresAt = h.expiresAt } else { if (typeof h.hoursToLive === "number" && h.hoursToLive !== 0) { g = new Date(); g.setTime(g.getTime() + (h.hoursToLive * 60 * 60 * 1000)); f.expiresAt = g } } if (typeof h.path === "string" && h.path !== "") { f.path = h.path } if (typeof h.domain === "string" && h.domain !== "") { f.domain = h.domain } if (h.secure === true) { f.secure = h.secure } } return f }; a = function (f) { f = d(f); return ((typeof f.expiresAt === "object" && f.expiresAt instanceof Date ? "; expires=" + f.expiresAt.toGMTString() : "") + "; path=" + f.path + (typeof f.domain === "string" ? "; domain=" + f.domain : "") + (f.secure === true ? "; secure" : "")) }; c = function () { var n = {}, f, g, k, j, l = document.cookie.split(";"), o; for (f = 0; f < l.length; f = f + 1) { g = l[f].split("="); k = g[0].replace(/^\s*/, "").replace(/\s*$/, ""); try { j = decodeURIComponent(g[1]) } catch (h) { j = g[1] } if (typeof JSON === "object" && JSON !== null && typeof JSON.parse === "function") { try { o = j; j = JSON.parse(j) } catch (m) { j = o } } n[k] = j } return n }; b = function () { }; b.prototype.get = function (f) { var g, i, h = c(); if (typeof f === "string") { g = (typeof h[f] !== "undefined") ? h[f] : null } else { if (typeof f === "object" && f !== null) { g = {}; for (i in f) { if (typeof h[f[i]] !== "undefined") { g[f[i]] = h[f[i]] } else { g[f[i]] = null } } } else { g = h } } return g }; b.prototype.filter = function (i) { var g, h = {}, f = c(); if (typeof i === "string") { i = new RegExp(i) } for (g in f) { if (g.match(i)) { h[g] = f[g] } } return h }; b.prototype.set = function (g, i, h) { if (typeof h !== "object" || h === null) { h = {} } if (typeof i === "undefined" || i === null) { i = ""; h.hoursToLive = -8760 } else { if (typeof i !== "string") { if (typeof JSON === "object" && JSON !== null && typeof JSON.stringify === "function") { i = JSON.stringify(i) } else { throw new Error("cookies.set() received non-string value and could not serialize.") } } } var f = a(h); document.cookie = g + "=" + encodeURIComponent(i) + f }; b.prototype.del = function (f, i) { var h = {}, g; if (typeof i !== "object" || i === null) { i = {} } if (typeof f === "boolean" && f === true) { h = this.get() } else { if (typeof f === "string") { h[f] = true } } for (g in h) { if (typeof g === "string" && g !== "") { this.set(g, null, i) } } }; b.prototype.test = function () { var f = false, g = "cT", h = "data"; this.set(g, h); if (this.get(g) === h) { this.del(g); f = true } return f }; b.prototype.setOptions = function (f) { if (typeof f !== "object") { f = null } e = d(f) }; return new b() })(); (function () { if (window.jQuery) { (function (b) { b.cookies = jaaulde.utils.cookies; var a = { cookify: function (c) { return this.each(function () { var e, f = ["name", "id"], d, g = b(this), h; for (e in f) { if (!isNaN(e)) { d = g.attr(f[e]); if (typeof d === "string" && d !== "") { if (g.is(":checkbox, :radio")) { if (g.attr("checked")) { h = g.val() } } else { if (g.is(":input")) { h = g.val() } else { h = g.html() } } if (typeof h !== "string" || h === "") { h = null } b.cookies.set(d, h, c); break } } } }) }, cookieFill: function () { return this.each(function () { var c, h, f = ["name", "id"], e, g = b(this), d; h = function () { c = f.pop(); return !!c }; while (h()) { e = g.attr(c); if (typeof e === "string" && e !== "") { d = b.cookies.get(e); if (d !== null) { if (g.is(":checkbox, :radio")) { if (g.val() === d) { g.attr("checked", "checked") } else { g.removeAttr("checked") } } else { if (g.is(":input")) { g.val(d) } else { g.html(d) } } } break } } }) }, cookieBind: function (c) { return this.each(function () { var d = b(this); d.cookieFill().change(function () { d.cookify(c) }) }) } }; b.each(a, function (c) { b.fn[c] = this }) })(window.jQuery) } })();
//(function (a) { a.jScrollPane = { active: [] }; a.fn.jScrollPane = function (b) { b = a.extend({}, a.fn.jScrollPane.defaults, b); var c = function () { return false }; return this.each(function () { var S = a(this); S.css("overflow", "hidden"); var q = this; if (a(this).parent().is(".jScrollPaneContainer")) { var G = b.maintainPosition ? S.position().top : 0; var x = a(this).parent(); var A = x.innerWidth(); var i = x.outerHeight(); var s = i; a(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown", x).remove(); S.css({ top: 0 }) } else { var G = 0; this.originalPadding = S.css("paddingTop") + " " + S.css("paddingRight") + " " + S.css("paddingBottom") + " " + S.css("paddingLeft"); this.originalSidePaddingTotal = (parseInt(S.css("paddingLeft")) || 0) + (parseInt(S.css("paddingRight")) || 0); var A = S.innerWidth(); var i = S.innerHeight(); var s = i; S.wrap(a("<div></div>").attr({ className: "jScrollPaneContainer" }).css({ height: i + "px", width: A + "px" }).addClass(b.scrollClass)); a(document).bind("emchange", function (ae, af, p) { S.jScrollPane(b) }) } if (b.reinitialiseOnImageLoad) { var Z = a.data(q, "jScrollPaneImagesToLoad") || a("img", S); var ab = []; if (Z.length) { Z.each(function (p, ae) { a(this).bind("load", function () { if (a.inArray(p, ab) == -1) { ab.push(ae); Z = a.grep(Z, function (af, ag) { return af != ae }); a.data(q, "jScrollPaneImagesToLoad", Z); b.reinitialiseOnImageLoad = false; S.jScrollPane(b) } }).each(function (af, ag) { if (this.complete || this.complete === undefined) { this.src = this.src } }) }) } } var w = this.originalSidePaddingTotal; var M = { height: "auto", width: A - b.scrollbarWidth - b.scrollbarMargin - w + "px" }; if (b.scrollbarOnLeft) { M.paddingLeft = b.scrollbarMargin + b.scrollbarWidth + "px" } else { M.paddingRight = b.scrollbarMargin + "px" } S.css(M); var l = S.outerHeight(); var g = i / l; if (g < 0.99) { var Q = S.parent(); Q.append(a("<div></div>").attr({ className: "jScrollPaneTrack" }).css({ width: b.scrollbarWidth + "px" }).append(a("<div></div>").attr({ className: "jScrollPaneDrag" }).css({ width: b.scrollbarWidth + "px" }).append(a("<div></div>").attr({ className: "jScrollPaneDragTop" }).css({ width: b.scrollbarWidth + "px" }), a("<div></div>").attr({ className: "jScrollPaneDragBottom" }).css({ width: b.scrollbarWidth + "px" })))); var o = a(">.jScrollPaneTrack", Q); var X = a(">.jScrollPaneTrack .jScrollPaneDrag", Q); if (b.showArrows) { var R; var F; var Y; var e; var m = function () { if (e > 4 || e % 4 == 0) { ac(v + F * T) } e++ }; var f = function (p) { a("html").unbind("mouseup", f); R.removeClass("jScrollActiveArrowButton"); clearInterval(Y) }; var E = function () { a("html").bind("mouseup", f); R.addClass("jScrollActiveArrowButton"); e = 0; m(); Y = setInterval(m, 100) }; Q.append(a("<a></a>").attr({ href: "javascript:;", className: "jScrollArrowUp" }).css({ width: b.scrollbarWidth + "px" }).html("Scroll up").bind("mousedown", function () { R = a(this); F = -1; E(); this.blur(); return false }).bind("click", c), a("<a></a>").attr({ href: "javascript:;", className: "jScrollArrowDown" }).css({ width: b.scrollbarWidth + "px" }).html("Scroll down").bind("mousedown", function () { R = a(this); F = 1; E(); this.blur(); return false }).bind("click", c)); var K = a(">.jScrollArrowUp", Q); var r = a(">.jScrollArrowDown", Q); if (b.arrowSize) { s = i - b.arrowSize - b.arrowSize; o.css({ height: s + "px", top: b.arrowSize + "px" }) } else { var O = K.height(); b.arrowSize = O; s = i - O - r.height(); o.css({ height: s + "px", top: O + "px" }) } } var N = a(this).css({ position: "absolute", overflow: "visible" }); var t; var n; var T; var v = 0; var y = g * i / 2; var u = function (ae, af) { var ag = af == "X" ? "Left" : "Top"; return ae["page" + af] || (ae["client" + af] + (document.documentElement["scroll" + ag] || document.body["scroll" + ag])) || 0 }; var ad = function () { return false }; var C = function () { d(); t = X.offset(false); t.top -= v; n = s - X[0].offsetHeight; T = 2 * b.wheelSpeed * n / l }; var I = function (p) { C(); y = u(p, "Y") - v - t.top; a("html").bind("mouseup", J).bind("mousemove", h); if (a.browser.msie) { a("html").bind("dragstart", ad).bind("selectstart", ad) } return false }; var J = function () { a("html").unbind("mouseup", J).unbind("mousemove", h); y = g * i / 2; if (a.browser.msie) { a("html").unbind("dragstart", ad).unbind("selectstart", ad) } }; var ac = function (ae) { ae = ae < 0 ? 0 : (ae > n ? n : ae); v = ae; X.css({ top: ae + "px" }); var af = ae / n; N.css({ top: ((i - l) * af) + "px" }); S.trigger("scroll"); if (b.showArrows) { K[ae == 0 ? "addClass" : "removeClass"]("disabled"); r[ae == n ? "addClass" : "removeClass"]("disabled") } }; var h = function (p) { ac(u(p, "Y") - t.top - y) }; var j = Math.max(Math.min(g * (i - b.arrowSize * 2), b.dragMaxHeight), b.dragMinHeight); X.css({ height: j + "px" }).bind("mousedown", I); var aa; var z; var P; var B = function () { if (z > 8 || z % 4 == 0) { ac((v - ((v - P) / 2))) } z++ }; var D = function () { clearInterval(aa); a("html").unbind("mouseup", D).unbind("mousemove", L) }; var L = function (p) { P = u(p, "Y") - t.top - y }; var V = function (p) { C(); L(p); z = 0; a("html").bind("mouseup", D).bind("mousemove", L); aa = setInterval(B, 100); B() }; o.bind("mousedown", V); Q.bind("mousewheel", function (af, ag) { C(); d(); var ae = v; ac(v - ag * T); var p = ae != v; return !p }); var H; var W; function k() { var p = (H - v) / b.animateStep; if (p > 1 || p < -1) { ac(v + p) } else { ac(H); d() } } var d = function () { if (W) { clearInterval(W); delete H } }; var U = function (ae, af) { if (typeof ae == "string") { $e = a(ae, S); if (!$e.length) { return } ae = $e.offset().top - S.offset().top } Q.scrollTop(0); d(); var p = -ae / (i - l) * n; if (af || !b.animateTo) { ac(p) } else { H = p; W = setInterval(k, b.animateInterval) } }; S[0].scrollTo = U; S[0].scrollBy = function (p) { var ae = -parseInt(N.css("top")) || 0; U(ae + p) }; C(); U(-G, true); a("*", this).bind("focus", function (ag) { var af = a(this); var ah = 0; while (af[0] != S[0]) { ah += af.position().top; af = af.offsetParent() } var ae = -parseInt(N.css("top")) || 0; var aj = ae + i; var p = ah > ae && ah < aj; if (!p) { var ai = ah - b.scrollbarMargin; if (ah > ae) { ai += a(this).height() + 15 + b.scrollbarMargin - i } U(ai) } }); if (location.hash) { U(location.hash) } a(document).bind("click", function (ae) { $target = a(ae.target); if ($target.is("a")) { var p = $target.attr("href"); if (p.substr(0, 1) == "#") { U(p) } } }); a.jScrollPane.active.push(S[0]) } else { S.css({ height: i + "px", width: A - this.originalSidePaddingTotal + "px", padding: this.originalPadding }); S.parent().unbind("mousewheel") } }) }; a.fn.jScrollPane.defaults = { scrollbarWidth: 10, scrollbarMargin: 5, wheelSpeed: 18, showArrows: false, arrowSize: 0, animateTo: false, dragMinHeight: 1, dragMaxHeight: 99999, animateInterval: 100, animateStep: 3, maintainPosition: true, scrollbarOnLeft: false, reinitialiseOnImageLoad: false, scrollClass: "" }; a(window).bind("unload", function () { var c = a.jScrollPane.active; for (var b = 0; b < c.length; b++) { c[b].scrollTo = c[b].scrollBy = null } }) })(jQuery); 
(function (a) { a.event.special.mousewheel = { setup: function () { var b = a.event.special.mousewheel.handler; if (a.browser.mozilla) { a(this).bind("mousemove.mousewheel", function (c) { a.data(this, "mwcursorposdata", { pageX: c.pageX, pageY: c.pageY, clientX: c.clientX, clientY: c.clientY }) }) } if (this.addEventListener) { this.addEventListener((a.browser.mozilla ? "DOMMouseScroll" : "mousewheel"), b, false) } else { this.onmousewheel = b } }, teardown: function () { var b = a.event.special.mousewheel.handler; a(this).unbind("mousemove.mousewheel"); if (this.removeEventListener) { this.removeEventListener((a.browser.mozilla ? "DOMMouseScroll" : "mousewheel"), b, false) } else { this.onmousewheel = function () { } } a.removeData(this, "mwcursorposdata") }, handler: function (d) { var c = Array.prototype.slice.call(arguments, 1); d = a.event.fix(d || window.event); a.extend(d, a.data(this, "mwcursorposdata") || {}); var e = 0, b = true; if (d.wheelDelta) { e = d.wheelDelta / 120 } if (d.detail) { e = -d.detail / 3 } d.data = d.data || {}; d.type = "mousewheel"; c.unshift(e); c.unshift(d); return a.event.handle.apply(this, c) } }; a.fn.extend({ mousewheel: function (b) { return b ? this.bind("mousewheel", b) : this.trigger("mousewheel") }, unmousewheel: function (b) { return this.unbind("mousewheel", b) } }) })(jQuery); jQuery.fn.labelify = function (a) { a = jQuery.extend({ text: "title", labelledClass: "labelled", defaultValue: "" }, a); var d = { title: function (e) { return $(e).attr("title") }, label: function (e) { return $("label[for=" + e.id + "]").text() } }; var c; var b = $(this); return $(this).each(function () { if (typeof a.text === "string") { c = d[a.text] } else { c = a.text } if (typeof c !== "function") { return } var f = c(this); if (!f) { return } $(this).data("label", c(this).replace(/\n/g, "")); $(this).focus(function () { if (this.value === $(this).data("label")) { this.value = a.defaultValue; $(this).removeClass(a.labelledClass); var g = this; setTimeout(function () { g.selectionStart = 0; g.selectionEnd = 0 }, 200) } }).blur(function () { if (this.value === a.defaultValue) { this.value = $(this).data("label"); $(this).addClass(a.labelledClass) } }); var e = function () { b.each(function () { if (this.value === $(this).data("label")) { this.value = a.defaultValue; $(this).removeClass(a.labelledClass) } }) }; $(this).parents("form").submit(e); $(window).unload(e); if (this.value !== this.defaultValue) { return } this.value = $(this).data("label"); $(this).addClass(a.labelledClass) }) };
/*
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 2.11 (15-JUN-2010)
* Requires jQuery v1.3.2 or later
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Authors: Dave Methvin and Mike Alsup
*/
(function (d) { var k = document.createElement("div").style, j = k.MozBorderRadius !== undefined, g = k.WebkitBorderRadius !== undefined, e = k.borderRadius !== undefined || k.BorderRadius !== undefined, a = document.documentMode || 0, c = d.browser.msie && ((d.browser.version < 8 && !a) || a < 8), l = d.browser.msie && (function () { var m = document.createElement("div"); try { m.style.setExpression("width", "0+0"); m.style.removeExpression("width") } catch (n) { return false } return true })(); d.support = d.support || {}; d.support.borderRadius = j || g || e; function h(m, n) { return parseInt(d.css(m, n)) || 0 } function f(m) { var m = parseInt(m).toString(16); return (m.length < 2) ? "0" + m : m } function i(o) { while (o) { var m = d.css(o, "backgroundColor"), n; if (m && m != "transparent" && m != "rgba(0, 0, 0, 0)") { if (m.indexOf("rgb") >= 0) { n = m.match(/\d+/g); return "#" + f(n[0]) + f(n[1]) + f(n[2]) } return m } if (o.nodeName.toLowerCase() == "html") { break } o = o.parentNode } return "#ffffff" } function b(m, o, n) { switch (m) { case "round": return Math.round(n * (1 - Math.cos(Math.asin(o / n)))); case "cool": return Math.round(n * (1 + Math.cos(Math.asin(o / n)))); case "sharp": return Math.round(n * (1 - Math.cos(Math.acos(o / n)))); case "bite": return Math.round(n * (Math.cos(Math.asin((n - o - 1) / n)))); case "slide": return Math.round(n * (Math.atan2(o, n / o))); case "jut": return Math.round(n * (Math.atan2(n, (n - o - 1)))); case "curl": return Math.round(n * (Math.atan(o))); case "tear": return Math.round(n * (Math.cos(o))); case "wicked": return Math.round(n * (Math.tan(o))); case "long": return Math.round(n * (Math.sqrt(o))); case "sculpt": return Math.round(n * (Math.log((n - o - 1), n))); case "dogfold": case "dog": return (o & 1) ? (o + 1) : n; case "dog2": return (o & 2) ? (o + 1) : n; case "dog3": return (o & 3) ? (o + 1) : n; case "fray": return (o % 2) * n; case "notch": return n; case "bevelfold": case "bevel": return o + 1 } } d.fn.corner = function (o) { if (this.length == 0) { if (!d.isReady && this.selector) { var m = this.selector, n = this.context; d(function () { d(m, n).corner(o) }) } return this } return this.each(function (q) { var G = d(this), L = [G.attr(d.fn.corner.defaults.metaAttr) || "", o || ""].join(" ").toLowerCase(), t = /keep/.test(L), B = ((L.match(/cc:(#[0-9a-f]+)/) || [])[1]), r = ((L.match(/sc:(#[0-9a-f]+)/) || [])[1]), Q = parseInt((L.match(/(\d+)px/) || [])[1]) || 10, O = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/, s = ((L.match(O) || ["round"])[0]), I = /dogfold|bevelfold/.test(L), p = { T: 0, B: 1 }, D = { TL: /top|tl|left/.test(L), TR: /top|tr|right/.test(L), BL: /bottom|bl|left/.test(L), BR: /bottom|br|right/.test(L) }, y, P, F, C, u, J, x, N, E, v, K, M, z, A; if (!D.TL && !D.TR && !D.BL && !D.BR) { D = { TL: 1, TR: 1, BL: 1, BR: 1} } if (d.fn.corner.defaults.useNative && s == "round" && (e || j || g) && !B && !r) { if (D.TL) { G.css(e ? "border-top-left-radius" : j ? "-moz-border-radius-topleft" : "-webkit-border-top-left-radius", Q + "px") } if (D.TR) { G.css(e ? "border-top-right-radius" : j ? "-moz-border-radius-topright" : "-webkit-border-top-right-radius", Q + "px") } if (D.BL) { G.css(e ? "border-bottom-left-radius" : j ? "-moz-border-radius-bottomleft" : "-webkit-border-bottom-left-radius", Q + "px") } if (D.BR) { G.css(e ? "border-bottom-right-radius" : j ? "-moz-border-radius-bottomright" : "-webkit-border-bottom-right-radius", Q + "px") } return } y = document.createElement("div"); d(y).css({ overflow: "hidden", height: "1px", minHeight: "1px", fontSize: "1px", backgroundColor: r || "transparent", borderStyle: "solid" }); P = { T: parseInt(d.css(this, "paddingTop")) || 0, R: parseInt(d.css(this, "paddingRight")) || 0, B: parseInt(d.css(this, "paddingBottom")) || 0, L: parseInt(d.css(this, "paddingLeft")) || 0 }; if (typeof this.style.zoom != undefined) { this.style.zoom = 1 } if (!t) { this.style.border = "none" } y.style.borderColor = B || i(this.parentNode); F = d(this).outerHeight(); for (C in p) { u = p[C]; if ((u && (D.BL || D.BR)) || (!u && (D.TL || D.TR))) { y.style.borderStyle = "none " + (D[C + "R"] ? "solid" : "none") + " none " + (D[C + "L"] ? "solid" : "none"); J = document.createElement("div"); d(J).addClass("jquery-corner"); x = J.style; u ? this.appendChild(J) : this.insertBefore(J, this.firstChild); if (u && F != "auto") { if (d.css(this, "position") == "static") { this.style.position = "relative" } x.position = "absolute"; x.bottom = x.left = x.padding = x.margin = "0"; if (l) { x.setExpression("width", "this.parentNode.offsetWidth") } else { x.width = "100%" } } else { if (!u && d.browser.msie) { if (d.css(this, "position") == "static") { this.style.position = "relative" } x.position = "absolute"; x.top = x.left = x.right = x.padding = x.margin = "0"; if (l) { N = h(this, "borderLeftWidth") + h(this, "borderRightWidth"); x.setExpression("width", "this.parentNode.offsetWidth - " + N + '+ "px"') } else { x.width = "100%" } } else { x.position = "relative"; x.margin = !u ? "-" + P.T + "px -" + P.R + "px " + (P.T - Q) + "px -" + P.L + "px" : (P.B - Q) + "px -" + P.R + "px -" + P.B + "px -" + P.L + "px" } } for (E = 0; E < Q; E++) { v = Math.max(0, b(s, E, Q)); K = y.cloneNode(false); K.style.borderWidth = "0 " + (D[C + "R"] ? v : 0) + "px 0 " + (D[C + "L"] ? v : 0) + "px"; u ? J.appendChild(K) : J.insertBefore(K, J.firstChild) } if (I && d.support.boxModel) { if (u && c) { continue } for (M in D) { if (!D[M]) { continue } if (u && (M == "TL" || M == "TR")) { continue } if (!u && (M == "BL" || M == "BR")) { continue } z = { position: "absolute", border: "none", margin: 0, padding: 0, overflow: "hidden", backgroundColor: y.style.borderColor }; A = d("<div/>").css(z).css({ width: Q + "px", height: "1px" }); switch (M) { case "TL": A.css({ bottom: 0, left: 0 }); break; case "TR": A.css({ bottom: 0, right: 0 }); break; case "BL": A.css({ top: 0, left: 0 }); break; case "BR": A.css({ top: 0, right: 0 }); break } J.appendChild(A[0]); var H = d("<div/>").css(z).css({ top: 0, bottom: 0, width: "1px", height: Q + "px" }); switch (M) { case "TL": H.css({ left: Q }); break; case "TR": H.css({ right: Q }); break; case "BL": H.css({ left: Q }); break; case "BR": H.css({ right: Q }); break } J.appendChild(H[0]) } } } } }) }; d.fn.uncorner = function () { if (e || j || g) { this.css(e ? "border-radius" : j ? "-moz-border-radius" : "-webkit-border-radius", 0) } d("div.jquery-corner", this).remove(); return this }; d.fn.corner.defaults = { useNative: true, metaAttr: "data-corner"} })(jQuery); var shareHelper = { baseUrl: "http://" + document.domain, title: null, date: null, bookmaerksToShow: null, contentUrl: null, contentType: null, relativeUrl: null, shareWidgetId: "id-ShareWidget", width: 220, height: 160, pconf: { useFacebookMystuff: "false", widgetTitle: "You must see this!", onClose: function () { $("#id-ShareWidget").hide(); return false }, defaultContent: "Check it out!", defaultBookmarkURL: null, companyName: "funnybone.com", UIConfig: '<config baseTheme="v2"><display showEmail="true" showPost="false" showBookmark="true" showCodeBox="false" showCloseButton="true"></display><body><background frame-thickness="3"></background><controls><snbuttons iconsOnly="true"></snbuttons></controls></body></config>' }, shareVideo: function (b, a, c) { return this.share(b, a, c, "Video") }, shareEvent: function (b, a, c) { return this.share(b, a, c, "Event") }, shareBlogPost: function (b, a, c) { return this.share(b, a, c, "BlogPost") }, share: function (a, b, c, d) { this.relativeUrl = a; this.title = b; this.date = c; this.contentType = d; this._initConfig(); this._share() }, _initConfig: function () { if (this.relativeUrl.indexOf("http://") == -1) { this.contentUrl = this.baseUrl + this.relativeUrl } else { this.contentUrl = this.relativeUrl } this.pconf.defaultBookmarkURL = this.contentUrl; this.pconf.bookmarksToShow = this._getBookmarksToShow(); this.pconf.emailSubject = "$sender$ shared a " + this.contentType.toLowerCase() + " with you from funnybone.com"; this.pconf.emailBody = this._getEmailBody(); if (this.date == "none") { this.pconf.widgetTitle = this.title } else { this.pconf.widgetTitle = this.title + " (" + this.date + ")" } }, _getBookmarksToShow: function () { return "facebook, delicious, digg, googlebookmarks, stumbleupon, twitter" }, _getEmailBody: function () { var a = '<a href="' + this.contentUrl + '">' + this.contentType + ' link</a><br />Check out more great comedy at <a href="http://www.funnybone.com">www.funnybone.com</a><br />Follow us on Facebook for great deals at an funnybone comedy club near you: <a href="http://www.facebook.com/thefunnybone">www.facebook.com/thefunnybone</a>'; return a }, _share: function () { Wildfire.initPost("1011622", this.shareWidgetId, this.width, this.height, this.pconf); $("#" + this.shareWidgetId).show(); return false } }; function showNotification(c, a) { var b = $("<div class='notification'>" + c + "</div>"); b.dialog({ autoOpen: true, position: ["center", 200], dialogClass: "notification-dialog", resizable: false, width: 260, minHeight: 20, buttons: { Close: function () { $(this).dialog("close") } }, close: function () { $(this).dialog("destroy"); b.remove(); if (a !== undefined) { a() } } }) } function selectShowTime(c, b) { var e = $("<div class='shows'></div>"); for (var d = 0; d < c.length; d++) { e.append($("<a class='show button' href='" + b[d] + "'>" + c[d] + "</a>")) } var a = $("<div class='select-show'><span>Please select the show you would like to attend.</span></div>").append(e); a.dialog({ autoOpen: true, title: "Choose a show time", position: ["center", 200], dialogClass: "select-show-dialog", resizable: false, width: 480, minHeight: 100, modal: true, close: function () { $(this).dialog("destroy"); a.remove() } }) } function showConfirm(e, b) { var a = $("<div class='actions'><div class='check'><input type='checkbox' />Don't show again</div><input class='button ok' type='button' value='OK' /><a class='cancel'>Cancel</a></div>"); var c = $("<div class='notification confirm'></div>").text(e).append(a); a.find(".ok").bind("keypress", function (f) { if (f.keyCode == 13) { d() } }); a.find(".ok").click(function () { d() }); function d() { c.dialog("close"); if (b !== undefined) { b(a.find(".check input").attr("checked")) } } a.find(".cancel").click(function () { c.dialog("close") }); c.dialog({ autoOpen: true, position: ["center", 200], dialogClass: "notification-dialog", resizable: false, width: 330, minHeight: 20, open: function () { a.find(".ok").focus() }, close: function () { $(this).dialog("destroy"); c.remove() } }) } $(function () { $(".module.editable").each(function (c, b) { var a = $(b).find(".edit-actions"); if (a !== undefined) { $(b).mouseenter(function () { a.show() }).mouseleave(function () { a.hide() }) } }) }); function initializeUserFollowersEdit(a) { $.ajax({ type: "GET", url: a.editFollowersDialogUrl, dataType: "html", data: { userUUID: a.userUUID }, success: function (c) { $("body").append(c); var b = $(".edit-followers .followers-wrap"); $(".edit-followers .search .search-followers").labelify(); $(".edit-followers").dialog({ autoOpen: false, position: ["center", 200], dialogClass: "edit-followers-dialog", resizable: false, width: 300, minWidth: 300, title: a.dialogTitle, modal: true, buttons: { Close: function () { $(this).dialog("close") } }, open: function () { fillUserFollowersEditList(b, a, "") }, close: function () { if (a.editCallback !== undefined) { a.editCallback() } } }); $(".edit-followers .delete-checked").click(function () { b.find(".check-delete:checked").each(function (e, d) { $(d).parents(".follower").trigger("delete") }); return false }); $(".edit-followers .search .button").click(function () { var d = $(".edit-followers .search .search-followers"); if (d.val() !== d.attr("title")) { fillUserFollowersEditList(b, a, d.val()) } }) }, error: function (c, b, d) { alert(b) } }) } function fillUserFollowersEditList(a, b, c) { $.ajax({ type: "GET", url: b.followersListUrl, dataType: "html", data: { userUUID: b.userUUID, searchString: c }, success: function (d) { a.html(d); a.find(".delete").each(function (h, f) { var g = $(f).parents(".follower"); var e = g.attr("id"); g.bind("delete", function () { $.ajax({ type: "POST", url: b.deleteFollowerUrl, dataType: "html", data: { userUUID: b.userUUID, followerUUID: e }, success: function (i) { g.remove() }, error: function (j, i, k) { alert(i) } }) }); $(f).click(function () { g.trigger("delete") }) }); $(".edit-followers .followers-wrap").jScrollPane({ showArrows: true, scrollbarWidth: 13 }) }, error: function (e, d, f) { alert(d) } }) } var EditPictureOverlay = (function () { var f; function e(g) { $(".edit-profile .upload .file-name").val(g.name) } function c() { $(".edit-profile .upload .button").hide(); $(".edit-profile .upload .loading").show(); $(".edit-profile .upload .success").hide() } function d(h, g) { $(".edit-profile .current img").remove(); $(".edit-profile .current").append($(g)); $(".edit-profile .upload .button").show(); $(".edit-profile .upload .loading").hide(); $(".edit-profile .upload .success").show(); $(".edit-profile").data("changed", true) } function b(i, h, g) { if (h === SWFUpload.UPLOAD_ERROR.FILE_CANCELLED) { return } $(".edit-profile .upload .button").show(); $(".edit-profile .upload .loading").hide(); $(".edit-profile .upload .success").hide(); alert(g) } function a() { $(".edit-profile .upload .file-name").val(""); this.cancelUpload() } return { init: function (g) { f = new SWFUpload({ upload_url: g.imageUploadUrl, post_params: { success_action_status: "201", comedianUUID: g.comedianUUID, token: g.authToken }, http_success: [201], use_query_string: true, assume_success_timeout: 5, file_post_name: "file", file_size_limit: "10240", file_types: "*.jpg;*.gif;*.png", file_types_description: "Web Image Files", file_upload_limit: "0", file_queue_limit: 1, file_dialog_start_handler: a, file_queued_handler: e, upload_start_handler: c, upload_error_handler: b, upload_success_handler: d, button_width: "70", button_height: "21", button_placeholder_id: "id-upload-place", button_text_left_padding: 6, button_text_top_padding: 3, button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT, button_cursor: SWFUpload.CURSOR.HAND, moving_average_history_size: 10, flash_url: "/Template/root/BinaryResource/Javascript/Flash/swfupload.swf", debug: false }); $(".edit-profile .upload .button").click(function () { f.startUpload() }); $(".edit-profile .remove .button").click(function () { $.ajax({ type: "POST", url: g.removeImageUrl, dataType: "html", data: { comedianUUID: g.comedianUUID }, beforeSend: function () { $(".edit-profile .remove .button").hide(); $(".edit-profile .remove .loading").show(); $(".edit-profile .remove .success").hide() }, success: function (h) { $(".edit-profile .remove .button").show(); $(".edit-profile .remove .loading").hide(); $(".edit-profile .remove .success").show(); $(".edit-profile .current img").attr("src", g.defaultImageUrl); $(".edit-profile").data("changed", true) }, error: function (i, h, j) { $(".edit-profile .remove .button").show(); $(".edit-profile .remove .loading").hide(); $(".edit-profile .remove .success").hide() } }) }); $(".edit-profile").dialog({ autoOpen: false, position: ["center", 200], dialogClass: "edit-profile-dialog", resizable: false, width: 320, minWidth: 320, title: "Edit Profile Picture", modal: true, buttons: { Close: function () { $(this).dialog("close") } }, close: function () { if ($(".edit-profile").data("changed") === true) { $(".edit-profile").data("changed", false); location.reload() } } }) }, show: function () { $(".edit-profile").dialog("open") } } })(); (function (d) { d.fn.jMyCarousel = function (e) { e = d.extend({ btnPrev: null, btnNext: null, mouseWheel: true, auto: false, speed: 400, easing: "linear", vertical: false, circular: false, visible: "4", start: 0, scroll: 1, step: 50, eltByElt: false, evtStart: "mouseover", evtStop: "mouseout", beforeStart: null, afterEnd: null, custom: true }, e || {}); return this.each(function () { var O = false, n = e.vertical ? "top" : "left", P = e.vertical ? "height" : "width"; var g = d(this), f = d("ul", g), h = d("li", f), L = h.size(), i = e.visible; var t = 0; var D = (e.btnNext === null && e.btnPrev === null) ? true : false; var E = (i.toString().indexOf("%") != -1 ? "%" : (i.toString().indexOf("px") != -1) ? "px" : "el"); var B = null; if (e.custom) { d("img", g).each(function () { d(this).attr("width", d(this).width()) }) } if (e.circular) { var N = h.clone(); f.prepend(N).append(N.clone()) } var C = d("li", f); g.css("visibility", "visible"); C.css("overflow", "hidden").css("float", e.vertical ? "none" : "left").children().css("overflow", "hidden"); if (!e.vertical) { C.css("display", "inline-block") } if (C.children().get(0).tagName.toLowerCase() == "a" && !e.vertical) { C.children().css("float", "left") } if (e.vertical && jQuery.browser.msie) { C.css("line-height", "4px").children().css("margin-bottom", "-4px") } f.css("margin", "0").css("padding", "0").css("position", "relative").css("list-style-type", "none").css("z-index", "1"); g.css("overflow", "hidden").css("position", "relative").css("z-index", "2").css("left", "0px"); var H = e.vertical ? a(C) : b(C); var q = e.vertical ? r(C) : a(C); var w = e.start; var o = C.size(); var x = H * o; var K = L; var p = K * H; var Q = o * H; var l = e.step == "default" ? H : e.step; if (e.custom) { x = 0; d("li", g).each(function () { x += d(this).width() }); p = x } else { p -= parseInt(d("li", g).css("margin-right")) } e.btnPrev = D ? d('<input type="button" class="' + (e.vertical ? "up" : "prev") + '" />') : d(e.btnPrev); e.btnNext = D ? d('<input type="button" class="' + (e.vertical ? "down" : "next") + '" />') : d(e.btnNext); var m = e.btnPrev; var G = e.btnNext; if (D && e.auto !== true) { g.parent().prepend(m); g.parent().prepend(G); e.btnPrev = m; e.btnNext = G } if (e.eltByElt) { l = H; if (e.start % H !== 0) { var J = parseInt(e.start / H); w = e.start = (J * H) } } if (e.circular) { e.start += (H * L); w += (H * L) } var z, F, u; if (E == "%") { z = 0; F = parseInt(i); u = "%" } else { if (E == "px") { z = parseInt(i); F = parseInt(i); u = "px" } else { z = H * parseInt(i); F = H * parseInt(i); u = "px" } } f.css(P, x + "px").css(n, -(e.start)); g.css(P, F + u); if (e.vertical && u == "%") { var M = ((H * K) * (parseInt(i) / 100)); g.css(P, M + "px") } if (z === 0) { z = g.width() } if (e.vertical) { g.css("width", q + "px"); f.css("width", q + "px"); C.css("margin-bottom", (parseInt(C.css("margin-bottom")) * 2) + "px"); C.eq(C.size() - 1).css("margin-bottom", C.css("margin-top")) } else { g.css("height", q + "px"); f.css("height", q + "px") } if (E == "%") { i = z / C.width(); if (i % 1 !== 0) { i += 1 } i = parseInt(i) } var I = g.height(); if (D) { G.css({ "z-index": 200, position: "absolute" }); m.css({ "z-index": 200, position: "absolute" }); if (e.vertical) { m.css({ width: m.width(), height: m.height(), top: "0px", left: parseInt(q / 2) - parseInt(m.width() / 2) + "px" }); G.css({ width: m.width(), height: m.height(), top: (I - m.height()) + "px", left: parseInt(q / 2) - parseInt(m.width() / 2) + "px" }) } else { m.css({ left: "0px", top: parseInt(q / 2) - parseInt(m.height() / 2) + "px" }); G.css({ right: "0px", top: parseInt(q / 2) - parseInt(m.height() / 2) + "px" }) } } if (e.btnPrev) { d(e.btnPrev).bind(e.evtStart, function () { O = true; B = "backward"; return j() }); d(e.btnPrev).bind(e.evtStop, function () { O = false; B = null; return A() }) } if (e.btnNext) { d(e.btnNext).bind(e.evtStart, function () { O = true; B = "forward"; return s() }); d(e.btnNext).bind(e.evtStop, function () { O = false; B = null; return A() }) } if (e.auto === true) { O = true; s() } if (e.mouseWheel && g.mousewheel) { g.mousewheel(function (R, v) { if (!e.circular && (v > 0 ? (w + z < x) : (w > 0)) || e.circular) { t += 1; if (O === false) { if (v > 0) { s(l, true) } else { j(l, true) } O = true } } }) } function s(S, v) { var R = (S ? S : l); if (O === true && B === "backward") { return } if (!e.circular) { if (w + R + (e.vertical ? I : z) > p) { R = p - (w + (e.vertical ? I : z)) } } f.animate(n == "left" ? { left: -(w + R)} : { top: -(w + R) }, e.speed, e.easing, function () { w += R; if (e.circular) { if (w + (e.vertical ? I : z) + H >= Q) { f.css(e.vertical ? "top" : "left", -w + p); w -= p } } if (!v && O) { s() } else { if (v) { if (--t > 0) { this.forward(l, true) } else { O = false; B = null } } } }) } function j(S, v) { var R = (S ? S : l); if (O === true && B === "forward") { return } if (!e.circular) { if (w - R < 0) { R = w - 0 } } f.animate(n == "left" ? { left: -(w - R)} : { top: -(w - R) }, e.speed, e.easing, function () { w -= R; if (e.circular) { if (w <= H) { f.css(e.vertical ? "top" : "left", -(w + p)); w += p } } if (!v && O) { j() } else { if (v) { if (--t > 0) { j(l, true) } else { O = false; B = null } } } }) } function A() { if (!e.eltByElt) { f.stop(); w = 0 - parseInt(f.css(n)) } O = false; B = null } function k(R, v) { if (v == "width") { return R.find("img").width() } else { return R.find("img").height() } } function r(v) { var R = v.find("img"); if (e.vertical) { return parseInt(v.css("margin-left")) + parseInt(v.css("margin-right")) + parseInt(R.width()) + parseInt(v.css("border-left-width")) + parseInt(v.css("border-right-width")) + parseInt(v.css("padding-right")) + parseInt(v.css("padding-left")) } else { return parseInt(v.css("margin-top")) + parseInt(v.css("margin-bottom")) + parseInt(R.width()) + parseInt(v.css("border-top-height")) + parseInt(v.css("border-bottom-height")) + parseInt(v.css("padding-top")) + parseInt(v.css("padding-bottom")) } } function y(v) { d("#debug").html(d("#debug").html() + v + "<br/>") } }) }; function c(e, f) { return parseInt(d.css(e[0], f)) || 0 } function b(e) { return e[0].offsetWidth + c(e, "marginLeft") + c(e, "marginRight") } function a(e) { return e[0].offsetHeight + c(e, "marginTop") + c(e, "marginBottom") } })(jQuery);

