Make WordPress Core

Ticket #6988: 6988.003.diff

File 6988.003.diff, 163.0 KB (added by AaronCampbell, 17 years ago)
  • wp-includes/js/jquery/ui.core.js

     
    77 *
    88 * http://docs.jquery.com/UI
    99 *
    10  * $Id: ui.core.js 5587 2008-05-13 19:56:42Z scott.gonzalez $
     10 * $Id: ui.core.js 5634 2008-05-19 20:53:51Z joern.zaefferer $
    1111 */
    1212;(function($) {
    1313       
     
    8282                var methods = $[namespace][plugin].getter || [];
    8383                methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
    8484                return ($.inArray(method, methods) != -1);
    85         };
     85        }
    8686       
    8787        var widgetPrototype = {
    8888                init: function() {},
     
    109109                var namespace = name.split(".")[0];
    110110                name = name.split(".")[1];
    111111                // create plugin method
    112                 $.fn[name] = function(options, data) {
    113                         var isMethodCall = (typeof options == 'string');
    114                         [].shift.call(arguments);
     112                $.fn[name] = function(options) {
     113                        var isMethodCall = (typeof options == 'string'),
     114                                args = Array.prototype.slice.call(arguments, 1);
    115115                       
    116116                        if (isMethodCall && getter(namespace, name, options)) {
    117117                                var instance = $.data(this[0], name);
    118                                 return (instance ? instance[options].apply(instance, arguments)
     118                                return (instance ? instance[options].apply(instance, args)
    119119                                        : undefined);
    120120                        }
    121121                       
     
    124124                                if (!instance) {
    125125                                        $.data(this, name, new $[namespace][name](this, options));
    126126                                } else if (isMethodCall) {
    127                                         instance[options].apply(instance, arguments);
     127                                        instance[options].apply(instance, args);
    128128                                }
    129129                        });
    130130                };
  • wp-includes/js/jquery/ui.sortable.js

     
     1/*
     2 * jQuery UI Sortable
     3 *
     4 * Copyright (c) 2008 Paul Bakaus
     5 * Dual licensed under the MIT (MIT-LICENSE.txt)
     6 * and GPL (GPL-LICENSE.txt) licenses.
     7 *
     8 * http://docs.jquery.com/UI/Sortables
     9 *
     10 * Depends:
     11 *      ui.core.js
     12 *
     13 * Revision: $Id: ui.sortable.js 5433 2008-05-04 20:07:17Z joern.zaefferer $
     14 */
     15;(function($) {
     16       
     17        function contains(a, b) {
     18            var safari2 = $.browser.safari && $.browser.version < 522;
     19            if (a.contains && !safari2) {
     20                return a.contains(b);
     21            }
     22            if (a.compareDocumentPosition)
     23                return !!(a.compareDocumentPosition(b) & 16);
     24            while (b = b.parentNode)
     25                  if (b == a) return true;
     26            return false;
     27        };
     28       
     29        $.widget("ui.sortable", {
     30                init: function() {
     31
     32                        var o = this.options;
     33                        this.containerCache = {};
     34                        this.element.addClass("ui-sortable");
     35               
     36                        //Get the items
     37                        this.refresh();
     38       
     39                        //Let's determine if the items are floating
     40                        this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
     41                       
     42                        //Let's determine the parent's offset
     43                        if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative');
     44                        this.offset = this.element.offset();
     45       
     46                        //Initialize mouse events for interaction
     47                        this.element.mouse({
     48                                executor: this,
     49                                delay: o.delay,
     50                                distance: o.distance || 1,
     51                                dragPrevention: o.prevention ? o.prevention.toLowerCase().split(',') : ['input','textarea','button','select','option'],
     52                                start: this.start,
     53                                stop: this.stop,
     54                                drag: this.drag,
     55                                condition: function(e) {
     56       
     57                                        if(this.options.disabled || this.options.type == 'static') return false;
     58       
     59                                        //Find out if the clicked node (or one of its parents) is a actual item in this.items
     60                                        var currentItem = null, nodes = $(e.target).parents().each(function() {
     61                                                if($.data(this, 'sortable-item')) {
     62                                                        currentItem = $(this);
     63                                                        return false;
     64                                                }
     65                                        });
     66                                        if($.data(e.target, 'sortable-item')) currentItem = $(e.target);
     67                                       
     68                                        if(!currentItem) return false; 
     69                                        if(this.options.handle) {
     70                                                var validHandle = false;
     71                                                $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; });
     72                                                if(!validHandle) return false;
     73                                        }
     74                                               
     75                                        this.currentItem = currentItem;
     76                                        return true;
     77       
     78                                }
     79                        });
     80                       
     81                },
     82                plugins: {},
     83                ui: function(inst) {
     84                        return {
     85                                helper: (inst || this)["helper"],
     86                                placeholder: (inst || this)["placeholder"] || $([]),
     87                                position: (inst || this)["position"].current,
     88                                absolutePosition: (inst || this)["position"].absolute,
     89                                instance: this,
     90                                options: this.options,
     91                                element: this.element,
     92                                item: (inst || this)["currentItem"],
     93                                sender: inst ? inst.element : null
     94                        };             
     95                },
     96                propagate: function(n,e,inst) {
     97                        $.ui.plugin.call(this, n, [e, this.ui(inst)]);
     98                        this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]);
     99                },
     100                serialize: function(o) {
     101                       
     102                        var items = $(this.options.items, this.element).not('.ui-sortable-helper'); //Only the items of the sortable itself
     103                        var str = []; o = o || {};
     104                       
     105                        items.each(function() {
     106                                var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
     107                                if(res) str.push((o.key || res[1])+'[]='+(o.key ? res[1] : res[2]));
     108                        });
     109                       
     110                        return str.join('&');
     111                       
     112                },
     113                toArray: function(attr) {
     114                        var items = $(this.options.items, this.element).not('.ui-sortable-helper'); //Only the items of the sortable itself
     115                        var ret = [];
     116
     117                        items.each(function() { ret.push($(this).attr(attr || 'id')); });
     118                        return ret;
     119                },
     120                enable: function() {
     121                        this.element.removeClass("ui-sortable-disabled");
     122                        this.options.disabled = false;
     123                },
     124                disable: function() {
     125                        this.element.addClass("ui-sortable-disabled");
     126                        this.options.disabled = true;
     127                },
     128                /* Be careful with the following core functions */
     129                intersectsWith: function(item) {
     130                       
     131                        var x1 = this.position.absolute.left, x2 = x1 + this.helperProportions.width,
     132                        y1 = this.position.absolute.top, y2 = y1 + this.helperProportions.height;
     133                        var l = item.left, r = l + item.width,
     134                        t = item.top, b = t + item.height;
     135
     136                        if(this.options.tolerance == "pointer") {
     137                                return (y1 + this.clickOffset.top > t && y1 + this.clickOffset.top < b && x1 + this.clickOffset.left > l && x1 + this.clickOffset.left < r);
     138                        } else {
     139                       
     140                                return (l < x1 + (this.helperProportions.width / 2) // Right Half
     141                                        && x2 - (this.helperProportions.width / 2) < r // Left Half
     142                                        && t < y1 + (this.helperProportions.height / 2) // Bottom Half
     143                                        && y2 - (this.helperProportions.height / 2) < b ); // Top Half
     144                       
     145                        }
     146                       
     147                },
     148                intersectsWithEdge: function(item) {   
     149                        var x1 = this.position.absolute.left, x2 = x1 + this.helperProportions.width,
     150                                y1 = this.position.absolute.top, y2 = y1 + this.helperProportions.height;
     151                        var l = item.left, r = l + item.width,
     152                                t = item.top, b = t + item.height;
     153
     154                        if(this.options.tolerance == "pointer") {
     155
     156                                if(!(y1 + this.clickOffset.top > t && y1 + this.clickOffset.top < b && x1 + this.clickOffset.left > l && x1 + this.clickOffset.left < r)) return false;
     157                               
     158                                if(this.floating) {
     159                                        if(x1 + this.clickOffset.left > l && x1 + this.clickOffset.left < l + item.width/2) return 2;
     160                                        if(x1 + this.clickOffset.left > l+item.width/2 && x1 + this.clickOffset.left < r) return 1;
     161                                } else {
     162                                        if(y1 + this.clickOffset.top > t && y1 + this.clickOffset.top < t + item.height/2) return 2;
     163                                        if(y1 + this.clickOffset.top > t+item.height/2 && y1 + this.clickOffset.top < b) return 1;
     164                                }
     165
     166                        } else {
     167                       
     168                                if (!(l < x1 + (this.helperProportions.width / 2) // Right Half
     169                                        && x2 - (this.helperProportions.width / 2) < r // Left Half
     170                                        && t < y1 + (this.helperProportions.height / 2) // Bottom Half
     171                                        && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half
     172                               
     173                                if(this.floating) {
     174                                        if(x2 > l && x1 < l) return 2; //Crosses left edge
     175                                        if(x1 < r && x2 > r) return 1; //Crosses right edge
     176                                } else {
     177                                        if(y2 > t && y1 < t) return 1; //Crosses top edge
     178                                        if(y1 < b && y2 > b) return 2; //Crosses bottom edge
     179                                }
     180                       
     181                        }
     182                       
     183                        return false;
     184                       
     185                },
     186                //This method checks approximately if the item is dragged in a container, but doesn't touch any items
     187                inEmptyZone: function(container) {
     188
     189                        if(!$(container.options.items, container.element).length) {
     190                                return container.options.dropOnEmpty ? true : false;
     191                        };
     192
     193                        var last = $(container.options.items, container.element).not('.ui-sortable-helper'); last = $(last[last.length-1]);
     194                        var top = last.offset()[this.floating ? 'left' : 'top'] + last[0][this.floating ? 'offsetWidth' : 'offsetHeight'];
     195                        return (this.position.absolute[this.floating ? 'left' : 'top'] > top);
     196                },
     197                refresh: function() {
     198                        this.refreshItems();
     199                        this.refreshPositions();
     200                },
     201                refreshItems: function() {
     202                       
     203                        this.items = [];
     204                        this.containers = [this];
     205                        var items = this.items;
     206                        var queries = [$(this.options.items, this.element)];
     207                       
     208                        if(this.options.connectWith) {
     209                                for (var i = this.options.connectWith.length - 1; i >= 0; i--){
     210                                        var cur = $(this.options.connectWith[i]);
     211                                        for (var j = cur.length - 1; j >= 0; j--){
     212                                                var inst = $.data(cur[j], 'sortable');
     213                                                if(inst && !inst.options.disabled) {
     214                                                        queries.push($(inst.options.items, inst.element));
     215                                                        this.containers.push(inst);
     216                                                }
     217                                        };
     218                                };
     219                        }
     220
     221                        for (var i = queries.length - 1; i >= 0; i--){
     222                                queries[i].each(function() {
     223                                        $.data(this, 'sortable-item', true); // Data for target checking (mouse manager)
     224                                        items.push({
     225                                                item: $(this),
     226                                                width: 0, height: 0,
     227                                                left: 0, top: 0
     228                                        });
     229                                });
     230                        };
     231
     232                },
     233                refreshPositions: function(fast) {
     234                        for (var i = this.items.length - 1; i >= 0; i--){
     235                                var t = this.items[i].item;
     236                                if(!fast) this.items[i].width = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerWidth();
     237                                if(!fast) this.items[i].height = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerHeight();
     238                                var p = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).offset();
     239                                this.items[i].left = p.left;
     240                                this.items[i].top = p.top;
     241                        };
     242                        for (var i = this.containers.length - 1; i >= 0; i--){
     243                                var p =this.containers[i].element.offset();
     244                                this.containers[i].containerCache.left = p.left;
     245                                this.containers[i].containerCache.top = p.top;
     246                                this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
     247                                this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
     248                        };
     249                },
     250                destroy: function() {
     251                        this.element
     252                                .removeClass("ui-sortable ui-sortable-disabled")
     253                                .removeData("sortable")
     254                                .unbind(".sortable")
     255                                .mouse("destroy");
     256                       
     257                        for ( var i = this.items.length - 1; i >= 0; i-- )
     258                                this.items[i].item.removeData("sortable-item");
     259                },
     260                createPlaceholder: function(that) {
     261                        (that || this).placeholderElement = this.options.placeholderElement ? $(this.options.placeholderElement, (that || this).currentItem) : (that || this).currentItem;
     262                        (that || this).placeholder = $('<div></div>')
     263                                .addClass(this.options.placeholder)
     264                                .appendTo('body')
     265                                .css({ position: 'absolute' })
     266                                .css((that || this).placeholderElement.offset())
     267                                .css({ width: (that || this).placeholderElement.outerWidth(), height: (that || this).placeholderElement.outerHeight() })
     268                                ;
     269                },
     270                contactContainers: function(e) {
     271                        for (var i = this.containers.length - 1; i >= 0; i--){
     272
     273                                if(this.intersectsWith(this.containers[i].containerCache)) {
     274                                        if(!this.containers[i].containerCache.over) {
     275                                               
     276
     277                                                if(this.currentContainer != this.containers[i]) {
     278                                                       
     279                                                        //When entering a new container, we will find the item with the least distance and append our item near it
     280                                                        var dist = 10000; var itemWithLeastDistance = null; var base = this.position.absolute[this.containers[i].floating ? 'left' : 'top'];
     281                                                        for (var j = this.items.length - 1; j >= 0; j--) {
     282                                                                if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue;
     283                                                                var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
     284                                                                if(Math.abs(cur - base) < dist) {
     285                                                                        dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
     286                                                                }
     287                                                        }
     288                                                       
     289                                                        //We also need to exchange the placeholder
     290                                                        if(this.placeholder) this.placeholder.remove();
     291                                                        if(this.containers[i].options.placeholder) {
     292                                                                this.containers[i].createPlaceholder(this);
     293                                                        } else {
     294                                                                this.placeholder = null; this.placeholderElement = null;
     295                                                        }
     296                                                       
     297                                                       
     298                                                        itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element);
     299                                                        this.propagate("change", e); //Call plugins and callbacks
     300                                                        this.containers[i].propagate("change", e, this); //Call plugins and callbacks
     301                                                        this.currentContainer = this.containers[i];
     302
     303                                                }
     304                                               
     305                                                this.containers[i].propagate("over", e, this);
     306                                                this.containers[i].containerCache.over = 1;
     307                                        }
     308                                } else {
     309                                        if(this.containers[i].containerCache.over) {
     310                                                this.containers[i].propagate("out", e, this);
     311                                                this.containers[i].containerCache.over = 0;
     312                                        }
     313                                }
     314                               
     315                        };                     
     316                },
     317                start: function(e,el) {
     318               
     319                        var o = this.options;
     320                        this.currentContainer = this;
     321                        this.refresh();
     322
     323                        //Create and append the visible helper
     324                        this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone();
     325                        if(!this.helper.parents('body').length) this.helper.appendTo(o.appendTo || this.currentItem[0].parentNode); //Add the helper to the DOM if that didn't happen already
     326                        this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class
     327                       
     328                        //Prepare variables for position generation
     329                        $.extend(this, {
     330                                offsetParent: this.helper.offsetParent(),
     331                                offsets: {
     332                                        absolute: this.currentItem.offset()
     333                                },
     334                                mouse: {
     335                                        start: { top: e.pageY, left: e.pageX }
     336                                },
     337                                margins: {
     338                                        top: parseInt(this.currentItem.css("marginTop")) || 0,
     339                                        left: parseInt(this.currentItem.css("marginLeft")) || 0
     340                                }
     341                        });
     342                       
     343                        //The relative click offset
     344                        this.offsets.parent = this.offsetParent.offset();
     345                        this.clickOffset = { left: e.pageX - this.offsets.absolute.left, top: e.pageY - this.offsets.absolute.top };
     346                       
     347                        this.originalPosition = {
     348                                left: this.offsets.absolute.left - this.offsets.parent.left - this.margins.left,
     349                                top: this.offsets.absolute.top - this.offsets.parent.top - this.margins.top
     350                        }
     351                       
     352                        //Generate a flexible offset that will later be subtracted from e.pageX/Y
     353                        //I hate margins - they need to be removed before positioning the element absolutely..
     354                        this.offset = {
     355                                left: e.pageX - this.originalPosition.left,
     356                                top: e.pageY - this.originalPosition.top
     357                        };
     358
     359                        //Save the first time position
     360                        $.extend(this, {
     361                                position: {
     362                                        current: { top: e.pageY - this.offset.top, left: e.pageX - this.offset.left },
     363                                        absolute: { left: e.pageX - this.clickOffset.left, top: e.pageY - this.clickOffset.top },
     364                                        dom: this.currentItem.prev()[0]
     365                                }
     366                        });
     367
     368                        //If o.placeholder is used, create a new element at the given position with the class
     369                        if(o.placeholder) this.createPlaceholder();
     370
     371                        this.propagate("start", e); //Call plugins and callbacks
     372                        this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; //Save and store the helper proportions
     373
     374                        //If we have something in cursorAt, we'll use it
     375                        if(o.cursorAt) {
     376                                if(o.cursorAt.top != undefined || o.cursorAt.bottom != undefined) {
     377                                        this.offset.top -= this.clickOffset.top - (o.cursorAt.top != undefined ? o.cursorAt.top : (this.helperProportions.height - o.cursorAt.bottom));
     378                                        this.clickOffset.top = (o.cursorAt.top != undefined ? o.cursorAt.top : (this.helperProportions.height - o.cursorAt.bottom));
     379                                }
     380                                if(o.cursorAt.left != undefined || o.cursorAt.right != undefined) {
     381                                        this.offset.left -= this.clickOffset.left - (o.cursorAt.left != undefined ? o.cursorAt.left : (this.helperProportions.width - o.cursorAt.right));
     382                                        this.clickOffset.left = (o.cursorAt.left != undefined ? o.cursorAt.left : (this.helperProportions.width - o.cursorAt.right));
     383                                }
     384                        }
     385
     386                        if(this.options.placeholder != 'clone') $(this.currentItem).css('visibility', 'hidden'); //Set the original element visibility to hidden to still fill out the white space
     387                        for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); } //Post 'activate' events to possible containers
     388                       
     389                        //Prepare possible droppables
     390                        if($.ui.ddmanager) $.ui.ddmanager.current = this;
     391                        if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
     392
     393                        this.dragging = true;
     394                        return false;
     395                       
     396                },
     397                stop: function(e) {
     398
     399                        this.propagate("stop", e); //Call plugins and trigger callbacks
     400                        if(this.position.dom != this.currentItem.prev()[0]) this.propagate("update", e); //Trigger update callback if the DOM position has changed
     401                        if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
     402                                this.propagate("remove", e);
     403                                for (var i = this.containers.length - 1; i >= 0; i--){
     404                                        if(contains(this.containers[i].element[0], this.currentItem[0])) {
     405                                                this.containers[i].propagate("update", e, this);
     406                                                this.containers[i].propagate("receive", e, this);
     407                                        }
     408                                };
     409                        };
     410                       
     411                        //Post events to containers
     412                        for (var i = this.containers.length - 1; i >= 0; i--){
     413                                this.containers[i].propagate("deactivate", e, this);
     414                                if(this.containers[i].containerCache.over) {
     415                                        this.containers[i].propagate("out", e, this);
     416                                        this.containers[i].containerCache.over = 0;
     417                                }
     418                        }
     419                       
     420                        //If we are using droppables, inform the manager about the drop
     421                        if ($.ui.ddmanager && !this.options.dropBehaviour) $.ui.ddmanager.drop(this, e);
     422                       
     423                        this.dragging = false;
     424                        if(this.cancelHelperRemoval) return false;
     425                        $(this.currentItem).css('visibility', '');
     426                        if(this.placeholder) this.placeholder.remove();
     427                        this.helper.remove();
     428
     429                        return false;
     430                       
     431                },
     432                drag: function(e) {
     433
     434                        //Compute the helpers position
     435                        this.position.current = { top: e.pageY - this.offset.top, left: e.pageX - this.offset.left };
     436                        this.position.absolute = { left: e.pageX - this.clickOffset.left, top: e.pageY - this.clickOffset.top };
     437
     438                        //Rearrange
     439                        for (var i = this.items.length - 1; i >= 0; i--) {
     440                                var intersection = this.intersectsWithEdge(this.items[i]);
     441                                if(!intersection) continue;
     442                               
     443                                if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself
     444                                        &&      this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before
     445                                        &&      !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked
     446                                        && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true)
     447                                ) {
     448                                       
     449                                        this.direction = intersection == 1 ? "down" : "up";
     450                                        this.rearrange(e, this.items[i]);
     451                                        this.propagate("change", e); //Call plugins and callbacks
     452                                        break;
     453                                }
     454                        }
     455                       
     456                        //Post events to containers
     457                        this.contactContainers(e);
     458                       
     459                        //Interconnect with droppables
     460                        if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
     461
     462                        this.propagate("sort", e); //Call plugins and callbacks
     463                        this.helper.css({ left: this.position.current.left+'px', top: this.position.current.top+'px' }); // Stick the helper to the cursor
     464                        return false;
     465                       
     466                },
     467                rearrange: function(e, i, a) {
     468                        a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem);
     469                        this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove
     470                        if(this.placeholderElement) this.placeholder.css(this.placeholderElement.offset());
     471                        if(this.placeholderElement && this.placeholderElement.is(":visible")) this.placeholder.css({ width: this.placeholderElement.outerWidth(), height: this.placeholderElement.outerHeight() });
     472                }
     473        });
     474       
     475        $.extend($.ui.sortable, {
     476                getter: "serialize toArray",
     477                defaults: {
     478                        items: '> *',
     479                        zIndex: 1000
     480                }
     481        });
     482
     483       
     484/*
     485 * Sortable Extensions
     486 */
     487
     488        $.ui.plugin.add("sortable", "cursor", {
     489                start: function(e, ui) {
     490                        var t = $('body');
     491                        if (t.css("cursor")) ui.options._cursor = t.css("cursor");
     492                        t.css("cursor", ui.options.cursor);
     493                },
     494                stop: function(e, ui) {
     495                        if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
     496                }
     497        });
     498
     499        $.ui.plugin.add("sortable", "zIndex", {
     500                start: function(e, ui) {
     501                        var t = ui.helper;
     502                        if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
     503                        t.css('zIndex', ui.options.zIndex);
     504                },
     505                stop: function(e, ui) {
     506                        if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
     507                }
     508        });
     509
     510        $.ui.plugin.add("sortable", "opacity", {
     511                start: function(e, ui) {
     512                        var t = ui.helper;
     513                        if(t.css("opacity")) ui.options._opacity = t.css("opacity");
     514                        t.css('opacity', ui.options.opacity);
     515                },
     516                stop: function(e, ui) {
     517                        if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
     518                }
     519        });
     520
     521
     522        $.ui.plugin.add("sortable", "revert", {
     523                stop: function(e, ui) {
     524                        var self = ui.instance;
     525                        self.cancelHelperRemoval = true;
     526                        var cur = self.currentItem.offset();
     527                        var op = self.helper.offsetParent().offset();
     528                        if(ui.instance.options.zIndex) ui.helper.css('zIndex', ui.instance.options.zIndex); //Do the zIndex again because it already was resetted by the plugin above on stop
     529
     530                        //Also animate the placeholder if we have one
     531                        if(ui.instance.placeholder) ui.instance.placeholder.animate({ opacity: 'hide' }, parseInt(ui.options.revert, 10) || 500);
     532                       
     533                       
     534                        ui.helper.animate({
     535                                left: cur.left - op.left - self.margins.left,
     536                                top: cur.top - op.top - self.margins.top
     537                        }, parseInt(ui.options.revert, 10) || 500, function() {
     538                                self.currentItem.css('visibility', 'visible');
     539                                window.setTimeout(function() {
     540                                        if(self.placeholder) self.placeholder.remove();
     541                                        self.helper.remove();
     542                                        if(ui.options._zIndex) ui.helper.css('zIndex', ui.options._zIndex);
     543                                }, 50);
     544                        });
     545                }
     546        });
     547
     548       
     549        $.ui.plugin.add("sortable", "containment", {
     550                start: function(e, ui) {
     551
     552                        var o = ui.options;
     553                        if((o.containment.left != undefined || o.containment.constructor == Array) && !o._containment) return;
     554                        if(!o._containment) o._containment = o.containment;
     555
     556                        if(o._containment == 'parent') o._containment = this[0].parentNode;
     557                        if(o._containment == 'sortable') o._containment = this[0];
     558                        if(o._containment == 'document') {
     559                                o.containment = [
     560                                        0,
     561                                        0,
     562                                        $(document).width(),
     563                                        ($(document).height() || document.body.parentNode.scrollHeight)
     564                                ];
     565                        } else { //I'm a node, so compute top/left/right/bottom
     566
     567                                var ce = $(o._containment);
     568                                var co = ce.offset();
     569
     570                                o.containment = [
     571                                        co.left,
     572                                        co.top,
     573                                        co.left+(ce.outerWidth() || ce[0].scrollWidth),
     574                                        co.top+(ce.outerHeight() || ce[0].scrollHeight)
     575                                ];
     576                        }
     577
     578                },
     579                sort: function(e, ui) {
     580
     581                        var o = ui.options;
     582                        var h = ui.helper;
     583                        var c = o.containment;
     584                        var self = ui.instance;
     585                        var borderLeft = (parseInt(self.offsetParent.css("borderLeftWidth"), 10) || 0);
     586                        var borderRight = (parseInt(self.offsetParent.css("borderRightWidth"), 10) || 0);
     587                        var borderTop = (parseInt(self.offsetParent.css("borderTopWidth"), 10) || 0);
     588                        var borderBottom = (parseInt(self.offsetParent.css("borderBottomWidth"), 10) || 0);
     589                       
     590                        if(c.constructor == Array) {
     591                                if((self.position.absolute.left < c[0])) self.position.current.left = c[0] - self.offsets.parent.left - self.margins.left;
     592                                if((self.position.absolute.top < c[1])) self.position.current.top = c[1] - self.offsets.parent.top - self.margins.top;
     593                                if(self.position.absolute.left - c[2] + self.helperProportions.width >= 0) self.position.current.left = c[2] - self.offsets.parent.left - self.helperProportions.width - self.margins.left - borderLeft - borderRight;
     594                                if(self.position.absolute.top - c[3] + self.helperProportions.height >= 0) self.position.current.top = c[3] - self.offsets.parent.top - self.helperProportions.height - self.margins.top - borderTop - borderBottom;
     595                        } else {
     596                                if((ui.position.left < c.left)) self.position.current.left = c.left;
     597                                if((ui.position.top < c.top)) self.position.current.top = c.top;
     598                                if(ui.position.left - self.offsetParent.innerWidth() + self.helperProportions.width + c.right + borderLeft + borderRight >= 0) self.position.current.left = self.offsetParent.innerWidth() - self.helperProportions.width - c.right - borderLeft - borderRight;
     599                                if(ui.position.top - self.offsetParent.innerHeight() + self.helperProportions.height + c.bottom + borderTop + borderBottom >= 0) self.position.current.top = self.offsetParent.innerHeight() - self.helperProportions.height - c.bottom - borderTop - borderBottom;
     600                        }
     601
     602                }
     603        });
     604
     605        $.ui.plugin.add("sortable", "axis", {
     606                sort: function(e, ui) {
     607                        var o = ui.options;
     608                        if(o.constraint) o.axis = o.constraint; //Legacy check
     609                        o.axis == 'x' ? ui.instance.position.current.top = ui.instance.originalPosition.top : ui.instance.position.current.left = ui.instance.originalPosition.left;
     610                }
     611        });
     612
     613        $.ui.plugin.add("sortable", "scroll", {
     614                start: function(e, ui) {
     615                        var o = ui.options;
     616                        o.scrollSensitivity     = o.scrollSensitivity || 20;
     617                        o.scrollSpeed           = o.scrollSpeed || 20;
     618
     619                        ui.instance.overflowY = function(el) {
     620                                do { if((/auto|scroll/).test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
     621                                return $(document);
     622                        }(this);
     623                        ui.instance.overflowX = function(el) {
     624                                do { if((/auto|scroll/).test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
     625                                return $(document);
     626                        }(this);
     627                       
     628                        if(ui.instance.overflowY[0] != document && ui.instance.overflowY[0].tagName != 'HTML') ui.instance.overflowYstart = ui.instance.overflowY[0].scrollTop;
     629                        if(ui.instance.overflowX[0] != document && ui.instance.overflowX[0].tagName != 'HTML') ui.instance.overflowXstart = ui.instance.overflowX[0].scrollLeft;
     630                       
     631                },
     632                sort: function(e, ui) {
     633                       
     634                        var o = ui.options;
     635                        var i = ui.instance;
     636
     637                        if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
     638                                if(i.overflowY[0].offsetHeight - (ui.position.top - i.overflowY[0].scrollTop + i.clickOffset.top) < o.scrollSensitivity)
     639                                        i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
     640                                if((ui.position.top - i.overflowY[0].scrollTop + i.clickOffset.top) < o.scrollSensitivity)
     641                                        i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;                           
     642                        } else {
     643                                //$(document.body).append('<p>'+(e.pageY - $(document).scrollTop())+'</p>');
     644                                if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
     645                                        $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
     646                                if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
     647                                        $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
     648                        }
     649                       
     650                        if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
     651                                if(i.overflowX[0].offsetWidth - (ui.position.left - i.overflowX[0].scrollLeft + i.clickOffset.left) < o.scrollSensitivity)
     652                                        i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
     653                                if((ui.position.top - i.overflowX[0].scrollLeft + i.clickOffset.left) < o.scrollSensitivity)
     654                                        i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;                         
     655                        } else {
     656                                if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
     657                                        $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
     658                                if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
     659                                        $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
     660                        }
     661                       
     662                        //ui.instance.recallOffset(e);
     663                        i.offset = {
     664                                left: i.mouse.start.left - i.originalPosition.left + (i.overflowXstart !== undefined ? i.overflowXstart - i.overflowX[0].scrollLeft : 0),
     665                                top: i.mouse.start.top - i.originalPosition.top + (i.overflowYstart !== undefined ? i.overflowYstart - i.overflowX[0].scrollTop : 0)
     666                        };
     667
     668                }
     669        });
     670
     671})(jQuery);
  • wp-includes/js/jquery/jquery.js

     
     1(function(){
    12/*
    2  * jQuery 1.2.3 - New Wave Javascript
     3 * jQuery 1.2.5 - New Wave Javascript
    34 *
    45 * Copyright (c) 2008 John Resig (jquery.com)
    56 * Dual licensed under the MIT (MIT-LICENSE.txt)
    67 * and GPL (GPL-LICENSE.txt) licenses.
    78 *
    8  * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
    9  * $Rev: 4663 $
     9 * $Date: 2008-05-16 11:37:11 -0700 (Fri, 16 May 2008) $
     10 * $Rev: 5623 $
    1011 */
    11 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{}));jQuery.noConflict();
    12  No newline at end of file
     12
     13// Map over jQuery in case of overwrite
     14var _jQuery = window.jQuery,
     15// Map over the $ in case of overwrite
     16        _$ = window.$;
     17
     18var jQuery = window.jQuery = window.$ = function( selector, context ) {
     19        // The jQuery object is actually just the init constructor 'enhanced'
     20        return new jQuery.fn.init( selector, context );
     21};
     22
     23// A simple way to check for HTML strings or ID strings
     24// (both of which we optimize for)
     25var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,
     26
     27// Is it a simple selector
     28        isSimple = /^.[^:#\[\.]*$/,
     29
     30// Will speed up references to undefined, and allows munging its name.
     31        undefined;
     32
     33jQuery.fn = jQuery.prototype = {
     34        init: function( selector, context ) {
     35                // Make sure that a selection was provided
     36                selector = selector || document;
     37
     38                // Handle $(DOMElement)
     39                if ( selector.nodeType ) {
     40                        this[0] = selector;
     41                        this.length = 1;
     42                        return this;
     43                }
     44                // Handle HTML strings
     45                if ( typeof selector == "string" ) {
     46                        // Are we dealing with HTML string or an ID?
     47                        var match = quickExpr.exec( selector );
     48
     49                        // Verify a match, and that no context was specified for #id
     50                        if ( match && (match[1] || !context) ) {
     51
     52                                // HANDLE: $(html) -> $(array)
     53                                if ( match[1] )
     54                                        selector = jQuery.clean( [ match[1] ], context );
     55
     56                                // HANDLE: $("#id")
     57                                else {
     58                                        var elem = document.getElementById( match[3] );
     59
     60                                        // Make sure an element was located
     61                                        if ( elem ){
     62                                                // Handle the case where IE and Opera return items
     63                                                // by name instead of ID
     64                                                if ( elem.id != match[3] )
     65                                                        return jQuery().find( selector );
     66
     67                                                // Otherwise, we inject the element directly into the jQuery object
     68                                                return jQuery( elem );
     69                                        }
     70                                        selector = [];
     71                                }
     72
     73                        // HANDLE: $(expr, [context])
     74                        // (which is just equivalent to: $(content).find(expr)
     75                        } else
     76                                return jQuery( context ).find( selector );
     77
     78                // HANDLE: $(function)
     79                // Shortcut for document ready
     80                } else if ( jQuery.isFunction( selector ) )
     81                        return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );
     82
     83                return this.setArray(jQuery.makeArray(selector));
     84        },
     85
     86        // The current version of jQuery being used
     87        jquery: "1.2.5",
     88
     89        // The number of elements contained in the matched element set
     90        size: function() {
     91                return this.length;
     92        },
     93
     94        // The number of elements contained in the matched element set
     95        length: 0,
     96
     97        // Get the Nth element in the matched element set OR
     98        // Get the whole matched element set as a clean array
     99        get: function( num ) {
     100                return num == undefined ?
     101
     102                        // Return a 'clean' array
     103                        jQuery.makeArray( this ) :
     104
     105                        // Return just the object
     106                        this[ num ];
     107        },
     108
     109        // Take an array of elements and push it onto the stack
     110        // (returning the new matched element set)
     111        pushStack: function( elems ) {
     112                // Build a new jQuery matched element set
     113                var ret = jQuery( elems );
     114
     115                // Add the old object onto the stack (as a reference)
     116                ret.prevObject = this;
     117
     118                // Return the newly-formed element set
     119                return ret;
     120        },
     121
     122        // Force the current matched set of elements to become
     123        // the specified array of elements (destroying the stack in the process)
     124        // You should use pushStack() in order to do this, but maintain the stack
     125        setArray: function( elems ) {
     126                // Resetting the length to 0, then using the native Array push
     127                // is a super-fast way to populate an object with array-like properties
     128                this.length = 0;
     129                Array.prototype.push.apply( this, elems );
     130
     131                return this;
     132        },
     133
     134        // Execute a callback for every element in the matched set.
     135        // (You can seed the arguments with an array of args, but this is
     136        // only used internally.)
     137        each: function( callback, args ) {
     138                return jQuery.each( this, callback, args );
     139        },
     140
     141        // Determine the position of an element within
     142        // the matched set of elements
     143        index: function( elem ) {
     144                var ret = -1;
     145
     146                // Locate the position of the desired element
     147                return jQuery.inArray(
     148                        // If it receives a jQuery object, the first element is used
     149                        elem && elem.jquery ? elem[0] : elem
     150                , this );
     151        },
     152
     153        attr: function( name, value, type ) {
     154                var options = name;
     155
     156                // Look for the case where we're accessing a style value
     157                if ( name.constructor == String )
     158                        if ( value === undefined )
     159                                return this[0] && jQuery[ type || "attr" ]( this[0], name );
     160
     161                        else {
     162                                options = {};
     163                                options[ name ] = value;
     164                        }
     165
     166                // Check to see if we're setting style values
     167                return this.each(function(i){
     168                        // Set all the styles
     169                        for ( name in options )
     170                                jQuery.attr(
     171                                        type ?
     172                                                this.style :
     173                                                this,
     174                                        name, jQuery.prop( this, options[ name ], type, i, name )
     175                                );
     176                });
     177        },
     178
     179        css: function( key, value ) {
     180                // ignore negative width and height values
     181                if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
     182                        value = undefined;
     183                return this.attr( key, value, "curCSS" );
     184        },
     185
     186        text: function( text ) {
     187                if ( typeof text != "object" && text != null )
     188                        return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
     189
     190                var ret = "";
     191
     192                jQuery.each( text || this, function(){
     193                        jQuery.each( this.childNodes, function(){
     194                                if ( this.nodeType != 8 )
     195                                        ret += this.nodeType != 1 ?
     196                                                this.nodeValue :
     197                                                jQuery.fn.text( [ this ] );
     198                        });
     199                });
     200
     201                return ret;
     202        },
     203
     204        wrapAll: function( html ) {
     205                if ( this[0] )
     206                        // The elements to wrap the target around
     207                        jQuery( html, this[0].ownerDocument )
     208                                .clone()
     209                                .insertBefore( this[0] )
     210                                .map(function(){
     211                                        var elem = this;
     212
     213                                        while ( elem.firstChild )
     214                                                elem = elem.firstChild;
     215
     216                                        return elem;
     217                                })
     218                                .append(this);
     219
     220                return this;
     221        },
     222
     223        wrapInner: function( html ) {
     224                return this.each(function(){
     225                        jQuery( this ).contents().wrapAll( html );
     226                });
     227        },
     228
     229        wrap: function( html ) {
     230                return this.each(function(){
     231                        jQuery( this ).wrapAll( html );
     232                });
     233        },
     234
     235        append: function() {
     236                return this.domManip(arguments, true, false, function(elem){
     237                        if (this.nodeType == 1)
     238                                this.appendChild( elem );
     239                });
     240        },
     241
     242        prepend: function() {
     243                return this.domManip(arguments, true, true, function(elem){
     244                        if (this.nodeType == 1)
     245                                this.insertBefore( elem, this.firstChild );
     246                });
     247        },
     248
     249        before: function() {
     250                return this.domManip(arguments, false, false, function(elem){
     251                        this.parentNode.insertBefore( elem, this );
     252                });
     253        },
     254
     255        after: function() {
     256                return this.domManip(arguments, false, true, function(elem){
     257                        this.parentNode.insertBefore( elem, this.nextSibling );
     258                });
     259        },
     260
     261        end: function() {
     262                return this.prevObject || jQuery( [] );
     263        },
     264
     265        find: function( selector ) {
     266                var elems = jQuery.map(this, function(elem){
     267                        return jQuery.find( selector, elem );
     268                });
     269
     270                return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
     271                        jQuery.unique( elems ) :
     272                        elems );
     273        },
     274
     275        clone: function( events ) {
     276                // Do the clone
     277                var ret = this.map(function(){
     278                        if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) {
     279                                // IE copies events bound via attachEvent when
     280                                // using cloneNode. Calling detachEvent on the
     281                                // clone will also remove the events from the orignal
     282                                // In order to get around this, we use innerHTML.
     283                                // Unfortunately, this means some modifications to
     284                                // attributes in IE that are actually only stored
     285                                // as properties will not be copied (such as the
     286                                // the name attribute on an input).
     287                                var clone = this.cloneNode(true),
     288                                        container = document.createElement("div");
     289                                container.appendChild(clone);
     290                                return jQuery.clean([container.innerHTML])[0];
     291                        } else
     292                                return this.cloneNode(true);
     293                });
     294
     295                // Need to set the expando to null on the cloned set if it exists
     296                // removeData doesn't work here, IE removes it from the original as well
     297                // this is primarily for IE but the data expando shouldn't be copied over in any browser
     298                var clone = ret.find("*").andSelf().each(function(){
     299                        if ( this[ expando ] != undefined )
     300                                this[ expando ] = null;
     301                });
     302
     303                // Copy the events from the original to the clone
     304                if ( events === true )
     305                        this.find("*").andSelf().each(function(i){
     306                                if (this.nodeType == 3)
     307                                        return;
     308                                var events = jQuery.data( this, "events" );
     309
     310                                for ( var type in events )
     311                                        for ( var handler in events[ type ] )
     312                                                jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
     313                        });
     314
     315                // Return the cloned set
     316                return ret;
     317        },
     318
     319        filter: function( selector ) {
     320                return this.pushStack(
     321                        jQuery.isFunction( selector ) &&
     322                        jQuery.grep(this, function(elem, i){
     323                                return selector.call( elem, i );
     324                        }) ||
     325
     326                        jQuery.multiFilter( selector, this ) );
     327        },
     328
     329        not: function( selector ) {
     330                if ( selector.constructor == String )
     331                        // test special case where just one selector is passed in
     332                        if ( isSimple.test( selector ) )
     333                                return this.pushStack( jQuery.multiFilter( selector, this, true ) );
     334                        else
     335                                selector = jQuery.multiFilter( selector, this );
     336
     337                var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
     338                return this.filter(function() {
     339                        return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
     340                });
     341        },
     342
     343        add: function( selector ) {
     344                return this.pushStack( jQuery.unique( jQuery.merge(
     345                        this.get(),
     346                        typeof selector == 'string' ?
     347                                jQuery( selector ) :
     348                                jQuery.makeArray( selector )
     349                )));
     350        },
     351
     352        is: function( selector ) {
     353                return !!selector && jQuery.multiFilter( selector, this ).length > 0;
     354        },
     355
     356        hasClass: function( selector ) {
     357                return this.is( "." + selector );
     358        },
     359
     360        val: function( value ) {
     361                if ( value == undefined ) {
     362
     363                        if ( this.length ) {
     364                                var elem = this[0];
     365
     366                                // We need to handle select boxes special
     367                                if ( jQuery.nodeName( elem, "select" ) ) {
     368                                        var index = elem.selectedIndex,
     369                                                values = [],
     370                                                options = elem.options,
     371                                                one = elem.type == "select-one";
     372
     373                                        // Nothing was selected
     374                                        if ( index < 0 )
     375                                                return null;
     376
     377                                        // Loop through all the selected options
     378                                        for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
     379                                                var option = options[ i ];
     380
     381                                                if ( option.selected ) {
     382                                                        // Get the specifc value for the option
     383                                                        value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
     384
     385                                                        // We don't need an array for one selects
     386                                                        if ( one )
     387                                                                return value;
     388
     389                                                        // Multi-Selects return an array
     390                                                        values.push( value );
     391                                                }
     392                                        }
     393
     394                                        return values;
     395
     396                                // Everything else, we just grab the value
     397                                } else
     398                                        return (this[0].value || "").replace(/\r/g, "");
     399
     400                        }
     401
     402                        return undefined;
     403                }
     404
     405                return this.each(function(){
     406                        if ( this.nodeType != 1 )
     407                                return;
     408
     409                        if ( value.constructor == Array && /radio|checkbox/.test( this.type ) )
     410                                this.checked = (jQuery.inArray(this.value, value) >= 0 ||
     411                                        jQuery.inArray(this.name, value) >= 0);
     412
     413                        else if ( jQuery.nodeName( this, "select" ) ) {
     414                                var values = jQuery.makeArray(value);
     415
     416                                jQuery( "option", this ).each(function(){
     417                                        this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
     418                                                jQuery.inArray( this.text, values ) >= 0);
     419                                });
     420
     421                                if ( !values.length )
     422                                        this.selectedIndex = -1;
     423
     424                        } else
     425                                this.value = value;
     426                });
     427        },
     428
     429        html: function( value ) {
     430                return value == undefined ?
     431                        (this.length ?
     432                                this[0].innerHTML :
     433                                null) :
     434                        this.empty().append( value );
     435        },
     436
     437        replaceWith: function( value ) {
     438                return this.after( value ).remove();
     439        },
     440
     441        eq: function( i ) {
     442                return this.slice( i, i + 1 );
     443        },
     444
     445        slice: function() {
     446                return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
     447        },
     448
     449        map: function( callback ) {
     450                return this.pushStack( jQuery.map(this, function(elem, i){
     451                        return callback.call( elem, i, elem );
     452                }));
     453        },
     454
     455        andSelf: function() {
     456                return this.add( this.prevObject );
     457        },
     458
     459        data: function( key, value ){
     460                var parts = key.split(".");
     461                parts[1] = parts[1] ? "." + parts[1] : "";
     462
     463                if ( value === undefined ) {
     464                        var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
     465
     466                        if ( data === undefined && this.length )
     467                                data = jQuery.data( this[0], key );
     468
     469                        return data === undefined && parts[1] ?
     470                                this.data( parts[0] ) :
     471                                data;
     472                } else
     473                        return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
     474                                jQuery.data( this, key, value );
     475                        });
     476        },
     477
     478        removeData: function( key ){
     479                return this.each(function(){
     480                        jQuery.removeData( this, key );
     481                });
     482        },
     483
     484        domManip: function( args, table, reverse, callback ) {
     485                var clone = this.length > 1, elems;
     486
     487                return this.each(function(){
     488                        if ( !elems ) {
     489                                elems = jQuery.clean( args, this.ownerDocument );
     490
     491                                if ( reverse )
     492                                        elems.reverse();
     493                        }
     494
     495                        var obj = this;
     496
     497                        if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
     498                                obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );
     499
     500                        var scripts = jQuery( [] );
     501
     502                        jQuery.each(elems, function(){
     503                                var elem = clone ?
     504                                        jQuery( this ).clone( true )[0] :
     505                                        this;
     506
     507                                // execute all scripts after the elements have been injected
     508                                if ( jQuery.nodeName( elem, "script" ) ) {
     509                                        scripts = scripts.add( elem );
     510                                } else {
     511                                        // Remove any inner scripts for later evaluation
     512                                        if ( elem.nodeType == 1 )
     513                                                scripts = scripts.add( jQuery( "script", elem ).remove() );
     514
     515                                        // Inject the elements into the document
     516                                        callback.call( obj, elem );
     517                                }
     518                        });
     519
     520                        scripts.each( evalScript );
     521                });
     522        }
     523};
     524
     525// Give the init function the jQuery prototype for later instantiation
     526jQuery.fn.init.prototype = jQuery.fn;
     527
     528function evalScript( i, elem ) {
     529        if ( elem.src )
     530                jQuery.ajax({
     531                        url: elem.src,
     532                        async: false,
     533                        dataType: "script"
     534                });
     535
     536        else
     537                jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
     538
     539        if ( elem.parentNode )
     540                elem.parentNode.removeChild( elem );
     541}
     542
     543function now(){
     544        return +new Date;
     545}
     546
     547jQuery.extend = jQuery.fn.extend = function() {
     548        // copy reference to target object
     549        var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
     550
     551        // Handle a deep copy situation
     552        if ( target.constructor == Boolean ) {
     553                deep = target;
     554                target = arguments[1] || {};
     555                // skip the boolean and the target
     556                i = 2;
     557        }
     558
     559        // Handle case when target is a string or something (possible in deep copy)
     560        if ( typeof target != "object" && typeof target != "function" )
     561                target = {};
     562
     563        // extend jQuery itself if only one argument is passed
     564        if ( length == i ) {
     565                target = this;
     566                --i;
     567        }
     568
     569        for ( ; i < length; i++ )
     570                // Only deal with non-null/undefined values
     571                if ( (options = arguments[ i ]) != null )
     572                        // Extend the base object
     573                        for ( var name in options ) {
     574                                var src = target[ name ], copy = options[ name ];
     575
     576                                // Prevent never-ending loop
     577                                if ( target === copy )
     578                                        continue;
     579
     580                                // Recurse if we're merging object values
     581                                if ( deep && copy && typeof copy == "object" && !copy.nodeType )
     582                                        target[ name ] = jQuery.extend( deep,
     583                                                // Never move original objects, clone them
     584                                                src || ( copy.length != null ? [ ] : { } )
     585                                        , copy );
     586
     587                                // Don't bring in undefined values
     588                                else if ( copy !== undefined )
     589                                        target[ name ] = copy;
     590
     591                        }
     592
     593        // Return the modified object
     594        return target;
     595};
     596
     597var expando = "jQuery" + now(), uuid = 0, windowData = {},
     598        // exclude the following css properties to add px
     599        exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
     600        // cache defaultView
     601        defaultView = document.defaultView || {};
     602
     603jQuery.extend({
     604        noConflict: function( deep ) {
     605                window.$ = _$;
     606
     607                if ( deep )
     608                        window.jQuery = _jQuery;
     609
     610                return jQuery;
     611        },
     612
     613        // See test/unit/core.js for details concerning this function.
     614        isFunction: function( fn ) {
     615                return !!fn && typeof fn != "string" && !fn.nodeName &&
     616                        fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
     617        },
     618
     619        // check if an element is in a (or is an) XML document
     620        isXMLDoc: function( elem ) {
     621                return elem.documentElement && !elem.body ||
     622                        elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
     623        },
     624
     625        // Evalulates a script in a global context
     626        globalEval: function( data ) {
     627                data = jQuery.trim( data );
     628
     629                if ( data ) {
     630                        // Inspired by code by Andrea Giammarchi
     631                        // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
     632                        var head = document.getElementsByTagName("head")[0] || document.documentElement,
     633                                script = document.createElement("script");
     634
     635                        script.type = "text/javascript";
     636                        if ( jQuery.browser.msie )
     637                                script.text = data;
     638                        else
     639                                script.appendChild( document.createTextNode( data ) );
     640
     641                        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
     642                        // This arises when a base node is used (#2709).
     643                        head.insertBefore( script, head.firstChild );
     644                        head.removeChild( script );
     645                }
     646        },
     647
     648        nodeName: function( elem, name ) {
     649                return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
     650        },
     651
     652        cache: {},
     653
     654        data: function( elem, name, data ) {
     655                elem = elem == window ?
     656                        windowData :
     657                        elem;
     658
     659                var id = elem[ expando ];
     660
     661                // Compute a unique ID for the element
     662                if ( !id )
     663                        id = elem[ expando ] = ++uuid;
     664
     665                // Only generate the data cache if we're
     666                // trying to access or manipulate it
     667                if ( name && !jQuery.cache[ id ] )
     668                        jQuery.cache[ id ] = {};
     669
     670                // Prevent overriding the named cache with undefined values
     671                if ( data !== undefined )
     672                        jQuery.cache[ id ][ name ] = data;
     673
     674                // Return the named cache data, or the ID for the element
     675                return name ?
     676                        jQuery.cache[ id ][ name ] :
     677                        id;
     678        },
     679
     680        removeData: function( elem, name ) {
     681                elem = elem == window ?
     682                        windowData :
     683                        elem;
     684
     685                var id = elem[ expando ];
     686
     687                // If we want to remove a specific section of the element's data
     688                if ( name ) {
     689                        if ( jQuery.cache[ id ] ) {
     690                                // Remove the section of cache data
     691                                delete jQuery.cache[ id ][ name ];
     692
     693                                // If we've removed all the data, remove the element's cache
     694                                name = "";
     695
     696                                for ( name in jQuery.cache[ id ] )
     697                                        break;
     698
     699                                if ( !name )
     700                                        jQuery.removeData( elem );
     701                        }
     702
     703                // Otherwise, we want to remove all of the element's data
     704                } else {
     705                        // Clean up the element expando
     706                        try {
     707                                delete elem[ expando ];
     708                        } catch(e){
     709                                // IE has trouble directly removing the expando
     710                                // but it's ok with using removeAttribute
     711                                if ( elem.removeAttribute )
     712                                        elem.removeAttribute( expando );
     713                        }
     714
     715                        // Completely remove the data cache
     716                        delete jQuery.cache[ id ];
     717                }
     718        },
     719
     720        // args is for internal usage only
     721        each: function( object, callback, args ) {
     722                var name, i = 0, length = object.length;
     723
     724                if ( args ) {
     725                        if ( length == undefined ) {
     726                                for ( name in object )
     727                                        if ( callback.apply( object[ name ], args ) === false )
     728                                                break;
     729                        } else
     730                                for ( ; i < length; )
     731                                        if ( callback.apply( object[ i++ ], args ) === false )
     732                                                break;
     733
     734                // A special, fast, case for the most common use of each
     735                } else {
     736                        if ( length == undefined ) {
     737                                for ( name in object )
     738                                        if ( callback.call( object[ name ], name, object[ name ] ) === false )
     739                                                break;
     740                        } else
     741                                for ( var value = object[0];
     742                                        i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
     743                }
     744
     745                return object;
     746        },
     747
     748        prop: function( elem, value, type, i, name ) {
     749                        // Handle executable functions
     750                        if ( jQuery.isFunction( value ) )
     751                                value = value.call( elem, i );
     752
     753                        // Handle passing in a number to a CSS property
     754                        return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
     755                                value + "px" :
     756                                value;
     757        },
     758
     759        className: {
     760                // internal only, use addClass("class")
     761                add: function( elem, classNames ) {
     762                        jQuery.each((classNames || "").split(/\s+/), function(i, className){
     763                                if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
     764                                        elem.className += (elem.className ? " " : "") + className;
     765                        });
     766                },
     767
     768                // internal only, use removeClass("class")
     769                remove: function( elem, classNames ) {
     770                        if (elem.nodeType == 1)
     771                                elem.className = classNames != undefined ?
     772                                        jQuery.grep(elem.className.split(/\s+/), function(className){
     773                                                return !jQuery.className.has( classNames, className );
     774                                        }).join(" ") :
     775                                        "";
     776                },
     777
     778                // internal only, use hasClass("class")
     779                has: function( elem, className ) {
     780                        return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
     781                }
     782        },
     783
     784        // A method for quickly swapping in/out CSS properties to get correct calculations
     785        swap: function( elem, options, callback ) {
     786                var old = {};
     787                // Remember the old values, and insert the new ones
     788                for ( var name in options ) {
     789                        old[ name ] = elem.style[ name ];
     790                        elem.style[ name ] = options[ name ];
     791                }
     792
     793                callback.call( elem );
     794
     795                // Revert the old values
     796                for ( var name in options )
     797                        elem.style[ name ] = old[ name ];
     798        },
     799
     800        css: function( elem, name, force ) {
     801                if ( name == "width" || name == "height" ) {
     802                        var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
     803
     804                        function getWH() {
     805                                val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
     806                                var padding = 0, border = 0;
     807                                jQuery.each( which, function() {
     808                                        padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
     809                                        border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
     810                                });
     811                                val -= Math.round(padding + border);
     812                        }
     813
     814                        if ( jQuery(elem).is(":visible") )
     815                                getWH();
     816                        else
     817                                jQuery.swap( elem, props, getWH );
     818
     819                        return Math.max(0, val);
     820                }
     821
     822                return jQuery.curCSS( elem, name, force );
     823        },
     824
     825        curCSS: function( elem, name, force ) {
     826                var ret, style = elem.style;
     827
     828                // A helper method for determining if an element's values are broken
     829                function color( elem ) {
     830                        if ( !jQuery.browser.safari )
     831                                return false;
     832
     833                        // defaultView is cached
     834                        var ret = defaultView.getComputedStyle( elem, null );
     835                        return !ret || ret.getPropertyValue("color") == "";
     836                }
     837
     838                // We need to handle opacity special in IE
     839                if ( name == "opacity" && jQuery.browser.msie ) {
     840                        ret = jQuery.attr( style, "opacity" );
     841
     842                        return ret == "" ?
     843                                "1" :
     844                                ret;
     845                }
     846                // Opera sometimes will give the wrong display answer, this fixes it, see #2037
     847                if ( jQuery.browser.opera && name == "display" ) {
     848                        var save = style.outline;
     849                        style.outline = "0 solid black";
     850                        style.outline = save;
     851                }
     852
     853                // Make sure we're using the right name for getting the float value
     854                if ( name.match( /float/i ) )
     855                        name = styleFloat;
     856
     857                if ( !force && style && style[ name ] )
     858                        ret = style[ name ];
     859
     860                else if ( defaultView.getComputedStyle ) {
     861
     862                        // Only "float" is needed here
     863                        if ( name.match( /float/i ) )
     864                                name = "float";
     865
     866                        name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
     867
     868                        var computedStyle = defaultView.getComputedStyle( elem, null );
     869
     870                        if ( computedStyle && !color( elem ) )
     871                                ret = computedStyle.getPropertyValue( name );
     872
     873                        // If the element isn't reporting its values properly in Safari
     874                        // then some display: none elements are involved
     875                        else {
     876                                var swap = [], stack = [], a = elem, i = 0;
     877
     878                                // Locate all of the parent display: none elements
     879                                for ( ; a && color(a); a = a.parentNode )
     880                                        stack.unshift(a);
     881
     882                                // Go through and make them visible, but in reverse
     883                                // (It would be better if we knew the exact display type that they had)
     884                                for ( ; i < stack.length; i++ )
     885                                        if ( color( stack[ i ] ) ) {
     886                                                swap[ i ] = stack[ i ].style.display;
     887                                                stack[ i ].style.display = "block";
     888                                        }
     889
     890                                // Since we flip the display style, we have to handle that
     891                                // one special, otherwise get the value
     892                                ret = name == "display" && swap[ stack.length - 1 ] != null ?
     893                                        "none" :
     894                                        ( computedStyle && computedStyle.getPropertyValue( name ) ) || "";
     895
     896                                // Finally, revert the display styles back
     897                                for ( i = 0; i < swap.length; i++ )
     898                                        if ( swap[ i ] != null )
     899                                                stack[ i ].style.display = swap[ i ];
     900                        }
     901
     902                        // We should always get a number back from opacity
     903                        if ( name == "opacity" && ret == "" )
     904                                ret = "1";
     905
     906                } else if ( elem.currentStyle ) {
     907                        var camelCase = name.replace(/\-(\w)/g, function(all, letter){
     908                                return letter.toUpperCase();
     909                        });
     910
     911                        ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
     912
     913                        // From the awesome hack by Dean Edwards
     914                        // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
     915
     916                        // If we're not dealing with a regular pixel number
     917                        // but a number that has a weird ending, we need to convert it to pixels
     918                        if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
     919                                // Remember the original values
     920                                var left = style.left, rsLeft = elem.runtimeStyle.left;
     921
     922                                // Put in the new values to get a computed value out
     923                                elem.runtimeStyle.left = elem.currentStyle.left;
     924                                style.left = ret || 0;
     925                                ret = style.pixelLeft + "px";
     926
     927                                // Revert the changed values
     928                                style.left = left;
     929                                elem.runtimeStyle.left = rsLeft;
     930                        }
     931                }
     932
     933                return ret;
     934        },
     935
     936        clean: function( elems, context ) {
     937                var ret = [];
     938                context = context || document;
     939                // !context.createElement fails in IE with an error but returns typeof 'object'
     940                if (typeof context.createElement == 'undefined')
     941                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
     942
     943                jQuery.each(elems, function(i, elem){
     944                        if ( !elem )
     945                                return;
     946
     947                        if ( elem.constructor == Number )
     948                                elem += '';
     949
     950                        // Convert html string into DOM nodes
     951                        if ( typeof elem == "string" ) {
     952                                // Fix "XHTML"-style tags in all browsers
     953                                elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
     954                                        return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
     955                                                all :
     956                                                front + "></" + tag + ">";
     957                                });
     958
     959                                // Trim whitespace, otherwise indexOf won't work as expected
     960                                var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");
     961
     962                                var wrap =
     963                                        // option or optgroup
     964                                        !tags.indexOf("<opt") &&
     965                                        [ 1, "<select multiple='multiple'>", "</select>" ] ||
     966
     967                                        !tags.indexOf("<leg") &&
     968                                        [ 1, "<fieldset>", "</fieldset>" ] ||
     969
     970                                        tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
     971                                        [ 1, "<table>", "</table>" ] ||
     972
     973                                        !tags.indexOf("<tr") &&
     974                                        [ 2, "<table><tbody>", "</tbody></table>" ] ||
     975
     976                                        // <thead> matched above
     977                                        (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
     978                                        [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
     979
     980                                        !tags.indexOf("<col") &&
     981                                        [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
     982
     983                                        // IE can't serialize <link> and <script> tags normally
     984                                        jQuery.browser.msie &&
     985                                        [ 1, "div<div>", "</div>" ] ||
     986
     987                                        [ 0, "", "" ];
     988
     989                                // Go to html and back, then peel off extra wrappers
     990                                div.innerHTML = wrap[1] + elem + wrap[2];
     991
     992                                // Move to the right depth
     993                                while ( wrap[0]-- )
     994                                        div = div.lastChild;
     995
     996                                // Remove IE's autoinserted <tbody> from table fragments
     997                                if ( jQuery.browser.msie ) {
     998
     999                                        // String was a <table>, *may* have spurious <tbody>
     1000                                        var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
     1001                                                div.firstChild && div.firstChild.childNodes :
     1002
     1003                                                // String was a bare <thead> or <tfoot>
     1004                                                wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
     1005                                                        div.childNodes :
     1006                                                        [];
     1007
     1008                                        for ( var j = tbody.length - 1; j >= 0 ; --j )
     1009                                                if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
     1010                                                        tbody[ j ].parentNode.removeChild( tbody[ j ] );
     1011
     1012                                        // IE completely kills leading whitespace when innerHTML is used
     1013                                        if ( /^\s/.test( elem ) )
     1014                                                div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
     1015
     1016                                }
     1017
     1018                                elem = jQuery.makeArray( div.childNodes );
     1019                        }
     1020
     1021                        if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) )
     1022                                return;
     1023
     1024                        if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )
     1025                                ret.push( elem );
     1026
     1027                        else
     1028                                ret = jQuery.merge( ret, elem );
     1029
     1030                });
     1031
     1032                return ret;
     1033        },
     1034
     1035        attr: function( elem, name, value ) {
     1036                // don't set attributes on text and comment nodes
     1037                if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
     1038                        return undefined;
     1039
     1040                var notxml = !jQuery.isXMLDoc( elem ),
     1041                        // Whether we are setting (or getting)
     1042                        set = value !== undefined,
     1043                        msie = jQuery.browser.msie;
     1044
     1045                // Try to normalize/fix the name
     1046                name = notxml && jQuery.props[ name ] || name;
     1047
     1048                // Only do all the following if this is a node (faster for style)
     1049                // IE elem.getAttribute passes even for style
     1050                if ( elem.tagName ) {
     1051
     1052                        // These attributes require special treatment
     1053                        var special = /href|src|style/.test( name );
     1054
     1055                        // Safari mis-reports the default selected property of a hidden option
     1056                        // Accessing the parent's selectedIndex property fixes it
     1057                        if ( name == "selected" && jQuery.browser.safari )
     1058                                elem.parentNode.selectedIndex;
     1059
     1060                        // If applicable, access the attribute via the DOM 0 way
     1061                        if ( notxml && !special && name in elem ) {
     1062                                if ( set ){
     1063                                        // We can't allow the type property to be changed (since it causes problems in IE)
     1064                                        if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
     1065                                                throw "type property can't be changed";
     1066
     1067                                        elem[ name ] = value;
     1068                                }
     1069
     1070                                // browsers index elements by id/name on forms, give priority to attributes.
     1071                                if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
     1072                                        return elem.getAttributeNode( name ).nodeValue;
     1073
     1074                                return elem[ name ];
     1075                        }
     1076
     1077                        if ( msie && notxml &&  name == "style" )
     1078                                return jQuery.attr( elem.style, "cssText", value );
     1079
     1080                        if ( set )
     1081                                // convert the value to a string (all browsers do this but IE) see #1070
     1082                                elem.setAttribute( name, "" + value );
     1083
     1084                        if ( msie && special && notxml )
     1085                                return elem.getAttribute( name, 2 );
     1086
     1087                        return elem.getAttribute( name );
     1088
     1089                }
     1090
     1091                // elem is actually elem.style ... set the style
     1092
     1093                // IE uses filters for opacity
     1094                if ( msie && name == "opacity" ) {
     1095                        if ( set ) {
     1096                                // IE has trouble with opacity if it does not have layout
     1097                                // Force it by setting the zoom level
     1098                                elem.zoom = 1;
     1099
     1100                                // Set the alpha filter to set the opacity
     1101                                elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
     1102                                        (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
     1103                        }
     1104
     1105                        return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
     1106                                (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
     1107                                "";
     1108                }
     1109
     1110                name = name.replace(/-([a-z])/ig, function(all, letter){
     1111                        return letter.toUpperCase();
     1112                });
     1113
     1114                if ( set )
     1115                        elem[ name ] = value;
     1116
     1117                return elem[ name ];
     1118        },
     1119
     1120        trim: function( text ) {
     1121                return (text || "").replace( /^\s+|\s+$/g, "" );
     1122        },
     1123
     1124        makeArray: function( array ) {
     1125                var ret = [];
     1126
     1127                if( array != null ){
     1128                        var i = array.length;
     1129                        //the window, strings and functions also have 'length'
     1130                        if( i == null || array.split || array.setInterval || array.call )
     1131                                ret[0] = array;
     1132                        else
     1133                                while( i )
     1134                                        ret[--i] = array[i];
     1135                }
     1136
     1137                return ret;
     1138        },
     1139
     1140        inArray: function( elem, array ) {
     1141                for ( var i = 0, length = array.length; i < length; i++ )
     1142                // Use === because on IE, window == document
     1143                        if ( array[ i ] === elem )
     1144                                return i;
     1145
     1146                return -1;
     1147        },
     1148
     1149        merge: function( first, second ) {
     1150                // We have to loop this way because IE & Opera overwrite the length
     1151                // expando of getElementsByTagName
     1152                var i = 0, elem, pos = first.length;
     1153                // Also, we need to make sure that the correct elements are being returned
     1154                // (IE returns comment nodes in a '*' query)
     1155                if ( jQuery.browser.msie ) {
     1156                        while ( elem = second[ i++ ] )
     1157                                if ( elem.nodeType != 8 )
     1158                                        first[ pos++ ] = elem;
     1159
     1160                } else
     1161                        while ( elem = second[ i++ ] )
     1162                                first[ pos++ ] = elem;
     1163
     1164                return first;
     1165        },
     1166
     1167        unique: function( array ) {
     1168                var ret = [], done = {};
     1169
     1170                try {
     1171
     1172                        for ( var i = 0, length = array.length; i < length; i++ ) {
     1173                                var id = jQuery.data( array[ i ] );
     1174
     1175                                if ( !done[ id ] ) {
     1176                                        done[ id ] = true;
     1177                                        ret.push( array[ i ] );
     1178                                }
     1179                        }
     1180
     1181                } catch( e ) {
     1182                        ret = array;
     1183                }
     1184
     1185                return ret;
     1186        },
     1187
     1188        grep: function( elems, callback, inv ) {
     1189                var ret = [];
     1190
     1191                // Go through the array, only saving the items
     1192                // that pass the validator function
     1193                for ( var i = 0, length = elems.length; i < length; i++ )
     1194                        if ( !inv != !callback( elems[ i ], i ) )
     1195                                ret.push( elems[ i ] );
     1196
     1197                return ret;
     1198        },
     1199
     1200        map: function( elems, callback ) {
     1201                var ret = [];
     1202
     1203                // Go through the array, translating each of the items to their
     1204                // new value (or values).
     1205                for ( var i = 0, length = elems.length; i < length; i++ ) {
     1206                        var value = callback( elems[ i ], i );
     1207
     1208                        if ( value != null )
     1209                                ret[ ret.length ] = value;
     1210                }
     1211
     1212                return ret.concat.apply( [], ret );
     1213        }
     1214});
     1215
     1216var userAgent = navigator.userAgent.toLowerCase();
     1217
     1218// Figure out what browser is being used
     1219jQuery.browser = {
     1220        version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
     1221        safari: /webkit/.test( userAgent ),
     1222        opera: /opera/.test( userAgent ),
     1223        msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
     1224        mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
     1225};
     1226
     1227var styleFloat = jQuery.browser.msie ?
     1228        "styleFloat" :
     1229        "cssFloat";
     1230
     1231jQuery.extend({
     1232        // Check to see if the W3C box model is being used
     1233        boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
     1234
     1235        props: {
     1236                "for": "htmlFor",
     1237                "class": "className",
     1238                "float": styleFloat,
     1239                cssFloat: styleFloat,
     1240                styleFloat: styleFloat,
     1241                readonly: "readOnly",
     1242                maxlength: "maxLength",
     1243                cellspacing: "cellSpacing"
     1244        }
     1245});
     1246
     1247jQuery.each({
     1248        parent: function(elem){return elem.parentNode;},
     1249        parents: function(elem){return jQuery.dir(elem,"parentNode");},
     1250        next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
     1251        prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
     1252        nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
     1253        prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
     1254        siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
     1255        children: function(elem){return jQuery.sibling(elem.firstChild);},
     1256        contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
     1257}, function(name, fn){
     1258        jQuery.fn[ name ] = function( selector ) {
     1259                var ret = jQuery.map( this, fn );
     1260
     1261                if ( selector && typeof selector == "string" )
     1262                        ret = jQuery.multiFilter( selector, ret );
     1263
     1264                return this.pushStack( jQuery.unique( ret ) );
     1265        };
     1266});
     1267
     1268jQuery.each({
     1269        appendTo: "append",
     1270        prependTo: "prepend",
     1271        insertBefore: "before",
     1272        insertAfter: "after",
     1273        replaceAll: "replaceWith"
     1274}, function(name, original){
     1275        jQuery.fn[ name ] = function() {
     1276                var args = arguments;
     1277
     1278                return this.each(function(){
     1279                        for ( var i = 0, length = args.length; i < length; i++ )
     1280                                jQuery( args[ i ] )[ original ]( this );
     1281                });
     1282        };
     1283});
     1284
     1285jQuery.each({
     1286        removeAttr: function( name ) {
     1287                jQuery.attr( this, name, "" );
     1288                if (this.nodeType == 1)
     1289                        this.removeAttribute( name );
     1290        },
     1291
     1292        addClass: function( classNames ) {
     1293                jQuery.className.add( this, classNames );
     1294        },
     1295
     1296        removeClass: function( classNames ) {
     1297                jQuery.className.remove( this, classNames );
     1298        },
     1299
     1300        toggleClass: function( classNames ) {
     1301                jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
     1302        },
     1303
     1304        remove: function( selector ) {
     1305                if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
     1306                        // Prevent memory leaks
     1307                        jQuery( "*", this ).add(this).each(function(){
     1308                                jQuery.event.remove(this);
     1309                                jQuery.removeData(this);
     1310                        });
     1311                        if (this.parentNode)
     1312                                this.parentNode.removeChild( this );
     1313                }
     1314        },
     1315
     1316        empty: function() {
     1317                // Remove element nodes and prevent memory leaks
     1318                jQuery( ">*", this ).remove();
     1319
     1320                // Remove any remaining nodes
     1321                while ( this.firstChild )
     1322                        this.removeChild( this.firstChild );
     1323        }
     1324}, function(name, fn){
     1325        jQuery.fn[ name ] = function(){
     1326                return this.each( fn, arguments );
     1327        };
     1328});
     1329
     1330jQuery.each([ "Height", "Width" ], function(i, name){
     1331        var type = name.toLowerCase();
     1332
     1333        jQuery.fn[ type ] = function( size ) {
     1334                // Get window width or height
     1335                return this[0] == window ?
     1336                        // Opera reports document.body.client[Width/Height] properly in both quirks and standards
     1337                        jQuery.browser.opera && document.body[ "client" + name ] ||
     1338
     1339                        // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
     1340                        jQuery.browser.safari && window[ "inner" + name ] ||
     1341
     1342                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
     1343                        document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :
     1344
     1345                        // Get document width or height
     1346                        this[0] == document ?
     1347                                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
     1348                                Math.max(
     1349                                        Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]),
     1350                                        Math.max(document.body["offset" + name], document.documentElement["offset" + name])
     1351                                ) :
     1352
     1353                                // Get or set width or height on the element
     1354                                size == undefined ?
     1355                                        // Get width or height on the element
     1356                                        (this.length ? jQuery.css( this[0], type ) : null) :
     1357
     1358                                        // Set the width or height on the element (default to pixels if value is unitless)
     1359                                        this.css( type, size.constructor == String ? size : size + "px" );
     1360        };
     1361});
     1362
     1363// Helper function used by the dimensions and offset modules
     1364function num(elem, prop) {
     1365        return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
     1366}var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
     1367                "(?:[\\w*_-]|\\\\.)" :
     1368                "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
     1369        quickChild = new RegExp("^>\\s*(" + chars + "+)"),
     1370        quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
     1371        quickClass = new RegExp("^([#.]?)(" + chars + "*)");
     1372
     1373jQuery.extend({
     1374        expr: {
     1375                "": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
     1376                "#": function(a,i,m){return a.getAttribute("id")==m[2];},
     1377                ":": {
     1378                        // Position Checks
     1379                        lt: function(a,i,m){return i<m[3]-0;},
     1380                        gt: function(a,i,m){return i>m[3]-0;},
     1381                        nth: function(a,i,m){return m[3]-0==i;},
     1382                        eq: function(a,i,m){return m[3]-0==i;},
     1383                        first: function(a,i){return i==0;},
     1384                        last: function(a,i,m,r){return i==r.length-1;},
     1385                        even: function(a,i){return i%2==0;},
     1386                        odd: function(a,i){return i%2;},
     1387
     1388                        // Child Checks
     1389                        "first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
     1390                        "last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
     1391                        "only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
     1392
     1393                        // Parent Checks
     1394                        parent: function(a){return a.firstChild;},
     1395                        empty: function(a){return !a.firstChild;},
     1396
     1397                        // Text Check
     1398                        contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},
     1399
     1400                        // Visibility
     1401                        visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
     1402                        hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
     1403
     1404                        // Form attributes
     1405                        enabled: function(a){return !a.disabled;},
     1406                        disabled: function(a){return a.disabled;},
     1407                        checked: function(a){return a.checked;},
     1408                        selected: function(a){return a.selected||jQuery.attr(a,"selected");},
     1409
     1410                        // Form elements
     1411                        text: function(a){return "text"==a.type;},
     1412                        radio: function(a){return "radio"==a.type;},
     1413                        checkbox: function(a){return "checkbox"==a.type;},
     1414                        file: function(a){return "file"==a.type;},
     1415                        password: function(a){return "password"==a.type;},
     1416                        submit: function(a){return "submit"==a.type;},
     1417                        image: function(a){return "image"==a.type;},
     1418                        reset: function(a){return "reset"==a.type;},
     1419                        button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
     1420                        input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
     1421
     1422                        // :has()
     1423                        has: function(a,i,m){return jQuery.find(m[3],a).length;},
     1424
     1425                        // :header
     1426                        header: function(a){return /h\d/i.test(a.nodeName);},
     1427
     1428                        // :animated
     1429                        animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
     1430                }
     1431        },
     1432
     1433        // The regular expressions that power the parsing engine
     1434        parse: [
     1435                // Match: [@value='test'], [@foo]
     1436                /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
     1437
     1438                // Match: :contains('foo')
     1439                /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
     1440
     1441                // Match: :even, :last-child, #id, .class
     1442                new RegExp("^([:.#]*)(" + chars + "+)")
     1443        ],
     1444
     1445        multiFilter: function( expr, elems, not ) {
     1446                var old, cur = [];
     1447
     1448                while ( expr && expr != old ) {
     1449                        old = expr;
     1450                        var f = jQuery.filter( expr, elems, not );
     1451                        expr = f.t.replace(/^\s*,\s*/, "" );
     1452                        cur = not ? elems = f.r : jQuery.merge( cur, f.r );
     1453                }
     1454
     1455                return cur;
     1456        },
     1457
     1458        find: function( t, context ) {
     1459                // Quickly handle non-string expressions
     1460                if ( typeof t != "string" )
     1461                        return [ t ];
     1462
     1463                // check to make sure context is a DOM element or a document
     1464                if ( context && context.nodeType != 1 && context.nodeType != 9)
     1465                        return [ ];
     1466
     1467                // Set the correct context (if none is provided)
     1468                context = context || document;
     1469
     1470                // Initialize the search
     1471                var ret = [context], done = [], last, nodeName;
     1472
     1473                // Continue while a selector expression exists, and while
     1474                // we're no longer looping upon ourselves
     1475                while ( t && last != t ) {
     1476                        var r = [];
     1477                        last = t;
     1478
     1479                        t = jQuery.trim(t);
     1480
     1481                        var foundToken = false,
     1482
     1483                        // An attempt at speeding up child selectors that
     1484                        // point to a specific element tag
     1485                                re = quickChild,
     1486
     1487                                m = re.exec(t);
     1488
     1489                        if ( m ) {
     1490                                nodeName = m[1].toUpperCase();
     1491
     1492                                // Perform our own iteration and filter
     1493                                for ( var i = 0; ret[i]; i++ )
     1494                                        for ( var c = ret[i].firstChild; c; c = c.nextSibling )
     1495                                                if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
     1496                                                        r.push( c );
     1497
     1498                                ret = r;
     1499                                t = t.replace( re, "" );
     1500                                if ( t.indexOf(" ") == 0 ) continue;
     1501                                foundToken = true;
     1502                        } else {
     1503                                re = /^([>+~])\s*(\w*)/i;
     1504
     1505                                if ( (m = re.exec(t)) != null ) {
     1506                                        r = [];
     1507
     1508                                        var merge = {};
     1509                                        nodeName = m[2].toUpperCase();
     1510                                        m = m[1];
     1511
     1512                                        for ( var j = 0, rl = ret.length; j < rl; j++ ) {
     1513                                                var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
     1514                                                for ( ; n; n = n.nextSibling )
     1515                                                        if ( n.nodeType == 1 ) {
     1516                                                                var id = jQuery.data(n);
     1517
     1518                                                                if ( m == "~" && merge[id] ) break;
     1519
     1520                                                                if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
     1521                                                                        if ( m == "~" ) merge[id] = true;
     1522                                                                        r.push( n );
     1523                                                                }
     1524
     1525                                                                if ( m == "+" ) break;
     1526                                                        }
     1527                                        }
     1528
     1529                                        ret = r;
     1530
     1531                                        // And remove the token
     1532                                        t = jQuery.trim( t.replace( re, "" ) );
     1533                                        foundToken = true;
     1534                                }
     1535                        }
     1536
     1537                        // See if there's still an expression, and that we haven't already
     1538                        // matched a token
     1539                        if ( t && !foundToken ) {
     1540                                // Handle multiple expressions
     1541                                if ( !t.indexOf(",") ) {
     1542                                        // Clean the result set
     1543                                        if ( context == ret[0] ) ret.shift();
     1544
     1545                                        // Merge the result sets
     1546                                        done = jQuery.merge( done, ret );
     1547
     1548                                        // Reset the context
     1549                                        r = ret = [context];
     1550
     1551                                        // Touch up the selector string
     1552                                        t = " " + t.substr(1,t.length);
     1553
     1554                                } else {
     1555                                        // Optimize for the case nodeName#idName
     1556                                        var re2 = quickID;
     1557                                        var m = re2.exec(t);
     1558
     1559                                        // Re-organize the results, so that they're consistent
     1560                                        if ( m ) {
     1561                                                m = [ 0, m[2], m[3], m[1] ];
     1562
     1563                                        } else {
     1564                                                // Otherwise, do a traditional filter check for
     1565                                                // ID, class, and element selectors
     1566                                                re2 = quickClass;
     1567                                                m = re2.exec(t);
     1568                                        }
     1569
     1570                                        m[2] = m[2].replace(/\\/g, "");
     1571
     1572                                        var elem = ret[ret.length-1];
     1573
     1574                                        // Try to do a global search by ID, where we can
     1575                                        if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
     1576                                                // Optimization for HTML document case
     1577                                                var oid = elem.getElementById(m[2]);
     1578
     1579                                                // Do a quick check for the existence of the actual ID attribute
     1580                                                // to avoid selecting by the name attribute in IE
     1581                                                // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
     1582                                                if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
     1583                                                        oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
     1584
     1585                                                // Do a quick check for node name (where applicable) so
     1586                                                // that div#foo searches will be really fast
     1587                                                ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
     1588                                        } else {
     1589                                                // We need to find all descendant elements
     1590                                                for ( var i = 0; ret[i]; i++ ) {
     1591                                                        // Grab the tag name being searched for
     1592                                                        var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
     1593
     1594                                                        // Handle IE7 being really dumb about <object>s
     1595                                                        if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
     1596                                                                tag = "param";
     1597
     1598                                                        r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
     1599                                                }
     1600
     1601                                                // It's faster to filter by class and be done with it
     1602                                                if ( m[1] == "." )
     1603                                                        r = jQuery.classFilter( r, m[2] );
     1604
     1605                                                // Same with ID filtering
     1606                                                if ( m[1] == "#" ) {
     1607                                                        var tmp = [];
     1608
     1609                                                        // Try to find the element with the ID
     1610                                                        for ( var i = 0; r[i]; i++ )
     1611                                                                if ( r[i].getAttribute("id") == m[2] ) {
     1612                                                                        tmp = [ r[i] ];
     1613                                                                        break;
     1614                                                                }
     1615
     1616                                                        r = tmp;
     1617                                                }
     1618
     1619                                                ret = r;
     1620                                        }
     1621
     1622                                        t = t.replace( re2, "" );
     1623                                }
     1624
     1625                        }
     1626
     1627                        // If a selector string still exists
     1628                        if ( t ) {
     1629                                // Attempt to filter it
     1630                                var val = jQuery.filter(t,r);
     1631                                ret = r = val.r;
     1632                                t = jQuery.trim(val.t);
     1633                        }
     1634                }
     1635
     1636                // An error occurred with the selector;
     1637                // just return an empty set instead
     1638                if ( t )
     1639                        ret = [];
     1640
     1641                // Remove the root context
     1642                if ( ret && context == ret[0] )
     1643                        ret.shift();
     1644
     1645                // And combine the results
     1646                done = jQuery.merge( done, ret );
     1647
     1648                return done;
     1649        },
     1650
     1651        classFilter: function(r,m,not){
     1652                m = " " + m + " ";
     1653                var tmp = [];
     1654                for ( var i = 0; r[i]; i++ ) {
     1655                        var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
     1656                        if ( !not && pass || not && !pass )
     1657                                tmp.push( r[i] );
     1658                }
     1659                return tmp;
     1660        },
     1661
     1662        filter: function(t,r,not) {
     1663                var last;
     1664
     1665                // Look for common filter expressions
     1666                while ( t && t != last ) {
     1667                        last = t;
     1668
     1669                        var p = jQuery.parse, m;
     1670
     1671                        for ( var i = 0; p[i]; i++ ) {
     1672                                m = p[i].exec( t );
     1673
     1674                                if ( m ) {
     1675                                        // Remove what we just matched
     1676                                        t = t.substring( m[0].length );
     1677
     1678                                        m[2] = m[2].replace(/\\/g, "");
     1679                                        break;
     1680                                }
     1681                        }
     1682
     1683                        if ( !m )
     1684                                break;
     1685
     1686                        // :not() is a special case that can be optimized by
     1687                        // keeping it out of the expression list
     1688                        if ( m[1] == ":" && m[2] == "not" )
     1689                                // optimize if only one selector found (most common case)
     1690                                r = isSimple.test( m[3] ) ?
     1691                                        jQuery.filter(m[3], r, true).r :
     1692                                        jQuery( r ).not( m[3] );
     1693
     1694                        // We can get a big speed boost by filtering by class here
     1695                        else if ( m[1] == "." )
     1696                                r = jQuery.classFilter(r, m[2], not);
     1697
     1698                        else if ( m[1] == "[" ) {
     1699                                var tmp = [], type = m[3];
     1700
     1701                                for ( var i = 0, rl = r.length; i < rl; i++ ) {
     1702                                        var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
     1703
     1704                                        if ( z == null || /href|src|selected/.test(m[2]) )
     1705                                                z = jQuery.attr(a,m[2]) || '';
     1706
     1707                                        if ( (type == "" && !!z ||
     1708                                                 type == "=" && z == m[5] ||
     1709                                                 type == "!=" && z != m[5] ||
     1710                                                 type == "^=" && z && !z.indexOf(m[5]) ||
     1711                                                 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
     1712                                                 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
     1713                                                        tmp.push( a );
     1714                                }
     1715
     1716                                r = tmp;
     1717
     1718                        // We can get a speed boost by handling nth-child here
     1719                        } else if ( m[1] == ":" && m[2] == "nth-child" ) {
     1720                                var merge = {}, tmp = [],
     1721                                        // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
     1722                                        test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
     1723                                                m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
     1724                                                !/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
     1725                                        // calculate the numbers (first)n+(last) including if they are negative
     1726                                        first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
     1727
     1728                                // loop through all the elements left in the jQuery object
     1729                                for ( var i = 0, rl = r.length; i < rl; i++ ) {
     1730                                        var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
     1731
     1732                                        if ( !merge[id] ) {
     1733                                                var c = 1;
     1734
     1735                                                for ( var n = parentNode.firstChild; n; n = n.nextSibling )
     1736                                                        if ( n.nodeType == 1 )
     1737                                                                n.nodeIndex = c++;
     1738
     1739                                                merge[id] = true;
     1740                                        }
     1741
     1742                                        var add = false;
     1743
     1744                                        if ( first == 0 ) {
     1745                                                if ( node.nodeIndex == last )
     1746                                                        add = true;
     1747                                        } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
     1748                                                add = true;
     1749
     1750                                        if ( add ^ not )
     1751                                                tmp.push( node );
     1752                                }
     1753
     1754                                r = tmp;
     1755
     1756                        // Otherwise, find the expression to execute
     1757                        } else {
     1758                                var fn = jQuery.expr[ m[1] ];
     1759                                if ( typeof fn == "object" )
     1760                                        fn = fn[ m[2] ];
     1761
     1762                                if ( typeof fn == "string" )
     1763                                        fn = eval("false||function(a,i){return " + fn + ";}");
     1764
     1765                                // Execute it against the current filter
     1766                                r = jQuery.grep( r, function(elem, i){
     1767                                        return fn(elem, i, m, r);
     1768                                }, not );
     1769                        }
     1770                }
     1771
     1772                // Return an array of filtered elements (r)
     1773                // and the modified expression string (t)
     1774                return { r: r, t: t };
     1775        },
     1776
     1777        dir: function( elem, dir ){
     1778                var matched = [],
     1779                        cur = elem[dir];
     1780                while ( cur && cur != document ) {
     1781                        if ( cur.nodeType == 1 )
     1782                                matched.push( cur );
     1783                        cur = cur[dir];
     1784                }
     1785                return matched;
     1786        },
     1787
     1788        nth: function(cur,result,dir,elem){
     1789                result = result || 1;
     1790                var num = 0;
     1791
     1792                for ( ; cur; cur = cur[dir] )
     1793                        if ( cur.nodeType == 1 && ++num == result )
     1794                                break;
     1795
     1796                return cur;
     1797        },
     1798
     1799        sibling: function( n, elem ) {
     1800                var r = [];
     1801
     1802                for ( ; n; n = n.nextSibling ) {
     1803                        if ( n.nodeType == 1 && n != elem )
     1804                                r.push( n );
     1805                }
     1806
     1807                return r;
     1808        }
     1809});
     1810/*
     1811 * A number of helper functions used for managing events.
     1812 * Many of the ideas behind this code orignated from
     1813 * Dean Edwards' addEvent library.
     1814 */
     1815jQuery.event = {
     1816
     1817        // Bind an event to an element
     1818        // Original by Dean Edwards
     1819        add: function(elem, types, handler, data) {
     1820                if ( elem.nodeType == 3 || elem.nodeType == 8 )
     1821                        return;
     1822
     1823                // For whatever reason, IE has trouble passing the window object
     1824                // around, causing it to be cloned in the process
     1825                if ( jQuery.browser.msie && elem.setInterval )
     1826                        elem = window;
     1827
     1828                // Make sure that the function being executed has a unique ID
     1829                if ( !handler.guid )
     1830                        handler.guid = this.guid++;
     1831
     1832                // if data is passed, bind to handler
     1833                if( data != undefined ) {
     1834                        // Create temporary function pointer to original handler
     1835                        var fn = handler;
     1836
     1837                        // Create unique handler function, wrapped around original handler
     1838                        handler = this.proxy( fn, function() {
     1839                                // Pass arguments and context to original handler
     1840                                return fn.apply(this, arguments);
     1841                        });
     1842
     1843                        // Store data in unique handler
     1844                        handler.data = data;
     1845                }
     1846
     1847                // Init the element's event structure
     1848                var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
     1849                        handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
     1850                                // Handle the second event of a trigger and when
     1851                                // an event is called after a page has unloaded
     1852                                if ( typeof jQuery != "undefined" && !jQuery.event.triggered )
     1853                                        return jQuery.event.handle.apply(arguments.callee.elem, arguments);
     1854                        });
     1855                // Add elem as a property of the handle function
     1856                // This is to prevent a memory leak with non-native
     1857                // event in IE.
     1858                handle.elem = elem;
     1859
     1860                // Handle multiple events separated by a space
     1861                // jQuery(...).bind("mouseover mouseout", fn);
     1862                jQuery.each(types.split(/\s+/), function(index, type) {
     1863                        // Namespaced event handlers
     1864                        var parts = type.split(".");
     1865                        type = parts[0];
     1866                        handler.type = parts[1];
     1867
     1868                        // Get the current list of functions bound to this event
     1869                        var handlers = events[type];
     1870
     1871                        // Init the event handler queue
     1872                        if (!handlers) {
     1873                                handlers = events[type] = {};
     1874
     1875                                // Check for a special event handler
     1876                                // Only use addEventListener/attachEvent if the special
     1877                                // events handler returns false
     1878                                if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) {
     1879                                        // Bind the global event handler to the element
     1880                                        if (elem.addEventListener)
     1881                                                elem.addEventListener(type, handle, false);
     1882                                        else if (elem.attachEvent)
     1883                                                elem.attachEvent("on" + type, handle);
     1884                                }
     1885                        }
     1886
     1887                        // Add the function to the element's handler list
     1888                        handlers[handler.guid] = handler;
     1889
     1890                        // Keep track of which events have been used, for global triggering
     1891                        jQuery.event.global[type] = true;
     1892                });
     1893
     1894                // Nullify elem to prevent memory leaks in IE
     1895                elem = null;
     1896        },
     1897
     1898        guid: 1,
     1899        global: {},
     1900
     1901        // Detach an event or set of events from an element
     1902        remove: function(elem, types, handler) {
     1903                // don't do events on text and comment nodes
     1904                if ( elem.nodeType == 3 || elem.nodeType == 8 )
     1905                        return;
     1906
     1907                var events = jQuery.data(elem, "events"), ret, index;
     1908
     1909                if ( events ) {
     1910                        // Unbind all events for the element
     1911                        if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") )
     1912                                for ( var type in events )
     1913                                        this.remove( elem, type + (types || "") );
     1914                        else {
     1915                                // types is actually an event object here
     1916                                if ( types.type ) {
     1917                                        handler = types.handler;
     1918                                        types = types.type;
     1919                                }
     1920
     1921                                // Handle multiple events seperated by a space
     1922                                // jQuery(...).unbind("mouseover mouseout", fn);
     1923                                jQuery.each(types.split(/\s+/), function(index, type){
     1924                                        // Namespaced event handlers
     1925                                        var parts = type.split(".");
     1926                                        type = parts[0];
     1927
     1928                                        if ( events[type] ) {
     1929                                                // remove the given handler for the given type
     1930                                                if ( handler )
     1931                                                        delete events[type][handler.guid];
     1932
     1933                                                // remove all handlers for the given type
     1934                                                else
     1935                                                        for ( handler in events[type] )
     1936                                                                // Handle the removal of namespaced events
     1937                                                                if ( !parts[1] || events[type][handler].type == parts[1] )
     1938                                                                        delete events[type][handler];
     1939
     1940                                                // remove generic event handler if no more handlers exist
     1941                                                for ( ret in events[type] ) break;
     1942                                                if ( !ret ) {
     1943                                                        if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
     1944                                                                if (elem.removeEventListener)
     1945                                                                        elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
     1946                                                                else if (elem.detachEvent)
     1947                                                                        elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
     1948                                                        }
     1949                                                        ret = null;
     1950                                                        delete events[type];
     1951                                                }
     1952                                        }
     1953                                });
     1954                        }
     1955
     1956                        // Remove the expando if it's no longer used
     1957                        for ( ret in events ) break;
     1958                        if ( !ret ) {
     1959                                var handle = jQuery.data( elem, "handle" );
     1960                                if ( handle ) handle.elem = null;
     1961                                jQuery.removeData( elem, "events" );
     1962                                jQuery.removeData( elem, "handle" );
     1963                        }
     1964                }
     1965        },
     1966
     1967        trigger: function(type, data, elem, donative, extra) {
     1968                // Clone the incoming data, if any
     1969                data = jQuery.makeArray(data);
     1970
     1971                if ( type.indexOf("!") >= 0 ) {
     1972                        type = type.slice(0, -1);
     1973                        var exclusive = true;
     1974                }
     1975
     1976                // Handle a global trigger
     1977                if ( !elem ) {
     1978                        // Only trigger if we've ever bound an event for it
     1979                        if ( this.global[type] )
     1980                                jQuery("*").add([window, document]).trigger(type, data);
     1981
     1982                // Handle triggering a single element
     1983                } else {
     1984                        // don't do events on text and comment nodes
     1985                        if ( elem.nodeType == 3 || elem.nodeType == 8 )
     1986                                return undefined;
     1987
     1988                        var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
     1989                                // Check to see if we need to provide a fake event, or not
     1990                                event = !data[0] || !data[0].preventDefault;
     1991
     1992                        // Pass along a fake event
     1993                        if ( event ) {
     1994                                data.unshift({
     1995                                        type: type,
     1996                                        target: elem,
     1997                                        preventDefault: function(){},
     1998                                        stopPropagation: function(){},
     1999                                        timeStamp: now()
     2000                                });
     2001                                data[0][expando] = true; // no need to fix fake event
     2002                        }
     2003
     2004                        // Enforce the right trigger type
     2005                        data[0].type = type;
     2006                        if ( exclusive )
     2007                                data[0].exclusive = true;
     2008
     2009                        // Trigger the event, it is assumed that "handle" is a function
     2010                        var handle = jQuery.data(elem, "handle");
     2011                        if ( handle )
     2012                                val = handle.apply( elem, data );
     2013
     2014                        // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
     2015                        if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
     2016                                val = false;
     2017
     2018                        // Extra functions don't get the custom event object
     2019                        if ( event )
     2020                                data.shift();
     2021
     2022                        // Handle triggering of extra function
     2023                        if ( extra && jQuery.isFunction( extra ) ) {
     2024                                // call the extra function and tack the current return value on the end for possible inspection
     2025                                ret = extra.apply( elem, val == null ? data : data.concat( val ) );
     2026                                // if anything is returned, give it precedence and have it overwrite the previous value
     2027                                if (ret !== undefined)
     2028                                        val = ret;
     2029                        }
     2030
     2031                        // Trigger the native events (except for clicks on links)
     2032                        if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
     2033                                this.triggered = true;
     2034                                try {
     2035                                        elem[ type ]();
     2036                                // prevent IE from throwing an error for some hidden elements
     2037                                } catch (e) {}
     2038                        }
     2039
     2040                        this.triggered = false;
     2041                }
     2042
     2043                return val;
     2044        },
     2045
     2046        handle: function(event) {
     2047                // returned undefined or false
     2048                var val, ret, namespace, all, handlers;
     2049
     2050                event = arguments[0] = jQuery.event.fix( event || window.event );
     2051
     2052                // Namespaced event handlers
     2053                namespace = event.type.split(".");
     2054                event.type = namespace[0];
     2055                namespace = namespace[1];
     2056                // Cache this now, all = true means, any handler
     2057                all = !namespace && !event.exclusive;
     2058
     2059                handlers = ( jQuery.data(this, "events") || {} )[event.type];
     2060
     2061                for ( var j in handlers ) {
     2062                        var handler = handlers[j];
     2063
     2064                        // Filter the functions by class
     2065                        if ( all || handler.type == namespace ) {
     2066                                // Pass in a reference to the handler function itself
     2067                                // So that we can later remove it
     2068                                event.handler = handler;
     2069                                event.data = handler.data;
     2070
     2071                                ret = handler.apply( this, arguments );
     2072
     2073                                if ( val !== false )
     2074                                        val = ret;
     2075
     2076                                if ( ret === false ) {
     2077                                        event.preventDefault();
     2078                                        event.stopPropagation();
     2079                                }
     2080                        }
     2081                }
     2082
     2083                return val;
     2084        },
     2085
     2086        fix: function(event) {
     2087                if ( event[expando] == true )
     2088                        return event;
     2089
     2090                // store a copy of the original event object
     2091                // and "clone" to set read-only properties
     2092                var originalEvent = event;
     2093                event = { originalEvent: originalEvent };
     2094                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(" ");
     2095                for ( var i=props.length; i; i-- )
     2096                        event[ props[i] ] = originalEvent[ props[i] ];
     2097
     2098                // Mark it as fixed
     2099                event[expando] = true;
     2100
     2101                // add preventDefault and stopPropagation since
     2102                // they will not work on the clone
     2103                event.preventDefault = function() {
     2104                        // if preventDefault exists run it on the original event
     2105                        if (originalEvent.preventDefault)
     2106                                originalEvent.preventDefault();
     2107                        // otherwise set the returnValue property of the original event to false (IE)
     2108                        originalEvent.returnValue = false;
     2109                };
     2110                event.stopPropagation = function() {
     2111                        // if stopPropagation exists run it on the original event
     2112                        if (originalEvent.stopPropagation)
     2113                                originalEvent.stopPropagation();
     2114                        // otherwise set the cancelBubble property of the original event to true (IE)
     2115                        originalEvent.cancelBubble = true;
     2116                };
     2117
     2118                // Fix timeStamp
     2119                event.timeStamp = event.timeStamp || now();
     2120
     2121                // Fix target property, if necessary
     2122                if ( !event.target )
     2123                        event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
     2124
     2125                // check if target is a textnode (safari)
     2126                if ( event.target.nodeType == 3 )
     2127                        event.target = event.target.parentNode;
     2128
     2129                // Add relatedTarget, if necessary
     2130                if ( !event.relatedTarget && event.fromElement )
     2131                        event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
     2132
     2133                // Calculate pageX/Y if missing and clientX/Y available
     2134                if ( event.pageX == null && event.clientX != null ) {
     2135                        var doc = document.documentElement, body = document.body;
     2136                        event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
     2137                        event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
     2138                }
     2139
     2140                // Add which for key events
     2141                if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
     2142                        event.which = event.charCode || event.keyCode;
     2143
     2144                // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
     2145                if ( !event.metaKey && event.ctrlKey )
     2146                        event.metaKey = event.ctrlKey;
     2147
     2148                // Add which for click: 1 == left; 2 == middle; 3 == right
     2149                // Note: button is not normalized, so don't use it
     2150                if ( !event.which && event.button )
     2151                        event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
     2152
     2153                return event;
     2154        },
     2155
     2156        proxy: function( fn, proxy ){
     2157                // Set the guid of unique handler to the same of original handler, so it can be removed
     2158                proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
     2159                // So proxy can be declared as an argument
     2160                return proxy;
     2161        },
     2162
     2163        special: {
     2164                ready: {
     2165                        setup: function() {
     2166                                // Make sure the ready event is setup
     2167                                bindReady();
     2168                                return;
     2169                        },
     2170
     2171                        teardown: function() { return; }
     2172                },
     2173
     2174                mouseenter: {
     2175                        setup: function() {
     2176                                if ( jQuery.browser.msie ) return false;
     2177                                jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
     2178                                return true;
     2179                        },
     2180
     2181                        teardown: function() {
     2182                                if ( jQuery.browser.msie ) return false;
     2183                                jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
     2184                                return true;
     2185                        },
     2186
     2187                        handler: function(event) {
     2188                                // If we actually just moused on to a sub-element, ignore it
     2189                                if ( withinElement(event, this) ) return true;
     2190                                // Execute the right handlers by setting the event type to mouseenter
     2191                                event.type = "mouseenter";
     2192                                return jQuery.event.handle.apply(this, arguments);
     2193                        }
     2194                },
     2195
     2196                mouseleave: {
     2197                        setup: function() {
     2198                                if ( jQuery.browser.msie ) return false;
     2199                                jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
     2200                                return true;
     2201                        },
     2202
     2203                        teardown: function() {
     2204                                if ( jQuery.browser.msie ) return false;
     2205                                jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
     2206                                return true;
     2207                        },
     2208
     2209                        handler: function(event) {
     2210                                // If we actually just moused on to a sub-element, ignore it
     2211                                if ( withinElement(event, this) ) return true;
     2212                                // Execute the right handlers by setting the event type to mouseleave
     2213                                event.type = "mouseleave";
     2214                                return jQuery.event.handle.apply(this, arguments);
     2215                        }
     2216                }
     2217        }
     2218};
     2219
     2220jQuery.fn.extend({
     2221        bind: function( type, data, fn ) {
     2222                return type == "unload" ? this.one(type, data, fn) : this.each(function(){
     2223                        jQuery.event.add( this, type, fn || data, fn && data );
     2224                });
     2225        },
     2226
     2227        one: function( type, data, fn ) {
     2228                var one = jQuery.event.proxy( fn || data, function(event) {
     2229                        jQuery(this).unbind(event, one);
     2230                        return (fn || data).apply( this, arguments );
     2231                });
     2232                return this.each(function(){
     2233                        jQuery.event.add( this, type, one, fn && data);
     2234                });
     2235        },
     2236
     2237        unbind: function( type, fn ) {
     2238                return this.each(function(){
     2239                        jQuery.event.remove( this, type, fn );
     2240                });
     2241        },
     2242
     2243        trigger: function( type, data, fn ) {
     2244                return this.each(function(){
     2245                        jQuery.event.trigger( type, data, this, true, fn );
     2246                });
     2247        },
     2248
     2249        triggerHandler: function( type, data, fn ) {
     2250                return this[0] && jQuery.event.trigger( type, data, this[0], false, fn );
     2251        },
     2252
     2253        toggle: function( fn ) {
     2254                // Save reference to arguments for access in closure
     2255                var args = arguments, i = 1;
     2256
     2257                // link all the functions, so any of them can unbind this click handler
     2258                while( i < args.length )
     2259                        jQuery.event.proxy( fn, args[i++] );
     2260
     2261                return this.click( jQuery.event.proxy( fn, function(event) {
     2262                        // Figure out which function to execute
     2263                        this.lastToggle = ( this.lastToggle || 0 ) % i;
     2264
     2265                        // Make sure that clicks stop
     2266                        event.preventDefault();
     2267
     2268                        // and execute the function
     2269                        return args[ this.lastToggle++ ].apply( this, arguments ) || false;
     2270                }));
     2271        },
     2272
     2273        hover: function(fnOver, fnOut) {
     2274                return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
     2275        },
     2276
     2277        ready: function(fn) {
     2278                // Attach the listeners
     2279                bindReady();
     2280
     2281                // If the DOM is already ready
     2282                if ( jQuery.isReady )
     2283                        // Execute the function immediately
     2284                        fn.call( document, jQuery );
     2285
     2286                // Otherwise, remember the function for later
     2287                else
     2288                        // Add the function to the wait list
     2289                        jQuery.readyList.push( function() { return fn.call(this, jQuery); } );
     2290
     2291                return this;
     2292        }
     2293});
     2294
     2295jQuery.extend({
     2296        isReady: false,
     2297        readyList: [],
     2298        // Handle when the DOM is ready
     2299        ready: function() {
     2300                // Make sure that the DOM is not already loaded
     2301                if ( !jQuery.isReady ) {
     2302                        // Remember that the DOM is ready
     2303                        jQuery.isReady = true;
     2304
     2305                        // If there are functions bound, to execute
     2306                        if ( jQuery.readyList ) {
     2307                                // Execute all of them
     2308                                jQuery.each( jQuery.readyList, function(){
     2309                                        this.call( document );
     2310                                });
     2311
     2312                                // Reset the list of functions
     2313                                jQuery.readyList = null;
     2314                        }
     2315
     2316                        // Trigger any bound ready events
     2317                        jQuery(document).triggerHandler("ready");
     2318                }
     2319        }
     2320});
     2321
     2322var readyBound = false;
     2323
     2324function bindReady(){
     2325        if ( readyBound ) return;
     2326        readyBound = true;
     2327
     2328        // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
     2329        if ( document.addEventListener && !jQuery.browser.opera)
     2330                // Use the handy event callback
     2331                document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
     2332
     2333        // If IE is used and is not in a frame
     2334        // Continually check to see if the document is ready
     2335        if ( jQuery.browser.msie && window == top ) (function(){
     2336                if (jQuery.isReady) return;
     2337                try {
     2338                        // If IE is used, use the trick by Diego Perini
     2339                        // http://javascript.nwbox.com/IEContentLoaded/
     2340                        document.documentElement.doScroll("left");
     2341                } catch( error ) {
     2342                        setTimeout( arguments.callee, 0 );
     2343                        return;
     2344                }
     2345                // and execute any waiting functions
     2346                jQuery.ready();
     2347        })();
     2348
     2349        if ( jQuery.browser.opera )
     2350                document.addEventListener( "DOMContentLoaded", function () {
     2351                        if (jQuery.isReady) return;
     2352                        for (var i = 0; i < document.styleSheets.length; i++)
     2353                                if (document.styleSheets[i].disabled) {
     2354                                        setTimeout( arguments.callee, 0 );
     2355                                        return;
     2356                                }
     2357                        // and execute any waiting functions
     2358                        jQuery.ready();
     2359                }, false);
     2360
     2361        if ( jQuery.browser.safari ) {
     2362                var numStyles;
     2363                (function(){
     2364                        if (jQuery.isReady) return;
     2365                        if ( document.readyState != "loaded" && document.readyState != "complete" ) {
     2366                                setTimeout( arguments.callee, 0 );
     2367                                return;
     2368                        }
     2369                        if ( numStyles === undefined )
     2370                                numStyles = jQuery("style, link[rel=stylesheet]").length;
     2371                        if ( document.styleSheets.length != numStyles ) {
     2372                                setTimeout( arguments.callee, 0 );
     2373                                return;
     2374                        }
     2375                        // and execute any waiting functions
     2376                        jQuery.ready();
     2377                })();
     2378        }
     2379
     2380        // A fallback to window.onload, that will always work
     2381        jQuery.event.add( window, "load", jQuery.ready );
     2382}
     2383
     2384jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
     2385        "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
     2386        "submit,keydown,keypress,keyup,error").split(","), function(i, name){
     2387
     2388        // Handle event binding
     2389        jQuery.fn[name] = function(fn){
     2390                return fn ? this.bind(name, fn) : this.trigger(name);
     2391        };
     2392});
     2393
     2394// Checks if an event happened on an element within another element
     2395// Used in jQuery.event.special.mouseenter and mouseleave handlers
     2396var withinElement = function(event, elem) {
     2397        // Check if mouse(over|out) are still within the same parent element
     2398        var parent = event.relatedTarget;
     2399        // Traverse up the tree
     2400        while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
     2401        // Return true if we actually just moused on to a sub-element
     2402        return parent == elem;
     2403};
     2404
     2405// Prevent memory leaks in IE
     2406// And prevent errors on refresh with events like mouseover in other browsers
     2407// Window isn't included so as not to unbind existing unload events
     2408jQuery(window).bind("unload", function() {
     2409        jQuery("*").add(document).unbind();
     2410});
     2411jQuery.fn.extend({
     2412        // Keep a copy of the old load
     2413        _load: jQuery.fn.load,
     2414
     2415        load: function( url, params, callback ) {
     2416                if ( typeof url != 'string' )
     2417                        return this._load( url );
     2418
     2419                var off = url.indexOf(" ");
     2420                if ( off >= 0 ) {
     2421                        var selector = url.slice(off, url.length);
     2422                        url = url.slice(0, off);
     2423                }
     2424
     2425                callback = callback || function(){};
     2426
     2427                // Default to a GET request
     2428                var type = "GET";
     2429
     2430                // If the second parameter was provided
     2431                if ( params )
     2432                        // If it's a function
     2433                        if ( jQuery.isFunction( params ) ) {
     2434                                // We assume that it's the callback
     2435                                callback = params;
     2436                                params = null;
     2437
     2438                        // Otherwise, build a param string
     2439                        } else {
     2440                                params = jQuery.param( params );
     2441                                type = "POST";
     2442                        }
     2443
     2444                var self = this;
     2445
     2446                // Request the remote document
     2447                jQuery.ajax({
     2448                        url: url,
     2449                        type: type,
     2450                        dataType: "html",
     2451                        data: params,
     2452                        complete: function(res, status){
     2453                                // If successful, inject the HTML into all the matched elements
     2454                                if ( status == "success" || status == "notmodified" )
     2455                                        // See if a selector was specified
     2456                                        self.html( selector ?
     2457                                                // Create a dummy div to hold the results
     2458                                                jQuery("<div/>")
     2459                                                        // inject the contents of the document in, removing the scripts
     2460                                                        // to avoid any 'Permission Denied' errors in IE
     2461                                                        .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
     2462
     2463                                                        // Locate the specified elements
     2464                                                        .find(selector) :
     2465
     2466                                                // If not, just inject the full result
     2467                                                res.responseText );
     2468
     2469                                self.each( callback, [res.responseText, status, res] );
     2470                        }
     2471                });
     2472                return this;
     2473        },
     2474
     2475        serialize: function() {
     2476                return jQuery.param(this.serializeArray());
     2477        },
     2478        serializeArray: function() {
     2479                return this.map(function(){
     2480                        return jQuery.nodeName(this, "form") ?
     2481                                jQuery.makeArray(this.elements) : this;
     2482                })
     2483                .filter(function(){
     2484                        return this.name && !this.disabled &&
     2485                                (this.checked || /select|textarea/i.test(this.nodeName) ||
     2486                                        /text|hidden|password/i.test(this.type));
     2487                })
     2488                .map(function(i, elem){
     2489                        var val = jQuery(this).val();
     2490                        return val == null ? null :
     2491                                val.constructor == Array ?
     2492                                        jQuery.map( val, function(val, i){
     2493                                                return {name: elem.name, value: val};
     2494                                        }) :
     2495                                        {name: elem.name, value: val};
     2496                }).get();
     2497        }
     2498});
     2499
     2500// Attach a bunch of functions for handling common AJAX events
     2501jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
     2502        jQuery.fn[o] = function(f){
     2503                return this.bind(o, f);
     2504        };
     2505});
     2506
     2507var jsc = now();
     2508
     2509jQuery.extend({
     2510        get: function( url, data, callback, type ) {
     2511                // shift arguments if data argument was ommited
     2512                if ( jQuery.isFunction( data ) ) {
     2513                        callback = data;
     2514                        data = null;
     2515                }
     2516
     2517                return jQuery.ajax({
     2518                        type: "GET",
     2519                        url: url,
     2520                        data: data,
     2521                        success: callback,
     2522                        dataType: type
     2523                });
     2524        },
     2525
     2526        getScript: function( url, callback ) {
     2527                return jQuery.get(url, null, callback, "script");
     2528        },
     2529
     2530        getJSON: function( url, data, callback ) {
     2531                return jQuery.get(url, data, callback, "json");
     2532        },
     2533
     2534        post: function( url, data, callback, type ) {
     2535                if ( jQuery.isFunction( data ) ) {
     2536                        callback = data;
     2537                        data = {};
     2538                }
     2539
     2540                return jQuery.ajax({
     2541                        type: "POST",
     2542                        url: url,
     2543                        data: data,
     2544                        success: callback,
     2545                        dataType: type
     2546                });
     2547        },
     2548
     2549        ajaxSetup: function( settings ) {
     2550                jQuery.extend( jQuery.ajaxSettings, settings );
     2551        },
     2552
     2553        ajaxSettings: {
     2554                url: location.href,
     2555                global: true,
     2556                type: "GET",
     2557                timeout: 0,
     2558                contentType: "application/x-www-form-urlencoded",
     2559                processData: true,
     2560                async: true,
     2561                data: null,
     2562                username: null,
     2563                password: null,
     2564                accepts: {
     2565                        xml: "application/xml, text/xml",
     2566                        html: "text/html",
     2567                        script: "text/javascript, application/javascript",
     2568                        json: "application/json, text/javascript",
     2569                        text: "text/plain",
     2570                        _default: "*/*"
     2571                }
     2572        },
     2573
     2574        // Last-Modified header cache for next request
     2575        lastModified: {},
     2576
     2577        ajax: function( s ) {
     2578                // Extend the settings, but re-extend 's' so that it can be
     2579                // checked again later (in the test suite, specifically)
     2580                s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
     2581
     2582                var jsonp, jsre = /=\?(&|$)/g, status, data,
     2583                        type = s.type.toUpperCase();
     2584
     2585                // convert data if not already a string
     2586                if ( s.data && s.processData && typeof s.data != "string" )
     2587                        s.data = jQuery.param(s.data);
     2588
     2589                // Handle JSONP Parameter Callbacks
     2590                if ( s.dataType == "jsonp" ) {
     2591                        if ( type == "GET" ) {
     2592                                if ( !s.url.match(jsre) )
     2593                                        s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
     2594                        } else if ( !s.data || !s.data.match(jsre) )
     2595                                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
     2596                        s.dataType = "json";
     2597                }
     2598
     2599                // Build temporary JSONP function
     2600                if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
     2601                        jsonp = "jsonp" + jsc++;
     2602
     2603                        // Replace the =? sequence both in the query string and the data
     2604                        if ( s.data )
     2605                                s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
     2606                        s.url = s.url.replace(jsre, "=" + jsonp + "$1");
     2607
     2608                        // We need to make sure
     2609                        // that a JSONP style response is executed properly
     2610                        s.dataType = "script";
     2611
     2612                        // Handle JSONP-style loading
     2613                        window[ jsonp ] = function(tmp){
     2614                                data = tmp;
     2615                                success();
     2616                                complete();
     2617                                // Garbage collect
     2618                                window[ jsonp ] = undefined;
     2619                                try{ delete window[ jsonp ]; } catch(e){}
     2620                                if ( head )
     2621                                        head.removeChild( script );
     2622                        };
     2623                }
     2624
     2625                if ( s.dataType == "script" && s.cache == null )
     2626                        s.cache = false;
     2627
     2628                if ( s.cache === false && type == "GET" ) {
     2629                        var ts = now();
     2630                        // try replacing _= if it is there
     2631                        var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
     2632                        // if nothing was replaced, add timestamp to the end
     2633                        s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
     2634                }
     2635
     2636                // If data is available, append data to url for get requests
     2637                if ( s.data && type == "GET" ) {
     2638                        s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
     2639
     2640                        // IE likes to send both get and post data, prevent this
     2641                        s.data = null;
     2642                }
     2643
     2644                // Watch for a new set of requests
     2645                if ( s.global && ! jQuery.active++ )
     2646                        jQuery.event.trigger( "ajaxStart" );
     2647
     2648                // Matches an absolute URL, and saves the domain
     2649                var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;
     2650
     2651                // If we're requesting a remote document
     2652                // and trying to load JSON or Script with a GET
     2653                if ( s.dataType == "script" && type == "GET"
     2654                                && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){
     2655                        var head = document.getElementsByTagName("head")[0];
     2656                        var script = document.createElement("script");
     2657                        script.src = s.url;
     2658                        if (s.scriptCharset)
     2659                                script.charset = s.scriptCharset;
     2660
     2661                        // Handle Script loading
     2662                        if ( !jsonp ) {
     2663                                var done = false;
     2664
     2665                                // Attach handlers for all browsers
     2666                                script.onload = script.onreadystatechange = function(){
     2667                                        if ( !done && (!this.readyState ||
     2668                                                        this.readyState == "loaded" || this.readyState == "complete") ) {
     2669                                                done = true;
     2670                                                success();
     2671                                                complete();
     2672                                                head.removeChild( script );
     2673                                        }
     2674                                };
     2675                        }
     2676
     2677                        head.appendChild(script);
     2678
     2679                        // We handle everything using the script element injection
     2680                        return undefined;
     2681                }
     2682
     2683                var requestDone = false;
     2684
     2685                // Create the request object; Microsoft failed to properly
     2686                // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
     2687                var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
     2688
     2689                // Open the socket
     2690                // Passing null username, generates a login popup on Opera (#2865)
     2691                if( s.username )
     2692                        xhr.open(type, s.url, s.async, s.username, s.password);
     2693                else
     2694                        xhr.open(type, s.url, s.async);
     2695
     2696                // Need an extra try/catch for cross domain requests in Firefox 3
     2697                try {
     2698                        // Set the correct header, if data is being sent
     2699                        if ( s.data )
     2700                                xhr.setRequestHeader("Content-Type", s.contentType);
     2701
     2702                        // Set the If-Modified-Since header, if ifModified mode.
     2703                        if ( s.ifModified )
     2704                                xhr.setRequestHeader("If-Modified-Since",
     2705                                        jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
     2706
     2707                        // Set header so the called script knows that it's an XMLHttpRequest
     2708                        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
     2709
     2710                        // Set the Accepts header for the server, depending on the dataType
     2711                        xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
     2712                                s.accepts[ s.dataType ] + ", */*" :
     2713                                s.accepts._default );
     2714                } catch(e){}
     2715
     2716                // Allow custom headers/mimetypes
     2717                if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
     2718                        // cleanup active request counter
     2719                        s.global && jQuery.active--;
     2720                        // close opended socket
     2721                        xhr.abort();
     2722                        return false;
     2723                }
     2724
     2725                if ( s.global )
     2726                        jQuery.event.trigger("ajaxSend", [xhr, s]);
     2727
     2728                // Wait for a response to come back
     2729                var onreadystatechange = function(isTimeout){
     2730                        // The transfer is complete and the data is available, or the request timed out
     2731                        if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
     2732                                requestDone = true;
     2733
     2734                                // clear poll interval
     2735                                if (ival) {
     2736                                        clearInterval(ival);
     2737                                        ival = null;
     2738                                }
     2739
     2740                                status = isTimeout == "timeout" && "timeout" ||
     2741                                        !jQuery.httpSuccess( xhr ) && "error" ||
     2742                                        s.ifModified && jQuery.httpNotModified( xhr, s.url ) && "notmodified" ||
     2743                                        "success";
     2744
     2745                                if ( status == "success" ) {
     2746                                        // Watch for, and catch, XML document parse errors
     2747                                        try {
     2748                                                // process the data (runs the xml through httpData regardless of callback)
     2749                                                data = jQuery.httpData( xhr, s.dataType, s.dataFilter );
     2750                                        } catch(e) {
     2751                                                status = "parsererror";
     2752                                        }
     2753                                }
     2754
     2755                                // Make sure that the request was successful or notmodified
     2756                                if ( status == "success" ) {
     2757                                        // Cache Last-Modified header, if ifModified mode.
     2758                                        var modRes;
     2759                                        try {
     2760                                                modRes = xhr.getResponseHeader("Last-Modified");
     2761                                        } catch(e) {} // swallow exception thrown by FF if header is not available
     2762
     2763                                        if ( s.ifModified && modRes )
     2764                                                jQuery.lastModified[s.url] = modRes;
     2765
     2766                                        // JSONP handles its own success callback
     2767                                        if ( !jsonp )
     2768                                                success();
     2769                                } else
     2770                                        jQuery.handleError(s, xhr, status);
     2771
     2772                                // Fire the complete handlers
     2773                                complete();
     2774
     2775                                // Stop memory leaks
     2776                                if ( s.async )
     2777                                        xhr = null;
     2778                        }
     2779                };
     2780
     2781                if ( s.async ) {
     2782                        // don't attach the handler to the request, just poll it instead
     2783                        var ival = setInterval(onreadystatechange, 13);
     2784
     2785                        // Timeout checker
     2786                        if ( s.timeout > 0 )
     2787                                setTimeout(function(){
     2788                                        // Check to see if the request is still happening
     2789                                        if ( xhr ) {
     2790                                                // Cancel the request
     2791                                                xhr.abort();
     2792
     2793                                                if( !requestDone )
     2794                                                        onreadystatechange( "timeout" );
     2795                                        }
     2796                                }, s.timeout);
     2797                }
     2798
     2799                // Send the data
     2800                try {
     2801                        xhr.send(s.data);
     2802                } catch(e) {
     2803                        jQuery.handleError(s, xhr, null, e);
     2804                }
     2805
     2806                // firefox 1.5 doesn't fire statechange for sync requests
     2807                if ( !s.async )
     2808                        onreadystatechange();
     2809
     2810                function success(){
     2811                        // If a local callback was specified, fire it and pass it the data
     2812                        if ( s.success )
     2813                                s.success( data, status );
     2814
     2815                        // Fire the global callback
     2816                        if ( s.global )
     2817                                jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
     2818                }
     2819
     2820                function complete(){
     2821                        // Process result
     2822                        if ( s.complete )
     2823                                s.complete(xhr, status);
     2824
     2825                        // The request was completed
     2826                        if ( s.global )
     2827                                jQuery.event.trigger( "ajaxComplete", [xhr, s] );
     2828
     2829                        // Handle the global AJAX counter
     2830                        if ( s.global && ! --jQuery.active )
     2831                                jQuery.event.trigger( "ajaxStop" );
     2832                }
     2833
     2834                // return XMLHttpRequest to allow aborting the request etc.
     2835                return xhr;
     2836        },
     2837
     2838        handleError: function( s, xhr, status, e ) {
     2839                // If a local callback was specified, fire it
     2840                if ( s.error ) s.error( xhr, status, e );
     2841
     2842                // Fire the global callback
     2843                if ( s.global )
     2844                        jQuery.event.trigger( "ajaxError", [xhr, s, e] );
     2845        },
     2846
     2847        // Counter for holding the number of active queries
     2848        active: 0,
     2849
     2850        // Determines if an XMLHttpRequest was successful or not
     2851        httpSuccess: function( xhr ) {
     2852                try {
     2853                        // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
     2854                        return !xhr.status && location.protocol == "file:" ||
     2855                                ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223 ||
     2856                                jQuery.browser.safari && xhr.status == undefined;
     2857                } catch(e){}
     2858                return false;
     2859        },
     2860
     2861        // Determines if an XMLHttpRequest returns NotModified
     2862        httpNotModified: function( xhr, url ) {
     2863                try {
     2864                        var xhrRes = xhr.getResponseHeader("Last-Modified");
     2865
     2866                        // Firefox always returns 200. check Last-Modified date
     2867                        return xhr.status == 304 || xhrRes == jQuery.lastModified[url] ||
     2868                                jQuery.browser.safari && xhr.status == undefined;
     2869                } catch(e){}
     2870                return false;
     2871        },
     2872
     2873        httpData: function( xhr, type, filter ) {
     2874                var ct = xhr.getResponseHeader("content-type"),
     2875                        xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
     2876                        data = xml ? xhr.responseXML : xhr.responseText;
     2877
     2878                if ( xml && data.documentElement.tagName == "parsererror" )
     2879                        throw "parsererror";
     2880                       
     2881                // Allow a pre-filtering function to sanitize the response
     2882                if( filter )
     2883                        data = filter( data, type );
     2884
     2885                // If the type is "script", eval it in global context
     2886                if ( type == "script" )
     2887                        jQuery.globalEval( data );
     2888
     2889                // Get the JavaScript object, if JSON is used.
     2890                if ( type == "json" )
     2891                        data = eval("(" + data + ")");
     2892
     2893                return data;
     2894        },
     2895
     2896        // Serialize an array of form elements or a set of
     2897        // key/values into a query string
     2898        param: function( a ) {
     2899                var s = [];
     2900
     2901                // If an array was passed in, assume that it is an array
     2902                // of form elements
     2903                if ( a.constructor == Array || a.jquery )
     2904                        // Serialize the form elements
     2905                        jQuery.each( a, function(){
     2906                                s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
     2907                        });
     2908
     2909                // Otherwise, assume that it's an object of key/value pairs
     2910                else
     2911                        // Serialize the key/values
     2912                        for ( var j in a )
     2913                                // If the value is an array then the key names need to be repeated
     2914                                if ( a[j] && a[j].constructor == Array )
     2915                                        jQuery.each( a[j], function(){
     2916                                                s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
     2917                                        });
     2918                                else
     2919                                        s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) );
     2920
     2921                // Return the resulting serialization
     2922                return s.join("&").replace(/%20/g, "+");
     2923        }
     2924
     2925});
     2926jQuery.fn.extend({
     2927        show: function(speed,callback){
     2928                return speed ?
     2929                        this.animate({
     2930                                height: "show", width: "show", opacity: "show"
     2931                        }, speed, callback) :
     2932
     2933                        this.filter(":hidden").each(function(){
     2934                                this.style.display = this.oldblock || "";
     2935                                if ( jQuery.css(this,"display") == "none" ) {
     2936                                        var elem = jQuery("<" + this.tagName + " />").appendTo("body");
     2937                                        this.style.display = elem.css("display");
     2938                                        // handle an edge condition where css is - div { display:none; } or similar
     2939                                        if (this.style.display == "none")
     2940                                                this.style.display = "block";
     2941                                        elem.remove();
     2942                                }
     2943                        }).end();
     2944        },
     2945
     2946        hide: function(speed,callback){
     2947                return speed ?
     2948                        this.animate({
     2949                                height: "hide", width: "hide", opacity: "hide"
     2950                        }, speed, callback) :
     2951
     2952                        this.filter(":visible").each(function(){
     2953                                this.oldblock = this.oldblock || jQuery.css(this,"display");
     2954                                this.style.display = "none";
     2955                        }).end();
     2956        },
     2957
     2958        // Save the old toggle function
     2959        _toggle: jQuery.fn.toggle,
     2960
     2961        toggle: function( fn, fn2 ){
     2962                return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
     2963                        this._toggle.apply( this, arguments ) :
     2964                        fn ?
     2965                                this.animate({
     2966                                        height: "toggle", width: "toggle", opacity: "toggle"
     2967                                }, fn, fn2) :
     2968                                this.each(function(){
     2969                                        jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
     2970                                });
     2971        },
     2972
     2973        slideDown: function(speed,callback){
     2974                return this.animate({height: "show"}, speed, callback);
     2975        },
     2976
     2977        slideUp: function(speed,callback){
     2978                return this.animate({height: "hide"}, speed, callback);
     2979        },
     2980
     2981        slideToggle: function(speed, callback){
     2982                return this.animate({height: "toggle"}, speed, callback);
     2983        },
     2984
     2985        fadeIn: function(speed, callback){
     2986                return this.animate({opacity: "show"}, speed, callback);
     2987        },
     2988
     2989        fadeOut: function(speed, callback){
     2990                return this.animate({opacity: "hide"}, speed, callback);
     2991        },
     2992
     2993        fadeTo: function(speed,to,callback){
     2994                return this.animate({opacity: to}, speed, callback);
     2995        },
     2996
     2997        animate: function( prop, speed, easing, callback ) {
     2998                var optall = jQuery.speed(speed, easing, callback);
     2999
     3000                return this[ optall.queue === false ? "each" : "queue" ](function(){
     3001                        if ( this.nodeType != 1)
     3002                                return false;
     3003
     3004                        var opt = jQuery.extend({}, optall), p,
     3005                                hidden = jQuery(this).is(":hidden"), self = this;
     3006
     3007                        for ( p in prop ) {
     3008                                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
     3009                                        return opt.complete.call(this);
     3010
     3011                                if ( p == "height" || p == "width" ) {
     3012                                        // Store display property
     3013                                        opt.display = jQuery.css(this, "display");
     3014
     3015                                        // Make sure that nothing sneaks out
     3016                                        opt.overflow = this.style.overflow;
     3017                                }
     3018                        }
     3019
     3020                        if ( opt.overflow != null )
     3021                                this.style.overflow = "hidden";
     3022
     3023                        opt.curAnim = jQuery.extend({}, prop);
     3024
     3025                        jQuery.each( prop, function(name, val){
     3026                                var e = new jQuery.fx( self, opt, name );
     3027
     3028                                if ( /toggle|show|hide/.test(val) )
     3029                                        e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
     3030                                else {
     3031                                        var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
     3032                                                start = e.cur(true) || 0;
     3033
     3034                                        if ( parts ) {
     3035                                                var end = parseFloat(parts[2]),
     3036                                                        unit = parts[3] || "px";
     3037
     3038                                                // We need to compute starting value
     3039                                                if ( unit != "px" ) {
     3040                                                        self.style[ name ] = (end || 1) + unit;
     3041                                                        start = ((end || 1) / e.cur(true)) * start;
     3042                                                        self.style[ name ] = start + unit;
     3043                                                }
     3044
     3045                                                // If a +=/-= token was provided, we're doing a relative animation
     3046                                                if ( parts[1] )
     3047                                                        end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
     3048
     3049                                                e.custom( start, end, unit );
     3050                                        } else
     3051                                                e.custom( start, val, "" );
     3052                                }
     3053                        });
     3054
     3055                        // For JS strict compliance
     3056                        return true;
     3057                });
     3058        },
     3059
     3060        queue: function(type, fn){
     3061                if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
     3062                        fn = type;
     3063                        type = "fx";
     3064                }
     3065
     3066                if ( !type || (typeof type == "string" && !fn) )
     3067                        return queue( this[0], type );
     3068
     3069                return this.each(function(){
     3070                        if ( fn.constructor == Array )
     3071                                queue(this, type, fn);
     3072                        else {
     3073                                queue(this, type).push( fn );
     3074
     3075                                if ( queue(this, type).length == 1 )
     3076                                        fn.call(this);
     3077                        }
     3078                });
     3079        },
     3080
     3081        stop: function(clearQueue, gotoEnd){
     3082                var timers = jQuery.timers;
     3083
     3084                if (clearQueue)
     3085                        this.queue([]);
     3086
     3087                this.each(function(){
     3088                        // go in reverse order so anything added to the queue during the loop is ignored
     3089                        for ( var i = timers.length - 1; i >= 0; i-- )
     3090                                if ( timers[i].elem == this ) {
     3091                                        if (gotoEnd)
     3092                                                // force the next step to be the last
     3093                                                timers[i](true);
     3094                                        timers.splice(i, 1);
     3095                                }
     3096                });
     3097
     3098                // start the next in the queue if the last step wasn't forced
     3099                if (!gotoEnd)
     3100                        this.dequeue();
     3101
     3102                return this;
     3103        }
     3104
     3105});
     3106
     3107var queue = function( elem, type, array ) {
     3108        if ( elem ){
     3109
     3110                type = type || "fx";
     3111
     3112                var q = jQuery.data( elem, type + "queue" );
     3113
     3114                if ( !q || array )
     3115                        q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );
     3116
     3117        }
     3118        return q;
     3119};
     3120
     3121jQuery.fn.dequeue = function(type){
     3122        type = type || "fx";
     3123
     3124        return this.each(function(){
     3125                var q = queue(this, type);
     3126
     3127                q.shift();
     3128
     3129                if ( q.length )
     3130                        q[0].call( this );
     3131        });
     3132};
     3133
     3134jQuery.extend({
     3135
     3136        speed: function(speed, easing, fn) {
     3137                var opt = speed && speed.constructor == Object ? speed : {
     3138                        complete: fn || !fn && easing ||
     3139                                jQuery.isFunction( speed ) && speed,
     3140                        duration: speed,
     3141                        easing: fn && easing || easing && easing.constructor != Function && easing
     3142                };
     3143
     3144                opt.duration = (opt.duration && opt.duration.constructor == Number ?
     3145                        opt.duration :
     3146                        jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;
     3147
     3148                // Queueing
     3149                opt.old = opt.complete;
     3150                opt.complete = function(){
     3151                        if ( opt.queue !== false )
     3152                                jQuery(this).dequeue();
     3153                        if ( jQuery.isFunction( opt.old ) )
     3154                                opt.old.call( this );
     3155                };
     3156
     3157                return opt;
     3158        },
     3159
     3160        easing: {
     3161                linear: function( p, n, firstNum, diff ) {
     3162                        return firstNum + diff * p;
     3163                },
     3164                swing: function( p, n, firstNum, diff ) {
     3165                        return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
     3166                }
     3167        },
     3168
     3169        timers: [],
     3170        timerId: null,
     3171
     3172        fx: function( elem, options, prop ){
     3173                this.options = options;
     3174                this.elem = elem;
     3175                this.prop = prop;
     3176
     3177                if ( !options.orig )
     3178                        options.orig = {};
     3179        }
     3180
     3181});
     3182
     3183jQuery.fx.prototype = {
     3184
     3185        // Simple function for setting a style value
     3186        update: function(){
     3187                if ( this.options.step )
     3188                        this.options.step.call( this.elem, this.now, this );
     3189
     3190                (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
     3191
     3192                // Set display property to block for height/width animations
     3193                if ( this.prop == "height" || this.prop == "width" )
     3194                        this.elem.style.display = "block";
     3195        },
     3196
     3197        // Get the current size
     3198        cur: function(force){
     3199                if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
     3200                        return this.elem[ this.prop ];
     3201
     3202                var r = parseFloat(jQuery.css(this.elem, this.prop, force));
     3203                return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
     3204        },
     3205
     3206        // Start an animation from one number to another
     3207        custom: function(from, to, unit){
     3208                this.startTime = now();
     3209                this.start = from;
     3210                this.end = to;
     3211                this.unit = unit || this.unit || "px";
     3212                this.now = this.start;
     3213                this.pos = this.state = 0;
     3214                this.update();
     3215
     3216                var self = this;
     3217                function t(gotoEnd){
     3218                        return self.step(gotoEnd);
     3219                }
     3220
     3221                t.elem = this.elem;
     3222
     3223                jQuery.timers.push(t);
     3224
     3225                if ( jQuery.timerId == null ) {
     3226                        jQuery.timerId = setInterval(function(){
     3227                                var timers = jQuery.timers;
     3228
     3229                                for ( var i = 0; i < timers.length; i++ )
     3230                                        if ( !timers[i]() )
     3231                                                timers.splice(i--, 1);
     3232
     3233                                if ( !timers.length ) {
     3234                                        clearInterval( jQuery.timerId );
     3235                                        jQuery.timerId = null;
     3236                                }
     3237                        }, 13);
     3238                }
     3239        },
     3240
     3241        // Simple 'show' function
     3242        show: function(){
     3243                // Remember where we started, so that we can go back to it later
     3244                this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
     3245                this.options.show = true;
     3246
     3247                // Begin the animation
     3248                this.custom(0, this.cur());
     3249
     3250                // Make sure that we start at a small width/height to avoid any
     3251                // flash of content
     3252                if ( this.prop == "width" || this.prop == "height" )
     3253                        this.elem.style[this.prop] = "1px";
     3254
     3255                // Start by showing the element
     3256                jQuery(this.elem).show();
     3257        },
     3258
     3259        // Simple 'hide' function
     3260        hide: function(){
     3261                // Remember where we started, so that we can go back to it later
     3262                this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
     3263                this.options.hide = true;
     3264
     3265                // Begin the animation
     3266                this.custom(this.cur(), 0);
     3267        },
     3268
     3269        // Each step of an animation
     3270        step: function(gotoEnd){
     3271                var t = now();
     3272
     3273                if ( gotoEnd || t > this.options.duration + this.startTime ) {
     3274                        this.now = this.end;
     3275                        this.pos = this.state = 1;
     3276                        this.update();
     3277
     3278                        this.options.curAnim[ this.prop ] = true;
     3279
     3280                        var done = true;
     3281                        for ( var i in this.options.curAnim )
     3282                                if ( this.options.curAnim[i] !== true )
     3283                                        done = false;
     3284
     3285                        if ( done ) {
     3286                                if ( this.options.display != null ) {
     3287                                        // Reset the overflow
     3288                                        this.elem.style.overflow = this.options.overflow;
     3289
     3290                                        // Reset the display
     3291                                        this.elem.style.display = this.options.display;
     3292                                        if ( jQuery.css(this.elem, "display") == "none" )
     3293                                                this.elem.style.display = "block";
     3294                                }
     3295
     3296                                // Hide the element if the "hide" operation was done
     3297                                if ( this.options.hide )
     3298                                        this.elem.style.display = "none";
     3299
     3300                                // Reset the properties, if the item has been hidden or shown
     3301                                if ( this.options.hide || this.options.show )
     3302                                        for ( var p in this.options.curAnim )
     3303                                                jQuery.attr(this.elem.style, p, this.options.orig[p]);
     3304                        }
     3305
     3306                        if ( done )
     3307                                // Execute the complete function
     3308                                this.options.complete.call( this.elem );
     3309
     3310                        return false;
     3311                } else {
     3312                        var n = t - this.startTime;
     3313                        this.state = n / this.options.duration;
     3314
     3315                        // Perform the easing function, defaults to swing
     3316                        this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
     3317                        this.now = this.start + ((this.end - this.start) * this.pos);
     3318
     3319                        // Perform the next step of the animation
     3320                        this.update();
     3321                }
     3322
     3323                return true;
     3324        }
     3325
     3326};
     3327
     3328jQuery.extend( jQuery.fx, {
     3329        speeds:{
     3330                slow: 600,
     3331                fast: 200,
     3332                // Default speed
     3333                def: 400
     3334        },
     3335        step: {
     3336                scrollLeft: function(fx){
     3337                        fx.elem.scrollLeft = fx.now;
     3338                },
     3339
     3340                scrollTop: function(fx){
     3341                        fx.elem.scrollTop = fx.now;
     3342                },
     3343
     3344                opacity: function(fx){
     3345                        jQuery.attr(fx.elem.style, "opacity", fx.now);
     3346                },
     3347
     3348                _default: function(fx){
     3349                        fx.elem.style[ fx.prop ] = fx.now + fx.unit;
     3350                }
     3351        }
     3352});
     3353// The Offset Method
     3354// Originally By Brandon Aaron, part of the Dimension Plugin
     3355// http://jquery.com/plugins/project/dimensions
     3356jQuery.fn.offset = function() {
     3357        var left = 0, top = 0, elem = this[0], results;
     3358
     3359        if ( elem ) with ( jQuery.browser ) {
     3360                var parent       = elem.parentNode,
     3361                    offsetChild  = elem,
     3362                    offsetParent = elem.offsetParent,
     3363                    doc          = elem.ownerDocument,
     3364                    safari2      = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
     3365                    css          = jQuery.curCSS,
     3366                    fixed        = css(elem, "position") == "fixed";
     3367
     3368                // Use getBoundingClientRect if available
     3369                if ( elem.getBoundingClientRect ) {
     3370                        var box = elem.getBoundingClientRect();
     3371
     3372                        // Add the document scroll offsets
     3373                        add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
     3374                                box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
     3375
     3376                        // IE adds the HTML element's border, by default it is medium which is 2px
     3377                        // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
     3378                        // IE 7 standards mode, the border is always 2px
     3379                        // This border/offset is typically represented by the clientLeft and clientTop properties
     3380                        // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
     3381                        // Therefore this method will be off by 2px in IE while in quirksmode
     3382                        add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
     3383
     3384                // Otherwise loop through the offsetParents and parentNodes
     3385                } else {
     3386
     3387                        // Initial element offsets
     3388                        add( elem.offsetLeft, elem.offsetTop );
     3389
     3390                        // Get parent offsets
     3391                        while ( offsetParent ) {
     3392                                // Add offsetParent offsets
     3393                                add( offsetParent.offsetLeft, offsetParent.offsetTop );
     3394
     3395                                // Mozilla and Safari > 2 does not include the border on offset parents
     3396                                // However Mozilla adds the border for table or table cells
     3397                                if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
     3398                                        border( offsetParent );
     3399
     3400                                // Add the document scroll offsets if position is fixed on any offsetParent
     3401                                if ( !fixed && css(offsetParent, "position") == "fixed" )
     3402                                        fixed = true;
     3403
     3404                                // Set offsetChild to previous offsetParent unless it is the body element
     3405                                offsetChild  = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
     3406                                // Get next offsetParent
     3407                                offsetParent = offsetParent.offsetParent;
     3408                        }
     3409
     3410                        // Get parent scroll offsets
     3411                        while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
     3412                                // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
     3413                                if ( !/^inline|table.*$/i.test(css(parent, "display")) )
     3414                                        // Subtract parent scroll offsets
     3415                                        add( -parent.scrollLeft, -parent.scrollTop );
     3416
     3417                                // Mozilla does not add the border for a parent that has overflow != visible
     3418                                if ( mozilla && css(parent, "overflow") != "visible" )
     3419                                        border( parent );
     3420
     3421                                // Get next parent
     3422                                parent = parent.parentNode;
     3423                        }
     3424
     3425                        // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
     3426                        // Mozilla doubles body offsets with a non-absolutely positioned offsetChild
     3427                        if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) ||
     3428                                (mozilla && css(offsetChild, "position") != "absolute") )
     3429                                        add( -doc.body.offsetLeft, -doc.body.offsetTop );
     3430
     3431                        // Add the document scroll offsets if position is fixed
     3432                        if ( fixed )
     3433                                add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
     3434                                        Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
     3435                }
     3436
     3437                // Return an object with top and left properties
     3438                results = { top: top, left: left };
     3439        }
     3440
     3441        function border(elem) {
     3442                add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
     3443        }
     3444
     3445        function add(l, t) {
     3446                left += parseInt(l, 10) || 0;
     3447                top += parseInt(t, 10) || 0;
     3448        }
     3449
     3450        return results;
     3451};
     3452
     3453
     3454jQuery.fn.extend({
     3455        position: function() {
     3456                var left = 0, top = 0, results;
     3457
     3458                if ( this[0] ) {
     3459                        // Get *real* offsetParent
     3460                        var offsetParent = this.offsetParent(),
     3461
     3462                        // Get correct offsets
     3463                        offset       = this.offset(),
     3464                        parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
     3465
     3466                        // Subtract element margins
     3467                        // note: when an element has margin: auto the offsetLeft and marginLeft
     3468                        // are the same in Safari causing offset.left to incorrectly be 0
     3469                        offset.top  -= num( this, 'marginTop' );
     3470                        offset.left -= num( this, 'marginLeft' );
     3471
     3472                        // Add offsetParent borders
     3473                        parentOffset.top  += num( offsetParent, 'borderTopWidth' );
     3474                        parentOffset.left += num( offsetParent, 'borderLeftWidth' );
     3475
     3476                        // Subtract the two offsets
     3477                        results = {
     3478                                top:  offset.top  - parentOffset.top,
     3479                                left: offset.left - parentOffset.left
     3480                        };
     3481                }
     3482
     3483                return results;
     3484        },
     3485
     3486        offsetParent: function() {
     3487                var offsetParent = this[0].offsetParent;
     3488                while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
     3489                        offsetParent = offsetParent.offsetParent;
     3490                return jQuery(offsetParent);
     3491        }
     3492});
     3493
     3494
     3495// Create scrollLeft and scrollTop methods
     3496jQuery.each( ['Left', 'Top'], function(i, name) {
     3497        var method = 'scroll' + name;
     3498       
     3499        jQuery.fn[ method ] = function(val) {
     3500                if (!this[0]) return;
     3501
     3502                return val != undefined ?
     3503
     3504                        // Set the scroll offset
     3505                        this.each(function() {
     3506                                this == window || this == document ?
     3507                                        window.scrollTo(
     3508                                                !i ? val : jQuery(window).scrollLeft(),
     3509                                                 i ? val : jQuery(window).scrollTop()
     3510                                        ) :
     3511                                        this[ method ] = val;
     3512                        }) :
     3513
     3514                        // Return the scroll offset
     3515                        this[0] == window || this[0] == document ?
     3516                                self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
     3517                                        jQuery.boxModel && document.documentElement[ method ] ||
     3518                                        document.body[ method ] :
     3519                                this[0][ method ];
     3520        };
     3521});
     3522// Create innerHeight, innerWidth, outerHeight and outerWidth methods
     3523jQuery.each([ "Height", "Width" ], function(i, name){
     3524
     3525        var tl = i ? "Left"  : "Top",  // top or left
     3526                br = i ? "Right" : "Bottom"; // bottom or right
     3527
     3528        // innerHeight and innerWidth
     3529        jQuery.fn["inner" + name] = function(){
     3530                return this[ name.toLowerCase() ]() +
     3531                        num(this, "padding" + tl) +
     3532                        num(this, "padding" + br);
     3533        };
     3534
     3535        // outerHeight and outerWidth
     3536        jQuery.fn["outer" + name] = function(margin) {
     3537                return this["inner" + name]() +
     3538                        num(this, "border" + tl + "Width") +
     3539                        num(this, "border" + br + "Width") +
     3540                        (margin ?
     3541                                num(this, "margin" + tl) + num(this, "margin" + br) : 0);
     3542        };
     3543
     3544});})();
  • wp-includes/script-loader.php

     
    7272
    7373        $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
    7474
    75         $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.3');
     75        $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.5');
    7676        $scripts->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '2.02');
    7777        $scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.js', array('jquery'), '2.0-4561');
    7878        $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' );
     
    109109
    110110        $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.5b4' );
    111111        $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.5b4' );
     112        $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.5b4' );
    112113
    113114        if ( is_admin() ) {
    114115                $scripts->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' );
     
    164165                        'cancel' => __('Cancel'),
    165166                        'edit' => __('Edit'),
    166167                ) );
     168                $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' );
    167169                $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' );
    168170                $scripts->localize( 'upload', 'uploadL10n', array(
    169171                        'browseTitle' => attribute_escape(__('Browse your files')),
  • wp-admin/includes/media.php

     
    199199                        $post['post_title'] = $attachment['post_title'];
    200200                if ( isset($attachment['post_excerpt']) )
    201201                        $post['post_excerpt'] = $attachment['post_excerpt'];
     202                if ( isset($attachment['menu_order']) )
     203                        $post['menu_order'] = $attachment['menu_order'];
    202204
    203205                $post = apply_filters('attachment_fields_to_save', $post, $attachment);
    204206
     
    399401                        $errors = $return;
    400402        }
    401403
     404        wp_enqueue_script('admin-gallery');
    402405        return wp_iframe( 'media_upload_gallery_form', $errors );
    403406}
    404407
     
    535538                                </script>\n",
    536539                        'helps'      => __('Enter a link URL or click above for presets.'),
    537540                ),
     541        'menu_order'   => array(
     542                        'label'      => __('Order'),
     543                        'value'      => $edit_post->menu_order
     544                ),
    538545        );
    539546
    540547        foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
  • wp-admin/js/gallery.js

     
     1jQuery(function($) {
     2        var gallerySortable;
     3        var gallerySortableInit = function() {
     4                gallerySortable = $('#media-items').sortable( {
     5                        items: '.media-item',
     6                        placeholder: 'sorthelper',
     7                        update: galleryReorder
     8                } );
     9        }
     10
     11        // When an update has occurred, adjust the order for each item
     12        var galleryReorder = function(e, sort) {
     13                jQuery.each(sort['instance'].toArray(), function(i, id) {
     14                        jQuery('#' + id + ' .menu_order input')[0].value = i;
     15                });
     16        }
     17
     18        // initialize sortable
     19        gallerySortableInit();
     20});
  • wp-admin/css/colors-fresh.css

     
    6363        color: #000;
    6464}
    6565
    66 ul.widget-control-list .sorthelper {
     66.sorthelper {
    6767        background-color: #ccf3fa;
    6868}
    6969
  • wp-admin/css/media.css

     
    216216}
    217217
    218218#media-upload .media-item {
     219        cursor:move;
    219220        position: relative;
    220221        border-bottom-width: 1px;
    221222        border-bottom-style: solid;
  • wp-admin/css/colors-classic.css

     
    6363        color: #000;
    6464}
    6565
    66 ul.widget-control-list .sorthelper {
     66.sorthelper {
    6767        background-color: #ccf3fa;
    6868}
    6969