/**
* jQuery Validation Plugin 1.8.0
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2011 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/
(function (c) {
    c.extend(c.fn, { validate: function (a) {
        if (this.length) {
            var b = c.data(this[0], "validator"); if (b) return b; b = new c.validator(a, this[0]); c.data(this[0], "validator", b); if (b.settings.onsubmit) {
                this.find("input, button").filter(".cancel").click(function () { b.cancelSubmit = true }); b.settings.submitHandler && this.find("input, button").filter(":submit").click(function () { b.submitButton = this }); this.submit(function (d) {
                    function e() {
                        if (b.settings.submitHandler) {
                            if (b.submitButton) var f = c("<input type='hidden'/>").attr("name",
b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm); b.settings.submitHandler.call(b, b.currentForm); b.submitButton && f.remove(); return false
                        } return true
                    } b.settings.debug && d.preventDefault(); 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
        } else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
    }, valid: function () {
        if (c(this[0]).is("form")) return this.validate().form();
        else { var a = true, b = c(this[0].form).validate(); this.each(function () { a &= b.element(this) }); return a } 
    }, removeAttrs: function (a) { var b = {}, d = this; c.each(a.split(/\s/), function (e, f) { b[f] = d.attr(f); d.removeAttr(f) }); return b }, rules: function (a, b) {
        var d = this[0]; if (a) {
            var e = c.data(d.form, "validator").settings, f = e.rules, g = c.validator.staticRules(d); switch (a) {
                case "add": c.extend(g, c.validator.normalizeRule(b)); f[d.name] = g; if (b.messages) e.messages[d.name] = c.extend(e.messages[d.name], b.messages); break; case "remove": if (!b) {
                        delete f[d.name];
                        return g
                    } var h = {}; c.each(b.split(/\s/), function (j, i) { h[i] = g[i]; delete g[i] }); return h
            } 
        } d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d); if (d.required) { e = d.required; delete d.required; d = c.extend({ required: e }, d) } return d
    } 
    }); c.extend(c.expr[":"], { blank: function (a) { return !c.trim("" + a.value) }, filled: function (a) { return !!c.trim("" + a.value) }, unchecked: function (a) { return !a.checked } }); c.validator = function (a,
b) { this.settings = c.extend(true, {}, c.validator.defaults, a); this.currentForm = b; this.init() }; c.validator.format = function (a, b) { if (arguments.length == 1) return function () { var d = c.makeArray(arguments); d.unshift(a); return c.validator.format.apply(this, d) }; if (arguments.length > 2 && b.constructor != Array) b = c.makeArray(arguments).slice(1); if (b.constructor != Array) b = [b]; c.each(b, function (d, e) { a = a.replace(RegExp("\\{" + d + "\\}", "g"), e) }); return a }; c.extend(c.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error",
    validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: c([]), errorLabelContainer: c([]), onsubmit: true, ignore: [], ignoreTitle: false, onfocusin: function (a) { this.lastActive = a; if (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) { if (!this.checkable(a) && (a.name in this.submitted || !this.optional(a))) this.element(a) },
    onkeyup: function (a) { if (a.name in this.submitted || a == this.lastElement) this.element(a) }, onclick: function (a) { if (a.name in this.submitted) this.element(a); else a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (a, b, d) { c(a).addClass(b).removeClass(d) }, unhighlight: function (a, b, d) { c(a).removeClass(b).addClass(d) } 
}, setDefaults: function (a) { c.extend(c.validator.defaults, a) }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.",
    url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: c.validator.format("Please enter no more than {0} characters."), minlength: c.validator.format("Please enter at least {0} characters."), rangelength: c.validator.format("Please enter a value between {0} and {1} characters long."),
    range: c.validator.format("Please enter a value between {0} and {1}."), max: c.validator.format("Please enter a value less than or equal to {0}."), min: c.validator.format("Please enter a value greater than or equal to {0}.")
}, autoCreateRanges: false, prototype: { init: function () {
    function a(e) { var f = c.data(this[0].form, "validator"); e = "on" + e.type.replace(/^validate/, ""); f.settings[e] && f.settings[e].call(f, this[0]) } this.labelContainer = c(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length &&
this.labelContainer || c(this.currentForm); this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var b = this.groups = {}; c.each(this.settings.groups, function (e, f) { c.each(f.split(/\s/), function (g, h) { b[h] = e }) }); var d = this.settings.rules; c.each(d, function (e, f) { d[e] = c.validator.normalizeRule(f) }); c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea",
"focusin focusout keyup", a).validateDelegate(":radio, :checkbox, select, option", "click", a); this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
}, form: function () { this.checkForm(); c.extend(this.submitted, this.errorMap); this.invalid = c.extend({}, this.errorMap); this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return 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 (a) { this.lastElement = a = this.clean(a); this.prepareElement(a); this.currentElements = c(a); var b = this.check(a); if (b) delete this.invalid[a.name]; else this.invalid[a.name] = true; if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers); this.showErrors(); return b }, showErrors: function (a) {
    if (a) {
        c.extend(this.errorMap, a); this.errorList = []; for (var b in a) this.errorList.push({ message: a[b], element: this.findByName(b)[0] }); this.successList = c.grep(this.successList,
function (d) { return !(d.name in a) })
    } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
}, resetForm: function () { c.fn.resetForm && c(this.currentForm).resetForm(); this.submitted = {}; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (a) { var b = 0, d; for (d in a) b++; return b }, hideErrors: function () { this.addWrapper(this.toHide).hide() },
    valid: function () { return this.size() == 0 }, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (a) { } }, findLastActive: function () { var a = this.lastActive; return a && c.grep(this.errorList, function (b) { return b.element.name == a.name }).length == 1 && a }, elements: function () {
        var a = this, b = {}; return c([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
            !this.name &&
a.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in b || !a.objectLength(c(this).rules())) return false; return b[this.name] = true
        })
    }, clean: function (a) { return c(a)[0] }, errors: function () { return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext) }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = c([]); this.toHide = c([]); this.currentElements = c([]) }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers) },
    prepareElement: function (a) { this.reset(); this.toHide = this.errorsFor(a) }, check: function (a) {
        a = this.clean(a); if (this.checkable(a)) a = this.findByName(a.name).not(this.settings.ignore)[0]; var b = c(a).rules(), d = false, e; for (e in b) {
            var f = { method: e, parameters: b[e] }; try { var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters); if (g == "dependency-mismatch") d = true; else { d = false; if (g == "pending") { this.toHide = this.toHide.not(this.errorsFor(a)); return } if (!g) { this.formatAndAdd(a, f); return false } } } catch (h) {
                this.settings.debug &&
window.console && console.log("exception occured when checking element " + a.id + ", check the '" + f.method + "' method", h); throw h;
            } 
        } if (!d) { this.objectLength(b) && this.successList.push(a); return true } 
    }, customMetaMessage: function (a, b) { if (c.metadata) { var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata(); return d && d.messages && d.messages[b] } }, customMessage: function (a, b) { var d = this.settings.messages[a]; return d && (d.constructor == String ? d : d[b]) }, findDefined: function () {
        for (var a = 0; a < arguments.length; a++) if (arguments[a] !==
undefined) return arguments[a]
    }, defaultMessage: function (a, b) { return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || undefined, c.validator.messages[b], "<strong>Warning: No message defined for " + a.name + "</strong>") }, formatAndAdd: function (a, b) {
        var d = this.defaultMessage(a, b.method), e = /\$?\{(\d+)\}/g; if (typeof d == "function") d = d.call(this, b.parameters, a); else if (e.test(d)) d = jQuery.format(d.replace(e, "{$1}"), b.parameters); this.errorList.push({ message: d,
            element: a
        }); this.errorMap[a.name] = d; this.submitted[a.name] = d
    }, addWrapper: function (a) { if (this.settings.wrapper) a = a.add(a.parent(this.settings.wrapper)); return a }, defaultShowErrors: function () {
        for (var a = 0; this.errorList[a]; a++) { var b = this.errorList[a]; this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass); this.showLabel(b.element, b.message) } if (this.errorList.length) this.toShow = this.toShow.add(this.containers); if (this.settings.success) for (a =
0; this.successList[a]; a++) this.showLabel(this.successList[a]); if (this.settings.unhighlight) { a = 0; for (b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass) } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show()
    }, validElements: function () { return this.currentElements.not(this.invalidElements()) }, invalidElements: function () { return c(this.errorList).map(function () { return this.element }) }, showLabel: function (a,
b) {
        var d = this.errorsFor(a); if (d.length) { d.removeClass().addClass(this.settings.errorClass); d.attr("generated") && d.html(b) } else { d = c("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(a), generated: true }).addClass(this.settings.errorClass).html(b || ""); if (this.settings.wrapper) d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a)) } if (!b && this.settings.success) {
            d.text("");
            typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d)
        } this.toShow = this.toShow.add(d)
    }, errorsFor: function (a) { var b = this.idOrName(a); return this.errors().filter(function () { return c(this).attr("for") == b }) }, idOrName: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, checkable: function (a) { return /radio|checkbox/i.test(a.type) }, findByName: function (a) {
        var b = this.currentForm; return c(document.getElementsByName(a)).map(function (d, e) {
            return e.form ==
b && e.name == a && e || null
        })
    }, getLength: function (a, b) { switch (b.nodeName.toLowerCase()) { case "select": return c("option:selected", b).length; case "input": if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length } return a.length }, depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : true }, dependTypes: { "boolean": function (a) { return a }, string: function (a, b) { return !!c(a, b.form).length }, "function": function (a, b) { return a(b) } }, optional: function (a) {
        return !c.validator.methods.required.call(this,
c.trim(a.value), a) && "dependency-mismatch"
    }, startRequest: function (a) { if (!this.pending[a.name]) { this.pendingRequest++; this.pending[a.name] = true } }, stopRequest: function (a, b) {
        this.pendingRequest--; if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[a.name]; if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) { c(this.currentForm).submit(); this.formSubmitted = false } else if (!b && this.pendingRequest == 0 && this.formSubmitted) {
            c(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted =
false
        } 
    }, previousValue: function (a) { return c.data(a, "previousValue") || c.data(a, "previousValue", { old: null, valid: true, message: this.defaultMessage(a, "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 (a, b) {
    a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings,
a)
}, classRules: function (a) { var b = {}; (a = c(a).attr("class")) && c.each(a.split(" "), function () { this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this]) }); return b }, attributeRules: function (a) { var b = {}; a = c(a); for (var d in c.validator.methods) { var e = a.attr(d); if (e) b[d] = e } b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength; return b }, metadataRules: function (a) {
    if (!c.metadata) return {}; var b = c.data(a.form, "validator").settings.meta; return b ? c(a).metadata()[b] :
c(a).metadata()
}, staticRules: function (a) { var b = {}, d = c.data(a.form, "validator"); if (d.settings.rules) b = c.validator.normalizeRule(d.settings.rules[a.name]) || {}; return b }, normalizeRules: function (a, b) {
    c.each(a, function (d, e) { if (e === false) delete a[d]; else if (e.param || e.depends) { var f = true; switch (typeof e.depends) { case "string": f = !!c(e.depends, b.form).length; break; case "function": f = e.depends.call(b, b) } if (f) a[d] = e.param !== undefined ? e.param : true; else delete a[d] } }); c.each(a, function (d, e) {
        a[d] = c.isFunction(e) ?
e(b) : e
    }); c.each(["minlength", "maxlength", "min", "max"], function () { if (a[this]) a[this] = Number(a[this]) }); c.each(["rangelength", "range"], function () { if (a[this]) a[this] = [Number(a[this][0]), Number(a[this][1])] }); if (c.validator.autoCreateRanges) { if (a.min && a.max) { a.range = [a.min, a.max]; delete a.min; delete a.max } if (a.minlength && a.maxlength) { a.rangelength = [a.minlength, a.maxlength]; delete a.minlength; delete a.maxlength } } a.messages && delete a.messages; return a
}, normalizeRule: function (a) {
    if (typeof a == "string") {
        var b =
{}; c.each(a.split(/\s/), function () { b[this] = true }); a = b
    } return a
}, addMethod: function (a, b, d) { c.validator.methods[a] = b; c.validator.messages[a] = d != undefined ? d : c.validator.messages[a]; b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a)) }, methods: { required: function (a, b, d) {
    if (!this.depend(d, b)) return "dependency-mismatch"; switch (b.nodeName.toLowerCase()) {
        case "select": return (a = c(b).val()) && a.length > 0; case "input": if (this.checkable(b)) return this.getLength(a, b) > 0; default: return c.trim(a).length >
0
    } 
}, remote: function (a, b, d) {
    if (this.optional(b)) return "dependency-mismatch"; var e = this.previousValue(b); this.settings.messages[b.name] || (this.settings.messages[b.name] = {}); e.originalMessage = this.settings.messages[b.name].remote; this.settings.messages[b.name].remote = e.message; d = typeof d == "string" && { url: d} || d; if (this.pending[b.name]) return "pending"; if (e.old === a) return e.valid; e.old = a; var f = this; this.startRequest(b); var g = {}; g[b.name] = a; c.ajax(c.extend(true, { url: d, mode: "abort", port: "validate" + b.name,
        dataType: "json", data: g, success: function (h) { f.settings.messages[b.name].remote = e.originalMessage; var j = h === true; if (j) { var i = f.formSubmitted; f.prepareElement(b); f.formSubmitted = i; f.successList.push(b); f.showErrors() } else { i = {}; h = h || f.defaultMessage(b, "remote"); i[b.name] = e.message = c.isFunction(h) ? h(a) : h; f.showErrors(i) } e.valid = j; f.stopRequest(b, j) } 
    }, d)); return "pending"
}, minlength: function (a, b, d) { return this.optional(b) || this.getLength(c.trim(a), b) >= d }, maxlength: function (a, b, d) {
    return this.optional(b) ||
this.getLength(c.trim(a), b) <= d
}, rangelength: function (a, b, d) { a = this.getLength(c.trim(a), b); return this.optional(b) || a >= d[0] && a <= d[1] }, min: function (a, b, d) { return this.optional(b) || a >= d }, max: function (a, b, d) { return this.optional(b) || a <= d }, range: function (a, b, d) { return this.optional(b) || a >= d[0] && a <= d[1] }, email: function (a, b) { return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a) },
    url: function (a, b) { return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) },
    date: function (a, b) { return this.optional(b) || !/Invalid|NaN/.test(new Date(a)) }, dateISO: function (a, b) { return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a) }, number: function (a, b) { return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a) }, digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) }, creditcard: function (a, b) {
        if (this.optional(b)) return "dependency-mismatch"; if (/[^0-9-]+/.test(a)) return false; var d = 0, e = 0, f = false; a = a.replace(/\D/g, ""); for (var g = a.length - 1; g >=
0; g--) { e = a.charAt(g); e = parseInt(e, 10); if (f) if ((e *= 2) > 9) e -= 9; d += e; f = !f } return d % 10 == 0
    }, accept: function (a, b, d) { d = typeof d == "string" ? d.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(b) || a.match(RegExp(".(" + d + ")$", "i")) }, equalTo: function (a, b, d) { d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () { c(b).valid() }); return a == d.val() } 
}
}); c.format = c.validator.format
})(jQuery);
(function (c) { var a = {}; if (c.ajaxPrefilter) c.ajaxPrefilter(function (d, e, f) { e = d.port; if (d.mode == "abort") { a[e] && a[e].abort(); a[e] = f } }); else { var b = c.ajax; c.ajax = function (d) { var e = ("port" in d ? d : c.ajaxSettings).port; if (("mode" in d ? d : c.ajaxSettings).mode == "abort") { a[e] && a[e].abort(); return a[e] = b.apply(this, arguments) } return b.apply(this, arguments) } } })(jQuery);
(function (c) {
    !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({ focus: "focusin", blur: "focusout" }, function (a, b) { function d(e) { e = c.event.fix(e); e.type = b; return c.event.handle.call(this, e) } c.event.special[b] = { setup: function () { this.addEventListener(a, d, true) }, teardown: function () { this.removeEventListener(a, d, true) }, handler: function (e) { arguments[0] = c.event.fix(e); arguments[0].type = b; return c.event.handle.apply(this, arguments) } } }); c.extend(c.fn, { validateDelegate: function (a,
b, d) { return this.bind(b, function (e) { var f = c(e.target); if (f.is(a)) return d.apply(f, arguments) }) } 
    })
})(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/**
* jQuery.ScrollTo
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 5/25/2009
*
* @projectDescription Easy element scrolling using jQuery.
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
* Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
*
* @author Ariel Flesler
* @version 1.4.2
*/
(function ($) { var $scrollTo = $.scrollTo = function (target, duration, settings) { $(window).scrollTo(target, duration, settings); }; $scrollTo.defaults = { axis: 'xy', duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1 }; $scrollTo.window = function (scope) { return $(window)._scrollable(); }; $.fn._scrollable = function () { return this.map(function () { var elem = this, isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; if (!isWin) return elem; var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem; return $.browser.safari || doc.compatMode == 'BackCompat' ? doc.body : doc.documentElement; }); }; $.fn.scrollTo = function (target, duration, settings) { if (typeof duration == 'object') { settings = duration; duration = 0; } if (typeof settings == 'function') settings = { onAfter: settings }; if (target == 'max') target = 9e9; settings = $.extend({}, $scrollTo.defaults, settings); duration = duration || settings.speed || settings.duration; settings.queue = settings.queue && settings.axis.length > 1; if (settings.queue) duration /= 2; settings.offset = both(settings.offset); settings.over = both(settings.over); return this._scrollable().each(function () { var elem = this, $elem = $(elem), targ = target, toff, attr = {}, win = $elem.is('html,body'); switch (typeof targ) { case 'number': case 'string': if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)) { targ = both(targ); break; } targ = $(targ, this); case 'object': if (targ.is || targ.style) toff = (targ = $(targ)).offset(); } $.each(settings.axis.split(''), function (i, axis) { var Pos = axis == 'x' ? 'Left' : 'Top', pos = Pos.toLowerCase(), key = 'scroll' + Pos, old = elem[key], max = $scrollTo.max(elem, axis); if (toff) { attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]); if (settings.margin) { attr[key] -= parseInt(targ.css('margin' + Pos)) || 0; attr[key] -= parseInt(targ.css('border' + Pos + 'Width')) || 0; } attr[key] += settings.offset[pos] || 0; if (settings.over[pos]) attr[key] += targ[axis == 'x' ? 'width' : 'height']() * settings.over[pos]; } else { var val = targ[pos]; attr[key] = val.slice && val.slice(-1) == '%' ? parseFloat(val) / 100 * max : val; } if (/^\d+$/.test(attr[key])) attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max); if (!i && settings.queue) { if (old != attr[key]) animate(settings.onAfterFirst); delete attr[key]; } }); animate(settings.onAfter); function animate(callback) { $elem.animate(attr, duration, settings.easing, callback && function () { callback.call(this, target, settings); }); }; }).end(); }; $scrollTo.max = function (elem, axis) { var Dim = axis == 'x' ? 'Width' : 'Height', scroll = 'scroll' + Dim; if (!$(elem).is('html,body')) return elem[scroll] - $(elem)[Dim.toLowerCase()](); var size = 'client' + Dim, html = elem.ownerDocument.documentElement, body = elem.ownerDocument.body; return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]); }; function both(val) { return typeof val == 'object' ? val : { top: val, left: val }; }; })(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
* 
* $Version: 2007.08.19 +r2
*/

(function ($) {
    $.fn.jqDrag = function (h) { return i(this, h, 'd'); }; $.fn.jqResize = function (h) { return i(this, h, 'r'); }; $.jqDnR = { dnr: {}, e: 0, drag: function (v) { if (M.k == 'd') E.css({ left: M.X + v.pageX - M.pX, top: M.Y + v.pageY - M.pY }); else E.css({ width: Math.max(v.pageX - M.pX + M.W, 0), height: Math.max(v.pageY - M.pY + M.H, 0) }); return false; }, stop: function () { E.css('opacity', M.o); $().unbind('mousemove', J.drag).unbind('mouseup', J.stop); } }; var J = $.jqDnR, M = J.dnr, E = J.e, i = function (e, h, k) {
        return e.each(function () {
            h = (h) ? $(h, e) : e; h.bind('mousedown', { e: e, k: k }, function (v) {
                var d = v.data, p = {}; E = d.e; if (E.css('position') != 'relative') { try { E.position(p); } catch (e) { } }
                M = { X: p.left || f('left') || 0, Y: p.top || f('top') || 0, W: f('width') || E[0].scrollWidth || 0, H: f('height') || E[0].scrollHeight || 0, pX: v.pageX, pY: v.pageY, k: d.k, o: E.css('opacity') }; E.css({ opacity: 0.8 }); $().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop); return false;
            });
        });
    }, f = function (k) { return parseInt(E.css(k)) || false; };
})(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/*
* jqModal - Minimalist Modaling with jQuery
*   (http://dev.iceburg.net/jquery/jqModal/)
*
* Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
* 
* $Version: 03/01/2009 +r14
*/
(function ($) {
    $.fn.jqm = function (o) { var p = { overlay: 50, overlayClass: 'jqmOverlay', closeClass: 'jqmClose', trigger: '.jqModal', ajax: F, ajaxText: '', target: F, modal: F, toTop: F, onShow: F, onHide: F, onLoad: F }; return this.each(function () { if (this._jqm) return H[this._jqm].c = $.extend({}, H[this._jqm].c, o); s++; this._jqm = s; H[s] = { c: $.extend(p, $.jqm.params, o), a: F, w: $(this).addClass('jqmID' + s), s: s }; if (p.trigger) $(this).jqmAddTrigger(p.trigger); }); }; $.fn.jqmAddClose = function (e) { return hs(this, e, 'jqmHide'); }; $.fn.jqmAddTrigger = function (e) { return hs(this, e, 'jqmShow'); }; $.fn.jqmShow = function (t) { return this.each(function () { t = t || window.event; $.jqm.open(this._jqm, t); }); }; $.fn.jqmHide = function (t) { return this.each(function () { t = t || window.event; $.jqm.close(this._jqm, t) }); }; $.jqm = { hash: {}, open: function (s, t) {
        var h = H[s], c = h.c, cc = '.' + c.closeClass, z = (parseInt(h.w.css('z-index'))), z = (z > 0) ? z : 3000, o = $('<div></div>').css({ height: '100%', width: '100%', position: 'fixed', left: 0, top: 0, 'z-index': z - 1, opacity: c.overlay / 100 }); if (h.a) return F; h.t = t; h.a = true; h.w.css('z-index', z); if (c.modal) { if (!A[0]) L('bind'); A.push(s); }
        else if (c.overlay > 0) h.w.jqmAddClose(o); else o = F; h.o = (o) ? o.addClass(c.overlayClass).prependTo('body') : F; if (ie6) { $('html,body').css({ height: '100%', width: '100%' }); if (o) { o = o.css({ position: 'absolute' })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'"); } }
        if (c.ajax) { var r = c.target || h.w, u = c.ajax, r = (typeof r == 'string') ? $(r, h.w) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u; r.html(c.ajaxText).load(u, function () { if (c.onLoad) c.onLoad.call(this, h); if (cc) h.w.jqmAddClose($(cc, h.w)); e(h); }); }
        else if (cc) h.w.jqmAddClose($(cc, h.w)); if (c.toTop && h.o) h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o); (c.onShow) ? c.onShow(h) : h.w.show(); e(h); return F;
    }, close: function (s) {
        var h = H[s]; if (!h.a) return F; h.a = F; if (A[0]) { A.pop(); if (!A[0]) L('unbind'); }
        if (h.c.toTop && h.o) $('#jqmP' + h.w[0]._jqm).after(h.w).remove(); if (h.c.onHide) h.c.onHide(h); else { h.w.hide(); if (h.o) h.o.remove(); } return F;
    }, params: {}
    }; var s = 0, H = $.jqm.hash, A = [], ie6 = $.browser.msie && ($.browser.version == "6.0"), F = false, i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({ opacity: 0 }), e = function (h) { if (ie6) if (h.o) h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0]) h.w.prepend(i); f(h); }, f = function (h) { try { $(':input:visible', h.w)[0].focus(); } catch (_) { } }, L = function (t) { $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m); }, m = function (e) { var h = H[A[A.length - 1]], r = (!$(e.target).parents('.jqmID' + h.s)[0]); if (r) f(h); return !r; }, hs = function (w, t, c) { return w.each(function () { var s = this._jqm; $(t).each(function () { if (!this[c]) { this[c] = []; $(this).click(function () { for (var i in { jqmShow: 1, jqmHide: 1 }) for (var s in this[i]) if (H[this[i][s]]) H[this[i][s]].w[i](this); return F; }); } this[c].push(s); }); }); };
})(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/* imageareaselect */
(function ($) { var abs = Math.abs, max = Math.max, min = Math.min, round = Math.round; function div() { return $('<div/>') } $.imgAreaSelect = function (img, options) { var $img = $(img), imgLoaded, $box = div(), $area = div(), $border = div().add(div()).add(div()).add(div()), $outer = div().add(div()).add(div()).add(div()), $handles = $([]), $areaOpera, left, top, imgOfs, imgWidth, imgHeight, $parent, parOfs, zIndex = 0, position = 'absolute', startX, startY, scaleX, scaleY, resizeMargin = 10, resize, minWidth, minHeight, maxWidth, maxHeight, aspectRatio, shown, x1, y1, x2, y2, selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 }, docElem = document.documentElement, $p, d, i, o, w, h, adjusted; function viewX(x) { return x + imgOfs.left - parOfs.left } function viewY(y) { return y + imgOfs.top - parOfs.top } function selX(x) { return x - imgOfs.left + parOfs.left } function selY(y) { return y - imgOfs.top + parOfs.top } function evX(event) { return event.pageX - parOfs.left } function evY(event) { return event.pageY - parOfs.top } function getSelection(noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; return { x1: round(selection.x1 * sx), y1: round(selection.y1 * sy), x2: round(selection.x2 * sx), y2: round(selection.y2 * sy), width: round(selection.x2 * sx) - round(selection.x1 * sx), height: round(selection.y2 * sy) - round(selection.y1 * sy)} } function setSelection(x1, y1, x2, y2, noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; selection = { x1: round(x1 / sx), y1: round(y1 / sy), x2: round(x2 / sx), y2: round(y2 / sy) }; selection.width = selection.x2 - selection.x1; selection.height = selection.y2 - selection.y1 } function adjust() { if (!$img.width()) return; imgOfs = { left: round($img.offset().left), top: round($img.offset().top) }; imgWidth = $img.width(); imgHeight = $img.height(); minWidth = options.minWidth || 0; minHeight = options.minHeight || 0; maxWidth = min(options.maxWidth || 1 << 24, imgWidth); maxHeight = min(options.maxHeight || 1 << 24, imgHeight); if ($().jquery == '1.3.2' && position == 'fixed' && !docElem['getBoundingClientRect']) { imgOfs.top += max(document.body.scrollTop, docElem.scrollTop); imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft) } parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) + 1 ? { left: round($parent.offset().left) - $parent.scrollLeft(), top: round($parent.offset().top) - $parent.scrollTop()} : position == 'fixed' ? { left: $(document).scrollLeft(), top: $(document).scrollTop()} : { left: 0, top: 0 }; left = viewX(0); top = viewY(0); if (selection.x2 > imgWidth || selection.y2 > imgHeight) doResize() } function update(resetKeyPress) { if (!shown) return; $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) }).add($area).width(w = selection.width).height(h = selection.height); $area.add($border).add($handles).css({ left: 0, top: 0 }); $border.width(max(w - $border.outerWidth() + $border.innerWidth(), 0)).height(max(h - $border.outerHeight() + $border.innerHeight(), 0)); $($outer[0]).css({ left: left, top: top, width: selection.x1, height: imgHeight }); $($outer[1]).css({ left: left + selection.x1, top: top, width: w, height: selection.y1 }); $($outer[2]).css({ left: left + selection.x2, top: top, width: imgWidth - selection.x2, height: imgHeight }); $($outer[3]).css({ left: left + selection.x1, top: top + selection.y2, width: w, height: imgHeight - selection.y2 }); w -= $handles.outerWidth(); h -= $handles.outerHeight(); switch ($handles.length) { case 8: $($handles[4]).css({ left: w / 2 }); $($handles[5]).css({ left: w, top: h / 2 }); $($handles[6]).css({ left: w / 2, top: h }); $($handles[7]).css({ top: h / 2 }); case 4: $handles.slice(1, 3).css({ left: w }); $handles.slice(2, 4).css({ top: h }) } if (resetKeyPress !== false) { if ($.imgAreaSelect.keyPress != docKeyPress) $(document).unbind($.imgAreaSelect.keyPress, $.imgAreaSelect.onKeyPress); if (options.keys) $(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress = docKeyPress) } if ($.browser.msie && $border.outerWidth() - $border.innerWidth() == 2) { $border.css('margin', 0); setTimeout(function () { $border.css('margin', 'auto') }, 0) } } function doUpdate(resetKeyPress) { adjust(); update(resetKeyPress); x1 = viewX(selection.x1); y1 = viewY(selection.y1); x2 = viewX(selection.x2); y2 = viewY(selection.y2) } function hide($elem, fn) { options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide() } function areaMouseMove(event) { var x = selX(evX(event)) - selection.x1, y = selY(evY(event)) - selection.y1; if (!adjusted) { adjust(); adjusted = true; $box.one('mouseout', function () { adjusted = false }) } resize = ''; if (options.resizable) { if (y <= resizeMargin) resize = 'n'; else if (y >= selection.height - resizeMargin) resize = 's'; if (x <= resizeMargin) resize += 'w'; else if (x >= selection.width - resizeMargin) resize += 'e' } $box.css('cursor', resize ? resize + '-resize' : options.movable ? 'move' : ''); if ($areaOpera) $areaOpera.toggle() } function docMouseUp(event) { $('body').css('cursor', ''); if (options.autoHide || selection.width * selection.height == 0) hide($box.add($outer), function () { $(this).hide() }); options.onSelectEnd(img, getSelection()); $(document).unbind('mousemove', selectingMouseMove); $box.mousemove(areaMouseMove) } function areaMouseDown(event) { if (event.which != 1) return false; adjust(); if (resize) { $('body').css('cursor', resize + '-resize'); x1 = viewX(selection[/w/.test(resize) ? 'x2' : 'x1']); y1 = viewY(selection[/n/.test(resize) ? 'y2' : 'y1']); $(document).mousemove(selectingMouseMove).one('mouseup', docMouseUp); $box.unbind('mousemove', areaMouseMove) } else if (options.movable) { startX = left + selection.x1 - evX(event); startY = top + selection.y1 - evY(event); $box.unbind('mousemove', areaMouseMove); $(document).mousemove(movingMouseMove).one('mouseup', function () { options.onSelectEnd(img, getSelection()); $(document).unbind('mousemove', movingMouseMove); $box.mousemove(areaMouseMove) }) } else $img.mousedown(event); return false } function fixAspectRatio(xFirst) { if (aspectRatio) if (xFirst) { x2 = max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))); y2 = round(max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)))); x2 = round(x2) } else { y2 = max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))); x2 = round(max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)))); y2 = round(y2) } } function doResize() { x1 = min(x1, left + imgWidth); y1 = min(y1, top + imgHeight); if (abs(x2 - x1) < minWidth) { x2 = x1 - minWidth * (x2 < x1 || -1); if (x2 < left) x1 = left + minWidth; else if (x2 > left + imgWidth) x1 = left + imgWidth - minWidth } if (abs(y2 - y1) < minHeight) { y2 = y1 - minHeight * (y2 < y1 || -1); if (y2 < top) y1 = top + minHeight; else if (y2 > top + imgHeight) y1 = top + imgHeight - minHeight } x2 = max(left, min(x2, left + imgWidth)); y2 = max(top, min(y2, top + imgHeight)); fixAspectRatio(abs(x2 - x1) < abs(y2 - y1) * aspectRatio); if (abs(x2 - x1) > maxWidth) { x2 = x1 - maxWidth * (x2 < x1 || -1); fixAspectRatio() } if (abs(y2 - y1) > maxHeight) { y2 = y1 - maxHeight * (y2 < y1 || -1); fixAspectRatio(true) } selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)), y1: selY(min(y1, y2)), y2: selY(max(y1, y2)), width: abs(x2 - x1), height: abs(y2 - y1) }; update(); options.onSelectChange(img, getSelection()) } function selectingMouseMove(event) { x2 = resize == '' || /w|e/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2); y2 = resize == '' || /n|s/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2); doResize(); return false } function doMove(newX1, newY1) { x2 = (x1 = newX1) + selection.width; y2 = (y1 = newY1) + selection.height; $.extend(selection, { x1: selX(x1), y1: selY(y1), x2: selX(x2), y2: selY(y2) }); update(); options.onSelectChange(img, getSelection()) } function movingMouseMove(event) { x1 = max(left, min(startX + evX(event), left + imgWidth - selection.width)); y1 = max(top, min(startY + evY(event), top + imgHeight - selection.height)); doMove(x1, y1); event.preventDefault(); return false } function startSelection() { adjust(); x2 = x1; y2 = y1; doResize(); resize = ''; if ($outer.is(':not(:visible)')) $box.add($outer).hide().fadeIn(options.fadeSpeed || 0); shown = true; $(document).unbind('mouseup', cancelSelection).mousemove(selectingMouseMove).one('mouseup', docMouseUp); $box.unbind('mousemove', areaMouseMove); options.onSelectStart(img, getSelection()) } function cancelSelection() { $(document).unbind('mousemove', startSelection); hide($box.add($outer)); selection = { x1: selX(x1), y1: selY(y1), x2: selX(x1), y2: selY(y1), width: 0, height: 0 }; options.onSelectChange(img, getSelection()); options.onSelectEnd(img, getSelection()) } function imgMouseDown(event) { if (event.which != 1 || $outer.is(':animated')) return false; adjust(); startX = x1 = evX(event); startY = y1 = evY(event); $(document).one('mousemove', startSelection).one('mouseup', cancelSelection); return false } function windowResize() { doUpdate(false) } function imgLoad() { imgLoaded = true; setOptions(options = $.extend({ classPrefix: 'imgareaselect', movable: true, resizable: true, parent: 'body', onInit: function () { }, onSelectStart: function () { }, onSelectChange: function () { }, onSelectEnd: function () { } }, options)); $box.add($outer).css({ visibility: '' }); if (options.show) { shown = true; adjust(); update(); $box.add($outer).hide().fadeIn(options.fadeSpeed || 0) } setTimeout(function () { options.onInit(img, getSelection()) }, 0) } var docKeyPress = function (event) { var k = options.keys, d, t, key = event.keyCode; d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt : !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl : !isNaN(k.shift) && event.shiftKey ? k.shift : !isNaN(k.arrows) ? k.arrows : 10; if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) || (k.ctrl == 'resize' && event.ctrlKey) || (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey))) { switch (key) { case 37: d = -d; case 39: t = max(x1, x2); x1 = min(x1, x2); x2 = max(t + d, x1); fixAspectRatio(); break; case 38: d = -d; case 40: t = max(y1, y2); y1 = min(y1, y2); y2 = max(t + d, y1); fixAspectRatio(true); break; default: return } doResize() } else { x1 = min(x1, x2); y1 = min(y1, y2); switch (key) { case 37: doMove(max(x1 - d, left), y1); break; case 38: doMove(x1, max(y1 - d, top)); break; case 39: doMove(x1 + min(d, imgWidth - selX(x2)), y1); break; case 40: doMove(x1, y1 + min(d, imgHeight - selY(y2))); break; default: return } } return false }; function styleOptions($elem, props) { for (option in props) if (options[option] !== undefined) $elem.css(props[option], options[option]) } function setOptions(newOptions) { if (newOptions.parent) ($parent = $(newOptions.parent)).append($box.add($outer)); $.extend(options, newOptions); adjust(); if (newOptions.handles != null) { $handles.remove(); $handles = $([]); i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0; while (i--) $handles = $handles.add(div()); $handles.addClass(options.classPrefix + '-handle').css({ position: 'absolute', fontSize: 0, zIndex: zIndex + 1 || 1 }); if (!parseInt($handles.css('width'))) $handles.width(5).height(5); if (o = options.borderWidth) $handles.css({ borderWidth: o, borderStyle: 'solid' }); styleOptions($handles, { borderColor1: 'border-color', borderColor2: 'background-color', borderOpacity: 'opacity' }) } scaleX = options.imageWidth / imgWidth || 1; scaleY = options.imageHeight / imgHeight || 1; if (newOptions.x1 != null) { setSelection(newOptions.x1, newOptions.y1, newOptions.x2, newOptions.y2); newOptions.show = !newOptions.hide } if (newOptions.keys) options.keys = $.extend({ shift: 1, ctrl: 'resize' }, newOptions.keys); $outer.addClass(options.classPrefix + '-outer'); $area.addClass(options.classPrefix + '-selection'); for (i = 0; i++ < 4; ) $($border[i - 1]).addClass(options.classPrefix + '-border' + i); styleOptions($area, { selectionColor: 'background-color', selectionOpacity: 'opacity' }); styleOptions($border, { borderOpacity: 'opacity', borderWidth: 'border-width' }); styleOptions($outer, { outerColor: 'background-color', outerOpacity: 'opacity' }); if (o = options.borderColor1) $($border[0]).css({ borderStyle: 'solid', borderColor: o }); if (o = options.borderColor2) $($border[1]).css({ borderStyle: 'dashed', borderColor: o }); $box.append($area.add($border).add($handles).add($areaOpera)); if ($.browser.msie) { if (o = $outer.css('filter').match(/opacity=([0-9]+)/)) $outer.css('opacity', o[1] / 100); if (o = $border.css('filter').match(/opacity=([0-9]+)/)) $border.css('opacity', o[1] / 100) } if (newOptions.hide) hide($box.add($outer)); else if (newOptions.show && imgLoaded) { shown = true; $box.add($outer).fadeIn(options.fadeSpeed || 0); doUpdate() } aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1]; if (options.disable || options.enable === false) { $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown); $img.add($outer).unbind('mousedown', imgMouseDown); $(window).unbind('resize', windowResize) } else if (options.enable || options.disable === false) { if (options.resizable || options.movable) $box.mousemove(areaMouseMove).mousedown(areaMouseDown); if (!options.persistent) $img.add($outer).mousedown(imgMouseDown); $(window).resize(windowResize) } options.enable = options.disable = undefined } this.remove = function () { $img.unbind('mousedown', imgMouseDown); $box.add($outer).remove() }; this.getOptions = function () { return options }; this.setOptions = setOptions; this.getSelection = getSelection; this.setSelection = setSelection; this.update = doUpdate; $p = $img; while ($p.length) { zIndex = max(zIndex, !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex); if ($p.css('position') == 'fixed') position = 'fixed'; $p = $p.parent(':not(body)') } zIndex = options.zIndex || zIndex; if ($.browser.msie) $img.attr('unselectable', 'on'); $.imgAreaSelect.keyPress = $.browser.msie || $.browser.safari ? 'keydown' : 'keypress'; if ($.browser.opera) $areaOpera = div().css({ width: '100%', height: '100%', position: 'absolute', zIndex: zIndex + 2 || 2 }); $box.add($outer).css({ visibility: 'hidden', position: position, overflow: 'hidden', zIndex: zIndex || '0' }); $box.css({ zIndex: zIndex + 2 || 2 }); $area.add($border).css({ position: 'absolute', fontSize: 0 }); img.complete || img.readyState == 'complete' || !$img.is('img') ? imgLoad() : $img.one('load', imgLoad) }; $.fn.imgAreaSelect = function (options) { options = options || {}; this.each(function () { if ($(this).data('imgAreaSelect')) { if (options.remove) { $(this).data('imgAreaSelect').remove(); $(this).removeData('imgAreaSelect') } else $(this).data('imgAreaSelect').setOptions(options) } else if (!options.remove) { if (options.enable === undefined && options.disable === undefined) options.enable = true; $(this).data('imgAreaSelect', new $.imgAreaSelect(this, options)) } }); if (options.instance) return $(this).data('imgAreaSelect'); return this } })(jQuery);

/*
* timeago: a jQuery plugin, version: 0.9.2 (2010-09-14)
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
* Copyright (c) 2008-2010, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)
*/
(function ($) {
    $.timeago = function (timestamp) { if (timestamp instanceof Date) return inWords(timestamp); else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); else return inWords($.timeago.datetime(timestamp)); }; var $t = $.timeago; $.extend($.timeago, { settings: { refreshMillis: 60000, allowFuture: false, strings: { prefixAgo: null, prefixFromNow: null, suffixAgo: "ago", suffixFromNow: "from now", seconds: "less than a minute", minute: "about a minute", minutes: "%d minutes", hour: "about an hour", hours: "about %d hours", day: "a day", days: "%d days", month: "about a month", months: "%d months", year: "about a year", years: "%d years", numbers: []} }, inWords: function (distanceMillis) {
        var $l = this.settings.strings; var prefix = $l.prefixAgo; var suffix = $l.suffixAgo; if (this.settings.allowFuture) {
            if (distanceMillis < 0) { prefix = $l.prefixFromNow; suffix = $l.suffixFromNow; }
            distanceMillis = Math.abs(distanceMillis);
        }
        var seconds = distanceMillis / 1000; var minutes = seconds / 60; var hours = minutes / 60; var days = hours / 24; var years = days / 365; function substitute(stringOrFunction, number) { var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; var value = ($l.numbers && $l.numbers[number]) || number; return string.replace(/%d/i, value); }
        var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || seconds < 90 && substitute($l.minute, 1) || minutes < 45 && substitute($l.minutes, Math.round(minutes)) || minutes < 90 && substitute($l.hour, 1) || hours < 24 && substitute($l.hours, Math.round(hours)) || hours < 48 && substitute($l.day, 1) || days < 30 && substitute($l.days, Math.floor(days)) || days < 60 && substitute($l.month, 1) || days < 365 && substitute($l.months, Math.floor(days / 30)) || years < 2 && substitute($l.year, 1) || substitute($l.years, Math.floor(years)); return $.trim([prefix, words, suffix].join(" "));
    }, parse: function (iso8601) { var s = $.trim(iso8601); s = s.replace(/\.\d\d\d+/, ""); s = s.replace(/-/, "/").replace(/-/, "/"); s = s.replace(/T/, " ").replace(/Z/, " UTC"); s = s.replace(/([\+-]\d\d)\:?(\d\d)/, " $1$2"); return new Date(s); }, datetime: function (elem) { var isTime = $(elem).get(0).tagName.toLowerCase() == "time"; var iso8601 = isTime ? $(elem).attr("datetime") : $(elem).attr("title"); return $t.parse(iso8601); }
    }); $.fn.timeago = function () {
        var self = this; self.each(refresh); var $s = $t.settings; if ($s.refreshMillis > 0) { setInterval(function () { self.each(refresh); }, $s.refreshMillis); }
        return self;
    }; function refresh() {
        var data = prepareData(this); if (!isNaN(data.datetime)) { $(this).text(inWords(data.datetime)); }
        return this;
    }
    function prepareData(element) {
        element = $(element); if (!element.data("timeago")) { element.data("timeago", { datetime: $t.datetime(element) }); var text = $.trim(element.text()); if (text.length > 0) element.attr("title", text); }
        return element.data("timeago");
    }
    function inWords(date) { return $t.inWords(distance(date)); }
    function distance(date) { return (new Date().getTime() - date.getTime()); }
    document.createElement("abbr"); document.createElement("time");
})(jQuery); var is = { ie: navigator.appName == 'Microsoft Internet Explorer', java: navigator.javaEnabled(), ns: navigator.appName == 'Netscape', ua: navigator.userAgent.toLowerCase(), version: parseFloat(navigator.appVersion.substr(21)) || parseFloat(navigator.appVersion), win: navigator.platform == 'Win32' }
is.mac = is.ua.indexOf('mac') >= 0; if (is.ua.indexOf('opera') >= 0) { is.ie = is.ns = false; is.opera = true; }
if (is.ua.indexOf('gecko') >= 0) { is.ie = is.ns = false; is.gecko = true; }

//-------------------------------------------------------------------------------------------------------------------

/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function (a) {
    a.event.special.textchange = { setup: function () { a(this).data("lastValue", this.contentEditable === "true" ? a(this).html() : a(this).val()); a(this).bind("keyup.textchange", a.event.special.textchange.handler); a(this).bind("cut.textchange paste.textchange input.textchange", a.event.special.textchange.delayedHandler) }, teardown: function () { a(this).unbind(".textchange") }, handler: function () { a.event.special.textchange.triggerIfChanged(a(this)) }, delayedHandler: function () {
        var b = a(this); setTimeout(function () { a.event.special.textchange.triggerIfChanged(b) },
 25)
    }, triggerIfChanged: function (b) { var c = b[0].contentEditable === "true" ? b.html() : b.val(); if (c !== b.data("lastValue")) { b.trigger("textchange", b.data("lastValue")); b.data("lastValue", c) } } 
    }; a.event.special.hastext = { setup: function () { a(this).bind("textchange", a.event.special.hastext.handler) }, teardown: function () { a(this).unbind("textchange", a.event.special.hastext.handler) }, handler: function (b, c) { c === "" && c !== a(this).val() && a(this).trigger("hastext") } }; a.event.special.notext = { setup: function () {
        a(this).bind("textchange",
 a.event.special.notext.handler)
    }, teardown: function () { a(this).unbind("textchange", a.event.special.notext.handler) }, handler: function (b, c) { a(this).val() === "" && a(this).val() !== c && a(this).trigger("notext") } 
    }
})(jQuery);

/* elastic */
(function (jQuery) {
    jQuery.fn.extend({ elastic: function () {
        var mimics = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontSize', 'lineHeight', 'fontFamily', 'width', 'fontWeight']; return this.each(function () {
            if (this.type != 'textarea') { return false; }
            var $textarea = jQuery(this), $twin = jQuery('<div />').css({ 'position': 'absolute', 'display': 'none', 'word-wrap': 'break-word' }), lineHeight = parseInt($textarea.css('line-height'), 10) || parseInt($textarea.css('font-size'), '10'), minheight = parseInt($textarea.css('height'), 10) || lineHeight * 3, maxheight = parseInt($textarea.css('max-height'), 10) || Number.MAX_VALUE, goalheight = 0, i = 0; if (maxheight < 0) { maxheight = Number.MAX_VALUE; }
            $twin.appendTo($textarea.parent()); var i = mimics.length; while (i--) { $twin.css(mimics[i].toString(), $textarea.css(mimics[i].toString())); }
            function setHeightAndOverflow(height, overflow) { curratedHeight = Math.floor(parseInt(height, 10)); if ($textarea.height() != curratedHeight) { $textarea.css({ 'height': curratedHeight + 'px', 'overflow': overflow }); } }
            function update() { var textareaContent = $textarea.val().replace(/&/g, '&amp;').replace(/  /g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\n/g, '<br />'); var twinContent = $twin.html(); if (textareaContent + '&nbsp;' != twinContent) { $twin.html(textareaContent + '&nbsp;'); if (Math.abs($twin.height() + lineHeight - $textarea.height()) > 3) { var goalheight = $twin.height() + lineHeight; if (goalheight >= maxheight) { setHeightAndOverflow(maxheight, 'auto'); } else if (goalheight <= minheight) { setHeightAndOverflow(minheight, 'hidden'); } else { setHeightAndOverflow(goalheight, 'hidden'); } } } }
            $textarea.css({ 'overflow': 'hidden' }); $textarea.keyup(function () { update(); }); $textarea.live('input paste', function (e) { setTimeout(update, 250); }); update();
        });
    } 
    });
})(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/* default value */
(function (l) { l.fn.extend({ defaultValue: function (o, i) { var j = o || {}; var k = l.extend({ value: j.value || null }, j); return this.each(function (b, c) { var d = $(this); var e = k.value || d.attr('rel'); var f = { 'input': d }; var g = createClone(); f.clone = g; g.insertAfter(d); var h = function () { if (d.val().length <= 0) { g.show(); d.hide() } else { g.hide(); d.show() } }; d.bind('blur', h); function createClone() { var a; if (d.context.nodeName.toLowerCase() == 'input') { a = l("<input />").attr({ 'type': 'text' }) } else if (d.context.nodeName.toLowerCase() == 'textarea') { a = l("<textarea />") } a.attr({ 'value': e, 'class': d.attr('class') + ' empty', 'size': d.attr('size'), 'style': d.attr('style'), 'tabindex': d.attr('tabindex'), 'name': 'defaultvalue-clone-' + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) }); a.focus(function () { a.hide(); d.show(); setTimeout(function () { d.focus() }, 1) }); return a } h(); if (i) { i(f) } }) } }) })(jQuery);

//-------------------------------------------------------------------------------------------------------------------

/* maxlength for textareas */
(function ($) {
    $.setMaxLength = function () {
        $("textarea[maxLength][label]")
                .keypress(function (event) {
                    var length = $(this).attr("maxLength") - $(this).val().length;
                    if (length == 0)
                        return (event.which == 8);
                })
                .keyup(function (event) {
                    var length = $(this).attr("maxLength") - $(this).val().length;
                    var label = $(this).attr("label");

                    if (length == $(this).attr("maxLength"))
                        $(label).html("M&aacute;ximo " + $(this).attr("maxLength") + " caracteres.");
                    else if (length >= 0)
                        $(label).html("Quedan " + length + " caracteres disponibles.");
                    else {
                        $(this).val($(this).val().substring(0, $(this).attr("maxLength")));
                        return (event.which == 8);
                    }
                });

        $("textarea[maxLength]")
            .keypress(function (event) {
                var length = $(this).attr("maxLength") - $(this).val().length;

                if (length == 0 && (event.keyCode!=37 && event.keyCode!=38 && event.keyCode!=39 && event.keyCode!=40))                
                    return (event.which == 8);
            })
            .keyup(function (event) {
                var length = $(this).attr("maxLength") - $(this).val().length;
                var label = $(this).attr("label");

                if (length < 0) {
                    $(this).val($(this).val().substring(0, $(this).attr("maxLength")));
                    return (event.which == 8);
                }
            });
    }
})(jQuery);

//---------------------------------------------------------------------------------------------------------------------

/* Copyright (c) 2004-2010, GreyWyvern
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

Neither the name of GreyWyvern.com nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var VKI_attach, VKI_close; function VKI_buildKeyboardInputs() {
    var self = this; this.VKI_showVersion = true; this.VKI_target = this.VKI_visible = false;
    this.VKI_shift = this.VKI_shiftlock = false; this.VKI_altgr = this.VKI_altgrlock = false; this.VKI_dead = false;
    this.VKI_deadkeysOn = false; this.VKI_kt = "US"; this.VKI_clearPasswords = false; this.VKI_imageURI = "/Content/img/Comun/keyboard.gif";
    this.VKI_clickless = 0; this.VKI_keyCenter = 3; this.VKI_isIE = false; this.VKI_isIE6 = false; this.VKI_isIElt8 = false; this.VKI_isMoz = (navigator.product == "Gecko");
    this.VKI_isWebKit = RegExp("KHTML").test(navigator.userAgent); this.VKI_layout = {}; this.VKI_layout.Arabic = [[["\u0630", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "\u003c"], ["\u062f", "\u003e"], ["\u005c", "\u007c"]], [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "\u005d"], ["\u0628", "\u005b"], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\u002f"], ["\u0643", "\u003a"], ["\u0637", "\u0022"], ["Enter", "Enter"]], [["Shift", "Shift"], ["\u0626", "\u007e"], ["\u0621", "\u0652"], ["\u0624", "\u007d"], ["\u0631", "\u007b"], ["\u0644", "\u0644"], ["\u0649", "\u0622"], ["\u0629", "\u2019"], ["\u0648", "\u002c"], ["\u0632", "\u002e"], ["\u0638", "\u061f"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_layout.Belarusian = [[["\u0451", "\u0401"], ["1", "!"], ["2", '"'], ["3", "\u2116"], ["4", ";"], ["5", "%"], ["6", ":"], ["7", "?"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043a", "\u041a"], ["\u0435", "\u0415"], ["\u043d", "\u041d"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u045e", "\u040e"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["'", "'"], ["\\", "/"]], [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044b", "\u042b"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043f", "\u041f"], ["\u0440", "\u0420"], ["\u043e", "\u041e"], ["\u043b", "\u041b"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044d", "\u042d"], ["Enter", "Enter"]], [["Shift", "Shift"], ["/", "|"], ["\u044f", "\u042f"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043c", "\u041c"], ["\u0456", "\u0406"], ["\u0442", "\u0422"], ["\u044c", "\u042c"], ["\u0431", "\u0411"], ["\u044e", "\u042e"], [".", ","], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Belgian = [[["\u00b2", "\u00b3"], ["&", "1", "|"], ["\u00e9", "2", "@"], ['"', "3", "#"], ["'", "4"], ["(", "5"], ["\u00a7", "6", "^"], ["\u00e8", "7"], ["!", "8"], ["\u00e7", "9", "{"], ["\u00e0", "0", "}"], [")", "\u00b0"], ["-", "_"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u005e", "\u00a8", "["], ["$", "*", "]"], ["Enter", "Enter"]], [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%", "\u00b4"], ["\u03bc", "\u00a3", "`"]], [["Shift", "Shift"], ["<", ">", "\\"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["=", "+", "~"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout['Bulgarian Ph'] = [[["\u0447", "\u0427"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u044F", "\u042F"], ["\u0432", "\u0412"], ["\u0435", "\u0415"], ["\u0440", "\u0420"], ["\u0442", "\u0422"], ["\u044A", "\u042A"], ["\u0443", "\u0423"], ["\u0438", "\u0418"], ["\u043E", "\u041E"], ["\u043F", "\u041F"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u044E", "\u042E"]], [["Caps", "Caps"], ["\u0430", "\u0410"], ["\u0441", "\u0421"], ["\u0434", "\u0414"], ["\u0444", "\u0424"], ["\u0433", "\u0413"], ["\u0445", "\u0425"], ["\u0439", "\u0419"], ["\u043A", "\u041A"], ["\u043B", "\u041B"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], [["Shift", "Shift"], ["\u0437", "\u0417"], ["\u044C", "\u042C"], ["\u0446", "\u0426"], ["\u0436", "\u0416"], ["\u0431", "\u0411"], ["\u043D", "\u041D"], ["\u043C", "\u041C"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Burmese = [[["\u1039`", "~"], ["\u1041", "\u100D"], ["\u1042", "\u100E"], ["\u1043", "\u100B"], ["\u1044", "\u1000\u103B\u1015\u103A"], ["\u1045", "%"], ["\u1046", "\u002F"], ["\u1047", "\u101B"], ["\u1048", "\u1002"], ["\u1049", "("], ["\u1040", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u1006", "\u1029"], ["\u1010", "\u1040"], ["\u1014", "\u103F"], ["\u1019", "\u1023"], ["\u1021", "\u1024"], ["\u1015", "\u104C"], ["\u1000", "\u1009"], ["\u1004", "\u104D"], ["\u101E", "\u1025"], ["\u1005", "\u100F"], ["\u101F", "\u1027"], ["\u2018", "\u2019"], ["\u104F", "\u100B\u1039\u100C"]], [["Caps", "Caps"], ["\u200B\u1031", "\u1017"], ["\u200B\u103B", "\u200B\u103E"], ["\u200B\u102D", "\u200B\u102E"], ["\u200B\u103A", "\u1004\u103A\u1039\u200B"], ["\u200B\u102B", "\u200B\u103D"], ["\u200B\u1037", "\u200B\u1036"], ["\u200B\u103C", "\u200B\u1032"], ["\u200B\u102F", "\u200B\u102F"], ["\u200B\u1030", "\u200B\u1030"], ["\u200B\u1038", "\u200B\u102B\u103A"], ["\u1012", "\u1013"], ["Enter", "Enter"]], [["Shift", "Shift"], ["\u1016", "\u1007"], ["\u1011", "\u100C"], ["\u1001", "\u1003"], ["\u101C", "\u1020"], ["\u1018", "\u1026"], ["\u100A", "\u1008"], ["\u200B\u102C", "\u102A"], ["\u101A", "\u101B"], ["\u002E", "\u101B"], ["\u104B", "\u104A"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Czech = [[[";", "\u00b0", "`", "~"], ["+", "1", "!"], ["\u011B", "2", "@"], ["\u0161", "3", "#"], ["\u010D", "4", "$"], ["\u0159", "5", "%"], ["\u017E", "6", "^"], ["\u00FD", "7", "&"], ["\u00E1", "8", "*"], ["\u00ED", "9", "("], ["\u00E9", "0", ")"], ["=", "%", "-", "_"], ["\u00B4", "\u02c7", "=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00FA", "/", "[", "{"], [")", "(", "]", "}"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u016F", '"', ";", ":"], ["\u00A7", "!", "\u00a4", "^"], ["\u00A8", "'", "\\", "|"]], [["Shift", "Shift"], ["\\", "|", "", "\u02dd"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "?", "<", "\u00d7"], [".", ":", ">", "\u00f7"], ["-", "_", "/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_layout.Danish = [[["\u00bd", "\u00a7"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%", "\u20ac"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?"], ["\u00b4", "`", "|"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00e6", "\u00c6"], ["\u00f8", "\u00d8"], ["'", "*"]], [["Shift", "Shift"], ["<", ">", "\\"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Dutch = [[["@", "\u00a7", "\u00ac"], ["1", "!", "\u00b9"], ["2", '"', "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00bc"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "_", "\u00a3"], ["8", "(", "{"], ["9", ")", "}"], ["0", "'"], ["/", "?", "\\"], ["\u00b0", "~", "\u00b8"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R", "\u00b6"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00a8", "^"], ["*", "|"], ["<", ">"]], [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["+", "\u00b1"], ["\u00b4", "\u0060"], ["Enter", "Enter"]], [["Shift", "Shift"], ["]", "[", "\u00a6"], ["z", "Z", "\u00ab"], ["x", "X", "\u00bb"], ["c", "C", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":", "\u00b7"], ["-", "="], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Dvorak = [[["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["[", "{"], ["]", "}"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["'", '"'], [",", "<"], [".", ">"], ["p", "P"], ["y", "Y"], ["f", "F"], ["g", "G"], ["c", "C"], ["r", "R"], ["l", "L"], ["/", "?"], ["=", "+"], ["\\", "|"]], [["Caps", "Caps"], ["a", "A"], ["o", "O"], ["e", "E"], ["u", "U"], ["i", "I"], ["d", "D"], ["h", "H"], ["t", "T"], ["n", "N"], ["s", "S"], ["-", "_"], ["Enter", "Enter"]], [["Shift", "Shift"], [";", ":"], ["q", "Q"], ["j", "J"], ["k", "K"], ["x", "X"], ["b", "B"], ["m", "M"], ["w", "W"], ["v", "V"], ["z", "Z"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Farsi = [[["\u067e", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "\u003c"], ["\u0686", "\u003e"], ["\u0698", "\u007c"]], [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "\u005d"], ["\u0628", "\u005b"], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\u005c"], ["\u06af", "\u003a"], ["\u0643", "\u0022"], ["Enter", "Enter"]], [["Shift", "Shift"], ["\u0626", "\u007e"], ["\u0621", "\u0652"], ["\u0632", "\u007d"], ["\u0631", "\u007b"], ["\u0630", "\u0644"], ["\u062f", "\u0622"], ["\u0626", "\u0621"], ["\u0648", "\u002c"], [".", "\u002e"], ["/", "\u061f"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_layout.French = [[["\u00b2", "\u00b3"], ["&", "1"], ["\u00e9", "2", "~"], ['"', "3", "#"], ["'", "4", "{"], ["(", "5", "["], ["-", "6", "|"], ["\u00e8", "7", "\u0060"], ["_", "8", "\\"], ["\u00e7", "9", "\u005e"], ["\u00e0", "0", "\u0040"], [")", "\u00b0", "]"], ["=", "+", "}"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["^", "\u00a8"], ["$", "\u00a3", "\u00a4"], ["Enter", "Enter"]], [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%"], ["*", "\u03bc"]], [["Shift", "Shift"], ["<", ">"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["!", "\u00a7"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.German = [[["\u005e", "\u00b0"], ["1", "!"], ["2", '"', "\u00b2"], ["3", "\u00a7", "\u00b3"], ["4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["\u00df", "?", "\\"], ["\u00b4", "\u0060"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\u0040"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00fc", "\u00dc"], ["+", "*", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f6", "\u00d6"], ["\u00e4", "\u00c4"], ["#", "'"]], [["Shift", "Shift"], ["<", ">", "\u00a6"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Greek = [[["`", "~"], ["1", "!"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a3"], ["5", "%", "\u00a7"], ["6", "^", "\u00b6"], ["7", "&"], ["8", "*", "\u00a4"], ["9", "(", "\u00a6"], ["0", ")", "\u00ba"], ["-", "_", "\u00b1"], ["=", "+", "\u00bd"], ["Bksp", "Bksp"]], [["Tab", "Tab"], [";", ":"], ["\u03c2", "^"], ["\u03b5", "\u0395"], ["\u03c1", "\u03a1"], ["\u03c4", "\u03a4"], ["\u03c5", "\u03a5"], ["\u03b8", "\u0398"], ["\u03b9", "\u0399"], ["\u03bf", "\u039f"], ["\u03c0", "\u03a0"], ["[", "{", "\u201c"], ["]", "}", "\u201d"], ["Enter", "Enter"]], [["Caps", "Caps"], ["\u03b1", "\u0391"], ["\u03c3", "\u03a3"], ["\u03b4", "\u0394"], ["\u03c6", "\u03a6"], ["\u03b3", "\u0393"], ["\u03b7", "\u0397"], ["\u03be", "\u039e"], ["\u03ba", "\u039a"], ["\u03bb", "\u039b"], ["\u0384", "\u00a8", "\u0385"], ["'", '"'], ["\\", "|", "\u00ac"]], [["Shift", "Shift"], ["<", ">"], ["\u03b6", "\u0396"], ["\u03c7", "\u03a7"], ["\u03c8", "\u03a8"], ["\u03c9", "\u03a9"], ["\u03b2", "\u0392"], ["\u03bd", "\u039d"], ["\u03bc", "\u039c"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Hebrew = [[["~", "`"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$", "\u20aa"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", ")"], ["0", "("], ["-", "_"], ["=", "+"], ["\\", "|"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["/", "Q"], ["'", "W"], ["\u05e7", "E", "\u20ac"], ["\u05e8", "R"], ["\u05d0", "T"], ["\u05d8", "Y"], ["\u05d5", "U", "\u05f0"], ["\u05df", "I"], ["\u05dd", "O"], ["\u05e4", "P"], ["]", "}"], ["[", "{"]], [["Caps", "Caps"], ["\u05e9", "A"], ["\u05d3", "S"], ["\u05d2", "D"], ["\u05db", "F"], ["\u05e2", "G"], ["\u05d9", "H", "\u05f2"], ["\u05d7", "J", "\u05f1"], ["\u05dc", "K"], ["\u05da", "L"], ["\u05e3", ":"], [",", '"'], ["Enter", "Enter"]], [["Shift", "Shift"], ["\u05d6", "Z"], ["\u05e1", "X"], ["\u05d1", "C"], ["\u05d4", "V"], ["\u05e0", "B"], ["\u05de", "N"], ["\u05e6", "M"], ["\u05ea", ">"], ["\u05e5", "<"], [".", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Hungarian = [[["0", "\u00a7"], ["1", "'", "\u007e"], ["2", '"', "\u02c7"], ["3", "+", "\u02c6"], ["4", "!", "\u02d8"], ["5", "%", "\u00b0"], ["6", "/", "\u02db"], ["7", "=", "\u0060"], ["8", "(", "\u02d9"], ["9", ")", "\u00b4"], ["\u00f6", "\u00d6", "\u02dd"], ["\u00fc", "\u00dc", "\u00a8"], ["\u00f3", "\u00d3", "\u00b8"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\u005c"], ["w", "W", "\u007c"], ["e", "E", "\u00c4"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U", "\u20ac"], ["i", "I", "\u00cd"], ["o", "O"], ["p", "P"], ["\u0151", "\u0150", "\u00f7"], ["\u00fa", "\u00da", "\u00d7"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A", "\u00e4"], ["s", "S", "\u0111"], ["d", "D", "\u0110"], ["f", "F", "\u005b"], ["g", "G", "\u005d"], ["h", "H"], ["j", "J", "\u00ed"], ["k", "K", "\u0141"], ["l", "L", "\u0142"], ["\u00e9", "\u00c9", "\u0024"], ["\u00e1", "\u00c1", "\u00df"], ["\u0171", "\u0170", "\u00a4"]], [["Shift", "Shift"], ["\u00ed", "\u00cd", "\u003c"], ["y", "Y", "\u003e"], ["x", "X", "\u0023"], ["c", "C", "\u0026"], ["v", "V", "\u0040"], ["b", "B", "\u007b"], ["n", "N", "\u007d"], ["m", "M", "\u003c"], [",", "?", "\u003b"], [".", ":", "\u003e"], ["-", "_", "\u002a"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Italian = [[["\u005c", "\u007c"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "&"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00ec", "\u005e"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e8", "\u00e9", "[", "{"], ["+", "*", "]", "}"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f2", "\u00e7", "@"], ["\u00e0", "\u00b0", "#"], ["\u00f9", "\u00a7"]], [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Kazakh = [[["(", ")"], ['"', "!"], ["\u04d9", "\u04d8"], ["\u0456", "\u0406"], ["\u04a3", "\u04a2"], ["\u0493", "\u0492"], [",", ";"], [".", ":"], ["\u04af", "\u04ae"], ["\u04b1", "\u04b0"], ["\u049b", "\u049a"], ["\u04e9", "\u04e8"], ["\u04bb", "\u04ba"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["\\", "/"]], [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044B", "\u042B"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["Enter", "Enter"]], [["Shift", "Shift"], ["\\", "|"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], ["\u2116", "?"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Lithuanian = [[["`", "~"], ["\u0105", "\u0104"], ["\u010D", "\u010C"], ["\u0119", "\u0118"], ["\u0117", "\u0116"], ["\u012F", "\u012E"], ["\u0161", "\u0160"], ["\u0173", "\u0172"], ["\u016B", "\u016A"], ["\u201E", "("], ["\u201C", ")"], ["-", "_"], ["\u017E", "\u017D"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["\\", "|"]], [["Shift", "Shift"], ["\u2013", "\u20AC"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.Norwegian = [[["|", "\u00a7"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?"], ["\\", "`", "\u00b4"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f8", "\u00d8"], ["\u00e6", "\u00c6"], ["'", "*"]], [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Numpad = [[["$"], ["\u00a3"], ["\u20ac"], ["\u00a5"], ["/"], ["^"], ["Bksp", "Bksp"]], [["."], ["7"], ["8"], ["9"], ["*"], ["<"], ["("], ["["]], [["="], ["4"], ["5"], ["6"], ["-"], [">"], [")"], ["]"]], [["0"], ["1"], ["2"], ["3"], ["+"], ["Enter", "Enter"]], [[" "]]];
    this.VKI_layout.Numpad.DDK = true; this.VKI_layout.Pinyin = [[["`", "~", "\u4e93", "\u301C"], ["1", "!", "\uFF62"], ["2", "@", "\uFF63"], ["3", "#", "\u301D"], ["4", "$", "\u301E"], ["5", "%", "\u301F"], ["6", "^", "\u3008"], ["7", "&", "\u3009"], ["8", "*", "\u302F"], ["9", "(", "\u300A"], ["0", ")", "\u300B"], ["-", "_", "\u300E"], ["=", "+", "\u300F"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\u0101", "\u0100"], ["w", "W", "\u00E1", "\u00C1"], ["e", "E", "\u01CE", "\u01CD"], ["r", "R", "\u00E0", "\u00C0"], ["t", "T", "\u0113", "\u0112"], ["y", "Y", "\u00E9", "\u00C9"], ["u", "U", "\u011B", "\u011A"], ["i", "I", "\u00E8", "\u00C8"], ["o", "O", "\u012B", "\u012A"], ["p", "P", "\u00ED", "\u00CD"], ["[", "{", "\u01D0", "\u01CF"], ["]", "}", "\u00EC", "\u00CC"], ["\\", "|", "\u3020"]], [["Caps", "Caps"], ["a", "A", "\u014D", "\u014C"], ["s", "S", "\u00F3", "\u00D3"], ["d", "D", "\u01D2", "\u01D1"], ["f", "F", "\u00F2", "\u00D2"], ["g", "G", "\u00fc", "\u00dc"], ["h", "H", "\u016B", "\u016A"], ["j", "J", "\u00FA", "\u00DA"], ["k", "K", "\u01D4", "\u01D3"], ["l", "L", "\u00F9", "\u00D9"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], [["Shift", "Shift"], ["z", "Z", "\u01D6", "\u01D5"], ["x", "X", "\u01D8", "\u01D7"], ["c", "C", "\u01DA", "\u01D9"], ["v", "V", "\u01DC", "\u01DB"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<", "\u3001"], [".", ">", "\u3002"], ["/", "?"], ["Shift", "Shift"]], [["AltLk", "AltLk"], [" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_layout["Polish Prog"] = [[["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u0119", "\u0118"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], [["Caps", "Caps"], ["a", "A", "\u0105", "\u0104"], ["s", "S", "\u015b", "\u015a"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u0142", "\u0141"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], [["Shift", "Shift"], ["z", "Z", "\u017c", "\u017b"], ["x", "X", "\u017a", "\u0179"], ["c", "C", "\u0107", "\u0106"], ["v", "V"], ["b", "B"], ["n", "N", "\u0144", "\u0143"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_layout.Portuguese = [[["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00e7", "\u00c7"], [";", ":"], ["'", "@"], ["#", "~"]], [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Romanian = [[["\u201E", "\u201D", "\u0060", "~"], ["1", "!", "~"], ["2", "\u0040", "\u02C7"], ["3", "#", "\u005E"], ["4", "$", "\u02D8"], ["5", "%", "\u00B0"], ["6", "\u005E", "\u02DB"], ["7", "&", "\u0060"], ["8", "*", "\u02D9"], ["9", "(", "\u00B4"], ["0", ")", "\u02DD"], ["-", "_", "\u00A8"], ["=", "+", "\u00B8", "\u00B1"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P", "\u00A7"], ["\u0103", "\u0102", "[", "{"], ["\u00EE", "\u00CE", "]", "}"], ["\u00E2", "\u00C2", "\\", "|"]], [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u00df"], ["d", "D", "\u00f0", "\u00D0"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u0142", "\u0141"], [(this.VKI_isIElt8) ? "\u015F" : "\u0219", (this.VKI_isIElt8) ? "\u015E" : "\u0218", ";", ":"], [(this.VKI_isIElt8) ? "\u0163" : "\u021B", (this.VKI_isIElt8) ? "\u0162" : "\u021A", "\'", "\""], ["Enter", "Enter"]], [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C", "\u00A9"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";", "<", "\u00AB"], [".", ":", ">", "\u00BB"], ["/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Russian = [[["\u0451", "\u0401"], ["1", "!"], ["2", '"'], ["3", "\u2116"], ["4", ";"], ["5", "%"], ["6", ":"], ["7", "?"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["Enter", "Enter"]], [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044B", "\u042B"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["\\", "/"]], [["Shift", "Shift"], ["/", "|"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], [".", ","], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout.SerbianCyr = [[["`", "~"], ["1", "!"], ["2", '"'], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "&"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["+", "*"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["\u0459", "\u0409"], ["\u045a", "\u040a"], ["\u0435", "\u0415", "\u20ac"], ["\u0440", "\u0420"], ["\u0442", "\u0422"], ["\u0437", "\u0417"], ["\u0443", "\u0423"], ["\u0438", "\u0418"], ["\u043e", "\u041e"], ["\u043f", "\u041f"], ["\u0448", "\u0428"], ["\u0452", "\u0402"], ["Enter", "Enter"]], [["Caps", "Caps"], ["\u0430", "\u0410"], ["\u0441", "\u0421"], ["\u0434", "\u0414"], ["\u0444", "\u0424"], ["\u0433", "\u0413"], ["\u0445", "\u0425"], ["\u0458", "\u0408"], ["\u043a", "\u041a"], ["\u043b", "\u041b"], ["\u0447", "\u0427"], ["\u045b", "\u040b"], ["\u0436", "\u0416"]], [["Shift", "Shift"], ["<", ">"], ["\u0455", "\u0405"], ["\u045f", "\u040f"], ["\u0446", "\u0426"], ["\u0432", "\u0412"], ["\u0431", "\u0411"], ["\u043d", "\u041d"], ["\u043c", "\u041c"], [",", ";", "<"], [".", ":", ">"], ["-", "_", "\u00a9"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.SerbianLat = [[["\u201a", "~"], ["1", "!", "~"], ["2", '"', "\u02c7"], ["3", "#", "^"], ["4", "$", "\u02d8"], ["5", "%", "\u00b0"], ["6", "&", "\u02db"], ["7", "/", "`"], ["8", "(", "\u02d9"], ["9", ")", "\u00b4"], ["0", "=", "\u02dd"], ["'", "?", "\u00a8"], ["+", "*", "\u00b8"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W", "|"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0161", "\u0160", "\u00f7"], ["\u0111", "\u0110", "\u00d7"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u010d", "\u010c"], ["\u0107", "\u0106", "\u00df"], ["\u017e", "\u017d", "\u00a4"]], [["Shift", "Shift"], ["<", ">"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V", "@"], ["b", "B", "{", ], ["n", "N", "}"], ["m", "M", "\u00a7"], [",", ";", "<"], [".", ":", ">"], ["-", "_", "\u00a9"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Slovak = [[[";", "\u00b0"], ["+", "1", "~"], ["\u013E", "2", "\u02C7"], ["\u0161", "3", "\u005E"], ["\u010D", "4", "\u02D8"], ["\u0165", "5", "\u00B0"], ["\u017E", "6", "\u02DB"], ["\u00FD", "7", "\u0060"], ["\u00E1", "8", "\u02D9"], ["\u00ED", "9", "\u00B4"], ["\u00E9", "0", "\u02DD"], ["=", "%", "\u00A8"], ["\u00B4", "\u02c7", "\u00B8"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\u005C"], ["w", "W", "\u007C"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P", "\u0027"], ["\u00FA", "/", "\u00F7"], ["\u00E4", "(", "\u00D7"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u0111"], ["d", "D", "\u0110"], ["f", "F", "\u005B"], ["g", "G", "\u005D"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u00F4", '"', "\u0024"], ["\u00A7", "!", "\u00DF", ], ["\u0148", ")", "\u00A4"]], [["Shift", "Shift"], ["&", "*", "\u003C"], ["y", "Y", "\u003E"], ["x", "X", "\u0023"], ["c", "C", "\u0026"], ["v", "V", "\u0040"], ["b", "B", "\u007B"], ["n", "N", "\u007D"], ["m", "M"], [",", "?", "<"], [".", ":", ">"], ["-", "_", "\u002A", ], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Slovenian = [[["\u00a8", "\u00a8", "\u00b8"], ["1", "!", "~"], ["2", '"', "\u02c7"], ["3", "#", "^"], ["4", "$", "\u02d8"], ["5", "%", "\u00b0"], ["6", "&", "\u02db"], ["7", "/", "\u0060"], ["8", "(", "\u00B7"], ["9", ")", "\u00b4"], ["0", "=", "\u2033"], ["'", "?", "\u00a8"], ["+", "*", "\u00b8"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W", "|"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0161", "\u0160", "\u00f7"], ["\u0111", "\u0110", "\u00d7"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u010D", "\u010C"], ["\u0107", "\u0106", "\u00df"], ["\u017E", "\u017D", "\u00a4"]], [["Shift", "Shift"], ["<", ">"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V", "@"], ["b", "B", "{", ], ["n", "N", "}"], ["m", "M", "\u00a7"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout["Spanish-SP"] = [[["\u00ba", "\u00aa", "\\"], ["1", "!", "|"], ["2", '"', "@"], ["3", "'", "#"], ["4", "$", "~"], ["5", "%", "\u20ac"], ["6", "&", "\u00ac"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00a1", "\u00bf"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0060", "^", "["], ["\u002b", "\u002a", "]"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f1", "\u00d1"], ["\u00b4", "\u00a8", "{"], ["\u00e7", "\u00c7", "}"]], [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.Swedish = [[["\u00a7", "\u00bd"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%", "\u20ac"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?", "\\"], ["\u00b4", "`"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f6", "\u00d6"], ["\u00e4", "\u00c4"], ["'", "*"]], [["Shift", "Shift"], ["<", ">", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout["Turkish-F"] = [[['+', "*", "\u00ac"], ["1", "!", "\u00b9", "\u00a1"], ["2", '"', "\u00b2"], ["3", "^", "#", "\u00b3"], ["4", "$", "\u00bc", "\u00a4"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "'", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["/", "?", "\\", "\u00bf"], ["-", "_", "|"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["f", "F", "@"], ["g", "G"], ["\u011f", "\u011e"], ["\u0131", "\u0049", "\u00b6", "\u00ae"], ["o", "O"], ["d", "D", "\u00a5"], ["r", "R"], ["n", "N"], ["h", "H", "\u00f8", "\u00d8"], ["p", "P", "\u00a3"], ["q", "Q", "\u00a8"], ["w", "W", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["u", "U", "\u00e6", "\u00c6"], ["i", "\u0130", "\u00df", "\u00a7"], ["e", "E", "\u20ac"], ["a", "A", " ", "\u00aa"], ["\u00fc", "\u00dc"], ["t", "T"], ["k", "K"], ["m", "M"], ["l", "L"], ["y", "Y", "\u00b4"], ["\u015f", "\u015e"], ["x", "X", "`"]], [["Shift", "Shift"], ["<", ">", "|", "\u00a6"], ["j", "J", "\u00ab", "<"], ["\u00f6", "\u00d6", "\u00bb", ">"], ["v", "V", "\u00a2", "\u00a9"], ["c", "C"], ["\u00e7", "\u00c7"], ["z", "Z"], ["s", "S", "\u00b5", "\u00ba"], ["b", "B", "\u00d7"], [".", ":", "\u00f7"], [",", ";", "-"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout["Turkish-Q"] = [[['"', "\u00e9", "<"], ["1", "!", ">"], ["2", "'", "\u00a3"], ["3", "^", "#"], ["4", "+", "$"], ["5", "%", "\u00bd"], ["6", "&"], ["7", "/", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["*", "?", "\\"], ["-", "_", "|"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "@"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["\u0131", "\u0049", "\u0069", "\u0130"], ["o", "O"], ["p", "P"], ["\u011f", "\u011e", "\u00a8"], ["\u00fc", "\u00dc", "~"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A", "\u00e6", "\u00c6"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u015f", "\u015e", "\u00b4"], ["\u0069", "\u0130"], [",", ";", "`"]], [["Shift", "Shift"], ["<", ">", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], ["\u00f6", "\u00d6"], ["\u00e7", "\u00c7"], [".", ":"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.UK = [[["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]], [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", "@"], ["#", "~"]], [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["AltGr", "AltGr"]]];
    this.VKI_layout.US = [[["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], [["Shift", "Shift"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], [[" ", " "]]];
    this.VKI_layout["US Int'l"] = [[["`", "~"], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], [["Tab", "Tab"], ["q", "Q", "\u00e4", "\u00c4"], ["w", "W", "\u00e5", "\u00c5"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R", "\u00ae"], ["t", "T", "\u00fe", "\u00de"], ["y", "Y", "\u00fc", "\u00dc"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P", "\u00f6", "\u00d6"], ["[", "{", "\u00ab"], ["]", "}", "\u00bb"], ["\\", "|", "\u00ac", "\u00a6"]], [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S", "\u00df", "\u00a7"], ["d", "D", "\u00f0", "\u00d0"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u00f8", "\u00d8"], [";", ":", "\u00b6", "\u00b0"], ["'", '"', "\u00b4", "\u00a8"], ["Enter", "Enter"]], [["Shift", "Shift"], ["z", "Z", "\u00e6", "\u00c6"], ["x", "X"], ["c", "C", "\u00a9", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N", "\u00f1", "\u00d1"], ["m", "M", "\u00b5"], [",", "<", "\u00e7", "\u00c7"], [".", ">"], ["/", "?", "\u00bf"], ["Shift", "Shift"]], [[" ", " ", " ", " "], ["Alt", "Alt"]]];
    this.VKI_deadkey = {}; this.VKI_deadkey['"'] = this.VKI_deadkey['\u00a8'] = [["a", "\u00e4"], ["e", "\u00eb"], ["i", "\u00ef"], ["o", "\u00f6"], ["u", "\u00fc"], ["y", "\u00ff"], ["\u03b9", "\u03ca"], ["\u03c5", "\u03cb"], ["\u016B", "\u01D6"], ["\u00FA", "\u01D8"], ["\u01D4", "\u01DA"], ["\u00F9", "\u01DC"], ["A", "\u00c4"], ["E", "\u00cb"], ["I", "\u00cf"], ["O", "\u00d6"], ["U", "\u00dc"], ["Y", "\u0178"], ["\u0399", "\u03aa"], ["\u03a5", "\u03ab"], ["\u016A", "\u01D5"], ["\u00DA", "\u01D7"], ["\u01D3", "\u01D9"], ["\u00D9", "\u01DB"]]; this.VKI_deadkey['~'] = [["a", "\u00e3"], ["o", "\u00f5"], ["n", "\u00f1"], ["A", "\u00c3"], ["O", "\u00d5"], ["N", "\u00d1"]];
    this.VKI_deadkey['^'] = [["a", "\u00e2"], ["e", "\u00ea"], ["i", "\u00ee"], ["o", "\u00f4"], ["u", "\u00fb"], ["w", "\u0175"], ["y", "\u0177"], ["A", "\u00c2"], ["E", "\u00ca"], ["I", "\u00ce"], ["O", "\u00d4"], ["U", "\u00db"], ["W", "\u0174"], ["Y", "\u0176"]]; this.VKI_deadkey['\u02c7'] = [["c", "\u010D"], ["d", "\u010f"], ["e", "\u011b"], ["s", "\u0161"], ["l", "\u013e"], ["n", "\u0148"], ["r", "\u0159"], ["t", "\u0165"], ["u", "\u01d4"], ["z", "\u017E"], ["\u00fc", "\u01da"], ["C", "\u010C"], ["D", "\u010e"], ["E", "\u011a"], ["S", "\u0160"], ["L", "\u013d"], ["N", "\u0147"], ["R", "\u0158"], ["T", "\u0164"], ["U", "\u01d3"], ["Z", "\u017D"], ["\u00dc", "\u01d9"]]; this.VKI_deadkey['\u02d8'] = [["a", "\u0103"], ["g", "\u011f"], ["A", "\u0102"], ["G", "\u011e"]];
    this.VKI_deadkey['-'] = this.VKI_deadkey['\u00af'] = [["a", "\u0101"], ["e", "\u0113"], ["i", "\u012b"], ["o", "\u014d"], ["u", "\u016B"], ["y", "\u0233"], ["\u00fc", "\u01d6"], ["A", "\u0100"], ["E", "\u0112"], ["I", "\u012a"], ["O", "\u014c"], ["U", "\u016A"], ["Y", "\u0232"], ["\u00dc", "\u01d5"]]; this.VKI_deadkey['`'] = [["a", "\u00e0"], ["e", "\u00e8"], ["i", "\u00ec"], ["o", "\u00f2"], ["u", "\u00f9"], ["\u00fc", "\u01dc"], ["A", "\u00c0"], ["E", "\u00c8"], ["I", "\u00cc"], ["O", "\u00d2"], ["U", "\u00d9"], ["\u00dc", "\u01db"]]; this.VKI_deadkey["'"] = this.VKI_deadkey['\u00b4'] = this.VKI_deadkey['\u0384'] = [["a", "\u00e1"], ["e", "\u00e9"], ["i", "\u00ed"], ["o", "\u00f3"], ["u", "\u00fa"], ["y", "\u00fd"], ["\u03b1", "\u03ac"], ["\u03b5", "\u03ad"], ["\u03b7", "\u03ae"], ["\u03b9", "\u03af"], ["\u03bf", "\u03cc"], ["\u03c5", "\u03cd"], ["\u03c9", "\u03ce"], ["\u00fc", "\u01d8"], ["A", "\u00c1"], ["E", "\u00c9"], ["I", "\u00cd"], ["O", "\u00d3"], ["U", "\u00da"], ["Y", "\u00dd"], ["\u0391", "\u0386"], ["\u0395", "\u0388"], ["\u0397", "\u0389"], ["\u0399", "\u038a"], ["\u039f", "\u038c"], ["\u03a5", "\u038e"], ["\u03a9", "\u038f"], ["\u00dc", "\u01d7"]];
    this.VKI_deadkey['\u02dd'] = [["o", "\u0151"], ["u", "\u0171"], ["O", "\u0150"], ["U", "\u0170"]]; this.VKI_deadkey['\u0385'] = [["\u03b9", "\u0390"], ["\u03c5", "\u03b0"]]; this.VKI_deadkey['\u00b0'] = this.VKI_deadkey['\u00ba'] = [["a", "\u00e5"], ["u", "\u016f"], ["A", "\u00c5"], ["U", "\u016e"]]; this.VKI_deadkey['\u02DB'] = [["a", "\u0106"], ["e", "\u0119"], ["i", "\u012f"], ["o", "\u01eb"], ["u", "\u0173"], ["y", "\u0177"], ["A", "\u0105"], ["E", "\u0118"], ["I", "\u012e"], ["O", "\u01ea"], ["U", "\u0172"], ["Y", "\u0176"]]; this.VKI_deadkey['\u02D9'] = [["c", "\u010B"], ["e", "\u0117"], ["g", "\u0121"], ["z", "\u017C"], ["C", "\u010A"], ["E", "\u0116"], ["G", "\u0120"], ["Z", "\u017B"]]; this.VKI_deadkey['\u00B8'] = this.VKI_deadkey['\u201a'] = [["c", "\u00e7"], ["s", "\u015F"], ["C", "\u00c7"], ["S", "\u015E"]]; this.VKI_deadkey[','] = [["s", (this.VKI_isIElt8) ? "\u015F" : "\u0219"], ["t", (this.VKI_isIElt8) ? "\u0163" : "\u021B"], ["S", (this.VKI_isIElt8) ? "\u015E" : "\u0218"], ["T", (this.VKI_isIElt8) ? "\u0162" : "\u021A"]]; function get_randomCssNum() { var ranCssNum = Math.floor(Math.random() * 3); return ranCssNum }
    function get_randomPosNum() { var ranNum = Math.floor(Math.random() * 200); return ranCssNum } function randOrd() { return (Math.round(Math.random()) - 0.3); /*return (Math.random() * ($(document).width() - $('#keyboardInputMaster').width()) - 0.3);*/ } function getCss() { var cssName = new Array('top', 'left', 'right', 'bottom'); cssName.sort(randOrd); var rand = cssName[0]; return rand }this.VKI_attachKeyboard = VKI_attach = function (elem) { if (elem.VKI_attached) return false; var keybut = document.createElement('img'); keybut.src = this.VKI_imageURI; keybut.alt = "Keyboard interface"; keybut.className = "keyboardInputInitiator"; keybut.title = "Virtual keyboard"; keybut.elem = elem; keybut.onclick = function () { self.VKI_show(this.elem); moveKeyboard(); }; elem.VKI_attached = true; elem.parentNode.insertBefore(keybut, (elem.dir == "rtl") ? elem : elem.nextSibling); if (this.VKI_isIE) { elem.onclick = elem.onselect = elem.onkeyup = function (e) { if ((e || event).type != "keyup" || !this.readOnly) this.VKI_range = document.selection.createRange() } } };
    var inputElems = [document.getElementsByTagName('input'), document.getElementsByTagName('textarea')]; for (var x = 0, elem; elem = inputElems[x++]; ) for (var y = 0, ex; ex = elem[y++]; ) if ((ex.nodeName == "TEXTAREA" || ex.type == "text" || ex.type == "password") && ex.className.indexOf("keyboardInput") > -1) this.VKI_attachKeyboard(ex); this.VKI_keyboard = document.createElement('table'); this.VKI_keyboard.id = "keyboardInputMaster"; this.VKI_keyboard.dir = "ltr"; this.VKI_keyboard.cellSpacing = this.VKI_keyboard.border = "0"; var thead = document.createElement('thead'); var tr = document.createElement('tr'); var th = document.createElement('th'); th.style.display = "none"; var label = document.createElement('label'); var checkbox = document.createElement('input'); checkbox.type = "checkbox"; checkbox.title = "Dead keys: " + ((this.VKI_deadkeysOn) ? "On" : "Off"); checkbox.defaultChecked = this.VKI_deadkeysOn; checkbox.onclick = function () { self.VKI_deadkeysOn = this.checked; this.title = "Dead keys: " + ((this.checked) ? "On" : "Off"); self.VKI_modify(""); return true }; label.appendChild(this.VKI_deadkeysElem = checkbox);
    checkbox.checked = this.VKI_deadkeysOn; th.appendChild(label); tr.appendChild(th); var td = document.createElement('td'); var clearer = document.createElement('span'); clearer.id = "keyboardInputClear"; clearer.appendChild(document.createTextNode("Clear")); clearer.title = "Clear this input"; clearer.onmousedown = function () { this.className = "pressed" }; clearer.onmouseup = function () { this.className = "" }; clearer.onclick = function () { self.VKI_target.value = ""; self.VKI_target.focus(); return false }; td.appendChild(clearer); var closer = document.createElement('span'); closer.id = "keyboardInputClose"; closer.appendChild(document.createTextNode('X')); closer.title = "Close this window"; closer.onmousedown = function () { this.className = "pressed" }; closer.onmouseup = function () { this.className = "" }; closer.onclick = function () { self.VKI_close() }; td.appendChild(closer); tr.appendChild(td); thead.appendChild(tr); this.VKI_keyboard.appendChild(thead); var tbody = document.createElement('tbody'); var tr = document.createElement('tr'); var td = document.createElement('td'); td.colSpan = "2"; var div = document.createElement('div'); div.id = "keyboardInputLayout"; td.appendChild(div);
    if (this.VKI_showVersion) { var div = document.createElement('div'); var ver = document.createElement('var'); div.appendChild(ver); td.appendChild(div) } tr.appendChild(td); tbody.appendChild(tr); this.VKI_keyboard.appendChild(tbody);
    if (this.VKI_isIE6) {
        this.VKI_iframe = document.createElement('iframe'); this.VKI_iframe.style.position = "absolute"; this.VKI_iframe.style.border = "0px none";
        this.VKI_iframe.style.filter = "mask()"; this.VKI_iframe.style.zIndex = "999999"; this.VKI_iframe.src = this.VKI_imageURI
    }
    this.VKI_buildKeys = function () {
        this.VKI_shift = this.VKI_shiftlock = this.VKI_altgr = this.VKI_altgrlock = this.VKI_dead = false;
        this.VKI_deadkeysOn = (this.VKI_layout[this.VKI_kt].DDK) ? false : this.VKI_keyboard.getElementsByTagName('label')[0].getElementsByTagName('input')[0].checked; var container = this.VKI_keyboard.tBodies[0].getElementsByTagName('div')[0];
        while (container.firstChild) container.removeChild(container.firstChild); for (var x = 0, hasDeadKey = false, lyt; lyt = this.VKI_layout[this.VKI_kt][x++]; ) {
            var table = document.createElement('table'); table.cellSpacing = table.border = "0"; if (lyt.length <= this.VKI_keyCenter) table.className = "keyboardInputCenter"; var tbody = document.createElement('tbody'); var tr = document.createElement('tr');
            for (var y = 0, lkey; lkey = lyt[y++]; ) {
                var td = document.createElement('td'); td.appendChild(document.createTextNode(lkey[0])); var className = [];
                if (this.VKI_deadkeysOn) for (key in this.VKI_deadkey) if (key === lkey[0]) { className.push("alive"); break } if (lyt.length > this.VKI_keyCenter && y == lyt.length) className.push("last"); if (lkey[0] == " ") className.push("space"); td.className = className.join(" "); td.VKI_clickless = 0; if (!td.click) { td.click = function () { var evt = this.ownerDocument.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt) } } td.onmouseover = function () { if (self.VKI_clickless) { var _self = this; clearTimeout(this.VKI_clickless); this.VKI_clickless = setTimeout(function () { _self.click() }, self.VKI_clickless) } if (this.firstChild.nodeValue != "\xa0") this.className += " hover" }; td.onmouseout = function () { if (self.VKI_clickless) clearTimeout(this.VKI_clickless); this.className = this.className.replace(/ ?(hover|pressed)/g, "") }; td.onmousedown = function () { if (self.VKI_clickless) clearTimeout(this.VKI_clickless); if (this.firstChild.nodeValue != "\xa0") this.className += " pressed" }; td.onmouseup = function () {
                    if (self.VKI_clickless) clearTimeout(this.VKI_clickless);
                    this.className = this.className.replace(/ ?pressed/g, "")
                }; td.ondblclick = function () { return false }; switch (lkey[1]) {
                    case "Caps": case "Shift": case "Alt": case "AltGr": case "AltLk": td.onclick = (function (type) { return function () { self.VKI_modify(type); return false } })(lkey[1]); break; case "Tab": td.onclick = function () { self.VKI_insert("\t"); return false }; break; case "Bksp": td.onclick = function () {
                        self.VKI_target.focus(); if (self.VKI_target.setSelectionRange) { if (self.VKI_target.readOnly && self.VKI_isWebKit) { var rng = [self.VKI_target.selStart || 0, self.VKI_target.selEnd || 0] } else var rng = [self.VKI_target.selectionStart, self.VKI_target.selectionEnd]; if (rng[0] < rng[1]) rng[0]++; self.VKI_target.value = self.VKI_target.value.substr(0, rng[0] - 1) + self.VKI_target.value.substr(rng[1]); self.VKI_target.setSelectionRange(rng[0] - 1, rng[0] - 1); if (self.VKI_target.readOnly && self.VKI_isWebKit) { var range = window.getSelection().getRangeAt(0); self.VKI_target.selStart = range.startOffset; self.VKI_target.selEnd = range.endOffset } } else if (self.VKI_target.createTextRange) { try { self.VKI_target.VKI_range.select() } catch (e) { self.VKI_target.VKI_range = document.selection.createRange() } if (!self.VKI_target.VKI_range.text.length) self.VKI_target.VKI_range.moveStart('character', -1); self.VKI_target.VKI_range.text = "" }
                        else self.VKI_target.value = self.VKI_target.value.substr(0, self.VKI_target.value.length - 1); if (self.VKI_shift) self.VKI_modify("Shift"); if (self.VKI_altgr) self.VKI_modify("AltGr"); self.VKI_target.focus(); return true
                    }; break; case "Enter": td.onclick = function () { if (self.VKI_target.nodeName != "TEXTAREA") { self.VKI_close(); this.className = this.className.replace(/ ?(hover|pressed)/g, "") } else self.VKI_insert("\n"); return true }; break; default: td.onclick = function () { if (self.VKI_deadkeysOn && self.VKI_dead) { if (self.VKI_dead != this.firstChild.nodeValue) { for (key in self.VKI_deadkey) { if (key == self.VKI_dead) { if (this.firstChild.nodeValue != " ") { for (var z = 0, rezzed = false, dk; dk = self.VKI_deadkey[key][z++]; ) { if (dk[0] == this.firstChild.nodeValue) { self.VKI_insert(dk[1]); rezzed = true; break } } } else { self.VKI_insert(self.VKI_dead); rezzed = true } break } } } else rezzed = true } self.VKI_dead = false; if (!rezzed && this.firstChild.nodeValue != "\xa0") { if (self.VKI_deadkeysOn) { for (key in self.VKI_deadkey) { if (key == this.firstChild.nodeValue) { self.VKI_dead = key; this.className += " dead"; if (self.VKI_shift) self.VKI_modify("Shift"); if (self.VKI_altgr) self.VKI_modify("AltGr"); break } } if (!self.VKI_dead) self.VKI_insert(this.firstChild.nodeValue) } else self.VKI_insert(this.firstChild.nodeValue) } self.VKI_modify(""); return false }
                } tr.appendChild(td); tbody.appendChild(tr); table.appendChild(tbody);
                for (var z = 0; z < 4; z++) if (this.VKI_deadkey[lkey[z] = lkey[z] || "\xa0"]) hasDeadKey = true
            } container.appendChild(table)
        } this.VKI_deadkeysElem.style.display = (!this.VKI_layout[this.VKI_kt].DDK && hasDeadKey) ? "inline" : "none"
    }; this.VKI_buildKeys(); VKI_disableSelection(this.VKI_keyboard); this.VKI_modify = function (type) {
        switch (type) { case "Alt": case "AltGr": this.VKI_altgr = !this.VKI_altgr; break; case "AltLk": this.VKI_altgrlock = !this.VKI_altgrlock; break; case "Caps": this.VKI_shiftlock = !this.VKI_shiftlock; break; case "Shift": this.VKI_shift = !this.VKI_shift; break } var vchar = 0; if (!this.VKI_shift != !this.VKI_shiftlock) vchar += 1; if (!this.VKI_altgr != !this.VKI_altgrlock) vchar += 2; var tables = this.VKI_keyboard.getElementsByTagName('table'); for (var x = 0; x < tables.length; x++) {
            var tds = tables[x].getElementsByTagName('td'); for (var y = 0; y < tds.length; y++) {
                var className = [], lkey = this.VKI_layout[this.VKI_kt][x][y]; if (tds[y].className.indexOf('hover') > -1) className.push("hover"); switch (lkey[1]) {
                    case "Alt": case "AltGr": if (this.VKI_altgr) className.push("dead"); break; case "AltLk": if (this.VKI_altgrlock) className.push("dead"); break; case "Shift": if (this.VKI_shift) className.push("dead"); break; case "Caps": if (this.VKI_shiftlock) className.push("dead"); break; case "Tab": case "Enter": case "Bksp": break; default: if (type) tds[y].firstChild.nodeValue = lkey[vchar];
                        if (this.VKI_deadkeysOn) { var char = tds[y].firstChild.nodeValue; if (this.VKI_dead) { if (char == this.VKI_dead) className.push("dead"); for (var z = 0; z < this.VKI_deadkey[this.VKI_dead].length; z++) { if (char == this.VKI_deadkey[this.VKI_dead][z][0]) { className.push("target"); break } } } for (key in this.VKI_deadkey) if (key === char) { className.push("alive"); break } }
                } if (y == tds.length - 1 && tds.length > this.VKI_keyCenter) className.push("last"); if (lkey[0] == " ") className.push("space"); tds[y].className = className.join(" ")
            }
        }
    }; this.VKI_insert = function (text) {
        this.VKI_target.focus(); if (this.VKI_target.maxLength) this.VKI_target.maxlength = this.VKI_target.maxLength; if (typeof this.VKI_target.maxlength == "undefined" || this.VKI_target.maxlength < 0 || this.VKI_target.value.length < this.VKI_target.maxlength) {
            if (this.VKI_target.setSelectionRange) { if (this.VKI_target.readOnly && this.VKI_isWebKit) { var rng = [this.VKI_target.selStart || 0, this.VKI_target.selEnd || 0] } else var rng = [this.VKI_target.selectionStart, this.VKI_target.selectionEnd]; this.VKI_target.value = this.VKI_target.value.substr(0, rng[0]) + text + this.VKI_target.value.substr(rng[1]); if (text == "\n" && window.opera) rng[0]++; this.VKI_target.setSelectionRange(rng[0] + text.length, rng[0] + text.length); if (this.VKI_target.readOnly && this.VKI_isWebKit) { var range = window.getSelection().getRangeAt(0); this.VKI_target.selStart = range.startOffset; this.VKI_target.selEnd = range.endOffset } } else if (this.VKI_target.createTextRange) {
                try { this.VKI_target.VKI_range.select() } catch (e) { this.VKI_target.VKI_range = document.selection.createRange() }
                this.VKI_target.VKI_range.text = text; this.VKI_target.VKI_range.collapse(true); this.VKI_target.VKI_range.select()
            } else this.VKI_target.value += text; if (this.VKI_shift) this.VKI_modify("Shift"); if (this.VKI_altgr) this.VKI_modify("AltGr"); this.VKI_target.focus()
        } else if (this.VKI_target.createTextRange && this.VKI_target.VKI_range) this.VKI_target.VKI_range.select()
    }; this.VKI_show = function (elem) { if (this.VKI_target = elem) { if (this.VKI_visible != elem) { if (this.VKI_isIE) { if (!this.VKI_target.VKI_range) { this.VKI_target.VKI_range = this.VKI_target.createTextRange(); this.VKI_target.VKI_range.moveStart('character', this.VKI_target.value.length) } this.VKI_target.VKI_range.select() } try { this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard) } catch (e) { } if (this.VKI_clearPasswords && this.VKI_target.type == "password") this.VKI_target.value = ""; var elem = this.VKI_target; this.VKI_target.keyboardPosition = "absolute"; do { if (VKI_getStyle(elem, "position") == "fixed") { this.VKI_target.keyboardPosition = "fixed"; break } } while (elem = elem.offsetParent); if (this.VKI_isIE6) document.body.appendChild(this.VKI_iframe); document.body.appendChild(this.VKI_keyboard); this.VKI_keyboard.style.top = this.VKI_keyboard.style.right = this.VKI_keyboard.style.bottom = this.VKI_keyboard.style.left = "auto"; this.VKI_keyboard.style.position = this.VKI_target.keyboardPosition; this.VKI_visible = this.VKI_target; this.VKI_position(); this.VKI_target.focus() } else this.VKI_close() } }; this.VKI_position = function () {
        if (self.VKI_visible) {
            var inputElemPos = VKI_findPos(self.VKI_target);
            self.VKI_keyboard.style.top = inputElemPos[1] - ((self.VKI_target.keyboardPosition == "fixed" && !self.VKI_isIE && !self.VKI_isMoz) ? VKI_scrollDist()[1] : 0) + self.VKI_target.offsetHeight + 3 + "px"; self.VKI_keyboard.style.left = Math.min(VKI_innerDimensions()[0] - self.VKI_keyboard.offsetWidth - 15, inputElemPos[0]) + "px"; if (self.VKI_isIE6) { self.VKI_iframe.style.width = self.VKI_keyboard.offsetWidth + "px"; self.VKI_iframe.style.height = self.VKI_keyboard.offsetHeight + "px"; self.VKI_iframe.style.top = self.VKI_keyboard.style.top; self.VKI_iframe.style.left = self.VKI_keyboard.style.left }
        }
    }; if (window.addEventListener) { window.addEventListener('resize', this.VKI_position, false) } else if (window.attachEvent) window.attachEvent('onresize', this.VKI_position); this.VKI_close = VKI_close = function () { if (this.VKI_visible) { try { this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard); if (this.VKI_isIE6) this.VKI_iframe.parentNode.removeChild(this.VKI_iframe) } catch (e) { } this.VKI_target.focus(); this.VKI_target = this.VKI_visible = false } }
}; function VKI_findPos(obj) { var curleft = curtop = 0; do { curleft += obj.offsetLeft; curtop += obj.offsetTop } while (obj = obj.offsetParent); return [curleft, curtop] } function VKI_innerDimensions() {
    if (self.innerHeight) { return [self.innerWidth, self.innerHeight] } else if (document.documentElement && document.documentElement.clientHeight) { return [document.documentElement.clientWidth, document.documentElement.clientHeight] }
    else if (document.body) return [document.body.clientWidth, document.body.clientHeight]; return [0, 0]
} function VKI_scrollDist() { var html = document.getElementsByTagName('html')[0]; if (html.scrollTop && document.documentElement.scrollTop) { return [html.scrollLeft, html.scrollTop] } else if (html.scrollTop || document.documentElement.scrollTop) return [html.scrollLeft + document.documentElement.scrollLeft, html.scrollTop + document.documentElement.scrollTop]; return [0, 0] } function VKI_getStyle(obj, styleProp) { if (obj.currentStyle) { var y = obj.currentStyle[styleProp] } else if (window.getComputedStyle) var y = window.getComputedStyle(obj, null)[styleProp]; return y } function VKI_disableSelection(elem) { elem.onselectstart = function () { return false }; elem.unselectable = "on"; elem.style.MozUserSelect = "none"; elem.style.cursor = "default"; if (window.opera) elem.onmousedown = function () { return false } } if (window.addEventListener) { window.addEventListener('load', VKI_buildKeyboardInputs, false) } else if (window.attachEvent) window.attachEvent('onload', VKI_buildKeyboardInputs);


//--------------------------------------------------------------------------------------------------------------

/* Copyright (c) 2009 Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* 
* See http://kelvinluck.com/assets/jquery/jScrollPane/
* $Id: jScrollPane.js 88 2009-12-31 16:24:03Z kelvin.luck $
*/

/**
* Replace the vertical scroll bars on any matched elements with a fancy
* styleable (via CSS) version. With JS disabled the elements will
* gracefully degrade to the browsers own implementation of overflow:auto.
* If the mousewheel plugin has been included on the page then the scrollable areas will also
* respond to the mouse wheel.
*
* @example jQuery(".scroll-pane").jScrollPane();
*
* @name jScrollPane
* @type jQuery
* @param Object	settings	hash with options, described below.
*								scrollbarWidth	-	The width of the generated scrollbar in pixels
*								scrollbarMargin	-	The amount of space to leave on the side of the scrollbar in pixels
*								wheelSpeed		-	The speed the pane will scroll in response to the mouse wheel in pixels
*								showArrows		-	Whether to display arrows for the user to scroll with
*								arrowSize		-	The height of the arrow buttons if showArrows=true
*								animateTo		-	Whether to animate when calling scrollTo and scrollBy
*								dragMinHeight	-	The minimum height to allow the drag bar to be
*								dragMaxHeight	-	The maximum height to allow the drag bar to be
*								animateInterval	-	The interval in milliseconds to update an animating scrollPane (default 100)
*								animateStep		-	The amount to divide the remaining scroll distance by when animating (default 3)
*								maintainPosition-	Whether you want the contents of the scroll pane to maintain it's position when you re-initialise it - so it doesn't scroll as you add more content (default true)
*								tabIndex		-	The tabindex for this jScrollPane to control when it is tabbed to when navigating via keyboard (default 0)
*								enableKeyboardNavigation - Whether to allow keyboard scrolling of this jScrollPane when it is focused (default true)
*								animateToInternalLinks - Whether the move to an internal link (e.g. when it's focused by tabbing or by a hash change in the URL) should be animated or instant (default false)
*								scrollbarOnLeft	-	Display the scrollbar on the left side?  (needs stylesheet changes, see examples.html)
*								reinitialiseOnImageLoad - Whether the jScrollPane should automatically re-initialise itself when any contained images are loaded (default false)
*								topCapHeight	-	The height of the "cap" area between the top of the jScrollPane and the top of the track/ buttons
*								bottomCapHeight	-	The height of the "cap" area between the bottom of the jScrollPane and the bottom of the track/ buttons
*								observeHash		-	Whether jScrollPane should attempt to automagically scroll to the correct place when an anchor inside the scrollpane is linked to (default true)
* @return jQuery
* @cat Plugins/jScrollPane
* @author Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
*/

(function ($) {
    $.jScrollPane = { active: [] }; $.fn.jScrollPane = function (settings) {
        settings = $.extend({}, $.fn.jScrollPane.defaults, settings); var rf = function () { return false; }; return this.each(function () {
            var $this = $(this); var paneEle = this; var currentScrollPosition = 0; var paneWidth; var paneHeight; var trackHeight; var trackOffset = settings.topCapHeight; if ($(this).parent().is('.jScrollPaneContainer')) { currentScrollPosition = settings.maintainPosition ? $this.position().top : 0; var $c = $(this).parent(); paneWidth = $c.innerWidth(); paneHeight = $c.outerHeight(); $('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown, >.jScrollCap', $c).remove(); $this.css({ 'top': 0 }); } else {
                $this.data('originalStyleTag', $this.attr('style')); $this.css('overflow', 'hidden'); this.originalPadding = $this.css('paddingTop') + ' ' + $this.css('paddingRight') + ' ' + $this.css('paddingBottom') + ' ' + $this.css('paddingLeft'); this.originalSidePaddingTotal = (parseInt($this.css('paddingLeft')) || 0) + (parseInt($this.css('paddingRight')) || 0); paneWidth = $this.innerWidth(); paneHeight = $this.innerHeight(); var $container = $('<div></div>').attr({ 'className': 'jScrollPaneContainer' }).css({ 'height': paneHeight + 'px', 'width': paneWidth + 'px' }); if (settings.enableKeyboardNavigation) { $container.attr('tabindex', settings.tabIndex); }
                $this.wrap($container); $(document).bind('emchange', function (e, cur, prev)
                { $this.jScrollPane(settings); });
            }
            trackHeight = paneHeight; if (settings.reinitialiseOnImageLoad) { var $imagesToLoad = $.data(paneEle, 'jScrollPaneImagesToLoad') || $('img', $this); var loadedImages = []; if ($imagesToLoad.length) { $imagesToLoad.each(function (i, val) { $(this).bind('load readystatechange', function () { if ($.inArray(i, loadedImages) == -1) { loadedImages.push(val); $imagesToLoad = $.grep($imagesToLoad, function (n, i) { return n != val; }); $.data(paneEle, 'jScrollPaneImagesToLoad', $imagesToLoad); var s2 = $.extend(settings, { reinitialiseOnImageLoad: false }); $this.jScrollPane(s2); } }).each(function (i, val) { if (this.complete || this.complete === undefined) { this.src = this.src; } }); }); }; }
            var p = this.originalSidePaddingTotal; var realPaneWidth = paneWidth - settings.scrollbarWidth - settings.scrollbarMargin - p; var cssToApply = { 'height': 'auto', 'width': realPaneWidth + 'px' }
            if (settings.scrollbarOnLeft) { cssToApply.paddingLeft = settings.scrollbarMargin + settings.scrollbarWidth + 'px'; } else { cssToApply.paddingRight = settings.scrollbarMargin + 'px'; }
            $this.css(cssToApply); var contentHeight = $this.outerHeight(); var percentInView = paneHeight / contentHeight; if (percentInView < .99) {
                var $container = $this.parent(); $container.append($('<div></div>').addClass('jScrollCap jScrollCapTop').css({ height: settings.topCapHeight }), $('<div></div>').attr({ 'className': 'jScrollPaneTrack' }).css({ 'width': settings.scrollbarWidth + 'px' }).append($('<div></div>').attr({ 'className': 'jScrollPaneDrag' }).css({ 'width': settings.scrollbarWidth + 'px' }).append($('<div></div>').attr({ 'className': 'jScrollPaneDragTop' }).css({ 'width': settings.scrollbarWidth + 'px' }), $('<div></div>').attr({ 'className': 'jScrollPaneDragBottom' }).css({ 'width': settings.scrollbarWidth + 'px' }))), $('<div></div>').addClass('jScrollCap jScrollCapBottom').css({ height: settings.bottomCapHeight })); var $track = $('>.jScrollPaneTrack', $container); var $drag = $('>.jScrollPaneTrack .jScrollPaneDrag', $container); var currentArrowDirection; var currentArrowTimerArr = []; var currentArrowInc; var whileArrowButtonDown = function () {
                    if (currentArrowInc > 4 || currentArrowInc % 4 == 0) { positionDrag(dragPosition + currentArrowDirection * mouseWheelMultiplier); }
                    currentArrowInc++;
                }; if (settings.enableKeyboardNavigation) {
                    $container.bind('keydown.jscrollpane', function (e)
                    { switch (e.keyCode) { case 38: currentArrowDirection = -1; currentArrowInc = 0; whileArrowButtonDown(); currentArrowTimerArr[currentArrowTimerArr.length] = setInterval(whileArrowButtonDown, 100); return false; case 40: currentArrowDirection = 1; currentArrowInc = 0; whileArrowButtonDown(); currentArrowTimerArr[currentArrowTimerArr.length] = setInterval(whileArrowButtonDown, 100); return false; case 33: case 34: return false; default: } }).bind('keyup.jscrollpane', function (e) {
                        if (e.keyCode == 38 || e.keyCode == 40) {
                            for (var i = 0; i < currentArrowTimerArr.length; i++) { clearInterval(currentArrowTimerArr[i]); }
                            return false;
                        }
                    });
                }
                if (settings.showArrows) {
                    var currentArrowButton; var currentArrowInterval; var onArrowMouseUp = function (event)
                    { $('html').unbind('mouseup', onArrowMouseUp); currentArrowButton.removeClass('jScrollActiveArrowButton'); clearInterval(currentArrowInterval); }; var onArrowMouseDown = function () { $('html').bind('mouseup', onArrowMouseUp); currentArrowButton.addClass('jScrollActiveArrowButton'); currentArrowInc = 0; whileArrowButtonDown(); currentArrowInterval = setInterval(whileArrowButtonDown, 100); }; $container.append($('<a></a>').attr({ 'href': 'javascript:;', 'className': 'jScrollArrowUp', 'tabindex': -1 }).css({ 'width': settings.scrollbarWidth + 'px', 'top': settings.topCapHeight + 'px' }).html('Scroll up').bind('mousedown', function ()
                    { currentArrowButton = $(this); currentArrowDirection = -1; onArrowMouseDown(); this.blur(); return false; }).bind('click', rf), $('<a></a>').attr({ 'href': 'javascript:;', 'className': 'jScrollArrowDown', 'tabindex': -1 }).css({ 'width': settings.scrollbarWidth + 'px', 'bottom': settings.bottomCapHeight + 'px' }).html('Scroll down').bind('mousedown', function ()
                    { currentArrowButton = $(this); currentArrowDirection = 1; onArrowMouseDown(); this.blur(); return false; }).bind('click', rf)); var $upArrow = $('>.jScrollArrowUp', $container); var $downArrow = $('>.jScrollArrowDown', $container);
                }
                if (settings.arrowSize) { trackHeight = paneHeight - settings.arrowSize - settings.arrowSize; trackOffset += settings.arrowSize; } else if ($upArrow) { var topArrowHeight = $upArrow.height(); settings.arrowSize = topArrowHeight; trackHeight = paneHeight - topArrowHeight - $downArrow.height(); trackOffset += topArrowHeight; }
                trackHeight -= settings.topCapHeight + settings.bottomCapHeight; $track.css({ 'height': trackHeight + 'px', top: trackOffset + 'px' })
                var $pane = $(this).css({ 'position': 'absolute', 'overflow': 'visible' }); var currentOffset; var maxY; var mouseWheelMultiplier; var dragPosition = 0; var dragMiddle = percentInView * paneHeight / 2; var getPos = function (event, c) { var p = c == 'X' ? 'Left' : 'Top'; return event['page' + c] || (event['client' + c] + (document.documentElement['scroll' + p] || document.body['scroll' + p])) || 0; }; var ignoreNativeDrag = function () { return false; }; var initDrag = function ()
                { ceaseAnimation(); currentOffset = $drag.offset(false); currentOffset.top -= dragPosition; maxY = trackHeight - $drag[0].offsetHeight; mouseWheelMultiplier = 2 * settings.wheelSpeed * maxY / contentHeight; }; var onStartDrag = function (event) {
                    initDrag(); dragMiddle = getPos(event, 'Y') - dragPosition - currentOffset.top; $('html').bind('mouseup', onStopDrag).bind('mousemove', updateScroll); if ($.browser.msie) { $('html').bind('dragstart', ignoreNativeDrag).bind('selectstart', ignoreNativeDrag); }
                    return false;
                }; var onStopDrag = function ()
                { $('html').unbind('mouseup', onStopDrag).unbind('mousemove', updateScroll); dragMiddle = percentInView * paneHeight / 2; if ($.browser.msie) { $('html').unbind('dragstart', ignoreNativeDrag).unbind('selectstart', ignoreNativeDrag); } }; var positionDrag = function (destY)
                { $container.scrollTop(0); destY = destY < 0 ? 0 : (destY > maxY ? maxY : destY); dragPosition = destY; $drag.css({ 'top': destY + 'px' }); var p = destY / maxY; $this.data('jScrollPanePosition', (paneHeight - contentHeight) * -p); $pane.css({ 'top': ((paneHeight - contentHeight) * p) + 'px' }); $this.trigger('scroll'); if (settings.showArrows) { $upArrow[destY == 0 ? 'addClass' : 'removeClass']('disabled'); $downArrow[destY == maxY ? 'addClass' : 'removeClass']('disabled'); } }; var updateScroll = function (e)
                { positionDrag(getPos(e, 'Y') - currentOffset.top - dragMiddle); }; var dragH = Math.max(Math.min(percentInView * (paneHeight - settings.arrowSize * 2), settings.dragMaxHeight), settings.dragMinHeight); $drag.css({ 'height': dragH + 'px' }).bind('mousedown', onStartDrag); var trackScrollInterval; var trackScrollInc; var trackScrollMousePos; var doTrackScroll = function () {
                    if (trackScrollInc > 8 || trackScrollInc % 4 == 0) { positionDrag((dragPosition - ((dragPosition - trackScrollMousePos) / 2))); }
                    trackScrollInc++;
                }; var onStopTrackClick = function ()
                { clearInterval(trackScrollInterval); $('html').unbind('mouseup', onStopTrackClick).unbind('mousemove', onTrackMouseMove); }; var onTrackMouseMove = function (event)
                { trackScrollMousePos = getPos(event, 'Y') - currentOffset.top - dragMiddle; }; var onTrackClick = function (event)
                { initDrag(); onTrackMouseMove(event); trackScrollInc = 0; $('html').bind('mouseup', onStopTrackClick).bind('mousemove', onTrackMouseMove); trackScrollInterval = setInterval(doTrackScroll, 100); doTrackScroll(); return false; }; $track.bind('mousedown', onTrackClick); $container.bind('mousewheel', function (event, delta) { delta = delta || (event.wheelDelta ? event.wheelDelta / 120 : (event.detail) ? -event.detail / 3 : 0); initDrag(); ceaseAnimation(); var d = dragPosition; positionDrag(dragPosition - delta * mouseWheelMultiplier); var dragOccured = d != dragPosition; return !dragOccured; }); var _animateToPosition; var _animateToInterval; function animateToPosition()
                { var diff = (_animateToPosition - dragPosition) / settings.animateStep; if (diff > 1 || diff < -1) { positionDrag(dragPosition + diff); } else { positionDrag(_animateToPosition); ceaseAnimation(); } }
                var ceaseAnimation = function ()
                { if (_animateToInterval) { clearInterval(_animateToInterval); delete _animateToPosition; } }; var scrollTo = function (pos, preventAni) {
                    if (typeof pos == "string") { $e = $(pos, $this); if (!$e.length) return; pos = $e.offset().top - $this.offset().top; }
                    ceaseAnimation(); var maxScroll = contentHeight - paneHeight; pos = pos > maxScroll ? maxScroll : pos; $this.data('jScrollPaneMaxScroll', maxScroll); var destDragPosition = pos / maxScroll * maxY; if (preventAni || !settings.animateTo) { positionDrag(destDragPosition); } else { $container.scrollTop(0); _animateToPosition = destDragPosition; _animateToInterval = setInterval(animateToPosition, settings.animateInterval); }
                }; $this[0].scrollTo = scrollTo; $this[0].scrollBy = function (delta)
                { var currentPos = -parseInt($pane.css('top')) || 0; scrollTo(currentPos + delta); }; initDrag(); scrollTo(-currentScrollPosition, true); $('*', this).bind('focus', function (event) {
                    var $e = $(this); var eleTop = 0; while ($e[0] != $this[0]) { eleTop += $e.position().top; $e = $e.offsetParent(); }
                    var viewportTop = -parseInt($pane.css('top')) || 0; var maxVisibleEleTop = viewportTop + paneHeight; var eleInView = eleTop > viewportTop && eleTop < maxVisibleEleTop; if (!eleInView) {
                        var destPos = eleTop - settings.scrollbarMargin; if (eleTop > viewportTop) { destPos += $(this).height() + 15 + settings.scrollbarMargin - paneHeight; }
                        scrollTo(destPos);
                    }
                })
                if (settings.observeHash) {
                    if (location.hash && location.hash.length > 1) { setTimeout(function () { scrollTo(location.hash); }, $.browser.safari ? 100 : 0); }
                    $(document).bind('click', function (e) { $target = $(e.target); if ($target.is('a')) { var h = $target.attr('href'); if (h && h.substr(0, 1) == '#' && h.length > 1) { setTimeout(function () { scrollTo(h, !settings.animateToInternalLinks); }, $.browser.safari ? 100 : 0); } } });
                }
                function onSelectScrollMouseDown(e)
                { $(document).bind('mousemove.jScrollPaneDragging', onTextSelectionScrollMouseMove); $(document).bind('mouseup.jScrollPaneDragging', onSelectScrollMouseUp); }
                var textDragDistanceAway; var textSelectionInterval; function onTextSelectionInterval()
                { direction = textDragDistanceAway < 0 ? -1 : 1; $this[0].scrollBy(textDragDistanceAway / 2); }
                function clearTextSelectionInterval()
                { if (textSelectionInterval) { clearInterval(textSelectionInterval); textSelectionInterval = undefined; } }
                function onTextSelectionScrollMouseMove(e)
                { var offset = $this.parent().offset().top; var maxOffset = offset + paneHeight; var mouseOffset = getPos(e, 'Y'); textDragDistanceAway = mouseOffset < offset ? mouseOffset - offset : (mouseOffset > maxOffset ? mouseOffset - maxOffset : 0); if (textDragDistanceAway == 0) { clearTextSelectionInterval(); } else { if (!textSelectionInterval) { textSelectionInterval = setInterval(onTextSelectionInterval, 100); } } }
                function onSelectScrollMouseUp(e)
                { $(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging'); clearTextSelectionInterval(); }
                $container.bind('mousedown.jScrollPane', onSelectScrollMouseDown); $.jScrollPane.active.push($this[0]);
            } else { $this.css({ 'height': paneHeight + 'px', 'width': paneWidth - this.originalSidePaddingTotal + 'px', 'padding': this.originalPadding }); $this[0].scrollTo = $this[0].scrollBy = function () { }; $this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane'); }
        })
    }; $.fn.jScrollPaneRemove = function () {
        $(this).each(function ()
        { $this = $(this); var $c = $this.parent(); if ($c.is('.jScrollPaneContainer')) { $this.css({ 'top': '', 'height': '', 'width': '', 'padding': '', 'overflow': '', 'position': '' }); $this.attr('style', $this.data('originalStyleTag')); $c.after($this).remove(); } });
    }
    $.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, tabIndex: 0, enableKeyboardNavigation: true, animateToInternalLinks: false, topCapHeight: 0, bottomCapHeight: 0, observeHash: true }; $(window).bind('unload', function () { var els = $.jScrollPane.active; for (var i = 0; i < els.length; i++) { els[i].scrollTo = els[i].scrollBy = null; } });
})(jQuery); var is = { ie: navigator.appName == 'Microsoft Internet Explorer', java: navigator.javaEnabled(), ns: navigator.appName == 'Netscape', ua: navigator.userAgent.toLowerCase(), version: parseFloat(navigator.appVersion.substr(21)) || parseFloat(navigator.appVersion), win: navigator.platform == 'Win32' }
is.mac = is.ua.indexOf('mac') >= 0; if (is.ua.indexOf('opera') >= 0) { is.ie = is.ns = false; is.opera = true; }
if (is.ua.indexOf('gecko') >= 0) { is.ie = is.ns = false; is.gecko = true; }

//--------------------------------------------------------------------------------------------------------------

/*
Watermark v3.1.3 (March 22, 2011) plugin for jQuery
http://jquery-watermark.googlecode.com/
Copyright (c) 2009-2011 Todd Northrop
http://www.speednet.biz/
Dual licensed under the MIT or GPL Version 2 licenses.
*/
(function (a, h, y) { var w = "function", v = "password", j = "maxLength", n = "type", b = "", c = true, u = "placeholder", i = false, t = "watermark", g = t, f = "watermarkClass", q = "watermarkFocus", l = "watermarkSubmit", o = "watermarkMaxLength", e = "watermarkPassword", d = "watermarkText", k = /\r/g, s = "input:data(" + g + "),textarea:data(" + g + ")", m = "input:text,input:password,input[type=search],input:not([type]),textarea", p = ["Page_ClientValidate"], r = i, x = u in document.createElement("input"); a.watermark = a.watermark || { version: "3.1.3", runOnce: c, options: { className: t, useNative: c, hideBeforeUnload: c }, hide: function (b) { a(b).filter(s).each(function () { a.watermark._hide(a(this)) }) }, _hide: function (a, r) { var p = a[0], q = (p.value || b).replace(k, b), l = a.data(d) || b, m = a.data(o) || 0, i = a.data(f); if (l.length && q == l) { p.value = b; if (a.data(e)) if ((a.attr(n) || b) === "text") { var g = a.data(e) || [], c = a.parent() || []; if (g.length && c.length) { c[0].removeChild(a[0]); c[0].appendChild(g[0]); a = g } } if (m) { a.attr(j, m); a.removeData(o) } if (r) { a.attr("autocomplete", "off"); h.setTimeout(function () { a.select() }, 1) } } i && a.removeClass(i) }, show: function (b) { a(b).filter(s).each(function () { a.watermark._show(a(this)) }) }, _show: function (g) { var p = g[0], u = (p.value || b).replace(k, b), h = g.data(d) || b, s = g.attr(n) || b, t = g.data(f); if ((u.length == 0 || u == h) && !g.data(q)) { r = c; if (g.data(e)) if (s === v) { var m = g.data(e) || [], l = g.parent() || []; if (m.length && l.length) { l[0].removeChild(g[0]); l[0].appendChild(m[0]); g = m; g.attr(j, h.length); p = g[0] } } if (s === "text" || s === "search") { var i = g.attr(j) || 0; if (i > 0 && h.length > i) { g.data(o, i); g.attr(j, h.length) } } t && g.addClass(t); p.value = h } else a.watermark._hide(g) }, hideAll: function () { if (r) { a.watermark.hide(m); r = i } }, showAll: function () { a.watermark.show(m) } }; a.fn.watermark = a.fn.watermark || function (p, o) { var t = "string"; if (!this.length) return this; var s = i, r = typeof p === t; if (r) p = p.replace(k, b); if (typeof o === "object") { s = typeof o.className === t; o = a.extend({}, a.watermark.options, o) } else if (typeof o === t) { s = c; o = a.extend({}, a.watermark.options, { className: o }) } else o = a.watermark.options; if (typeof o.useNative !== w) o.useNative = o.useNative ? function () { return c } : function () { return i }; return this.each(function () { var B = "dragleave", A = "dragenter", z = this, i = a(z); if (!i.is(m)) return; if (i.data(g)) { if (r || s) { a.watermark._hide(i); r && i.data(d, p); s && i.data(f, o.className) } } else { if (x && o.useNative.call(z, i) && (i.attr("tagName") || b) !== "TEXTAREA") { r && i.attr(u, p); return } i.data(d, r ? p : b); i.data(f, o.className); i.data(g, 1); if ((i.attr(n) || b) === v) { var C = i.wrap("<span>").parent(), t = a(C.html().replace(/type=["']?password["']?/i, 'type="text"')); t.data(d, i.data(d)); t.data(f, i.data(f)); t.data(g, 1); t.attr(j, p.length); t.focus(function () { a.watermark._hide(t, c) }).bind(A, function () { a.watermark._hide(t) }).bind("dragend", function () { h.setTimeout(function () { t.blur() }, 1) }); i.blur(function () { a.watermark._show(i) }).bind(B, function () { a.watermark._show(i) }); t.data(e, i); i.data(e, t) } else i.focus(function () { i.data(q, 1); a.watermark._hide(i, c) }).blur(function () { i.data(q, 0); a.watermark._show(i) }).bind(A, function () { a.watermark._hide(i) }).bind(B, function () { a.watermark._show(i) }).bind("dragend", function () { h.setTimeout(function () { a.watermark._show(i) }, 1) }).bind("drop", function (e) { var c = i[0], a = e.originalEvent.dataTransfer.getData("Text"); if ((c.value || b).replace(k, b).replace(a, b) === i.data(d)) c.value = a; i.focus() }); if (z.form) { var w = z.form, y = a(w); if (!y.data(l)) { y.submit(a.watermark.hideAll); if (w.submit) { y.data(l, w.submit); w.submit = function (c, b) { return function () { var d = b.data(l); a.watermark.hideAll(); if (d.apply) d.apply(c, Array.prototype.slice.call(arguments)); else d() } } (w, y) } else { y.data(l, 1); w.submit = function (b) { return function () { a.watermark.hideAll(); delete b.submit; b.submit() } } (w) } } } } a.watermark._show(i) }) }; if (a.watermark.runOnce) { a.watermark.runOnce = i; a.extend(a.expr[":"], { data: function (c, d, b) { return !!a.data(c, b[3]) } }); (function (c) { a.fn.val = function () { var e = this; if (!e.length) return arguments.length ? e : y; if (!arguments.length) if (e.data(g)) { var f = (e[0].value || b).replace(k, b); return f === (e.data(d) || b) ? b : f } else return c.apply(e, arguments); else { c.apply(e, arguments); a.watermark.show(e); return e } } })(a.fn.val); p.length && a(function () { for (var b, c, d = p.length - 1; d >= 0; d--) { b = p[d]; c = h[b]; if (typeof c === w) h[b] = function (b) { return function () { a.watermark.hideAll(); return b.apply(null, Array.prototype.slice.call(arguments)) } } (c) } }); a(h).bind("beforeunload", function () { a.watermark.options.hideBeforeUnload && a.watermark.hideAll() }) } })(jQuery, window);

//--------------------------------------------------------------------------------------------------------------

/*!
* jQuery UI 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function (c, j) {
    function k(a, b) { var d = a.nodeName.toLowerCase(); if ("area" === d) { b = a.parentNode; d = b.name; if (!a.href || !d || b.nodeName.toLowerCase() !== "map") return false; a = c("img[usemap=#" + d + "]")[0]; return !!a && l(a) } return (/input|select|textarea|button|object/.test(d) ? !a.disabled : "a" == d ? a.href || b : b) && l(a) } function l(a) { return !c(a).parents().andSelf().filter(function () { return c.curCSS(this, "visibility") === "hidden" || c.expr.filters.hidden(this) }).length } c.ui = c.ui || {}; if (!c.ui.version) {
        c.extend(c.ui, { version: "1.8.13",
            keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91}
        }); c.fn.extend({ _focus: c.fn.focus, focus: function (a, b) {
            return typeof a === "number" ? this.each(function () {
                var d = this; setTimeout(function () {
                    c(d).focus();
                    b && b.call(d)
                }, a)
            }) : this._focus.apply(this, arguments)
        }, scrollParent: function () {
            var a; a = c.browser.msie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(c.curCSS(this, "position", 1)) && /(auto|scroll)/.test(c.curCSS(this, "overflow", 1) + c.curCSS(this, "overflow-y", 1) + c.curCSS(this, "overflow-x", 1)) }).eq(0) : this.parents().filter(function () {
                return /(auto|scroll)/.test(c.curCSS(this, "overflow", 1) + c.curCSS(this,
"overflow-y", 1) + c.curCSS(this, "overflow-x", 1))
            }).eq(0); return /fixed/.test(this.css("position")) || !a.length ? c(document) : a
        }, zIndex: function (a) { if (a !== j) return this.css("zIndex", a); if (this.length) { a = c(this[0]); for (var b; a.length && a[0] !== document; ) { b = a.css("position"); if (b === "absolute" || b === "relative" || b === "fixed") { b = parseInt(a.css("zIndex"), 10); if (!isNaN(b) && b !== 0) return b } a = a.parent() } } return 0 }, disableSelection: function () {
            return this.bind((c.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection",
function (a) { a.preventDefault() })
        }, enableSelection: function () { return this.unbind(".ui-disableSelection") } 
        }); c.each(["Width", "Height"], function (a, b) {
            function d(f, g, m, n) { c.each(e, function () { g -= parseFloat(c.curCSS(f, "padding" + this, true)) || 0; if (m) g -= parseFloat(c.curCSS(f, "border" + this + "Width", true)) || 0; if (n) g -= parseFloat(c.curCSS(f, "margin" + this, true)) || 0 }); return g } var e = b === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], h = b.toLowerCase(), i = { innerWidth: c.fn.innerWidth, innerHeight: c.fn.innerHeight, outerWidth: c.fn.outerWidth,
                outerHeight: c.fn.outerHeight
            }; c.fn["inner" + b] = function (f) { if (f === j) return i["inner" + b].call(this); return this.each(function () { c(this).css(h, d(this, f) + "px") }) }; c.fn["outer" + b] = function (f, g) { if (typeof f !== "number") return i["outer" + b].call(this, f); return this.each(function () { c(this).css(h, d(this, f, true, g) + "px") }) } 
        }); c.extend(c.expr[":"], { data: function (a, b, d) { return !!c.data(a, d[3]) }, focusable: function (a) { return k(a, !isNaN(c.attr(a, "tabindex"))) }, tabbable: function (a) {
            var b = c.attr(a, "tabindex"), d = isNaN(b);
            return (d || b >= 0) && k(a, !d)
        } 
        }); c(function () { var a = document.body, b = a.appendChild(b = document.createElement("div")); c.extend(b.style, { minHeight: "100px", height: "auto", padding: 0, borderWidth: 0 }); c.support.minHeight = b.offsetHeight === 100; c.support.selectstart = "onselectstart" in b; a.removeChild(b).style.display = "none" }); c.extend(c.ui, { plugin: { add: function (a, b, d) { a = c.ui[a].prototype; for (var e in d) { a.plugins[e] = a.plugins[e] || []; a.plugins[e].push([b, d[e]]) } }, call: function (a, b, d) {
            if ((b = a.plugins[b]) && a.element[0].parentNode) for (var e =
0; e < b.length; e++) a.options[b[e][0]] && b[e][1].apply(a.element, d)
        } 
        }, contains: function (a, b) { return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b) }, hasScroll: function (a, b) { if (c(a).css("overflow") === "hidden") return false; b = b && b === "left" ? "scrollLeft" : "scrollTop"; var d = false; if (a[b] > 0) return true; a[b] = 1; d = a[b] > 0; a[b] = 0; return d }, isOverAxis: function (a, b, d) { return a > b && a < b + d }, isOver: function (a, b, d, e, h, i) { return c.ui.isOverAxis(a, d, h) && c.ui.isOverAxis(b, e, i) } 
        })
    } 
})(jQuery);
; /*!
 * jQuery UI Widget 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function (b, j) {
    if (b.cleanData) { var k = b.cleanData; b.cleanData = function (a) { for (var c = 0, d; (d = a[c]) != null; c++) b(d).triggerHandler("remove"); k(a) } } else { var l = b.fn.remove; b.fn.remove = function (a, c) { return this.each(function () { if (!c) if (!a || b.filter(a, [this]).length) b("*", this).add([this]).each(function () { b(this).triggerHandler("remove") }); return l.call(b(this), a, c) }) } } b.widget = function (a, c, d) {
        var e = a.split(".")[0], f; a = a.split(".")[1]; f = e + "-" + a; if (!d) { d = c; c = b.Widget } b.expr[":"][f] = function (h) {
            return !!b.data(h,
a)
        }; b[e] = b[e] || {}; b[e][a] = function (h, g) { arguments.length && this._createWidget(h, g) }; c = new c; c.options = b.extend(true, {}, c.options); b[e][a].prototype = b.extend(true, c, { namespace: e, widgetName: a, widgetEventPrefix: b[e][a].prototype.widgetEventPrefix || a, widgetBaseClass: f }, d); b.widget.bridge(a, b[e][a])
    }; b.widget.bridge = function (a, c) {
        b.fn[a] = function (d) {
            var e = typeof d === "string", f = Array.prototype.slice.call(arguments, 1), h = this; d = !e && f.length ? b.extend.apply(null, [true, d].concat(f)) : d; if (e && d.charAt(0) === "_") return h;
            e ? this.each(function () { var g = b.data(this, a), i = g && b.isFunction(g[d]) ? g[d].apply(g, f) : g; if (i !== g && i !== j) { h = i; return false } }) : this.each(function () { var g = b.data(this, a); g ? g.option(d || {})._init() : b.data(this, a, new c(d, this)) }); return h
        } 
    }; b.Widget = function (a, c) { arguments.length && this._createWidget(a, c) }; b.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function (a, c) {
        b.data(c, this.widgetName, this); this.element = b(c); this.options = b.extend(true, {}, this.options,
this._getCreateOptions(), a); var d = this; this.element.bind("remove." + this.widgetName, function () { d.destroy() }); this._create(); this._trigger("create"); this._init()
    }, _getCreateOptions: function () { return b.metadata && b.metadata.get(this.element[0])[this.widgetName] }, _create: function () { }, _init: function () { }, destroy: function () { this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled ui-state-disabled") },
        widget: function () { return this.element }, option: function (a, c) { var d = a; if (arguments.length === 0) return b.extend({}, this.options); if (typeof a === "string") { if (c === j) return this.options[a]; d = {}; d[a] = c } this._setOptions(d); return this }, _setOptions: function (a) { var c = this; b.each(a, function (d, e) { c._setOption(d, e) }); return this }, _setOption: function (a, c) { this.options[a] = c; if (a === "disabled") this.widget()[c ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled ui-state-disabled").attr("aria-disabled", c); return this },
        enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _trigger: function (a, c, d) { var e = this.options[a]; c = b.Event(c); c.type = (a === this.widgetEventPrefix ? a : this.widgetEventPrefix + a).toLowerCase(); d = d || {}; if (c.originalEvent) { a = b.event.props.length; for (var f; a; ) { f = b.event.props[--a]; c[f] = c.originalEvent[f] } } this.element.trigger(c, d); return !(b.isFunction(e) && e.call(this.element[0], c, d) === false || c.isDefaultPrevented()) } 
    }
})(jQuery);
; /*!
 * jQuery UI Mouse 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function (b) {
    var d = false; b(document).mousedown(function () { d = false }); b.widget("ui.mouse", { options: { cancel: ":input,option", distance: 1, delay: 0 }, _mouseInit: function () { var a = this; this.element.bind("mousedown." + this.widgetName, function (c) { return a._mouseDown(c) }).bind("click." + this.widgetName, function (c) { if (true === b.data(c.target, a.widgetName + ".preventClickEvent")) { b.removeData(c.target, a.widgetName + ".preventClickEvent"); c.stopImmediatePropagation(); return false } }); this.started = false }, _mouseDestroy: function () {
        this.element.unbind("." +
this.widgetName)
    }, _mouseDown: function (a) {
        if (!d) {
            this._mouseStarted && this._mouseUp(a); this._mouseDownEvent = a; var c = this, f = a.which == 1, g = typeof this.options.cancel == "string" ? b(a.target).parents().add(a.target).filter(this.options.cancel).length : false; if (!f || g || !this._mouseCapture(a)) return true; this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) this._mouseDelayTimer = setTimeout(function () { c.mouseDelayMet = true }, this.options.delay); if (this._mouseDistanceMet(a) && this._mouseDelayMet(a)) {
                this._mouseStarted =
this._mouseStart(a) !== false; if (!this._mouseStarted) { a.preventDefault(); return true } 
            } true === b.data(a.target, this.widgetName + ".preventClickEvent") && b.removeData(a.target, this.widgetName + ".preventClickEvent"); this._mouseMoveDelegate = function (e) { return c._mouseMove(e) }; this._mouseUpDelegate = function (e) { return c._mouseUp(e) }; b(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); a.preventDefault(); return d = true
        } 
    }, _mouseMove: function (a) {
        if (b.browser.msie &&
!(document.documentMode >= 9) && !a.button) return this._mouseUp(a); if (this._mouseStarted) { this._mouseDrag(a); return a.preventDefault() } if (this._mouseDistanceMet(a) && this._mouseDelayMet(a)) (this._mouseStarted = this._mouseStart(this._mouseDownEvent, a) !== false) ? this._mouseDrag(a) : this._mouseUp(a); return !this._mouseStarted
    }, _mouseUp: function (a) {
        b(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) {
            this._mouseStarted =
false; a.target == this._mouseDownEvent.target && b.data(a.target, this.widgetName + ".preventClickEvent", true); this._mouseStop(a)
        } return false
    }, _mouseDistanceMet: function (a) { return Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return true } 
    })
})(jQuery);
; /*
 * jQuery UI Draggable 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function (d) {
    d.widget("ui.draggable", d.ui.mouse, { widgetEventPrefix: "drag", options: { addClasses: true, appendTo: "parent", axis: false, connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false }, _create: function () {
        if (this.options.helper ==
"original" && !/^(?:r|a|f)/.test(this.element.css("position"))) this.element[0].style.position = "relative"; this.options.addClasses && this.element.addClass("ui-draggable"); this.options.disabled && this.element.addClass("ui-draggable-disabled"); this._mouseInit()
    }, destroy: function () { if (this.element.data("draggable")) { this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy(); return this } }, _mouseCapture: function (a) {
        var b =
this.options; if (this.helper || b.disabled || d(a.target).is(".ui-resizable-handle")) return false; this.handle = this._getHandle(a); if (!this.handle) return false; d(b.iframeFix === true ? "iframe" : b.iframeFix).each(function () { d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1E3 }).css(d(this).offset()).appendTo("body") }); return true
    }, _mouseStart: function (a) {
        var b = this.options; this.helper =
this._createHelper(a); this._cacheHelperProportions(); if (d.ui.ddmanager) d.ui.ddmanager.current = this; this._cacheMargins(); this.cssPosition = this.helper.css("position"); this.scrollParent = this.helper.scrollParent(); this.offset = this.positionAbs = this.element.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; d.extend(this.offset, { click: { left: a.pageX - this.offset.left, top: a.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() });
        this.originalPosition = this.position = this._generatePosition(a); this.originalPageX = a.pageX; this.originalPageY = a.pageY; b.cursorAt && this._adjustOffsetFromHelper(b.cursorAt); b.containment && this._setContainment(); if (this._trigger("start", a) === false) { this._clear(); return false } this._cacheHelperProportions(); d.ui.ddmanager && !b.dropBehaviour && d.ui.ddmanager.prepareOffsets(this, a); this.helper.addClass("ui-draggable-dragging"); this._mouseDrag(a, true); return true
    }, _mouseDrag: function (a, b) {
        this.position = this._generatePosition(a);
        this.positionAbs = this._convertPositionTo("absolute"); if (!b) { b = this._uiHash(); if (this._trigger("drag", a, b) === false) { this._mouseUp({}); return false } this.position = b.position } if (!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left + "px"; if (!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top + "px"; d.ui.ddmanager && d.ui.ddmanager.drag(this, a); return false
    }, _mouseStop: function (a) {
        var b = false; if (d.ui.ddmanager && !this.options.dropBehaviour) b =
d.ui.ddmanager.drop(this, a); if (this.dropped) { b = this.dropped; this.dropped = false } if ((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original") return false; if (this.options.revert == "invalid" && !b || this.options.revert == "valid" && b || this.options.revert === true || d.isFunction(this.options.revert) && this.options.revert.call(this.element, b)) { var c = this; d(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { c._trigger("stop", a) !== false && c._clear() }) } else this._trigger("stop",
a) !== false && this._clear(); return false
    }, _mouseUp: function (a) { this.options.iframeFix === true && d("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }); return d.ui.mouse.prototype._mouseUp.call(this, a) }, cancel: function () { this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(); return this }, _getHandle: function (a) {
        var b = !this.options.handle || !d(this.options.handle, this.element).length ? true : false; d(this.options.handle, this.element).find("*").andSelf().each(function () {
            if (this ==
a.target) b = true
        }); return b
    }, _createHelper: function (a) { var b = this.options; a = d.isFunction(b.helper) ? d(b.helper.apply(this.element[0], [a])) : b.helper == "clone" ? this.element.clone().removeAttr("id") : this.element; a.parents("body").length || a.appendTo(b.appendTo == "parent" ? this.element[0].parentNode : b.appendTo); a[0] != this.element[0] && !/(fixed|absolute)/.test(a.css("position")) && a.css("position", "absolute"); return a }, _adjustOffsetFromHelper: function (a) {
        if (typeof a == "string") a = a.split(" "); if (d.isArray(a)) a =
{ left: +a[0], top: +a[1] || 0 }; if ("left" in a) this.offset.click.left = a.left + this.margins.left; if ("right" in a) this.offset.click.left = this.helperProportions.width - a.right + this.margins.left; if ("top" in a) this.offset.click.top = a.top + this.margins.top; if ("bottom" in a) this.offset.click.top = this.helperProportions.height - a.bottom + this.margins.top
    }, _getParentOffset: function () {
        this.offsetParent = this.helper.offsetParent(); var a = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document &&
d.ui.contains(this.scrollParent[0], this.offsetParent[0])) { a.left += this.scrollParent.scrollLeft(); a.top += this.scrollParent.scrollTop() } if (this.offsetParent[0] == document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && d.browser.msie) a = { top: 0, left: 0 }; return { top: a.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: a.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)}
    }, _getRelativeOffset: function () {
        if (this.cssPosition == "relative") {
            var a =
this.element.position(); return { top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()}
        } else return { top: 0, left: 0}
    }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css("marginLeft"), 10) || 0, top: parseInt(this.element.css("marginTop"), 10) || 0, right: parseInt(this.element.css("marginRight"), 10) || 0, bottom: parseInt(this.element.css("marginBottom"), 10) || 0} }, _cacheHelperProportions: function () {
        this.helperProportions =
{ width: this.helper.outerWidth(), height: this.helper.outerHeight()}
    }, _setContainment: function () {
        var a = this.options; if (a.containment == "parent") a.containment = this.helper[0].parentNode; if (a.containment == "document" || a.containment == "window") this.containment = [(a.containment == "document" ? 0 : d(window).scrollLeft()) - this.offset.relative.left - this.offset.parent.left, (a.containment == "document" ? 0 : d(window).scrollTop()) - this.offset.relative.top - this.offset.parent.top, (a.containment == "document" ? 0 : d(window).scrollLeft()) +
d(a.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (a.containment == "document" ? 0 : d(window).scrollTop()) + (d(a.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(a.containment) && a.containment.constructor != Array) {
            a = d(a.containment); var b = a[0]; if (b) {
                a.offset(); var c = d(b).css("overflow") != "hidden"; this.containment = [(parseInt(d(b).css("borderLeftWidth"),
10) || 0) + (parseInt(d(b).css("paddingLeft"), 10) || 0), (parseInt(d(b).css("borderTopWidth"), 10) || 0) + (parseInt(d(b).css("paddingTop"), 10) || 0), (c ? Math.max(b.scrollWidth, b.offsetWidth) : b.offsetWidth) - (parseInt(d(b).css("borderLeftWidth"), 10) || 0) - (parseInt(d(b).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (c ? Math.max(b.scrollHeight, b.offsetHeight) : b.offsetHeight) - (parseInt(d(b).css("borderTopWidth"), 10) || 0) - (parseInt(d(b).css("paddingBottom"), 10) || 0) - this.helperProportions.height -
this.margins.top - this.margins.bottom]; this.relative_container = a
            } 
        } else if (a.containment.constructor == Array) this.containment = a.containment
    }, _convertPositionTo: function (a, b) {
        if (!b) b = this.position; a = a == "absolute" ? 1 : -1; var c = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && d.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, f = /(html|body)/i.test(c[0].tagName); return { top: b.top + this.offset.relative.top * a + this.offset.parent.top * a - (d.browser.safari &&
d.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : f ? 0 : c.scrollTop()) * a), left: b.left + this.offset.relative.left * a + this.offset.parent.left * a - (d.browser.safari && d.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : f ? 0 : c.scrollLeft()) * a)
        }
    }, _generatePosition: function (a) {
        var b = this.options, c = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && d.ui.contains(this.scrollParent[0],
this.offsetParent[0])) ? this.offsetParent : this.scrollParent, f = /(html|body)/i.test(c[0].tagName), e = a.pageX, h = a.pageY; if (this.originalPosition) {
            var g; if (this.containment) {
                if (this.relative_container) { g = this.relative_container.offset(); g = [this.containment[0] + g.left, this.containment[1] + g.top, this.containment[2] + g.left, this.containment[3] + g.top] } else g = this.containment; if (a.pageX - this.offset.click.left < g[0]) e = g[0] + this.offset.click.left; if (a.pageY - this.offset.click.top < g[1]) h = g[1] + this.offset.click.top;
                if (a.pageX - this.offset.click.left > g[2]) e = g[2] + this.offset.click.left; if (a.pageY - this.offset.click.top > g[3]) h = g[3] + this.offset.click.top
            } if (b.grid) {
                h = this.originalPageY + Math.round((h - this.originalPageY) / b.grid[1]) * b.grid[1]; h = g ? !(h - this.offset.click.top < g[1] || h - this.offset.click.top > g[3]) ? h : !(h - this.offset.click.top < g[1]) ? h - b.grid[1] : h + b.grid[1] : h; e = this.originalPageX + Math.round((e - this.originalPageX) / b.grid[0]) * b.grid[0]; e = g ? !(e - this.offset.click.left < g[0] || e - this.offset.click.left > g[2]) ? e : !(e - this.offset.click.left <
g[0]) ? e - b.grid[0] : e + b.grid[0] : e
            } 
        } return { top: h - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (d.browser.safari && d.browser.version < 526 && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : f ? 0 : c.scrollTop()), left: e - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (d.browser.safari && d.browser.version < 526 && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : f ? 0 : c.scrollLeft())}
    }, _clear: function () {
        this.helper.removeClass("ui-draggable-dragging");
        this.helper[0] != this.element[0] && !this.cancelHelperRemoval && this.helper.remove(); this.helper = null; this.cancelHelperRemoval = false
    }, _trigger: function (a, b, c) { c = c || this._uiHash(); d.ui.plugin.call(this, a, [b, c]); if (a == "drag") this.positionAbs = this._convertPositionTo("absolute"); return d.Widget.prototype._trigger.call(this, a, b, c) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } 
    }); d.extend(d.ui.draggable, { version: "1.8.13" });
    d.ui.plugin.add("draggable", "connectToSortable", { start: function (a, b) { var c = d(this).data("draggable"), f = c.options, e = d.extend({}, b, { item: c.element }); c.sortables = []; d(f.connectToSortable).each(function () { var h = d.data(this, "sortable"); if (h && !h.options.disabled) { c.sortables.push({ instance: h, shouldRevert: h.options.revert }); h.refreshPositions(); h._trigger("activate", a, e) } }) }, stop: function (a, b) {
        var c = d(this).data("draggable"), f = d.extend({}, b, { item: c.element }); d.each(c.sortables, function () {
            if (this.instance.isOver) {
                this.instance.isOver =
0; c.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) this.instance.options.revert = true; this.instance._mouseStop(a); this.instance.options.helper = this.instance.options._helper; c.options.helper == "original" && this.instance.currentItem.css({ top: "auto", left: "auto" })
            } else { this.instance.cancelHelperRemoval = false; this.instance._trigger("deactivate", a, f) } 
        })
    }, drag: function (a, b) {
        var c = d(this).data("draggable"), f = this; d.each(c.sortables, function () {
            this.instance.positionAbs =
c.positionAbs; this.instance.helperProportions = c.helperProportions; this.instance.offset.click = c.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) {
                if (!this.instance.isOver) {
                    this.instance.isOver = 1; this.instance.currentItem = d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return b.helper[0] }; a.target = this.instance.currentItem[0]; this.instance._mouseCapture(a,
true); this.instance._mouseStart(a, true, true); this.instance.offset.click.top = c.offset.click.top; this.instance.offset.click.left = c.offset.click.left; this.instance.offset.parent.left -= c.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= c.offset.parent.top - this.instance.offset.parent.top; c._trigger("toSortable", a); c.dropped = this.instance.element; c.currentItem = c.element; this.instance.fromOutside = c
                } this.instance.currentItem && this.instance._mouseDrag(a)
            } else if (this.instance.isOver) {
                this.instance.isOver =
0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance._trigger("out", a, this.instance._uiHash(this.instance)); this.instance._mouseStop(a, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); this.instance.placeholder && this.instance.placeholder.remove(); c._trigger("fromSortable", a); c.dropped = false
            } 
        })
    } 
    }); d.ui.plugin.add("draggable", "cursor", { start: function () {
        var a = d("body"), b = d(this).data("draggable").options; if (a.css("cursor")) b._cursor =
a.css("cursor"); a.css("cursor", b.cursor)
    }, stop: function () { var a = d(this).data("draggable").options; a._cursor && d("body").css("cursor", a._cursor) } 
    }); d.ui.plugin.add("draggable", "opacity", { start: function (a, b) { a = d(b.helper); b = d(this).data("draggable").options; if (a.css("opacity")) b._opacity = a.css("opacity"); a.css("opacity", b.opacity) }, stop: function (a, b) { a = d(this).data("draggable").options; a._opacity && d(b.helper).css("opacity", a._opacity) } }); d.ui.plugin.add("draggable", "scroll", { start: function () {
        var a = d(this).data("draggable");
        if (a.scrollParent[0] != document && a.scrollParent[0].tagName != "HTML") a.overflowOffset = a.scrollParent.offset()
    }, drag: function (a) {
        var b = d(this).data("draggable"), c = b.options, f = false; if (b.scrollParent[0] != document && b.scrollParent[0].tagName != "HTML") {
            if (!c.axis || c.axis != "x") if (b.overflowOffset.top + b.scrollParent[0].offsetHeight - a.pageY < c.scrollSensitivity) b.scrollParent[0].scrollTop = f = b.scrollParent[0].scrollTop + c.scrollSpeed; else if (a.pageY - b.overflowOffset.top < c.scrollSensitivity) b.scrollParent[0].scrollTop =
f = b.scrollParent[0].scrollTop - c.scrollSpeed; if (!c.axis || c.axis != "y") if (b.overflowOffset.left + b.scrollParent[0].offsetWidth - a.pageX < c.scrollSensitivity) b.scrollParent[0].scrollLeft = f = b.scrollParent[0].scrollLeft + c.scrollSpeed; else if (a.pageX - b.overflowOffset.left < c.scrollSensitivity) b.scrollParent[0].scrollLeft = f = b.scrollParent[0].scrollLeft - c.scrollSpeed
        } else {
            if (!c.axis || c.axis != "x") if (a.pageY - d(document).scrollTop() < c.scrollSensitivity) f = d(document).scrollTop(d(document).scrollTop() - c.scrollSpeed);
            else if (d(window).height() - (a.pageY - d(document).scrollTop()) < c.scrollSensitivity) f = d(document).scrollTop(d(document).scrollTop() + c.scrollSpeed); if (!c.axis || c.axis != "y") if (a.pageX - d(document).scrollLeft() < c.scrollSensitivity) f = d(document).scrollLeft(d(document).scrollLeft() - c.scrollSpeed); else if (d(window).width() - (a.pageX - d(document).scrollLeft()) < c.scrollSensitivity) f = d(document).scrollLeft(d(document).scrollLeft() + c.scrollSpeed)
        } f !== false && d.ui.ddmanager && !c.dropBehaviour && d.ui.ddmanager.prepareOffsets(b,
a)
    } 
    }); d.ui.plugin.add("draggable", "snap", { start: function () { var a = d(this).data("draggable"), b = a.options; a.snapElements = []; d(b.snap.constructor != String ? b.snap.items || ":data(draggable)" : b.snap).each(function () { var c = d(this), f = c.offset(); this != a.element[0] && a.snapElements.push({ item: this, width: c.outerWidth(), height: c.outerHeight(), top: f.top, left: f.left }) }) }, drag: function (a, b) {
        for (var c = d(this).data("draggable"), f = c.options, e = f.snapTolerance, h = b.offset.left, g = h + c.helperProportions.width, n = b.offset.top,
o = n + c.helperProportions.height, i = c.snapElements.length - 1; i >= 0; i--) {
            var j = c.snapElements[i].left, l = j + c.snapElements[i].width, k = c.snapElements[i].top, m = k + c.snapElements[i].height; if (j - e < h && h < l + e && k - e < n && n < m + e || j - e < h && h < l + e && k - e < o && o < m + e || j - e < g && g < l + e && k - e < n && n < m + e || j - e < g && g < l + e && k - e < o && o < m + e) {
                if (f.snapMode != "inner") {
                    var p = Math.abs(k - o) <= e, q = Math.abs(m - n) <= e, r = Math.abs(j - g) <= e, s = Math.abs(l - h) <= e; if (p) b.position.top = c._convertPositionTo("relative", { top: k - c.helperProportions.height, left: 0 }).top - c.margins.top;
                    if (q) b.position.top = c._convertPositionTo("relative", { top: m, left: 0 }).top - c.margins.top; if (r) b.position.left = c._convertPositionTo("relative", { top: 0, left: j - c.helperProportions.width }).left - c.margins.left; if (s) b.position.left = c._convertPositionTo("relative", { top: 0, left: l }).left - c.margins.left
                } var t = p || q || r || s; if (f.snapMode != "outer") {
                    p = Math.abs(k - n) <= e; q = Math.abs(m - o) <= e; r = Math.abs(j - h) <= e; s = Math.abs(l - g) <= e; if (p) b.position.top = c._convertPositionTo("relative", { top: k, left: 0 }).top - c.margins.top; if (q) b.position.top =
c._convertPositionTo("relative", { top: m - c.helperProportions.height, left: 0 }).top - c.margins.top; if (r) b.position.left = c._convertPositionTo("relative", { top: 0, left: j }).left - c.margins.left; if (s) b.position.left = c._convertPositionTo("relative", { top: 0, left: l - c.helperProportions.width }).left - c.margins.left
                } if (!c.snapElements[i].snapping && (p || q || r || s || t)) c.options.snap.snap && c.options.snap.snap.call(c.element, a, d.extend(c._uiHash(), { snapItem: c.snapElements[i].item })); c.snapElements[i].snapping = p || q || r || s || t
            } else {
                c.snapElements[i].snapping &&
c.options.snap.release && c.options.snap.release.call(c.element, a, d.extend(c._uiHash(), { snapItem: c.snapElements[i].item })); c.snapElements[i].snapping = false
            } 
        } 
    } 
    }); d.ui.plugin.add("draggable", "stack", { start: function () { var a = d(this).data("draggable").options; a = d.makeArray(d(a.stack)).sort(function (c, f) { return (parseInt(d(c).css("zIndex"), 10) || 0) - (parseInt(d(f).css("zIndex"), 10) || 0) }); if (a.length) { var b = parseInt(a[0].style.zIndex) || 0; d(a).each(function (c) { this.style.zIndex = b + c }); this[0].style.zIndex = b + a.length } } });
    d.ui.plugin.add("draggable", "zIndex", { start: function (a, b) { a = d(b.helper); b = d(this).data("draggable").options; if (a.css("zIndex")) b._zIndex = a.css("zIndex"); a.css("zIndex", b.zIndex) }, stop: function (a, b) { a = d(this).data("draggable").options; a._zIndex && d(b.helper).css("zIndex", a._zIndex) } })
})(jQuery);
;

//--------------------------------------------------------------------------------------------------------------
    //Masked Input TextBox
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2009 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 
Version: 1.2.2 (03/09/2009 22:39:06)
*/
(function (a) { var c = (a.browser.msie ? "paste" : "input") + ".mask"; var b = (window.orientation != undefined); a.mask = { definitions: { "9": "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]"} }; a.fn.extend({ caret: function (e, f) { if (this.length == 0) { return } if (typeof e == "number") { f = (typeof f == "number") ? f : e; return this.each(function () { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(e, f) } else { if (this.createTextRange) { var g = this.createTextRange(); g.collapse(true); g.moveEnd("character", f); g.moveStart("character", e); g.select() } } }) } else { if (this[0].setSelectionRange) { e = this[0].selectionStart; f = this[0].selectionEnd } else { if (document.selection && document.selection.createRange) { var d = document.selection.createRange(); e = 0 - d.duplicate().moveStart("character", -100000); f = e + d.text.length } } return { begin: e, end: f} } }, unmask: function () { return this.trigger("unmask") }, mask: function (j, d) { if (!j && this.length > 0) { var f = a(this[0]); var g = f.data("tests"); return a.map(f.data("buffer"), function (l, m) { return g[m] ? l : null }).join("") } d = a.extend({ placeholder: "_", completed: null }, d); var k = a.mask.definitions; var g = []; var e = j.length; var i = null; var h = j.length; a.each(j.split(""), function (m, l) { if (l == "?") { h--; e = m } else { if (k[l]) { g.push(new RegExp(k[l])); if (i == null) { i = g.length - 1 } } else { g.push(null) } } }); return this.each(function () { var r = a(this); var m = a.map(j.split(""), function (x, y) { if (x != "?") { return k[x] ? d.placeholder : x } }); var n = false; var q = r.val(); r.data("buffer", m).data("tests", g); function v(x) { while (++x <= h && !g[x]) { } return x } function t(x) { while (!g[x] && --x >= 0) { } for (var y = x; y < h; y++) { if (g[y]) { m[y] = d.placeholder; var z = v(y); if (z < h && g[y].test(m[z])) { m[y] = m[z] } else { break } } } s(); r.caret(Math.max(i, x)) } function u(y) { for (var A = y, z = d.placeholder; A < h; A++) { if (g[A]) { var B = v(A); var x = m[A]; m[A] = z; if (B < h && g[B].test(x)) { z = x } else { break } } } } function l(y) { var x = a(this).caret(); var z = y.keyCode; n = (z < 16 || (z > 16 && z < 32) || (z > 32 && z < 41)); if ((x.begin - x.end) != 0 && (!n || z == 8 || z == 46)) { w(x.begin, x.end) } if (z == 8 || z == 46 || (b && z == 127)) { t(x.begin + (z == 46 ? 0 : -1)); return false } else { if (z == 27) { r.val(q); r.caret(0, p()); return false } } } function o(B) { if (n) { n = false; return (B.keyCode == 8) ? false : null } B = B || window.event; var C = B.charCode || B.keyCode || B.which; var z = a(this).caret(); if (B.ctrlKey || B.altKey || B.metaKey) { return true } else { if ((C >= 32 && C <= 125) || C > 186) { var x = v(z.begin - 1); if (x < h) { var A = String.fromCharCode(C); if (g[x].test(A)) { u(x); m[x] = A; s(); var y = v(x); a(this).caret(y); if (d.completed && y == h) { d.completed.call(r) } } } } } return false } function w(x, y) { for (var z = x; z < y && z < h; z++) { if (g[z]) { m[z] = d.placeholder } } } function s() { return r.val(m.join("")).val() } function p(y) { var z = r.val(); var C = -1; for (var B = 0, x = 0; B < h; B++) { if (g[B]) { m[B] = d.placeholder; while (x++ < z.length) { var A = z.charAt(x - 1); if (g[B].test(A)) { m[B] = A; C = B; break } } if (x > z.length) { break } } else { if (m[B] == z[x] && B != e) { x++; C = B } } } if (!y && C + 1 < e) { r.val(""); w(0, h) } else { if (y || C + 1 >= e) { s(); if (!y) { r.val(r.val().substring(0, C + 1)) } } } return (e ? B : i) } if (!r.attr("readonly")) { r.one("unmask", function () { r.unbind(".mask").removeData("buffer").removeData("tests") }).bind("focus.mask", function () { q = r.val(); var x = p(); s(); setTimeout(function () { if (x == j.length) { r.caret(0, x) } else { r.caret(x) } }, 0) }).bind("blur.mask", function () { p(); if (r.val() != q) { r.change() } }).bind("keydown.mask", l).bind("keypress.mask", o).bind(c, function () { setTimeout(function () { r.caret(p(true)) }, 0) }) } p() }) } }) })(jQuery);

//--------------------------------------------------------------------------------------------------------------
String.repeat = function (chr, count) {
    var str = "";
    for (var x = 0; x < count; x++) { str += chr };
    return str;
}

String.prototype.padL = function (width, pad) {
    if (!width || width < 1)
        return this;

    if (!pad) pad = " ";
    var length = width - this.length
    if (length < 1) return this.substr(0, width);

    return (String.repeat(pad, length) + this).substr(0, width);
}

String.prototype.padR = function (width, pad) {
    if (!width || width < 1)
        return this;

    if (!pad) pad = " ";
    var length = width - this.length
    if (length < 1) this.substr(0, width);

    return (this + String.repeat(pad, length)).substr(0, width);
}

Date.prototype.formatDate = function (format) {
    var date = this;
    if (!format)
        format = "MM/dd/yyyy";

    var month = date.getMonth() + 1;
    var year = date.getFullYear();

    format = format.replace("MM", month.toString().padL(2, "0"));

    if (format.indexOf("yyyy") > -1)
        format = format.replace("yyyy", year.toString());
    else if (format.indexOf("yy") > -1)
        format = format.replace("yy", year.toString().substr(2, 2));

    format = format.replace("dd", date.getDate().toString().padL(2, "0"));

    var hours = date.getHours();
    if (format.indexOf("t") > -1) {
        if (hours > 11)
            format = format.replace("t", "pm")
        else
            format = format.replace("t", "am")
    }
    if (format.indexOf("HH") > -1)
        format = format.replace("HH", hours.toString().padL(2, "0"));
    if (format.indexOf("hh") > -1) {
        if (hours > 12) hours - 12;
        if (hours == 0) hours = 12;
        format = format.replace("hh", hours.toString().padL(2, "0"));
    }
    if (format.indexOf("mm") > -1)
        format = format.replace("mm", date.getMinutes().toString().padL(2, "0"));
    if (format.indexOf("ss") > -1)
        format = format.replace("ss", date.getSeconds().toString().padL(2, "0"));
    return format;
}

String.prototype.formatDate = function (format) {
    var date = new Date(parseInt(this.replace(/\/Date\((\d+)\)\//g, '$1')));
    if (format == null)
        format = "yyyy-MM-ddTHH:mm:ssZ";
    return (format == null) ? date : date.formatDate(format);
}

String.prototype.hasInvalidChars = function () {
    // validate if there are < or >
    if (this.indexOf(">") > -1 || this.indexOf("<") > -1)
        return true;
    return false;
}

String.prototype.hasSpecialChars = function () {
    // Esta funcion valida uqe solo se ingresen letras, espacios y numeros , NINGUN SIMBOLO ESPECIAL
    var isInvalid = false;
    for (var i = 0; i < this.length; i++) {
        var code = this.charCodeAt(i);
        if ((code <= 47 || (code <= 58 && code >= 64) || (code <= 91 && code >= 96) || (code > 122)) && code != 32 && code != 13)
            isInvalid = true;
    }
    return isInvalid;
}

String.prototype.limitText = function (length) {
    if (this.length > length) {
        var messageAbr = this.substring(0, length);

        var index = messageAbr.lastIndexOf(' ');
        if (index > 0)
            messageAbr = messageAbr.substring(0, index);

        return messageAbr + "...";
    } else {
        return this.toString();
    }
    //return (this.length > length) ? this.substring(0, length) + "..." : this.toString();
}

// String.Format emulation Prototype
String.prototype.format = function () {
    var pattern = /\{\d+\}/g;
    var args = arguments;
    return this.replace(pattern, function (capture) { return args[capture.match(/\d+/)]; });
}
// bool parse prototype
String.prototype.bool = function () { return (/^true$/i).test(this); };

String.prototype.parseNumber = function () {
    return this.replace(/\$|\.|\%|\s/g, "").replace(/\,/, ".");
}

String.prototype.parseAmount = function () {
    var parsed = parseInt(this.parseNumber());
    return isNaN(parsed) ? 0 : parsed;
}

jQuery.fn.scrollFix = function (maxLength) {
    if ($(this).val().length > maxLength) {
        var scrollDown = $(".scrolldown");
        if (scrollDown.length > 0)
            scrollDown.click();
    }
    else {
        var scrollUp = $(".scrollup");
        if (scrollUp.length > 0)
            scrollUp.click();
    }
}

jQuery.fn.jqmCenterShow = function () {
    return $(this).jqm({ modal: true, overlay: 80 }).jqmCenter().jqmShow();
}

jQuery.fn.jqmCenter = function () {
    var $this = $(this);
    var top = ($(window).height() - $this.height()) / 2 + $(window).scrollTop();
    var left = ($(window).width() - $this.width()) / 2 + $(window).scrollLeft();
    $this.css("top", top).css("left", left);
    return $this;
}

jQuery.fn.centerToParent = function () {
    var $this = $(this);
    var $parent = $this.parent();
    var top = ($parent.height() - $this.height()) / 2;
    var left = ($parent.width() - $this.width()) / 2;
    $this.css("margin-top", top).css("margin-left", left);
    return $this;
}

jQuery.fn.numberBox = function () {
    $(this).each(function (i, elem) {
        // 48 - 57 / 96 - 105(numLock) : numbers
        // 8 - 46 - 9 : BACKSPACE, DELETE, TAB
        // 37, 40 : arrows.
        $(elem)
            .keydown(function (e) {
                return (e.which >= 48 && e.which <= 57) || (e.which >= 96 && e.which <= 105) || e.which == 8 || e.which == 46 || e.which == 9 || (e.which >= 37 && e.which <= 40);
            })
            .keyup(function (e) {
                return (e.which >= 48 && e.which <= 57) || (e.which >= 96 && e.which <= 105) || e.which == 8 || e.which == 46 || e.which == 9 || (e.which >= 37 && e.which <= 40);
            });
    });
}

jQuery.fn.telephoneBox = function () {
    var dashCode = isFirefox() ? 109 : 189;

    $(this).each(function (i, elem) {
        // 48 - 57 / 96 - 105(numLock) : numbers
        // 8 - 46 - 9 : BACKSPACE, DELETE, TAB
        // 37, 40 : arrows.
        // 109 or 189: dash.
        $(elem)
        .keydown(function (e) {
            return (e.which >= 48 && e.which <= 57) || (e.which >= 96 && e.which <= 105) || e.which == 8 || e.which == 46 || e.which == 9 || (e.which >= 37 && e.which <= 40) || e.which == dashCode;
        })
        .keyup(function (e) {
            return (e.which >= 48 && e.which <= 57) || (e.which >= 96 && e.which <= 105) || e.which == 8 || e.which == 46 || e.which == 9 || (e.which >= 37 && e.which <= 40) || e.which == dashCode;
        });
    });
}

jQuery.fn.slideUpRemove = function (callback) {
    var $item = $(this);
    $item.slideUp(400, function () {
        $item.remove();
        if (callback != undefined)
            callback();
    });
}

function showPasswordStrength(e) {
    var value = $(e.target).val();
    var passwordStrengthId = $(this).attr('strength-validator');

    var $divPasswordStrength = $('#' + passwordStrengthId);
    
    if (value.length == 0) {
        $divPasswordStrength.hide();
        return;
    }

    $divPasswordStrength.show();
    checkPasswordStrength(value, $(this));
}

function checkPasswordStrength(value, $element) {
    var minuscula = 0;
    var mayuscula = 0;
    var numero = 0;
    var simbolo = 0;

    for (i = 0; i < value.length; i++) {
        //si el codigo ASCII es el de las minusculas, pone a true el flag de minusculas  
        if (value.charCodeAt(i) >= 97 && value.charCodeAt(i) <= 122) {
            minuscula = 1;
            //si el codigo ASCII es el de las mayusculas, pone a true el flag de mayusculas  
        } else if (value.charCodeAt(i) >= 65 && value.charCodeAt(i) <= 90) {
            mayuscula = 1;
            //si el codigo ASCII es el de loss numeros, pone a true el flag de numeros  
        } else if (value.charCodeAt(i) >= 48 && value.charCodeAt(i) <= 57) {
            numero = 1;
            //si el codigo ASCII es el de loss simbolos imprimibles, pone a true el flag de simbolos
        } else if ((value.charCodeAt(i) >= 123 && value.charCodeAt(i) <= 126) || (value.charCodeAt(i) >= 91 && value.charCodeAt(i) <= 96) || (value.charCodeAt(i) >= 32 && value.charCodeAt(i) <= 47) || (value.charCodeAt(i) >= 58 && value.charCodeAt(i) <= 64)) {
            simbolo = 1;
        }
    }

    var passwordStrengthId = $element.attr('strength-validator');

    var $divPasswordStrength = $('#' + passwordStrengthId);
    
    var result = numero + simbolo + mayuscula + minuscula > 1 && value.length >= 8;
    if (result)
        $divPasswordStrength.addClass('securityFull');
    else
        $divPasswordStrength.removeClass('securityFull');
    return result;
}

jQuery.validator.addMethod("passwordStrength", function (value, element) {
    return checkPasswordStrength(value, $(element));
});

jQuery.validator.addMethod('required', function (value, element) {
    return value != '' && $(element).attr('title') != value;
});

function goTo(url) {
    window.location.href = url;
    return false;
}

function changeUrl(url) {
    if (!('replaceState' in window.history)) return;
    window.history.replaceState(null, '', url);
}

/*********************************************************************************/

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject = function () { var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [h], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function () { var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/.test(Y) : /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = ! +"\v1", ag = [0, 0, 0], ab = null; if (typeof t.plugins != D && typeof t.plugins[S] == r) { ab = t.plugins[S].description; if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) { T = true; X = false; ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10); ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10); ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0 } } else { if (typeof O.ActiveXObject != D) { try { var ad = new ActiveXObject(W); if (ad) { ab = ad.GetVariable("$version"); if (ab) { X = true; ab = ab.split(" ")[1].split(","); ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } } catch (Z) { } } } return { w3: aa, pv: ag, wk: af, ie: X, win: ae, mac: ac} } (), k = function () { if (!M.w3) { return } if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) { f() } if (!J) { if (typeof j.addEventListener != D) { j.addEventListener("DOMContentLoaded", f, false) } if (M.ie && M.win) { j.attachEvent(x, function () { if (j.readyState == "complete") { j.detachEvent(x, arguments.callee); f() } }); if (O == top) { (function () { if (J) { return } try { j.documentElement.doScroll("left") } catch (X) { setTimeout(arguments.callee, 0); return } f() })() } } if (M.wk) { (function () { if (J) { return } if (!/loaded|complete/.test(j.readyState)) { setTimeout(arguments.callee, 0); return } f() })() } s(f) } } (); function f() { if (J) { return } try { var Z = j.getElementsByTagName("body")[0].appendChild(C("span")); Z.parentNode.removeChild(Z) } catch (aa) { return } J = true; var X = U.length; for (var Y = 0; Y < X; Y++) { U[Y]() } } function K(X) { if (J) { X() } else { U[U.length] = X } } function s(Y) { if (typeof O.addEventListener != D) { O.addEventListener("load", Y, false) } else { if (typeof j.addEventListener != D) { j.addEventListener("load", Y, false) } else { if (typeof O.attachEvent != D) { i(O, "onload", Y) } else { if (typeof O.onload == "function") { var X = O.onload; O.onload = function () { X(); Y() } } else { O.onload = Y } } } } } function h() { if (T) { V() } else { H() } } function V() { var X = j.getElementsByTagName("body")[0]; var aa = C(r); aa.setAttribute("type", q); var Z = X.appendChild(aa); if (Z) { var Y = 0; (function () { if (typeof Z.GetVariable != D) { var ab = Z.GetVariable("$version"); if (ab) { ab = ab.split(" ")[1].split(","); M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } else { if (Y < 10) { Y++; setTimeout(arguments.callee, 10); return } } X.removeChild(aa); Z = null; H() })() } else { H() } } function H() { var ag = o.length; if (ag > 0) { for (var af = 0; af < ag; af++) { var Y = o[af].id; var ab = o[af].callbackFn; var aa = { success: false, id: Y }; if (M.pv[0] > 0) { var ae = c(Y); if (ae) { if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) { w(Y, true); if (ab) { aa.success = true; aa.ref = z(Y); ab(aa) } } else { if (o[af].expressInstall && A()) { var ai = {}; ai.data = o[af].expressInstall; ai.width = ae.getAttribute("width") || "0"; ai.height = ae.getAttribute("height") || "0"; if (ae.getAttribute("class")) { ai.styleclass = ae.getAttribute("class") } if (ae.getAttribute("align")) { ai.align = ae.getAttribute("align") } var ah = {}; var X = ae.getElementsByTagName("param"); var ac = X.length; for (var ad = 0; ad < ac; ad++) { if (X[ad].getAttribute("name").toLowerCase() != "movie") { ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value") } } P(ai, ah, Y, ab) } else { p(ae); if (ab) { ab(aa) } } } } } else { w(Y, true); if (ab) { var Z = z(Y); if (Z && typeof Z.SetVariable != D) { aa.success = true; aa.ref = Z } ab(aa) } } } } } function z(aa) { var X = null; var Y = c(aa); if (Y && Y.nodeName == "OBJECT") { if (typeof Y.SetVariable != D) { X = Y } else { var Z = Y.getElementsByTagName(r)[0]; if (Z) { X = Z } } } return X } function A() { return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312) } function P(aa, ab, X, Z) { a = true; E = Z || null; B = { success: false, id: X }; var ae = c(X); if (ae) { if (ae.nodeName == "OBJECT") { l = g(ae); Q = null } else { l = ae; Q = X } aa.id = R; if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) { aa.width = "310" } if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) { aa.height = "137" } j.title = j.title.slice(0, 47) + " - Flash Player Installation"; var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title; if (typeof ab.flashvars != D) { ab.flashvars += "&" + ac } else { ab.flashvars = ac } if (M.ie && M.win && ae.readyState != 4) { var Y = C("div"); X += "SWFObjectNew"; Y.setAttribute("id", X); ae.parentNode.insertBefore(Y, ae); ae.style.display = "none"; (function () { if (ae.readyState == 4) { ae.parentNode.removeChild(ae) } else { setTimeout(arguments.callee, 10) } })() } u(aa, ab, X) } } function p(Y) { if (M.ie && M.win && Y.readyState != 4) { var X = C("div"); Y.parentNode.insertBefore(X, Y); X.parentNode.replaceChild(g(Y), X); Y.style.display = "none"; (function () { if (Y.readyState == 4) { Y.parentNode.removeChild(Y) } else { setTimeout(arguments.callee, 10) } })() } else { Y.parentNode.replaceChild(g(Y), Y) } } function g(ab) { var aa = C("div"); if (M.win && M.ie) { aa.innerHTML = ab.innerHTML } else { var Y = ab.getElementsByTagName(r)[0]; if (Y) { var ad = Y.childNodes; if (ad) { var X = ad.length; for (var Z = 0; Z < X; Z++) { if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) { aa.appendChild(ad[Z].cloneNode(true)) } } } } } return aa } function u(ai, ag, Y) { var X, aa = c(Y); if (M.wk && M.wk < 312) { return X } if (aa) { if (typeof ai.id == D) { ai.id = Y } if (M.ie && M.win) { var ah = ""; for (var ae in ai) { if (ai[ae] != Object.prototype[ae]) { if (ae.toLowerCase() == "data") { ag.movie = ai[ae] } else { if (ae.toLowerCase() == "styleclass") { ah += ' class="' + ai[ae] + '"' } else { if (ae.toLowerCase() != "classid") { ah += " " + ae + '="' + ai[ae] + '"' } } } } } var af = ""; for (var ad in ag) { if (ag[ad] != Object.prototype[ad]) { af += '<param name="' + ad + '" value="' + ag[ad] + '" />' } } aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>"; N[N.length] = ai.id; X = c(ai.id) } else { var Z = C(r); Z.setAttribute("type", q); for (var ac in ai) { if (ai[ac] != Object.prototype[ac]) { if (ac.toLowerCase() == "styleclass") { Z.setAttribute("class", ai[ac]) } else { if (ac.toLowerCase() != "classid") { Z.setAttribute(ac, ai[ac]) } } } } for (var ab in ag) { if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") { e(Z, ab, ag[ab]) } } aa.parentNode.replaceChild(Z, aa); X = Z } } return X } function e(Z, X, Y) { var aa = C("param"); aa.setAttribute("name", X); aa.setAttribute("value", Y); Z.appendChild(aa) } function y(Y) { var X = c(Y); if (X && X.nodeName == "OBJECT") { if (M.ie && M.win) { X.style.display = "none"; (function () { if (X.readyState == 4) { b(Y) } else { setTimeout(arguments.callee, 10) } })() } else { X.parentNode.removeChild(X) } } } function b(Z) { var Y = c(Z); if (Y) { for (var X in Y) { if (typeof Y[X] == "function") { Y[X] = null } } Y.parentNode.removeChild(Y) } } function c(Z) { var X = null; try { X = j.getElementById(Z) } catch (Y) { } return X } function C(X) { return j.createElement(X) } function i(Z, X, Y) { Z.attachEvent(X, Y); I[I.length] = [Z, X, Y] } function F(Z) { var Y = M.pv, X = Z.split("."); X[0] = parseInt(X[0], 10); X[1] = parseInt(X[1], 10) || 0; X[2] = parseInt(X[2], 10) || 0; return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false } function v(ac, Y, ad, ab) { if (M.ie && M.mac) { return } var aa = j.getElementsByTagName("head")[0]; if (!aa) { return } var X = (ad && typeof ad == "string") ? ad : "screen"; if (ab) { n = null; G = null } if (!n || G != X) { var Z = C("style"); Z.setAttribute("type", "text/css"); Z.setAttribute("media", X); n = aa.appendChild(Z); if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) { n = j.styleSheets[j.styleSheets.length - 1] } G = X } if (M.ie && M.win) { if (n && typeof n.addRule == r) { n.addRule(ac, Y) } } else { if (n && typeof j.createTextNode != D) { n.appendChild(j.createTextNode(ac + " {" + Y + "}")) } } } function w(Z, X) { if (!m) { return } var Y = X ? "visible" : "hidden"; if (J && c(Z)) { c(Z).style.visibility = Y } else { v("#" + Z, "visibility:" + Y) } } function L(Y) { var Z = /[\\\"<>\.;]/; var X = Z.exec(Y) != null; return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y } var d = function () { if (M.ie && M.win) { window.attachEvent("onunload", function () { var ac = I.length; for (var ab = 0; ab < ac; ab++) { I[ab][0].detachEvent(I[ab][1], I[ab][2]) } var Z = N.length; for (var aa = 0; aa < Z; aa++) { y(N[aa]) } for (var Y in M) { M[Y] = null } M = null; for (var X in swfobject) { swfobject[X] = null } swfobject = null }) } } (); return { registerObject: function (ab, X, aa, Z) { if (M.w3 && ab && X) { var Y = {}; Y.id = ab; Y.swfVersion = X; Y.expressInstall = aa; Y.callbackFn = Z; o[o.length] = Y; w(ab, false) } else { if (Z) { Z({ success: false, id: ab }) } } }, getObjectById: function (X) { if (M.w3) { return z(X) } }, embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) { var X = { success: false, id: ah }; if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) { w(ah, false); K(function () { ae += ""; ag += ""; var aj = {}; if (af && typeof af === r) { for (var al in af) { aj[al] = af[al] } } aj.data = ab; aj.width = ae; aj.height = ag; var am = {}; if (ad && typeof ad === r) { for (var ak in ad) { am[ak] = ad[ak] } } if (Z && typeof Z === r) { for (var ai in Z) { if (typeof am.flashvars != D) { am.flashvars += "&" + ai + "=" + Z[ai] } else { am.flashvars = ai + "=" + Z[ai] } } } if (F(Y)) { var an = u(aj, am, ah); if (aj.id == ah) { w(ah, true) } X.success = true; X.ref = an } else { if (aa && A()) { aj.data = aa; P(aj, am, ah, ac); return } else { w(ah, true) } } if (ac) { ac(X) } }) } else { if (ac) { ac(X) } } }, switchOffAutoHideShow: function () { m = false }, ua: M, getFlashPlayerVersion: function () { return { major: M.pv[0], minor: M.pv[1], release: M.pv[2]} }, hasFlashPlayerVersion: F, createSWF: function (Z, Y, X) { if (M.w3) { return u(Z, Y, X) } else { return undefined } }, showExpressInstall: function (Z, aa, X, Y) { if (M.w3 && A()) { P(Z, aa, X, Y) } }, removeSWF: function (X) { if (M.w3) { y(X) } }, createCSS: function (aa, Z, Y, X) { if (M.w3) { v(aa, Z, Y, X) } }, addDomLoadEvent: K, addLoadEvent: s, getQueryParamValue: function (aa) { var Z = j.location.search || j.location.hash; if (Z) { if (/\?/.test(Z)) { Z = Z.split("?")[1] } if (aa == null) { return L(Z) } var Y = Z.split("&"); for (var X = 0; X < Y.length; X++) { if (Y[X].substring(0, Y[X].indexOf("=")) == aa) { return L(Y[X].substring((Y[X].indexOf("=") + 1))) } } } return "" }, expressInstallCallback: function () { if (a) { var X = c(R); if (X && l) { X.parentNode.replaceChild(l, X); if (Q) { w(Q, true); if (M.ie && M.win) { l.style.display = "block" } } if (E) { E(B) } } a = false } } } } ();

/*********************************************************************************/

/*	
*	jQuery carouFredSel 3.2.1
*	Demo's and documentation:
*	caroufredsel.frebsite.nl
*	
*	Copyright (c) 2010 Fred Heusschen
*	www.frebsite.nl
*
*	Dual licensed under the MIT and GPL licenses.
*	http://en.wikipedia.org/wiki/MIT_License
*	http://en.wikipedia.org/wiki/GNU_General_Public_License
*/

eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(v($){$.1h.1i=v(o){9(I.U==0)y 14(\'3h 3i 2t.\');9(I.U>1){y I.1x(v(){$(I).1i(o)})}I.2u=v(o){9(q o!=\'1a\')o={};9(q o.S==\'C\'){9(o.S<=3j)o.S={u:o.S};A o.S={W:o.S}}A{9(q o.S==\'15\')o.S={X:o.S}}9(q o.u==\'C\')o.u={G:o.u};A 9(q o.u==\'15\')o.u={G:o.u,1K:o.u,1L:o.u};8=$.1M(K,{},$.1h.1i.2L,o);8.P=2M(8.P);8.11=(8.P[0]==0&&8.P[1]==0&&8.P[2]==0&&8.P[3]==0)?Q:K;1j=(8.1j==\'2N\'||8.1j==\'1k\')?\'E\':\'H\';9(8.1j==\'2O\'||8.1j==\'1k\'){8.w=[\'1K\',\'2P\',\'1L\',\'2Q\',\'1k\',\'22\',\'3k\',\'3l\']}A{8.w=[\'1L\',\'2Q\',\'1K\',\'2P\',\'22\',\'1k\',\'3m\',\'3n\'];8.P=[8.P[3],8.P[2],8.P[1],8.P[0]]}9(8[8.w[2]]==\'L\'){8[8.w[2]]=1l(8,J(j))[1];8.u[8.w[2]]=\'L\'}A{9(!8.u[8.w[2]]){8.u[8.w[2]]=J(j)[8.w[3]](K)}}9(!8.u[8.w[0]]){8.u[8.w[0]]=J(j)[8.w[1]](K)}9(8.u.G==\'3o\'){9(q 8[8.w[0]]==\'C\'){8.1y=8[8.w[0]];8[8.w[0]]=1N}A{8.1y=l.1O()[8.w[7]]()}9(q 8.u[8.w[0]]==\'C\'){8.u.G=2v.3p(8.1y/8.u[8.w[0]])}A{2w=K;8.u.G=0}}9(q 8.u.1P!=\'C\')8.u.1P=8.u.G;9(q 8.S.u!=\'C\')8.S.u=8.u.G;9(q 8.S.W!=\'C\')8.S.W=3q;8.L=1Q(8.L,Q,K);8.H=1Q(8.H);8.E=1Q(8.E);8.T=1Q(8.T,K);8.L=$.1M({},8.S,8.L);8.H=$.1M({},8.S,8.H);8.E=$.1M({},8.S,8.E);8.T=$.1M({},8.S,8.T);9(q 8.T.23!=\'Z\')8.T.23=Q;9(q 8.T.2x!=\'v\')8.T.2x=$.1h.1i.2R;9(q 8.L.V!=\'Z\')8.L.V=K;9(q 8.L.1R!=\'Z\')8.L.1R=K;9(q 8.L.2y!=\'C\')8.L.2y=0;9(q 8.L.24!=\'C\')8.L.24=(8.L.W<10)?3r:8.L.W*5};I.2S=v(){l.O({25:\'3s\',3t:\'3u\'});j.z(\'2T\',{1K:j.O(\'1K\'),1L:j.O(\'1L\'),25:j.O(\'25\'),22:j.O(\'22\'),1k:j.O(\'1k\')}).O({25:\'3v\'});9(8.11){J(j).1x(v(){D m=1S($(I).O(8.w[6]));9(26(m))m=0;$(I).z(\'Y\',m)})}27(8,F)};I.2U=v(){j.16(\'1e\',v(e,g){9(q g!=\'Z\')g=Q;9(g)1m=K;9(28!=1N){3w(28)}9(29!=1N){3x(29)}});j.16(\'V\',v(e,d,f,g){j.B(\'1e\');9(8.L.V){9(q g!=\'Z\'){9(q f==\'Z\')g=f;A 9(q d==\'Z\')g=d;A g=Q}9(q f!=\'C\'){9(q d==\'C\')f=d;A f=0}9(d!=\'H\'&&d!=\'E\')d=1j;9(g)1m=Q;9(1m)y;28=3y(v(){9(j.1b(\':1z\')){j.B(\'V\',d)}A{2a=0;j.B(d,8.L)}},8.L.24+f-2a);9(8.L.1A===\'3z\'){29=3A(v(){2a+=2V},2V)}}});9(2w){j.16(\'H\',v(e,b,c){9(j.1b(\':1z\'))y;9(1m)y;D d=J(j),1n=0,x=0;9(q b==\'C\')c=b;9(q c!=\'C\'){1T(D a=d.U-1;a>=0;a--){1f=d.18(\':2z(\'+a+\')\')[8.w[1]](K);9(1n+1f>8.1y)2A;1n+=1f;x++}c=x}1T(D a=d.U-c;a<d.U;a++){1f=d.18(\':2z(\'+a+\')\')[8.w[1]](K);9(1n+1f>8.1y)2A;1n+=1f;9(a==d.U-1)a=0;x++};8.u.G=x;j.B(\'2B\',[b,c])});j.16(\'E\',v(e,b,c){9(j.1b(\':1z\'))y;9(1m)y;D d=J(j),1n=0,x=0;9(q b==\'C\')c=b;9(q c!=\'C\')c=8.u.G;1T(D a=c;a<d.U;a++){1f=d.18(\':2z(\'+a+\')\')[8.w[1]](K);9(1n+1f>8.1y)2A;1n+=1f;9(a==d.U-1)a=0;x++};8.u.G=x;j.B(\'2C\',[b,c])}).B(\'E\',{W:0})}A{j.16(\'H\',v(e,a,b){j.B(\'2B\',[a,b])});j.16(\'E\',v(e,a,b){j.B(\'2C\',[a,b])})}j.16(\'2B\',v(e,b,c){9(j.1b(\':1z\'))y;9(1m)y;9(8.u.1P>=F)y 14(\'1t 2D u: 1U 1V\');9(q b==\'C\')c=b;9(q b!=\'1a\')b=8.H;9(q c!=\'C\')c=b.u;9(q c!=\'C\')y 14(\'1t a 2b C: 1U 1V\');9(!8.1u){D d=F-M;9(d-c<0){c=d}9(M==0){c=0}}M+=c;9(M>=F)M-=F;9(!8.1u){9(M==0&&c!=0&&8.H.2c){8.H.2c()}9(8.2d){9(c==0){j.B(\'E\',F-8.u.G);y Q}}A{9(M==0&&8.H.R)8.H.R.2e(\'1W\');9(8.E.R)8.E.R.2E(\'1W\')}}9(c==0){y Q}J(j,\':2f(\'+(F-c-1)+\')\').3B(j);9(F<8.u.G+c)J(j,\':1o(\'+((8.u.G+c)-F)+\')\').2W(K).2F(j);D f=2G(j,8,c),1p=J(j,\':1v(\'+(c-1)+\')\'),17=f[1].18(\':1B\'),1c=f[0].18(\':1B\');9(8.11)17.O(8.w[6],17.z(\'Y\'));D g=1l(8,J(j,\':1o(\'+c+\')\')),1q=2g(1l(8,f[0],K),8);9(8.11)17.O(8.w[6],17.z(\'Y\')+8.P[1]);D h={},2H={},1C={},N=b.W;9(N==\'L\')N=8.S.W/8.S.u*c;A 9(N<=0)N=0;A 9(N<10)N=g[0]/N;9(b.2h)b.2h(f[1],f[0],1q,N);9(8.11){D i=8.P[3];1C[8.w[6]]=1p.z(\'Y\');2H[8.w[6]]=1c.z(\'Y\')+8.P[1];1p.O(8.w[6],1p.z(\'Y\')+8.P[3]);1p.1D().1r(1C,{W:N,X:b.X});1c.1D().1r(2H,{W:N,X:b.X})}A{D i=0}h[8.w[4]]=i;9((q 8[8.w[0]]!=\'C\'&&q 8.u[8.w[0]]!=\'C\')||(q 8[8.w[2]]!=\'C\'&&q 8.u[8.w[2]]!=\'C\')){l.1D().1r(1q,{W:N,X:b.X})}j.z(\'1E\',c).z(\'1F\',b).z(\'2i\',f[1]).z(\'2j\',f[0]).z(\'2k\',1q).O(8.w[4],-g[0]).1r(h,{W:N,X:b.X,2X:v(){9(j.z(\'1F\').2l){j.z(\'1F\').2l(j.z(\'2i\'),j.z(\'2j\'),j.z(\'2k\'))}9(F<8.u.G+j.z(\'1E\')){J(j,\':2f(\'+(F-1)+\')\').1X()}D a=J(j,\':1v(\'+(8.u.G+j.z(\'1E\')-1)+\')\');9(8.11){a.O(8.w[6],a.z(\'Y\'))}}});j.B(\'1w\').B(\'V\',N)});j.16(\'2C\',v(e,c,d){9(j.1b(\':1z\'))y;9(1m)y;9(8.u.1P>=F)y 14(\'1t 2D u: 1U 1V\');9(q c==\'C\')d=c;9(q c!=\'1a\')c=8.E;9(q d!=\'C\')d=c.u;9(q d!=\'C\')y 14(\'1t a 2b C: 1U 1V\');9(!8.1u){9(M==0){9(d>F-8.u.G){d=F-8.u.G}}A{9(M-d<8.u.G){d=M-8.u.G}}}M-=d;9(M<0)M+=F;9(!8.1u){9(M==8.u.G&&d!=0&&8.E.2c){8.E.2c()}9(8.2d){9(d==0){j.B(\'H\',F-8.u.G);y Q}}A{9(M==8.u.G&&8.E.R)8.E.R.2e(\'1W\');9(8.H.R)8.H.R.2E(\'1W\')}}9(d==0){y Q}9(F<8.u.G+d)J(j,\':1o(\'+((8.u.G+d)-F)+\')\').2W(K).2F(j);D f=2G(j,8,d),1p=J(j,\':1v(\'+(d-1)+\')\'),17=f[0].18(\':1B\'),1c=f[1].18(\':1B\');9(8.11){17.O(8.w[6],17.z(\'Y\'));1c.O(8.w[6],1c.z(\'Y\'))}D g=1l(8,J(j,\':1o(\'+d+\')\')),1q=2g(1l(8,f[1],K),8);9(8.11){17.O(8.w[6],17.z(\'Y\')+8.P[1]);1c.O(8.w[6],1c.z(\'Y\')+8.P[1])}D h={},2I={},1C={},N=c.W;9(N==\'L\')N=8.S.W/8.S.u*d;A 9(N<=0)N=0;A 9(N<10)N=g[0]/N;9(c.2h)c.2h(f[0],f[1],1q,N);h[8.w[4]]=-g[0];9(8.11){2I[8.w[6]]=17.z(\'Y\');1C[8.w[6]]=1p.z(\'Y\')+8.P[3];1c.O(8.w[6],1c.z(\'Y\')+8.P[1]);17.1D().1r(2I,{W:N,X:c.X});1p.1D().1r(1C,{W:N,X:c.X})}9((q 8[8.w[0]]!=\'C\'&&q 8.u[8.w[0]]!=\'C\')||(q 8[8.w[2]]!=\'C\'&&q 8.u[8.w[2]]!=\'C\')){l.1D().1r(1q,{W:N,X:c.X})}j.z(\'1E\',d).z(\'1F\',c).z(\'2i\',f[0]).z(\'2j\',f[1]).z(\'2k\',1q).1r(h,{W:N,X:c.X,2X:v(){9(j.z(\'1F\').2l){j.z(\'1F\').2l(j.z(\'2i\'),j.z(\'2j\'),j.z(\'2k\'))}9(F<8.u.G+j.z(\'1E\')){J(j,\':2f(\'+(F-1)+\')\').1X()}D a=(8.11)?8.P[3]:0;j.O(8.w[4],a);D b=J(j,\':1o(\'+j.z(\'1E\')+\')\').2F(j).18(\':1B\');9(8.11){b.O(8.w[6],b.z(\'Y\'))}}});j.B(\'1w\').B(\'V\',N)});j.16(\'1G\',v(e,a,b,c,d){9(j.1b(\':1z\'))y Q;a=2m(a,b,c,M,F,j);9(a==0)y Q;9(q d!=\'1a\')d=Q;9(8.1u){9(a<F/2)j.B(\'E\',[d,a]);A j.B(\'H\',[d,F-a])}A{9(M==0||M>a)j.B(\'E\',[d,a]);A j.B(\'H\',[d,F-a])}}).16(\'2Y\',v(e,a,b,c,d){9(q a==\'1a\'&&q a.1Y==\'12\')a=$(a);9(q a==\'15\')a=$(a);9(q a!=\'1a\'||q a.1Y==\'12\'||a.U==0)y 14(\'1t a 2b 1a.\');9(q b==\'12\'||b==\'2Z\'){j.2J(a)}A{b=2m(b,d,c,M,F,j);D f=J(j,\':1v(\'+b+\')\');9(f.U){9(b<=M)M+=a.U;f.3C(a)}A{j.2J(a)}}F=J(j).U;1H(\'\',\'.2n\',j);1Z(j,8);27(8,F);j.B(\'1w\',K)}).16(\'30\',v(e,a,b,c){9(q a==\'12\'||a==\'2Z\'){J(j,\':1B\').1X()}A{a=2m(a,c,b,M,F,j);D d=J(j,\':1v(\'+a+\')\');9(d.U){9(a<M)M-=d.U;d.1X()}}F=J(j).U;1H(\'\',\'.2n\',j);1Z(j,8);27(8,F);j.B(\'1w\',K)}).16(\'1w\',v(e,b){9(!8.T.13)y Q;9(q b==\'Z\'&&b){J(8.T.13).1X();1T(D a=0;a<2v.3D(F/8.u.G);a++){8.T.13.2J(8.T.2x(a+1))}J(8.T.13).19(\'1I\').1x(v(a){$(I).1I(v(e){e.1g();j.B(\'1G\',[a*8.u.G,0,K,8.T])})})}D c=(M==0)?0:2v.3E((F-M)/8.u.G);J(8.T.13).2E(\'2t\').18(\':1v(\'+c+\')\').2e(\'2t\')})};I.31=v(){9(8.L.1A&&8.L.V){l.2o(v(){j.B(\'1e\')},v(){j.B(\'V\')})}9(8.H.R){8.H.R.1I(v(e){j.B(\'H\');e.1g()});9(8.H.1A&&8.L.V){8.H.R.2o(v(){j.B(\'1e\')},v(){j.B(\'V\')})}9(!8.1u&&!8.2d){8.H.R.2e(\'1W\')}}9($.1h.1d){9(8.H.1d){l.1d(v(e,a){9(a>0){e.1g();2p=(q 8.H.1d==\'C\')?8.H.1d:\'\';j.B(\'H\',2p)}})}9(8.E.1d){l.1d(v(e,a){9(a<0){e.1g();2p=(q 8.E.1d==\'C\')?8.E.1d:\'\';j.B(\'E\',2p)}})}}9(8.E.R){8.E.R.1I(v(e){e.1g();j.B(\'E\')});9(8.E.1A&&8.L.V){8.E.R.2o(v(){j.B(\'1e\')},v(){j.B(\'V\')})}}9(8.T.13){j.B(\'1w\',K);9(8.T.1A&&8.L.V){8.T.13.2o(v(){j.B(\'1e\')},v(){j.B(\'V\')})}}9(8.E.1s||8.H.1s){$(32).33(v(e){D k=e.34;9(k==8.E.1s){e.1g();j.B(\'E\')}9(k==8.H.1s){e.1g();j.B(\'H\')}})}9(8.T.23){$(32).33(v(e){D k=e.34;9(k>=49&&k<3F){k=(k-49)*8.u.G;9(k<=F){e.1g();j.B(\'1G\',[k,0,K,8.T])}}})}9(8.L.V){j.B(\'V\',8.L.2y);9($.1h.1R&&8.L.1R){j.1R(\'1e\',\'V\')}}};I.35=v(){j.B(\'1e\').O(j.z(\'2T\')).19(\'1e\').19(\'V\').19(\'H\').19(\'E\').19(\'3G\').19(\'1G\').19(\'2Y\').19(\'30\').19(\'1w\');l.3H(j);y I};I.3I=v(a,b){9(q a==\'12\')y 8;9(q b==\'12\'){D r=36(\'8.\'+a);9(q r==\'12\')r=\'\';y r}36(\'8.\'+a+\' = b\');I.2u(8);1Z(j,8);y I};I.1H=v(a,b){1H(a,b,j)};I.3J=v(){9(M==0){y 0}y F-M};D j=$(I);9($(I).1O().1b(\'.3a\')){D l=j.1O();I.35()}D l=$(I).3K(\'<3L 3M="3a" />\').1O(),8={},F=J(j).U,M=0,28=1N,29=1N,2a=0,1m=Q,1j=\'E\',2w=Q;I.2u(o);I.2S();I.2U();I.31();1H(\'\',\'.2n\',j);1Z(j,8);9(8.u.20!==0&&8.u.20!==Q){D s=8.u.20;9(8.u.20===K){s=2q.3N.3b;9(!s.U)s=0}j.B(\'1G\',[s,0,K,{W:0}])}y I};$.1h.1i.2L={2d:K,1u:K,1j:\'1k\',P:0,u:{G:5,20:0},S:{X:\'3O\',1A:Q,1d:Q}};$.1h.1i.2R=v(a){y\'<a 3P="#"><3c>\'+a+\'</3c></a>\'};v 1H(a,b,c){9(q a==\'12\'||a.U==0)a=$(\'3Q\');A 9(q a==\'15\')a=$(a);9(q a!=\'1a\')y Q;9(q b==\'12\')b=\'\';a.3R(\'a\'+b).1x(v(){D h=I.3b||\'\';9(h.U>0&&J(c).3d($(h))!=-1){$(I).19(\'1I\').1I(v(e){e.1g();c.B(\'1G\',h)})}})}v 27(o,t){9(o.u.1P>=t){14(\'1t 2D u: 1U 1V\');D f=\'3S\'}A{D f=\'3T\'}9(o.H.R)o.H.R[f]();9(o.E.R)o.E.R[f]();9(o.T.13)o.T.13[f]()}v 2K(k){9(k==\'2O\')y 39;9(k==\'1k\')y 37;9(k==\'2N\')y 38;9(k==\'3U\')y 40;y-1};v 1Q(a,b,c){9(q b!=\'Z\')b=Q;9(q c!=\'Z\')c=Q;9(q a==\'12\')a={};9(q a==\'15\'){D d=2K(a);9(d==-1)a=$(a);A a=d}9(b){9(q a.1Y!=\'12\')a={13:a};9(q 3V==\'Z\')a={23:a};9(q a.13==\'15\')a.13=$(a.13)}A 9(c){9(q a==\'Z\')a={V:a};9(q a==\'C\')a={24:a}}A{9(q a.1Y!=\'12\')a={R:a};9(q a==\'C\')a={1s:a};9(q a.R==\'15\')a.R=$(a.R);9(q a.1s==\'15\')a.1s=2K(a.1s)}y a};v J(a,f){9(q f!=\'15\')f=\'\';y $(\'> *\'+f,a)};v 2G(c,o,n){D a=J(c,\':1o(\'+o.u.G+\')\'),3e=J(c,\':1o(\'+(o.u.G+n)+\'):2f(\'+(n-1)+\')\');y[a,3e]};v 2m(a,b,c,d,e,f){9(q a==\'15\'){9(26(a))a=$(a);A a=1S(a)}9(q a==\'1a\'){9(q a.1Y==\'12\')a=$(a);a=J(f).3d(a);9(a==-1)a=0;9(q c!=\'Z\')c=Q}A{9(q c!=\'Z\')c=K}9(26(a))a=0;A a=1S(a);9(26(b))b=0;A b=1S(b);9(c){a+=d}a+=b;9(e>0){3f(a>=e){a-=e}3f(a<0){a+=e}}y a};v 1l(o,a,b){9(q b!=\'Z\')b=Q;D c=o.w,21=0,1J=0;9(b&&q o[c[0]]==\'C\')21+=o[c[0]];A 9(q o.u[c[0]]==\'C\')21+=o.u[c[0]]*a.U;A{a.1x(v(){21+=$(I)[c[1]](K)})}9(b&&q o[c[2]]==\'C\')1J+=o[c[2]];A 9(q o.u[c[2]]==\'C\')1J+=o.u[c[2]];A{a.1x(v(){D m=$(I)[c[3]](K);9(1J<m)1J=m})}y[21,1J]};v 2g(a,o){D b=(o.11)?o.P:[0,0,0,0];D c={};c[o.w[0]]=a[0]+b[1]+b[3];c[o.w[2]]=a[1]+b[0]+b[2];y c};v 1Z(a,o){D b=a.1O(),$i=J(a),$l=$i.18(\':1v(\'+(o.u.G-1)+\')\'),1b=1l(o,$i,Q);b.O(2g(1l(o,$i.18(\':1o(\'+o.u.G+\')\'),K),o));9(o.11){$l.O(o.w[6],$l.z(\'Y\')+o.P[1]);a.O(o.w[5],o.P[0]);a.O(o.w[4],o.P[3])}a.O(o.w[0],1b[0]*2);a.O(o.w[2],1b[1])};v 2M(p){9(q p==\'C\')p=[p];A 9(q p==\'15\')p=p.3g(\'3W\').3X(\'\').3g(\' \');9(q p!=\'1a\'){14(\'1t a 2b 3Y, P 3Z 41 "0".\');p=[0]}1T(i 42 p){p[i]=1S(p[i])}43(p.U){2r 0:y[0,0,0,0];2r 1:y[p[0],p[0],p[0],p[0]];2r 2:y[p[0],p[1],p[0],p[1]];2r 3:y[p[0],p[1],p[2],p[1]];44:y p}};v 14(m){9(q m==\'15\')m=\'1i: \'+m;9(2q.2s&&2q.2s.14)2q.2s.14(m);A 45{2s.14(m)}46(47){}y Q};$.1h.2n=v(o){I.1i(o)}})(48);', 62, 258, '||||||||opts|if|||||||||||||||||typeof||||items|function|dimentions||return|data|else|trigger|number|var|next|totalItems|visible|prev|this|getItems|true|auto|firstItem|a_dur|css|padding|false|button|scroll|pagination|length|play|duration|easing|cfs_origCssMargin|boolean||usePadding|undefined|container|log|string|bind|l_old|filter|unbind|object|is|l_new|mousewheel|pause|current|preventDefault|fn|carouFredSel|direction|left|getSizes|pausedGlobal|total|lt|l_cur|w_siz|animate|key|Not|circular|nth|updatePageStatus|each|maxDimention|animated|pauseOnHover|last|a_cur|stop|cfs_numItems|cfs_slideObj|slideTo|link_anchors|click|s2|width|height|extend|null|parent|minimum|getNaviObject|nap|parseInt|for|not|scrolling|disabled|remove|jquery|setSizes|start|s1|top|keys|pauseDuration|position|isNaN|showNavi|autoTimeout|autoInterval|pauseTimePassed|valid|onEnd|infinite|addClass|gt|mapWrapperSizes|onBefore|cfs_oldItems|cfs_newItems|cfs_wrapSize|onAfter|getItemIndex|caroufredsel|hover|num|window|case|console|selected|init|Math|varnumvisitem|anchorBuilder|delay|eq|break|scrollPrev|scrollNext|enough|removeClass|appendTo|getCurrentItems|a_new|a_old|append|getKeyCode|defaults|getPadding|up|right|outerWidth|outerHeight|pageAnchorBuilder|build|cfs_origCss|bind_events|100|clone|complete|insertItem|end|removeItem|bind_buttons|document|keyup|keyCode|destroy|eval||||caroufredsel_wrapper|hash|span|index|ni|while|split|No|element|50|marginRight|innerWidth|marginBottom|innerHeight|variable|floor|500|2500|relative|overflow|hidden|absolute|clearTimeout|clearInterval|setTimeout|resume|setInterval|prependTo|before|ceil|round|58|scrollTo|replaceWith|configuration|current_position|wrap|div|class|location|swing|href|body|find|hide|show|down|Object|px|join|value|set||to|in|switch|default|try|catch|err|jQuery|'.split('|'), 0, {}))

function moveKeyboard() {
    
    // make position sensitive to size and document's width
    var top = ((Math.random()) * ($(window).height() - $this.height()) / 2 + $(window).scrollTop());
    var left = ((Math.random()) * ($(window).width() - $this.width()) / 2 + $(window).scrollLeft());

    $('#keyboardInputMaster').css({
        'left': left + 'px',
        'top': top + 'px'
    }).draggable({ containment: '.layout' });
}


/*
* jQuery JSON Plugin
* version: 2.1 (2009-08-14)
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
*
* Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 
* website's http://www.json.org/json2.js, which proclaims:
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
* I uphold.
*
* It is also influenced heavily by MochiKit's serializeJSON, which is 
* copyrighted 2005 by Bob Ippolito.
*/
 
(function ($) {
    $.toJSON = function (o) {
        if (typeof (JSON) == 'object' && JSON.stringify)
            return JSON.stringify(o); var type = typeof (o); if (o === null)
            return "null"; if (type == "undefined")
            return undefined; if (type == "number" || type == "boolean")
            return o + ""; if (type == "string")
            return $.quoteString(o); if (type == 'object') {
            if (typeof o.toJSON == "function")
                return $.toJSON(o.toJSON()); if (o.constructor === Date) {
                var month = o.getUTCMonth() + 1; if (month < 10) month = '0' + month; var day = o.getUTCDate(); if (day < 10) day = '0' + day; var year = o.getUTCFullYear(); var hours = o.getUTCHours(); if (hours < 10) hours = '0' + hours; var minutes = o.getUTCMinutes(); if (minutes < 10) minutes = '0' + minutes; var seconds = o.getUTCSeconds(); if (seconds < 10) seconds = '0' + seconds; var milli = o.getUTCMilliseconds(); if (milli < 100) milli = '0' + milli; if (milli < 10) milli = '0' + milli; return '"' + year + '-' + month + '-' + day + 'T' +
hours + ':' + minutes + ':' + seconds + '.' + milli + 'Z"';
            }
            if (o.constructor === Array) {
                var ret = []; for (var i = 0; i < o.length; i++)
                    ret.push($.toJSON(o[i]) || "null"); return "[" + ret.join(",") + "]";
            }
            var pairs = []; for (var k in o) {
                var name; var type = typeof k; if (type == "number")
                    name = '"' + k + '"'; else if (type == "string")
                    name = $.quoteString(k); else
                    continue; if (typeof o[k] == "function")
                    continue; var val = $.toJSON(o[k]); pairs.push(name + ":" + val);
            }
            return "{" + pairs.join(", ") + "}";
        } 
    }; $.evalJSON = function (src) {
        if (typeof (JSON) == 'object' && JSON.parse)
            return JSON.parse(src); return eval("(" + src + ")");
    }; $.secureEvalJSON = function (src) {
        if (typeof (JSON) == 'object' && JSON.parse)
            return JSON.parse(src); var filtered = src; filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@'); filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); if (/^[\],:{}\s]*$/.test(filtered))
            return eval("(" + src + ")"); else
            throw new SyntaxError("Error parsing JSON, source is not valid.");
    }; $.quoteString = function (string) {
        if (_escapeable.test(string)) {
            return '"' + string.replace(_escapeable, function (a)
            { var c = _meta[a]; if (typeof c === 'string') return c; c = a.charCodeAt(); return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); }) + '"';
        }
        return '"' + string + '"';
    }; var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g; var _meta = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' };
})(jQuery);

/*
* ----------------------------- JSTORAGE -------------------------------------
* Simple local storage wrapper to save data on the browser side, supporting
* all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera 10.5+
*
* Copyright (c) 2010 Andris Reinman, andris.reinman@gmail.com
* Project homepage: www.jstorage.info
*
* Licensed under MIT-style license:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/**
* $.jStorage
* 
* USAGE:
*
* jStorage requires Prototype, MooTools or jQuery! If jQuery is used, then
* jQuery-JSON (http://code.google.com/p/jquery-json/) is also needed.
* (jQuery-JSON needs to be loaded BEFORE jStorage!)
*
* Methods:
*
* -set(key, value)
* $.jStorage.set(key, value) -> saves a value
*
* -get(key[, default])
* value = $.jStorage.get(key [, default]) ->
*    retrieves value if key exists, or default if it doesn't
*
* -deleteKey(key)
* $.jStorage.deleteKey(key) -> removes a key from the storage
*
* -flush()
* $.jStorage.flush() -> clears the cache
* 
* -storageObj()
* $.jStorage.storageObj() -> returns a read-ony copy of the actual storage
* 
* -storageSize()
* $.jStorage.storageSize() -> returns the size of the storage in bytes
*
* -index()
* $.jStorage.index() -> returns the used keys as an array
* 
* -storageAvailable()
* $.jStorage.storageAvailable() -> returns true if storage is available
* 
* -reInit()
* $.jStorage.reInit() -> reloads the data from browser storage
* 
* <value> can be any JSON-able value, including objects and arrays.
*
**/

(function (f) { if (!f || !(f.toJSON || Object.toJSON || window.JSON)) { throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!") } var g = {}, d = { jStorage: "{}" }, h = null, j = 0, l = f.toJSON || Object.toJSON || (window.JSON && (JSON.encode || JSON.stringify)), e = f.evalJSON || (window.JSON && (JSON.decode || JSON.parse)) || function (m) { return String(m).evalJSON() }, i = false; _XMLService = { isXML: function (n) { var m = (n ? n.ownerDocument || n : 0).documentElement; return m ? m.nodeName !== "HTML" : false }, encode: function (n) { if (!this.isXML(n)) { return false } try { return new XMLSerializer().serializeToString(n) } catch (m) { try { return n.xml } catch (o) { } } return false }, decode: function (n) { var m = ("DOMParser" in window && (new DOMParser()).parseFromString) || (window.ActiveXObject && function (p) { var q = new ActiveXObject("Microsoft.XMLDOM"); q.async = "false"; q.loadXML(p); return q }), o; if (!m) { return false } o = m.call("DOMParser" in window && (new DOMParser()) || window, n, "text/xml"); return this.isXML(o) ? o : false } }; function k() { if ("localStorage" in window) { try { if (window.localStorage) { d = window.localStorage; i = "localStorage" } } catch (p) { } } else { if ("globalStorage" in window) { try { if (window.globalStorage) { d = window.globalStorage[window.location.hostname]; i = "globalStorage" } } catch (o) { } } else { h = document.createElement("link"); if (h.addBehavior) { h.style.behavior = "url(#default#userData)"; document.getElementsByTagName("head")[0].appendChild(h); h.load("jStorage"); var n = "{}"; try { n = h.getAttribute("jStorage") } catch (m) { } d.jStorage = n; i = "userDataBehavior" } else { h = null; return } } } b() } function b() { if (d.jStorage) { try { g = e(String(d.jStorage)) } catch (m) { d.jStorage = "{}" } } else { d.jStorage = "{}" } j = d.jStorage ? String(d.jStorage).length : 0 } function c() { try { d.jStorage = l(g); if (h) { h.setAttribute("jStorage", d.jStorage); h.save("jStorage") } j = d.jStorage ? String(d.jStorage).length : 0 } catch (m) { } } function a(m) { if (!m || (typeof m != "string" && typeof m != "number")) { throw new TypeError("Key name must be string or numeric") } return true } f.jStorage = { version: "0.1.5.0", set: function (m, n) { a(m); if (_XMLService.isXML(n)) { n = { _is_xml: true, xml: _XMLService.encode(n)} } g[m] = n; c(); return n }, get: function (m, n) { a(m); if (m in g) { if (typeof g[m] == "object" && g[m]._is_xml && g[m]._is_xml) { return _XMLService.decode(g[m].xml) } else { return g[m] } } return typeof (n) == "undefined" ? null : n }, deleteKey: function (m) { a(m); if (m in g) { delete g[m]; c(); return true } return false }, flush: function () { g = {}; c(); try { window.localStorage.clear() } catch (m) { } return true }, storageObj: function () { function m() { } m.prototype = g; return new m() }, index: function () { var m = [], n; for (n in g) { if (g.hasOwnProperty(n)) { m.push(n) } } return m }, storageSize: function () { return j }, currentBackend: function () { return i }, storageAvailable: function () { return !!i }, reInit: function () { var m, o; if (h && h.addBehavior) { m = document.createElement("link"); h.parentNode.replaceChild(m, h); h = m; h.style.behavior = "url(#default#userData)"; document.getElementsByTagName("head")[0].appendChild(h); h.load("jStorage"); o = "{}"; try { o = h.getAttribute("jStorage") } catch (n) { } d.jStorage = o; i = "userDataBehavior" } b() } }; k() })(window.jQuery || window.$);

/*
* jQuery Expander plugin
* Version 0.4  (12/09/2008)
* @requires jQuery v1.1.1+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
(function ($) { $.fn.expander = function (options) { var opts = $.extend({}, $.fn.expander.defaults, options); var delayedCollapse; return this.each(function () { var $this = $(this); var o = $.meta ? $.extend({}, opts, $this.data()) : opts; var cleanedTag, startTags, endTags; var allText = $this.html(); var startText = allText.slice(0, o.slicePoint).replace(/\w+$/, ''); startTags = startText.match(/<\w[^>]*>/g); if (startTags) { startText = allText.slice(0, o.slicePoint + startTags.join('').length).replace(/\w+$/, '') } if (startText.lastIndexOf('<') > startText.lastIndexOf('>')) { startText = startText.slice(0, startText.lastIndexOf('<')) } var endText = allText.slice(startText.length); if (!$('span.details', this).length) { if (endText.replace(/\s+$/, '').split(' ').length < o.widow) { return } if (endText.indexOf('</') > -1) { endTags = endText.match(/<(\/)?[^>]*>/g); for (var i = 0; i < endTags.length; i++) { if (endTags[i].indexOf('</') > -1) { var startTag, startTagExists = false; for (var j = 0; j < i; j++) { startTag = endTags[j].slice(0, endTags[j].indexOf(' ')).replace(/(\w)$/, '$1>'); if (startTag == rSlash(endTags[i])) { startTagExists = true } } if (!startTagExists) { startText = startText + endTags[i]; var matched = false; for (var s = startTags.length - 1; s >= 0; s--) { if (startTags[s].slice(0, startTags[s].indexOf(' ')).replace(/(\w)$/, '$1>') == rSlash(endTags[i]) && matched == false) { cleanedTag = cleanedTag ? startTags[s] + cleanedTag : startTags[s]; matched = true } } } } } endText = cleanedTag && cleanedTag + endText || endText } $this.html([startText, '<span class="read-more">', o.expandPrefix, '<a href="#">', o.expandText, '</a>', '</span>', '<span class="details">', endText, '</span>'].join('')) } var $thisDetails = $('span.details', this), $readMore = $('span.read-more', this); $thisDetails.hide(); $readMore.find('a').click(function () { $readMore.hide(); if (o.expandEffect === 'show' && !o.expandSpeed) { o.beforeExpand($this); $thisDetails.show(); o.afterExpand($this); delayCollapse(o, $thisDetails) } else { o.beforeExpand($this); $thisDetails[o.expandEffect](o.expandSpeed, function () { $thisDetails.css({ zoom: '' }); o.afterExpand($this); delayCollapse(o, $thisDetails) }) } return false }); if (o.userCollapse) { $this.find('span.details').append('<span class="re-collapse">' + o.userCollapsePrefix + '<a href="#">' + o.userCollapseText + '</a></span>'); $this.find('span.re-collapse a').click(function () { clearTimeout(delayedCollapse); var $detailsCollapsed = $(this).parents('span.details'); reCollapse($detailsCollapsed); o.onCollapse($this, true); return false }) } }); function reCollapse(el) { el.hide().prev('span.read-more').show() } function delayCollapse(option, $collapseEl) { if (option.collapseTimer) { delayedCollapse = setTimeout(function () { reCollapse($collapseEl); option.onCollapse($collapseEl.parent(), false) }, option.collapseTimer) } } function rSlash(rString) { return rString.replace(/\//, '') } }; $.fn.expander.defaults = { slicePoint: 100, widow: 4, expandText: 'read more', expandPrefix: '&hellip; ', collapseTimer: 0, expandEffect: 'fadeIn', expandSpeed: '', userCollapse: true, userCollapseText: '[collapse expanded text]', userCollapsePrefix: ' ', beforeExpand: function ($thisEl) { }, afterExpand: function ($thisEl) { }, onCollapse: function ($thisEl, byUser) { } } })(jQuery);
