(function(A) { A.extend(A.fn, { livequery: function(F, E, D) { var C = this, G; if (A.isFunction(F)) { D = E, E = F, F = undefined } A.each(A.livequery.queries, function(H, I) { if (C.selector == I.selector && C.context == I.context && F == I.type && (!E || E.$lqguid == I.fn.$lqguid) && (!D || D.$lqguid == I.fn2.$lqguid)) { return (G = I) && false } }); G = G || new A.livequery(this.selector, this.context, F, E, D); G.stopped = false; A.livequery.run(G.id); return this }, expire: function(F, E, D) { var C = this; if (A.isFunction(F)) { D = E, E = F, F = undefined } A.each(A.livequery.queries, function(G, H) { if (C.selector == H.selector && C.context == H.context && (!F || F == H.type) && (!E || E.$lqguid == H.fn.$lqguid) && (!D || D.$lqguid == H.fn2.$lqguid) && !this.stopped) { A.livequery.stop(H.id) } }); return this } }); A.livequery = function(C, E, G, F, D) { this.selector = C; this.context = E || document; this.type = G; this.fn = F; this.fn2 = D; this.elements = []; this.stopped = false; this.id = A.livequery.queries.push(this) - 1; F.$lqguid = F.$lqguid || A.livequery.guid++; if (D) { D.$lqguid = D.$lqguid || A.livequery.guid++ } return this }; A.livequery.prototype = { stop: function() { var C = this; if (this.type) { this.elements.unbind(this.type, this.fn) } else { if (this.fn2) { this.elements.each(function(D, E) { C.fn2.apply(E) }) } } this.elements = []; this.stopped = true }, run: function() { if (this.stopped) { return } var E = this; var F = this.elements, D = A(this.selector, this.context), C = D.not(F); this.elements = D; if (this.type) { C.bind(this.type, this.fn); if (F.length > 0) { A.each(F, function(G, H) { if (A.inArray(H, D) < 0) { A.event.remove(H, E.type, E.fn) } }) } } else { C.each(function() { E.fn.apply(this) }); if (this.fn2 && F.length > 0) { A.each(F, function(G, H) { if (A.inArray(H, D) < 0) { E.fn2.apply(H) } }) } } } }; A.extend(A.livequery, { guid: 0, queries: [], queue: [], running: false, timeout: null, checkQueue: function() { if (A.livequery.running && A.livequery.queue.length) { var C = A.livequery.queue.length; while (C--) { A.livequery.queries[A.livequery.queue.shift()].run() } } }, pause: function() { A.livequery.running = false }, play: function() { A.livequery.running = true; A.livequery.run() }, registerPlugin: function() { A.each(arguments, function(D, E) { if (!A.fn[E]) { return } var C = A.fn[E]; A.fn[E] = function() { var F = C.apply(this, arguments); A.livequery.run(); return F } }) }, run: function(C) { if (C != undefined) { if (A.inArray(C, A.livequery.queue) < 0) { A.livequery.queue.push(C) } } else { A.each(A.livequery.queries, function(D) { if (A.inArray(D, A.livequery.queue) < 0) { A.livequery.queue.push(D) } }) } if (A.livequery.timeout) { clearTimeout(A.livequery.timeout) } A.livequery.timeout = setTimeout(A.livequery.checkQueue, 20) }, stop: function(C) { if (C != undefined) { A.livequery.queries[C].stop() } else { A.each(A.livequery.queries, function(D) { A.livequery.queries[D].stop() }) } } }); A.livequery.registerPlugin("append", "prepend", "after", "before", "wrap", "attr", "removeAttr", "addClass", "removeClass", "toggleClass", "empty", "remove"); A(function() { A.livequery.play() }); var B = A.prototype.init; A.prototype.init = function(C, E) { var D = B.apply(this, arguments); if (C && C.selector) { D.context = C.context, D.selector = C.selector } if (typeof C == "string") { D.context = E || document, D.selector = C } return D }; A.prototype.init.prototype = A.prototype })(jQuery)
//------------------------------------------------------------------
/// Create Namespace Manager to make creating namespaces easier.
/// DON'T ALTER!

if (typeof Namespace == 'undefined') var Namespace = {};
if (!Namespace.Manager) Namespace.Manager = {};

Namespace.Manager = {
    Register: function(namespace) {
        namespace = namespace.split('.');

        if (!window[namespace[0]]) window[namespace[0]] = {};

        var strFullNamespace = namespace[0];
        for (var i = 1; i < namespace.length; i++) {
            strFullNamespace += "." + namespace[i];
            eval("if(!window." + strFullNamespace + ")window." + strFullNamespace + "={};");
        }
    }
};

//-------------------------------------------------------------------------
Namespace.Manager.Register("Es.Settings");
Es.Settings.debug = false;
//-------------------------------------------------------------------------
Namespace.Manager.Register("Es.Exceptions");
Es.Exceptions.raiseException = function(type, filename, err, msg, onlyRaiseInDebugMode) {
    err = err || "";
    msg = msg || 'Error';
    if (Es.Settings.debug) {
        alert(type + " in " + filename + ": " + err + " Message: " + msg);
    }
    else if (!onlyRaiseInDebugMode) {
        alert(msg);
    }
}

Es.Exceptions.raiseAjaxException = function(filename, handler, optionalErr, optionalMsg, onlyRaiseInDebugMode) {
    optionalErr = optionalErr || "";
    Es.Exceptions.raiseException("Ajax Exception", filename, "in " + handler + ": " + optionalErr, optionalMsg);
};

Es.Exceptions.raiseGeneralException = function(filename, optionalErr, optionalMsg) {//err is for debugging & not used in production
    Es.Exceptions.raiseException("General Exception", filename, optionalErr, optionalMsg);
};

