function DWRUtil() {}
DWRUtil.onReturn = function (a, b) {
    if (!a) {
        a = window.event
    }
    if (a && a.keyCode && a.keyCode == 13) {
        b()
    }
};
DWRUtil.selectRange = function (c, e, a) {
    var d = c;
    c = $(c);
    if (c == null) {
        DWRUtil.debug("selectRange() can't find an element with id: " + d + ".");
        return
    }
    if (c.setSelectionRange) {
        c.setSelectionRange(e, a)
    } else {
        if (c.createTextRange) {
            var b = c.createTextRange();
            b.moveStart("character", e);
            b.moveEnd("character", a - c.value.length);
            b.select()
        }
    }
    c.focus()
};
DWRUtil._getSelection = function (a) {
    var b = a;
    a = $(a);
    if (a == null) {
        DWRUtil.debug("selectRange() can't find an element with id: " + b + ".");
        return
    }
    return a.value.substring(a.selectionStart, a.selectionEnd)
};
var $;
if (!$ && document.getElementById) {
    $ = function () {
        var c = new Array();
        for (var b = 0; b < arguments.length; b++) {
            var a = arguments[b];
            if (typeof a == "string") {
                a = document.getElementById(a)
            }
            if (arguments.length == 1) {
                return a
            }
            c.push(a)
        }
        return c
    }
} else {
    if (!$ && document.all) {
        $ = function () {
            var c = new Array();
            for (var b = 0; b < arguments.length; b++) {
                var a = arguments[b];
                if (typeof a == "string") {
                    a = document.all[a]
                }
                if (arguments.length == 1) {
                    return a
                }
                c.push(a)
            }
            return c
        }
    }
}
DWRUtil.toDescriptiveString = function (h, c, f) {
    var d = "";
    var j = 0;
    var m;
    var g;
    if (c == null) {
        c = 0
    }
    if (f == null) {
        f = 0
    }
    if (h == null) {
        return "null"
    }
    if (DWRUtil._isArray(h)) {
        if (h.length == 0) {
            d += "[]"
        } else {
            if (c != 0) {
                d += "[\n"
            } else {
                d = "["
            }
            for (j = 0; j < h.length; j++) {
                try {
                    g = h[j];
                    if (g == null || typeof g == "function") {
                        continue
                    } else {
                        if (typeof g == "object") {
                            if (c > 0) {
                                m = DWRUtil.toDescriptiveString(g, c - 1, f + 1)
                            } else {
                                m = DWRUtil._detailedTypeOf(g)
                            }
                        } else {
                            m = "" + g;
                            m = m.replace(/\/n/g, "\\n");
                            m = m.replace(/\/t/g, "\\t")
                        }
                    }
                } catch (l) {
                    m = "" + l
                }
                if (c != 0) {
                    d += DWRUtil._indent(c, f + 2) + m + ", \n"
                } else {
                    if (m.length > 13) {
                        m = m.substring(0, 10) + "..."
                    }
                    d += m + ", ";
                    if (j > 5) {
                        d += "...";
                        break
                    }
                }
            }
            if (c != 0) {
                d += DWRUtil._indent(c, f) + "]"
            } else {
                d += "]"
            }
        }
        return d
    }
    if (typeof h == "string" || typeof h == "number" || DWRUtil._isDate(h)) {
        return h.toString()
    }
    if (typeof h == "object") {
        var e = DWRUtil._detailedTypeOf(h);
        if (e != "Object") {
            d = e + " "
        }
        if (c != 0) {
            d += "{\n"
        } else {
            d = "{"
        }
        var a = DWRUtil._isHTMLElement(h);
        for (var b in h) {
            if (a) {
                if (b.toUpperCase() == b || b == "title" || b == "lang" || b == "dir" || b == "className" || b == "form" || b == "name" || b == "prefix" || b == "namespaceURI" || b == "nodeType" || b == "firstChild" || b == "lastChild" || b.match(/^offset/)) {
                    continue
                }
            }
            m = "";
            try {
                g = h[b];
                if (g == null || typeof g == "function") {
                    continue
                } else {
                    if (typeof g == "object") {
                        if (c > 0) {
                            m = "\n";
                            m += DWRUtil._indent(c, f + 2);
                            m = DWRUtil.toDescriptiveString(g, c - 1, f + 1)
                        } else {
                            m = DWRUtil._detailedTypeOf(g)
                        }
                    } else {
                        m = "" + g;
                        m = m.replace(/\/n/g, "\\n");
                        m = m.replace(/\/t/g, "\\t")
                    }
                }
            } catch (l) {
                m = "" + l
            }
            if (c == 0 && m.length > 13) {
                m = m.substring(0, 10) + "..."
            }
            var k = b;
            if (k.length > 30) {
                k = k.substring(0, 27) + "..."
            }
            if (c != 0) {
                d += DWRUtil._indent(c, f + 1)
            }
            d += b + ":" + m + ", ";
            if (c != 0) {
                d += "\n"
            }
            j++;
            if (c == 0 && j > 5) {
                d += "...";
                break
            }
        }
        d += DWRUtil._indent(c, f);
        d += "}";
        return d
    }
    return h.toString()
};
DWRUtil._indent = function (d, c) {
    var b = "";
    if (d != 0) {
        for (var a = 0; a < c; a++) {
            b += "\u00A0\u00A0"
        }
        b += " "
    }
    return b
};
DWRUtil.useLoadingMessage = function (a) {
    var b;
    if (a) {
        b = a
    } else {
        b = "Loading"
    }
    DWREngine.setPreHook(function () {
        var d = $("disabledZone");
        if (!d) {
            d = document.createElement("div");
            d.setAttribute("id", "disabledZone");
            d.style.position = "absolute";
            d.style.zIndex = "1000";
            d.style.left = "0px";
            d.style.top = "0px";
            d.style.width = "100%";
            d.style.height = "100%";
            document.body.appendChild(d);
            var c = document.createElement("div");
            c.setAttribute("id", "messageZone");
            c.style.position = "absolute";
            c.style.top = "0px";
            c.style.right = "0px";
            c.style.background = "red";
            c.style.color = "white";
            c.style.fontFamily = "Arial,Helvetica,sans-serif";
            c.style.padding = "4px";
            d.appendChild(c);
            var e = document.createTextNode(b);
            c.appendChild(e)
        } else {
            $("messageZone").innerHTML = b;
            d.style.visibility = "visible"
        }
    });
    DWREngine.setPostHook(function () {
        $("disabledZone").style.visibility = "hidden"
    })
};
DWRUtil.setValue = function (e, f, b) {
    if (f == null) {
        f = ""
    }
    if (b != null) {
        if (b.escapeHtml) {
            f = f.replace(/&/, "&amp;");
            f = f.replace(/'/, "&apos;");
            f = f.replace(/</, "&lt;");
            f = f.replace(/>/, "&gt;")
        }
    }
    var g = e;
    var a, d, c;
    e = $(e);
    if (e == null) {
        a = document.getElementsByName(g);
        if (a.length >= 1) {
            e = a.item(0)
        }
    }
    if (e == null) {
        DWRUtil.debug("setValue() can't find an element with id/name: " + g + ".");
        return
    }
    if (DWRUtil._isHTMLElement(e, "select")) {
        if (e.type == "select-multiple" && DWRUtil._isArray(f)) {
            DWRUtil._selectListItems(e, f)
        } else {
            DWRUtil._selectListItem(e, f)
        }
        return
    }
    if (DWRUtil._isHTMLElement(e, "input")) {
        if (e.type == "radio") {
            if (a == null) {
                a = document.getElementsByName(g)
            }
            if (a != null && a.length > 1) {
                for (c = 0; c < a.length; c++) {
                    d = a.item(c);
                    if (d.type == "radio") {
                        d.checked = (d.value == f)
                    }
                }
            } else {
                e.checked = (f == true)
            }
        } else {
            if (e.type == "checkbox") {
                e.checked = f
            } else {
                e.value = f
            }
        }
        return
    }
    if (DWRUtil._isHTMLElement(e, "textarea")) {
        e.value = f;
        return
    }
    if (f.nodeType) {
        if (f.nodeType == 9) {
            f = f.documentElement
        }
        f = DWRUtil._importNode(e.ownerDocument, f, true);
        e.appendChild(f);
        return
    }
    e.innerHTML = f
};
DWRUtil._selectListItems = function (d, e) {
    var c = false;
    var b;
    var a;
    for (b = 0; b < d.options.length; b++) {
        d.options[b].selected = false;
        for (a = 0; a < e.length; a++) {
            if (d.options[b].value == e[a]) {
                d.options[b].selected = true
            }
        }
    }
    if (c) {
        return
    }
    for (b = 0; b < d.options.length; b++) {
        for (a = 0; a < e.length; a++) {
            if (d.options[b].text == e[a]) {
                d.options[b].selected = true
            }
        }
    }
};
DWRUtil._selectListItem = function (c, d) {
    var b = false;
    var a;
    for (a = 0; a < c.options.length; a++) {
        if (c.options[a].value == d) {
            c.options[a].selected = true;
            b = true
        } else {
            c.options[a].selected = false
        }
    }
    if (b) {
        return
    }
    for (a = 0; a < c.options.length; a++) {
        if (c.options[a].text == d) {
            c.options[a].selected = true
        } else {
            c.options[a].selected = false
        }
    }
};
DWRUtil.getValue = function (f, b) {
    if (b == null) {
        b = {}
    }
    var g = f;
    f = $(f);
    var a = document.getElementsByName(g);
    if (f == null && a.length >= 1) {
        f = a.item(0)
    }
    if (f == null) {
        DWRUtil.debug("getValue() can't find an element with id/name: " + g + ".");
        return ""
    }
    if (DWRUtil._isHTMLElement(f, "select")) {
        var e = f.selectedIndex;
        if (e != -1) {
            var c = f.options[e].value;
            if (c == null || c == "") {
                c = f.options[e].text
            }
            return c
        } else {
            return ""
        }
    }
    if (DWRUtil._isHTMLElement(f, "input")) {
        if (f.type == "radio") {
            var d;
            for (i = 0; i < a.length; i++) {
                d = a.item(i);
                if (d.type == "radio") {
                    if (d.checked) {
                        if (a.length > 1) {
                            return d.value
                        } else {
                            return true
                        }
                    }
                }
            }
        }
        switch (f.type) {
        case "checkbox":
        case "check-box":
        case "radio":
            return f.checked;
        default:
            return f.value
        }
    }
    if (DWRUtil._isHTMLElement(f, "textarea")) {
        return f.value
    }
    if (b.textContent) {
        if (f.textContent) {
            return f.textContent
        } else {
            if (f.innerText) {
                return f.innerText
            }
        }
    }
    return f.innerHTML
};
DWRUtil.getText = function (b) {
    var c = b;
    b = $(b);
    if (b == null) {
        DWRUtil.debug("getText() can't find an element with id: " + c + ".");
        return ""
    }
    if (!DWRUtil._isHTMLElement(b, "select")) {
        DWRUtil.debug("getText() can only be used with select elements. Attempt to use: " + DWRUtil._detailedTypeOf(b) + " from  id: " + c + ".");
        return ""
    }
    var a = b.selectedIndex;
    if (a != -1) {
        return b.options[a].text
    } else {
        return ""
    }
};
DWRUtil.setValues = function (b) {
    for (var a in b) {
        if ($(a) != null || document.getElementsByName(a).length >= 1) {
            DWRUtil.setValue(a, b[a])
        }
    }
};
DWRUtil.getValues = function (f) {
    var e;
    if (typeof f == "string") {
        e = $(f)
    }
    if (DWRUtil._isHTMLElement(f)) {
        e = f
    }
    if (e != null) {
        if (e.elements == null) {
            alert("getValues() requires an object or reference to a form element.");
            return null
        }
        var b = {};
        var d;
        for (var a = 0; a < e.elements.length; a++) {
            if (e[a].id != null) {
                d = e[a].id
            } else {
                if (e[a].value != null) {
                    d = e[a].value
                } else {
                    d = "element" + a
                }
            }
            b[d] = DWRUtil.getValue(e[a])
        }
        return b
    } else {
        for (var c in f) {
            if ($(c) != null || document.getElementsByName(c).length >= 1) {
                f[c] = DWRUtil.getValue(c)
            }
        }
        return f
    }
};
DWRUtil.addOptions = function (l, e) {
    var g = l;
    l = $(l);
    if (l == null) {
        DWRUtil.debug("addOptions() can't find an element with id: " + g + ".");
        return
    }
    var c = DWRUtil._isHTMLElement(l, "select");
    var f = DWRUtil._isHTMLElement(l, ["ul", "ol"]);
    if (!c && !f) {
        DWRUtil.debug("addOptions() can only be used with select/ul/ol elements. Attempt to use: " + DWRUtil._detailedTypeOf(l));
        return
    }
    if (e == null) {
        return
    }
    var k;
    var h;
    var b;
    var j;
    if (DWRUtil._isArray(e)) {
        for (var d = 0; d < e.length; d++) {
            if (c) {
                if (arguments[2] != null) {
                    if (arguments[3] != null) {
                        k = DWRUtil._getValueFrom(e[d], arguments[3]);
                        h = DWRUtil._getValueFrom(e[d], arguments[2])
                    } else {
                        h = DWRUtil._getValueFrom(e[d], arguments[2]);
                        k = h
                    }
                } else {
                    k = DWRUtil._getValueFrom(e[d], arguments[3]);
                    h = k
                }
                if (k || h) {
                    b = new Option(k, h);
                    l.options[l.options.length] = b
                }
            } else {
                j = document.createElement("li");
                h = DWRUtil._getValueFrom(e[d], arguments[2]);
                if (h != null) {
                    j.innerHTML = h;
                    l.appendChild(j)
                }
            }
        }
    } else {
        if (arguments[3] != null) {
            for (var a in e) {
                if (!c) {
                    alert("DWRUtil.addOptions can only create select lists from objects.");
                    return
                }
                h = DWRUtil._getValueFrom(e[a], arguments[2]);
                k = DWRUtil._getValueFrom(e[a], arguments[3]);
                if (k || h) {
                    b = new Option(k, h);
                    l.options[l.options.length] = b
                }
            }
        } else {
            for (var a in e) {
                if (!c) {
                    DWRUtil.debug("DWRUtil.addOptions can only create select lists from objects.");
                    return
                }
                if (typeof e[a] == "function") {
                    k = null;
                    h = null
                } else {
                    if (arguments[2]) {
                        k = a;
                        h = e[a]
                    } else {
                        k = e[a];
                        h = a
                    }
                }
                if (k || h) {
                    b = new Option(k, h);
                    l.options[l.options.length] = b
                }
            }
        }
    }
};
DWRUtil._getValueFrom = function (a, b) {
    if (b == null) {
        return a
    } else {
        if (typeof b == "function") {
            return b(a)
        } else {
            return a[b]
        }
    }
};
DWRUtil.removeAllOptions = function (b) {
    var d = b;
    b = $(b);
    if (b == null) {
        DWRUtil.debug("removeAllOptions() can't find an element with id: " + d + ".");
        return
    }
    var a = DWRUtil._isHTMLElement(b, "select");
    var c = DWRUtil._isHTMLElement(b, ["ul", "ol"]);
    if (!a && !c) {
        DWRUtil.debug("removeAllOptions() can only be used with select, ol and ul elements. Attempt to use: " + DWRUtil._detailedTypeOf(b));
        return
    }
    if (a) {
        b.options.length = 0
    } else {
        while (b.childNodes.length > 0) {
            b.removeChild(b.firstChild)
        }
    }
};
DWRUtil.addRows = function (e, d, a, b) {
    var h = e;
    e = $(e);
    if (e == null) {
        DWRUtil.debug("addRows() can't find an element with id: " + h + ".");
        return
    }
    if (!DWRUtil._isHTMLElement(e, ["table", "tbody", "thead", "tfoot"])) {
        DWRUtil.debug("addRows() can only be used with table, tbody, thead and tfoot elements. Attempt to use: " + DWRUtil._detailedTypeOf(e));
        return
    }
    if (!b) {
        b = {}
    }
    if (!b.rowCreator) {
        b.rowCreator = DWRUtil._defaultRowCreator
    }
    if (!b.cellCreator) {
        b.cellCreator = DWRUtil._defaultCellCreator
    }
    var c, f;
    if (DWRUtil._isArray(d)) {
        for (f = 0; f < d.length; f++) {
            b.rowData = d[f];
            b.rowIndex = f;
            b.rowNum = f;
            b.data = null;
            b.cellNum = -1;
            c = DWRUtil._addRowInner(a, b);
            if (c != null) {
                e.appendChild(c)
            }
        }
    } else {
        if (typeof d == "object") {
            f = 0;
            for (var g in d) {
                b.rowData = d[g];
                b.rowIndex = g;
                b.rowNum = f;
                b.data = null;
                b.cellNum = -1;
                c = DWRUtil._addRowInner(a, b);
                if (c != null) {
                    e.appendChild(c)
                }
                f++
            }
        }
    }
};
DWRUtil._addRowInner = function (a, b) {
    var e = b.rowCreator(b);
    if (e == null) {
        return null
    }
    for (var f = 0; f < a.length; f++) {
        var d = a[f];
        var c = d(b.rowData, b);
        b.data = c;
        b.cellNum = f;
        var g = b.cellCreator(b);
        if (g != null) {
            if (c != null) {
                if (DWRUtil._isHTMLElement(c)) {
                    g.appendChild(c)
                } else {
                    g.innerHTML = c
                }
            }
            e.appendChild(g)
        }
    }
    return e
};
DWRUtil._defaultRowCreator = function (a) {
    return document.createElement("tr")
};
DWRUtil._defaultCellCreator = function (a) {
    return document.createElement("td")
};
DWRUtil.removeAllRows = function (a) {
    var b = a;
    a = $(a);
    if (a == null) {
        DWRUtil.debug("removeAllRows() can't find an element with id: " + b + ".");
        return
    }
    if (!DWRUtil._isHTMLElement(a, ["table", "tbody", "thead", "tfoot"])) {
        DWRUtil.debug("removeAllRows() can only be used with table, tbody, thead and tfoot elements. Attempt to use: " + DWRUtil._detailedTypeOf(a));
        return
    }
    while (a.childNodes.length > 0) {
        a.removeChild(a.firstChild)
    }
};
DWRUtil._isHTMLElement = function (c, e) {
    if (c == null || typeof c != "object" || c.nodeName == null) {
        return false
    }
    if (e != null) {
        var d = c.nodeName.toLowerCase();
        if (typeof e == "string") {
            return d == e.toLowerCase()
        }
        if (DWRUtil._isArray(e)) {
            var a = false;
            for (var b = 0; b < e.length && !a; b++) {
                if (d == e[b].toLowerCase()) {
                    a = true
                }
            }
            return a
        }
        DWRUtil.debug("DWRUtil._isHTMLElement was passed test node name that is neither a string or array of strings");
        return false
    }
    return true
};
DWRUtil._detailedTypeOf = function (a) {
    var b = typeof a;
    if (b == "object") {
        b = Object.prototype.toString.apply(a);
        b = b.substring(8, b.length - 1)
    }
    return b
};
DWRUtil._isArray = function (a) {
    return (a && a.join) ? true : false
};
DWRUtil._isDate = function (a) {
    return (a && a.toUTCString) ? true : false
};
DWRUtil._importNode = function (f, e, b) {
    var d;
    if (e.nodeType == 1) {
        d = f.createElement(e.nodeName);
        for (var c = 0; c < e.attributes.length; c++) {
            var a = e.attributes[c];
            if (a.nodeValue != null && a.nodeValue != "") {
                d.setAttribute(a.name, a.nodeValue)
            }
        }
        if (typeof e.style != "undefined") {
            d.style.cssText = e.style.cssText
        }
    } else {
        if (e.nodeType == 3) {
            d = f.createTextNode(e.nodeValue)
        }
    }
    if (b && e.hasChildNodes()) {
        for (c = 0; c < e.childNodes.length; c++) {
            d.appendChild(DWRUtil._importNode(f, e.childNodes[c], true))
        }
    }
    return d
};
DWRUtil.debug = function (a) {
    alert(a)
};

function toggleVisibility(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval('document.getElementById(id).style.visibility = "' + WC3type + '"')
    } else {
        if (document.layers) {
            document.layers[id].visibility = NNtype
        } else {
            if (document.all) {
                eval("document.all." + id + '.style.visibility = "' + IEtype + '"')
            }
        }
    }
}
function toggleContentTrace(a) {
    if (document.getElementById(a).style.display == "none") {
        document.getElementById(a).style.display = "inline"
    } else {
        document.getElementById(a).style.display = "none"
    }
}
function setCookie(b, d, c, e) {
    var a = new Date();
    a.setTime(a.getTime() + 1000 * 60 * 60 * 24 * c);
    document.cookie = b + "=" + escape(d) + ((a == null) ? "" : ("; expires=" + a.toGMTString())) + ((e == null) ? "" : ("; path=" + e))
}
function getCookie(a) {
    var b = a + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(b);
        if (offset != -1) {
            offset += b.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length
            }
            return unescape(document.cookie.substring(offset, end))
        }
    }
}(function () {
    var _jQuery = window.jQuery,
        _$ = window.$;
    var jQuery = window.jQuery = window.$ = function (selector, context) {
        return new jQuery.fn.init(selector, context)
    };
    var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,
        isSimple = /^.[^:#\[\.]*$/,
        undefined;
    jQuery.fn = jQuery.prototype = {
        init: function (selector, context) {
            selector = selector || document;
            if (selector.nodeType) {
                this[0] = selector;
                this.length = 1;
                return this
            }
            if (typeof selector == "string") {
                var match = quickExpr.exec(selector);
                if (match && (match[1] || !context)) {
                    if (match[1]) {
                        selector = jQuery.clean([match[1]], context)
                    } else {
                        var elem = document.getElementById(match[3]);
                        if (elem) {
                            if (elem.id != match[3]) {
                                return jQuery().find(selector)
                            }
                            return jQuery(elem)
                        }
                        selector = []
                    }
                } else {
                    return jQuery(context).find(selector)
                }
            } else {
                if (jQuery.isFunction(selector)) {
                    return jQuery(document)[jQuery.fn.ready ? "ready" : "load"](selector)
                }
            }
            return this.setArray(jQuery.makeArray(selector))
        },
        jquery: "1.2.6",
        size: function () {
            return this.length
        },
        length: 0,
        get: function (num) {
            return num == undefined ? jQuery.makeArray(this) : this[num]
        },
        pushStack: function (elems) {
            var ret = jQuery(elems);
            ret.prevObject = this;
            return ret
        },
        setArray: function (elems) {
            this.length = 0;
            Array.prototype.push.apply(this, elems);
            return this
        },
        each: function (callback, args) {
            return jQuery.each(this, callback, args)
        },
        index: function (elem) {
            var ret = -1;
            return jQuery.inArray(elem && elem.jquery ? elem[0] : elem, this)
        },
        attr: function (name, value, type) {
            var options = name;
            if (name.constructor == String) {
                if (value === undefined) {
                    return this[0] && jQuery[type || "attr"](this[0], name)
                } else {
                    options = {};
                    options[name] = value
                }
            }
            return this.each(function (i) {
                for (name in options) {
                    jQuery.attr(type ? this.style : this, name, jQuery.prop(this, options[name], type, i, name))
                }
            })
        },
        css: function (key, value) {
            if ((key == "width" || key == "height") && parseFloat(value) < 0) {
                value = undefined
            }
            return this.attr(key, value, "curCSS")
        },
        text: function (text) {
            if (typeof text != "object" && text != null) {
                return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text))
            }
            var ret = "";
            jQuery.each(text || this, function () {
                jQuery.each(this.childNodes, function () {
                    if (this.nodeType != 8) {
                        ret += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text([this])
                    }
                })
            });
            return ret
        },
        wrapAll: function (html) {
            if (this[0]) {
                jQuery(html, this[0].ownerDocument).clone().insertBefore(this[0]).map(function () {
                    var elem = this;
                    while (elem.firstChild) {
                        elem = elem.firstChild
                    }
                    return elem
                }).append(this)
            }
            return this
        },
        wrapInner: function (html) {
            return this.each(function () {
                jQuery(this).contents().wrapAll(html)
            })
        },
        wrap: function (html) {
            return this.each(function () {
                jQuery(this).wrapAll(html)
            })
        },
        append: function () {
            return this.domManip(arguments, true, false, function (elem) {
                if (this.nodeType == 1) {
                    this.appendChild(elem)
                }
            })
        },
        prepend: function () {
            return this.domManip(arguments, true, true, function (elem) {
                if (this.nodeType == 1) {
                    this.insertBefore(elem, this.firstChild)
                }
            })
        },
        before: function () {
            return this.domManip(arguments, false, false, function (elem) {
                this.parentNode.insertBefore(elem, this)
            })
        },
        after: function () {
            return this.domManip(arguments, false, true, function (elem) {
                this.parentNode.insertBefore(elem, this.nextSibling)
            })
        },
        end: function () {
            return this.prevObject || jQuery([])
        },
        find: function (selector) {
            var elems = jQuery.map(this, function (elem) {
                return jQuery.find(selector, elem)
            });
            return this.pushStack(/[^+>] [^+>]/.test(selector) || selector.indexOf("..") > -1 ? jQuery.unique(elems) : elems)
        },
        clone: function (events) {
            var ret = this.map(function () {
                if (jQuery.browser.msie && !jQuery.isXMLDoc(this)) {
                    var clone = this.cloneNode(true),
                        container = document.createElement("div");
                    container.appendChild(clone);
                    return jQuery.clean([container.innerHTML])[0]
                } else {
                    return this.cloneNode(true)
                }
            });
            var clone = ret.find("*").andSelf().each(function () {
                if (this[expando] != undefined) {
                    this[expando] = null
                }
            });
            if (events === true) {
                this.find("*").andSelf().each(function (i) {
                    if (this.nodeType == 3) {
                        return
                    }
                    var events = jQuery.data(this, "events");
                    for (var type in events) {
                        for (var handler in events[type]) {
                            jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data)
                        }
                    }
                })
            }
            return ret
        },
        filter: function (selector) {
            return this.pushStack(jQuery.isFunction(selector) && jQuery.grep(this, function (elem, i) {
                return selector.call(elem, i)
            }) || jQuery.multiFilter(selector, this))
        },
        not: function (selector) {
            if (selector.constructor == String) {
                if (isSimple.test(selector)) {
                    return this.pushStack(jQuery.multiFilter(selector, this, true))
                } else {
                    selector = jQuery.multiFilter(selector, this)
                }
            }
            var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
            return this.filter(function () {
                return isArrayLike ? jQuery.inArray(this, selector) < 0 : this != selector
            })
        },
        add: function (selector) {
            return this.pushStack(jQuery.unique(jQuery.merge(this.get(), typeof selector == "string" ? jQuery(selector) : jQuery.makeArray(selector))))
        },
        is: function (selector) {
            return !!selector && jQuery.multiFilter(selector, this).length > 0
        },
        hasClass: function (selector) {
            return this.is("." + selector)
        },
        val: function (value) {
            if (value == undefined) {
                if (this.length) {
                    var elem = this[0];
                    if (jQuery.nodeName(elem, "select")) {
                        var index = elem.selectedIndex,
                            values = [],
                            options = elem.options,
                            one = elem.type == "select-one";
                        if (index < 0) {
                            return null
                        }
                        for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) {
                            var option = options[i];
                            if (option.selected) {
                                value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
                                if (one) {
                                    return value
                                }
                                values.push(value)
                            }
                        }
                        return values
                    } else {
                        return (this[0].value || "").replace(/\r/g, "")
                    }
                }
                return undefined
            }
            if (value.constructor == Number) {
                value += ""
            }
            return this.each(function () {
                if (this.nodeType != 1) {
                    return
                }
                if (value.constructor == Array && /radio|checkbox/.test(this.type)) {
                    this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0)
                } else {
                    if (jQuery.nodeName(this, "select")) {
                        var values = jQuery.makeArray(value);
                        jQuery("option", this).each(function () {
                            this.selected = (jQuery.inArray(this.value, values) >= 0 || jQuery.inArray(this.text, values) >= 0)
                        });
                        if (!values.length) {
                            this.selectedIndex = -1
                        }
                    } else {
                        this.value = value
                    }
                }
            })
        },
        html: function (value) {
            return value == undefined ? (this[0] ? this[0].innerHTML : null) : this.empty().append(value)
        },
        replaceWith: function (value) {
            return this.after(value).remove()
        },
        eq: function (i) {
            return this.slice(i, i + 1)
        },
        slice: function () {
            return this.pushStack(Array.prototype.slice.apply(this, arguments))
        },
        map: function (callback) {
            return this.pushStack(jQuery.map(this, function (elem, i) {
                return callback.call(elem, i, elem)
            }))
        },
        andSelf: function () {
            return this.add(this.prevObject)
        },
        data: function (key, value) {
            var parts = key.split(".");
            parts[1] = parts[1] ? "." + parts[1] : "";
            if (value === undefined) {
                var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
                if (data === undefined && this.length) {
                    data = jQuery.data(this[0], key)
                }
                return data === undefined && parts[1] ? this.data(parts[0]) : data
            } else {
                return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function () {
                    jQuery.data(this, key, value)
                })
            }
        },
        removeData: function (key) {
            return this.each(function () {
                jQuery.removeData(this, key)
            })
        },
        domManip: function (args, table, reverse, callback) {
            var clone = this.length > 1,
                elems;
            return this.each(function () {
                if (!elems) {
                    elems = jQuery.clean(args, this.ownerDocument);
                    if (reverse) {
                        elems.reverse()
                    }
                }
                var obj = this;
                if (table && jQuery.nodeName(this, "table") && jQuery.nodeName(elems[0], "tr")) {
                    obj = this.getElementsByTagName("tbody")[0] || this.appendChild(this.ownerDocument.createElement("tbody"))
                }
                var scripts = jQuery([]);
                jQuery.each(elems, function () {
                    var elem = clone ? jQuery(this).clone(true)[0] : this;
                    if (jQuery.nodeName(elem, "script")) {
                        scripts = scripts.add(elem)
                    } else {
                        if (elem.nodeType == 1) {
                            scripts = scripts.add(jQuery("script", elem).remove())
                        }
                        callback.call(obj, elem)
                    }
                });
                scripts.each(evalScript)
            })
        }
    };
    jQuery.fn.init.prototype = jQuery.fn;

    function evalScript(i, elem) {
        if (elem.src) {
            jQuery.ajax({
                url: elem.src,
                async: false,
                dataType: "script"
            })
        } else {
            jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || "")
        }
        if (elem.parentNode) {
            elem.parentNode.removeChild(elem)
        }
    }
    function now() {
        return +new Date
    }
    jQuery.extend = jQuery.fn.extend = function () {
        var target = arguments[0] || {},
            i = 1,
            length = arguments.length,
            deep = false,
            options;
        if (target.constructor == Boolean) {
            deep = target;
            target = arguments[1] || {};
            i = 2
        }
        if (typeof target != "object" && typeof target != "function") {
            target = {}
        }
        if (length == i) {
            target = this;
            --i
        }
        for (; i < length; i++) {
            if ((options = arguments[i]) != null) {
                for (var name in options) {
                    var src = target[name],
                        copy = options[name];
                    if (target === copy) {
                        continue
                    }
                    if (deep && copy && typeof copy == "object" && !copy.nodeType) {
                        target[name] = jQuery.extend(deep, src || (copy.length != null ? [] : {}), copy)
                    } else {
                        if (copy !== undefined) {
                            target[name] = copy
                        }
                    }
                }
            }
        }
        return target
    };
    var expando = "jQuery" + now(),
        uuid = 0,
        windowData = {},
        exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
        defaultView = document.defaultView || {};
    jQuery.extend({
        noConflict: function (deep) {
            window.$ = _$;
            if (deep) {
                window.jQuery = _jQuery
            }
            return jQuery
        },
        isFunction: function (fn) {
            return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /^[\s[]?function/.test(fn + "")
        },
        isXMLDoc: function (elem) {
            return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body
        },
        globalEval: function (data) {
            data = jQuery.trim(data);
            if (data) {
                var head = document.getElementsByTagName("head")[0] || document.documentElement,
                    script = document.createElement("script");
                script.type = "text/javascript";
                if (jQuery.browser.msie) {
                    script.text = data
                } else {
                    script.appendChild(document.createTextNode(data))
                }
                head.insertBefore(script, head.firstChild);
                head.removeChild(script)
            }
        },
        nodeName: function (elem, name) {
            return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase()
        },
        cache: {},
        data: function (elem, name, data) {
            elem = elem == window ? windowData : elem;
            var id = elem[expando];
            if (!id) {
                id = elem[expando] = ++uuid
            }
            if (name && !jQuery.cache[id]) {
                jQuery.cache[id] = {}
            }
            if (data !== undefined) {
                jQuery.cache[id][name] = data
            }
            return name ? jQuery.cache[id][name] : id
        },
        removeData: function (elem, name) {
            elem = elem == window ? windowData : elem;
            var id = elem[expando];
            if (name) {
                if (jQuery.cache[id]) {
                    delete jQuery.cache[id][name];
                    name = "";
                    for (name in jQuery.cache[id]) {
                        break
                    }
                    if (!name) {
                        jQuery.removeData(elem)
                    }
                }
            } else {
                try {
                    delete elem[expando]
                } catch (e) {
                    if (elem.removeAttribute) {
                        elem.removeAttribute(expando)
                    }
                }
                delete jQuery.cache[id]
            }
        },
        each: function (object, callback, args) {
            var name, i = 0,
                length = object.length;
            if (args) {
                if (length == undefined) {
                    for (name in object) {
                        if (callback.apply(object[name], args) === false) {
                            break
                        }
                    }
                } else {
                    for (; i < length;) {
                        if (callback.apply(object[i++], args) === false) {
                            break
                        }
                    }
                }
            } else {
                if (length == undefined) {
                    for (name in object) {
                        if (callback.call(object[name], name, object[name]) === false) {
                            break
                        }
                    }
                } else {
                    for (var value = object[0]; i < length && callback.call(value, i, value) !== false; value = object[++i]) {}
                }
            }
            return object
        },
        prop: function (elem, value, type, i, name) {
            if (jQuery.isFunction(value)) {
                value = value.call(elem, i)
            }
            return value && value.constructor == Number && type == "curCSS" && !exclude.test(name) ? value + "px" : value
        },
        className: {
            add: function (elem, classNames) {
                jQuery.each((classNames || "").split(/\s+/), function (i, className) {
                    if (elem.nodeType == 1 && !jQuery.className.has(elem.className, className)) {
                        elem.className += (elem.className ? " " : "") + className
                    }
                })
            },
            remove: function (elem, classNames) {
                if (elem.nodeType == 1) {
                    elem.className = classNames != undefined ? jQuery.grep(elem.className.split(/\s+/), function (className) {
                        return !jQuery.className.has(classNames, className)
                    }).join(" ") : ""
                }
            },
            has: function (elem, className) {
                return jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1
            }
        },
        swap: function (elem, options, callback) {
            var old = {};
            for (var name in options) {
                old[name] = elem.style[name];
                elem.style[name] = options[name]
            }
            callback.call(elem);
            for (var name in options) {
                elem.style[name] = old[name]
            }
        },
        css: function (elem, name, force) {
            if (name == "width" || name == "height") {
                var val, props = {
                    position: "absolute",
                    visibility: "hidden",
                    display: "block"
                },
                    which = name == "width" ? ["Left", "Right"] : ["Top", "Bottom"];

                function getWH() {
                    val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
                    var padding = 0,
                        border = 0;
                    jQuery.each(which, function () {
                        padding += parseFloat(jQuery.curCSS(elem, "padding" + this, true)) || 0;
                        border += parseFloat(jQuery.curCSS(elem, "border" + this + "Width", true)) || 0
                    });
                    val -= Math.round(padding + border)
                }
                if (jQuery(elem).is(":visible")) {
                    getWH()
                } else {
                    jQuery.swap(elem, props, getWH)
                }
                return Math.max(0, val)
            }
            return jQuery.curCSS(elem, name, force)
        },
        curCSS: function (elem, name, force) {
            var ret, style = elem.style;

            function color(elem) {
                if (!jQuery.browser.safari) {
                    return false
                }
                var ret = defaultView.getComputedStyle(elem, null);
                return !ret || ret.getPropertyValue("color") == ""
            }
            if (name == "opacity" && jQuery.browser.msie) {
                ret = jQuery.attr(style, "opacity");
                return ret == "" ? "1" : ret
            }
            if (jQuery.browser.opera && name == "display") {
                var save = style.outline;
                style.outline = "0 solid black";
                style.outline = save
            }
            if (name.match(/float/i)) {
                name = styleFloat
            }
            if (!force && style && style[name]) {
                ret = style[name]
            } else {
                if (defaultView.getComputedStyle) {
                    if (name.match(/float/i)) {
                        name = "float"
                    }
                    name = name.replace(/([A-Z])/g, "-$1").toLowerCase();
                    var computedStyle = defaultView.getComputedStyle(elem, null);
                    if (computedStyle && !color(elem)) {
                        ret = computedStyle.getPropertyValue(name)
                    } else {
                        var swap = [],
                            stack = [],
                            a = elem,
                            i = 0;
                        for (; a && color(a); a = a.parentNode) {
                            stack.unshift(a)
                        }
                        for (; i < stack.length; i++) {
                            if (color(stack[i])) {
                                swap[i] = stack[i].style.display;
                                stack[i].style.display = "block"
                            }
                        }
                        ret = name == "display" && swap[stack.length - 1] != null ? "none" : (computedStyle && computedStyle.getPropertyValue(name)) || "";
                        for (i = 0; i < swap.length; i++) {
                            if (swap[i] != null) {
                                stack[i].style.display = swap[i]
                            }
                        }
                    }
                    if (name == "opacity" && ret == "") {
                        ret = "1"
                    }
                } else {
                    if (elem.currentStyle) {
                        var camelCase = name.replace(/\-(\w)/g, function (all, letter) {
                            return letter.toUpperCase()
                        });
                        ret = elem.currentStyle[name] || elem.currentStyle[camelCase];
                        if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) {
                            var left = style.left,
                                rsLeft = elem.runtimeStyle.left;
                            elem.runtimeStyle.left = elem.currentStyle.left;
                            style.left = ret || 0;
                            ret = style.pixelLeft + "px";
                            style.left = left;
                            elem.runtimeStyle.left = rsLeft
                        }
                    }
                }
            }
            return ret
        },
        clean: function (elems, context) {
            var ret = [];
            context = context || document;
            if (typeof context.createElement == "undefined") {
                context = context.ownerDocument || context[0] && context[0].ownerDocument || document
            }
            jQuery.each(elems, function (i, elem) {
                if (!elem) {
                    return
                }
                if (elem.constructor == Number) {
                    elem += ""
                }
                if (typeof elem == "string") {
                    elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function (all, front, tag) {
                        return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"
                    });
                    var tags = jQuery.trim(elem).toLowerCase(),
                        div = context.createElement("div");
                    var wrap = !tags.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !tags.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !tags.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!tags.indexOf("<td") || !tags.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !tags.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || jQuery.browser.msie && [1, "div<div>", "</div>"] || [0, "", ""];
                    div.innerHTML = wrap[1] + elem + wrap[2];
                    while (wrap[0]--) {
                        div = div.lastChild
                    }
                    if (jQuery.browser.msie) {
                        var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? div.firstChild && div.firstChild.childNodes : wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ? div.childNodes : [];
                        for (var j = tbody.length - 1; j >= 0; --j) {
                            if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) {
                                tbody[j].parentNode.removeChild(tbody[j])
                            }
                        }
                        if (/^\s/.test(elem)) {
                            div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]), div.firstChild)
                        }
                    }
                    elem = jQuery.makeArray(div.childNodes)
                }
                if (elem.length === 0 && (!jQuery.nodeName(elem, "form") && !jQuery.nodeName(elem, "select"))) {
                    return
                }
                if (elem[0] == undefined || jQuery.nodeName(elem, "form") || elem.options) {
                    ret.push(elem)
                } else {
                    ret = jQuery.merge(ret, elem)
                }
            });
            return ret
        },
        attr: function (elem, name, value) {
            if (!elem || elem.nodeType == 3 || elem.nodeType == 8) {
                return undefined
            }
            var notxml = !jQuery.isXMLDoc(elem),
                set = value !== undefined,
                msie = jQuery.browser.msie;
            name = notxml && jQuery.props[name] || name;
            if (elem.tagName) {
                var special = /href|src|style/.test(name);
                if (name == "selected" && jQuery.browser.safari) {
                    elem.parentNode.selectedIndex
                }
                if (name in elem && notxml && !special) {
                    if (set) {
                        if (name == "type" && jQuery.nodeName(elem, "input") && elem.parentNode) {
                            throw "type property can't be changed"
                        }
                        elem[name] = value
                    }
                    if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) {
                        return elem.getAttributeNode(name).nodeValue
                    }
                    return elem[name]
                }
                if (msie && notxml && name == "style") {
                    return jQuery.attr(elem.style, "cssText", value)
                }
                if (set) {
                    elem.setAttribute(name, "" + value)
                }
                var attr = msie && notxml && special ? elem.getAttribute(name, 2) : elem.getAttribute(name);
                return attr === null ? undefined : attr
            }
            if (msie && name == "opacity") {
                if (set) {
                    elem.zoom = 1;
                    elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(value) + "" == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")")
                }
                return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? (parseFloat(elem.filter.match(/opacity=([^)]*)/)[1]) / 100) + "" : ""
            }
            name = name.replace(/-([a-z])/ig, function (all, letter) {
                return letter.toUpperCase()
            });
            if (set) {
                elem[name] = value
            }
            return elem[name]
        },
        trim: function (text) {
            return (text || "").replace(/^\s+|\s+$/g, "")
        },
        makeArray: function (array) {
            var ret = [];
            if (array != null) {
                var i = array.length;
                if (i == null || array.split || array.setInterval || array.call) {
                    ret[0] = array
                } else {
                    while (i) {
                        ret[--i] = array[i]
                    }
                }
            }
            return ret
        },
        inArray: function (elem, array) {
            for (var i = 0, length = array.length; i < length; i++) {
                if (array[i] === elem) {
                    return i
                }
            }
            return -1
        },
        merge: function (first, second) {
            var i = 0,
                elem, pos = first.length;
            if (jQuery.browser.msie) {
                while (elem = second[i++]) {
                    if (elem.nodeType != 8) {
                        first[pos++] = elem
                    }
                }
            } else {
                while (elem = second[i++]) {
                    first[pos++] = elem
                }
            }
            return first
        },
        unique: function (array) {
            var ret = [],
                done = {};
            try {
                for (var i = 0, length = array.length; i < length; i++) {
                    var id = jQuery.data(array[i]);
                    if (!done[id]) {
                        done[id] = true;
                        ret.push(array[i])
                    }
                }
            } catch (e) {
                ret = array
            }
            return ret
        },
        grep: function (elems, callback, inv) {
            var ret = [];
            for (var i = 0, length = elems.length; i < length; i++) {
                if (!inv != !callback(elems[i], i)) {
                    ret.push(elems[i])
                }
            }
            return ret
        },
        map: function (elems, callback) {
            var ret = [];
            for (var i = 0, length = elems.length; i < length; i++) {
                var value = callback(elems[i], i);
                if (value != null) {
                    ret[ret.length] = value
                }
            }
            return ret.concat.apply([], ret)
        }
    });
    var userAgent = navigator.userAgent.toLowerCase();
    jQuery.browser = {
        version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
        safari: /webkit/.test(userAgent),
        opera: /opera/.test(userAgent),
        msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
        mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
    };
    var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
    jQuery.extend({
        boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
        props: {
            "for": "htmlFor",
            "class": "className",
            "float": styleFloat,
            cssFloat: styleFloat,
            styleFloat: styleFloat,
            readonly: "readOnly",
            maxlength: "maxLength",
            cellspacing: "cellSpacing"
        }
    });
    jQuery.each({
        parent: function (elem) {
            return elem.parentNode
        },
        parents: function (elem) {
            return jQuery.dir(elem, "parentNode")
        },
        next: function (elem) {
            return jQuery.nth(elem, 2, "nextSibling")
        },
        prev: function (elem) {
            return jQuery.nth(elem, 2, "previousSibling")
        },
        nextAll: function (elem) {
            return jQuery.dir(elem, "nextSibling")
        },
        prevAll: function (elem) {
            return jQuery.dir(elem, "previousSibling")
        },
        siblings: function (elem) {
            return jQuery.sibling(elem.parentNode.firstChild, elem)
        },
        children: function (elem) {
            return jQuery.sibling(elem.firstChild)
        },
        contents: function (elem) {
            return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray(elem.childNodes)
        }
    }, function (name, fn) {
        jQuery.fn[name] = function (selector) {
            var ret = jQuery.map(this, fn);
            if (selector && typeof selector == "string") {
                ret = jQuery.multiFilter(selector, ret)
            }
            return this.pushStack(jQuery.unique(ret))
        }
    });
    jQuery.each({
        appendTo: "append",
        prependTo: "prepend",
        insertBefore: "before",
        insertAfter: "after",
        replaceAll: "replaceWith"
    }, function (name, original) {
        jQuery.fn[name] = function () {
            var args = arguments;
            return this.each(function () {
                for (var i = 0, length = args.length; i < length; i++) {
                    jQuery(args[i])[original](this)
                }
            })
        }
    });
    jQuery.each({
        removeAttr: function (name) {
            jQuery.attr(this, name, "");
            if (this.nodeType == 1) {
                this.removeAttribute(name)
            }
        },
        addClass: function (classNames) {
            jQuery.className.add(this, classNames)
        },
        removeClass: function (classNames) {
            jQuery.className.remove(this, classNames)
        },
        toggleClass: function (classNames) {
            jQuery.className[jQuery.className.has(this, classNames) ? "remove" : "add"](this, classNames)
        },
        remove: function (selector) {
            if (!selector || jQuery.filter(selector, [this]).r.length) {
                jQuery("*", this).add(this).each(function () {
                    jQuery.event.remove(this);
                    jQuery.removeData(this)
                });
                if (this.parentNode) {
                    this.parentNode.removeChild(this)
                }
            }
        },
        empty: function () {
            jQuery(">*", this).remove();
            while (this.firstChild) {
                this.removeChild(this.firstChild)
            }
        }
    }, function (name, fn) {
        jQuery.fn[name] = function () {
            return this.each(fn, arguments)
        }
    });
    jQuery.each(["Height", "Width"], function (i, name) {
        var type = name.toLowerCase();
        jQuery.fn[type] = function (size) {
            return this[0] == window ? jQuery.browser.opera && document.body["client" + name] || jQuery.browser.safari && window["inner" + name] || document.compatMode == "CSS1Compat" && document.documentElement["client" + name] || document.body["client" + name] : this[0] == document ? Math.max(Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), Math.max(document.body["offset" + name], document.documentElement["offset" + name])) : size == undefined ? (this.length ? jQuery.css(this[0], type) : null) : this.css(type, size.constructor == String ? size : size + "px")
        }
    });

    function num(elem, prop) {
        return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0
    }
    var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
        quickChild = new RegExp("^>\\s*(" + chars + "+)"),
        quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
        quickClass = new RegExp("^([#.]?)(" + chars + "*)");
    jQuery.extend({
        expr: {
            "": function (a, i, m) {
                return m[2] == "*" || jQuery.nodeName(a, m[2])
            },
            "#": function (a, i, m) {
                return a.getAttribute("id") == m[2]
            },
            ":": {
                lt: function (a, i, m) {
                    return i < m[3] - 0
                },
                gt: function (a, i, m) {
                    return i > m[3] - 0
                },
                nth: function (a, i, m) {
                    return m[3] - 0 == i
                },
                eq: function (a, i, m) {
                    return m[3] - 0 == i
                },
                first: function (a, i) {
                    return i == 0
                },
                last: function (a, i, m, r) {
                    return i == r.length - 1
                },
                even: function (a, i) {
                    return i % 2 == 0
                },
                odd: function (a, i) {
                    return i % 2
                },
                "first-child": function (a) {
                    return a.parentNode.getElementsByTagName("*")[0] == a
                },
                "last-child": function (a) {
                    return jQuery.nth(a.parentNode.lastChild, 1, "previousSibling") == a
                },
                "only-child": function (a) {
                    return !jQuery.nth(a.parentNode.lastChild, 2, "previousSibling")
                },
                parent: function (a) {
                    return a.firstChild
                },
                empty: function (a) {
                    return !a.firstChild
                },
                contains: function (a, i, m) {
                    return (a.textContent || a.innerText || jQuery(a).text() || "").indexOf(m[3]) >= 0
                },
                visible: function (a) {
                    return "hidden" != a.type && jQuery.css(a, "display") != "none" && jQuery.css(a, "visibility") != "hidden"
                },
                hidden: function (a) {
                    return "hidden" == a.type || jQuery.css(a, "display") == "none" || jQuery.css(a, "visibility") == "hidden"
                },
                enabled: function (a) {
                    return !a.disabled
                },
                disabled: function (a) {
                    return a.disabled
                },
                checked: function (a) {
                    return a.checked
                },
                selected: function (a) {
                    return a.selected || jQuery.attr(a, "selected")
                },
                text: function (a) {
                    return "text" == a.type
                },
                radio: function (a) {
                    return "radio" == a.type
                },
                checkbox: function (a) {
                    return "checkbox" == a.type
                },
                file: function (a) {
                    return "file" == a.type
                },
                password: function (a) {
                    return "password" == a.type
                },
                submit: function (a) {
                    return "submit" == a.type
                },
                image: function (a) {
                    return "image" == a.type
                },
                reset: function (a) {
                    return "reset" == a.type
                },
                button: function (a) {
                    return "button" == a.type || jQuery.nodeName(a, "button")
                },
                input: function (a) {
                    return /input|select|textarea|button/i.test(a.nodeName)
                },
                has: function (a, i, m) {
                    return jQuery.find(m[3], a).length
                },
                header: function (a) {
                    return /h\d/i.test(a.nodeName)
                },
                animated: function (a) {
                    return jQuery.grep(jQuery.timers, function (fn) {
                        return a == fn.elem
                    }).length
                }
            }
        },
        parse: [/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, new RegExp("^([:.#]*)(" + chars + "+)")],
        multiFilter: function (expr, elems, not) {
            var old, cur = [];
            while (expr && expr != old) {
                old = expr;
                var f = jQuery.filter(expr, elems, not);
                expr = f.t.replace(/^\s*,\s*/, "");
                cur = not ? elems = f.r : jQuery.merge(cur, f.r)
            }
            return cur
        },
        find: function (t, context) {
            if (typeof t != "string") {
                return [t]
            }
            if (context && context.nodeType != 1 && context.nodeType != 9) {
                return []
            }
            context = context || document;
            var ret = [context],
                done = [],
                last, nodeName;
            while (t && last != t) {
                var r = [];
                last = t;
                t = jQuery.trim(t);
                var foundToken = false,
                    re = quickChild,
                    m = re.exec(t);
                if (m) {
                    nodeName = m[1].toUpperCase();
                    for (var i = 0; ret[i]; i++) {
                        for (var c = ret[i].firstChild; c; c = c.nextSibling) {
                            if (c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName)) {
                                r.push(c)
                            }
                        }
                    }
                    ret = r;
                    t = t.replace(re, "");
                    if (t.indexOf(" ") == 0) {
                        continue
                    }
                    foundToken = true
                } else {
                    re = /^([>+~])\s*(\w*)/i;
                    if ((m = re.exec(t)) != null) {
                        r = [];
                        var merge = {};
                        nodeName = m[2].toUpperCase();
                        m = m[1];
                        for (var j = 0, rl = ret.length; j < rl; j++) {
                            var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
                            for (; n; n = n.nextSibling) {
                                if (n.nodeType == 1) {
                                    var id = jQuery.data(n);
                                    if (m == "~" && merge[id]) {
                                        break
                                    }
                                    if (!nodeName || n.nodeName.toUpperCase() == nodeName) {
                                        if (m == "~") {
                                            merge[id] = true
                                        }
                                        r.push(n)
                                    }
                                    if (m == "+") {
                                        break
                                    }
                                }
                            }
                        }
                        ret = r;
                        t = jQuery.trim(t.replace(re, ""));
                        foundToken = true
                    }
                }
                if (t && !foundToken) {
                    if (!t.indexOf(",")) {
                        if (context == ret[0]) {
                            ret.shift()
                        }
                        done = jQuery.merge(done, ret);
                        r = ret = [context];
                        t = " " + t.substr(1, t.length)
                    } else {
                        var re2 = quickID;
                        var m = re2.exec(t);
                        if (m) {
                            m = [0, m[2], m[3], m[1]]
                        } else {
                            re2 = quickClass;
                            m = re2.exec(t)
                        }
                        m[2] = m[2].replace(/\\/g, "");
                        var elem = ret[ret.length - 1];
                        if (m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem)) {
                            var oid = elem.getElementById(m[2]);
                            if ((jQuery.browser.msie || jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2]) {
                                oid = jQuery('[@id="' + m[2] + '"]', elem)[0]
                            }
                            ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : []
                        } else {
                            for (var i = 0; ret[i]; i++) {
                                var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
                                if (tag == "*" && ret[i].nodeName.toLowerCase() == "object") {
                                    tag = "param"
                                }
                                r = jQuery.merge(r, ret[i].getElementsByTagName(tag))
                            }
                            if (m[1] == ".") {
                                r = jQuery.classFilter(r, m[2])
                            }
                            if (m[1] == "#") {
                                var tmp = [];
                                for (var i = 0; r[i]; i++) {
                                    if (r[i].getAttribute("id") == m[2]) {
                                        tmp = [r[i]];
                                        break
                                    }
                                }
                                r = tmp
                            }
                            ret = r
                        }
                        t = t.replace(re2, "")
                    }
                }
                if (t) {
                    var val = jQuery.filter(t, r);
                    ret = r = val.r;
                    t = jQuery.trim(val.t)
                }
            }
            if (t) {
                ret = []
            }
            if (ret && context == ret[0]) {
                ret.shift()
            }
            done = jQuery.merge(done, ret);
            return done
        },
        classFilter: function (r, m, not) {
            m = " " + m + " ";
            var tmp = [];
            for (var i = 0; r[i]; i++) {
                var pass = (" " + r[i].className + " ").indexOf(m) >= 0;
                if (!not && pass || not && !pass) {
                    tmp.push(r[i])
                }
            }
            return tmp
        },
        filter: function (t, r, not) {
            var last;
            while (t && t != last) {
                last = t;
                var p = jQuery.parse,
                    m;
                for (var i = 0; p[i]; i++) {
                    m = p[i].exec(t);
                    if (m) {
                        t = t.substring(m[0].length);
                        m[2] = m[2].replace(/\\/g, "");
                        break
                    }
                }
                if (!m) {
                    break
                }
                if (m[1] == ":" && m[2] == "not") {
                    r = isSimple.test(m[3]) ? jQuery.filter(m[3], r, true).r : jQuery(r).not(m[3])
                } else {
                    if (m[1] == ".") {
                        r = jQuery.classFilter(r, m[2], not)
                    } else {
                        if (m[1] == "[") {
                            var tmp = [],
                                type = m[3];
                            for (var i = 0, rl = r.length; i < rl; i++) {
                                var a = r[i],
                                    z = a[jQuery.props[m[2]] || m[2]];
                                if (z == null || /href|src|selected/.test(m[2])) {
                                    z = jQuery.attr(a, m[2]) || ""
                                }
                                if ((type == "" && !! z || type == "=" && z == m[5] || type == "!=" && z != m[5] || type == "^=" && z && !z.indexOf(m[5]) || type == "$=" && z.substr(z.length - m[5].length) == m[5] || (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not) {
                                    tmp.push(a)
                                }
                            }
                            r = tmp
                        } else {
                            if (m[1] == ":" && m[2] == "nth-child") {
                                var merge = {},
                                    tmp = [],
                                    test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || !/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
                                    first = (test[1] + (test[2] || 1)) - 0,
                                    last = test[3] - 0;
                                for (var i = 0, rl = r.length; i < rl; i++) {
                                    var node = r[i],
                                        parentNode = node.parentNode,
                                        id = jQuery.data(parentNode);
                                    if (!merge[id]) {
                                        var c = 1;
                                        for (var n = parentNode.firstChild; n; n = n.nextSibling) {
                                            if (n.nodeType == 1) {
                                                n.nodeIndex = c++
                                            }
                                        }
                                        merge[id] = true
                                    }
                                    var add = false;
                                    if (first == 0) {
                                        if (node.nodeIndex == last) {
                                            add = true
                                        }
                                    } else {
                                        if ((node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0) {
                                            add = true
                                        }
                                    }
                                    if (add ^ not) {
                                        tmp.push(node)
                                    }
                                }
                                r = tmp
                            } else {
                                var fn = jQuery.expr[m[1]];
                                if (typeof fn == "object") {
                                    fn = fn[m[2]]
                                }
                                if (typeof fn == "string") {
                                    fn = eval("false||function(a,i){return " + fn + ";}")
                                }
                                r = jQuery.grep(r, function (elem, i) {
                                    return fn(elem, i, m, r)
                                }, not)
                            }
                        }
                    }
                }
            }
            return {
                r: r,
                t: t
            }
        },
        dir: function (elem, dir) {
            var matched = [],
                cur = elem[dir];
            while (cur && cur != document) {
                if (cur.nodeType == 1) {
                    matched.push(cur)
                }
                cur = cur[dir]
            }
            return matched
        },
        nth: function (cur, result, dir, elem) {
            result = result || 1;
            var num = 0;
            for (; cur; cur = cur[dir]) {
                if (cur.nodeType == 1 && ++num == result) {
                    break
                }
            }
            return cur
        },
        sibling: function (n, elem) {
            var r = [];
            for (; n; n = n.nextSibling) {
                if (n.nodeType == 1 && n != elem) {
                    r.push(n)
                }
            }
            return r
        }
    });
    jQuery.event = {
        add: function (elem, types, handler, data) {
            if (elem.nodeType == 3 || elem.nodeType == 8) {
                return
            }
            if (jQuery.browser.msie && elem.setInterval) {
                elem = window
            }
            if (!handler.guid) {
                handler.guid = this.guid++
            }
            if (data != undefined) {
                var fn = handler;
                handler = this.proxy(fn, function () {
                    return fn.apply(this, arguments)
                });
                handler.data = data
            }
            var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
                handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function () {
                    if (typeof jQuery != "undefined" && !jQuery.event.triggered) {
                        return jQuery.event.handle.apply(arguments.callee.elem, arguments)
                    }
                });
            handle.elem = elem;
            jQuery.each(types.split(/\s+/), function (index, type) {
                var parts = type.split(".");
                type = parts[0];
                handler.type = parts[1];
                var handlers = events[type];
                if (!handlers) {
                    handlers = events[type] = {};
                    if (!jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false) {
                        if (elem.addEventListener) {
                            elem.addEventListener(type, handle, false)
                        } else {
                            if (elem.attachEvent) {
                                elem.attachEvent("on" + type, handle)
                            }
                        }
                    }
                }
                handlers[handler.guid] = handler;
                jQuery.event.global[type] = true
            });
            elem = null
        },
        guid: 1,
        global: {},
        remove: function (elem, types, handler) {
            if (elem.nodeType == 3 || elem.nodeType == 8) {
                return
            }
            var events = jQuery.data(elem, "events"),
                ret, index;
            if (events) {
                if (types == undefined || (typeof types == "string" && types.charAt(0) == ".")) {
                    for (var type in events) {
                        this.remove(elem, type + (types || ""))
                    }
                } else {
                    if (types.type) {
                        handler = types.handler;
                        types = types.type
                    }
                    jQuery.each(types.split(/\s+/), function (index, type) {
                        var parts = type.split(".");
                        type = parts[0];
                        if (events[type]) {
                            if (handler) {
                                delete events[type][handler.guid]
                            } else {
                                for (handler in events[type]) {
                                    if (!parts[1] || events[type][handler].type == parts[1]) {
                                        delete events[type][handler]
                                    }
                                }
                            }
                            for (ret in events[type]) {
                                break
                            }
                            if (!ret) {
                                if (!jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false) {
                                    if (elem.removeEventListener) {
                                        elem.removeEventListener(type, jQuery.data(elem, "handle"), false)
                                    } else {
                                        if (elem.detachEvent) {
                                            elem.detachEvent("on" + type, jQuery.data(elem, "handle"))
                                        }
                                    }
                                }
                                ret = null;
                                delete events[type]
                            }
                        }
                    })
                }
                for (ret in events) {
                    break
                }
                if (!ret) {
                    var handle = jQuery.data(elem, "handle");
                    if (handle) {
                        handle.elem = null
                    }
                    jQuery.removeData(elem, "events");
                    jQuery.removeData(elem, "handle")
                }
            }
        },
        trigger: function (type, data, elem, donative, extra) {
            data = jQuery.makeArray(data);
            if (type.indexOf("!") >= 0) {
                type = type.slice(0, -1);
                var exclusive = true
            }
            if (!elem) {
                if (this.global[type]) {
                    jQuery("*").add([window, document]).trigger(type, data)
                }
            } else {
                if (elem.nodeType == 3 || elem.nodeType == 8) {
                    return undefined
                }
                var val, ret, fn = jQuery.isFunction(elem[type] || null),
                    event = !data[0] || !data[0].preventDefault;
                if (event) {
                    data.unshift({
                        type: type,
                        target: elem,
                        preventDefault: function () {},
                        stopPropagation: function () {},
                        timeStamp: now()
                    });
                    data[0][expando] = true
                }
                data[0].type = type;
                if (exclusive) {
                    data[0].exclusive = true
                }
                var handle = jQuery.data(elem, "handle");
                if (handle) {
                    val = handle.apply(elem, data)
                }
                if ((!fn || (jQuery.nodeName(elem, "a") && type == "click")) && elem["on" + type] && elem["on" + type].apply(elem, data) === false) {
                    val = false
                }
                if (event) {
                    data.shift()
                }
                if (extra && jQuery.isFunction(extra)) {
                    ret = extra.apply(elem, val == null ? data : data.concat(val));
                    if (ret !== undefined) {
                        val = ret
                    }
                }
                if (fn && donative !== false && val !== false && !(jQuery.nodeName(elem, "a") && type == "click")) {
                    this.triggered = true;
                    try {
                        elem[type]()
                    } catch (e) {}
                }
                this.triggered = false
            }
            return val
        },
        handle: function (event) {
            var val, ret, namespace, all, handlers;
            event = arguments[0] = jQuery.event.fix(event || window.event);
            namespace = event.type.split(".");
            event.type = namespace[0];
            namespace = namespace[1];
            all = !namespace && !event.exclusive;
            handlers = (jQuery.data(this, "events") || {})[event.type];
            for (var j in handlers) {
                var handler = handlers[j];
                if (all || handler.type == namespace) {
                    event.handler = handler;
                    event.data = handler.data;
                    ret = handler.apply(this, arguments);
                    if (val !== false) {
                        val = ret
                    }
                    if (ret === false) {
                        event.preventDefault();
                        event.stopPropagation()
                    }
                }
            }
            return val
        },
        fix: function (event) {
            if (event[expando] == true) {
                return event
            }
            var originalEvent = event;
            event = {
                originalEvent: originalEvent
            };
            var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
            for (var i = props.length; i; i--) {
                event[props[i]] = originalEvent[props[i]]
            }
            event[expando] = true;
            event.preventDefault = function () {
                if (originalEvent.preventDefault) {
                    originalEvent.preventDefault()
                }
                originalEvent.returnValue = false
            };
            event.stopPropagation = function () {
                if (originalEvent.stopPropagation) {
                    originalEvent.stopPropagation()
                }
                originalEvent.cancelBubble = true
            };
            event.timeStamp = event.timeStamp || now();
            if (!event.target) {
                event.target = event.srcElement || document
            }
            if (event.target.nodeType == 3) {
                event.target = event.target.parentNode
            }
            if (!event.relatedTarget && event.fromElement) {
                event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement
            }
            if (event.pageX == null && event.clientX != null) {
                var doc = document.documentElement,
                    body = document.body;
                event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
                event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0)
            }
            if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode)) {
                event.which = event.charCode || event.keyCode
            }
            if (!event.metaKey && event.ctrlKey) {
                event.metaKey = event.ctrlKey
            }
            if (!event.which && event.button) {
                event.which = (event.button & 1 ? 1 : (event.button & 2 ? 3 : (event.button & 4 ? 2 : 0)))
            }
            return event
        },
        proxy: function (fn, proxy) {
            proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
            return proxy
        },
        special: {
            ready: {
                setup: function () {
                    bindReady();
                    return
                },
                teardown: function () {
                    return
                }
            },
            mouseenter: {
                setup: function () {
                    if (jQuery.browser.msie) {
                        return false
                    }
                    jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
                    return true
                },
                teardown: function () {
                    if (jQuery.browser.msie) {
                        return false
                    }
                    jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
                    return true
                },
                handler: function (event) {
                    if (withinElement(event, this)) {
                        return true
                    }
                    event.type = "mouseenter";
                    return jQuery.event.handle.apply(this, arguments)
                }
            },
            mouseleave: {
                setup: function () {
                    if (jQuery.browser.msie) {
                        return false
                    }
                    jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
                    return true
                },
                teardown: function () {
                    if (jQuery.browser.msie) {
                        return false
                    }
                    jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
                    return true
                },
                handler: function (event) {
                    if (withinElement(event, this)) {
                        return true
                    }
                    event.type = "mouseleave";
                    return jQuery.event.handle.apply(this, arguments)
                }
            }
        }
    };
    jQuery.fn.extend({
        bind: function (type, data, fn) {
            return type == "unload" ? this.one(type, data, fn) : this.each(function () {
                jQuery.event.add(this, type, fn || data, fn && data)
            })
        },
        one: function (type, data, fn) {
            var one = jQuery.event.proxy(fn || data, function (event) {
                jQuery(this).unbind(event, one);
                return (fn || data).apply(this, arguments)
            });
            return this.each(function () {
                jQuery.event.add(this, type, one, fn && data)
            })
        },
        unbind: function (type, fn) {
            return this.each(function () {
                jQuery.event.remove(this, type, fn)
            })
        },
        trigger: function (type, data, fn) {
            return this.each(function () {
                jQuery.event.trigger(type, data, this, true, fn)
            })
        },
        triggerHandler: function (type, data, fn) {
            return this[0] && jQuery.event.trigger(type, data, this[0], false, fn)
        },
        toggle: function (fn) {
            var args = arguments,
                i = 1;
            while (i < args.length) {
                jQuery.event.proxy(fn, args[i++])
            }
            return this.click(jQuery.event.proxy(fn, function (event) {
                this.lastToggle = (this.lastToggle || 0) % i;
                event.preventDefault();
                return args[this.lastToggle++].apply(this, arguments) || false
            }))
        },
        hover: function (fnOver, fnOut) {
            return this.bind("mouseenter", fnOver).bind("mouseleave", fnOut)
        },
        ready: function (fn) {
            bindReady();
            if (jQuery.isReady) {
                fn.call(document, jQuery)
            } else {
                jQuery.readyList.push(function () {
                    return fn.call(this, jQuery)
                })
            }
            return this
        }
    });
    jQuery.extend({
        isReady: false,
        readyList: [],
        ready: function () {
            if (!jQuery.isReady) {
                jQuery.isReady = true;
                if (jQuery.readyList) {
                    jQuery.each(jQuery.readyList, function () {
                        this.call(document)
                    });
                    jQuery.readyList = null
                }
                jQuery(document).triggerHandler("ready")
            }
        }
    });
    var readyBound = false;

    function bindReady() {
        if (readyBound) {
            return
        }
        readyBound = true;
        if (document.addEventListener && !jQuery.browser.opera) {
            document.addEventListener("DOMContentLoaded", jQuery.ready, false)
        }
        if (jQuery.browser.msie && window == top) {
            (function () {
                if (jQuery.isReady) {
                    return
                }
                try {
                    document.documentElement.doScroll("left")
                } catch (error) {
                    setTimeout(arguments.callee, 0);
                    return
                }
                jQuery.ready()
            })()
        }
        if (jQuery.browser.opera) {
            document.addEventListener("DOMContentLoaded", function () {
                if (jQuery.isReady) {
                    return
                }
                for (var i = 0; i < document.styleSheets.length; i++) {
                    if (document.styleSheets[i].disabled) {
                        setTimeout(arguments.callee, 0);
                        return
                    }
                }
                jQuery.ready()
            }, false)
        }
        if (jQuery.browser.safari) {
            var numStyles;
            (function () {
                if (jQuery.isReady) {
                    return
                }
                if (document.readyState != "loaded" && document.readyState != "complete") {
                    setTimeout(arguments.callee, 0);
                    return
                }
                if (numStyles === undefined) {
                    numStyles = jQuery("style, link[rel=stylesheet]").length
                }
                if (document.styleSheets.length != numStyles) {
                    setTimeout(arguments.callee, 0);
                    return
                }
                jQuery.ready()
            })()
        }
        jQuery.event.add(window, "load", jQuery.ready)
    }
    jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","), function (i, name) {
        jQuery.fn[name] = function (fn) {
            return fn ? this.bind(name, fn) : this.trigger(name)
        }
    });
    var withinElement = function (event, elem) {
        var parent = event.relatedTarget;
        while (parent && parent != elem) {
            try {
                parent = parent.parentNode
            } catch (error) {
                parent = elem
            }
        }
        return parent == elem
    };
    jQuery(window).bind("unload", function () {
        jQuery("*").add(document).unbind()
    });
    jQuery.fn.extend({
        _load: jQuery.fn.load,
        load: function (url, params, callback) {
            if (typeof url != "string") {
                return this._load(url)
            }
            var off = url.indexOf(" ");
            if (off >= 0) {
                var selector = url.slice(off, url.length);
                url = url.slice(0, off)
            }
            callback = callback ||
            function () {};
            var type = "GET";
            if (params) {
                if (jQuery.isFunction(params)) {
                    callback = params;
                    params = null
                } else {
                    params = jQuery.param(params);
                    type = "POST"
                }
            }
            var self = this;
            jQuery.ajax({
                url: url,
                type: type,
                dataType: "html",
                data: params,
                complete: function (res, status) {
                    if (status == "success" || status == "notmodified") {
                        self.html(selector ? jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")).find(selector) : res.responseText)
                    }
                    self.each(callback, [res.responseText, status, res])
                }
            });
            return this
        },
        serialize: function () {
            return jQuery.param(this.serializeArray())
        },
        serializeArray: function () {
            return this.map(function () {
                return jQuery.nodeName(this, "form") ? jQuery.makeArray(this.elements) : this
            }).filter(function () {
                return this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type))
            }).map(function (i, elem) {
                var val = jQuery(this).val();
                return val == null ? null : val.constructor == Array ? jQuery.map(val, function (val, i) {
                    return {
                        name: elem.name,
                        value: val
                    }
                }) : {
                    name: elem.name,
                    value: val
                }
            }).get()
        }
    });
    jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function (i, o) {
        jQuery.fn[o] = function (f) {
            return this.bind(o, f)
        }
    });
    var jsc = now();
    jQuery.extend({
        get: function (url, data, callback, type) {
            if (jQuery.isFunction(data)) {
                callback = data;
                data = null
            }
            return jQuery.ajax({
                type: "GET",
                url: url,
                data: data,
                success: callback,
                dataType: type
            })
        },
        getScript: function (url, callback) {
            return jQuery.get(url, null, callback, "script")
        },
        getJSON: function (url, data, callback) {
            return jQuery.get(url, data, callback, "json")
        },
        post: function (url, data, callback, type) {
            if (jQuery.isFunction(data)) {
                callback = data;
                data = {}
            }
            return jQuery.ajax({
                type: "POST",
                url: url,
                data: data,
                success: callback,
                dataType: type
            })
        },
        ajaxSetup: function (settings) {
            jQuery.extend(jQuery.ajaxSettings, settings)
        },
        ajaxSettings: {
            url: location.href,
            global: true,
            type: "GET",
            timeout: 0,
            contentType: "application/x-www-form-urlencoded",
            processData: true,
            async: true,
            data: null,
            username: null,
            password: null,
            accepts: {
                xml: "application/xml, text/xml",
                html: "text/html",
                script: "text/javascript, application/javascript",
                json: "application/json, text/javascript",
                text: "text/plain",
                _default: "*/*"
            }
        },
        lastModified: {},
        ajax: function (s) {
            s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
            var jsonp, jsre = /=\?(&|$)/g,
                status, data, type = s.type.toUpperCase();
            if (s.data && s.processData && typeof s.data != "string") {
                s.data = jQuery.param(s.data)
            }
            if (s.dataType == "jsonp") {
                if (type == "GET") {
                    if (!s.url.match(jsre)) {
                        s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"
                    }
                } else {
                    if (!s.data || !s.data.match(jsre)) {
                        s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"
                    }
                }
                s.dataType = "json"
            }
            if (s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre))) {
                jsonp = "jsonp" + jsc++;
                if (s.data) {
                    s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1")
                }
                s.url = s.url.replace(jsre, "=" + jsonp + "$1");
                s.dataType = "script";
                window[jsonp] = function (tmp) {
                    data = tmp;
                    success();
                    complete();
                    window[jsonp] = undefined;
                    try {
                        delete window[jsonp]
                    } catch (e) {}
                    if (head) {
                        head.removeChild(script)
                    }
                }
            }
            if (s.dataType == "script" && s.cache == null) {
                s.cache = false
            }
            if (s.cache === false && type == "GET") {
                var ts = now();
                var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
                s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "")
            }
            if (s.data && type == "GET") {
                s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
                s.data = null
            }
            if (s.global && !jQuery.active++) {
                jQuery.event.trigger("ajaxStart")
            }
            var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;
            if (s.dataType == "script" && type == "GET" && remote.test(s.url) && remote.exec(s.url)[1] != location.host) {
                var head = document.getElementsByTagName("head")[0];
                var script = document.createElement("script");
                script.src = s.url;
                if (s.scriptCharset) {
                    script.charset = s.scriptCharset
                }
                if (!jsonp) {
                    var done = false;
                    script.onload = script.onreadystatechange = function () {
                        if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) {
                            done = true;
                            success();
                            complete();
                            head.removeChild(script)
                        }
                    }
                }
                head.appendChild(script);
                return undefined
            }
            var requestDone = false;
            var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
            if (s.username) {
                xhr.open(type, s.url, s.async, s.username, s.password)
            } else {
                xhr.open(type, s.url, s.async)
            }
            try {
                if (s.data) {
                    xhr.setRequestHeader("Content-Type", s.contentType)
                }
                if (s.ifModified) {
                    xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT")
                }
                xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
                xhr.setRequestHeader("Accept", s.dataType && s.accepts[s.dataType] ? s.accepts[s.dataType] + ", */*" : s.accepts._default)
            } catch (e) {}
            if (s.beforeSend && s.beforeSend(xhr, s) === false) {
                s.global && jQuery.active--;
                xhr.abort();
                return false
            }
            if (s.global) {
                jQuery.event.trigger("ajaxSend", [xhr, s])
            }
            var onreadystatechange = function (isTimeout) {
                if (!requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout")) {
                    requestDone = true;
                    if (ival) {
                        clearInterval(ival);
                        ival = null
                    }
                    status = isTimeout == "timeout" && "timeout" || !jQuery.httpSuccess(xhr) && "error" || s.ifModified && jQuery.httpNotModified(xhr, s.url) && "notmodified" || "success";
                    if (status == "success") {
                        try {
                            data = jQuery.httpData(xhr, s.dataType, s.dataFilter)
                        } catch (e) {
                            status = "parsererror"
                        }
                    }
                    if (status == "success") {
                        var modRes;
                        try {
                            modRes = xhr.getResponseHeader("Last-Modified")
                        } catch (e) {}
                        if (s.ifModified && modRes) {
                            jQuery.lastModified[s.url] = modRes
                        }
                        if (!jsonp) {
                            success()
                        }
                    } else {
                        jQuery.handleError(s, xhr, status)
                    }
                    complete();
                    if (s.async) {
                        xhr = null
                    }
                }
            };
            if (s.async) {
                var ival = setInterval(onreadystatechange, 13);
                if (s.timeout > 0) {
                    setTimeout(function () {
                        if (xhr) {
                            xhr.abort();
                            if (!requestDone) {
                                onreadystatechange("timeout")
                            }
                        }
                    }, s.timeout)
                }
            }
            try {
                xhr.send(s.data)
            } catch (e) {
                jQuery.handleError(s, xhr, null, e)
            }
            if (!s.async) {
                onreadystatechange()
            }
            function success() {
                if (s.success) {
                    s.success(data, status)
                }
                if (s.global) {
                    jQuery.event.trigger("ajaxSuccess", [xhr, s])
                }
            }
            function complete() {
                if (s.complete) {
                    s.complete(xhr, status)
                }
                if (s.global) {
                    jQuery.event.trigger("ajaxComplete", [xhr, s])
                }
                if (s.global && !--jQuery.active) {
                    jQuery.event.trigger("ajaxStop")
                }
            }
            return xhr
        },
        handleError: function (s, xhr, status, e) {
            if (s.error) {
                s.error(xhr, status, e)
            }
            if (s.global) {
                jQuery.event.trigger("ajaxError", [xhr, s, e])
            }
        },
        active: 0,
        httpSuccess: function (xhr) {
            try {
                return !xhr.status && location.protocol == "file:" || (xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || xhr.status == 1223 || jQuery.browser.safari && xhr.status == undefined
            } catch (e) {}
            return false
        },
        httpNotModified: function (xhr, url) {
            try {
                var xhrRes = xhr.getResponseHeader("Last-Modified");
                return xhr.status == 304 || xhrRes == jQuery.lastModified[url] || jQuery.browser.safari && xhr.status == undefined
            } catch (e) {}
            return false
        },
        httpData: function (xhr, type, filter) {
            var ct = xhr.getResponseHeader("content-type"),
                xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
                data = xml ? xhr.responseXML : xhr.responseText;
            if (xml && data.documentElement.tagName == "parsererror") {
                throw "parsererror"
            }
            if (filter) {
                data = filter(data, type)
            }
            if (type == "script") {
                jQuery.globalEval(data)
            }
            if (type == "json") {
                data = eval("(" + data + ")")
            }
            return data
        },
        param: function (a) {
            var s = [];
            if (a.constructor == Array || a.jquery) {
                jQuery.each(a, function () {
                    s.push(encodeURIComponent(this.name) + "=" + encodeURIComponent(this.value))
                })
            } else {
                for (var j in a) {
                    if (a[j] && a[j].constructor == Array) {
                        jQuery.each(a[j], function () {
                            s.push(encodeURIComponent(j) + "=" + encodeURIComponent(this))
                        })
                    } else {
                        s.push(encodeURIComponent(j) + "=" + encodeURIComponent(jQuery.isFunction(a[j]) ? a[j]() : a[j]))
                    }
                }
            }
            return s.join("&").replace(/%20/g, "+")
        }
    });
    jQuery.fn.extend({
        show: function (speed, callback) {
            return speed ? this.animate({
                height: "show",
                width: "show",
                opacity: "show"
            }, speed, callback) : this.filter(":hidden").each(function () {
                this.style.display = this.oldblock || "";
                if (jQuery.css(this, "display") == "none") {
                    var elem = jQuery("<" + this.tagName + " />").appendTo("body");
                    this.style.display = elem.css("display");
                    if (this.style.display == "none") {
                        this.style.display = "block"
                    }
                    elem.remove()
                }
            }).end()
        },
        hide: function (speed, callback) {
            return speed ? this.animate({
                height: "hide",
                width: "hide",
                opacity: "hide"
            }, speed, callback) : this.filter(":visible").each(function () {
                this.oldblock = this.oldblock || jQuery.css(this, "display");
                this.style.display = "none"
            }).end()
        },
        _toggle: jQuery.fn.toggle,
        toggle: function (fn, fn2) {
            return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? this._toggle.apply(this, arguments) : fn ? this.animate({
                height: "toggle",
                width: "toggle",
                opacity: "toggle"
            }, fn, fn2) : this.each(function () {
                jQuery(this)[jQuery(this).is(":hidden") ? "show" : "hide"]()
            })
        },
        slideDown: function (speed, callback) {
            return this.animate({
                height: "show"
            }, speed, callback)
        },
        slideUp: function (speed, callback) {
            return this.animate({
                height: "hide"
            }, speed, callback)
        },
        slideToggle: function (speed, callback) {
            return this.animate({
                height: "toggle"
            }, speed, callback)
        },
        fadeIn: function (speed, callback) {
            return this.animate({
                opacity: "show"
            }, speed, callback)
        },
        fadeOut: function (speed, callback) {
            return this.animate({
                opacity: "hide"
            }, speed, callback)
        },
        fadeTo: function (speed, to, callback) {
            return this.animate({
                opacity: to
            }, speed, callback)
        },
        animate: function (prop, speed, easing, callback) {
            var optall = jQuery.speed(speed, easing, callback);
            return this[optall.queue === false ? "each" : "queue"](function () {
                if (this.nodeType != 1) {
                    return false
                }
                var opt = jQuery.extend({}, optall),
                    p, hidden = jQuery(this).is(":hidden"),
                    self = this;
                for (p in prop) {
                    if (prop[p] == "hide" && hidden || prop[p] == "show" && !hidden) {
                        return opt.complete.call(this)
                    }
                    if (p == "height" || p == "width") {
                        opt.display = jQuery.css(this, "display");
                        opt.overflow = this.style.overflow
                    }
                }
                if (opt.overflow != null) {
                    this.style.overflow = "hidden"
                }
                opt.curAnim = jQuery.extend({}, prop);
                jQuery.each(prop, function (name, val) {
                    var e = new jQuery.fx(self, opt, name);
                    if (/toggle|show|hide/.test(val)) {
                        e[val == "toggle" ? hidden ? "show" : "hide" : val](prop)
                    } else {
                        var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
                            start = e.cur(true) || 0;
                        if (parts) {
                            var end = parseFloat(parts[2]),
                                unit = parts[3] || "px";
                            if (unit != "px") {
                                self.style[name] = (end || 1) + unit;
                                start = ((end || 1) / e.cur(true)) * start;
                                self.style[name] = start + unit
                            }
                            if (parts[1]) {
                                end = ((parts[1] == "-=" ? -1 : 1) * end) + start
                            }
                            e.custom(start, end, unit)
                        } else {
                            e.custom(start, val, "")
                        }
                    }
                });
                return true
            })
        },
        queue: function (type, fn) {
            if (jQuery.isFunction(type) || (type && type.constructor == Array)) {
                fn = type;
                type = "fx"
            }
            if (!type || (typeof type == "string" && !fn)) {
                return queue(this[0], type)
            }
            return this.each(function () {
                if (fn.constructor == Array) {
                    queue(this, type, fn)
                } else {
                    queue(this, type).push(fn);
                    if (queue(this, type).length == 1) {
                        fn.call(this)
                    }
                }
            })
        },
        stop: function (clearQueue, gotoEnd) {
            var timers = jQuery.timers;
            if (clearQueue) {
                this.queue([])
            }
            this.each(function () {
                for (var i = timers.length - 1; i >= 0; i--) {
                    if (timers[i].elem == this) {
                        if (gotoEnd) {
                            timers[i](true)
                        }
                        timers.splice(i, 1)
                    }
                }
            });
            if (!gotoEnd) {
                this.dequeue()
            }
            return this
        }
    });
    var queue = function (elem, type, array) {
        if (elem) {
            type = type || "fx";
            var q = jQuery.data(elem, type + "queue");
            if (!q || array) {
                q = jQuery.data(elem, type + "queue", jQuery.makeArray(array))
            }
        }
        return q
    };
    jQuery.fn.dequeue = function (type) {
        type = type || "fx";
        return this.each(function () {
            var q = queue(this, type);
            q.shift();
            if (q.length) {
                q[0].call(this)
            }
        })
    };
    jQuery.extend({
        speed: function (speed, easing, fn) {
            var opt = speed && speed.constructor == Object ? speed : {
                complete: fn || !fn && easing || jQuery.isFunction(speed) && speed,
                duration: speed,
                easing: fn && easing || easing && easing.constructor != Function && easing
            };
            opt.duration = (opt.duration && opt.duration.constructor == Number ? opt.duration : jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;
            opt.old = opt.complete;
            opt.complete = function () {
                if (opt.queue !== false) {
                    jQuery(this).dequeue()
                }
                if (jQuery.isFunction(opt.old)) {
                    opt.old.call(this)
                }
            };
            return opt
        },
        easing: {
            linear: function (p, n, firstNum, diff) {
                return firstNum + diff * p
            },
            swing: function (p, n, firstNum, diff) {
                return ((-Math.cos(p * Math.PI) / 2) + 0.5) * diff + firstNum
            }
        },
        timers: [],
        timerId: null,
        fx: function (elem, options, prop) {
            this.options = options;
            this.elem = elem;
            this.prop = prop;
            if (!options.orig) {
                options.orig = {}
            }
        }
    });
    jQuery.fx.prototype = {
        update: function () {
            if (this.options.step) {
                this.options.step.call(this.elem, this.now, this)
            }(jQuery.fx.step[this.prop] || jQuery.fx.step._default)(this);
            if (this.prop == "height" || this.prop == "width") {
                this.elem.style.display = "block"
            }
        },
        cur: function (force) {
            if (this.elem[this.prop] != null && this.elem.style[this.prop] == null) {
                return this.elem[this.prop]
            }
            var r = parseFloat(jQuery.css(this.elem, this.prop, force));
            return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0
        },
        custom: function (from, to, unit) {
            this.startTime = now();
            this.start = from;
            this.end = to;
            this.unit = unit || this.unit || "px";
            this.now = this.start;
            this.pos = this.state = 0;
            this.update();
            var self = this;

            function t(gotoEnd) {
                return self.step(gotoEnd)
            }
            t.elem = this.elem;
            jQuery.timers.push(t);
            if (jQuery.timerId == null) {
                jQuery.timerId = setInterval(function () {
                    var timers = jQuery.timers;
                    for (var i = 0; i < timers.length; i++) {
                        if (!timers[i]()) {
                            timers.splice(i--, 1)
                        }
                    }
                    if (!timers.length) {
                        clearInterval(jQuery.timerId);
                        jQuery.timerId = null
                    }
                }, 13)
            }
        },
        show: function () {
            this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop);
            this.options.show = true;
            this.custom(0, this.cur());
            if (this.prop == "width" || this.prop == "height") {
                this.elem.style[this.prop] = "1px"
            }
            jQuery(this.elem).show()
        },
        hide: function () {
            this.options.orig[this.prop] = jQuery.attr(this.elem.style, this.prop);
            this.options.hide = true;
            this.custom(this.cur(), 0)
        },
        step: function (gotoEnd) {
            var t = now();
            if (gotoEnd || t > this.options.duration + this.startTime) {
                this.now = this.end;
                this.pos = this.state = 1;
                this.update();
                this.options.curAnim[this.prop] = true;
                var done = true;
                for (var i in this.options.curAnim) {
                    if (this.options.curAnim[i] !== true) {
                        done = false
                    }
                }
                if (done) {
                    if (this.options.display != null) {
                        this.elem.style.overflow = this.options.overflow;
                        this.elem.style.display = this.options.display;
                        if (jQuery.css(this.elem, "display") == "none") {
                            this.elem.style.display = "block"
                        }
                    }
                    if (this.options.hide) {
                        this.elem.style.display = "none"
                    }
                    if (this.options.hide || this.options.show) {
                        for (var p in this.options.curAnim) {
                            jQuery.attr(this.elem.style, p, this.options.orig[p])
                        }
                    }
                }
                if (done) {
                    this.options.complete.call(this.elem)
                }
                return false
            } else {
                var n = t - this.startTime;
                this.state = n / this.options.duration;
                this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
                this.now = this.start + ((this.end - this.start) * this.pos);
                this.update()
            }
            return true
        }
    };
    jQuery.extend(jQuery.fx, {
        speeds: {
            slow: 600,
            fast: 200,
            def: 400
        },
        step: {
            scrollLeft: function (fx) {
                fx.elem.scrollLeft = fx.now
            },
            scrollTop: function (fx) {
                fx.elem.scrollTop = fx.now
            },
            opacity: function (fx) {
                jQuery.attr(fx.elem.style, "opacity", fx.now)
            },
            _default: function (fx) {
                fx.elem.style[fx.prop] = fx.now + fx.unit
            }
        }
    });
    jQuery.fn.offset = function () {
        var left = 0,
            top = 0,
            elem = this[0],
            results;
        if (elem) {
            with(jQuery.browser) {
                var parent = elem.parentNode,
                    offsetChild = elem,
                    offsetParent = elem.offsetParent,
                    doc = elem.ownerDocument,
                    safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
                    css = jQuery.curCSS,
                    fixed = css(elem, "position") == "fixed";
                if (elem.getBoundingClientRect) {
                    var box = elem.getBoundingClientRect();
                    add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
                    add(-doc.documentElement.clientLeft, -doc.documentElement.clientTop)
                } else {
                    add(elem.offsetLeft, elem.offsetTop);
                    while (offsetParent) {
                        add(offsetParent.offsetLeft, offsetParent.offsetTop);
                        if (mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2) {
                            border(offsetParent)
                        }
                        if (!fixed && css(offsetParent, "position") == "fixed") {
                            fixed = true
                        }
                        offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
                        offsetParent = offsetParent.offsetParent
                    }
                    while (parent && parent.tagName && !/^body|html$/i.test(parent.tagName)) {
                        if (!/^inline|table.*$/i.test(css(parent, "display"))) {
                            add(-parent.scrollLeft, -parent.scrollTop)
                        }
                        if (mozilla && css(parent, "overflow") != "visible") {
                            border(parent)
                        }
                        parent = parent.parentNode
                    }
                    if ((safari2 && (fixed || css(offsetChild, "position") == "absolute")) || (mozilla && css(offsetChild, "position") != "absolute")) {
                        add(-doc.body.offsetLeft, -doc.body.offsetTop)
                    }
                    if (fixed) {
                        add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), Math.max(doc.documentElement.scrollTop, doc.body.scrollTop))
                    }
                }
                results = {
                    top: top,
                    left: left
                }
            }
        }
        function border(elem) {
            add(jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true))
        }
        function add(l, t) {
            left += parseInt(l, 10) || 0;
            top += parseInt(t, 10) || 0
        }
        return results
    };
/*
    jQuery.fn.extend({
        position: function () {
            var left = 0,
                top = 0,
                results;
            if (this[0]) {
                var offsetParent = this.offsetParent(),
                    offset = this.offset(),
                    parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? {
                        top: 0,
                        left: 0
                    } : offsetParent.offset();
                offset.top -= num(this, "marginTop");
                offset.left -= num(this, "marginLeft");
                parentOffset.top += num(offsetParent, "borderTopWidth");
                parentOffset.left += num(offsetParent, "borderLeftWidth");
                results = {
                    top: offset.top - parentOffset.top,
                    left: offset.left - parentOffset.left
                }
            }
            return results
        },
        offsetParent: function () {
            var offsetParent = this[0].offsetParent;
            while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, "position") == "static")) {
                offsetParent = offsetParent.offsetParent
            }
            return jQuery(offsetParent)
        }
    });
	*/

    jQuery.each(["Left", "Top"], function (i, name) {
        var method = "scroll" + name;
        jQuery.fn[method] = function (val) {
            if (!this[0]) {
                return
            }
            return val != undefined ? this.each(function () {
                this == window || this == document ? window.scrollTo(!i ? val : jQuery(window).scrollLeft(), i ? val : jQuery(window).scrollTop()) : this[method] = val
            }) : this[0] == window || this[0] == document ? self[i ? "pageYOffset" : "pageXOffset"] || jQuery.boxModel && document.documentElement[method] || document.body[method] : this[0][method]
        }
    });
    jQuery.each(["Height", "Width"], function (i, name) {
        var tl = i ? "Left" : "Top",
            br = i ? "Right" : "Bottom";
        jQuery.fn["inner" + name] = function () {
            return this[name.toLowerCase()]() + num(this, "padding" + tl) + num(this, "padding" + br)
        };
        jQuery.fn["outer" + name] = function (margin) {
            return this["inner" + name]() + num(this, "border" + tl + "Width") + num(this, "border" + br + "Width") + (margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0)
        }
    })
})();
(function ($) {
    $.fn.charCounter = function (max, settings) {
        max = max || 100;
        settings = $.extend({
            container: "<span></span>",
            classname: "charcounter",
            format: "(%1 characters remaining)",
            pulse: true,
            delay: 0
        }, settings);
        var p, timeout;

        function count(el, container) {
            el = $(el);
            if (el.val().length > max) {
                el.val(el.val().substring(0, max));
                if (settings.pulse && !p) {
                    pulse(container, true)
                }
            }
            if (settings.delay > 0) {
                if (timeout) {
                    window.clearTimeout(timeout)
                }
                timeout = window.setTimeout(function () {
                    container.html(settings.format.replace(/%1/, (max - el.val().length)))
                }, settings.delay)
            } else {
                container.html(settings.format.replace(/%1/, (max - el.val().length)))
            }
        }
        function pulse(el, again) {
            if (p) {
                window.clearTimeout(p);
                p = null
            }
            el.animate({
                opacity: 0.1
            }, 100, function () {
                $(this).animate({
                    opacity: 1
                }, 100)
            });
            if (again) {
                p = window.setTimeout(function () {
                    pulse(el)
                }, 200)
            }
        }
        return this.each(function () {
            var container = (!settings.container.match(/^<.+>$/)) ? $(settings.container) : $(settings.container).insertAfter(this).addClass(settings.classname);
            $(this).bind("keydown", function () {
                count(this, container)
            }).bind("keypress", function () {
                count(this, container)
            }).bind("keyup", function () {
                count(this, container)
            }).bind("focus", function () {
                count(this, container)
            }).bind("mouseover", function () {
                count(this, container)
            }).bind("mouseout", function () {
                count(this, container)
            }).bind("paste", function () {
                var me = this;
                setTimeout(function () {
                    count(me, container)
                }, 10)
            });
            if (this.addEventListener) {
                this.addEventListener("input", function () {
                    count(this, container)
                }, false)
            }
            count(this, container)
        })
    };
	/*
    var dropShadowZindex = 10;
    $.fn.dropShadow = function (options) {
        var opt = $.extend({
            left: ($.browser.msie && $.browser.version < 7) ? 3 : 5,
            top: ($.browser.msie && $.browser.version < 7) ? 3 : 5,
            blur: ($.browser.msie && $.browser.version < 7) ? 0 : 5,
            opacity: 0.3,
            color: "black",
            swap: false
        }, options);
        var jShadows = $([]);
        this.not(".dropShadow").each(function () {
            var jthis = $(this);
            var shadows = [];
            var blur = (opt.blur <= 0) ? 0 : opt.blur;
            var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8);
            var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1;
            var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex;
            var shadowId;
            if (this.id) {
                shadowId = this.id + "_dropShadow"
            } else {
                shadowId = "ds" + (1 + Math.floor(9999 * Math.random()))
            }
            $.data(this, "shadowId", shadowId);
            $.data(this, "shadowOptions", options);
            jthis.attr("shadowId", shadowId).css("zIndex", zOriginal);
            if (jthis.css("position") != "absolute") {
                jthis.css({
                    position: "relative",
                    zoom: 1
                })
            }
            bgColor = jthis.css("backgroundColor");
            if (bgColor == "rgba(0, 0, 0, 0)") {
                bgColor = "transparent"
            }
            if (bgColor != "transparent" || jthis.css("backgroundImage") != "none" || this.nodeName == "SELECT" || this.nodeName == "INPUT" || this.nodeName == "TEXTAREA") {
                shadows[0] = $("<div></div>").css("background", opt.color)
            } else {
                shadows[0] = jthis.clone().removeAttr("id").removeAttr("name").removeAttr("shadowId").css("color", opt.color)
            }
            shadows[0].addClass("dropShadow").css({
                height: jthis.outerHeight(),
                left: blur,
                opacity: opacity,
                position: "absolute",
                top: blur,
                width: jthis.outerWidth(),
                zIndex: zShadow
            });
            var layers = (8 * blur) + 1;
            for (i = 1; i < layers; i++) {
                shadows[i] = shadows[0].clone()
            }
            var i = 1;
            var j = blur;
            while (j > 0) {
                shadows[i].css({
                    left: j * 2,
                    top: 0
                });
                shadows[i + 1].css({
                    left: j * 4,
                    top: j * 2
                });
                shadows[i + 2].css({
                    left: j * 2,
                    top: j * 4
                });
                shadows[i + 3].css({
                    left: 0,
                    top: j * 2
                });
                shadows[i + 4].css({
                    left: j * 3,
                    top: j
                });
                shadows[i + 5].css({
                    left: j * 3,
                    top: j * 3
                });
                shadows[i + 6].css({
                    left: j,
                    top: j * 3
                });
                shadows[i + 7].css({
                    left: j,
                    top: j
                });
                i += 8;
                j--
            }
            var divShadow = $("<div></div>").attr("id", shadowId).addClass("dropShadow").css({
                left: jthis.position().left + opt.left - blur,
                marginTop: jthis.css("marginTop"),
                marginRight: jthis.css("marginRight"),
                marginBottom: jthis.css("marginBottom"),
                marginLeft: jthis.css("marginLeft"),
                position: "absolute",
                top: jthis.position().top + opt.top - blur,
                zIndex: zShadow
            });
            for (i = 0; i < layers; i++) {
                divShadow.append(shadows[i])
            }
            jthis.after(divShadow);
            jShadows = jShadows.add(divShadow);
            $(window).resize(function () {
                try {
                    divShadow.css({
                        left: jthis.position().left + opt.left - blur,
                        top: jthis.position().top + opt.top - blur
                    })
                } catch (e) {}
            });
            dropShadowZindex += 2
        });
        return this.pushStack(jShadows)
    };
	*/
    $.fn.redrawShadow = function () {
        this.removeShadow();
        return this.each(function () {
            var shadowOptions = $.data(this, "shadowOptions");
            $(this).dropShadow(shadowOptions)
        })
    };
    $.fn.removeShadow = function () {
        return this.each(function () {
            var shadowId = $(this).shadowId();
            $("div#" + shadowId).remove()
        })
    };
    $.fn.shadowId = function () {
        return $.data(this[0], "shadowId")
    };
    $(function () {
        var noPrint = "<style type='text/css' media='print'>";
        noPrint += ".dropShadow{visibility:hidden;}</style>";
        $("head").append(noPrint)
    });
    $.fn.prettyComments = function (settings) {
        settings = jQuery.extend({
            animate: false,
            animationSpeed: "fast",
            maxHeight: 500,
            alreadyAnimated: false,
            init: true
        }, settings);
        $("body").append('<div id="comment_hidden"></div>');
        var setCSS = function (which) {
            $("#comment_hidden").css({
                position: "absolute",
                top: -10000,
                left: -10000,
                width: $(which).width(),
                "min-height": $(which).height(),
                "font-family": $(which).css("font-family"),
                "font-size": $(which).css("font-size"),
                "line-height": $(which).css("line-height")
            });
            if ($.browser.msie && parseFloat($.browser.version) < 7) {
                $("#comment_hidden").css("height", $(which).height())
            }
        };
        var copyContent = function (which) {
            theValue = $(which).attr("value") || "";
            theValue = theValue.replace(/\n/g, "<br />");
            $("#comment_hidden").html(theValue + "<br />");
            if (!settings.init) {
                if ($("#comment_hidden").height() > $(which).height()) {
                    if ($("#comment_hidden").height() > settings.maxHeight) {
                        $(which).css("overflow-y", "scroll")
                    } else {
                        $(which).css("overflow-y", "hidden");
                        expand(which)
                    }
                } else {
                    if ($("#comment_hidden").height() < $(which).height()) {
                        if ($("#comment_hidden").height() > settings.maxHeight) {
                            $(which).css("overflow-y", "scroll")
                        } else {
                            $(which).css("overflow-y", "hidden");
                            shrink(which)
                        }
                    }
                }
            }
        };
        var expand = function (which) {
            if (settings.animate && !settings.alreadyAnimated) {
                settings.alreadyAnimated = true;
                $(which).animate({
                    height: $("#comment_hidden").height()
                }, settings.animationSpeed, function () {
                    settings.alreadyAnimated = false
                })
            } else {
                if (!settings.animate && !settings.alreadyAnimated) {
                    $(which).height($("#comment_hidden").height())
                }
            }
        };
        var shrink = function (which) {
            if (settings.animate && !settings.alreadyAnimated) {
                settings.alreadyAnimated = true;
                $(which).animate({
                    height: $("#comment_hidden").height()
                }, settings.animationSpeed, function () {
                    settings.alreadyAnimated = false
                })
            } else {
                $(which).height($("#comment_hidden").height())
            }
        };
        $(this).each(function () {
            $(this).css({
                "overflow-x": "auto",
                "overflow-y": "hidden"
            }).bind("keyup", function () {
                copyContent($(this))
            });
            setCSS(this);
            copyContent($(this));
            if ($("#comment_hidden").height() > settings.maxHeight) {
                $(this).css({
                    "overflow-y": "scroll",
                    height: settings.maxHeight
                })
            } else {
                $(this).height($("#comment_hidden").height())
            }
            settings.init = false
        })
    };
    $.fn.media = function (options, f1, f2) {
        return this.each(function () {
            if (typeof options == "function") {
                f2 = f1;
                f1 = options;
                options = {}
            }
            var o = getSettings(this, options);
            if (typeof f1 == "function") {
                f1(this, o)
            }
            var r = getTypesRegExp();
            var m = r.exec(o.src) || [""];
            o.type ? m[0] = o.type : m.shift();
            for (var i = 0; i < m.length; i++) {
                fn = m[i].toLowerCase();
                if (isDigit(fn[0])) {
                    fn = "fn" + fn
                }
                if (!$.fn.media[fn]) {
                    continue
                }
                var player = $.fn.media[fn + "_player"];
                if (!o.params) {
                    o.params = {}
                }
                if (player) {
                    var num = player.autoplayAttr == "autostart";
                    o.params[player.autoplayAttr || "autoplay"] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false
                }
                var $div = $.fn.media[fn](this, o);
                $div.css("backgroundColor", o.bgColor).width(o.width);
                if (typeof f2 == "function") {
                    f2(this, $div[0], o, player.name)
                }
                break
            }
        })
    };
    $.fn.media.mapFormat = function (format, player) {
        if (!format || !player || !$.fn.media.defaults.players[player]) {
            return
        }
        format = format.toLowerCase();
        if (isDigit(format[0])) {
            format = "fn" + format
        }
        $.fn.media[format] = $.fn.media[player];
        $.fn.media[format + "_player"] = $.fn.media.defaults.players[player]
    };
    $.fn.media.defaults = {
        width: 400,
        height: 400,
        autoplay: 0,
        bgColor: "#ffffff",
        params: {
            wmode: "transparent"
        },
        attrs: {},
        flashvars: {},
        flashVersion: "7",
        expressInstaller: null,
        flvPlayer: "mediaplayer.swf",
        mp3Player: "mediaplayer.swf",
        silverlight: {
            inplaceInstallPrompt: "true",
            isWindowless: "true",
            framerate: "24",
            version: "0.9",
            onError: null,
            onLoad: null,
            initParams: null,
            userContext: null
        }
    };
    $.fn.media.defaults.players = {
        flash: {
            name: "flash",
            types: "flv,mp3,swf",
            oAttrs: {
                classid: "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
                type: "application/x-oleobject",
                codebase: "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + $.fn.media.defaults.flashVersion
            },
            eAttrs: {
                type: "application/x-shockwave-flash",
                pluginspage: "http://www.adobe.com/go/getflashplayer"
            }
        },
        quicktime: {
            name: "quicktime",
            types: "aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp",
            oAttrs: {
                classid: "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",
                codebase: "http://www.apple.com/qtactivex/qtplugin.cab"
            },
            eAttrs: {
                pluginspage: "http://www.apple.com/quicktime/download/"
            }
        },
        realplayer: {
            name: "real",
            types: "ra,ram,rm,rpm,rv,smi,smil",
            autoplayAttr: "autostart",
            oAttrs: {
                classid: "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
            },
            eAttrs: {
                type: "audio/x-pn-realaudio-plugin",
                pluginspage: "http://www.real.com/player/"
            }
        },
        winmedia: {
            name: "winmedia",
            types: "asf,avi,wma,wmv",
            autoplayAttr: "autostart",
            oUrl: "url",
            oAttrs: {
                classid: "clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6",
                type: "application/x-oleobject"
            },
            eAttrs: {
                type: $.browser.mozilla && isFirefoxWMPPluginInstalled() ? "application/x-ms-wmp" : "application/x-mplayer2",
                pluginspage: "http://www.microsoft.com/Windows/MediaPlayer/"
            }
        },
        iframe: {
            name: "iframe",
            types: "html,pdf"
        },
        silverlight: {
            name: "silverlight",
            types: "xaml"
        }
    };

    function isFirefoxWMPPluginInstalled() {
        var plugs = navigator.plugins;
        for (i = 0; i < plugs.length; i++) {
            var plugin = plugs[i];
            if (plugin.filename == "np-mswmp.dll") {
                return true
            }
        }
        return false
    }
    var counter = 1;
    for (var player in $.fn.media.defaults.players) {
        var types = $.fn.media.defaults.players[player].types;
        $.each(types.split(","), function (i, o) {
            if (isDigit(o[0])) {
                o = "fn" + o
            }
            $.fn.media[o] = $.fn.media[player] = getGenerator(player);
            $.fn.media[o + "_player"] = $.fn.media.defaults.players[player]
        })
    }
    function getTypesRegExp() {
        var types = "";
        for (var player in $.fn.media.defaults.players) {
            if (types.length) {
                types += ","
            }
            types += $.fn.media.defaults.players[player].types
        }
        return new RegExp("\\.(" + types.replace(/,/g, "|") + ")\\b")
    }
    function getGenerator(player) {
        return function (el, options) {
            return generate(el, options, player)
        }
    }
    function isDigit(c) {
        return "0123456789".indexOf(c) > -1
    }
    function getSettings(el, options) {
        options = options || {};
        var $el = $(el);
        var cls = el.className || "";
        var meta = $.metadata ? $el.metadata() : $.meta ? $el.data() : {};
        meta = meta || {};
        var w = meta.width || parseInt(((cls.match(/w:(\d+)/) || [])[1] || 0));
        var h = meta.height || parseInt(((cls.match(/h:(\d+)/) || [])[1] || 0));
        if (w) {
            meta.width = w
        }
        if (h) {
            meta.height = h
        }
        if (cls) {
            meta.cls = cls
        }
        var a = $.fn.media.defaults;
        var b = options;
        var c = meta;
        var p = {
            params: {
                bgColor: options.bgColor || $.fn.media.defaults.bgColor
            }
        };
        var opts = $.extend({}, a, b, c);
        $.each(["attrs", "params", "flashvars", "silverlight"], function (i, o) {
            opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {})
        });
        if (typeof opts.caption == "undefined") {
            opts.caption = $el.text()
        }
        opts.src = opts.src || $el.attr("href") || $el.attr("src") || "unknown";
        return opts
    }
    $.fn.media.swf = function (el, opts) {
        if (!window.SWFObject && !window.swfobject) {
            if (opts.flashvars) {
                var a = [];
                for (var f in opts.flashvars) {
                    a.push(f + "=" + opts.flashvars[f])
                }
                if (!opts.params) {
                    opts.params = {}
                }
                opts.params.flashvars = a.join("&")
            }
            return generate(el, opts, "flash")
        }
        var id = el.id ? (' id="' + el.id + '"') : "";
        var cls = opts.cls ? (' class="' + opts.cls + '"') : "";
        var $div = $("<div" + id + cls + ">");
        if (window.swfobject) {
            $(el).after($div).appendTo($div);
            if (!el.id) {
                el.id = "movie_player_" + counter++
            }
            swfobject.embedSWF(opts.src, el.id, opts.width, opts.height, opts.flashVersion, opts.expressInstaller, opts.flashvars, opts.params, opts.attrs)
        } else {
            $(el).after($div).remove();
            var so = new SWFObject(opts.src, "movie_player_" + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
            if (opts.expressInstaller) {
                so.useExpressInstall(opts.expressInstaller)
            }
            for (var p in opts.params) {
                if (p != "bgColor") {
                    so.addParam(p, opts.params[p])
                }
            }
            for (var f in opts.flashvars) {
                so.addVariable(f, opts.flashvars[f])
            }
            so.write($div[0])
        }
        if (opts.caption) {
            $("<div>").appendTo($div).html(opts.caption)
        }
        return $div
    };
    $.fn.media.flv = $.fn.media.mp3 = function (el, opts) {
        var src = opts.src;
        var player = /\.mp3\b/i.test(src) ? $.fn.media.defaults.mp3Player : $.fn.media.defaults.flvPlayer;
        opts.src = player;
        opts.src = opts.src + "?file=" + src;
        opts.flashvars = $.extend({}, {
            file: src
        }, opts.flashvars);
        return $.fn.media.swf(el, opts)
    };
    $.fn.media.xaml = function (el, opts) {
        if (!window.Sys || !window.Sys.Silverlight) {
            if ($.fn.media.xaml.warning) {
                return
            }
            $.fn.media.xaml.warning = 1;
            alert("You must include the Silverlight.js script.");
            return
        }
        var props = {
            width: opts.width,
            height: opts.height,
            background: opts.bgColor,
            inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
            isWindowless: opts.silverlight.isWindowless,
            framerate: opts.silverlight.framerate,
            version: opts.silverlight.version
        };
        var events = {
            onError: opts.silverlight.onError,
            onLoad: opts.silverlight.onLoad
        };
        var id1 = el.id ? (' id="' + el.id + '"') : "";
        var id2 = opts.id || "AG" + counter++;
        var cls = opts.cls ? (' class="' + opts.cls + '"') : "";
        var $div = $("<div" + id1 + cls + ">");
        $(el).after($div).remove();
        Sys.Silverlight.createObjectEx({
            source: opts.src,
            initParams: opts.silverlight.initParams,
            userContext: opts.silverlight.userContext,
            id: id2,
            parentElement: $div[0],
            properties: props,
            events: events
        });
        if (opts.caption) {
            $("<div>").appendTo($div).html(opts.caption)
        }
        return $div
    };
     /*
    function generate(el, opts, player) {
        var $el = $(el);
        var o = $.fn.media.defaults.players[player];
        if (player == "iframe") {
            var o = $('<iframe width="' + opts.width + '" height="' + opts.height + '" >');
            o.attr("src", opts.src);
            o.css("backgroundColor", o.bgColor)
        } else {
            if ($.browser.msie) {
                var a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
                for (var key in opts.attrs) {
                    a.push(key + '="' + opts.attrs[key] + '" ')
                }
                for (var key in o.oAttrs || {}) {
                    a.push(key + '="' + o.oAttrs[key] + '" ')
                }
                a.push("></object>");
                var p = ['<param name="' + (o.oUrl || "src") + '" value="' + opts.src + '">'];
                for (var key in opts.params) {
                    p.push('<param name="' + key + '" value="' + opts.params[key] + '">')
                }
                var o = document.createElement(a.join(""));
                for (var i = 0; i < p.length; i++) {
                    o.appendChild(document.createElement(p[i]))
                }
            } else {
                var a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
                if (opts.src) {
                    a.push(' src="' + opts.src + '" ')
                }
                for (var key in opts.attrs) {
                    a.push(key + '="' + opts.attrs[key] + '" ')
                }
                for (var key in o.eAttrs || {}) {
                    a.push(key + '="' + o.eAttrs[key] + '" ')
                }
                for (var key in opts.params) {
                    a.push(key + '="' + opts.params[key] + '" ')
                }
                a.push("></embed>")
            }
        }
        var id = el.id ? (' id="' + el.id + '"') : "";
        var cls = opts.cls ? (' class="' + opts.cls + '"') : "";
        var $div = $("<div" + id + cls + ">");
        $el.after($div).remove();
        ($.browser.msie || player == "iframe") ? $div.append(o) : $div.html(a.join(""));
        if (opts.caption) {
            $("<div>").appendTo($div).html(opts.caption)
        }
        return $div
    }
	*/
    $.extend({
        metadata: {
            defaults: {
                type: "class",
                name: "metadata",
                cre: /({.*})/,
                single: "metadata"
            },
            setType: function (type, name) {
                this.defaults.type = type;
                this.defaults.name = name
            },
            get: function (elem, opts) {
                var settings = $.extend({}, this.defaults, opts);
                if (!settings.single.length) {
                    settings.single = "metadata"
                }
                var data = $.data(elem, settings.single);
                if (data) {
                    return data
                }
                data = "{}";
                if (settings.type == "class") {
                    var m = settings.cre.exec(elem.className);
                    if (m) {
                        data = m[1]
                    }
                } else {
                    if (settings.type == "elem") {
                        if (!elem.getElementsByTagName) {
                            return undefined
                        }
                        var e = elem.getElementsByTagName(settings.name);
                        if (e.length) {
                            data = $.trim(e[0].innerHTML)
                        }
                    } else {
                        if (elem.getAttribute != undefined) {
                            var attr = elem.getAttribute(settings.name);
                            if (attr) {
                                data = attr
                            }
                        }
                    }
                }
                if (data.indexOf("{") < 0) {
                    data = "{" + data + "}"
                }
                data = eval("(" + data + ")");
                $.data(elem, settings.single, data);
                return data
            }
        }
    });
    $.fn.metadata = function (opts) {
        return $.metadata.get(this[0], opts)
    };
	/*
    $.fn.bgIframe = function (s) {
        if (ie6 = $.browser.msie && ($.browser.version == "6.0")) {
            s = $.extend({
                top: "auto",
                left: "auto",
                width: "auto",
                height: "auto",
                opacity: true,
                src: "javascript:false;"
            }, s || {});
            var prop = function (n) {
                return n && n.constructor == Number ? n + "px" : n
            },
                html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? "filter:Alpha(Opacity='0');" : "") + "top:" + (s.top == "auto" ? "expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')" : prop(s.top)) + ";left:" + (s.left == "auto" ? "expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')" : prop(s.left)) + ";width:" + (s.width == "auto" ? "expression(this.parentNode.offsetWidth+'px')" : prop(s.width)) + ";height:" + (s.height == "auto" ? "expression(this.parentNode.offsetHeight+'px')" : prop(s.height)) + ';"/>';
            return this.each(function () {
                if ($("> iframe.bgiframe", this).length == 0) {
                    this.insertBefore(document.createElement(html), this.firstChild)
                }
            })
        }
        return this
    };

    $.facebox = function (data, klass) {
        $.facebox.loading();
        if (data.ajax) {
            fillFaceboxFromAjax(data.ajax, klass)
        } else {
            if (data.image) {
                fillFaceboxFromImage(data.image, klass)
            } else {
                if (data.div) {
                    fillFaceboxFromHref(data.div, klass)
                } else {
                    if ($.isFunction(data)) {
                        data.call($)
                    } else {
                        $.facebox.reveal(data, klass)
                    }
                }
            }
        }
    };
    $.facebox = function (data, klass) {
        $.facebox.loading();
        if (data.ajax) {
            fillFaceboxFromAjax(data.ajax, klass)
        } else {
            if (data.image) {
                fillFaceboxFromImage(data.image, klass)
            } else {
                if (data.div) {
                    fillFaceboxFromHref(data.div, klass)
                } else {
                    if ($.isFunction(data)) {
                        data.call($)
                    } else {
                        $.facebox.reveal(data, klass)
                    }
                }
            }
        }
    };*/
	/*
    $.extend($.facebox, {
        settings: {
            opacity: 0.15,
            overlay: true,
            loadingImage: "/wps/themes/html/Facelift/gfx/content/loading.gif",
            closeImage: "/wps/themes/html/Facelift/gfx/content/closelabel.png",
            imageTypes: ["png", "jpg", "jpeg", "gif"],
            faceboxHtml: '    <div id="facebox" style="display:none;">       <div class="popup">         <table>           <tbody>             <tr>               <td class="tl"/><td class="b"/><td class="tr"/>             </tr>             <tr>               <td class="b"/>               <td class="body">                 <div class="footer">                   <a href="#" class="close">                     <img src="/wps/themes/html/Facelift/gfx/content/closelabel.gif" title="close" class="close_image" />                   </a>                 </div> 				<div class="content">                 </div>               </td>               <td class="b"/>             </tr>             <tr>               <td class="bl"/><td class="b"/><td class="br"/>             </tr>           </tbody>         </table>       </div>     </div>'
        },
        loading: function () {
            init();
            if ($("#facebox .loading").length == 1) {
                return true
            }
            showOverlay();
            $("#facebox .content").empty();
            $("#facebox .body").children().hide().end().append('<div class="loading"><img src="' + $.facebox.settings.loadingImage + '"/></div>');
            $("#facebox").css({
                top: getPageScroll()[1] + (getPageHeight() / 10),
                left: $(window).width() / 2 - 205
            }).show().bgIframe();
            $(document).bind("keydown.facebox", function (e) {
                if (e.keyCode == 27) {
                    $.facebox.close()
                }
                return true
            });
            $(document).trigger("loading.facebox")
        },
        reveal: function (data, klass) {
            $(document).trigger("beforeReveal.facebox");
            if (klass) {
                $("#facebox .content").addClass(klass)
            }
            $("#facebox .content").append(data);
            $("#facebox .loading").remove();
            $("#facebox .body").children().fadeIn("normal");
            $("#facebox").css("left", $(window).width() / 2 - ($("#facebox table").width() / 2));
            $(document).trigger("reveal.facebox").trigger("afterReveal.facebox")
        },
        close: function () {
            $(document).trigger("close.facebox");
            return false
        }
    });
	*/
    $.fn.facebox = function (settings) {
        init(settings);

        function clickHandler() {
            $.facebox.loading(true);
            var klass = this.rel.match(/facebox\[?\.(\w+)\]?/);
            if (klass) {
                klass = klass[1]
            }
            fillFaceboxFromHref(this.href, klass);
            return false
        }
        return this.bind("click.facebox", clickHandler)
    };
/*
    function init(settings) {
        if ($.facebox.settings.inited) {
            return true
        } else {
            $.facebox.settings.inited = true
        }
        $(document).trigger("init.facebox");
        makeCompatible();
        var imageTypes = $.facebox.settings.imageTypes.join("|");
        $.facebox.settings.imageTypesRegexp = new RegExp(".(" + imageTypes + ")$", "i");
        if (settings) {
            $.extend($.facebox.settings, settings)
        }
        $("body").append($.facebox.settings.faceboxHtml);
        var preload = [new Image(), new Image()];
        preload[0].src = $.facebox.settings.closeImage;
        preload[1].src = $.facebox.settings.loadingImage;
        $("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function () {
            preload.push(new Image());
            preload.slice(-1).src = $(this).css("background-image").replace(/url\((.+)\)/, "$1")
        });
        $("#facebox .close").click($.facebox.close);
        $("#facebox .close_image").attr("src", $.facebox.settings.closeImage)
    }
	*/
    function getPageScroll() {
        var xScroll, yScroll;
        if (self.pageYOffset) {
            yScroll = self.pageYOffset;
            xScroll = self.pageXOffset
        } else {
            if (document.documentElement && document.documentElement.scrollTop) {
                yScroll = document.documentElement.scrollTop;
                xScroll = document.documentElement.scrollLeft
            } else {
                if (document.body) {
                    yScroll = document.body.scrollTop;
                    xScroll = document.body.scrollLeft
                }
            }
        }
        return new Array(xScroll, yScroll)
    }
    function getPageHeight() {
        var windowHeight;
        if (self.innerHeight) {
            windowHeight = self.innerHeight
        } else {
            if (document.documentElement && document.documentElement.clientHeight) {
                windowHeight = document.documentElement.clientHeight
            } else {
                if (document.body) {
                    windowHeight = document.body.clientHeight
                }
            }
        }
        return windowHeight
    }/*
    function makeCompatible() {
        var $s = $.facebox.settings;
        $s.loadingImage = $s.loading_image || $s.loadingImage;
        $s.closeImage = $s.close_image || $s.closeImage;
        $s.imageTypes = $s.image_types || $s.imageTypes;
        $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
    }
    function fillFaceboxFromHref(href, klass) {
        if (href.match(/#/)) {
            var url = window.location.href.split("#");
            var target = href.replace(url, "");
            $.facebox.reveal($(target).show().replaceWith("<div id='facebox_moved'></div>"), klass)
        } else {
            if (href.match($.facebox.settings.imageTypesRegexp)) {
                fillFaceboxFromImage(href, klass)
            } else {
                fillFaceboxFromAjax(href, klass)
            }
        }
    }

    function fillFaceboxFromImage(href, klass) {
        var image = new Image();
        image.onload = function () {
            $.facebox.reveal('xxxx<div class="image">xxx<img src="' + image.src + '" /></div>', klass)
        };
        image.src = href
    }*/
    function fillFaceboxFromAjax(href, klass) {
        $.get(href, function (data) {
            $.facebox.reveal(data, klass)
        })
    }
    function skipOverlay() {
        return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null
    }
    function showOverlay() {
        if (skipOverlay()) {
            return
        }
        if ($("#facebox_overlay").length == 0) {
            $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')
        }
        $("#facebox_overlay").hide().addClass("facebox_overlayBG").css({
            opacity: $.facebox.settings.opacity,
            height: $(document).height()
        }).click(function () {
            $(document).trigger("close.facebox")
        }).fadeIn(200);
        return false
    }
    function hideOverlay() {
        if (skipOverlay()) {
            return
        }
        $("#facebox_overlay").fadeOut(200, function () {
            $("#facebox_overlay").removeClass("facebox_overlayBG");
            $("#facebox_overlay").addClass("facebox_hide");
            $("#facebox_overlay").remove()
        });
        return false
    }
    $(document).bind("close.facebox", function () {
        $(document).unbind("keydown.facebox");
        $("#facebox").fadeOut(function () {
            if ($("#facebox_moved").length == 0) {
                $("#facebox .content").removeClass().addClass("content")
            } else {
                $("#facebox_moved").replaceWith($("#facebox .content").children().hide())
            }
            hideOverlay();
            $("#facebox .loading").remove()
        })
    });
    $.blockUI = function (opts) {
        install(window, opts)
    };
    $.unblockUI = function (opts) {
        remove(window, opts)
    };
    $.fn.block = function (opts) {
        return this.each(function () {
            if ($.css(this, "position") == "static") {
                this.style.position = "relative"
            }
            if ($.browser.msie) {
                this.style.zoom = 1
            }
            install(this, opts)
        })
    };
    $.fn.unblock = function (opts) {
        return this.each(function () {
            remove(this, opts)
        })
    };
    $.blockUI.version = 2.08;
    $.blockUI.defaults = {
        message: "<h3>Please wait...</h3>",
        css: {
            padding: 0,
            margin: 0,
            width: "30%",
            top: "40%",
            left: "35%",
            textAlign: "center",
            color: "#000",
            border: "3px solid #aaa",
            backgroundColor: "#fff",
            cursor: "wait"
        },
        overlayCSS: {
            backgroundColor: "#000",
            opacity: "0.6"
        },
        baseZ: 1000,
        centerX: true,
        centerY: true,
        allowBodyStretch: true,
        constrainTabKey: true,
        fadeOut: 400,
        focusInput: true,
        applyPlatformOpacityRules: true,
        onUnblock: null
    };
    var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
    var pageBlock = null;
    var pageBlockEls = [];
/*
    function install(el, opts) {
        var full = (el == window);
        var msg = opts && opts.message !== undefined ? opts.message : undefined;
        opts = $.extend({}, $.blockUI.defaults, opts || {});
        opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
        var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
        msg = msg === undefined ? opts.message : msg;
        if (full && pageBlock) {
            remove(window, {
                fadeOut: 0
            })
        }
        if (msg && typeof msg != "string" && (msg.parentNode || msg.jquery)) {
            var node = msg.jquery ? msg[0] : msg;
            var data = {};
            $(el).data("blockUI.history", data);
            data.el = node;
            data.parent = node.parentNode;
            data.display = node.style.display;
            data.position = node.style.position;
            data.parent.removeChild(node)
        }
        var z = opts.baseZ;
        var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:' + z+++';border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>') : $('<div class="blockUI" style="display:none"></div>');
        var lyr2 = $('<div class="blockUI" style="z-index:' + z+++';cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
        var lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:' + z + ';position:fixed"></div>') : $('<div class="blockUI blockMsg blockElement" style="z-index:' + z + ';display:none;position:absolute"></div>');
        if (msg) {
            lyr3.css(css)
        }
        if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) {
            lyr2.css(opts.overlayCSS)
        }
        lyr2.css("position", full ? "fixed" : "absolute");
        if ($.browser.msie) {
            lyr1.css("opacity", "0.0")
        }
        $([lyr1[0], lyr2[0], lyr3[0]]).appendTo(full ? "body" : el);
        var expr = $.browser.msie && (!$.boxModel || $("object,embed", full ? null : el).length > 0);
        if (ie6 || expr) {
            if (full && opts.allowBodyStretch && $.boxModel) {
                $("html,body").css("height", "100%")
            }
            if ((ie6 || !$.boxModel) && !full) {
                var t = sz(el, "borderTopWidth"),
                    l = sz(el, "borderLeftWidth");
                var fixT = t ? "(0 - " + t + ")" : 0;
                var fixL = l ? "(0 - " + l + ")" : 0
            }
            $.each([lyr1, lyr2, lyr3], function (i, o) {
                var s = o[0].style;
                s.position = "absolute";
                if (i < 2) {
                    full ? s.setExpression("height", 'document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"') : s.setExpression("height", 'this.parentNode.offsetHeight + "px"');
                    full ? s.setExpression("width", 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : s.setExpression("width", 'this.parentNode.offsetWidth + "px"');
                    if (fixL) {
                        s.setExpression("left", fixL)
                    }
                    if (fixT) {
                        s.setExpression("top", fixT)
                    }
                } else {
                    if (opts.centerY) {
                        if (full) {
                            s.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
                        }
                        s.marginTop = 0
                    }
                }
            })
        }
        lyr3.append(msg).show();
        if (msg && (msg.jquery || msg.nodeType)) {
            $(msg).show()
        }
        bind(1, el, opts);
        if (full) {
            pageBlock = lyr3[0];
            pageBlockEls = $(":input:enabled:visible", pageBlock);
            if (opts.focusInput) {
                setTimeout(focus, 20)
            }
        } else {
            center(lyr3[0], opts.centerX, opts.centerY)
        }
    }
	*/
    function remove(el, opts) {
        var full = el == window;
        var data = $(el).data("blockUI.history");
        opts = $.extend({}, $.blockUI.defaults, opts || {});
        bind(0, el, opts);
        var els = full ? $("body").children().filter(".blockUI") : $(".blockUI", el);
        if (full) {
            pageBlock = pageBlockEls = null
        }
        if (opts.fadeOut) {
            els.fadeOut(opts.fadeOut);
            setTimeout(function () {
                reset(els, data, opts, el)
            }, opts.fadeOut)
        } else {
            reset(els, data, opts, el)
        }
    }
    function reset(els, data, opts, el) {
        els.each(function (i, o) {
            if (this.parentNode) {
                this.parentNode.removeChild(this)
            }
        });
        if (data && data.el) {
            data.el.style.display = data.display;
            data.el.style.position = data.position;
            data.parent.appendChild(data.el);
            $(data.el).removeData("blockUI.history")
        }
        if (typeof opts.onUnblock == "function") {
            opts.onUnblock(el, opts)
        }
    }
    function bind(b, el, opts) {
        var full = el == window,
            $el = $(el);
        if (!b && (full && !pageBlock || !full && !$el.data("blockUI.isBlocked"))) {
            return
        }
        if (!full) {
            $el.data("blockUI.isBlocked", b)
        }
        var events = "mousedown mouseup keydown keypress click";
        b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler)
    }
    function handler(e) {
        if (e.keyCode && e.keyCode == 9) {
            if (pageBlock && e.data.constrainTabKey) {
                var els = pageBlockEls;
                var fwd = !e.shiftKey && e.target == els[els.length - 1];
                var back = e.shiftKey && e.target == els[0];
                if (fwd || back) {
                    setTimeout(function () {
                        focus(back)
                    }, 10);
                    return false
                }
            }
        }
        if ($(e.target).parents("div.blockMsg").length > 0) {
            return true
        }
        return $(e.target).parents().children().filter("div.blockUI").length == 0
    }
    function focus(back) {
        if (!pageBlockEls) {
            return
        }
        var e = pageBlockEls[back === true ? pageBlockEls.length - 1 : 0];
        if (e) {
            e.focus()
        }
    }
    function center(el, x, y) {
        var p = el.parentNode,
            s = el.style;
        var l = ((p.offsetWidth - el.offsetWidth) / 2) - sz(p, "borderLeftWidth");
        var t = ((p.offsetHeight - el.offsetHeight) / 2) - sz(p, "borderTopWidth");
        if (x) {
            s.left = l > 0 ? (l + "px") : "0"
        }
        if (y) {
            s.top = t > 0 ? (t + "px") : "0"
        }
    }
    function sz(el, p) {
        return parseInt($.css(el, p)) || 0
    }
})(jQuery);

function c_addEvent(d, c, a) {
    if (d.addEventListener) {
        d.addEventListener(c, a, false);
        return true
    } else {
        if (d.attachEvent) {
            var b = d.attachEvent("on" + c, a);
            return b
        } else {
            return false
        }
    }
}
function c_getViewportHeight() {
    if (window.innerHeight != window.undefined) {
        return window.innerHeight
    }
    if (document.compatMode == "CSS1Compat") {
        return document.documentElement.clientHeight
    }
    if (document.body) {
        return document.body.clientHeight
    }
    return window.undefined
}
function c_getViewportWidth() {
    var b = 17;
    var a = null;
    if (window.innerWidth != window.undefined) {
        return window.innerWidth
    }
    if (document.compatMode == "CSS1Compat") {
        return document.documentElement.clientWidth
    }
    if (document.body) {
        return document.body.clientWidth
    }
}
function c_getScrollTop() {
    if (self.pageYOffset) {
        return self.pageYOffset
    } else {
        if (document.documentElement && document.documentElement.scrollTop) {
            return document.documentElement.scrollTop
        } else {
            if (document.body) {
                return document.body.scrollTop
            }
        }
    }
}
var gPopupMask = null;
var gPopupContainer = null;
var gPopFrame = null;
var gReturnFunc;
var gPopupIsShown = false;
var gDefaultPage = "loading.html";
var gHideSelects = false;
var gReturnVal = null;
var gTabIndexes = new Array();
var gTabbableTags = new Array("A", "BUTTON", "TEXTAREA", "INPUT", "IFRAME");
if (!document.all) {
    document.onkeypress = keyDownHandler
}

function setMaskSize() {
    var b = document.getElementsByTagName("BODY")[0];
    var a = c_getViewportHeight();
    var c = c_getViewportWidth();
    if (a > b.scrollHeight) {
        popHeight = a
    } else {
        popHeight = b.scrollHeight
    }
    if (c > b.scrollWidth) {
        popWidth = c
    } else {
        popWidth = b.scrollWidth
    }
    if (document.body.className == "jump") {
        gPopupMask.style.height = "417px";
        gPopupMask.style.width = "183px"
    }
    if (document.body.className == "miniReservation") {
        gPopupMask.style.height = "150px";
        gPopupMask.style.width = "150px"
    } else {
        gPopupMask.style.height = popHeight + "px";
        gPopupMask.style.width = popWidth + "px"
    }
}
function keyDownHandler(a) {
    if (gPopupIsShown && a.keyCode == 9) {
        return false
    }
}
function disableTabIndexes() {
    if (document.all) {
        var c = 0;
        for (var b = 0; b < gTabbableTags.length; b++) {
            var d = document.getElementsByTagName(gTabbableTags[b]);
            for (var a = 0; a < d.length; a++) {
                gTabIndexes[c] = d[a].tabIndex;
                d[a].tabIndex = "-1";
                c++
            }
        }
    }
}
function restoreTabIndexes() {
    if (document.all) {
        var c = 0;
        for (var b = 0; b < gTabbableTags.length; b++) {
            var d = document.getElementsByTagName(gTabbableTags[b]);
            for (var a = 0; a < d.length; a++) {
                d[a].tabIndex = gTabIndexes[c];
                d[a].tabEnabled = true;
                c++
            }
        }
    }
}
function hideSelectBoxes() {
    for (var a = 0; a < document.forms.length; a++) {
        for (var b = 0; b < document.forms[a].length; b++) {
            if (document.forms[a].elements[b].tagName == "SELECT") {
                document.forms[a].elements[b].style.visibility = "hidden"
            }
        }
    }
}
function displaySelectBoxes() {
    for (var a = 0; a < document.forms.length; a++) {
        for (var b = 0; b < document.forms[a].length; b++) {
            if (document.forms[a].elements[b].tagName == "SELECT") {
                document.forms[a].elements[b].style.visibility = "visible"
            }
        }
    }
}

function getCookie(c) {
    var d = document.cookie;
    var e = d.indexOf(c + "=");
    if (e == -1) {
        return null
    }
    var a = e + c.length + 1;
    var b = d.indexOf(";", a);
    if (b == -1) {
        b = d.length
    }
    return unescape(d.substring(a, b))
}
function setCookie(a, b, c) {
    cookiestring = a + "=" + escape(b) + ";PATH=/;EXPIRES=" + getexpirydate(c);
    document.cookie = cookiestring;
    return true
}

function putGookie(a) {
    document.cookie = gookie_name + "=" + a + ";path=/;"
}
function getGookievalue() {
    if (document.cookie) {
        index = document.cookie.indexOf(gookie_name);
        if (index != -1) {
            namestart = (document.cookie.indexOf("=", index) + 1);
            nameend = document.cookie.indexOf(";", index);
            if (nameend == -1) {
                nameend = document.cookie.length
            }
            YouWrote = document.cookie.substring(namestart, nameend);
            return YouWrote
        }
    }
}
var iframeids = ["toolboxSelectedTool"];
var iframehide = "no";
var uniquePageName = "";
var getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
var FFextraHeight = parseFloat(getFFVersion) >= 0.1 ? 20 : 5;
var ie6extraHeight = 60;

function resizeCaller() {
    var a = new Array();
    for (i = 0; i < iframeids.length; i++) {
        if (document.getElementById) {
            if (document.getElementById(iframeids[i])) {
                resizeIframe(iframeids[i])
            }
        }
        if ((document.all || document.getElementById) && iframehide == "no") {
            if (document.getElementById(iframeids[i])) {
                var b = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i]);
                b.style.display = "block"
            }
        }
    }
}
function resizeIframe(c) {
    var a = document.getElementById(c);
    ie6extraHeight = 60;
    var d = 0;
    var b = 0;
    if (typeof(currentToolId) !== "undefined") {
        if (uniquePageName.indexOf("Ajax_FL") > -1) {
            d = 65;
            ie6extraHeight = 80
        }
        if (uniquePageName.indexOf("HotelsAndCars") > -1) {
            d = 40;
            ie6extraHeight = 120
        }
        if (uniquePageName.indexOf("CarTrawler") > -1) {
            ie6extraHeight = 85
        }
        if (uniquePageName.indexOf("FlightStatus") > -1) {
            ie6extraHeight = 145
        }
    }
    if (a && !window.opera) {
        a.style.display = "block";
        if (a.contentDocument && a.contentDocument.body && a.contentDocument.body.offsetHeight) {
            a.height = a.contentDocument.body.offsetHeight + FFextraHeight + d + b
        } else {
            if (a.Document && a.Document.body && a.Document.body.scrollHeight) {
                a.height = a.Document.body.scrollHeight + ie6extraHeight + b
            }
        }
        if (a.addEventListener) {
            a.addEventListener("load", readjustIframe, false)
        } else {
            if (a.attachEvent) {
                a.detachEvent("onload", readjustIframe);
                a.attachEvent("onload", readjustIframe)
            }
        }
    }
}
function readjustIframe(b) {
    var a = (window.event) ? event : b;
    var c = (a.currentTarget) ? a.currentTarget : a.srcElement;
    if (c) {
        resizeIframe(c.id)
    }
}
function loadintoIframe(b, a) {
    if (document.getElementById) {
        document.getElementById(b).src = a
    }
}
if (window.addEventListener) {
    window.addEventListener("load", resizeCaller, false)
} else {
    if (window.attachEvent) {
        window.attachEvent("onload", resizeCaller)
    } else {
        window.onload = resizeCaller
    }
}
if (DWREngine == null) {
    var DWREngine = {}
}
DWREngine.setErrorHandler = function (a) {
    DWREngine._errorHandler = a
};
DWREngine.setWarningHandler = function (a) {
    DWREngine._warningHandler = a
};
DWREngine.setTimeout = function (a) {
    DWREngine._timeout = a
};
DWREngine.setPreHook = function (a) {
    DWREngine._preHook = a
};
DWREngine.setPostHook = function (a) {
    DWREngine._postHook = a
};
DWREngine.XMLHttpRequest = 1;
DWREngine.IFrame = 2;
DWREngine.setMethod = function (a) {
    if (a != DWREngine.XMLHttpRequest && a != DWREngine.IFrame) {
        DWREngine._handleError("Remoting method must be one of DWREngine.XMLHttpRequest or DWREngine.IFrame");
        return
    }
    DWREngine._method = a
};
DWREngine.setVerb = function (a) {
    if (a != "GET" && a != "POST") {
        DWREngine._handleError("Remoting verb must be one of GET or POST");
        return
    }
    DWREngine._verb = a
};
DWREngine.setOrdered = function (a) {
    DWREngine._ordered = a
};
DWREngine.setAsync = function (a) {
    DWREngine._async = a
};
DWREngine.setTextHtmlHandler = function (a) {
    DWREngine._textHtmlHandler = a
};
DWREngine.defaultMessageHandler = function (a) {
    if (typeof a == "object" && a.name == "Error" && a.description) {
        alert("Error: " + a.description)
    } else {
        if (a.toString().indexOf("0x80040111") == -1) {
            alert(a)
        }
    }
};
DWREngine.beginBatch = function () {
    if (DWREngine._batch) {
        DWREngine._handleError("Batch already started.");
        return
    }
    DWREngine._batch = {
        map: {
            callCount: 0
        },
        paramCount: 0,
        ids: [],
        preHooks: [],
        postHooks: []
    }
};
DWREngine.endBatch = function (b) {
    var a = DWREngine._batch;
    if (a == null) {
        DWREngine._handleError("No batch in progress.");
        return
    }
    if (b && b.preHook) {
        a.preHooks.unshift(b.preHook)
    }
    if (b && b.postHook) {
        a.postHooks.push(b.postHook)
    }
    if (DWREngine._preHook) {
        a.preHooks.unshift(DWREngine._preHook)
    }
    if (DWREngine._postHook) {
        a.postHooks.push(DWREngine._postHook)
    }
    if (a.method == null) {
        a.method = DWREngine._method
    }
    if (a.verb == null) {
        a.verb = DWREngine._verb
    }
    if (a.async == null) {
        a.async = DWREngine._async
    }
    if (a.timeout == null) {
        a.timeout = DWREngine._timeout
    }
    a.completed = false;
    DWREngine._batch = null;
    if (!DWREngine._ordered) {
        DWREngine._sendData(a);
        DWREngine._batches[DWREngine._batches.length] = a
    } else {
        if (DWREngine._batches.length == 0) {
            DWREngine._sendData(a);
            DWREngine._batches[DWREngine._batches.length] = a
        } else {
            DWREngine._batchQueue[DWREngine._batchQueue.length] = a
        }
    }
};
DWREngine._errorHandler = DWREngine.defaultMessageHandler;
DWREngine._warningHandler = null;
DWREngine._preHook = null;
DWREngine._postHook = null;
DWREngine._batches = [];
DWREngine._batchQueue = [];
DWREngine._handlersMap = {};
DWREngine._method = DWREngine.XMLHttpRequest;
DWREngine._verb = "POST";
DWREngine._ordered = false;
DWREngine._async = true;
DWREngine._batch = null;
DWREngine._timeout = 0;
DWREngine._DOMDocument = ["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"];
DWREngine._XMLHTTP = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
DWREngine._execute = function (o, d, m, l) {
    var h = false;
    if (DWREngine._batch == null) {
        DWREngine.beginBatch();
        h = true
    }
    var k = [];
    for (var g = 0; g < arguments.length - 3; g++) {
        k[g] = arguments[g + 3]
    }
    if (DWREngine._batch.path == null) {
        DWREngine._batch.path = o
    } else {
        if (DWREngine._batch.path != o) {
            DWREngine._handleError("Can't batch requests to multiple DWR Servlets.");
            return
        }
    }
    var f;
    var c;
    var e = k[0];
    var n = k[k.length - 1];
    if (typeof e == "function") {
        c = {
            callback: k.shift()
        };
        f = k
    } else {
        if (typeof n == "function") {
            c = {
                callback: k.pop()
            };
            f = k
        } else {
            if (n != null && typeof n == "object" && n.callback != null && typeof n.callback == "function") {
                c = k.pop();
                f = k
            } else {
                if (e == null) {
                    if (n == null && k.length > 2) {
                        DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?")
                    }
                    c = {
                        callback: k.shift()
                    };
                    f = k
                } else {
                    if (n == null) {
                        c = {
                            callback: k.pop()
                        };
                        f = k
                    } else {
                        DWREngine._handleError("Missing callback function or metadata object.");
                        return
                    }
                }
            }
        }
    }
    var b = Math.floor(Math.random() * 10001);
    var a = (b + "_" + new Date().getTime()).toString();
    var j = "c" + DWREngine._batch.map.callCount + "-";
    DWREngine._batch.ids.push(a);
    if (c.method != null) {
        DWREngine._batch.method = c.method;
        delete c.method
    }
    if (c.verb != null) {
        DWREngine._batch.verb = c.verb;
        delete c.verb
    }
    if (c.async != null) {
        DWREngine._batch.async = c.async;
        delete c.async
    }
    if (c.timeout != null) {
        DWREngine._batch.timeout = c.timeout;
        delete c.timeout
    }
    if (c.preHook != null) {
        DWREngine._batch.preHooks.unshift(c.preHook);
        delete c.preHook
    }
    if (c.postHook != null) {
        DWREngine._batch.postHooks.push(c.postHook);
        delete c.postHook
    }
    if (c.errorHandler == null) {
        c.errorHandler = DWREngine._errorHandler
    }
    if (c.warningHandler == null) {
        c.warningHandler = DWREngine._warningHandler
    }
    DWREngine._handlersMap[a] = c;
    DWREngine._batch.map[j + "scriptName"] = d;
    DWREngine._batch.map[j + "methodName"] = m;
    DWREngine._batch.map[j + "id"] = a;
    for (g = 0; g < f.length; g++) {
        DWREngine._serializeAll(DWREngine._batch, [], f[g], j + "param" + g)
    }
    DWREngine._batch.map.callCount++;
    if (h) {
        DWREngine.endBatch()
    }
};
DWREngine._sendData = function (e) {
    if (e.map.callCount == 0) {
        return
    }
    for (var d = 0; d < e.preHooks.length; d++) {
        e.preHooks[d]()
    }
    e.preHooks = null;
    if (e.timeout && e.timeout != 0) {
        e.interval = setInterval(function () {
            DWREngine._abortRequest(e)
        }, e.timeout)
    }
    var g;
    if (e.map.callCount == 1) {
        g = e.map["c0-scriptName"] + "." + e.map["c0-methodName"] + ".dwr"
    } else {
        g = "Multiple." + e.map.callCount + ".dwr"
    }
    if (e.method == DWREngine.XMLHttpRequest) {
        if (window.XMLHttpRequest) {
            e.req = new XMLHttpRequest()
        } else {
            if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) {
                e.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP)
            }
        }
    }
    var k = "";
    var a;
    if (e.req) {
        e.map.xml = "true";
        if (e.async) {
            e.req.onreadystatechange = function () {
                DWREngine._stateChange(e)
            }
        }
        var b = navigator.userAgent.indexOf("Safari/");
        if (b >= 0) {
            var h = navigator.userAgent.substring(b + 7);
            if (parseInt(h, 10) < 400) {
                e.verb == "GET"
            }
        }
        if (e.verb == "GET") {
            e.map.callCount = "" + e.map.callCount;
            for (a in e.map) {
                var c = encodeURIComponent(a);
                var l = encodeURIComponent(e.map[a]);
                if (l == "") {
                    DWREngine._handleError("Found empty qval for qkey=" + c)
                }
                k += c + "=" + l + "&"
            }
            try {
                e.req.open("GET", e.path + "/exec/" + g + "?" + k, e.async);
                e.req.send(null);
                if (!e.async) {
                    DWREngine._stateChange(e)
                }
            } catch (j) {
                DWREngine._handleMetaDataError(null, j)
            }
        } else {
            for (a in e.map) {
                if (typeof e.map[a] != "function") {
                    k += a + "=" + e.map[a] + "\n"
                }
            }
            try {
                e.req.open("POST", e.path + "/exec/" + g, e.async);
                e.req.setRequestHeader("Content-Type", "text/plain");
                e.req.send(k);
                if (!e.async) {
                    DWREngine._stateChange(e)
                }
            } catch (j) {
                DWREngine._handleMetaDataError(null, j)
            }
        }
    } else {
        e.map.xml = "false";
        var f = "dwr-if-" + e.map["c0-id"];
        e.div = document.createElement("div");
        e.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + f + "' name='" + f + "'></iframe>";
        document.body.appendChild(e.div);
        e.iframe = document.getElementById(f);
        e.iframe.setAttribute("style", "width:0px; height:0px; border:0px;");
        if (e.verb == "GET") {
            for (a in e.map) {
                if (typeof e.map[a] != "function") {
                    k += encodeURIComponent(a) + "=" + encodeURIComponent(e.map[a]) + "&"
                }
            }
            k = k.substring(0, k.length - 1);
            e.iframe.setAttribute("src", e.path + "/exec/" + g + "?" + k);
            document.body.appendChild(e.iframe)
        } else {
            e.form = document.createElement("form");
            e.form.setAttribute("id", "dwr-form");
            e.form.setAttribute("action", e.path + "/exec" + g);
            e.form.setAttribute("target", f);
            e.form.target = f;
            e.form.setAttribute("method", "POST");
            for (a in e.map) {
                var m = document.createElement("input");
                m.setAttribute("type", "hidden");
                m.setAttribute("name", a);
                m.setAttribute("value", e.map[a]);
                e.form.appendChild(m)
            }
            document.body.appendChild(e.form);
            e.form.submit()
        }
    }
};
DWREngine._stateChange = function (batch) {
    if (!batch.completed && batch.req.readyState == 4) {
        try {
            var reply = batch.req.responseText;
            if (reply == null || reply == "") {
                DWREngine._handleMetaDataWarning(null, "No data received from server")
            } else {
                var contentType = batch.req.getResponseHeader("Content-Type");
                if (!contentType.match(/^text\/plain/) && !contentType.match(/^text\/javascript/)) {
                    if (DWREngine._textHtmlHandler && contentType.match(/^text\/html/)) {
                        DWREngine._textHtmlHandler()
                    } else {
                        DWREngine._handleMetaDataWarning(null, "Invalid content type from server: '" + contentType + "'")
                    }
                } else {
                    if (reply.search("DWREngine._handle") == -1) {
                        DWREngine._handleMetaDataWarning(null, "Invalid reply from server")
                    } else {
                        eval(reply)
                    }
                }
            }
            DWREngine._clearUp(batch)
        } catch (ex) {
            if (ex == null) {
                ex = "Unknown error occured"
            }
            DWREngine._handleMetaDataWarning(null, ex)
        } finally {
            if (DWREngine._batchQueue.length != 0) {
                var sendbatch = DWREngine._batchQueue.shift();
                DWREngine._sendData(sendbatch);
                DWREngine._batches[DWREngine._batches.length] = sendbatch
            }
        }
    }
};
DWREngine._handleResponse = function (e, d) {
    var a = DWREngine._handlersMap[e];
    DWREngine._handlersMap[e] = null;
    if (a) {
        try {
            if (a.callback) {
                a.callback(d)
            }
        } catch (c) {
            DWREngine._handleMetaDataError(a, c)
        }
    }
    if (DWREngine._method == DWREngine.IFrame) {
        var b = DWREngine._batches[DWREngine._batches.length - 1];
        if (b.map["c" + (b.map.callCount - 1) + "-id"] == e) {
            DWREngine._clearUp(b)
        }
    }
};
DWREngine._handleServerError = function (c, b) {
    var a = DWREngine._handlersMap[c];
    DWREngine._handlersMap[c] = null;
    if (b.message) {
        DWREngine._handleMetaDataError(a, b.message, b)
    } else {
        DWREngine._handleMetaDataError(a, b)
    }
};
DWREngine._eval = function (script) {
    return eval(script)
};
DWREngine._abortRequest = function (b) {
    if (b && !b.completed) {
        clearInterval(b.interval);
        DWREngine._clearUp(b);
        if (b.req) {
            b.req.abort()
        }
        var a;
        for (var c = 0; c < b.ids.length; c++) {
            a = DWREngine._handlersMap[b.ids[c]];
            DWREngine._handleMetaDataError(a, "Timeout")
        }
    }
};
DWREngine._clearUp = function (a) {
    if (a.completed) {
        DWREngine._handleError("Double complete");
        return
    }
    if (a.div) {
        a.div.parentNode.removeChild(a.div)
    }
    if (a.iframe) {
        a.iframe.parentNode.removeChild(a.iframe)
    }
    if (a.form) {
        a.form.parentNode.removeChild(a.form)
    }
    if (a.req) {
        delete a.req
    }
    for (var b = 0; b < a.postHooks.length; b++) {
        a.postHooks[b]()
    }
    a.postHooks = null;
    for (var b = 0; b < DWREngine._batches.length; b++) {
        if (DWREngine._batches[b] == a) {
            DWREngine._batches.splice(b, 1);
            break
        }
    }
    a.completed = true
};
DWREngine._handleError = function (b, a) {
    if (DWREngine._errorHandler) {
        DWREngine._errorHandler(b, a)
    }
};
DWREngine._handleWarning = function (b, a) {
    if (DWREngine._warningHandler) {
        DWREngine._warningHandler(b, a)
    }
};
DWREngine._handleMetaDataError = function (a, c, b) {
    if (a && typeof a.errorHandler == "function") {
        a.errorHandler(c, b)
    } else {
        DWREngine._handleError(c, b)
    }
};
DWREngine._handleMetaDataWarning = function (a, c, b) {
    if (a && typeof a.warningHandler == "function") {
        a.warningHandler(c, b)
    } else {
        DWREngine._handleWarning(c, b)
    }
};
DWREngine._serializeAll = function (b, d, c, a) {
    if (c == null) {
        b.map[a] = "null:null";
        return
    }
    switch (typeof c) {
    case "boolean":
        b.map[a] = "boolean:" + c;
        break;
    case "number":
        b.map[a] = "number:" + c;
        break;
    case "string":
        b.map[a] = "string:" + encodeURIComponent(c);
        break;
    case "object":
        if (c instanceof String) {
            b.map[a] = "String:" + encodeURIComponent(c)
        } else {
            if (c instanceof Boolean) {
                b.map[a] = "Boolean:" + c
            } else {
                if (c instanceof Number) {
                    b.map[a] = "Number:" + c
                } else {
                    if (c instanceof Date) {
                        b.map[a] = "Date:" + c.getTime()
                    } else {
                        if (c instanceof Array) {
                            b.map[a] = DWREngine._serializeArray(b, d, c, a)
                        } else {
                            b.map[a] = DWREngine._serializeObject(b, d, c, a)
                        }
                    }
                }
            }
        }
        break;
    case "function":
        break;
    default:
        DWREngine._handleWarning("Unexpected type: " + typeof c + ", attempting default converter.");
        b.map[a] = "default:" + c;
        break
    }
};
DWREngine._lookup = function (e, c, a) {
    var d;
    for (var b = 0; b < e.length; b++) {
        if (e[b].data == c) {
            d = e[b];
            break
        }
    }
    if (d) {
        return "reference:" + d.name
    }
    e.push({
        data: c,
        name: a
    });
    return null
};
DWREngine._serializeObject = function (c, h, g, b) {
    var f = DWREngine._lookup(h, g, b);
    if (f) {
        return f
    }
    if (g.nodeName && g.nodeType) {
        return DWREngine._serializeXml(c, h, g, b)
    }
    var e = "Object:{";
    var d;
    for (d in g) {
        c.paramCount++;
        var a = "c" + DWREngine._batch.map.callCount + "-e" + c.paramCount;
        DWREngine._serializeAll(c, h, g[d], a);
        e += encodeURIComponent(d) + ":reference:" + a + ", "
    }
    if (e.substring(e.length - 2) == ", ") {
        e = e.substring(0, e.length - 2)
    }
    e += "}";
    return e
};
DWREngine._serializeXml = function (c, f, e, b) {
    var d = DWREngine._lookup(f, e, b);
    if (d) {
        return d
    }
    var a;
    if (window.XMLSerializer) {
        a = new XMLSerializer().serializeToString(e)
    } else {
        a = e.toXml
    }
    return "XML:" + encodeURIComponent(a)
};
DWREngine._serializeArray = function (c, h, g, b) {
    var f = DWREngine._lookup(h, g, b);
    if (f) {
        return f
    }
    var e = "Array:[";
    for (var d = 0; d < g.length; d++) {
        if (d != 0) {
            e += ","
        }
        c.paramCount++;
        var a = "c" + DWREngine._batch.map.callCount + "-e" + c.paramCount;
        DWREngine._serializeAll(c, h, g[d], a);
        e += "reference:";
        e += a
    }
    e += "]";
    return e
};
DWREngine._unserializeDocument = function (a) {
    var c;
    if (window.DOMParser) {
        var e = new DOMParser();
        c = e.parseFromString(a, "text/xml");
        if (!c.documentElement || c.documentElement.tagName == "parsererror") {
            var b = c.documentElement.firstChild.data;
            b += "\n" + c.documentElement.firstChild.nextSibling.firstChild.data;
            throw b
        }
        return c
    } else {
        if (window.ActiveXObject) {
            c = DWREngine._newActiveXObject(DWREngine._DOMDocument);
            c.loadXML(a);
            return c
        } else {
            var d = document.createElement("div");
            d.innerHTML = a;
            return d
        }
    }
};
DWREngine._newActiveXObject = function (a) {
    var d;
    for (var c = 0; c < a.length; c++) {
        try {
            d = new ActiveXObject(a[c]);
            break
        } catch (b) {}
    }
    return d
};
if (typeof window.encodeURIComponent === "undefined") {
    DWREngine._utf8 = function (b) {
        b = "" + b;
        var f;
        var e;
        var a = "";
        var d = 0;
        while (d < b.length) {
            f = b.charCodeAt(d++);
            if (f >= 56320 && f < 57344) {
                continue
            }
            if (f >= 55296 && f < 56320) {
                if (d >= b.length) {
                    continue
                }
                e = b.charCodeAt(d++);
                if (e < 56320 || f >= 56832) {
                    continue
                }
                f = ((f - 55296) << 10) + (e - 56320) + 65536
            }
            if (f < 128) {
                a += String.fromCharCode(f)
            } else {
                if (f < 2048) {
                    a += String.fromCharCode(192 + (f >> 6), 128 + (f & 63))
                } else {
                    if (f < 65536) {
                        a += String.fromCharCode(224 + (f >> 12), 128 + (f >> 6 & 63), 128 + (f & 63))
                    } else {
                        a += String.fromCharCode(240 + (f >> 18), 128 + (f >> 12 & 63), 128 + (f >> 6 & 63), 128 + (f & 63))
                    }
                }
            }
        }
        return a
    };
    DWREngine._hexchars = "0123456789ABCDEF";
    DWREngine._toHex = function (a) {
        return DWREngine._hexchars.charAt(a >> 4) + DWREngine._hexchars.charAt(a & 15)
    };
    DWREngine._okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
    window.encodeURIComponent = function (d) {
        d = DWREngine._utf8(d);
        var e;
        var a = "";
        for (var b = 0; b < d.length; b++) {
            if (DWREngine._okURIchars.indexOf(d.charAt(b)) == -1) {
                a += "%" + DWREngine._toHex(d.charCodeAt(b))
            } else {
                a += d.charAt(b)
            }
        }
        return a
    }
}
if (typeof Array.prototype.splice === "undefined") {
    Array.prototype.splice = function (c, b) {
        if (arguments.length == 0) {
            return c
        }
        if (typeof c != "number") {
            c = 0
        }
        if (c < 0) {
            c = Math.max(0, this.length + c)
        }
        if (c > this.length) {
            if (arguments.length > 2) {
                c = this.length
            } else {
                return []
            }
        }
        if (arguments.length < 2) {
            b = this.length - c
        }
        b = (typeof b == "number") ? Math.max(0, b) : 0;
        removeArray = this.slice(c, c + b);
        endArray = this.slice(c + b);
        this.length = c;
        for (var a = 2; a < arguments.length; a++) {
            this[this.length] = arguments[a]
        }
        for (a = 0; a < endArray.length; a++) {
            this[this.length] = endArray[a]
        }
        return removeArray
    }
}
if (typeof Array.prototype.shift === "undefined") {
    Array.prototype.shift = function (c) {
        var b = this[0];
        for (var a = 1; a < this.length; ++a) {
            this[a - 1] = this[a]
        }
        this.length--;
        return b
    }
}
if (typeof Array.prototype.unshift === "undefined") {
    Array.prototype.unshift = function () {
        var b = unshift.arguments.length;
        for (var a = this.length - 1; a >= 0; --a) {
            this[a + b] = this[a]
        }
        for (a = 0; a < b; ++a) {
            this[a] = unshift.arguments[a]
        }
    }
}
if (typeof Array.prototype.push === "undefined") {
    Array.prototype.push = function () {
        var b = this.length;
        for (var a = 0; a < push.arguments.length; ++a) {
            this[b] = push.arguments[a];
            b++
        }
    }
}
if (typeof Array.prototype.pop === "undefined") {
    Array.prototype.pop = function () {
        var a = this[this.length - 1];
        this.length--;
        return a
    }
}(function (a) {
    a.fn.extend({
        autocomplete: function (b, c) {
            var d = typeof b == "string";
            c = a.extend({}, a.Autocompleter.defaults, {
                url: d ? b : null,
                data: d ? null : b,
                delay: d ? a.Autocompleter.defaults.delay : 10,
                max: c && !c.scroll ? 10 : 150
            }, c);
            c.highlight = c.highlight ||
            function (e) {
                return e
            };
            c.formatMatch = c.formatMatch || c.formatItem;
            return this.each(function () {
                new a.Autocompleter(this, c)
            })
        },
        result: function (b) {
            return this.bind("result", b)
        },
        search: function (b) {
            return this.trigger("search", [b])
        },
        flushCache: function () {
            return this.trigger("flushCache")
        },
        setOptions: function (b) {
            return this.trigger("setOptions", [b])
        },
        unautocomplete: function () {
            return this.trigger("unautocomplete")
        }
    });
    a.Autocompleter = function (m, g) {
        var c = {
            UP: 38,
            DOWN: 40,
            DEL: 46,
            TAB: 9,
            RETURN: 13,
            ESC: 27,
            COMMA: 188,
            PAGEUP: 33,
            PAGEDOWN: 34,
            BACKSPACE: 8
        };
        var b = a(m).attr("autocomplete", "off").addClass(g.inputClass);
        var k;
        var q = "";
        var n = a.Autocompleter.Cache(g);
        var e = 0;
        var v;
        var y = {
            mouseDownOnSelect: false
        };
        var s = a.Autocompleter.Select(g, m, d, y);
        var x;
        a.browser.opera && a(m.form).bind("submit.autocomplete", function () {
            if (x) {
                x = false;
                return false
            }
        });
        b.bind((a.browser.opera ? "keypress" : "keydown") + ".autocomplete", function (z) {
            v = z.keyCode;
            switch (z.keyCode) {
            case c.UP:
                z.preventDefault();
                if (s.visible()) {
                    s.prev()
                } else {
                    u(0, true)
                }
                break;
            case c.DOWN:
                z.preventDefault();
                if (s.visible()) {
                    s.next()
                } else {
                    u(0, true)
                }
                break;
            case c.PAGEUP:
                z.preventDefault();
                if (s.visible()) {
                    s.pageUp()
                } else {
                    u(0, true)
                }
                break;
            case c.PAGEDOWN:
                z.preventDefault();
                if (s.visible()) {
                    s.pageDown()
                } else {
                    u(0, true)
                }
                break;
            case g.multiple && a.trim(g.multipleSeparator) == "," && c.COMMA:
            case c.TAB:
            case c.RETURN:
                if (d()) {
                    z.preventDefault();
                    x = true;
                    return false
                }
                break;
            case c.ESC:
                s.hide();
                break;
            default:
                clearTimeout(k);
                k = setTimeout(u, g.delay);
                break
            }
        }).focus(function () {
            e++;
            if (this.value == g.default_value) {
                this.value = ""
            }
        }).blur(function () {
            e = 0;
            if (!y.mouseDownOnSelect) {
                t()
            }
        }).click(function () {
            if (this.value == g.default_value) {
                this.value = ""
            } else {
                this.select()
            }
            if (e++ > 1 && !s.visible()) {
                u(0, true)
            }
        }).bind("search", function () {
            var z = (arguments.length > 1) ? arguments[1] : null;

            function A(E, D) {
                var B;
                if (D && D.length) {
                    for (var C = 0; C < D.length; C++) {
                        if (D[C].result.toLowerCase() == E.toLowerCase()) {
                            B = D[C];
                            break
                        }
                    }
                }
                if (typeof z == "function") {
                    z(B)
                } else {
                    b.trigger("result", B && [B.data, B.value])
                }
            }
            a.each(h(b.val()), function (B, C) {
                f(C, A, A)
            })
        }).bind("flushCache", function () {
            n.flush()
        }).bind("setOptions", function () {
            a.extend(g, arguments[1]);
            if ("data" in arguments[1]) {
                n.populate()
            }
        }).bind("unautocomplete", function () {
            s.unbind();
            b.unbind();
            a(m.form).unbind(".autocomplete")
        });

        function d() {
            var A = s.selected();
            if (!A) {
                return false
            }
            var z = A.result;
            q = z;
            if (g.multiple) {
                var B = h(b.val());
                if (B.length > 1) {
                    z = B.slice(0, B.length - 1).join(g.multipleSeparator) + g.multipleSeparator + z
                }
                z += g.multipleSeparator
            }
            b.val(z);
            w();
            b.trigger("result", [A.data, A.value]);
            onBlurTypeAheadField(g.selectorName, g.default_value, g.cityArray);
            return true
        }
        function u(B, A) {
            if (v == c.DEL) {
                s.hide();
                return
            }
            var z = b.val();
            if (!A && z == q) {
                return
            }
            q = z;
            z = j(z);
            if (z.length >= g.minChars) {
                b.addClass(g.loadingClass);
                if (!g.matchCase) {
                    z = z.toLowerCase()
                }
                f(z, l, w)
            } else {
                o();
                s.hide()
            }
        }
        function h(A) {
            if (!A) {
                return [""]
            }
            var B = A.split(g.multipleSeparator);
            var z = [];
            a.each(B, function (C, D) {
                if (a.trim(D)) {
                    z[C] = a.trim(D)
                }
            });
            return z
        }
        function j(z) {
            if (!g.multiple) {
                return z
            }
            var A = h(z);
            return A[A.length - 1]
        }
        function r(z, A) {
            if (g.autoFill && (j(b.val()).toLowerCase() == z.toLowerCase()) && v != c.BACKSPACE) {
                b.val(b.val() + A.substring(j(q).length));
                a.Autocompleter.Selection(m, q.length, q.length + A.length)
            }
        }
        function t() {
            clearTimeout(k);
            k = setTimeout(w, 200)
        }
        function w() {
            var z = s.visible();
            s.hide();
            clearTimeout(k);
            o();
            if (g.mustMatch) {
                b.search(function (A) {
                    if (!A) {
                        if (g.multiple) {
                            var B = h(b.val()).slice(0, -1);
                            b.val(B.join(g.multipleSeparator) + (B.length ? g.multipleSeparator : ""))
                        } else {
                            b.val("")
                        }
                    }
                })
            }
        }
        function l(A, z) {
            if (z && z.length && e) {
                o();
                s.display(z, A);
                r(A, z[0].value);
                s.show()
            } else {
                w()
            }
        }
        function f(A, C, z) {
            if (!g.matchCase) {
                A = A.toLowerCase()
            }
            var B = n.load(A);
            if (B && B.length) {
                C(A, B)
            } else {
                if ((typeof g.url == "string") && (g.url.length > 0)) {
                    var D = {
                        timestamp: +new Date()
                    };
                    a.each(g.extraParams, function (E, F) {
                        D[E] = typeof F == "function" ? F() : F
                    });
                    a.ajax({
                        mode: "abort",
                        port: "autocomplete" + m.name,
                        dataType: g.dataType,
                        url: g.url,
                        data: a.extend({
                            q: j(A),
                            limit: g.max
                        }, D),
                        success: function (F) {
                            var E = g.parse && g.parse(F) || p(F);
                            n.add(A, E);
                            C(A, E)
                        }
                    })
                } else {
                    s.emptyList();
                    z(A)
                }
            }
            //alert('aaa');
            qq2('#slickInfoDep').fadeOut('1');
            qq2('#slickInfoDepD').fadeOut('1');           // qq("#slickInfoDest2").fadeOut("1000");
            // qq("#slickInfo" + g.selectorName).fadeOut("1000")
        }
        function p(C) {
            var z = [];
            var B = C.split("\n");
            for (var A = 0; A < B.length; A++) {
                var D = a.trim(B[A]);
                if (D) {
                    D = D.split("|");
                    z[z.length] = {
                        data: D,
                        value: D[0],
                        result: g.formatResult && g.formatResult(D, D[0]) || D[0]
                    }
                }
            }
            return z
        }
        function o() {
            b.removeClass(g.loadingClass)
        }
    };
    a.Autocompleter.defaults = {
        inputClass: "ac_input",
        resultsClass: "ac_results",
        loadingClass: "ac_loading",
        minChars: 1,
        delay: 400,
        matchCase: false,
        matchSubset: true,
        matchContains: false,
        cacheLength: 10,
        max: 100,
        mustMatch: false,
        extraParams: {},
        selectFirst: true,
        formatItem: function (b) {
            return b[0]
        },
        formatMatch: null,
        autoFill: false,
        width: 0,
        multiple: false,
        multipleSeparator: ", ",
        highlight: function (c, b) {
            return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>")
        },
        scroll: true,
        scrollHeight: 280
    };
    a.Autocompleter.Cache = function (c) {
        var f = {};
        var d = 0;

        function h(k, j) {
            if (!c.matchCase) {
                k = k.toLowerCase()
            }
            if (!k.startsWith(j) && k.indexOf(" " + j) === -1 && k.indexOf("(" + j) === -1) {
                return false
            }
            return c.matchContains
        }
        function g(k, j) {
            if (d > c.cacheLength) {
                b()
            }
            if (!f[k]) {
                d++
            }
            f[k] = j
        }
        function e() {
            if (!c.data) {
                return false
            }
            var k = {},
                j = 0;
            if (!c.url) {
                c.cacheLength = 1
            }
            k[""] = [];
            for (var m = 0, l = c.data.length; m < l; m++) {
                var p = c.data[m];
                p = (typeof p == "string") ? [p] : p;
                var o = c.formatMatch(p, m + 1, c.data.length);
                if (o === false) {
                    continue
                }
                var n = o.charAt(0).toLowerCase();
                if (!k[n]) {
                    k[n] = []
                }
                var q = {
                    value: o,
                    data: p,
                    result: c.formatResult && c.formatResult(p) || o
                };
                k[n].push(q);
                if (j++ < c.max) {
                    k[""].push(q)
                }
            }
            a.each(k, function (r, s) {
                c.cacheLength++;
                g(r, s)
            })
        }
        setTimeout(e, 25);

        function b() {
            f = {};
            d = 0
        }
        return {
            flush: b,
            add: g,
            populate: e,
            load: function (n) {
                if (!c.cacheLength || !d) {
                    return null
                }
                if (!c.url && c.matchContains) {
                    var m = [];
                    for (var j in f) {
                        if (j.length > 0) {
                            var o = f[j];
                            a.each(o, function (p, k) {
                                if (h(k.value, n)) {
                                    m.push(k)
                                }
                            })
                        }
                    }
                    return m
                } else {
                    if (f[n]) {
                        return f[n]
                    } else {
                        if (c.matchSubset) {
                            for (var l = n.length - 1; l >= c.minChars; l--) {
                                var o = f[n.substr(0, l)];
                                if (o) {
                                    var m = [];
                                    a.each(o, function (p, k) {
                                        if (h(k.value, n)) {
                                            m[m.length] = k
                                        }
                                    });
                                    return m
                                }
                            }
                        }
                    }
                }
                return null
            }
        }
    };
    a.Autocompleter.Select = function (e, k, m, q) {
        var j = {
            ACTIVE: "ac_over"
        };
        var l, f = -1,
            s, n = "",
            t = true,
            c, p;

        function o() {
            if (!t) {
                return
            }
            c = a("<div/>").hide().addClass(e.resultsClass).css("position", "absolute").appendTo(document.body);
            p = a("<ul/>").appendTo(c).mouseover(function (u) {
                if (r(u).nodeName && r(u).nodeName.toUpperCase() == "LI") {
                    f = a("li", p).removeClass(j.ACTIVE).index(r(u));
                    a(r(u)).addClass(j.ACTIVE)
                }
            }).click(function (u) {
                a(r(u)).addClass(j.ACTIVE);
                m();
                k.focus();
                return false
            }).mousedown(function () {
                q.mouseDownOnSelect = true
            }).mouseup(function () {
                q.mouseDownOnSelect = false
            });
            if (e.width > 0) {
                c.css("width", e.width)
            }
            t = false
        }
        function r(v) {
            var u = v.target;
            while (u && u.tagName != "LI") {
                u = u.parentNode
            }
            if (!u) {
                return []
            }
            return u
        }
        function h(u) {
            l.slice(f, f + 1).removeClass(j.ACTIVE);
            g(u);
            var w = l.slice(f, f + 1).addClass(j.ACTIVE);
            if (e.scroll) {
                var v = 0;
                l.slice(0, f).each(function () {
                    v += this.offsetHeight
                });
                if ((v + w[0].offsetHeight - p.scrollTop()) > p[0].clientHeight) {
                    p.scrollTop(v + w[0].offsetHeight - p.innerHeight())
                } else {
                    if (v < p.scrollTop()) {
                        p.scrollTop(v)
                    }
                }
            }
        }
        function g(u) {
            f += u;
            if (f < 0) {
                f = l.size() - 1
            } else {
                if (f >= l.size()) {
                    f = 0
                }
            }
        }
        function b(u) {
            return e.max && e.max < u ? e.max : u
        }
        function d() {
            p.empty();
            var v = b(s.length);
            for (var w = 0; w < v; w++) {
                if (!s[w]) {
                    continue
                }
                var x = e.formatItem(s[w].data, w + 1, v, s[w].value, n);
                if (x === false) {
                    continue
                }
                var u = a("<li/>").html(e.highlight(x, n)).addClass(w % 2 == 0 ? "ac_even" : "ac_odd").appendTo(p)[0];
                a.data(u, "ac_data", s[w])
            }
            l = p.find("li");
            if (e.selectFirst) {
                l.slice(0, 1).addClass(j.ACTIVE);
                f = 0
            }
            if (a.fn.bgiframe) {
                p.bgiframe()
            }
        }
        return {
            display: function (v, u) {
                o();
                s = v;
                n = u;
                d()
            },
            next: function () {
                h(1)
            },
            prev: function () {
                h(-1)
            },
            pageUp: function () {
                if (f != 0 && f - 8 < 0) {
                    h(-f)
                } else {
                    h(-8)
                }
            },
            pageDown: function () {
                if (f != l.size() - 1 && f + 8 > l.size()) {
                    h(l.size() - 1 - f)
                } else {
                    h(8)
                }
            },
            hide: function () {
                c && c.hide();
                l && l.removeClass(j.ACTIVE);
                f = -1
            },
            visible: function () {
                return c && c.is(":visible")
            },
            current: function () {
                return this.visible() && (l.filter("." + j.ACTIVE)[0] || e.selectFirst && l[0])
            },
            show: function () {
                var w = a(k).offset();
                a(k).removeClass("fieldError");
                c.css({
                    width: typeof e.width == "string" || e.width > 0 ? e.width : a(k).width(),
                    top: w.top + k.offsetHeight,
                    left: w.left
                }).show();
                if (e.scroll) {
                    p.scrollTop(0);
                    p.css({
                        maxHeight: e.scrollHeight,
                        overflow: "auto"
                    });
                    if (a.browser.msie && typeof document.body.style.maxHeight === "undefined") {
                        var u = 0;
                        l.each(function () {
                            u += this.offsetHeight
                        });
                        var v = u > e.scrollHeight;
                        p.css("height", v ? e.scrollHeight : u);
                        if (!v) {
                            l.width(p.width() - parseInt(l.css("padding-left")) - parseInt(l.css("padding-right")))
                        }
                    }
                }
            },
            selected: function () {
                var u = l && l.filter("." + j.ACTIVE).removeClass(j.ACTIVE);
                return u && u.length && a.data(u[0], "ac_data")
            },
            emptyList: function () {
                p && p.empty()
            },
            unbind: function () {
                c && c.remove()
            }
        }
    };
    a.Autocompleter.Selection = function (d, e, c) {
        if (d.createTextRange) {
            var b = d.createTextRange();
            b.collapse(true);
            b.moveStart("character", e);
            b.moveEnd("character", c);
            b.select()
        } else {
            if (d.setSelectionRange) {
                d.setSelectionRange(e, c)
            } else {
                if (d.selectionStart) {
                    d.selectionStart = e;
                    d.selectionEnd = c
                }
            }
        }
        d.focus()
    }
})(jQuery);
/*
(function (a) {
    a.fn.bgIframe = a.fn.bgiframe = function (c) {
        if (a.browser.msie && /6.0/.test(navigator.userAgent)) {
            c = a.extend({
                top: "auto",
                left: "auto",
                width: "auto",
                height: "auto",
                opacity: true,
                src: "javascript:false;"
            }, c || {});
            var d = function (e) {
                return e && e.constructor == Number ? e + "px" : e
            },
                b = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + c.src + '"style="display:block;position:absolute;z-index:-1;' + (c.opacity !== false ? "filter:Alpha(Opacity='0');" : "") + "top:" + (c.top == "auto" ? "expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')" : d(c.top)) + ";left:" + (c.left == "auto" ? "expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')" : d(c.left)) + ";width:" + (c.width == "auto" ? "expression(this.parentNode.offsetWidth+'px')" : d(c.width)) + ";height:" + (c.height == "auto" ? "expression(this.parentNode.offsetHeight+'px')" : d(c.height)) + ';"/>';
            return this.each(function () {
                if (a("> iframe.bgiframe", this).length == 0) {
                    this.insertBefore(document.createElement(b), this.firstChild)
                }
            })
        }
        return this
    }
})(jQuery);*/
var isIframe = (parent.document.location != document.location) ? true : false;
json_parse = function () {
    var d, b, a = {
        '"': '"',
        "\\": "\\",
        "/": "/",
        b: "\b",
        f: "\f",
        n: "\n",
        r: "\r",
        t: "\t"
    },
        n, l = function (o) {
            throw {
                name: "SyntaxError",
                message: o,
                at: d,
                text: n
            }
        },
        g = function (o) {
            if (o && o !== b) {
                l("Expected '" + o + "' instead of '" + b + "'")
            }
            b = n.charAt(d);
            d += 1;
            return b
        },
        f = function () {
            var p, o = "";
            if (b === "-") {
                o = "-";
                g("-")
            }
            while (b >= "0" && b <= "9") {
                o += b;
                g()
            }
            if (b === ".") {
                o += ".";
                while (g() && b >= "0" && b <= "9") {
                    o += b
                }
            }
            if (b === "e" || b === "E") {
                o += b;
                g();
                if (b === "-" || b === "+") {
                    o += b;
                    g()
                }
                while (b >= "0" && b <= "9") {
                    o += b;
                    g()
                }
            }
            p = +o;
            if (isNaN(p)) {
                l("Bad number")
            } else {
                return p
            }
        },
        h = function () {
            var r, q, p = "",
                o;
            if (b === '"') {
                while (g()) {
                    if (b === '"') {
                        g();
                        return p
                    } else {
                        if (b === "\\") {
                            g();
                            if (b === "u") {
                                o = 0;
                                for (q = 0; q < 4; q += 1) {
                                    r = parseInt(g(), 16);
                                    if (!isFinite(r)) {
                                        break
                                    }
                                    o = o * 16 + r
                                }
                                p += String.fromCharCode(o)
                            } else {
                                if (typeof a[b] === "string") {
                                    p += a[b]
                                } else {
                                    break
                                }
                            }
                        } else {
                            p += b
                        }
                    }
                }
            }
            l("Bad string")
        },
        k = function () {
            while (b && b <= " ") {
                g()
            }
        },
        c = function () {
            switch (b) {
            case "t":
                g("t");
                g("r");
                g("u");
                g("e");
                return true;
            case "f":
                g("f");
                g("a");
                g("l");
                g("s");
                g("e");
                return false;
            case "n":
                g("n");
                g("u");
                g("l");
                g("l");
                return null
            }
            l("Unexpected '" + b + "'")
        },
        m, j = function () {
            var o = [];
            if (b === "[") {
                g("[");
                k();
                if (b === "]") {
                    g("]");
                    return o
                }
                while (b) {
                    o.push(m());
                    k();
                    if (b === "]") {
                        g("]");
                        return o
                    }
                    g(",");
                    k()
                }
            }
            l("Bad array")
        },
        e = function () {
            var p, o = {};
            if (b === "{") {
                g("{");
                k();
                if (b === "}") {
                    g("}");
                    return o
                }
                while (b) {
                    p = h();
                    k();
                    g(":");
                    if (Object.hasOwnProperty.call(o, p)) {
                        l('Duplicate key "' + p + '"')
                    }
                    o[p] = m();
                    k();
                    if (b === "}") {
                        g("}");
                        return o
                    }
                    g(",");
                    k()
                }
            }
            l("Bad object")
        };
    m = function () {
        k();
        switch (b) {
        case "{":
            return e();
        case "[":
            return j();
        case '"':
            return h();
        case "-":
            return f();
        default:
            return b >= "0" && b <= "9" ? f() : c()
        }
    };
    return function (q, p) {
        var o;
        n = q;
        d = 0;
        b = " ";
        o = m();
        k();
        if (b) {
            l("Syntax error")
        }
        return o
    }
}();
var GFX = "";
var countryUpper = "";

function setSelectedCity(a, b) {
    setVariable(a, "selected" + a, b)
}
function getSelectedCity(a) {
    return getVariable(a, "selected" + a)
}
function setPrevTypeahead(a, b) {
    setVariable(a, "prevTypeahead" + a, b)
}
function getPrevTypeahead(a) {
    return getVariable(a, "prevTypeahead" + a)
}
function setVariable(a, b, c) {
    jQuery("#ac" + a).attr(b, c)
}
function getVariable(a, b) {
    return jQuery("#ac" + a).attr(b)
}
var setTypeAheadcomplete = function (e, d, c, b, a) {
    if (c) {
        jQuery(e).unautocomplete()
    }
    jQuery(e).autocomplete(d, {
        matchContains: true,
        max: 1000,
        width: 260,
        selectorName: b,
        default_value: a,
        cityArray: d,
        formatItem: function (f) {
            return '<div title="' + f.cr + '" style="background:url(' + GFX + "/" + f.im + ') 0 0 no-repeat;"><span>' + f.t + " (" + f.c + "), " + f.lc + "</span></div>"
        },
        formatMatch: function (h, g, f) {
            return h.t + " (" + h.c + ")  " + h.lc + " " + h.e
        },
        formatResult: function (f) {
            return f.t + " (" + f.c + ")"
        },
        highlight: function (g, f) {
            return g.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)([( >]{1})(" + f.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1<strong>$2</strong>")
        }
    })
};
var onBlurTypeAheadField = function (a, d, c) {
    var b = findCityByCode(getCitycodeFromField(jQuery("#ac" + a).val()), c);
    if (b != null) {
        jQuery("#ac" + a).removeClass("fieldError");
        setSelectedCity(a, b.c);
        jQuery("#ac" + a).val(b.t + " (" + b.c + ")");
        if (getPrevTypeahead(a) != b) {
            setPrevTypeahead(a, b)
        }
    } else {
        setSelectedCity(a, "")
    }
    if (b == null && jQuery("#ac" + a).val() != d) {
        jQuery("#ac" + a).addClass("fieldError")
    }
};

function getDomain() {
    if ((countryUpper == "") || (countryUpper == "INT")) {
        countryUpper = "COM"
    }
    return countryUpper
}
var hideComplexTypeahead = function (a) {
    $("<%=selectorName%>").style.display = "none"
};
var showComplexTypeahead = function () {
    $("<%=selectorName%>").style.display = "block"
};
var findCityByCode = function (c, b) {
    for (var a = 0; a < b.length; a++) {
        if (b[a].c == c) {
            return b[a]
        }
    }
    return null
};
var getCitycodeFromField = function (a) {
    return a.substr(a.search(/\(\w+\)/) + 1, 3)
};
String.prototype.startsWith = function (a) {
    return this.indexOf(a) === 0
};

var getCitycodeFromField = function (a) {    //return a.substr(a.search(/\(\w+\)/) + 1, 3);};var getCitynameFromField = function (a) {    return a.substr(0, a.search(/\(\w+\)/) - 1);};var findCityByCode = function (b) {    for (var a = 0; a < cityArray.length; a++) {        if (cityArray[a].c == b) {            return cityArray[a];        }    }    return null;};var qq = jQuery.noConflict();
function dropDownBTIndex(c, b) {
     qq(c).autocomplete(b, {
        matchContains: true,
        max: 1000,
        width: 260,
        formatItem: function (d) {
            return '<div title="' + d.cr + '"><span>' + d.t + "</span></div>";
        },
        formatMatch: function (f, e, d) {
            return f.t + f.lc + " " + f.e;
        },
        formatResult: function (d) {
            return d.t;
        },
        highlight: function (e, d) {
            return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)([( >]{1})(" + d.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1<strong>$2</strong>");
        }
    });
};
function dropDownBT(c, b) {     qq(c).autocomplete(b, {        matchContains: true,        max: 1000,        width: 260,        formatItem: function (d) {            return '<div title="' + d.cr + '"><span>' + d.t + " (" + d.c + ") " + d.lc + "</span></div>";        },        formatMatch: function (f, e, d) {            return f.t + " (" + f.c + ")  " + f.lc + " " + f.e;        },        formatResult: function (d) {            return d.t + " (" + d.c + ")";        },        highlight: function (e, d) {            return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)([( >]{1})(" + d.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1<strong>$2</strong>");        }    });};var initialOnBlur = 0;var onBlurTypeheadField = function (b) {/*    alert('aaa');    routeFetchRequired = false;    var c = findCityByCode(getCitycodeFromField($("acdep").value));    if (c != null) {        jQuery("#acdep").removeClass("fieldError");        selectedDepCity = c.c;        $j("#acdep").val(c.t + " (" + c.c + ")");        if (prevTypeaheadDepCity != c && c.c != selectedDestCity) {            prevTypeaheadDepCity = c;            routeFetchRequired = true;        }    } else {        selectedDepCity = null;    }    if ($j("#dest2").is(":visible")) {        var a = findCityByCode(getCitycodeFromField($("acdest2").value));    } else {        var a = findCityByCode(getCitycodeFromField($("acdest").value));    }    if (a != null) {        jQuery("#acdest").removeClass("fieldError");        jQuery("#acdest2").removeClass("fieldError");        selectedDestCity = a.c;        $j("#acdest").val(a.t + " (" + a.c + ")");        $j("#acdest2").val(a.t + " (" + a.c + ")");        if (prevTypeaheadDestCity != a && a.c != selectedDepCity) {            prevTypeaheadDestCity = a;            routeFetchRequired = true;        }    } else {        selectedDestCity = null;    }    if (c == null && initialOnBlur > 0 && jQuery("#acdep").val() != acdep_default) {        jQuery("#acdep").addClass("fieldError");    }    if (a == null && initialOnBlur > 0 && jQuery("#acdest").val() != acdest_default) {        jQuery("#acdest").addClass("fieldError");    }    if (a == null && initialOnBlur > 0 && jQuery("#acdest2").val() != acdest2_default) {        jQuery("#acdest2").addClass("fieldError");    }    if (init == 1) {        //getRouteDependantSelections();        init = 0;    }    if ((routeFetchRequired || b) && (c != null && a != null)) {        if (calendarType == "NORMAL") {            SiteAdmin.getRoute(c.i, a.i, setRouteForCurrentDepCity);        } else {            if (calendarType == "PLUS") {                SiteAdmin.getPlusRoute(c.i, a.i, setRouteForCurrentDepCity);            }        }    }    initialOnBlur++	*/};
